mirror of
https://gitlab.com/skysthelimit.dev/selenite.git
synced 2025-06-15 18:12:08 -05:00
8 lines
80 KiB
JavaScript
8 lines
80 KiB
JavaScript
/*
|
|
* Project: @gamedistribution.com/html5-sdk
|
|
* Description: GameDistribution.com HTML5 SDK
|
|
* Development By: GameDistribution.com
|
|
* Copyright(c): 2019
|
|
* Version: 1.2.15 (29-05-2019 12:59)
|
|
*/
|
|
!function e(t,n,o){function i(s,a){if(!n[s]){if(!t[s]){var d="function"==typeof require&&require;if(!a&&d)return d(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n||e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(e,t,n){"use strict";t.exports=e("./").polyfill()},{"./":2}],2:[function(e,t,n){(function(o,i){!function(e,o){"object"==typeof n&&void 0!==t?t.exports=o():"function"==typeof define&&define.amd?define(o):e.ES6Promise=o()}(this,function(){"use strict";function t(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function n(e){return"function"==typeof e}function r(){return void 0!==B?function(){B(a)}:s()}function s(){var e=setTimeout;return function(){return e(a,1)}}function a(){for(var e=0;e<O;e+=2)(0,H[e])(H[e+1]),H[e]=void 0,H[e+1]=void 0;O=0}function d(e,t){var n=this,o=new this.constructor(u);void 0===o[z]&&R(o);var i=n._state;if(i){var r=arguments[i-1];N(function(){return T(i,o,r,n._result)})}else A(n,o,e,t);return o}function c(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(u);return v(n,e),n}function u(){}function l(){return new TypeError("You cannot resolve a promise with itself")}function h(){return new TypeError("A promises callback cannot return that same promise.")}function g(e){try{return e.then}catch(e){return W.error=e,W}}function f(e,t,n,o){try{e.call(t,n,o)}catch(e){return e}}function p(e,t,n){N(function(e){var o=!1,i=f(n,t,function(n){o||(o=!0,t!==n?v(e,n):_(e,n))},function(t){o||(o=!0,E(e,t))},"Settle: "+(e._label||" unknown promise"));!o&&i&&(o=!0,E(e,i))},e)}function m(e,t){t._state===Q?_(e,t._result):t._state===V?E(e,t._result):A(t,void 0,function(t){return v(e,t)},function(t){return E(e,t)})}function b(e,t,o){t.constructor===e.constructor&&o===d&&t.constructor.resolve===c?m(e,t):o===W?(E(e,W.error),W.error=null):void 0===o?_(e,t):n(o)?p(e,t,o):_(e,t)}function v(e,n){e===n?E(e,l()):t(n)?b(e,n,g(n)):_(e,n)}function y(e){e._onerror&&e._onerror(e._result),w(e)}function _(e,t){e._state===Y&&(e._result=t,e._state=Q,0!==e._subscribers.length&&N(w,e))}function E(e,t){e._state===Y&&(e._state=V,e._result=t,N(y,e))}function A(e,t,n,o){var i=e._subscribers,r=i.length;e._onerror=null,i[r]=t,i[r+Q]=n,i[r+V]=o,0===r&&e._state&&N(w,e)}function w(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var o=void 0,i=void 0,r=e._result,s=0;s<t.length;s+=3)o=t[s],i=t[s+n],o?T(n,o,i,r):i(r);e._subscribers.length=0}}function D(e,t){try{return e(t)}catch(e){return W.error=e,W}}function T(e,t,o,i){var r=n(o),s=void 0,a=void 0,d=void 0,c=void 0;if(r){if((s=D(o,i))===W?(c=!0,a=s.error,s.error=null):d=!0,t===s)return void E(t,h())}else s=i,d=!0;t._state!==Y||(r&&d?v(t,s):c?E(t,a):e===Q?_(t,s):e===V&&E(t,s))}function S(e,t){try{t(function(t){v(e,t)},function(t){E(e,t)})}catch(t){E(e,t)}}function C(){return J++}function R(e){e[z]=J++,e._state=void 0,e._result=void 0,e._subscribers=[]}function I(){return new Error("Array Methods must be provided an Array")}function x(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function k(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var P=void 0,L=P=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},O=0,B=void 0,M=void 0,N=function(e,t){H[O]=e,H[O+1]=t,2===(O+=2)&&(M?M(a):F())},U="undefined"!=typeof window?window:void 0,G=U||{},K=G.MutationObserver||G.WebKitMutationObserver,j="undefined"==typeof self&&void 0!==o&&"[object process]"==={}.toString.call(o),q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,H=new Array(1e3),F=void 0;F=j?function(){return o.nextTick(a)}:K?function(){var e=0,t=new K(a),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}():q?function(){var e=new MessageChannel;return e.port1.onmessage=a,function(){return e.port2.postMessage(0)}}():void 0===U&&"function"==typeof e?function(){try{var e=Function("return this")().require("vertx");return B=e.runOnLoop||e.runOnContext,r()}catch(e){return s()}}():s();var z=Math.random().toString(36).substring(2),Y=void 0,Q=1,V=2,W={error:null},J=0,X=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(u),this.promise[z]||R(this.promise),L(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?_(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&_(this.promise,this._result))):E(this.promise,I())}return e.prototype._enumerate=function(e){for(var t=0;this._state===Y&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,o=n.resolve;if(o===c){var i=g(e);if(i===d&&e._state!==Y)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===Z){var r=new n(u);b(r,e,i),this._willSettleAt(r,t)}else this._willSettleAt(new n(function(t){return t(e)}),t)}else this._willSettleAt(o(e),t)},e.prototype._settledAt=function(e,t,n){var o=this.promise;o._state===Y&&(this._remaining--,e===V?E(o,n):this._result[t]=n),0===this._remaining&&_(o,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;A(e,void 0,function(e){return n._settledAt(Q,t,e)},function(e){return n._settledAt(V,t,e)})},e}(),Z=function(){function e(t){this[z]=C(),this._result=this._state=void 0,this._subscribers=[],u!==t&&("function"!=typeof t&&x(),this instanceof e?S(this,t):k())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var t=this,n=t.constructor;return t.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){throw t})})},e}();return Z.prototype.then=d,Z.all=function(e){return new X(this,e).promise},Z.race=function(e){var t=this;return new t(L(e)?function(n,o){for(var i=e.length,r=0;r<i;r++)t.resolve(e[r]).then(n,o)}:function(e,t){return t(new TypeError("You must pass an array to race."))})},Z.resolve=c,Z.reject=function(e){var t=new this(u);return E(t,e),t},Z._setScheduler=function(e){M=e},Z._setAsap=function(e){N=e},Z._asap=N,Z.polyfill=function(){var e=void 0;if(void 0!==i)e=i;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=Z},Z.Promise=Z,Z})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:4}],3:[function(require,module,exports){(function(global){!function(e,t){"object"==typeof exports&&void 0!==module?module.exports=t(e):"function"==typeof define&&define.amd?define(t):t(e)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==global?global:this,function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.1",buffer;if(void 0!==module&&module.exports)try{buffer=eval("require('buffer').Buffer")}catch(e){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(e){for(var t={},n=0,o=e.length;n<o;n++)t[e.charAt(n)]=n;return t}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?fromCharCode(192|t>>>6)+fromCharCode(128|63&t):fromCharCode(224|t>>>12&15)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|t>>>18&7)+fromCharCode(128|t>>>12&63)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(e){return e.replace(re_utob,cb_utob)},cb_encode=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[b64chars.charAt(n>>>18),b64chars.charAt(n>>>12&63),t>=2?"=":b64chars.charAt(n>>>6&63),t>=1?"=":b64chars.charAt(63&n)].join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e)).toString("base64")}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e)).toString("base64")}:function(e){return btoa(utob(e))},encode=function(e,t){return t?_encode(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):_encode(String(e))},encodeURI=function(e){return encode(e,!0)},re_btou=new RegExp(["[À-ß][€-¿]","[à -ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),cb_btou=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return fromCharCode(55296+(t>>>10))+fromCharCode(56320+(1023&t));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function(e){return e.replace(re_btou,cb_btou)},cb_decode=function(e){var t=e.length,n=t%4,o=(t>0?b64tab[e.charAt(0)]<<18:0)|(t>1?b64tab[e.charAt(1)]<<12:0)|(t>2?b64tab[e.charAt(2)]<<6:0)|(t>3?b64tab[e.charAt(3)]:0),i=[fromCharCode(o>>>16),fromCharCode(o>>>8&255),fromCharCode(255&o)];return i.length-=[0,0,2,1][n],i.join("")},_atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/\S{1,4}/g,cb_decode)},atob=function(e){return _atob(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(_atob(e))},decode=function(e){return _decode(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var e=global.Base64;return global.Base64=_Base64,e};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"==typeof Object.defineProperty){var noEnum=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(e){return encode(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global.Meteor&&(Base64=global.Base64),void 0!==module&&module.exports?module.exports.Base64=global.Base64:"function"==typeof define&&define.amd&&define([],function(){return global.Base64}),{Base64:global.Base64}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,n){function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(e){if(l===setTimeout)return setTimeout(e,0);if((l===o||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(h===clearTimeout)return clearTimeout(e);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function a(){m&&f&&(m=!1,f.length?p=f.concat(p):b=-1,p.length&&d())}function d(){if(!m){var e=r(a);m=!0;for(var t=p.length;t;){for(f=p,p=[];++b<t;)f&&f[b].run();b=-1,t=p.length}f=null,m=!1,s(e)}}function c(e,t){this.fun=e,this.array=t}function u(){}var l,h,g=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:o}catch(e){l=o}try{h="function"==typeof clearTimeout?clearTimeout:i}catch(e){h=i}}();var f,p=[],m=!1,b=-1;g.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new c(e,t)),1!==p.length||m||r(d)},c.prototype.run=function(){this.fun.apply(null,this.array)},g.title="browser",g.browser=!0,g.env={},g.argv=[],g.version="",g.versions={},g.on=u,g.addListener=u,g.once=u,g.off=u,g.removeListener=u,g.removeAllListeners=u,g.emit=u,g.prependListener=u,g.prependOnceListener=u,g.listeners=function(e){return[]},g.binding=function(e){throw new Error("process.binding is not supported")},g.cwd=function(){return"/"},g.chdir=function(e){throw new Error("process.chdir is not supported")},g.umask=function(){return 0}},{}],5:[function(e,t,n){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return b.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?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 r(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function s(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function a(e){var t=new FileReader,n=s(t);return t.readAsArrayBuffer(e),n}function d(e){var t=new FileReader,n=s(t);return t.readAsText(e),n}function c(e){for(var t=new Uint8Array(e),n=new Array(t.length),o=0;o<t.length;o++)n[o]=String.fromCharCode(t[o]);return n.join("")}function u(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(b.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(b.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(b.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(b.arrayBuffer&&b.blob&&y(e))this._bodyArrayBuffer=u(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!b.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!_(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=u(e)}else 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):b.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},b.blob&&(this.blob=function(){var e=r(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(){return this._bodyArrayBuffer?r(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(a)}),this.text=function(){var e=r(this);if(e)return e;if(this._bodyBlob)return d(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(c(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},b.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}function h(e){var t=e.toUpperCase();return E.indexOf(t)>-1?t:e}function g(e,t){var n=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=h(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),o=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(o),decodeURIComponent(i))}}),t}function p(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),o=n.shift().trim();if(o){var i=n.join(":").trim();t.append(o,i)}}),t}function m(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var b={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(b.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=function(e){return e&&DataView.prototype.isPrototypeOf(e)},_=ArrayBuffer.isView||function(e){return e&&v.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,o){e=t(e),o=n(o);var i=this.map[e];this.map[e]=i?i+","+o:o},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,o){this.map[t(e)]=n(o)},i.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),o(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),o(e)},b.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},l.call(g.prototype),l.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var A=[301,302,303,307,308];m.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=g,e.Response=m,e.fetch=function(e,t){return new Promise(function(n,o){var i=new g(e,t),r=new XMLHttpRequest;r.onload=function(){var e={status:r.status,statusText:r.statusText,headers:p(r.getAllResponseHeaders()||"")};e.url="responseURL"in r?r.responseURL:e.headers.get("X-Request-URL");var t="response"in r?r.response:r.responseText;n(new m(t,e))},r.onerror=function(){o(new TypeError("Network request failed"))},r.ontimeout=function(){o(new TypeError("Network request failed"))},r.open(i.method,i.url,!0),"include"===i.credentials&&(r.withCredentials=!0),"responseType"in r&&b.blob&&(r.responseType="blob"),i.headers.forEach(function(e,t){r.setRequestHeader(t,e)}),r.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},{}],6:[function(e,t,n){t.exports={name:"@gamedistribution.com/html5-sdk",version:"1.2.15",author:"GameDistribution.com",description:"GameDistribution.com HTML5 SDK",url:"https://gamedistribution.com",license:"MIT",main:"lib/main.js",scripts:{test:'echo "Error: no test specified" && exit 1'},directories:{doc:"https://github.com/GameDistribution/GD-HTML5/wiki"},repository:{type:"git",url:"git@github.com:GameDistribution/GD-HTML5.git"},dependencies:{"es6-promise":"^4.1.1","js-base64":"^2.5.1","whatwg-fetch":"^2.0.3"},devDependencies:{"babel-eslint":"^8.0.0","babel-preset-env":"^1.6.1",babelify:"^7.2.0",eslint:"^4.7.0","eslint-config-google":"^0.9.1","eslint-friendly-formatter":"^3.0.0","eslint-loader":"^1.7.1","eslint-plugin-html":"^3.0.0","eslint-plugin-promise":"^3.4.0","eslint-plugin-standard":"^2.0.1",grunt:"^1.0.4","grunt-banner":"^0.6.0","grunt-browser-sync":"^2.2.0","grunt-browserify":"^5.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^3.1.0","grunt-contrib-watch":"^1.0.0","grunt-exec":"^3.0.0","grunt-google-cloud":"^1.0.7"},engines:{node:">= 10.15.0",npm:">= 6.6.0"}}},{}],7:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=null,s=function(){function e(){if(o(this,e),r)return r;r=this,this.listeners={}}return i(e,[{key:"_getListenerIdx",value:function(e,t,n){var o=this.listeners[e],i=void 0,r=-1;if(!o||0===o.length)return r;for(i=0;i<o.length;i++)if(o[i].callback===t&&(!n||n===o[i].scope)){r=i;break}return r}},{key:"subscribe",value:function(e,t,n){var o=void 0;if(!e)throw new Error("Event name cannot be null or undefined.");if(!t||"function"!=typeof t)throw new Error("Listener must be of type function.");this._getListenerIdx(e,t,n)>=0||(o={callback:t,scope:n},this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(o))}},{key:"broadcast",value:function(e,t){var n=this.listeners[e];e&&this.listeners[e]&&(t=t||{},n.forEach(function(e){e.callback.call(e.scope,t)}))}}]),e}();n.default=s},{}],8:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(e("../components/EventBus")),s=null,a=function(){function e(t){if(o(this,e),s)return s;s=this,this.testing=t,this.eventBus=new r.default}return i(e,[{key:"start",value:function(){var e="\n #gdsdk__implementation {\n display: flex;\n box-sizing: border-box;\n position: fixed;\n z-index: 667;\n bottom: 0;\n left: 0;\n width: 100%;\n padding: 3px;\n background: linear-gradient(90deg,#3d1b5d,#5c3997);\n box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);\n color: #fff;\n font-family: Helvetica, Arial, sans-serif;\n font-size: 8px;\n }\n #gdsdk__implementation button {\n flex: 1;\n background: #44a5ab;\n padding: 3px 10px;\n margin: 2px;\n border: 0;\n border-radius: 3px;\n color: #fff;\n outline: 0;\n cursor: pointer;\n font-size: 8px;\n box-shadow: 0 0 0 transparent;\n text-shadow: 0 0 0 transparent;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n #gdsdk__implementation button:hover {\n background: #4fb3b9;\n }\n #gdsdk__implementation button:active {\n background: #62bbc0;\n }\n ",t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n);var o=document.body||document.getElementsByTagName("body")[0],i=document.createElement("div");i.style.position="fixed",i.style.zIndex="668",i.style.bottom="0",i.innerHTML='\n <div id="gdsdk__implementation">\n <button id="gdsdk__hbgdDebug">Activate hbgd debug</button>\n <button id="gdsdk__hbgdConfig">Log idhbgd config</button>\n <button id="gdsdk__resumeGame">resumeGame</button>\n <button id="gdsdk__pauseGame">pauseGame</button>\n <button id="gdsdk__showBanner">showBanner()</button>\n <button id="gdsdk__cancel">Cancel</button>\n <button id="gdsdk__demo">Demo VAST tag</button>\n <button id="gdsdk__midrollTimer">Disable delay</button>\n <button id="gdsdk__closeDebug">Close</button>\n </div>\n ',o.appendChild(i);var r=document.getElementById("gdsdk__pauseGame"),s=document.getElementById("gdsdk__resumeGame"),a=document.getElementById("gdsdk__showBanner"),d=document.getElementById("gdsdk__cancel"),c=document.getElementById("gdsdk__demo"),u=document.getElementById("gdsdk__midrollTimer"),l=document.getElementById("gdsdk__hbgdDebug"),h=document.getElementById("gdsdk__hbgdConfig"),g=document.getElementById("gdsdk__closeDebug");localStorage.getItem("gd_tag")?(c.innerHTML="Revert Vast tag",c.style.background="#ff8c1c"):(c.innerHTML="Demo VAST tag",c.style.background="#44a5ab"),localStorage.getItem("gd_midroll")?(u.innerHTML="Revert delay",u.style.background="#ff8c1c"):(u.innerHTML="Disable delay",u.style.background="#44a5ab"),r.addEventListener("click",function(){window.gdsdk.onPauseGame("Pause game requested from debugger","warning")}),s.addEventListener("click",function(){window.gdsdk.onResumeGame("Resume game requested from debugger","warning")}),a.addEventListener("click",function(){window.gdsdk.showBanner()}),d.addEventListener("click",function(){window.gdsdk.videoAdInstance.requestAttempts=0,window.gdsdk.videoAdInstance.cancel()}),c.addEventListener("click",function(){try{if(localStorage.getItem("gd_tag"))localStorage.removeItem("gd_tag");else{localStorage.setItem("gd_tag","https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=")}location.reload()}catch(e){console.log(e)}}),u.addEventListener("click",function(){try{localStorage.getItem("gd_midroll")?localStorage.removeItem("gd_midroll"):localStorage.setItem("gd_midroll","0"),location.reload()}catch(e){console.log(e)}}),g.addEventListener("click",function(){try{localStorage.getItem("gd_debug")?localStorage.removeItem("gd_debug"):localStorage.setItem("gd_debug","0"),location.reload()}catch(e){console.log(e)}}),l.addEventListener("click",function(){try{window.idhbgd.debug(!0)}catch(e){console.log(e)}}),h.addEventListener("click",function(){try{var e=window.idhbgd.getConfig();console.info(e)}catch(e){console.log(e)}})}}]),e}();n.default=a},{"../components/EventBus":7}],9:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();e("whatwg-fetch");var r=e("js-base64"),s=function(){function e(t){o(this,e),this._config=t||{},this._url=t.url||"https://msgrt.gamedistribution.com/collect"}return i(e,[{key:"send",value:function(e,t){var n=[this._config.gameId,this._config.parentDomain,this._config.hours];t&&t.length>0&&t.forEach(function(e){return n.push(e)}),n=encodeURIComponent(r.Base64.encode(JSON.stringify(n))),fetch(this._url+"?tp=com.gdsdk."+e+"&ar="+n+"&ts="+Date.now())}}]),e}();n.default=s},{"js-base64":3,"whatwg-fetch":5}],10:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(e("../components/EventBus")),s=e("../modules/common"),a=e("../modules/dankLog"),d=null,c=function(){function e(t,n,i){var a=this;if(o(this,e),d)return d;d=this;var c={debug:!1,width:640,height:360,locale:"en"};this.options=i?(0,s.extendDefaults)(c,i):c,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new r.default,this.safetyTimer=null,this.containerTransitionSpeed=300,this.adCount=0,this.adTypeCount=0,this.requestRunning=!1,this.parentDomain=(0,s.getParentDomain)(),this.parentUrl=(0,s.getParentUrl)(),this.maxPrerollCount=1,this.requestedPrerollCount=0,this.requestedMidrollCount=0,this.canRequestPreroll=function(){return a.requestedPrerollCount<a.maxPrerollCount},this.userDeclinedPersonalAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"1":"0",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 u=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:u,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:l,this.gameId="0",this.category="",this.tags=[],this.eventCategory="AD",this.adsLoaderPromise=new Promise(function(e,t){a.eventBus.subscribe("AD_SDK_LOADER_READY",function(){return e()}),a.eventBus.subscribe("AD_CANCELED",function(){return t(new Error("Initial adsLoaderPromise failed to load."))})}),this._loadScripts().then(function(){a._createPlayer(),a._setUpIMA()}).catch(function(e){return a.onError(e)}),window.idhbgd=window.idhbgd||{},window.idhbgd.que=window.idhbgd.que||[]}return i(e,[{key:"start",value:function(){var e=this;this._startSafetyTimer(12e3,"start()"),this.eventBus.subscribe("AD_SDK_LOADER_READY",function(){e._clearSafetyTimer("AD_SDK_LOADER_READY")}),this.eventBus.subscribe("AD_SDK_MANAGER_READY",function(){e._clearSafetyTimer("AD_SDK_MANAGER_READY")}),this.eventBus.subscribe("LOADED",function(){e._clearSafetyTimer("LOADED"),e._startSafetyTimer(8e3,"LOADED")}),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){e._show()}),this.eventBus.subscribe("STARTED",function(){e._clearSafetyTimer("STARTED")})}},{key:"requestAd",value:function(){var e=this;return new Promise(function(t,n){if(e.requestRunning)(0,a.dankLog)("AD_SDK_REQUEST","A request is already running","warning");else{e.requestRunning=!0,1===e.adTypeCount&&(e.adCount=0),e.adCount++,e.adTypeCount++;try{localStorage.getItem("gd_debug")&&localStorage.getItem("gd_tag")?t(localStorage.getItem("gd_tag")):e._tunnlReportingKeys().then(function(o){void 0===window.idhbgd.requestAds&&n("Prebid.js wrapper script hit an error or didn't exist!");var i=(o.nsid?o.nsid:"TNL_T-17102571517")+"/"+(o.tid?o.tid:"TNL_NS-18101700058");delete o.nsid,delete o.tid,(0,a.dankLog)("AD_SDK_AD_UNIT",i,"info");var r=o.consent_string?o.consent_string:"BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA";Object.assign(o,{tnl_system:"1",tnl_content_category:e.category.toLowerCase()}),void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_REQUEST",eventAction:e.parentDomain,eventLabel:i});var s="0"===e.userDeclinedPersonalAds;window.idhbgd.que.push(function(){window.idhbgd.setAdserverTargeting(o),window.idhbgd.setDfpAdUnitCode(i),window.idhbgd.setRefererUrl(encodeURIComponent(e.parentUrl)),window.idhbgd.allowPersonalizedAds(s),window.idhbgd.setDefaultGdprConsentString(r),window.idhbgd.requestAds({callback:function(e){t(e)}})})}).catch(function(e){console.log(e),n(e)})}catch(e){n(e)}}})}},{key:"_tunnlReportingKeys",value:function(){var e=this;return new Promise(function(t){var n="";n=!navigator.userAgent.match(/Crosswalk/i)&&void 0===window.cordova||"m.hopy.com"!==s.getParentDomain?"page_url="+encodeURIComponent(e.parentUrl):"bundle=com.hopy.frivgames";var o=(0,s.getMobilePlatform)(),i=1===e.adTypeCount?"preroll1":"midroll"+e.adCount.toString(),r=(0,s.getQueryString)("ch",window.location.href),a=(0,s.getQueryString)("ch_date",window.location.href),d=r?"&ch="+r:"",c=a?"&ch_date="+a:"",u="https://pub.tunnl.com/opphb?"+n+"&player_width="+e.options.width+"&player_height="+e.options.height+"&ad_type=video_image&os="+o+"&game_id="+e.gameId+"&ad_position="+i+d+c+"&correlator="+Date.now(),l=new Request(u,{method:"GET"});fetch(l).then(function(e){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!")}).then(function(e){return t(e)}).catch(function(n){console.log(n);var o={tid:"TNL_T-17102571517",nsid:"TNL_NS-18101700058",tnl_tid:"T-17102571517",tnl_nsid:"NS-18101700058",tnl_pw:e.options.width,tnl_ph:e.options.height,tnl_pt:"22",tnl_pid:"P-17101800031",tnl_paid:"17",tnl_ad_type:"video_image",tnl_asset_id:e.gameId.toString(),tnl_ad_pos:i,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:e.category.toLowerCase()};void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_REQUEST_FALLBACK",eventAction:e.parentUrl,eventLabel:n}),t(o)})})}},{key:"loadAd",value:function(e){if("undefined"!=typeof google)try{var t=new google.ima.AdsRequest;if(t.adTagUrl=e,(0,a.dankLog)("AD_SDK_TAG_URL",t.adTagUrl,"success"),t.linearAdSlotWidth=this.options.width,t.linearAdSlotHeight=this.options.height,t.nonLinearAdSlotWidth=this.options.width,t.nonLinearAdSlotHeight=this.options.height,t.forceNonLinearFullSlot=!0,void 0!==window.ga){var n=new Date,o=n.getHours(),i=n.getDate(),r=n.getMonth(),s=n.getFullYear();window.ga("gd.send",{hitType:"event",eventCategory:1===this.adTypeCount?"AD_PREROLL":"AD_MIDROLL",eventAction:this.parentDomain+" | h"+o+" d"+i+" m"+r+" y"+s,eventLabel:e})}this.adsLoader.requestAds(t)}catch(e){this._onAdError(e)}else this.onError("Unable to load ad, google IMA SDK not defined.")}},{key:"cancel",value:function(){var e=this;this.adsLoaderPromise.then(function(){e.adsLoader&&e.adsLoader.contentComplete(),e.adsManager&&e.adsManager.destroy(),e._hide(),e.requestRunning=!1}).catch(function(){console.log(new Error("adsLoaderPromise failed to load."))});this.eventBus.broadcast("AD_CANCELED",{name:"AD_CANCELED",message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:"AD_CANCELED",label:this.gameId}})}},{key:"onError",value:function(e){this.eventBus.broadcast("AD_SDK_ERROR",{name:"AD_SDK_ERROR",message:e,status:"error",analytics:{category:this.eventCategory,action:"AD_SDK_ERROR",label:e}}),this.cancel(),this._clearSafetyTimer("AD_SDK_ERROR")}},{key:"_hide",value:function(){var e=this;this.adContainer&&(this.adContainer.style.opacity="0",this.thirdPartyContainer&&(this.thirdPartyContainer.style.opacity="0"),setTimeout(function(){e.adContainer.style.transform="translateX(-9999px)",e.adContainer.style.zIndex="0",e.thirdPartyContainer&&(e.thirdPartyContainer.style.transform="translateX(-9999px)",e.thirdPartyContainer.style.zIndex="0")},this.canRequestPreroll()?0:this.containerTransitionSpeed))}},{key:"_show",value:function(){var e=this;this.adContainer&&(this.adContainer.style.transform="translateX(0)",this.adContainer.style.zIndex="99",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform="translateX(0)",this.thirdPartyContainer.style.zIndex="99",this.thirdPartyContainer.style.display="block"),setTimeout(function(){e.adContainer.style.opacity="1",e.thirdPartyContainer&&(e.thirdPartyContainer.style.opacity="1")},10))}},{key:"_loadScripts",value:function(){var e=this,t=new Promise(function(t,n){var o=e.options.debug?"//imasdk.googleapis.com/js/sdkloader/ima3_debug.js":"//imasdk.googleapis.com/js/sdkloader/ima3.js",i=document.getElementsByTagName("script")[0],r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=o,r.onload=function(){t()},r.onerror=function(){n("IMA script failed to load! Probably due to an ADBLOCKER!")},i.parentNode.insertBefore(r,i)}),n=new Promise(function(t,n){var o=e.options.debug?"https://test-hb.improvedigital.com/pbw/gameDistribution.min.js?v=1":"https://hb.improvedigital.com/pbw/gameDistribution.min.js?v=1",i=document.getElementsByTagName("script")[0],r=document.createElement("script");r.type="text/javascript",r.id="idhbgd",r.async=!0,r.src=o,r.onload=function(){t()},r.onerror=function(){n("Prebid.js failed to load! Probably due to an ADBLOCKER!")},i.parentNode.insertBefore(r,i)});return Promise.all([t,n])}},{key:"_createPlayer",value:function(){var e=this,t=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id=this.prefix+"advertisement",this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex="0",this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.adContainer.style.transform="translateX(-9999px)",this.adContainer.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.adContainer.style.opacity="0",this.adContainer.style.transition="opacity "+this.containerTransitionSpeed+"ms cubic-bezier(0.55, 0, 0.1, 1)",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform="translateX(-9999px)",this.thirdPartyContainer.style.opacity="0",this.thirdPartyContainer.style.transition="opacity "+this.containerTransitionSpeed+"ms cubic-bezier(0.55, 0, 0.1, 1)");var n=document.createElement("div");n.id=this.prefix+"advertisement_slot",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.thirdPartyContainer?(this.adContainer.appendChild(n),this.thirdPartyContainer.appendChild(this.adContainer)):(this.adContainer.appendChild(n),t.appendChild(this.adContainer)),window.addEventListener("resize",function(){var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;e.options.width=e.thirdPartyContainer?e.thirdPartyContainer.offsetWidth:t,e.options.height=e.thirdPartyContainer?e.thirdPartyContainer.offsetHeight:o,n.style.width=e.options.width+"px",n.style.height=e.options.height+"px"})}},{key:"_setUpIMA",value:function(){google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.INSECURE),google.ima.settings.setLocale(this.options.locale),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0),this.adDisplayContainer=new google.ima.AdDisplayContainer(document.getElementById(this.prefix+"advertisement_slot")),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),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);var e=new Date,t=e.getHours(),n=e.getDate(),o=e.getMonth(),i=e.getFullYear(),r="AD_SDK_LOADER_READY";this.eventBus.broadcast(r,{name:r,message:this.options,status:"success",analytics:{category:r,action:this.parentDomain,label:"h"+t+" d"+n+" m"+o+" y"+i}})}},{key:"_onAdsManagerLoaded",value:function(e){var t=this,n=new google.ima.AdsRenderingSettings;if(n.enablePreloading=!0,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(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(){t.adsManager.resize(t.options.width,t.options.height,google.ima.ViewMode.NORMAL)}),this.adsManager&&this.adDisplayContainer){var o=new Date,i=o.getHours(),r=o.getDate(),s=o.getMonth(),a=o.getFullYear(),d="AD_SDK_MANAGER_READY";this.eventBus.broadcast(d,{name:d,message:this.adsManager,status:"success",analytics:{category:d,action:this.parentDomain,label:"h"+i+" d"+r+" m"+s+" y"+a}}),this.adDisplayContainer.initialize();try{this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start()}catch(e){this.onError(e)}}}},{key:"_onAdEvent",value:function(e){var t=this,n=new Date,o=n.getHours(),i=n.getDate(),r=n.getMonth(),s=n.getFullYear(),a="",d="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:a="AD_BREAK_READY",d="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:a="AD_METADATA",d="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:a="ALL_ADS_COMPLETED",d="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:a="CLICK",d="Fired when the ad is clicked.";break;case google.ima.AdEvent.Type.COMPLETE:a="COMPLETE",d="Fired when the ad completes playing.";break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:a="CONTENT_PAUSE_REQUESTED",d="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:a="CONTENT_RESUME_REQUESTED",d="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",this._hide(),this.adsLoaderPromise.then(function(){if(t.adsLoader&&t.adsLoader.contentComplete(),t.adsManager&&t.adsManager.destroy(),1===t.adCount){var e=[];t.tags.forEach(function(t){e.push(t.title.toLowerCase())});var n=t.category.toLowerCase();t._loadDisplayAd(t.gameId,e,n)}t.requestRunning=!1;t.eventBus.broadcast("AD_SDK_FINISHED",{name:"AD_SDK_FINISHED",message:"IMA is ready for new requests.",status:"success",analytics:{category:"AD_SDK_FINISHED",action:t.parentDomain,label:"h"+o+" d"+i+" m"+r+" y"+s}})}).catch(function(){console.log(new Error("adsLoaderPromise failed to load."))});break;case google.ima.AdEvent.Type.DURATION_CHANGE:a="DURATION_CHANGE",d="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:a="FIRST_QUARTILE",d="Fired when the ad playhead crosses first quartile.";break;case google.ima.AdEvent.Type.IMPRESSION:a="IMPRESSION",d="Fired when the impression URL has been pinged.";try{if(void 0!==window.pbjsgd){var c=window.pbjsgd.getHighestCpmBids();this.options.debug&&console.log("Winner(s)",c),c.length>0?c.forEach(function(e){void 0!==window.ga&&e.bidder&&window.ga("gd.send",{hitType:"event",eventCategory:"IMPRESSION_"+e.bidder.toUpperCase(),eventAction:t.parentDomain,eventLabel:"h"+o+" d"+i+" m"+r+" y"+s})}):void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"IMPRESSION_ADEXCHANGE",eventAction:this.parentDomain,eventLabel:"h"+o+" d"+i+" m"+r+" y"+s})}}catch(e){console.log(e)}break;case google.ima.AdEvent.Type.INTERACTION:a="INTERACTION",d="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:a="LINEAR_CHANGED",d="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:a="LOADED",d=e.getAd().getContentType();break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(a="LOG",d=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:a="MIDPOINT",d="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:a="PAUSED",d="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:a="RESUMED",d="Fired when the ad is resumed.";break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:a="SKIPPABLE_STATE_CHANGED",d="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:a="SKIPPED",d="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:a="STARTED",d="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:a="THIRD_QUARTILE",d="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:a="USER_CLOSE",d="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:a="VOLUME_CHANGED",d="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:a="VOLUME_MUTED",d="Fired when the ad volume has been muted."}""!==a&&""!==d&&this.eventBus.broadcast(a,{name:a,message:d,status:"success",analytics:{category:a,action:this.parentDomain,label:"h"+o+" d"+i+" m"+r+" y"+s}})}},{key:"_onAdError",value:function(e){this.cancel(),this._clearSafetyTimer("AD_ERROR");try{if(void 0!==window.ga){var t=e.getError().getMessage();this.eventBus.broadcast("AD_ERROR",{name:"AD_ERROR",message:t,status:"warning",analytics:{category:"AD_ERROR",action:e.getError().getErrorCode().toString()||e.getError().getVastErrorCode().toString(),label:t}})}if(void 0!==window.pbjsgd){var n=window.pbjsgd.getHighestCpmBids();this.options.debug&&console.log("Failed winner(s) ",n),n.length>0?n.forEach(function(t){var n=t.adId?t.adId:null,o=t.creativeId?t.creativeId:null;void 0!==window.ga&&t.bidder&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_ERROR_"+t.bidder.toUpperCase(),eventAction:e.getError().getErrorCode().toString()||e.getError().getVastErrorCode().toString(),eventLabel:n+" | "+o})}):void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_ERROR_ADEXCHANGE",eventAction:e.getError().getErrorCode().toString()||e.getError().getVastErrorCode().toString(),eventLabel:e.getError().getMessage()})}}catch(e){console.log(e)}}},{key:"_startSafetyTimer",value:function(e,t){var n=this;(0,a.dankLog)("AD_SAFETY_TIMER","Invoked timer from: "+t,"success"),this.safetyTimer=window.setTimeout(function(){n.eventBus.broadcast("AD_SAFETY_TIMER",{name:"AD_SAFETY_TIMER",message:"Advertisement took too long to load.",status:"warning",analytics:{category:n.eventCategory,action:"AD_SAFETY_TIMER",label:n.gameId}}),n.cancel(),n._clearSafetyTimer(t)},e)}},{key:"_clearSafetyTimer",value:function(e){if(void 0!==this.safetyTimer&&null!==this.safetyTimer&&((0,a.dankLog)("AD_SAFETY_TIMER","Cleared timer set at: "+e,"success"),clearTimeout(this.safetyTimer),this.safetyTimer=void 0,"requestAd()"===e)){var t=new Date,n=t.getHours(),o=t.getDate(),i=t.getMonth(),r=t.getFullYear();void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_SDK_AD_REQUEST_ERROR",eventAction:"h"+n+" d"+o+" m"+i+" y"+r})}}},{key:"_loadDisplayAd",value:function(e,t,n){var o=this,i=document.body||document.getElementsByTagName("body")[0],r=document.createElement("div");r.id=this.prefix+"baguette",r.style.zIndex="100",r.style.position="absolute",r.style.top="0",r.style.left="0",i.appendChild(r);var s=document.createElement("script");s.async=!0,s.type="text/javascript";var a="https:"===document.location.protocol;s.src=(a?"https:":"http:")+"//www.googletagservices.com/tag/js/gpt.js";var d=document.getElementsByTagName("script")[0];d.parentNode.insertBefore(s,d),window.googletag=window.googletag||{},window.googletag.cmd=window.googletag.cmd||[],googletag.cmd.push(function(){var i=[];i[0]=googletag.defineSlot("/1015413/Gamedistribution_ingame_1x1_crosspromo",[1,1],o.prefix+"baguette").setCollapseEmptyDiv(!0,!0).addService(googletag.pubads()),googletag.pubads().setTargeting("crossid",e),googletag.pubads().setTargeting("crosstags",t),googletag.pubads().setTargeting("crosscategory",n),googletag.pubads().disableInitialLoad(),googletag.enableServices(),googletag.display(o.prefix+"baguette"),googletag.pubads().refresh([i[0]])})}}]),e}();n.default=c},{"../components/EventBus":7,"../modules/common":13,"../modules/dankLog":14}],11:[function(e,t,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e){return e&&e.__esModule?e:{default:e}}(e("./main")),r="object"===("undefined"==typeof GD_OPTIONS?"undefined":o(GD_OPTIONS))&&GD_OPTIONS?GD_OPTIONS:window.gdApi&&"object"===o(window.gdApi.q[0][0])&&window.gdApi.q[0][0]?window.gdApi.q[0][0]:{};window.gdApi&&"object"===o(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&(r.hasOwnProperty("advertisementSettings")||(r.advertisementSettings={autoplay:!0})),window.gdsdk=new i.default(r),window.gdApi=window.gdsdk},{"./main":12}],12:[function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();e("es6-promise/auto"),e("whatwg-fetch");var a=o(e("../package.json")),d=o(e("./components/VideoAd")),c=o(e("./components/EventBus")),u=o(e("./components/ImplementationTest")),l=o(e("./components/MessageRouter")),h=e("./modules/dankLog"),g=e("./modules/common"),f=null,p=function(){function e(t){var n=this;if(i(this,e),f)return f;f=this;var o={debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onEvent:function(e){},onInit:function(e){},onError:function(e){}};this.options=t?(0,g.extendDefaults)(o,t):o;var r=a.default.version,s=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+r+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,s);var u=(0,g.getParentUrl)(),p=(0,g.getParentDomain)();this.msgrt=new l.default({gameId:this.options.gameId,parentDomain:p,hours:(new Date).getHours()}),this.msgrt.send("loaded");var m=document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0;if(this._analytics(m,p),["razda.com","74.127.72.247"].indexOf(p)>-1)return void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"SDK_BLOCKED",eventAction:p,eventLabel:this.options.gameId+""}),void(document.location="/blocked.html?domain="+p+"&localTime="+(new Date).getHours());var b=[];this.options.testing=this.options.testing||b.indexOf(p)>-1,this.options.testing&&(0,h.dankLog)("SDK_TESTING_ENABLED",this.options.testing,"info"),this.whitelabelPartner=!1;var v=(0,g.getQueryParams)("xanthophyll");v.hasOwnProperty("xanthophyll")&&"true"===v.xanthophyll&&(this.whitelabelPartner=!0,(0,h.dankLog)("SDK_WHITELABEL",this.whitelabelPartner,"success"));try{if("developer.gamedistribution.com"===p){localStorage.setItem("gd_debug","true"),localStorage.setItem("gd_midroll","0");localStorage.setItem("gd_tag","https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=")}else"html5.api.gamedistribution.com"!==p&&"localhost:3000"!==p||(localStorage.setItem("gd_debug","true"),localStorage.setItem("gd_midroll","0"));localStorage.getItem("gd_debug")&&this.openConsole()}catch(e){console.log(e)}(new Image).src="https://ana.tunnl.com/event?page_url="+encodeURIComponent(u)+"&game_id="+this.options.gameId+"&eventtype=1",this.eventBus=new c.default,this.eventBus.gameId=this.options.gameId+"",this.eventBus.subscribe("SDK_BLOCKED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_ERROR",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GAME_DATA_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GAME_START",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GAME_PAUSE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GDPR_TRACKING",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GDPR_TARGETING",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GDPR_THIRD_PARTY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_LOADER_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_MANAGER_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_REQUEST_ADS",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_ERROR",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_FINISHED",function(e){n._onEvent(e),n._checkPrerollRequest(e)}),this.eventBus.subscribe("AD_CANCELED",function(e){n._onEvent(e),n.onResumeGame("Advertisement error, no worries, start / resume the game.","warning")}),this.eventBus.subscribe("AD_ERROR",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SAFETY_TIMER",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_BREAK_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_METADATA",function(e){return n._onEvent(e)}),this.eventBus.subscribe("ALL_ADS_COMPLETED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("CLICK",function(e){n._onEvent(e);try{window._cc13998.bcpw("act","ad click")}catch(e){}}),this.eventBus.subscribe("COMPLETE",function(e){n._onEvent(e);try{window._cc13998.bcpw("act","ad complete")}catch(e){}}),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(e){n._onEvent(e),n.onPauseGame("New advertisements requested and loaded","success")}),this.eventBus.subscribe("CONTENT_RESUME_REQUESTED",function(e){if(n._onEvent(e),n.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),"developer.gamedistribution.com"===p||!0===new RegExp("^localhost").test(p)){(new Image).src="https://game.api.gamedistribution.com/game/hasapi/"+n.options.gameId;try{var t=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:n.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){}}}),this.eventBus.subscribe("DURATION_CHANGE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("FIRST_QUARTILE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("IMPRESSION",function(e){n._onEvent(e);try{window._cc13998.bcpw("genp","ad video"),window._cc13998.bcpw("act","ad impression")}catch(e){}}),this.eventBus.subscribe("INTERACTION",function(e){return n._onEvent(e)}),this.eventBus.subscribe("LINEAR_CHANGED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("LOADED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("LOG",function(e){return n._onEvent(e)}),this.eventBus.subscribe("MIDPOINT",function(e){return n._onEvent(e)}),this.eventBus.subscribe("PAUSED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("RESUMED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SKIPPABLE_STATE_CHANGED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SKIPPED",function(e){n._onEvent(e);try{window._cc13998.bcpw("act","ad skipped")}catch(e){}}),this.eventBus.subscribe("STARTED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("THIRD_QUARTILE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("USER_CLOSE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("VOLUME_CHANGED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("VOLUME_MUTED",function(e){return n._onEvent(e)}),this._gdpr(p),this.adRequestTimer=void 0,this.videoAdInstance=new d.default(this.options.flashSettings.adContainerId,this.options.prefix,this.options.advertisementSettings);var y=new Promise(function(e){var t={gameId:n.options.gameId?n.options.gameId+"":"49258a0e497c42b5b5d87887f24d27a6",advertisements:!0,preroll:!0,midroll:12e4,title:"",tags:[],category:"",assets:[]},o="https://game.api.gamedistribution.com/game/get/"+t.gameId.replace(/-/g,"")+"/?domain="+p+"&localTime="+(new Date).getHours(),i=new Request(o,{method:"GET"});fetch(i).then(function(e){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!")}).then(function(o){if(o.error)(0,h.dankLog)("SDK_GAME_DATA_READY",o.error,"warning");else if(o.success){var i={gameId:o.result.game.gameMd5,advertisements:o.result.game.enableAds,preroll:o.result.game.preRoll,midroll:6e4*o.result.game.timeAds,title:o.result.game.title,tags:o.result.game.tags,category:o.result.game.category,assets:o.result.game.assets,displaySecondPrerollIfFirstOneShort:o.result.game.displaySecondPrerollIfFirstOneShort};(t=(0,g.extendDefaults)(t,i)).displaySecondPrerollIfFirstOneShort&&(n.videoAdInstance.maxPrerollCount=2),(0,h.dankLog)("SDK_GAME_DATA_READY",t,"success")}e(t)}).catch(function(n){(0,h.dankLog)("SDK_GAME_DATA_READY",n,"success"),e(t)})});y.then(function(e){n.videoAdInstance.gameId=e.gameId,n.videoAdInstance.category=e.category,n.videoAdInstance.tags=e.tags;try{localStorage.getItem("gd_debug")&&(localStorage.getItem("gd_tag")&&(n.videoAdInstance.tag=localStorage.getItem("gd_tag")),localStorage.getItem("gd_midroll")&&(e.midroll=localStorage.getItem("gd_midroll")))}catch(e){console.log(e)}if(e.advertisements){var t=["gry.pl","oyunskor.com","juegos.com","a10.com","agame.com","spelletjes.nl","jeux.fr","gioco.it","ojogos.com.br","gamesgames.com","games.co.id","jetztspielen.de","spel.nl","spela.se","jeu.fr","spielen.com","giochi.it","games.co.uk","ourgames.ru","flashgames.ru","permainan.co.id","mousebreaker.com","gameplayer.io","oyunoyna.com","spilgames.com","spilcloud.com"].indexOf(p)>-1&&document.cookie.indexOf("ogdpr_tracking=1")<0;e.preroll?(n.videoAdInstance.options.autoplay||t)&&n._createSplash(e,t):n.adRequestTimer=new Date}n.videoAdInstance.start()}).catch(function(){console.log(new Error("gameDataPromise failed to resolve."))}),this.readyPromise=Promise.all([y,this.videoAdInstance.adsLoaderPromise]).then(function(e){return n.eventBus.broadcast("SDK_READY",{name:"SDK_READY",message:"Everything is ready.",status:"success",analytics:{category:"SDK",action:"SDK_READY",label:n.options.gameId+""}}),n.options.onInit("Everything is ready."),e[0]}).catch(function(){return n.eventBus.broadcast("SDK_ERROR",{name:"SDK_ERROR",message:"The SDK failed.",status:"error",analytics:{category:"SDK",action:"SDK_ERROR",label:n.options.gameId+""}}),n.options.onError("The SDK failed."),!1})}return s(e,[{key:"_gdpr",value:function(e){var t=document.location.search.indexOf("gdpr-tracking")>=0,n=document.location.search.indexOf("gdpr-tracking=1")>=0,o="",i="";t?n?(o="General Data Protection Regulation is set to allow tracking.",i="success"):(o="General Data Protection Regulation is set to disallow tracking.",i="warning"):(o="General Data Protection Regulation consent for tracking is not set by the publisher.",i="warning"),this.eventBus.broadcast("SDK_GDPR_TRACKING",{name:"SDK_GDPR_TRACKING",message:o,status:i,analytics:{category:"SDK_GDPR_TRACKING",action:e,label:t?n?"1":"0":"not set"}});var r=document.location.search.indexOf("gdpr-targeting")>=0,s=document.location.search.indexOf("gdpr-targeting=1")>=0,a="",d="";r?s?(a="General Data Protection Regulation is set to allow personalised advertisements.",d="success"):(a="General Data Protection Regulation is set to disallow personalised advertisements.",d="warning"):(a="General Data Protection Regulation consent for targeting is not set by the publisher.",d="warning"),this.eventBus.broadcast("SDK_GDPR_TARGETING",{name:"SDK_GDPR_TARGETING",message:a,status:d,analytics:{category:"SDK_GDPR_TARGETING",action:e,label:r?s?"1":"0":"not set"}});var c=document.location.search.indexOf("gdpr-third-party")>=0,u=document.location.search.indexOf("gdpr-third-party=1")>=0,l="",h="";c?u?(l="General Data Protection Regulation is set to allow third parties.",h="success"):(l="General Data Protection Regulation is set to disallow third parties.",h="warning"):(l="General Data Protection Regulation consent for third parties is not set by the publisher.",h="warning"),this.eventBus.broadcast("SDK_GDPR_THIRD_PARTY",{name:"SDK_GDPR_THIRD_PARTY",message:l,status:h,analytics:{category:"SDK_GDPR_THIRD_PARTY",action:e,label:c?u?"1":"0":"not set"}})}},{key:"_onEvent",value:function(e){(0,h.dankLog)(e.name,e.message,e.status);try{void 0!==window.ga&&e.analytics&&window.ga("gd.send",{hitType:"event",eventCategory:e.analytics.category?e.analytics.category:"",eventAction:e.analytics.action?e.analytics.action:"",eventLabel:e.analytics.label?e.analytics.label:""})}catch(e){console.log(e)}this.options.onEvent(e)}},{key:"_analytics",value:function(e,t){var n=this;(0,g.getScript)("https://www.google-analytics.com/analytics.js","gdsdk_google_analytics").then(function(){window.ga("create","UA-102601800-1",{name:"gd",cookieExpires:7776e3},"auto"),window.ga("gd.send","pageview"),e||window.ga("gd.set","anonymizeIp",!0)}).catch(function(e){(0,h.dankLog)("SDK_LOAD_SCRIPT",e,"error")}),e||(0,g.getScript)("https://tags.crwdcntrl.net/c/13998/cc.js?ns=_cc13998","LOTCC_13998").then(function(){n.readyPromise.then(function(e){"object"===r(window._cc13998)&&"function"==typeof window._cc13998.bcpf&&"function"==typeof window._cc13998.bcpw&&(window._cc13998.bcpw("act","play"),window._cc13998.bcpw("int","domain : "+t),window._cc13998.bcpw("int","category : "+e.category.toLowerCase()),"complete"===document.readyState?window._cc13998.bcpf():window._cc13998.bcp())})}).catch(function(e){(0,h.dankLog)("SDK_LOAD_SCRIPT",e,"error")})}},{key:"_createSplash",value:function(e,t){var n=this,o=e.assets.find(function(e){return e.hasOwnProperty("name")&&512===e.width&&512===e.height});o=o?"https://img.gamedistribution.com/"+o.name:e.assets[0].hasOwnProperty("name")?"https://img.gamedistribution.com/"+e.assets[0].name:"https://img.gamedistribution.com/logo.svg";var i="\n body {\n position: inherit;\n }\n ."+this.options.prefix+"splash-background-container {\n box-sizing: border-box;\n position: absolute;\n z-index: 664;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: #000;\n overflow: hidden;\n }\n ."+this.options.prefix+"splash-background-image {\n box-sizing: border-box;\n position: absolute;\n top: -25%;\n left: -25%;\n width: 150%;\n height: 150%;\n background-image: url("+o+");\n background-size: cover;\n filter: blur(50px) brightness(1.5);\n }\n ."+this.options.prefix+"splash-container {\n display: flex;\n flex-flow: column;\n box-sizing: border-box;\n position: absolute;\n z-index: 665;\n bottom: 0;\n width: 100%;\n height: 100%;\n }\n ."+this.options.prefix+"splash-top {\n display: flex;\n flex-flow: column;\n box-sizing: border-box;\n flex: 1;\n align-self: center;\n justify-content: center;\n padding: 20px;\n }\n ."+this.options.prefix+"splash-top > div {\n text-align: center;\n }\n ."+this.options.prefix+"splash-top > div > button {\n border: 0;\n margin: auto;\n padding: 10px 22px;\n border-radius: 5px;\n border: 3px solid white;\n background: linear-gradient(0deg, #dddddd, #ffffff);\n color: #222;\n text-transform: uppercase;\n text-shadow: 0 0 1px #fff;\n font-family: Helvetica, Arial, sans-serif;\n font-weight: bold;\n font-size: 18px;\n cursor: pointer;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n }\n ."+this.options.prefix+"splash-top > div > button:hover {\n background: linear-gradient(0deg, #ffffff, #dddddd);\n }\n ."+this.options.prefix+"splash-top > div > button:active {\n box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);\n background: linear-gradient(0deg, #ffffff, #f5f5f5);\n }\n ."+this.options.prefix+"splash-top > div > div {\n position: relative;\n width: 150px;\n height: 150px;\n margin: auto auto 20px;\n border-radius: 100%;\n overflow: hidden;\n border: 3px solid rgba(255, 255, 255, 1);\n background-color: #000;\n box-shadow: inset 0 5px 5px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);\n background-image: url("+o+");\n background-position: center;\n background-size: cover;\n }\n ."+this.options.prefix+"splash-top > div > div > img {\n width: 100%;\n height: 100%;\n }\n ."+this.options.prefix+"splash-bottom {\n display: flex;\n flex-flow: column;\n box-sizing: border-box;\n align-self: center;\n justify-content: center;\n width: 100%;\n padding: 0 0 20px;\n }\n ."+this.options.prefix+"splash-bottom > ."+this.options.prefix+"splash-consent,\n ."+this.options.prefix+"splash-bottom > ."+this.options.prefix+"splash-title {\n box-sizing: border-box;\n width: 100%;\n padding: 20px;\n background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.5) 50%, transparent);\n color: #fff;\n text-align: left;\n font-size: 12px;\n font-family: Arial;\n font-weight: normal;\n text-shadow: 0 0 1px rgba(0, 0, 0, 0.7);\n line-height: 150%;\n }\n ."+this.options.prefix+"splash-bottom > ."+this.options.prefix+"splash-title {\n padding: 15px 0;\n text-align: center;\n font-size: 18px;\n font-family: Helvetica, Arial, sans-serif;\n font-weight: bold;\n line-height: 100%;\n }\n ."+this.options.prefix+"splash-bottom > ."+this.options.prefix+"splash-consent a {\n color: #fff;\n }\n ",r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i)),r.appendChild(s);var a="";a=t?'\n <div class="'+this.options.prefix+'splash-background-container">\n <div class="'+this.options.prefix+'splash-background-image"></div>\n </div>\n <div class="'+this.options.prefix+'splash-container">\n <div class="'+this.options.prefix+'splash-top">\n <div>\n <div></div>\n <button id="'+this.options.prefix+'splash-button">Play Game</button>\n </div> \n </div>\n <div class="'+this.options.prefix+'splash-bottom">\n <div class="'+this.options.prefix+'splash-consent">\n We may show personalized ads provided by our partners, and our \n services can not be used by children under 16 years old without the \n consent of their legal guardian. By clicking "PLAY GAME", you consent \n to transmit your data to our partners for advertising purposes and \n declare that you are 16 years old or have the permission of your \n legal guardian. You can review our terms\n <a href="https://docs.google.com/document/d/e/2PACX-1vR0BAkCq-V-OkAJ3EBT4qW4sZ9k1ta9K9EAa32V9wlxOOgP-BrY9Nv-533A_zdN3yi7tYRjO1r5cLxS/pub" target="_blank">here</a>.\n </div>\n </div>\n </div>\n ':"b92a4170784248bca2ffa0c08bec7a50"===e.gameId?'\n <div class="'+this.options.prefix+'splash-background-container">\n <div class="'+this.options.prefix+'splash-background-image"></div>\n </div>\n <div class="'+this.options.prefix+'splash-container">\n <div class="'+this.options.prefix+'splash-top">\n <div>\n <button id="'+this.options.prefix+'splash-button">Play Game</button>\n </div> \n </div>\n </div>\n ':'\n <div class="'+this.options.prefix+'splash-background-container">\n <div class="'+this.options.prefix+'splash-background-image"></div>\n </div>\n <div class="'+this.options.prefix+'splash-container">\n <div class="'+this.options.prefix+'splash-top">\n <div>\n <div></div>\n <button id="'+this.options.prefix+'splash-button">Play Game</button>\n </div> \n </div>\n <div class="'+this.options.prefix+'splash-bottom">\n <div class="'+this.options.prefix+'splash-title">'+e.title+"</div>\n </div>\n </div>\n ";var d=document.createElement("div");d.innerHTML=a,d.id=this.options.prefix+"splash";var c=this.options.flashSettings.splashContainerId?document.getElementById(this.options.flashSettings.splashContainerId):null;if(c)c.style.display="block",c.insertBefore(d,c.firstChild);else{var u=document.body||document.getElementsByTagName("body")[0];u.insertBefore(d,u.firstChild)}t?document.getElementById(this.options.prefix+"splash-button").addEventListener("click",function(){var e=new Date;e.setDate(e.getDate()+90),document.cookie="ogdpr_tracking=1; expires="+e.toUTCString()+"; path=/",n.showBanner()}):d.addEventListener("click",function(){n.showBanner()}),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){d&&d.parentNode?d.parentNode.removeChild(d):d&&(d.style.display="none"),c&&c.parentNode?c.parentNode.removeChild(c):c&&(c.style.display="none")}),this.eventBus.subscribe("SDK_GAME_START",function(){d&&d.parentNode?d.parentNode.removeChild(d):d&&(d.style.display="none"),c&&c.parentNode?c.parentNode.removeChild(c):c&&(c.style.display="none")})}},{key:"_checkPrerollRequest",value:function(){var e=this;this.videoAdInstance.canRequestPreroll()&&(this.videoAdInstance.requestedPrerollCount++,this.videoAdInstance.requestAttempts=0,this.videoAdInstance.requestAd().then(function(t){return e.videoAdInstance.loadAd(t)}).catch(function(t){e.videoAdInstance.onError(t)}),this.msgrt.send("req.ad.preroll."+this.videoAdInstance.requestedPrerollCount))}},{key:"showBanner",value:function(){var e=this;this.readyPromise.then(function(t){t.advertisements&&!e.whitelabelPartner?void 0!==e.adRequestTimer?(new Date).valueOf()-e.adRequestTimer.valueOf()<t.midroll?((0,h.dankLog)("SDK_SHOW_BANNER","The advertisement was requested too soon after the previous advertisement was finished.","warning"),e.onResumeGame("Just resume the game...","success")):((0,h.dankLog)("SDK_SHOW_BANNER","Requested the midroll advertisement.","success"),e.adRequestTimer=new Date,e.videoAdInstance.requestAttempts=0,e.videoAdInstance.requestedMidrollCount++,e.videoAdInstance.requestAd().then(function(t){return e.videoAdInstance.loadAd(t)}).catch(function(t){e.videoAdInstance.onError(t)}),e.msgrt.send("req.ad.midroll."+e.videoAdInstance.requestedMidrollCount)):((0,h.dankLog)("SDK_SHOW_BANNER","Requested the preroll advertisement.","success"),e.adRequestTimer=new Date,e.videoAdInstance.requestAttempts=0,e.videoAdInstance.requestedPrerollCount++,e.videoAdInstance.requestAd().then(function(t){return e.videoAdInstance.loadAd(t)}).catch(function(t){e.videoAdInstance.onError(t)}),e.msgrt.send("req.ad.preroll."+e.videoAdInstance.requestedPrerollCount)):(e.videoAdInstance.cancel(),(0,h.dankLog)("SDK_SHOW_BANNER","Advertisements are disabled.","warning"))}).catch(function(e){(0,h.dankLog)("SDK_SHOW_BANNER",e,"error")})}},{key:"customLog",value:function(e){}},{key:"play",value:function(){}},{key:"onResumeGame",value:function(e,t){try{this.options.resumeGame()}catch(e){console.log(e)}this.eventBus.broadcast("SDK_GAME_START",{name:"SDK_GAME_START",message:e,status:t,analytics:{category:"SDK",action:"SDK_GAME_START",label:this.options.gameId+""}})}},{key:"onPauseGame",value:function(e,t){try{this.options.pauseGame()}catch(e){console.log(e)}this.eventBus.broadcast("SDK_GAME_PAUSE",{name:"SDK_GAME_PAUSE",message:e,status:t,analytics:{category:"SDK",action:"SDK_GAME_PAUSE",label:this.options.gameId+""}})}},{key:"openConsole",value:function(){try{new u.default(this.options.testing).start(),localStorage.setItem("gd_debug",!0)}catch(e){console.log(e)}}}]),e}();n.default=p},{"../package.json":6,"./components/EventBus":7,"./components/ImplementationTest":8,"./components/MessageRouter":9,"./components/VideoAd":10,"./modules/common":13,"./modules/dankLog":14,"es6-promise/auto":1,"whatwg-fetch":5}],13:[function(e,t,n){"use strict";function o(e,t){var n=t||window.location.href,o=new RegExp("[?&]"+e+"=([^&#]*)","i").exec(n);return o?o[1]:null}function i(){for(var e=void 0,t=/\+/g,n=/([^&=]+)=?([^&]*)/g,o=function(e){return decodeURIComponent(e.toLowerCase().replace(t," "))},i=window.location.search.substring(1),r={};e=n.exec(i);)r[o(e[1])]=o(e[2]);return r}function r(e){return(e=e||"")!==decodeURIComponent(e)}function s(e){for(;r(e);)e=decodeURIComponent(e);return e}Object.defineProperty(n,"__esModule",{value:!0}),n.extendDefaults=function(e,t){var n=void 0;for(n in t)t.hasOwnProperty(n)&&null!==t[n]&&void 0!==t[n]&&(e[n]=t[n]);return e},n.getParentUrl=function(){var e=i();if(e.gd_sdk_referrer_url)return console.log("self-hosted referrer URL:",e.gd_sdk_referrer_url),e.gd_sdk_referrer_url;var t=window.location!==window.parent.location&&document.referrer&&""!==document.referrer?document.referrer:document.location.href;if(-1!==document.referrer.indexOf("gameplayer.io")){t="https://gamedistribution.com";var n=o("ref",document.referrer);if(n){var r=n;""!==r&&"{portal%20name}"!==r&&"{spilgames}"!==r&&"{portal name}"!==r&&(t="https://"+(t=(r=s(r)).replace(/^(?:https?:\/\/)?(?:\/\/)?/i,"")))}console.info("Spil referrer URL: "+t)}else-1!==document.referrer.indexOf("localhost")&&(t="https://gamedistribution.com/");return t},n.getParentDomain=function(){var e=i(),t=(e.gd_sdk_referrer_url?e.gd_sdk_referrer_url:window.location!==window.parent.location&&document.referrer&&""!==document.referrer?document.referrer.split("/")[2]:document.location.host).replace(/^(?:https?:\/\/)?(?:\/\/)?(?:www\.)?/i,"").split("/")[0];if(-1!==document.referrer.indexOf("gameplayer.io")){t="gamedistribution.com";var n=o("ref",document.referrer);if(n){var r=n;""!==r&&"{portal%20name}"!==r&&"{spilgames}"!==r&&"{portal name}"!==r&&(t=(r=s(r)).replace(/^(?:https?:\/\/)?(?:\/\/)?(?:www\.)?/i,"").split("/")[0])}console.info("Spil referrer domain: "+t)}else-1!==document.referrer.indexOf("localhost")&&(t="gamedistribution.com");return t},n.getQueryParams=i,n.getMobilePlatform=function(){var e=navigator.userAgent||navigator.vendor||window.opera;return/windows phone/i.test(e)?"windows":/android/i.test(e)?"android":/iPad|iPhone|iPod/.test(e)&&!window.MSStream?"ios":""},n.getQueryString=o,n.getScript=function(e,t){return new Promise(function(n,o){if(Array.from(document.querySelectorAll("script")).map(function(e){return e.src}).includes(e))n();else{var i=document.getElementsByTagName("script")[0],r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.id=t,r.onload=function(){n()},r.onerror=function(){o("Failed to load "+e)},i.parentNode.insertBefore(r,i)}})}},{}],14:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=Date.now();n.dankLog=function(e,t,n){try{if(localStorage.getItem("gd_debug")){var i="error"===n?"background: #c4161e; color: #fff":"warning"===n?"background: #ff8c1c; color: #fff":"info"===n?"background: #ff0080; color: #fff":"background: #44a5ab; color: #fff",r=console.log("["+(Date.now()-o)/1e3+"s]%c %c %c gdsdk %c %c %c "+e+" ","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8",i,void 0!==t?t:"");console.log.apply(console,r)}}catch(e){console.log(e)}}},{}]},{},[7,8,9,10,11,12,13,14]); |