@goodgamestudios/webshop-utils
Advanced tools
Comparing version 0.0.37 to 0.0.38
@@ -5,2 +5,4 @@ # Changelog | ||
### [0.0.38](https://gitlab.goodgamestudios.com/webshop/utils/compare/v0.0.37...v0.0.38) (2020-03-01) | ||
### [0.0.37](https://gitlab.goodgamestudios.com/webshop/utils/compare/v0.0.36...v0.0.37) (2020-03-01) | ||
@@ -7,0 +9,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function detectBrowser() { | ||
return 'chrome'; | ||
// @ts-ignore | ||
if (!!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime)) { | ||
return 'chrome'; | ||
} | ||
// @ts-ignore | ||
if (typeof InstallTrigger !== 'undefined') { | ||
return 'firefox'; | ||
} | ||
// @ts-ignore | ||
if (!isIE && !!window.StyleMedia) { | ||
return 'edge'; | ||
} | ||
// @ts-ignore | ||
if (/constructor/i.test(window.HTMLElement) || (function (p) { | ||
return p.toString() === '[object SafariRemoteNotification]'; | ||
// @ts-ignore | ||
})(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification))) { | ||
return 'safari'; | ||
} | ||
// @ts-ignore | ||
if ((!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) { | ||
return 'opera'; | ||
} | ||
// @ts-ignore | ||
if (isChrome && (navigator.userAgent.indexOf('Edg') != -1)) { | ||
return 'edge-chromium'; | ||
} | ||
// @ts-ignore | ||
if ( /*@cc_on!@*/false || !!document.documentMode) { | ||
return 'ie'; | ||
} | ||
// @ts-ignore | ||
if ((isChrome || isOpera) && !!window.CSS) { | ||
return 'blink'; | ||
} | ||
} | ||
exports.detectBrowser = detectBrowser; |
export function detectBrowser() { | ||
return 'chrome'; | ||
// @ts-ignore | ||
if (!!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime)) { | ||
return 'chrome'; | ||
} | ||
// @ts-ignore | ||
if (typeof InstallTrigger !== 'undefined') { | ||
return 'firefox'; | ||
} | ||
// @ts-ignore | ||
if (!isIE && !!window.StyleMedia) { | ||
return 'edge'; | ||
} | ||
// @ts-ignore | ||
if (/constructor/i.test(window.HTMLElement) || (function (p) { | ||
return p.toString() === '[object SafariRemoteNotification]'; | ||
// @ts-ignore | ||
})(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification))) { | ||
return 'safari'; | ||
} | ||
// @ts-ignore | ||
if ((!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) { | ||
return 'opera'; | ||
} | ||
// @ts-ignore | ||
if (isChrome && (navigator.userAgent.indexOf('Edg') != -1)) { | ||
return 'edge-chromium'; | ||
} | ||
// @ts-ignore | ||
if ( /*@cc_on!@*/false || !!document.documentMode) { | ||
return 'ie'; | ||
} | ||
// @ts-ignore | ||
if ((isChrome || isOpera) && !!window.CSS) { | ||
return 'blink'; | ||
} | ||
} |
{ | ||
"name": "@goodgamestudios/webshop-utils", | ||
"description": "Utils library for WebShop", | ||
"version": "0.0.37", | ||
"version": "0.0.38", | ||
"sideEffects": false, | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("mobx")):"function"==typeof define&&define.amd?define("WebshopUtils",["mobx"],n):"object"==typeof exports?exports.WebshopUtils=n(require("mobx")):t.WebshopUtils=n(t.mobx)}(window,(function(t){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=21)}([function(t,n,e){"use strict";var r=e(1);e.d(n,"d",(function(){return u})),e.d(n,"h",(function(){return i})),e.d(n,"i",(function(){return c})),e.d(n,"e",(function(){return a})),e.d(n,"c",(function(){return s})),e.d(n,"a",(function(){return f})),e.d(n,"k",(function(){return d})),e.d(n,"q",(function(){return l})),e.d(n,"r",(function(){return p})),e.d(n,"s",(function(){return v})),e.d(n,"j",(function(){return h})),e.d(n,"f",(function(){return y})),e.d(n,"p",(function(){return g})),e.d(n,"o",(function(){return m})),e.d(n,"n",(function(){return b})),e.d(n,"l",(function(){return O})),e.d(n,"m",(function(){return w})),e.d(n,"b",(function(){return _})),e.d(n,"g",(function(){return I}));var o=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var u=arguments[n],i=0,c=u.length;i<c;i++,o++)r[o]=u[i];return r},u=function(t){return t[0]},i=function(t){return t[t.length-1]},c=function(t){return t[Math.floor(t.length/2)]},a=function(t){return t.reduce((function(t,n){return t.concat(n)}),[])},s=function(t){return Array.from(new Set(t))},f=function(t){var n=t.browserName;return function(t){return-1!==t.indexOf(n)}},d=function(t,n){return Object.keys(t).reduce((function(e,r){return n!==r&&(e[r]=t[r]),e}),{})},l=function(t,n){void 0===n&&(n={});var e=Object.keys(n);if(0===e.length)return t;var r=u(e),o=n[r];if(void 0===o)throw new Error("template error "+r+", "+JSON.stringify(n));return l(t.replace("{"+r+"}",o.toString()),d(n,r))},p=function(t,n){void 0===n&&(n={});var e=Object.keys(n);if(0===e.length)return t;var r=u(e),o=n[r];if(void 0===o)throw new Error("template error "+r+", "+JSON.stringify(n));return l(t.replace(":"+r,o.toString()),d(n,r))};function v(t){for(var n=0,e=Object.keys(t);n<e.length;n++){var o=e[n],u=t[o];if(!u||Number.isNaN(u))throw new r.a(o,u)}}function h(t){return Math.floor(t/1e3)}function y(t){return encodeURIComponent("{"+t.join(",")+"}")}var g=function(t){var n=Math.ceil(t.length/2),e=t.slice(0,n),r=t.slice(n);return e.reduce((function(t,n,e){return t.push(n),e<r.length&&t.push(r[e]),t}),[])},m=function(t){return 0===t.length?[]:o(g(t.slice(0,6)),m(t.slice(6)))},b=function(t){return new Promise((function(n){return setTimeout(n,t)}))},O=function(t){return Array.from(Array(t).keys())};function w(t){return t/60/60}var _=function(t,n){var e,r,o,u,i=(e=t,r=n,function(){var t=this,n=arguments,i=function(){u=null,o||e.apply(t,n)},c=o&&!u;clearTimeout(u),u=setTimeout(i,r),c&&e.apply(t,n)});return function(n){n?i():t()}},I=function(t){return function(n){return-1!==t.indexOf(n)}}},function(t,n,e){"use strict";e.d(n,"a",(function(){return u}));var r,o=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),u=function(t){function n(n,e){var r=t.call(this,n+" has null value "+e)||this;return r.name="ArgumentNullError",r}return o(n,t),n}(Error)},function(t,n,e){"use strict";function r(t){var n=t.split("-");return{gameId:n[0],networkId:n[1],instanceId:n[2],playerId:n[3]}}function o(t){return[t.gameId,t.networkId,t.instanceId,t.playerId].join("-")}e.d(n,"a",(function(){return r})),e.d(n,"b",(function(){return o}))},function(t,n,e){"use strict";e.d(n,"a",(function(){return u}));var r,o=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),u=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.name="ResourseLoadError",n}return o(n,t),n}(Error)},function(n,e){n.exports=t},function(t,n,e){"use strict";e.d(n,"a",(function(){return u}));var r,o=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),u=function(t){function n(n,e){var r=t.call(this,n+" has "+e.toString()+" is out of range")||this;return r.name="ArgumentOutOfRange",r}return o(n,t),n}(Error)},function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var r=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}}},function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var r=function(){function t(){this.observers=[]}return t.prototype.raise=function(t){this.observers.forEach((function(n){return n(t)}))},t.prototype.subscribe=function(t){var n=this;return this.observers.push(t),function(){return n.unsubscribe(t)}},t.prototype.dispose=function(){this.observers=[]},t.prototype.unsubscribe=function(t){this.observers=this.observers.filter((function(n){return n!==t}))},t}()},function(t,n,e){"use strict";e.r(n);var r=e(9);e.d(n,"PostMessenger",(function(){return r.a}));var o=e(10);e.d(n,"ApplicationType",(function(){return o.a}));var u=e(11);for(var i in u)["PostMessenger","ApplicationType","default"].indexOf(i)<0&&function(t){e.d(n,t,(function(){return u[t]}))}(i)},function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var r=function(){function t(){}return t.prototype.sendCloseMessage=function(){this.send({type:"close"})},t.prototype.sendToggleDialogMode=function(t){this.send({type:"toggle-dialog-mode",payload:t})},t.prototype.track=function(t){this.send({type:"track",payload:t})},t.prototype.send=function(t){parent.postMessage(t,"*")},t}()},function(t,n,e){"use strict";var r;e.d(n,"a",(function(){return r})),function(t){t[t.CashOffers=0]="CashOffers",t[t.GrowthFund=1]="GrowthFund",t[t.SaleOffers=2]="SaleOffers",t[t.EventOffers=3]="EventOffers",t[t.DailyOffers=4]="DailyOffers"}(r||(r={}))},function(t,n){},function(t,n,e){"use strict";e.r(n);var r=e(13);e.d(n,"TrackActionRequest",(function(){return r.a}));var o=e(14);for(var u in o)["TrackActionRequest","default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(u)},function(t,n,e){"use strict";e.d(n,"a",(function(){return u}));var r=e(2),o=e(0),u=function(){function t(t,n,e){this.appType=t,this.searchParams=n,this.postMessenger=e}return t.prototype.execute=function(t,n){var e=this.createPayload(t,n);this.postMessenger.track(e)},t.prototype.createPayload=function(t,n){var e=Date.now(),u=Object(r.a)(this.searchParams.get("ping")),i=u.gameId,c=u.networkId,a=u.instanceId,s=u.playerId,f=this.searchParams.get("sid"),d=this.searchParams.get("zoneId");return Object(o.s)({playerId:s,instanceId:a,networkId:c,gameId:i,sid:f}),{eventId:1182,date:Object(o.j)(e),unixtimeMS:e,actionId:t,packageId:n.offerId,providerId:n.paymentProviderId,playerId:parseInt(s,10),instanceId:parseInt(a,10),networkId:parseInt(c,10),gameId:parseInt(i,10),zoneId:d?parseInt(d,10):void 0,sessionId:f,type:this.appType}},t}()},function(t,n){},function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var r=function(t){return t<0?"00:00:00":o(Math.floor(t%864e5/36e5))+":"+o(Math.floor(t%36e5/6e4))+":"+o(Math.floor(t%6e4/1e3))};function o(t){return t>9?t.toString(10):"0"+t}},function(t,n,e){"use strict";function r(){return"chrome"}e.d(n,"a",(function(){return r}))},function(t,n,e){"use strict";var r;e.d(n,"a",(function(){return o})),function(t){t[t.Factory=0]="Factory",t[t.Instance=1]="Instance",t[t.Constructor=2]="Constructor"}(r||(r={}));var o=function(){function t(){this.providers={},this.singletons={}}return t.prototype.resolve=function(t){var n=this,e=Object.entries(this.providers).find((function(n){return n[0]===t}));if(!e)throw new Error("ServiceLocator: cannot find "+t);e[0];var o=e[1];switch(o.type){case r.Constructor:return o.options.singleton?this.resolveSingleton(t,o.value):new o.value(this);case r.Instance:return o.value;case r.Factory:return function(){return o.value(n)}}},t.prototype.register=function(t,n,e){void 0===e&&(e={}),this.providers[t]={type:r.Constructor,value:n,options:e}},t.prototype.registerInstance=function(t,n){this.providers[t]={type:r.Instance,value:n,options:{}}},t.prototype.registerFactory=function(t,n){this.providers[t]={type:r.Factory,value:n,options:{}}},t.prototype.resolveSingleton=function(t,n){return this.singletons[t]||(this.singletons[t]=new n(this)),this.singletons[t]},t}()},function(t,n,e){"use strict";var r=e(0),o=function(){function t(t){this.url=t}return t.prototype.execute=function(t){Object(r.s)({locale:t});var n=t.replace(/zh_.*/,"zh"),e=Object(r.q)(this.url,{locale:n});return fetch(e,{headers:{"Cache-Control":"no-cache, max-age=0"}}).then((function(t){return t.json()})).then((function(t){return t[n]}))},t}(),u=e(1),i=function(){function t(t){this.url=t}return t.prototype.execute=function(t,n,e){if(Object(r.s)({gameId:t,locale:n}),0===e.length)throw new u.a("keys",e);var o=Object(r.f)(e.concat());return fetch(Object(r.q)(this.url,{gameId:t,locale:n,pattern:o})).then((function(t){return t.json()}))},t}(),c=e(3),a=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var u=arguments[n],i=0,c=u.length;i<c;i++,o++)r[o]=u[i];return r},s=function(){function t(t,n){void 0===n&&(n=[]),this.url=t,this.pattern=Object(r.f)(a(["webshop_*","value_percentage_add","generic_support","Presentreceived_title","equipment_itemType_baron","equipment_itemType_general","panel_action_stats","levelX_colon","generic_time_*","generic_minute_*","value_percentage"],n))}return t.prototype.execute=function(t,n){var e=this.createUrl(t,n);return fetch(e).then((function(t){return t.json()})).catch((function(t){return new c.a("LocaleRequest - cannot load ("+t.name+" "+t.message+")")}))},t.prototype.createUrl=function(t,n){return Object(r.s)({gameId:t,locale:n}),Object(r.q)(this.url,{gameId:t,locale:n,pattern:this.pattern})},t}();e.d(n,"b",(function(){return o})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){return s}))},function(t,n,e){"use strict";var r=e(4),o=function(t,n,e,r){var o,u=arguments.length,i=u<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,n,e,r);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(i=(u<3?o(i):u>3?o(n,e,i):o(n,e))||i);return u>3&&i&&Object.defineProperty(n,e,i),i},u=function(){function t(t){this.factory=t}return t.prototype.goTo=function(t,n){return this.currentViewModel&&this.currentViewModel.route===t?this.currentViewModel:(this.currentViewModel&&this.currentViewModel.dispose(),this.changeCurrentViewModel(t),this.currentViewModel.init(n),this.currentViewModel)},t.prototype.changeCurrentViewModel=function(t){this.currentViewModel=this.factory.create(t)},t.prototype.dispose=function(){this.currentViewModel&&this.currentViewModel.dispose()},o([r.observable],t.prototype,"currentViewModel",void 0),o([r.action.bound],t.prototype,"changeCurrentViewModel",null),t}();e.d(n,"a",(function(){return u}))},function(t,n,e){"use strict";var r=function(){function t(t){this.win=t}return t.prototype.goTo=function(t){this.win.location.href=t},t}();e.d(n,"a",(function(){return r}))},function(t,n,e){"use strict";e.r(n);var r=e(1);e.d(n,"ArgumentNullError",(function(){return r.a}));var o=e(5);e.d(n,"ArgumentOutOfRange",(function(){return o.a}));var u=e(6);e.d(n,"entityProvider",(function(){return u.a}));var i=e(2);e.d(n,"decodePing",(function(){return i.a})),e.d(n,"encodePing",(function(){return i.b}));var c=e(3);e.d(n,"ResourceLoadError",(function(){return c.a}));var a=e(0);e.d(n,"first",(function(){return a.d})),e.d(n,"last",(function(){return a.h})),e.d(n,"middle",(function(){return a.i})),e.d(n,"flatten",(function(){return a.e})),e.d(n,"distinct",(function(){return a.c})),e.d(n,"browser",(function(){return a.a})),e.d(n,"omit",(function(){return a.k})),e.d(n,"template",(function(){return a.q})),e.d(n,"urlTemplate",(function(){return a.r})),e.d(n,"validateForNull",(function(){return a.s})),e.d(n,"msToSec",(function(){return a.j})),e.d(n,"globPattern",(function(){return a.f})),e.d(n,"sortSubBy2Columns",(function(){return a.p})),e.d(n,"sortBy2Columns",(function(){return a.o})),e.d(n,"sleep",(function(){return a.n})),e.d(n,"repeat",(function(){return a.l})),e.d(n,"secToHrs",(function(){return a.m})),e.d(n,"conditionalDebounce",(function(){return a.b})),e.d(n,"includes",(function(){return a.g}));var s=e(7);e.d(n,"TypedEvent",(function(){return s.a}));var f=e(19);e.d(n,"NavService",(function(){return f.a}));var d=e(20);e.d(n,"AppWindow",(function(){return d.a}));var l=e(8);for(var p in l)["ArgumentNullError","ArgumentOutOfRange","entityProvider","decodePing","encodePing","ResourceLoadError","first","last","middle","flatten","distinct","browser","omit","template","urlTemplate","validateForNull","msToSec","globPattern","sortSubBy2Columns","sortBy2Columns","sleep","repeat","secToHrs","conditionalDebounce","includes","TypedEvent","NavService","AppWindow","default"].indexOf(p)<0&&function(t){e.d(n,t,(function(){return l[t]}))}(p);var v=e(12);for(var p in v)["ArgumentNullError","ArgumentOutOfRange","entityProvider","decodePing","encodePing","ResourceLoadError","first","last","middle","flatten","distinct","browser","omit","template","urlTemplate","validateForNull","msToSec","globPattern","sortSubBy2Columns","sortBy2Columns","sleep","repeat","secToHrs","conditionalDebounce","includes","TypedEvent","NavService","AppWindow","default"].indexOf(p)<0&&function(t){e.d(n,t,(function(){return v[t]}))}(p);var h=e(18);e.d(n,"PaymentLocalesRequest",(function(){return h.b})),e.d(n,"RewardLocalesRequest",(function(){return h.c})),e.d(n,"LocaleRequest",(function(){return h.a}));var y=e(15);e.d(n,"formatTimeLeft",(function(){return y.a}));var g=e(16);e.d(n,"detectBrowser",(function(){return g.a}));var m=e(17);e.d(n,"ServiceLocator",(function(){return m.a}))}])})); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("mobx")):"function"==typeof define&&define.amd?define("WebshopUtils",["mobx"],n):"object"==typeof exports?exports.WebshopUtils=n(require("mobx")):t.WebshopUtils=n(t.mobx)}(window,(function(t){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=21)}([function(t,n,e){"use strict";var r=e(1);e.d(n,"d",(function(){return i})),e.d(n,"h",(function(){return u})),e.d(n,"i",(function(){return c})),e.d(n,"e",(function(){return a})),e.d(n,"c",(function(){return s})),e.d(n,"a",(function(){return f})),e.d(n,"k",(function(){return d})),e.d(n,"q",(function(){return l})),e.d(n,"r",(function(){return p})),e.d(n,"s",(function(){return h})),e.d(n,"j",(function(){return v})),e.d(n,"f",(function(){return y})),e.d(n,"p",(function(){return g})),e.d(n,"o",(function(){return m})),e.d(n,"n",(function(){return b})),e.d(n,"l",(function(){return w})),e.d(n,"m",(function(){return O})),e.d(n,"b",(function(){return _})),e.d(n,"g",(function(){return I}));var o=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var i=arguments[n],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r},i=function(t){return t[0]},u=function(t){return t[t.length-1]},c=function(t){return t[Math.floor(t.length/2)]},a=function(t){return t.reduce((function(t,n){return t.concat(n)}),[])},s=function(t){return Array.from(new Set(t))},f=function(t){var n=t.browserName;return function(t){return-1!==t.indexOf(n)}},d=function(t,n){return Object.keys(t).reduce((function(e,r){return n!==r&&(e[r]=t[r]),e}),{})},l=function(t,n){void 0===n&&(n={});var e=Object.keys(n);if(0===e.length)return t;var r=i(e),o=n[r];if(void 0===o)throw new Error("template error "+r+", "+JSON.stringify(n));return l(t.replace("{"+r+"}",o.toString()),d(n,r))},p=function(t,n){void 0===n&&(n={});var e=Object.keys(n);if(0===e.length)return t;var r=i(e),o=n[r];if(void 0===o)throw new Error("template error "+r+", "+JSON.stringify(n));return l(t.replace(":"+r,o.toString()),d(n,r))};function h(t){for(var n=0,e=Object.keys(t);n<e.length;n++){var o=e[n],i=t[o];if(!i||Number.isNaN(i))throw new r.a(o,i)}}function v(t){return Math.floor(t/1e3)}function y(t){return encodeURIComponent("{"+t.join(",")+"}")}var g=function(t){var n=Math.ceil(t.length/2),e=t.slice(0,n),r=t.slice(n);return e.reduce((function(t,n,e){return t.push(n),e<r.length&&t.push(r[e]),t}),[])},m=function(t){return 0===t.length?[]:o(g(t.slice(0,6)),m(t.slice(6)))},b=function(t){return new Promise((function(n){return setTimeout(n,t)}))},w=function(t){return Array.from(Array(t).keys())};function O(t){return t/60/60}var _=function(t,n){var e,r,o,i,u=(e=t,r=n,function(){var t=this,n=arguments,u=function(){i=null,o||e.apply(t,n)},c=o&&!i;clearTimeout(i),i=setTimeout(u,r),c&&e.apply(t,n)});return function(n){n?u():t()}},I=function(t){return function(n){return-1!==t.indexOf(n)}}},function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var r,o=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),i=function(t){function n(n,e){var r=t.call(this,n+" has null value "+e)||this;return r.name="ArgumentNullError",r}return o(n,t),n}(Error)},function(t,n,e){"use strict";function r(t){var n=t.split("-");return{gameId:n[0],networkId:n[1],instanceId:n[2],playerId:n[3]}}function o(t){return[t.gameId,t.networkId,t.instanceId,t.playerId].join("-")}e.d(n,"a",(function(){return r})),e.d(n,"b",(function(){return o}))},function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var r,o=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),i=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.name="ResourseLoadError",n}return o(n,t),n}(Error)},function(n,e){n.exports=t},function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var r,o=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),i=function(t){function n(n,e){var r=t.call(this,n+" has "+e.toString()+" is out of range")||this;return r.name="ArgumentOutOfRange",r}return o(n,t),n}(Error)},function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var r=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}}},function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var r=function(){function t(){this.observers=[]}return t.prototype.raise=function(t){this.observers.forEach((function(n){return n(t)}))},t.prototype.subscribe=function(t){var n=this;return this.observers.push(t),function(){return n.unsubscribe(t)}},t.prototype.dispose=function(){this.observers=[]},t.prototype.unsubscribe=function(t){this.observers=this.observers.filter((function(n){return n!==t}))},t}()},function(t,n,e){"use strict";e.r(n);var r=e(9);e.d(n,"PostMessenger",(function(){return r.a}));var o=e(10);e.d(n,"ApplicationType",(function(){return o.a}));var i=e(11);for(var u in i)["PostMessenger","ApplicationType","default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(u)},function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var r=function(){function t(){}return t.prototype.sendCloseMessage=function(){this.send({type:"close"})},t.prototype.sendToggleDialogMode=function(t){this.send({type:"toggle-dialog-mode",payload:t})},t.prototype.track=function(t){this.send({type:"track",payload:t})},t.prototype.send=function(t){parent.postMessage(t,"*")},t}()},function(t,n,e){"use strict";var r;e.d(n,"a",(function(){return r})),function(t){t[t.CashOffers=0]="CashOffers",t[t.GrowthFund=1]="GrowthFund",t[t.SaleOffers=2]="SaleOffers",t[t.EventOffers=3]="EventOffers",t[t.DailyOffers=4]="DailyOffers"}(r||(r={}))},function(t,n){},function(t,n,e){"use strict";e.r(n);var r=e(13);e.d(n,"TrackActionRequest",(function(){return r.a}));var o=e(14);for(var i in o)["TrackActionRequest","default"].indexOf(i)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(i)},function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var r=e(2),o=e(0),i=function(){function t(t,n,e){this.appType=t,this.searchParams=n,this.postMessenger=e}return t.prototype.execute=function(t,n){var e=this.createPayload(t,n);this.postMessenger.track(e)},t.prototype.createPayload=function(t,n){var e=Date.now(),i=Object(r.a)(this.searchParams.get("ping")),u=i.gameId,c=i.networkId,a=i.instanceId,s=i.playerId,f=this.searchParams.get("sid"),d=this.searchParams.get("zoneId");return Object(o.s)({playerId:s,instanceId:a,networkId:c,gameId:u,sid:f}),{eventId:1182,date:Object(o.j)(e),unixtimeMS:e,actionId:t,packageId:n.offerId,providerId:n.paymentProviderId,playerId:parseInt(s,10),instanceId:parseInt(a,10),networkId:parseInt(c,10),gameId:parseInt(u,10),zoneId:d?parseInt(d,10):void 0,sessionId:f,type:this.appType}},t}()},function(t,n){},function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var r=function(t){return t<0?"00:00:00":o(Math.floor(t%864e5/36e5))+":"+o(Math.floor(t%36e5/6e4))+":"+o(Math.floor(t%6e4/1e3))};function o(t){return t>9?t.toString(10):"0"+t}},function(t,n,e){"use strict";function r(){return window.chrome&&(window.chrome.webstore||window.chrome.runtime)?"chrome":"undefined"!=typeof InstallTrigger?"firefox":!isIE&&window.StyleMedia?"edge":/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString()?"safari":window.opr&&opr.addons||window.opera||navigator.userAgent.indexOf(" OPR/")>=0?"opera":isChrome&&-1!=navigator.userAgent.indexOf("Edg")?"edge-chromium":document.documentMode?"ie":(isChrome||isOpera)&&window.CSS?"blink":void 0}e.d(n,"a",(function(){return r}))},function(t,n,e){"use strict";var r;e.d(n,"a",(function(){return o})),function(t){t[t.Factory=0]="Factory",t[t.Instance=1]="Instance",t[t.Constructor=2]="Constructor"}(r||(r={}));var o=function(){function t(){this.providers={},this.singletons={}}return t.prototype.resolve=function(t){var n=this,e=Object.entries(this.providers).find((function(n){return n[0]===t}));if(!e)throw new Error("ServiceLocator: cannot find "+t);e[0];var o=e[1];switch(o.type){case r.Constructor:return o.options.singleton?this.resolveSingleton(t,o.value):new o.value(this);case r.Instance:return o.value;case r.Factory:return function(){return o.value(n)}}},t.prototype.register=function(t,n,e){void 0===e&&(e={}),this.providers[t]={type:r.Constructor,value:n,options:e}},t.prototype.registerInstance=function(t,n){this.providers[t]={type:r.Instance,value:n,options:{}}},t.prototype.registerFactory=function(t,n){this.providers[t]={type:r.Factory,value:n,options:{}}},t.prototype.resolveSingleton=function(t,n){return this.singletons[t]||(this.singletons[t]=new n(this)),this.singletons[t]},t}()},function(t,n,e){"use strict";var r=e(0),o=function(){function t(t){this.url=t}return t.prototype.execute=function(t){Object(r.s)({locale:t});var n=t.replace(/zh_.*/,"zh"),e=Object(r.q)(this.url,{locale:n});return fetch(e,{headers:{"Cache-Control":"no-cache, max-age=0"}}).then((function(t){return t.json()})).then((function(t){return t[n]}))},t}(),i=e(1),u=function(){function t(t){this.url=t}return t.prototype.execute=function(t,n,e){if(Object(r.s)({gameId:t,locale:n}),0===e.length)throw new i.a("keys",e);var o=Object(r.f)(e.concat());return fetch(Object(r.q)(this.url,{gameId:t,locale:n,pattern:o})).then((function(t){return t.json()}))},t}(),c=e(3),a=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var i=arguments[n],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r},s=function(){function t(t,n){void 0===n&&(n=[]),this.url=t,this.pattern=Object(r.f)(a(["webshop_*","value_percentage_add","generic_support","Presentreceived_title","equipment_itemType_baron","equipment_itemType_general","panel_action_stats","levelX_colon","generic_time_*","generic_minute_*","value_percentage"],n))}return t.prototype.execute=function(t,n){var e=this.createUrl(t,n);return fetch(e).then((function(t){return t.json()})).catch((function(t){return new c.a("LocaleRequest - cannot load ("+t.name+" "+t.message+")")}))},t.prototype.createUrl=function(t,n){return Object(r.s)({gameId:t,locale:n}),Object(r.q)(this.url,{gameId:t,locale:n,pattern:this.pattern})},t}();e.d(n,"b",(function(){return o})),e.d(n,"c",(function(){return u})),e.d(n,"a",(function(){return s}))},function(t,n,e){"use strict";var r=e(4),o=function(t,n,e,r){var o,i=arguments.length,u=i<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,n,e,r);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(u=(i<3?o(u):i>3?o(n,e,u):o(n,e))||u);return i>3&&u&&Object.defineProperty(n,e,u),u},i=function(){function t(t){this.factory=t}return t.prototype.goTo=function(t,n){return this.currentViewModel&&this.currentViewModel.route===t?this.currentViewModel:(this.currentViewModel&&this.currentViewModel.dispose(),this.changeCurrentViewModel(t),this.currentViewModel.init(n),this.currentViewModel)},t.prototype.changeCurrentViewModel=function(t){this.currentViewModel=this.factory.create(t)},t.prototype.dispose=function(){this.currentViewModel&&this.currentViewModel.dispose()},o([r.observable],t.prototype,"currentViewModel",void 0),o([r.action.bound],t.prototype,"changeCurrentViewModel",null),t}();e.d(n,"a",(function(){return i}))},function(t,n,e){"use strict";var r=function(){function t(t){this.win=t}return t.prototype.goTo=function(t){this.win.location.href=t},t}();e.d(n,"a",(function(){return r}))},function(t,n,e){"use strict";e.r(n);var r=e(1);e.d(n,"ArgumentNullError",(function(){return r.a}));var o=e(5);e.d(n,"ArgumentOutOfRange",(function(){return o.a}));var i=e(6);e.d(n,"entityProvider",(function(){return i.a}));var u=e(2);e.d(n,"decodePing",(function(){return u.a})),e.d(n,"encodePing",(function(){return u.b}));var c=e(3);e.d(n,"ResourceLoadError",(function(){return c.a}));var a=e(0);e.d(n,"first",(function(){return a.d})),e.d(n,"last",(function(){return a.h})),e.d(n,"middle",(function(){return a.i})),e.d(n,"flatten",(function(){return a.e})),e.d(n,"distinct",(function(){return a.c})),e.d(n,"browser",(function(){return a.a})),e.d(n,"omit",(function(){return a.k})),e.d(n,"template",(function(){return a.q})),e.d(n,"urlTemplate",(function(){return a.r})),e.d(n,"validateForNull",(function(){return a.s})),e.d(n,"msToSec",(function(){return a.j})),e.d(n,"globPattern",(function(){return a.f})),e.d(n,"sortSubBy2Columns",(function(){return a.p})),e.d(n,"sortBy2Columns",(function(){return a.o})),e.d(n,"sleep",(function(){return a.n})),e.d(n,"repeat",(function(){return a.l})),e.d(n,"secToHrs",(function(){return a.m})),e.d(n,"conditionalDebounce",(function(){return a.b})),e.d(n,"includes",(function(){return a.g}));var s=e(7);e.d(n,"TypedEvent",(function(){return s.a}));var f=e(19);e.d(n,"NavService",(function(){return f.a}));var d=e(20);e.d(n,"AppWindow",(function(){return d.a}));var l=e(8);for(var p in l)["ArgumentNullError","ArgumentOutOfRange","entityProvider","decodePing","encodePing","ResourceLoadError","first","last","middle","flatten","distinct","browser","omit","template","urlTemplate","validateForNull","msToSec","globPattern","sortSubBy2Columns","sortBy2Columns","sleep","repeat","secToHrs","conditionalDebounce","includes","TypedEvent","NavService","AppWindow","default"].indexOf(p)<0&&function(t){e.d(n,t,(function(){return l[t]}))}(p);var h=e(12);for(var p in h)["ArgumentNullError","ArgumentOutOfRange","entityProvider","decodePing","encodePing","ResourceLoadError","first","last","middle","flatten","distinct","browser","omit","template","urlTemplate","validateForNull","msToSec","globPattern","sortSubBy2Columns","sortBy2Columns","sleep","repeat","secToHrs","conditionalDebounce","includes","TypedEvent","NavService","AppWindow","default"].indexOf(p)<0&&function(t){e.d(n,t,(function(){return h[t]}))}(p);var v=e(18);e.d(n,"PaymentLocalesRequest",(function(){return v.b})),e.d(n,"RewardLocalesRequest",(function(){return v.c})),e.d(n,"LocaleRequest",(function(){return v.a}));var y=e(15);e.d(n,"formatTimeLeft",(function(){return y.a}));var g=e(16);e.d(n,"detectBrowser",(function(){return g.a}));var m=e(17);e.d(n,"ServiceLocator",(function(){return m.a}))}])})); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146310
1556