fansunited-sdk-umd 1.35.0 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FansUnitedSDK=t():e.FansUnitedSDK=t()}(self,(function(){return(()=>{var e={9669:(e,t,n)=>{e.exports=n(1609)},5448:(e,t,n)=>{"use strict";var r=n(4867),i=n(6026),s=n(4372),a=n(5327),o=n(4097),u=n(4109),l=n(7985),c=n(5061),d=n(5655),h=n(5263);e.exports=function(e){return new Promise((function(t,n){var p,f=e.data,m=e.headers,v=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}r.isFormData(f)&&delete m["Content-Type"];var g=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(w+":"+b)}var _=o(e.baseURL,e.url);function E(){if(g){var r="getAllResponseHeaders"in g?u(g.getAllResponseHeaders()):null,s={data:v&&"text"!==v&&"json"!==v?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g};i((function(e){t(e),y()}),(function(e){n(e),y()}),s),g=null}}if(g.open(e.method.toUpperCase(),a(_,e.params,e.paramsSerializer),!0),g.timeout=e.timeout,"onloadend"in g?g.onloadend=E:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(E)},g.onabort=function(){g&&(n(c("Request aborted",e,"ECONNABORTED",g)),g=null)},g.onerror=function(){n(c("Network Error",e,null,g)),g=null},g.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||d.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(c(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",g)),g=null},r.isStandardBrowserEnv()){var I=(e.withCredentials||l(_))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;I&&(m[e.xsrfHeaderName]=I)}"setRequestHeader"in g&&r.forEach(m,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete m[t]:g.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(g.withCredentials=!!e.withCredentials),v&&"json"!==v&&(g.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&g.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&g.upload&&g.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){g&&(n(!e||e&&e.type?new h("canceled"):e),g.abort(),g=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),f||(f=null),g.send(f)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),i=n(1849),s=n(321),a=n(7185),o=function e(t){var n=new s(t),o=i(s.prototype.request,n);return r.extend(o,s.prototype,n),r.extend(o,n),o.create=function(n){return e(a(t,n))},o}(n(5655));o.Axios=s,o.Cancel=n(5263),o.CancelToken=n(4972),o.isCancel=n(6502),o.VERSION=n(7288).version,o.all=function(e){return Promise.all(e)},o.spread=n(8713),o.isAxiosError=n(6268),e.exports=o,e.exports.default=o},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),i=n(5327),s=n(782),a=n(3572),o=n(7185),u=n(4875),l=u.validators;function c(e){this.defaults=e,this.interceptors={request:new s,response:new s}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=o(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var i,s=[];if(this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)})),!r){var c=[a,void 0];for(Array.prototype.unshift.apply(c,n),c=c.concat(s),i=Promise.resolve(e);c.length;)i=i.then(c.shift(),c.shift());return i}for(var d=e;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{i=a(d)}catch(e){return Promise.reject(e)}for(;s.length;)i=i.then(s.shift(),s.shift());return i},c.prototype.getUri=function(e){return e=o(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(o(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,r){return this.request(o(r||{},{method:e,url:t,data:n}))}})),e.exports=c},782:(e,t,n)=>{"use strict";var r=n(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,n)=>{"use strict";var r=n(1793),i=n(7303);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,i,s){var a=new Error(e);return r(a,t,n,i,s)}},3572:(e,t,n)=>{"use strict";var r=n(4867),i=n(8527),s=n(6502),a=n(5655),o=n(5263);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new o("canceled")}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={};function i(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(e[n],t[n])}function a(e){if(!r.isUndefined(t[e]))return i(void 0,t[e])}function o(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(void 0,t[n])}function u(n){return n in t?i(e[n],t[n]):n in e?i(void 0,e[n]):void 0}var l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||s,i=t(e);r.isUndefined(i)&&t!==u||(n[e]=i)})),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867),i=n(5655);e.exports=function(e,t,n){var s=this||i;return r.forEach(n,(function(n){e=n.call(s,e,t)})),e}},5655:(e,t,n)=>{"use strict";var r=n(4867),i=n(6016),s=n(481),a={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=n(5448)),u),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(o(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(0,JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||i&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(a)})),e.exports=l},7288:e=>{e.exports={version:"0.24.0"}},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},5327:(e,t,n)=>{"use strict";var r=n(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(r.isURLSearchParams(t))s=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(i(t)+"="+i(e))})))})),s=a.join("&")}if(s){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,s,a){var o=[];o.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),r.isString(i)&&o.push("path="+i),r.isString(s)&&o.push("domain="+s),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,s,a={};return e?(r.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,n)=>{"use strict";var r=n(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var s={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new Error(i(r," has been removed"+(t?" in "+t:"")));return t&&!s[r]&&(s[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var s=r[i],a=t[s];if(a){var o=e[s],u=void 0===o||a(o,s,e);if(!0!==u)throw new TypeError("option "+s+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+s)}},validators:i}},4867:(e,t,n)=>{"use strict";var r=n(1849),i=Object.prototype.toString;function s(e){return"[object Array]"===i.call(e)}function a(e){return void 0===e}function o(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:o,isPlainObject:u,isUndefined:a,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:l,isStream:function(e){return o(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):s(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,(function(t,i){e[i]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},6245:(e,t,n)=>{"use strict";function r(e){this.message=e}n.r(t),n.d(t,{default:()=>o,InvalidTokenError:()=>a}),r.prototype=new Error,r.prototype.name="InvalidCharacterError";var i="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,a=0,o="";i=t.charAt(a++);~i&&(n=s%4?64*n+i:i,s++%4)?o+=String.fromCharCode(255&n>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};function s(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(i(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return i(t)}}function a(e){this.message=e}a.prototype=new Error,a.prototype.name="InvalidTokenError";const o=function(e,t){if("string"!=typeof e)throw new a("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(s(e.split(".")[n]))}catch(e){throw new a("Invalid token specified: "+e.message)}}},6595:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(682),i=n(2141),s=n(4241),a=n(6391),o=n(1512),u=n(4392),l=n(320),c=n(7631),d=n(6965),h=n(9158);t.default=function(){var e=this;this.validate=function(t){var n=e.checkFieldsForValues(t);return n.isValid=e.containsErrorMessage(n),n},this.checkFieldsForValues=function(e){for(var t=new c.default,n={apiKey:new o.default,environment:new a.default,idSchema:new u.default,clientId:new d.default,lang:new s.default,errorHandlingMode:new h.default,authProvider:new l.default},r=0,i=Object.entries(t);r<i.length;r++){var p=i[r],f=p[0];p[1],"isValid"!==f&&n[f].validate(e)}return Object.keys(n).forEach((function(r){t[r]=n[r].validate(e)})),t},this.containsErrorMessage=function(e){for(var t=!0,n=0,s=Object.entries(e);n<s.length;n++){var a=s[n],o=a[0],u=a[1];if(o!==r.ConfigFieldEnum.authProvider){if("isValid"!==o&&u.message.type===i.LogEnum.ERROR)return!1;if("isValid"!==o&&u.message.type===i.LogEnum.WARNING)return!0}else if(u.message.type===i.LogEnum.ERROR)return!1}return t}}},682:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigFieldEnum=void 0,(n=t.ConfigFieldEnum||(t.ConfigFieldEnum={})).apiKey="apiKey",n.environment="environment",n.idSchema="idSchema",n.clientId="clientId",n.lang="lang",n.authProvider="authProvider"},2671:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentEnum=void 0,(n=t.EnvironmentEnum||(t.EnvironmentEnum={})).DEV="dev",n.PROD="prod",n.STAGING="staging"},9580:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorHandlingModeEnum=void 0,(n=t.ErrorHandlingModeEnum||(t.ErrorHandlingModeEnum={})).DEFAULT="default",n.STANDARD="standard"},4946:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.IdSchemaEnum=void 0,(n=t.IdSchemaEnum||(t.IdSchemaEnum={})).NATIVE="native",n.ENETPULSE="enetpulse",n.SPORTRADAR="sportradar",n.SPORTAL_365="sportal365"},9377:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LangEnum=void 0,(n=t.LangEnum||(t.LangEnum={})).EN="en",n.BG="bg",n.RO="ro",n.EL="el"},2141:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogEnum=void 0,(n=t.LogEnum||(t.LogEnum={})).ERROR="error",n.WARNING="warning"},9028:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationMessageEnum=void 0,(n=t.ValidationMessageEnum||(t.ValidationMessageEnum={})).API_KEY="The field apiKey with valid value must be provided to use Fans United JS SDK",n.CLIENT_ID="The field clientId must be provided to use Fans United JS SDK",n.LANG_MISSING="If no lang is passed the default one will be set which is: en",n.LANG_INVALID="This lang value is not supported, the default one will be set which is: en",n.ID_SCHEMA_MISSING="If no idSchema is passed the default one will be set which is: native",n.ID_SCHEMA_INVALID="This idSchema value is not supported, the default one will be set which is: native",n.ENVIRONMENT_MISSING="If no environment is passed the default one will be set which is: prod",n.ENVIRONMENT_INVALID="This environment value is not supported, the default one will be set which is: prod",n.ERROR_HANDLING_MODE_MISSING="If no errorHandlingMode is passed the default one will be set which is: default",n.ERROR_HANDLING_MODE_INVALID="This errorHandlingMode value is not supported, the default one will be set which is: default",n.AUTH_PROVIDER_CONFIG_PROP_MISSING="The following property is missing from the authProvider object:",n.AUTH_PROVIDER_CONFIG_INVALID_PROP="You have passed a property which is not supported for the authentication provider:",n.AUTH_PROVIDER_CONFIG_MISSING="The field authProvider must be provided to use this SDK",n.AUTH_PROVIDER_CONFIG_MISSING_CONFIG="The field authProvider has missing properties"},9627:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationResponseEnum=void 0,(n=t.ValidationResponseEnum||(t.ValidationResponseEnum={})).MISSING_VALUE="missing",n.INVALID_VALUE="invalid",n.VALID_VALUE="valid"},7070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.getIdToken=null,this.logout=null}},2379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3220);t.default=function(){this.validation=null,this.message=new r.default,this.getIdToken={validation:null,message:new r.default},this.logout={validation:null,message:new r.default}}},7631:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3074);t.default=function(){this.apiKey=null,this.environment=null,this.idSchema=null,this.clientId=null,this.lang=null,this.errorHandlingMode=null,this.authProvider={getIdToken:new r.default,logout:new r.default},this.isValid=!1}},3220:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.text=null,this.type=null}},3074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},1512:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=function(){function e(){this.validateField=function(e){return null!=e&&e.length>0?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=s.LogEnum.ERROR;return e===r.ValidationResponseEnum.MISSING_VALUE&&(t=i.ValidationMessageEnum.API_KEY),e===r.ValidationResponseEnum.VALID_VALUE&&(n=null),{text:t,type:n}}}return e.prototype.validate=function(e){var t=this.validateField(e.apiKey);return{validation:t,message:this.generateMessage(t)}},e}();t.default=a},320:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=n(7070),o=n(2379),u=function(){function e(){this.validateAuthProvider=function(e){var t=Object.keys(new a.default),n=new o.default;if(e){var u=Object.keys(e).filter((function(e){return!t.includes(e)}));u.length>0?(n.validation=r.ValidationResponseEnum.INVALID_VALUE,n.message.type=s.LogEnum.WARNING,n.message.text=i.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_INVALID_PROP+" "+u.join(",")):n.validation=r.ValidationResponseEnum.VALID_VALUE}else n.validation=r.ValidationResponseEnum.MISSING_VALUE,n.message.type=s.LogEnum.ERROR,n.message.text=i.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_MISSING;return n},this.validateAuthProviderConfigFields=function(e,t){return Object.keys(new a.default).forEach((function(n){e[n]?t[n].validation=r.ValidationResponseEnum.VALID_VALUE:t[n].validation=r.ValidationResponseEnum.MISSING_VALUE})),t},this.generateAuthProviderConfigMessages=function(e){return Object.keys(e).filter((function(e){return"validation"!==e&&"message"!==e})).forEach((function(t){var n=e[t];n.validation===r.ValidationResponseEnum.MISSING_VALUE&&(n.message.text=i.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_PROP_MISSING+" "+t,n.message.type=s.LogEnum.ERROR)})),e},this.checkAuthProviderConfigMessagesForErrors=function(e){return Object.keys(e).filter((function(e){return"validation"!==e&&"message"!==e})).forEach((function(t){e[t].validation===r.ValidationResponseEnum.MISSING_VALUE&&e.validation===r.ValidationResponseEnum.VALID_VALUE&&(e.validation=r.ValidationResponseEnum.INVALID_VALUE,e.message.type=s.LogEnum.ERROR,e.message.text=i.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_MISSING_CONFIG)})),e}}return e.prototype.validate=function(e){var t=this.validateAuthProvider(e.authProvider);return t.validation!==r.ValidationResponseEnum.MISSING_VALUE&&(t=this.validateAuthProviderConfigFields(e.authProvider,t),t=this.generateAuthProviderConfigMessages(t),t=this.checkAuthProviderConfigMessagesForErrors(t)),t},e}();t.default=u},6965:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=function(){function e(){this.validateField=function(e){return null!=e&&e.length>0?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=s.LogEnum.ERROR;return e===r.ValidationResponseEnum.MISSING_VALUE&&(t=i.ValidationMessageEnum.CLIENT_ID),e===r.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}return e.prototype.validate=function(e){var t=this.validateField(e.clientId);return{validation:t,message:this.generateMessage(t)}},e}();t.default=a},6391:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=n(2671),o=function(){function e(){this.validateField=function(e){var t=[a.EnvironmentEnum.DEV,a.EnvironmentEnum.STAGING,a.EnvironmentEnum.PROD];return null!=e&&e.length>0?t.includes(e)?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.INVALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=s.LogEnum.WARNING;return e===r.ValidationResponseEnum.MISSING_VALUE&&(t=i.ValidationMessageEnum.ENVIRONMENT_MISSING),e===r.ValidationResponseEnum.INVALID_VALUE&&(t=i.ValidationMessageEnum.ENVIRONMENT_INVALID),e===r.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}return e.prototype.validate=function(e){var t=this.validateField(e.environment);return{validation:t,message:this.generateMessage(t)}},e}();t.default=o},9158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9580),i=n(2141),s=n(9028),a=n(9627);t.default=function(){var e=this;this.validate=function(t){var n=e.validateField(t.errorHandlingMode);return{validation:n,message:e.generateMessage(n)}},this.validateField=function(e){var t=[r.ErrorHandlingModeEnum.DEFAULT,r.ErrorHandlingModeEnum.STANDARD];return e?t.includes(e)?a.ValidationResponseEnum.VALID_VALUE:a.ValidationResponseEnum.INVALID_VALUE:a.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=i.LogEnum.WARNING;return e===a.ValidationResponseEnum.MISSING_VALUE&&(t=s.ValidationMessageEnum.ERROR_HANDLING_MODE_MISSING),e===a.ValidationResponseEnum.INVALID_VALUE&&(t=s.ValidationMessageEnum.ERROR_HANDLING_MODE_INVALID),e===a.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}},4392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=n(4946),o=function(){function e(){this.validateField=function(e){var t=[a.IdSchemaEnum.NATIVE,a.IdSchemaEnum.SPORTAL_365,a.IdSchemaEnum.ENETPULSE,a.IdSchemaEnum.SPORTRADAR];return null!=e&&e.length>0?t.includes(e)?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.INVALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=s.LogEnum.WARNING;return e===r.ValidationResponseEnum.MISSING_VALUE&&(t=i.ValidationMessageEnum.ID_SCHEMA_MISSING),e===r.ValidationResponseEnum.INVALID_VALUE&&(t=i.ValidationMessageEnum.ID_SCHEMA_INVALID),e===r.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}return e.prototype.validate=function(e){var t=this.validateField(e.idSchema);return{validation:t,message:this.generateMessage(t)}},e}();t.default=o},4241:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9377),i=n(9627),s=n(9028),a=n(2141);t.default=function(){var e=this;this.validate=function(t){var n=e.validateField(t.lang);return{validation:n,message:e.generateMessage(n)}},this.validateField=function(e){var t=[r.LangEnum.BG,r.LangEnum.RO,r.LangEnum.EN,r.LangEnum.EL];return null!=e&&e.length>0?t.includes(e)?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.INVALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=a.LogEnum.WARNING;return e===i.ValidationResponseEnum.MISSING_VALUE&&(t=s.ValidationMessageEnum.LANG_MISSING),e===i.ValidationResponseEnum.INVALID_VALUE&&(t=s.ValidationMessageEnum.LANG_INVALID),e===i.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}},4021:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCodes=void 0,(n=t.ErrorCodes||(t.ErrorCodes={}))[n.BAD_METHOD_CALL=400]="BAD_METHOD_CALL",n[n.UNAUTHORIZED=401]="UNAUTHORIZED"},4904:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorStatuses=void 0,(n=t.ErrorStatuses||(t.ErrorStatuses={})).INVALID_TEMPLATE="INVALID_TEMPLATE",n.INVALID_PREDICTION="INVALID_PREDICTION",n.INVALID_MARKET="INVALID_MARKET",n.INVALID_FIELD="INVALID_FIELD",n.INVALID_TYPE="INVALID_TYPE",n.EXCEEDED_LENGTH="EXCEEDED_LENGTH",n.INVALID_TOKEN="invalid_token",n.UNAUTHORIZED="unauthorized",n.INVALID_FILTERS="invalid_filters",n.INVALID_AVATAR="invalid_avatar"},8097:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t,n,r){var i=e.call(this)||this;return i.code=0,i.status=null,i.message=null,i.errorMessage=function(){return i.message},i.code=t,i.status=n,i.message=r,i}return r(t,e),t}(Error);t.default=i},2535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t,n){this.response={error:{code:0,status:"",message:""}},this.response.error.code=e,this.response.error.status=t,this.response.error.message=n}},1260:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validFixtureFields=t.documentationLinks=t.ID_TYPES=void 0,t.ID_TYPES={native:"id",sportradar:"sportradar_id",sportal365:"sportal365_id",enetpulse:"enetpulse_id"},t.documentationLinks={PREDICTOR_USER_RELATED_OPERATION:"https://docs.fansunitedmedia.com/docs/predictor-operations#user-related-operations"},t.validFixtureFields=["matchId","matchType","market","prediction"]},817:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EntityTypeEnum=void 0,(n=t.EntityTypeEnum||(t.EntityTypeEnum={})).COMPETITION="competition",n.TEAM="team",n.PLAYER="player"},5409:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SportSourceEnum=void 0,(n=t.SportSourceEnum||(t.SportSourceEnum={})).FOOTBALL="FOOTBALL",n.CUSTOM="CUSTOM"},712:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.constructStringArrayWithProvidedLength=t.sortArrayInAscOrder=t.initDisableCache=t.isDisabledCache=t.transformIdsToBeUnique=t.setBaseUrl=t.limitIds=t.requestChunkBuild=void 0;var r=n(2671);t.requestChunkBuild=function(e){var t=[],n=0;return t[n]=[],e.forEach((function(e){t[n].length<=199?t[n].push(e):(n++,t[n]=[e])})),t},t.limitIds=function(e,t){for(var n=[];e.length>t;){var r=e.splice(0,t);n.push(r)}return n.push(e),n},t.setBaseUrl=function(e,t){return e===r.EnvironmentEnum.PROD?{profile:"https://profile.fansunitedapi.com/v1",football:"https://football.fansunitedapi.com/v1",idMapping:"https://id-mapping.fansunitedapi.com/v1",predictor:"https://prediction.fansunitedapi.com/v1",client:"https://client.fansunitedapi.com/v1",loyalty:"https://loyalty.fansunitedapi.com/v1"}[t]:e===r.EnvironmentEnum.DEV?{profile:"http://localhost:8010/v1",football:"http://localhost:8080/v1",idMapping:"http://localhost:8030/v1",predictor:"http://localhost:8040/v1",client:"http://localhost:8070/v1",loyalty:"http://localhost:8060/v1"}[t]:{profile:"https://profile.fansunitedstagingapi.com/v1",football:"https://football.fansunitedstagingapi.com/v1",idMapping:"https://id-mapping.fansunitedstagingapi.com/v1",predictor:"https://prediction.fansunitedstagingapi.com/v1",client:"https://client.fansunitedstagingapi.com/v1",loyalty:"https://loyalty.fansunitedstagingapi.com/v1"}[t]},t.transformIdsToBeUnique=function(e){return e.filter((function(e,t,n){return t===n.indexOf(e)}))},t.isDisabledCache=function(e){return e||!1},t.initDisableCache=function(){return"&disable_cache="+Date.now()},t.sortArrayInAscOrder=function(e){return JSON.parse(JSON.stringify(e.sort((function(e,t){return e.localeCompare(t)}))))},t.constructStringArrayWithProvidedLength=function(e,t){for(var n=[],r=0;r<t;r++)n[r]=e;return n}},5601:function(e,t,n){"use strict";var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1260),s="FansUnited",a={football:{ids:[],countries:[],competitions:[],expirations:{ids:0}},profile:{info:{},statistics:{},badges:null,countries:[],expirations:{profile:0,statistics:0,badges:0}},client:{features:{},expirations:{features:0}}};t.default=function(e){var t=this;this.idSchema="",this.expirationProfileTimeout=600,this.expirationBadgesTimeout=3600,this.expirationClientFeaturesTimeout=14400,this.expirationFootballIdsTimeout=604800,this.clearData=function(){t.setData(a)},this.getEntityById=function(e,n){return void 0===e&&(e=""),void 0===n&&(n=""),t.getData().football.ids.find((function(r){var s=i.ID_TYPES[t.idSchema];return r&&""+r[s]===n&&r.resource===e}))},this.getEntity=function(e,n,r){return Array.isArray(e)?t.getData().football.ids.filter((function(t){var s=i.ID_TYPES[r];return t&&e.includes(""+t[s])&&t.resource===n})):t.getData().football.ids.find((function(t){var s=i.ID_TYPES[r];return t&&""+t[s]===e&&t.resource===n}))},this.getEntityByNativeId=function(e,n){return void 0===e&&(e=""),void 0===n&&(n=""),t.getData().football.ids.find((function(t){return t&&""+t.id===n&&t.resource===e}))},this.checkForExistingIdObjs=function(e,n){var r=i.ID_TYPES[n],s={};return Object.keys(e).forEach((function(i){var a=e[i],o=t.getEntity(a,i,n).map((function(e){return e[r]})),u=e[i].filter((function(e){return!o.includes(e)}));s[i]=a.map((function(e){return u.includes(e)?{id:e,exists:!1}:{id:e,exists:!0}}))})),s},this.getIdsByType=function(e,n,r){var s=i.ID_TYPES[r],a=i.ID_TYPES[n],o={};return Object.keys(e).forEach((function(n){var r=e[n],i=[];t.getData().football.ids.forEach((function(e){r.forEach((function(t,r){t===e[a]&&n===e.resource&&(i[r]=e[s])}))})),o[n]=i})),o},this.addIdMapping=function(e){var n=t.getData();n.football.ids.push(e),t.setData(n)},this.addIdMappings=function(e){var n=t.getData(),i=n.football.ids;i=r(r([],i,!0),e,!0),n.football.ids=i,t.setData(n)},this.addTopIdMappings=function(e){var n=t.getData();if(n.football.ids.length){var i=JSON.parse(JSON.stringify(n.football.ids));i=i.filter((function(e){return"match"!==e.resource})),e=e.filter((function(e){return"match"===e.resource})),i=r(r([],i,!0),e,!0),n.football.ids=i}else n.football.ids=e;n.football.expirations.ids=Math.floor(Date.now()/1e3)+t.expirationFootballIdsTimeout,t.setData(n)},this.setOwnProfile=function(e){var n=t.getData();n.profile.info=e,n.profile.expirations.profile=Math.floor(Date.now()/1e3)+t.expirationProfileTimeout,t.setData(n)},this.getOwnProfile=function(){return t.getData().profile.info},this.getProfileCountries=function(){return t.getData().profile.countries},this.setProfileCountries=function(e){var n=t.getData();n.profile.countries=e,t.setData(n)},this.getProfileStats=function(){return t.getData().profile.statistics},this.setProfileStats=function(e){var n=t.getData();n.profile.statistics=e,n.profile.expirations.statistics=Math.floor(Date.now()/1e3)+t.expirationProfileTimeout,t.setData(n)},this.getProfileBadges=function(){return t.getData().profile.badges},this.setProfileBadges=function(e){var n=t.getData();n.profile.badges=e,n.profile.expirations.badges=Math.floor(Date.now()/1e3)+t.expirationBadgesTimeout,t.setData(n)},this.getFootballCountries=function(){return t.getData().football.countries},this.setFootballCountries=function(e){var n=t.getData();n.football.countries=e,t.setData(n)},this.getCompetitions=function(e){var n=t.getData();return e?e.competitionSearchFilter(n.football.competitions):n.football.competitions},this.setCompetitions=function(e){var n=t.getData(),i=r([],n.football.competitions,!0);i.push.apply(i,e),n.football.competitions=t.makeCompetitionsUnique(i),t.setData(n)},this.getCompetitionsLength=function(){return t.getData().football.competitions.length},this.getClientFeatures=function(){return t.getData().client.features},this.setClientFeatures=function(e){var n=t.getData(),r=JSON.parse(JSON.stringify(e));n.client.expirations.features=Math.floor(Date.now()/1e3)+t.expirationClientFeaturesTimeout,n.client.features=r,t.setData(n)},this.getExpiration=function(e,n){t.initialNewSchema(e,"expirations");var r=t.getData();switch(n){case"profile":return r.profile.expirations.profile;case"statistics":return r.profile.expirations.statistics;case"badges":return r.profile.expirations.badges;case"features":return r.client.expirations.features;case"ids":return r.football.expirations.ids}},this.makeCompetitionsUnique=function(e){var t=new Set;return e.filter((function(e){var n=!t.has(e.id);return t.add(e.id),n}))},this.getData=function(){return JSON.parse(localStorage.getItem(s))},this.setData=function(e){localStorage.setItem(s,JSON.stringify(e))},this.initialNewSchema=function(e,n){var r=t.getData();r&&r[e]&&r[e][n]||t.setData(a)},this.idSchema=e.idSchema,void 0!==this.getData()&&null!==this.getData()||this.setData(a)}},5318:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invalidTypeMessage=t.missingFieldsMessage=t.invalidFieldMessage=t.invalidMarketTopXMessage=t.invalidMarketMessage=t.invalidPredictionMessage=t.WarningMessages=t.ErrorMessages=void 0;var r,i=n(1260);(r=t.ErrorMessages||(t.ErrorMessages={})).LOYALTY_INVALID_TEMPLATE_ID="Provided template ID does NOT exist! Try again with existing template ID.",r.INVALID_MATCH_ID="Match id is invalid!",r.INVALID_PLAYER_ID="Player id is invalid!",r.QUERY_PARAM_MATCH_IDS_EXCEEDED="Maximum matchIds in PredictionFilters should be 10 or less.",r.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED="Maximum limit for filtering games is 50 or less.",r.INVALID_PREDICTION_FIELD="Prediction field is invalid. For more information please visit our documentation",r.INVALID_TOKEN="Invalid JWT token is provided",r.EXPIRED_TOKEN="The provided JWT token is expired",r.ENTITIES_NEEDED="At least one of footballCompetitions, footballTeams or footballPlayers properties should be provided for filters.",r.ENTITIES_FOLLOWS_FILTERS_EXCEEDED="Maximum length per entity should be 24 or less.",r.INVALID_TYPE="You have provided invalid type. The valid type is ",r.INVALID_VALUE="You have provided invalid value. The valid value is ",r.INVALID_AVATAR="Invalid URL syntax for avatar image.",t.WarningMessages={UNEXPECTED_STATUS_PROP:"Unexpected provided property 'status'. You can NOT use this property for this method. For more information visit our documentation: \n "+i.documentationLinks.PREDICTOR_USER_RELATED_OPERATION,UNEXPECTED_TYPE_PROP:"Unexpected provided property 'type'. You can NOT use this property for this method. For more information visit our documentation: \n "+i.documentationLinks.PREDICTOR_USER_RELATED_OPERATION},t.invalidPredictionMessage=function(e,t){return"The prediction '"+e+"' is invalid for market '"+t+"'. Please check again have you passed appropriate prediction model. For more information please visit our documentation: https://docs.fansunitedmedia.com/sdks/js/match.quiz#gamerelatedoperations"},t.invalidMarketMessage=function(e){return"The market '"+e+"' is not supported from Fans United. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/predictor-operations#make-football-prediction"},t.invalidMarketTopXMessage=function(e){return"The market '"+e+"' is not valid for Top X game. The only available market is CORRECT_SCORE."},t.invalidFieldMessage=function(e){return"The field/s '"+(e.length>1?e.join(", "):e[0])+"' is/are invalid. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/javascript-sdk"},t.missingFieldsMessage=function(e,t){return"The following field/s is/are missing from "+e+": '"+(t.length>1?t.join(", "):t[0])+"'. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/predictor-operations#make-football-prediction"},t.invalidTypeMessage=function(e,t){return"The field "+e+" has incorrect type. The correct type is "+t}},4800:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.limit=e.limit?e.limit:null,this.startAfter=e.startAfter?e.startAfter:null}return e.prototype.constructMainFiltersUrl=function(){var e="";return this.limit&&(e+="&",e+="limit="+this.limit),this.startAfter&&(e+="&",e+="start_after="+this.startAfter),e},e}();t.default=n},439:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.main=null,this.cover=null,this.mobile=null}},8872:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8902);t.default=function(){this.pagination=new r.default}},8902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.nextPageStartsAfter=null,this.itemsPerPage=null}},1553:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8872);t.default=function(){this.meta=new r.default,this.data=[]}},3623:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8872);t.default=function(){this.remapMetaData=function(e){var t=new r.default;return t.pagination.nextPageStartsAfter=e.pagination.next_page_starts_after,t.pagination.itemsPerPage=e.pagination.items_per_page,t}}},3483:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.entityId=null,this.entityType=null}},6208:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.axiosError=void 0,t.axiosError=function(e,t,n){var r={data:e.data,status:t,statusText:n,headers:e.headers,config:e};return{code:String(t),config:e,isAxiosError:!0,toJSON:function(){return{}},name:"Unauthorized",message:n,response:r}}},1022:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(2453),l=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"loyalty"))||this;return n.activityRemapper=null,n.createActivity=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),t="/activities"+this.apiSignInUrl,[4,this.instanceAuth.post(t,JSON.stringify(e))];case 1:return n=s.sent(),[2,this.activityRemapper.remapSingleResponse(n.data)];case 2:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem with creating activity for user",i),i.response;case 3:return[2]}}))}))},n.deleteActivity=function(e){return s(n,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t="/activities/"+e+this.apiSignInUrl,[4,this.instanceAuth.delete(t)];case 1:return i.sent(),[2,!0];case 2:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem deleting the following activity: "+e,r),r.response;case 3:return[2]}}))}))},n.getOwnActivities=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/activities"+this.apiSignInUrl,r=Date.now(),e&&(n+=""+e.constructFilterUrl()),t&&(n+="disable_cache="+r),[4,this.instanceAuth.get(n)];case 1:return i=a.sent(),[2,this.activityRemapper.remapActivitiesResponse(i.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with fetching own activities",o),o.response;case 3:return[2]}}))}))},n.getActivitiesForUser=function(e,t,r){return s(n,void 0,void 0,(function(){var n,i,s,o,u;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/users/"+e+"/activities"+this.apiSignInUrl,i=Date.now(),t&&(n+=""+t.constructFilterUrl()),r&&(n+="disable_cache="+i),[4,this.instance.get(n)];case 1:return s=a.sent(),[2,this.activityRemapper.remapActivitiesResponse(s.data)];case 2:throw o=a.sent(),u=this.transformAxiosErrorToFansUnitedException(o),console.warn("There was a problem with fetching activities for user "+e,u),u.response;case 3:return[2]}}))}))},n.getStats=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),n="",r=null,e?(n+=(0,o.isDisabledCache)(t)?"/users/"+e+"/statistics"+this.apiSignInUrl+(0,o.initDisableCache)():"/users/"+e+"/statistics"+this.apiSignInUrl,[4,this.instance.get(n)]):[3,2];case 1:return r=a.sent(),[3,4];case 2:return n+="/statistics"+this.apiSignInUrl,[4,this.instanceAuth.get(n)];case 3:r=a.sent(),a.label=4;case 4:return[2,this.activityRemapper.remapStatsReponse(r.data.data)];case 5:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching profile`s statistics:",s),s.response;case 6:return[2]}}))}))},n.activityRemapper=new u.default,n}return i(t,e),t}(n(7724).default);t.default=l},7686:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureConfigType=void 0;var o,u=n(712),l=n(704),c=n(7724),d=n(5601);(o=t.FeatureConfigType||(t.FeatureConfigType={})).PREDICTOR="predictor",o.TOP_X="topX",o.MATCH_QUIZ="matchQuiz",o.LOYALTY="loyalty";var h=function(e){function t(t){var n=e.call(this,t,(0,u.setBaseUrl)(t.environment,"client"))||this;return n.featureConfigRemapper=null,n.localStorage=null,n.clientId=null,n.getConfig=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(t=this.getCachedFeatures())?[3,2]:(n="/clients/"+this.clientId+"/features",r=this.apiSignInUrl.split("&")[0],[4,this.instance.get(""+n+r)]);case 1:i=a.sent(),t=i.data.data,this.localStorage.setClientFeatures(t),a.label=2;case 2:switch(e){case"predictor":return[2,this.featureConfigRemapper.remapPredictorConfig(t.predictor)];case"topX":return[2,this.featureConfigRemapper.remapTopXConfig(t.top_x)];case"matchQuiz":return[2,this.featureConfigRemapper.remapMatchQuizConfig(t.match_quiz)];case"loyalty":return[2,this.featureConfigRemapper.remapLoyaltyConfig(t.loyalty)]}return[3,4];case 3:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching configuration from Client API",o),o.response;case 4:return[2]}}))}))},n.getCachedFeatures=function(){var e=n.getLocalStorageData();if(e&&Object.keys(e).length)return e},n.getLocalStorageData=function(){var e=Math.floor(Date.now()/1e3);return n.localStorage.getExpiration("client","features")>e?n.localStorage.getClientFeatures():null},n.clientId=t.clientId,n.localStorage=new d.default(t),n.featureConfigRemapper=new l.default,n}return i(t,e),t}(c.default);t.default=h},595:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(3430),l=n(7316),c=n(8758),d=n(5827),h=n(7821),p=n(5284),f=n(9330),m=n(4729),v=n(5157),y=n(7943),g=n(7287),w=n(753),b=n(1925),_=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"football"))||this;return n.limitIds=200,n.countryRemapper=null,n.competitionBasicRemapper=null,n.competitionFullRemapper=null,n.teamBasicRemapper=null,n.teamFullRemapper=null,n.matchBasicRemapper=null,n.matchFullRemapper=null,n.playerBasicRemapper=null,n.playerFullRemapper=null,n.topPlayerRemapper=null,n.searchRemapper=null,n.footballMetaRemapper=null,n.getCountries=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="/countries"+this.apiSignInUrl,n=Date.now(),e&&(t+="&disable_cache="+n),[4,this.instance.get(t)];case 1:return r=a.sent(),[2,this.countryRemapper.countriesFromResponse(r.data.data)];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem with the football countries request",s),s.response;case 3:return[2]}}))}))},n.getCompetitions=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,l,c,d,h,p,f=this;return a(this,(function(a){switch(a.label){case 0:if(a.trys.push([0,8,,9]),n={},r=Date.now(),t=t||!1,!(e&&e.competitionIds&&e.competitionIds.length>this.limitIds-1))return[3,5];i=[],s=(0,o.limitIds)(e.competitionIds,this.limitIds),u=0,l=s,a.label=1;case 1:return u<l.length?(c=l[u],e.competitionIds=c,d="/competitions"+this.apiSignInUrl+e.constructFilterUrl(),t&&(d+="&disable_cache="+r),[4,this.instance.get(d)]):[3,4];case 2:n=a.sent(),i.push(n.data.data.map((function(e){return f.competitionBasicRemapper.fromResponse(e)}))),a.label=3;case 3:return u++,[3,1];case 4:return[2,Array.prototype.concat.apply([],i)];case 5:return d="/competitions"+this.apiSignInUrl,e&&(d+=""+e.constructFilterUrl()),t&&(d+="&disable_cache="+r),[4,this.instance.get(d)];case 6:return[2,(n=a.sent()).data.data.map((function(e){return f.competitionBasicRemapper.fromResponse(e)}))];case 7:return[3,9];case 8:throw h=a.sent(),p=this.transformAxiosErrorToFansUnitedException(h),console.warn("There was a problem with getCompetitions request",p),p.response;case 9:return[2]}}))}))},n.getCompetitionById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/competitions/"+e+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.competitionFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getCompetitionById request",o),o.response;case 3:return[2]}}))}))},n.getTopCompetitions=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="/competitions/top"+this.apiSignInUrl,n=Date.now(),e&&(t+="&disable_cache="+n),[4,this.instance.get(t)];case 1:return[2,a.sent().data.data.map((function(e){return s.competitionBasicRemapper.fromResponse(e)}))];case 2:throw r=a.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem with getTopCompetitions request",i),i.response;case 3:return[2]}}))}))},n.getTeams=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,l,c,d,h,p,f,m=this;return a(this,(function(a){switch(a.label){case 0:if(a.trys.push([0,8,,9]),n={},r=Date.now(),!(e&&e.teamIds&&e.teamIds.length>this.limitIds))return[3,5];i=[],s=(0,o.limitIds)(e.teamIds,this.limitIds),u=0,l=s,a.label=1;case 1:return u<l.length?(c=l[u],e.teamIds=c,h="/teams"+this.apiSignInUrl+e.constructFilterUrl(),t&&(h+="disable_cache="+r),[4,this.instance.get(h)]):[3,4];case 2:n=a.sent(),i.push(n.data.data.map((function(e){return m.teamBasicRemapper.fromResponse(e)}))),a.label=3;case 3:return u++,[3,1];case 4:return[2,Array.prototype.concat.apply([],i)];case 5:return d=new w.default,h="/teams"+this.apiSignInUrl,e&&(h+=""+e.constructFilterUrl()),t&&(h+="&disable_cache="+r),[4,this.instance.get(h)];case 6:return n=a.sent(),d.meta=this.footballMetaRemapper.remapMetaProp(n.data.meta),d.data=n.data.data.map((function(e){return m.teamBasicRemapper.fromResponse(e)})),[2,d];case 7:return[3,9];case 8:throw p=a.sent(),f=this.transformAxiosErrorToFansUnitedException(p),console.warn("There was a problem with getTeams request",f),f.response;case 9:return[2]}}))}))},n.getTeamById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/teams/"+e+this.apiSignInUrl,r=Date.now(),t&&(n+="disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.teamFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getTeamById request",o),o.response;case 3:return[2]}}))}))},n.getTopTeams=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s,o=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="/teams/top"+this.apiSignInUrl,n=Date.now(),e&&(t+="$disable_cache="+n),[4,this.instance.get(t)];case 1:return[2,(r=a.sent()).data.data?r.data.data.map((function(e){return o.teamBasicRemapper.fromResponse(e)})):[]];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem with getTopTeams request",s),s.response;case 3:return[2]}}))}))},n.getNextMatchForTeam=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/teams/"+e+"/next-match"+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getNextMatchForTeam request",o),o.response;case 3:return[2]}}))}))},n.getPrevMatchForTeam=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/teams/"+e+"/previous-match"+this.apiSignInUrl,r=Date.now(),t&&(n+="disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getPrevMatchForTeam request",o),o.response;case 3:return[2]}}))}))},n.getPlayers=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,l,c,d,h,p,f,m=this;return a(this,(function(a){switch(a.label){case 0:if(a.trys.push([0,8,,9]),n={},r=Date.now(),!(e&&e.playerIds&&e.playerIds.length>this.limitIds-1))return[3,5];i=[],s=(0,o.limitIds)(e.playerIds,this.limitIds),u=0,l=s,a.label=1;case 1:return u<l.length?(c=l[u],e.playerIds=c,h="/players"+this.apiSignInUrl+e.constructFilterUrl(),t&&(h+="&disable_cache="+r),[4,this.instance.get(h)]):[3,4];case 2:n=a.sent(),i.push(n.data.data.map((function(e){return m.teamBasicRemapper.fromResponse(e)}))),a.label=3;case 3:return u++,[3,1];case 4:return[2,Array.prototype.concat.apply([],i)];case 5:return d=new w.default,h="/players"+this.apiSignInUrl,e&&(h+=""+e.constructFilterUrl()),t&&(h+="&disable_cache="+r),[4,this.instance.get(h)];case 6:return n=a.sent(),d.meta=this.footballMetaRemapper.remapMetaProp(n.data.meta),d.data=n.data.data.map((function(e){return m.playerBasicRemapper.fromResponse(e)})),[2,d];case 7:return[3,9];case 8:throw p=a.sent(),f=this.transformAxiosErrorToFansUnitedException(p),console.warn("There was a problem with getPlayers request",f),f.response;case 9:return[2]}}))}))},n.getPlayerById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/players/"+e+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.playerFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getPlayerById request",o),o.response;case 3:return[2]}}))}))},n.getTopPlayers=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="/players/top"+this.apiSignInUrl,n=Date.now(),e&&(t+="&disable_cache="+n),[4,this.instance.get(t)];case 1:return[2,a.sent().data.data.map((function(e){return s.topPlayerRemapper.fromResponse(e)}))];case 2:throw r=a.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem with getTopPlayers request",i),i.response;case 3:return[2]}}))}))},n.getNextMatchForPlayer=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/players/"+e+"/next-match"+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getNextMatchForPlayer request",o),o.response;case 3:return[2]}}))}))},n.getPrevMatchForPlayer=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/players/"+e+"/previous-match"+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getPrevMatchForPlayer request",o),o.response;case 3:return[2]}}))}))},n.getMatchById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/matches/"+e+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getMatchById request",o),o.response;case 3:return[2]}}))}))},n.getMatches=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o,u,l=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=new w.default,r="/matches"+this.apiSignInUrl,i=Date.now(),e&&(r+=""+e.constructFilterUrl()),t&&(r+="&disable_cache="+i),[4,this.instance.get(r)];case 1:return s=a.sent(),n.meta=this.footballMetaRemapper.remapMetaProp(s.data.meta),n.data=s.data.data.map((function(e){return l.matchBasicRemapper.fromResponse(e)})),[2,n];case 2:throw o=a.sent(),u=this.transformAxiosErrorToFansUnitedException(o),console.warn("There was a problem with getMatches request",u),u.response;case 3:return[2]}}))}))},n.search=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/search"+this.apiSignInUrl+e.constructFilterUrl(),r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.searchRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with search request",o),o.response;case 3:return[2]}}))}))},n.apiSignInUrl="en"!==t.lang?n.apiSignInUrl+"&lang="+t.lang:n.apiSignInUrl,n.countryRemapper=new u.default,n.competitionBasicRemapper=new l.default,n.competitionFullRemapper=new c.default,n.teamBasicRemapper=new d.default,n.teamFullRemapper=new h.default,n.matchBasicRemapper=new p.default,n.matchFullRemapper=new f.default,n.playerBasicRemapper=new v.default,n.playerFullRemapper=new y.default,n.topPlayerRemapper=new m.default,n.searchRemapper=new g.default,n.footballMetaRemapper=new b.default,n}return i(t,e),t}(n(7724).default);t.default=_},7724:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9669),i=n(6245),s=n(4021),a=n(4904),o=n(2535),u=n(6208),l=n(5318);t.default=function(e,t){var n=this;this.apiSignInUrl=null,this.instanceAuth=null,this.instance=null,this.errorHandlingMode=null,this.transformAxiosErrorToFansUnitedException=function(e){if("standard"===n.errorHandlingMode&&e.response&&e.response.data&&e.response.data.error){var t=e.response.data.error,r=t.code,i=t.status,s=t.message;return new o.default(r,i,s)}return e},this.apiSignInUrl="?key="+e.apiKey+"&client_id="+e.clientId,this.errorHandlingMode=e.errorHandlingMode,this.instanceAuth=r.default.create({baseURL:t,headers:{Authorization:"Bearer "+e.authProvider.getIdToken(),"Content-Type":"application/json"}}),this.instanceAuth.interceptors.request.use((function(t){var c=null;try{c=(0,i.default)(e.authProvider.getIdToken())}catch(e){if("default"===n.errorHandlingMode)throw(0,u.axiosError)(t,401,e.message);if("standard"===n.errorHandlingMode)throw new o.default(s.ErrorCodes.UNAUTHORIZED,a.ErrorStatuses.INVALID_TOKEN,l.ErrorMessages.INVALID_TOKEN)}return Date.now()>c.exp?(r.default.defaults.headers.common.Authorization="Bearer "+e.authProvider.getIdToken(),t.headers.Authorization="Bearer "+e.authProvider.getIdToken(),t):t}),(function(e){Promise.reject(e)})),this.instanceAuth.interceptors.response.use((function(e){return e}),(function(t){var r,i,u,c=t.config;if((403===(null===(r=t.response)||void 0===r?void 0:r.status)||401===(null===(i=t.response)||void 0===i?void 0:i.status))&&!c._retry){c._retry=!0;var d=e.authProvider.getIdToken();return c.headers.Authorization="Bearer "+d,n.instanceAuth(c)}if("standard"===n.errorHandlingMode&&401===(null===(u=t.response)||void 0===u?void 0:u.status)){var h=new o.default(s.ErrorCodes.UNAUTHORIZED,a.ErrorStatuses.UNAUTHORIZED,l.ErrorMessages.EXPIRED_TOKEN);return Promise.reject(h)}return Promise.reject(t)})),this.instance=r.default.create({baseURL:t,headers:{"Content-Type":"application/json"}})}},8539:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(7724),l={player:"players",team:"teams",homeTeam:"teams",awayTeam:"teams",country:"countries",competition:"competitions",match:"matches"},c=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"idMapping"))||this;return n.getEntityById=function(e,r){try{return n.instance.get("/football"+n.apiSignInUrl+"&input_provider="+t.idSchema+"&"+l[e]+"="+r)}catch(e){throw console.warn("There was a problem with id mapping request for the following id:"+r,e),e.response}},n.getEntityByIdAndSchema=function(e,t,r){try{return n.instance.get("/football"+n.apiSignInUrl+"&input_provider="+r+"&"+l[e]+"="+t)}catch(e){throw console.warn("There was a problem with id mapping request for the following id:"+t,e),e.response}},n.getEntityIdsByIdsAndSchema=function(e,t,r){try{return n.instance.get("/football"+n.apiSignInUrl+"&input_provider="+r+"&"+l[e]+"="+t.join(","))}catch(e){throw console.warn("There was a problem with id mapping request for the following ids:"+t.join(","),e),e.response}},n.getEntitiesByIds=function(e,t,r){t.sort((function(e,t){return e.localeCompare(t)}));var i=(0,o.requestChunkBuild)(t).map((function(t){try{return n.instance.get("/football"+n.apiSignInUrl+"&input_provider="+r+"&"+l[e]+"="+t.join(","))}catch(e){var i=n.transformAxiosErrorToFansUnitedException(e);throw console.warn("There was a problem with id mapping request for the following ids:"+t.join(","),i),i.response}}));return Promise.all(i).then((function(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.data.data)})),t}))},n.getEntitiesByIdObjs=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,c,d,h,p,f;return a(this,(function(m){switch(m.label){case 0:n=[],r={},i=[],Object.keys(e).forEach((function(t){n.push.apply(n,e[t])})),s=(0,o.transformIdsToBeUnique)(n),u=(0,o.requestChunkBuild)(s),c=function(n){var s,o,u,c;return a(this,(function(a){switch(a.label){case 0:if(s="",Object.keys(e).forEach((function(t){r[t]=[];var i=n.filter((function(n){return e[t].includes(n)}));i&&i.length>0&&(r[t]=i)})),Object.keys(r).forEach((function(e){r[e].length>0&&(r[e].sort((function(e,t){return e.localeCompare(t)})),s+="&",s+=l[e]+"="+r[e].join(","))})),!(s&&s.length>0))return[3,5];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,d.instance.get("/football"+d.apiSignInUrl+"&input_provider="+(t||"native")+s)];case 2:return o=a.sent(),i.push(o.data.data),[3,4];case 3:throw u=a.sent(),c=d.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem with id mapping request",c),c.response;case 4:return[3,6];case 5:i.push([]),a.label=6;case 6:return[2]}}))},d=this,h=0,p=u,m.label=1;case 1:return h<p.length?(f=p[h],[5,c(f)]):[3,4];case 2:m.sent(),m.label=3;case 3:return h++,[3,1];case 4:return[2,Array.prototype.concat.apply([],i)]}}))}))},n.getTopEntities=function(){return s(n,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.instance.get("/football/top"+this.apiSignInUrl)];case 1:return[2,n.sent().data.data];case 2:throw e=n.sent(),t=this.transformAxiosErrorToFansUnitedException(e),console.warn("There was a problem with top id mappings request",t),t.response;case 3:return[2]}}))}))},n}return i(t,e),t}(u.default);t.default=c},7059:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(7419),l=n(4533),c=n(8899),d=n(7746),h=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"loyalty"))||this;return n.templateRemapper=null,n.leaderboardRemapper=null,n.rankingsRemapper=null,n.highestSuccessRateRemapper=null,n.getTemplates=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,o.isDisabledCache)(e)?"/leaderboard/templates/"+this.apiSignInUrl+(0,o.initDisableCache)():"/leaderboard/templates/"+this.apiSignInUrl,[4,this.instance.get(n)];case 1:return r=a.sent(),t?((i=JSON.parse(JSON.stringify(r.data))).meta=this.templateRemapper.remapMeta(r.data.meta),i.data=this.templateRemapper.remapResponse(r.data.data),[2,i]):[2,this.templateRemapper.remapResponse(r.data.data)];case 2:throw s=a.sent(),u=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching the list of templates",u),u.response;case 3:return[2]}}))}))},n.getTemplateById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,o.isDisabledCache)(t)?"/leaderboard/templates/"+e+this.apiSignInUrl+(0,o.initDisableCache)():"/leaderboard/templates/"+e+this.apiSignInUrl,[4,this.instance.get(n)];case 1:return r=a.sent(),[2,this.templateRemapper.remapResponseId(r.data.data)];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem requesting the following template: "+e,s),s.response;case 3:return[2]}}))}))},n.getLeaderboard=function(e,t,r){return s(n,void 0,void 0,(function(){var n,i,s,u,l;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,o.isDisabledCache)(t)?"/leaderboard/"+e+"/"+this.apiSignInUrl+(0,o.initDisableCache)():"/leaderboard/"+e+"/"+this.apiSignInUrl,r&&(n+=""+r.constructFiltersUrl()),[4,this.instance.get(n)];case 1:return i=a.sent(),s=JSON.parse(JSON.stringify(i.data)),[2,this.leaderboardRemapper.remapResponse(s)];case 2:throw u=a.sent(),l=this.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem fetching the leaderboard for the following template: "+e,l),l.response;case 3:return[2]}}))}))},n.getLeaderboardForGame=function(e,t,r){return s(n,void 0,void 0,(function(){var n,i,s,u,l;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,o.isDisabledCache)(t)?"/leaderboard/games/"+e+"/"+this.apiSignInUrl+(0,o.initDisableCache)():"/leaderboard/games/"+e+"/"+this.apiSignInUrl,r&&(n+=""+r.constructFiltersUrl()),[4,this.instance.get(n)];case 1:return i=a.sent(),s=JSON.parse(JSON.stringify(i.data)),[2,this.leaderboardRemapper.remapResponse(s)];case 2:throw u=a.sent(),l=this.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem fetching the leaderboard for the following game: "+e,l),l.response;case 3:return[2]}}))}))},n.getUserRankings=function(e,t,r){return s(n,void 0,void 0,(function(){var n,i,s,u;return a(this,(function(a){switch(a.label){case 0:n="/leaderboard/users/"+e+"/rankings/"+this.apiSignInUrl,t&&(n+=""+t.constructFiltersUrl()),(0,o.isDisabledCache)(r)&&(n+=""+(0,o.initDisableCache)()),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return i=a.sent(),[2,this.rankingsRemapper.remapRankings(i.data)];case 3:throw s=a.sent(),u=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching the rankings for the following user: "+e,u),u.response;case 4:return[2]}}))}))},n.getHighestSuccessRate=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:n="/statistics/top"+this.apiSignInUrl,e&&(n+=""+e.constructFiltersUrl()),(0,o.isDisabledCache)(t)&&(n+=""+(0,o.initDisableCache)()),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return r=a.sent(),[2,this.highestSuccessRateRemapper.remapHighestSuccessRate(r.data.data)];case 3:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching highest success rate",s),s.response;case 4:return[2]}}))}))},n.getEntitiesFollows=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i;return a(this,(function(s){switch(s.label){case 0:n=(0,o.isDisabledCache)(t)?"/statistics/follows"+this.apiSignInUrl+(0,o.initDisableCache)():"/statistics/follows"+this.apiSignInUrl,e.footballCompetitions&&(n+="&competitions="+e.footballCompetitions.join(",")),e.footballTeams&&(n+="&teams="+e.footballTeams.join(",")),e.footballPlayers&&(n+="&players="+e.footballPlayers.join(",")),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return[2,s.sent().data.data];case 3:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem fetching follows for entities",i),i.response;case 4:return[2]}}))}))},n.templateRemapper=new c.default,n.leaderboardRemapper=new u.default,n.rankingsRemapper=new l.default,n.highestSuccessRateRemapper=new d.default,n}return i(t,e),t}(n(7724).default);t.default=h},2793:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2726),u=n(9679),l=n(712),c=n(4780),d=n(1553),h=n(3623),p=function(e){function t(t,n){var r=e.call(this,t,(0,l.setBaseUrl)(t.environment,"predictor"))||this;return r.predictionRemapper=null,r.matchSummaryRemapper=null,r.gamesRemapper=null,r.metaRemapper=null,r.makeFootballPrediction=function(e){return s(r,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),t=this.predictionRemapper.remapRequestBody(e),[4,this.instanceAuth.post("/predictions"+this.apiSignInUrl,JSON.stringify(t))];case 1:return n=s.sent(),[4,this.predictionRemapper.remapResponseObjBody(n.data)];case 2:return[2,s.sent()];case 3:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem making POST request: ",i),i.response;case 4:return[2]}}))}))},r.getMatchSummary=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:n=(0,l.isDisabledCache)(t)?"/predictions/summary/"+e+this.apiSignInUrl+(0,l.initDisableCache)():"/predictions/summary/"+e+this.apiSignInUrl,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return r=a.sent(),[2,this.matchSummaryRemapper.remapResponse(r.data)];case 3:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching predictions for match: "+e+" ",s),s.response;case 4:return[2]}}))}))},r.deleteFootballPrediction=function(e){return s(r,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.instanceAuth.delete("/predictions/"+e+this.apiSignInUrl)];case 1:return r.sent(),[2,!0];case 2:throw t=r.sent(),n=this.transformAxiosErrorToFansUnitedException(t),console.warn("There was a problem deleting your prediction: "+e,n),n.response;case 3:return[2]}}))}))},r.getMyPredictions=function(e){return s(r,void 0,void 0,(function(){var t,n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),t=new d.default,n="/predictions"+this.apiSignInUrl,e&&(n+=""+e.constructFiltersUrl()),[4,this.instanceAuth.get(n)];case 1:return r=a.sent(),t.meta=this.metaRemapper.remapMetaData(r.data.meta),i=t,[4,this.predictionRemapper.remapResponseArrayBody(r.data.data)];case 2:return i.data=a.sent(),[2,t];case 3:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching own predictions",o),o.response;case 4:return[2]}}))}))},r.getMyPredictionsNoRemap=function(e){return s(r,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.instanceAuth.get("/predictions"+this.apiSignInUrl+e.constructFiltersUrl())];case 1:return[2,r.sent().data];case 2:throw t=r.sent(),n=this.transformAxiosErrorToFansUnitedException(t),console.warn("There was a problem fetching own predictions",n),n.response;case 3:return[2]}}))}))},r.getUserPredictions=function(e,t,n){return s(r,void 0,void 0,(function(){var r,i,s,o,u,c;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r=new d.default,i=(0,l.isDisabledCache)(t)?"/predictions/users/"+e+this.apiSignInUrl+(0,l.initDisableCache)():"/predictions/users/"+e+this.apiSignInUrl,n&&(i+=""+n.constructFiltersUrl()),[4,this.instance.get(i)];case 1:return s=a.sent(),r.meta=this.metaRemapper.remapMetaData(s.data.meta),o=r,[4,this.predictionRemapper.remapResponseArrayBody(s.data.data)];case 2:return o.data=a.sent(),[2,r];case 3:throw u=a.sent(),c=this.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem fetching predictions for user: "+e,c),c.response;case 4:return[2]}}))}))},r.getUserPredictionsNoRemap=function(e,t){return s(r,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.instance.get("/predictions/users/"+e+this.apiSignInUrl+t.constructFiltersUrl())];case 1:return[2,i.sent().data];case 2:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem fetching predictions for user: "+e,r),r.response;case 3:return[2]}}))}))},r.getGames=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,l.isDisabledCache)(t)?"/games/"+this.apiSignInUrl+e.constructFiltersUrl()+(0,l.initDisableCache)():"/games/"+this.apiSignInUrl+e.constructFiltersUrl(),[4,this.instance.get(n)];case 1:return r=a.sent(),[2,this.gamesRemapper.remapPaginatedGames(r.data)];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the games list",s),s.response;case 3:return[2]}}))}))},r.getGameById=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,l.isDisabledCache)(t)?"/games/"+e+this.apiSignInUrl+(0,l.initDisableCache)():"/games/"+e+this.apiSignInUrl,[4,this.instance.get(n)];case 1:return r=a.sent(),[2,this.gamesRemapper.remapGameByIdResponse(r.data)];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the following game: "+e,s),s.response;case 3:return[2]}}))}))},r.getGamePredictions=function(e,t,n){return s(r,void 0,void 0,(function(){var r,i,s,o,u,c;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r=new d.default,i=(0,l.isDisabledCache)(t)?"/games/"+e+"/predictions"+this.apiSignInUrl+(0,l.initDisableCache)():"/games/"+e+"/predictions"+this.apiSignInUrl,n&&(i+=""+n.constructFiltersUrl()),[4,this.instance.get(i)];case 1:return s=a.sent(),r.meta=this.metaRemapper.remapMetaData(s.data.meta),o=r,[4,this.predictionRemapper.remapResponseArrayBody(s.data.data)];case 2:return o.data=a.sent(),[2,r];case 3:throw u=a.sent(),c=this.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem fetching the predictions for game: "+e,c),c.response;case 4:return[2]}}))}))},r.getUserGameEditions=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s,o,u=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=null,r=(0,l.isDisabledCache)(t)?"/games/"+this.apiSignInUrl+e.constructFiltersUrl()+(0,l.initDisableCache)():"/games/"+this.apiSignInUrl+e.constructFiltersUrl(),[4,this.instance.get(r)];case 1:return(i=a.sent()).data.data.forEach((function(e){"TOP_X"===e.type?n=u.gamesRemapper.remapPaginatedUserTopXEditions(i.data):"MATCH_QUIZ"===e.type&&(n=u.gamesRemapper.remapPaginatedUserMathQuizEditions(i.data))})),[2,n];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching the games list",o),o.response;case 3:return[2]}}))}))},r.getGameResults=function(e,t,n){return s(r,void 0,void 0,(function(){var r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),r=(0,l.isDisabledCache)(t)?"/games/"+e+"/results/"+this.apiSignInUrl+(0,l.initDisableCache)():"/games/"+e+"/results/"+this.apiSignInUrl,n&&(r+=""+n.constructMainFiltersUrl()),[4,this.instance.get(r)];case 1:return i=a.sent(),[2,this.gamesRemapper.remapPaginatedGameResults(i.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching the results for the following game: "+e,o),o.response;case 3:return[2]}}))}))},r.getMarketResultsForGame=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:n="/games/"+e+"/correct-results/"+this.apiSignInUrl,(0,l.isDisabledCache)(t)&&(n+=""+(0,l.initDisableCache)()),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return r=a.sent(),[2,this.gamesRemapper.remapGameMarketsResults(r.data.data)];case 3:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the markets correct results for the following game: "+e,s),s.response;case 4:return[2]}}))}))},r.getContestWinners=function(e){return s(r,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.instance.get("/winners/"+this.apiSignInUrl+"&contest_id="+e)];case 1:return t=i.sent(),[2,this.gamesRemapper.remapContestWinners(t.data)];case 2:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem fetching winners for the following game: "+e,r),r.response;case 3:return[2]}}))}))},r.getPredictionById=function(e){return s(r,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),t="/predictions/"+e+this.apiSignInUrl,[4,this.instanceAuth.get(t)];case 1:return n=s.sent(),[4,this.predictionRemapper.remapResponseArrayBody([n.data.data])];case 2:return[2,s.sent()[0]];case 3:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem fetching info for the following prediction: "+e,i),i.response;case 4:return[2]}}))}))},r.predictionRemapper=new o.default(t,n),r.matchSummaryRemapper=new u.default(t,n),r.gamesRemapper=new c.default,r.metaRemapper=new h.default,r}return i(t,e),t}(n(7724).default);t.default=p},4275:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(441),l=n(8673),c=n(6277),d=n(1712),h=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"profile"))||this;return n.profileRemapper=null,n.followingRemapper=null,n.followersRemapper=null,n.lang=null,n.limitIds=100,n.getCountries=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="&lang="+this.lang,n="/countries"+this.apiSignInUrl+t,r=Date.now(),e&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return[2,a.sent().data.data];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the countries:",s),s.response;case 3:return[2]}}))}))},n.getProfile=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s;return a(this,(function(a){switch(a.label){case 0:if(t="/profile"+this.apiSignInUrl,!e)return[3,5];t="/profiles/"+e+this.apiSignInUrl,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(t)];case 2:return r=a.sent(),[2,this.profileRemapper.fullProfileFromResponse(r.data.data)];case 3:throw n=a.sent(),s=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem fetching the following profile: "+e,s),s.response;case 4:return[3,8];case 5:return a.trys.push([5,7,,8]),[4,this.instanceAuth.get(t)];case 6:return r=a.sent(),[2,this.profileRemapper.fullProfileFromResponse(r.data.data)];case 7:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching your profile from API:",s),s.response;case 8:return[2]}}))}))},n.getProfiles=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,l,c,d,h,p,f,m;return a(this,(function(a){switch(a.label){case 0:if(a.trys.push([0,7,,8]),n=Date.now(),!(e.length>this.limitIds))return[3,5];r=[],i=(0,o.limitIds)(e,this.limitIds),s=0,u=i,a.label=1;case 1:return s<u.length?(l=u[s],c="/profiles"+this.apiSignInUrl+"&profile_ids="+l.join(","),t&&(c+="&disable_cache="+n),[4,this.instance.get(c)]):[3,4];case 2:d=a.sent(),r.push.apply(r,this.profileRemapper.profilesFromResponse(d.data.data)),a.label=3;case 3:return s++,[3,1];case 4:return[2,r];case 5:return h="/profiles"+this.apiSignInUrl+"&profile_ids="+e.join(","),t&&(h+="&disable_cache="+n),[4,this.instance.get(h)];case 6:return p=a.sent(),[2,this.profileRemapper.profilesFromResponse(p.data.data)];case 7:throw f=a.sent(),m=this.transformAxiosErrorToFansUnitedException(f),console.warn("There was a problem fetching the following profiles: "+e.join(","),m),m.response;case 8:return[2]}}))}))},n.getFollowers=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o,u;return a(this,(function(a){switch(a.label){case 0:if(n="/profile/followers"+this.apiSignInUrl,!e||t)return[3,5];n="/profile/followers"+this.apiSignInUrl+e.constructFilterUrl(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instanceAuth.get(n)];case 2:return s=a.sent(),[2,this.followersRemapper.followersFromResponse(s.data)];case 3:throw r=a.sent(),u=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem fetching the followers for own profile",u),u.response;case 4:return[3,9];case 5:if(e||t)return[3,9];a.label=6;case 6:return a.trys.push([6,8,,9]),[4,this.instanceAuth.get(n)];case 7:return s=a.sent(),[2,this.followersRemapper.followersFromResponse(s.data)];case 8:throw i=a.sent(),u=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the followers for own profile",u),u.response;case 9:e&&t?n="/profile/"+t+"/followers"+this.apiSignInUrl+e.constructFilterUrl():!e&&t&&(n="/profile/"+t+"/followers"+this.apiSignInUrl),a.label=10;case 10:return a.trys.push([10,12,,13]),[4,this.instance.get(n)];case 11:return s=a.sent(),[2,this.followersRemapper.followersFromResponse(s.data)];case 12:throw o=a.sent(),u=this.transformAxiosErrorToFansUnitedException(o),console.warn("There was a problem fetching the followers for profile: "+t,u),u.response;case 13:return[2]}}))}))},n.getFollowing=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o,u;return a(this,(function(a){switch(a.label){case 0:if(n="/profile/following"+this.apiSignInUrl,!e||t)return[3,5];n="/profile/following"+this.apiSignInUrl+e.constructFilterUrl(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instanceAuth.get(n)];case 2:return s=a.sent(),[2,this.followingRemapper.followingFromResponse(s.data)];case 3:throw r=a.sent(),u=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem fetching the followers of own profile",u),u.response;case 4:return[3,9];case 5:if(e||t)return[3,9];a.label=6;case 6:return a.trys.push([6,8,,9]),[4,this.instanceAuth.get(n)];case 7:return s=a.sent(),[2,this.followingRemapper.followingFromResponse(s.data)];case 8:throw i=a.sent(),u=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the followers of own profile",u),u.response;case 9:e&&t?n="/profile/"+t+"/following"+this.apiSignInUrl+e.constructFilterUrl():!e&&t&&(n="/profile/"+t+"/following"+this.apiSignInUrl),a.label=10;case 10:return a.trys.push([10,12,,13]),[4,this.instance.get(n)];case 11:return s=a.sent(),[2,this.followingRemapper.followingFromResponse(s.data)];case 12:throw o=a.sent(),u=this.transformAxiosErrorToFansUnitedException(o),console.warn("There was a problem fetching the followers of the following profile: "+t,u),u.response;case 13:return[2]}}))}))},n.follow=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(s){switch(s.label){case 0:(t=new d.default).profile_ids=e,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.instanceAuth.post("/profile/follow"+this.apiSignInUrl,JSON.stringify(t))];case 2:return n=s.sent(),[2,this.followingRemapper.followResponse(n.data.data)];case 3:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem with POST request for profiles: "+e.join(",")+" ",i),i.response;case 4:return[2]}}))}))},n.unfollow=function(e){return s(n,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:(t=new d.default).profile_ids=e,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.instanceAuth.delete("/profile/follow"+this.apiSignInUrl,{data:JSON.stringify(t)})];case 2:return i.sent(),[2,!0];case 3:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem with DELETE request for profiles: "+e.join(",")+" ",r),r.response;case 4:return[2]}}))}))},n.getBadges=function(e){return s(n,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:t="/profile/badges"+this.apiSignInUrl,i.label=1;case 1:return i.trys.push([1,5,,6]),e?(t="/profile/"+e+"/badges"+this.apiSignInUrl,[4,this.instance.get(t)]):[3,3];case 2:return[2,i.sent().data.data];case 3:return[4,this.instanceAuth.get(t)];case 4:return[2,i.sent().data.data];case 5:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem with fetching the badges",r),r.response;case 6:return[2]}}))}))},n.updateProfile=function(e){return s(n,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.instanceAuth.patch("/profile"+this.apiSignInUrl,e)];case 1:return t=i.sent(),[2,this.profileRemapper.fullProfileFromResponse(t.data.data)];case 2:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem updating the own profile:",r),r.response;case 3:return[2]}}))}))},n.lang=t.lang,n.profileRemapper=new u.default,n.followingRemapper=new l.default,n.followersRemapper=new c.default,n}return i(t,e),t}(n(7724).default);t.default=h},5792:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(5601),a=n(8539),o=n(1260);t.default=function(e){var t=this;this.isBrowser=!1,this.localStorage=null,this.https=null,this.getEntitiesByIds=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r,a,u,l,c;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?[4,this.setTopIdMappings()]:[3,6];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,4,,5]),t=this.localStorage.checkForExistingIdObjs(e,n),r=this.splitForRequestAndExisting(t),[4,this.https.getEntitiesByIdObjs(r.request,n)];case 3:return a=i.sent(),this.localStorage.addIdMappings(a),[2,this.localStorage.getIdsByType(e,n,s)];case 4:return u=i.sent(),console.warn("There was a problem retrieving the entity ids ",u),[2,Promise.resolve([])];case 5:return[3,9];case 6:return i.trys.push([6,8,,9]),[4,this.https.getEntitiesByIdObjs(e,n)];case 7:return l=i.sent(),Object.keys(e).forEach((function(t){e[t]=l.filter((function(e){return e.resource===t})).map((function(e){return e[o.ID_TYPES[s]]}))})),[2,e];case 8:return c=i.sent(),console.warn("There was a problem retrieving the entity ids ",c),[2,Promise.resolve([])];case 9:return[2]}}))}))},this.getEntityById=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?(t=this.localStorage.getEntity(e,n,s))?[2,t]:[3,1]:[3,4];case 1:case 4:return[4,this.requestEntity(e,n,s)];case 2:return r=i.sent(),this.localStorage.addIdMappings(r),[2,r];case 3:return[3,6];case 5:return[2,i.sent()];case 6:return[2]}}))}))},this.splitForRequestAndExisting=function(e){var t={},n={};return Object.keys(e).forEach((function(r){t[r]=e[r].filter((function(e){return!e.exists})).map((function(e){return e.id})),n[r]=e[r].filter((function(e){return e.exists})).map((function(e){return e.id}))})),{existing:n,request:t}},this.requestEntity=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=Array.isArray(e)?e:[e],[4,this.https.getEntitiesByIds(n,e,s)];case 1:return[2,r.sent()];case 2:return t=r.sent(),console.warn("There was a problem retrieving the requested entity: "+t),[2,null];case 3:return[2]}}))}))},this.setTopIdMappings=function(){return r(t,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return e=Math.floor(Date.now()/1e3),this.localStorage.getExpiration("football","ids")>e?[2,Promise.resolve()]:[4,this.https.getTopEntities()];case 1:return t=n.sent(),this.localStorage.addTopIdMappings(t),[2]}}))}))},this.isBrowser="undefined"!=typeof window,this.localStorage=new s.default(e),this.https=new a.default(e)}},8900:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4946),a=n(5792),o=n(7611),u=n(9052);t.default=function(e){var t=this;this.idSchema="",this.idMappingFacade=null,this.getEntityIdBySchemaId=function(e,n){return t.idMappingFacade.getEntityById(e,n,t.idSchema)},this.remapEntities=function(e,n){return r(t,void 0,void 0,(function(){var t,r,a;return i(this,(function(i){t=JSON.parse(JSON.stringify(e));try{return this.idSchema!==s.IdSchemaEnum.NATIVE?(r=new o.default,a=r.traverse(t,n),[2,this.idMappingFacade.getEntitiesByIds(a,"native",this.idSchema).then((function(e){return(new u.default).traverse(t,n,e)}))]):[2,e]}catch(e){return console.warn("There was a problem remapping entity: "+n+" with inner entity ",e),[2,[]]}return[2]}))}))},this.getEntityIdsBySchemaId=function(e,n,a){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return(t={})[n]=e,this.idSchema===s.IdSchemaEnum.NATIVE?[3,2]:[4,this.idMappingFacade.getEntitiesByIds(t,this.idSchema,a)];case 1:return[2,r.sent()];case 2:return[2,t]}}))}))},this.idSchema=e.idSchema,this.idMappingFacade=new a.default(e)}},3845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeConvert=void 0,t.typeConvert=function(e){switch(e){case"competitions":return"competition";case"players":case"relatedPlayer":case"squad":return"player";case"teams":case"participants":case"homeTeam":case"awayTeam":case"timeline":case"teamId":return"team";default:return e}}},7611:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3845);t.default=function(){var e=this;this.extractedObjIds={},this.traverse=function(t,n){return n=(0,r.typeConvert)(n),Array.isArray(t)?e.traverseArrExtract(t,n):t&&"object"==typeof t&&e.traverseObjExtract(t,n),e.extractedObjIds},this.traverseArrExtract=function(t,n){t&&t.length>0&&t.forEach((function(t){e.traverseObjExtract(t,n)}))},this.traverseObjExtract=function(t,n){t&&Object.keys(t).length>0&&Object.keys(t).forEach((function(r){var i=t[r];"id"===r||"teamId"===r?(e.extractedObjIds.hasOwnProperty(n)||(e.extractedObjIds[n]=[]),i&&e.extractedObjIds[n].push(i)):t[r]&&e.traverse(t[r],r)}))}}},9052:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3845);t.default=function(){var e=this;this.replaceObjIdsIndex=null,this.remappedIdsObj={},this.traverse=function(t,n,i){return n=(0,r.typeConvert)(n),null===e.replaceObjIdsIndex&&(e.initReplaceObjIdsIndex(i),e.remappedIdsObj=i),Array.isArray(t)?e.traverseArrReplace(t,n):t&&"object"==typeof t&&e.traverseObjReplace(t,n),t},this.initReplaceObjIdsIndex=function(t){e.replaceObjIdsIndex={},Object.keys(t).forEach((function(t){e.replaceObjIdsIndex[t]=0}))},this.traverseArrReplace=function(t,n){t&&t.length>0&&t.forEach((function(t){e.traverseObjReplace(t,n)}))},this.traverseObjReplace=function(t,n){t&&Object.keys(t).length>0&&Object.keys(t).forEach((function(r){"id"===r||"teamId"===r?t[r]&&(t[r]=e.remappedIdsObj[n][e.replaceObjIdsIndex[n]],e.replaceObjIdsIndex[n]=e.replaceObjIdsIndex[n]+1):t[r]&&e.traverse(t[r],r,e.remappedIdsObj)}))}}},7302:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(5936);t.default=function(e){var t=this;this.add=function(e,n,s,a){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.add(e,n,s,a)];case 1:return[2,t.sent()]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.delete(e)];case 1:return[2,t.sent()]}}))}))},this.like=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.like(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.dislike=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.dislike(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addPageview=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addPageview(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addContentConsumed=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addContentConsumed(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addShare=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addShare(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addComment=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addComment(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addClickAd=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addClickAd(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addConversion=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addConversion(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getOwn=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.getOwn(e,n)];case 1:return[2,t.sent()]}}))}))},this.getForUser=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.getForUser(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.activityFacade=new s.default(e)}},1491:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionsEnum=void 0,(n=t.ActionsEnum||(t.ActionsEnum={})).LIKE="like",n.DISLIKE="dislike",n.PAGE_VIEW="page_view",n.CONTENT_CONSUMED="content_consumed",n.SHARE="share",n.COMMENT="comment",n.CLICK_AD="click_ad",n.CONVERSION="conversion",n.PREDICTION_MADE="prediction_made",n.CONVERT="convert",n.MANAGE_INTERESTS="manage_interests",n.GAME_PARTICIPATION="game_participation",n.ARTICLE_CONSUMED="article_consumed",n.VIDEO_CONSUMED="video_consumed",n.SHORT_VIDEO_CONSUMED="short_video_consumed",n.LONG_VIDEO_CONSUMED="long_video_consumed",n.AUDIO_CONSUMED="audio_consumed",n.GALLERY_CONSUMED="gallery_consumed",n.IMAGE_CONSUMED="image_consumed",n.POLL_PARTICIPATION="poll_participation"},5936:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4946),a=n(1022),o=n(1491),u=n(4630),l=n(8261),c=n(629),d=n(8636);t.default=function(e){var t=this;this.add=function(e,n,a,o){return r(t,void 0,void 0,(function(){var t,r,l,c,d;return i(this,(function(i){switch(i.label){case 0:return this.idSchema==s.IdSchemaEnum.NATIVE?[3,3]:(t=JSON.parse(JSON.stringify(n)),[4,this.activityService.remapTagsIds(n,this.idSchema,s.IdSchemaEnum.NATIVE)]);case 1:return r=i.sent(),l=new u.default(e,r,a,o),[4,this.activityHttps.createActivity(l)];case 2:return(c=i.sent()).context.tags=t,[2,c];case 3:return d=new u.default(e,n,a,o),[2,this.activityHttps.createActivity(d)]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityHttps.deleteActivity(e)];case 1:return[2,t.sent()]}}))}))},this.like=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.LIKE,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.dislike=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.DISLIKE,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addPageview=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.PAGE_VIEW,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addContentConsumed=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.CONTENT_CONSUMED,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addShare=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.SHARE,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addComment=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.COMMENT,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addClickAd=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.CLICK_AD,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addConversion=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.CONVERSION,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.getOwn=function(e,n){return r(t,void 0,void 0,(function(){var t,r,a,o;return i(this,(function(i){switch(i.label){case 0:return n=n||!1,e&&(e=new c.default(e)),this.idSchema==s.IdSchemaEnum.NATIVE?[3,6]:[4,this.activityHttps.getOwnActivities(e,n)];case 1:t=i.sent(),r=0,a=t.data,i.label=2;case 2:return r<a.length?(o=a[r],[4,this.activityService.remapTagsIds(o.context.tags,s.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:i.sent(),i.label=4;case 4:return r++,[3,2];case 5:return[2,t];case 6:return[4,this.activityHttps.getOwnActivities(e,n)];case 7:return[2,i.sent()]}}))}))},this.getForUser=function(e,n,a){return r(t,void 0,void 0,(function(){var t,r,o,u;return i(this,(function(i){switch(i.label){case 0:return a=a||!1,n&&(n=new d.default(n)),this.idSchema==s.IdSchemaEnum.NATIVE?[3,6]:[4,this.activityHttps.getActivitiesForUser(e,n,a)];case 1:t=i.sent(),r=0,o=t.data,i.label=2;case 2:return r<o.length?(u=o[r],[4,this.activityService.remapTagsIds(u.context.tags,s.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:i.sent(),i.label=4;case 4:return r++,[3,2];case 5:return[2,t];case 6:return[4,this.activityHttps.getActivitiesForUser(e,n,a)];case 7:return[2,i.sent()]}}))}))},this.idSchema=e.idSchema,this.activityHttps=new a.default(e),this.activityService=new l.default(e)}},1517:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2820);t.default=function(){this.id=null,this.profileId=null,this.property=null,this.value=null,this.action=null,this.context=new r.default,this.points=0}},2195:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.page=null,this.limit=null,this.page=e.page?e.page:null,this.limit=e.limit?e.limit:null}},629:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var n=e.call(this,t)||this;return n.action=null,n.action=t.action?t.action:null,n}return i(t,e),t.prototype.constructFilterUrl=function(){var e="";return this.action&&(e+="&",e+="action="+this.action),this.page&&(e+="&",e+="page="+this.page),this.limit&&(e+="&",e+="limit="+this.limit),e},t}(n(2195).default);t.default=s},8636:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var n=e.call(this,t)||this;return n.action=null,n.action=t.action?t.action:null,n}return i(t,e),t.prototype.constructFilterUrl=function(){var e="";return this.action&&(e+="&",e+="action="+this.action),this.page&&(e+="&",e+="page="+this.page),this.limit&&(e+="&",e+="limit="+this.limit),e},t}(n(2195).default);t.default=s},6021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3569),i=n(1517);t.default=function(){this.meta=new r.default,this.data=[new i.default]}},2820:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.content=null,this.tags=[],this.campaign=null}},4630:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2820);t.default=function(e,t,n,i){this.action=null,this.context=new r.default,this.action=e,this.context.tags=t,n&&(this.context.content=n),i&&(this.context.campaign=i)}},2453:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(7974),s=n(1316),a=n(9826),o=n(1517),u=n(6021);t.default=function(){var e=this;this.remapSingleResponse=function(e){var t=new o.default;return t.id=e.id,t.profileId=e.profile_id,t.property=e.property,t.value=e.value,t.action=e.action,t.context.content=e.context.content,t.context.tags=e.context.tags,t.context.campaign=e.context.campaign,t.points=e.points,t},this.remapActivitiesResponse=function(t){var n=new u.default;return n.meta.pagination.currentPage=t.meta.pagination.current_page,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.meta.pagination.numberOfPages=t.meta.pagination.number_of_pages,n.meta.pagination.totalItems=t.meta.pagination.total_items,n.data=t.data.map((function(t){return e.remapSingleResponse(t)})),n},this.remapStatsReponse=function(t){var n=new s.default;return n.profileId=t.profile_id,n.tier=t.tier,n.points=t.points,n.successRates.overallPercent=t.success_rates.overall_percent,n.successRates.byFootballCompetition=e.constructNewRecord(t.success_rates.by_competition),n.successRates.byFootballTeam=e.constructNewRecord(t.success_rates.by_team),n.successRates.byFootballMarket=e.constructNewRecord(t.success_rates.by_market),n},this.constructNewRecord=function(t){var n;return Object.entries(t).length?(Object.entries(t).forEach((function(t){var s,a=t[0],o=t[1];n=r(r({},n),((s={})[a]=e.remapSuccessRatePercent(o),s)),i.MarketEnum[a]&&delete n[a].model})),n):t},this.remapSuccessRatePercent=function(e){var t=new a.default;return t.successRatePercent=e.success_rate_percent,t}}},8261:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8900);t.default=function(e){var t=this;this.remapTagsIds=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r,a,o,u,l,c,d,h,p;return i(this,(function(i){switch(i.label){case 0:return e&&e.length?(t={},r={},a=[],e.forEach((function(e){t.hasOwnProperty(e.type)||(t[e.type]=[],r[e.type]=[]),t[e.type].push(e.id),r[e.type].push(e)})),[4,this.idMapping.idMappingFacade.getEntitiesByIds(t,n,s)]):[2,e];case 1:for(o=i.sent(),u=function(e,t){t.forEach((function(t,n){t.id=o[e][n],a.push(t)}))},l=0,c=Object.entries(r);l<c.length;l++)d=c[l],h=d[0],p=d[1],u(h,p);return[2,a]}}))}))},this.idSchema=e.idSchema,this.idMapping=new s.default(e)}},7e3:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(2754),a=n(712);t.default=function(e,t,n){var o=this;this.isBrowser=!1,this.localStorage={},this.https=null,this.idMapping=null,this.getCompetitionsIdMapping=function(e,t){return r(o,void 0,void 0,(function(){var n,r,a,o,u;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,8,,9]),n=!1,e?(e=new s.default(e)).countryId?[4,this.idMapping.getEntityIdsBySchemaId([""+e.countryId],"country","native")]:[3,2]:[3,5];case 1:0===(r=i.sent()).country.length&&(n=!0),e.countryId=r.country[0],i.label=2;case 2:return e.competitionIds?[4,this.idMapping.getEntityIdsBySchemaId(e.competitionIds,"competition","native")]:[3,4];case 3:0===(a=i.sent()).competition.length&&(n=!0),e.competitionIds=a.competition,i.label=4;case 4:if(n)return[2,[]];i.label=5;case 5:return[4,this.getCompetitions(e,t)];case 6:return o=i.sent(),[4,this.idMapping.remapEntities(o,"competition")];case 7:return[2,i.sent()];case 8:throw u=i.sent(),console.warn("There was a problem browsing all of the competitions",u),u;case 9:return[2]}}))}))},this.getCompetitionsMapWithNativeIds=function(e){return r(o,void 0,void 0,(function(){var t,n,r,o,u,l;return i(this,(function(i){switch(i.label){case 0:return t=new Map,n=e.length,r=new s.default({competitionIds:e,limit:n}),[4,this.getCompetitions(r)];case 1:return(o=i.sent()).sort((function(e,t){return e.id.localeCompare(t.id)})),u=(0,a.sortArrayInAscOrder)(e),[4,this.idMapping.remapEntities(o,"competition")];case 2:return l=i.sent(),u.forEach((function(e,n){return t.set(e,l[n])})),[2,t]}}))}))},this.getCompetitions=function(e,t){return r(o,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:if(n=null,t=t||!1,!this.isBrowser)return[3,6];if(this.localStorage.getCompetitionsLength())return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.https.getCompetitions()];case 2:return n=i.sent(),[3,4];case 3:throw r=i.sent(),console.warn("There was a problem retrieving all competitions",r),r;case 4:this.localStorage.setCompetitions(n),i.label=5;case 5:return[2,this.localStorage.getCompetitions(e)];case 6:return[2,this.https.getCompetitions(e,t)]}}))}))},this.getCompetitionByIdIdMapping=function(e,t){return r(o,void 0,void 0,(function(){var n,r,s,a;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"competition","native")];case 1:return n=i.sent(),r=n.competition[0],[4,this.getCompetitionById(r,t)];case 2:return s=i.sent(),[4,this.idMapping.remapEntities(s,"competition")];case 3:return[2,i.sent()];case 4:throw a=i.sent(),console.warn("There was a problem browsing the following competition:"+e,a),a;case 5:return[2]}}))}))},this.getCompetitionById=function(e,t){return r(o,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getCompetitionById(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the competition with the following id: "+e,n),n;case 3:return[2]}}))}))},this.getTopCompetitionsIdMapping=function(e){return r(o,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.getTopCompetitions(e)];case 1:return t=r.sent(),[4,this.idMapping.remapEntities(t,"competition")];case 2:return[2,r.sent()];case 3:throw n=r.sent(),console.warn("There was a problem browsing the top competitions",n),n;case 4:return[2]}}))}))},this.getTopCompetitions=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTopCompetitions(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem retrieving the top competitions",t),t;case 3:return[2]}}))}))},this.isBrowser="undefined"!=typeof window,this.localStorage=e,this.idMapping=n,this.https=t}},8350:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t,i){var s=this;this.isBrowser=!1,this.localStorage={},this.https=null,this.idMapping=null,this.getCountriesWithIdMapping=function(e){return n(s,void 0,void 0,(function(){var t,n;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getCountries(e)];case 1:return t=r.sent(),[2,this.idMapping.remapEntities(t,"country")];case 2:throw n=r.sent(),console.warn("There was a problem browsing countries as football entities",n),n;case 3:return[2]}}))}))},this.getCountries=function(e){return n(s,void 0,void 0,(function(){var t,n,i;return r(this,(function(r){switch(r.label){case 0:return e=e||!1,this.isBrowser?(t=this.localStorage.getFootballCountries())&&t.length>0?[2,t]:[3,1]:[3,5];case 1:return r.trys.push([1,3,,4]),[4,this.https.getCountries(e)];case 2:return n=r.sent(),this.localStorage.setFootballCountries(n),[2,n];case 3:throw i=r.sent(),console.warn("There was a problem retrieving countries as football entities",i),i;case 4:return[3,6];case 5:return[2,this.https.getCountries(e)];case 6:return[2]}}))}))},this.isBrowser="undefined"!=typeof window,this.localStorage=e,this.idMapping=i,this.https=t}},4289:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8350),a=n(7e3),o=n(9693),u=n(4272),l=n(4545),c=n(2140);t.default=function(e,t,n,d){var h=this;this.countriesFacade=null,this.competitionsFacade=null,this.teamsFacade=null,this.playerFacade=null,this.matchFacade=null,this.searchFacade=null,this.getCountries=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.countriesFacade.getCountriesWithIdMapping(e)]}))}))},this.getCompetitions=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.competitionsFacade.getCompetitionsIdMapping(e,t)]}))}))},this.getCompetitionById=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.competitionsFacade.getCompetitionByIdIdMapping(e,t)]}))}))},this.getTopCompetitions=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.competitionsFacade.getTopCompetitionsIdMapping(e)]}))}))},this.getCompetitionsMapWithNativeIds=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.competitionsFacade.getCompetitionsMapWithNativeIds(e)];case 1:return[2,t.sent()]}}))}))},this.getTeams=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.teamsFacade.getTeamsIdMapping(e,t)]}))}))},this.getTeamById=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.teamsFacade.getTeamByIdIdMapping(e,t)]}))}))},this.getTopTeams=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.teamsFacade.getTopTeamsIdMapping(e)]}))}))},this.getNextMatchForTeam=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.teamsFacade.getNextMatchForTeamIdMapping(e,t)]}))}))},this.getPrevMatchForTeam=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.teamsFacade.getPrevMatchForTeamIdMapping(e,t)]}))}))},this.getTeamsMapWithNativeIds=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.teamsFacade.getTeamsMapWithNativeIds(e)];case 1:return[2,t.sent()]}}))}))},this.getPlayers=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.playerFacade.getPlayersIdMapping(e,t)]}))}))},this.getPlayerById=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.playerFacade.getPlayerIdMapping(e,t)]}))}))},this.getTopPlayers=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.playerFacade.getTopPlayersIdMapping(e)]}))}))},this.getNextMatchForPlayer=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.playerFacade.getNextMatchForPlayerIdMapping(e,t)]}))}))},this.getPrevMatchForPlayer=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.playerFacade.getPrevMatchForPlayerIdMapping(e,t)]}))}))},this.getPlayersMapWithNativeIds=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.playerFacade.getPlayersMapWithNativeIds(e)]}))}))},this.getMatches=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.matchFacade.getMatchesIdMapping(e,t)]}))}))},this.getMatchById=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.matchFacade.getMatchIdMapping(e,t)]}))}))},this.search=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.searchFacade.searchIdMapping(e,t)]}))}))},this.countriesFacade=new s.default(t,n,d),this.competitionsFacade=new a.default(t,n,d),this.teamsFacade=new o.default(e,n,d),this.playerFacade=new u.default(e,n,d),this.matchFacade=new l.default(e,n,d),this.searchFacade=new c.default(n,d)}},4545:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var a=n(712),o=n(6134),u=n(9582);t.default=function(e,t,n){var l=this;this.https=null,this.idMapping=null,this.footballService=null,this.getMatchesIdMapping=function(e,t){return r(l,void 0,void 0,(function(){var n,r,a,u,l,c,d,h;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,12,,13]),e?(e=new o.default(e)).countryIds?[4,this.idMapping.getEntityIdsBySchemaId(e.countryIds,"country","native")]:[3,2]:[3,8];case 1:n=i.sent(),e.countryIds=n.country,i.label=2;case 2:return e.competitionIds?[4,this.idMapping.getEntityIdsBySchemaId(e.competitionIds,"competition","native")]:[3,4];case 3:r=i.sent(),e.competitionIds=r.competition,i.label=4;case 4:return e.matchIds?[4,this.idMapping.getEntityIdsBySchemaId(e.matchIds,"match","native")]:[3,6];case 5:a=i.sent(),e.matchIds=a.match,i.label=6;case 6:return e.teamIds?[4,this.idMapping.getEntityIdsBySchemaId(e.teamIds,"team","native")]:[3,8];case 7:u=i.sent(),e.teamIds=u.team,i.label=8;case 8:return[4,this.getMatches(e,t)];case 9:return l=i.sent(),c=l,[4,this.footballService.setAvailableMarketsForMatch(s([],l.data,!0))];case 10:return c.data=i.sent(),d=l,[4,this.idMapping.remapEntities(l.data,"match")];case 11:return d.data=i.sent(),[2,l];case 12:throw h=i.sent(),console.warn("There was a problem browsing the matches",h),h;case 13:return[2]}}))}))},this.getMatchesWithNativeIds=function(e){return r(l,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=e.length,n=new o.default({matchIds:e,limit:t}),[4,this.getMatches(n)];case 1:return(r=i.sent()).data.sort((function(e,t){return e.id.localeCompare(t.id)})),[4,this.idMapping.remapEntities(r.data,"match")];case 2:return[2,i.sent()]}}))}))},this.getMatchesMapWithNativeIds=function(e){return r(l,void 0,void 0,(function(){var t,n,r,s,u,l;return i(this,(function(i){switch(i.label){case 0:return t={},(n=(0,a.transformIdsToBeUnique)(e)).sort((function(e,t){return e.localeCompare(t)})),[4,this.getMatchesWithNativeIds(n)];case 1:return r=i.sent(),n.length===r.length?[3,3]:(s=new o.default({matchIds:n,limit:n.length}),[4,this.getMatches(s)]);case 2:u=i.sent(),l=n.filter((function(e){if(u.data.every((function(t){return t.id!==e})))return e})),n=n.filter((function(e){if(!l.includes(e))return e})),i.label=3;case 3:return n.forEach((function(e,n){return t[e]=r[n]})),[2,t]}}))}))},this.getMatches=function(e,t){return r(l,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getMatches(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the matches",n),n;case 3:return[2]}}))}))},this.getMatchIdMapping=function(e,t){return r(l,void 0,void 0,(function(){var n,r,s,a;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),[4,this.idMapping.getEntityIdsBySchemaId([e],"match","native")];case 1:return n=i.sent(),[4,this.getMatchById(n.match[0],t)];case 2:return r=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(r)];case 3:return s=i.sent(),[4,this.idMapping.remapEntities(s,"match")];case 4:return[2,i.sent()];case 5:throw a=i.sent(),console.warn("There was a problem browsing the following match: "+e,a),a;case 6:return[2]}}))}))},this.getMatchById=function(e,t){return r(l,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getMatchById(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the following match: "+e,n),n;case 3:return[2]}}))}))},this.https=t,this.idMapping=n,this.footballService=new u.default(e)}},4272:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(6477),a=n(712),o=n(9582);t.default=function(e,t,n){var u=this;this.https=null,this.footballService=null,this.idMapping=null,this.getPlayersIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,a,o,u,l,c;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,10,,11]),n=!1,e?(e=new s.default(e)).countryId?[4,this.idMapping.getEntityIdsBySchemaId([e.countryId],"country","native")]:[3,2]:[3,7];case 1:0===(r=i.sent()).country.length&&(n=!0),e.countryId=r.country[0],i.label=2;case 2:return e.playerIds?[4,this.idMapping.getEntityIdsBySchemaId(e.playerIds,"player","native")]:[3,4];case 3:0===(a=i.sent()).player.length&&(n=!0),e.playerIds=a.player,i.label=4;case 4:return e.scope?[4,this.idMapping.getEntityIdsBySchemaId(e.scope,"competition","native")]:[3,6];case 5:0===(o=i.sent()).competition.length&&(n=!0),e.scope=o.competition,i.label=6;case 6:if(n)return[2,[]];i.label=7;case 7:return[4,this.getPlayers(e,t)];case 8:return u=i.sent(),l=u,[4,this.idMapping.remapEntities(u.data,"player")];case 9:return l.data=i.sent(),[2,u];case 10:throw c=i.sent(),console.warn("There was a problem browsing the players",c),c;case 11:return[2]}}))}))},this.getPlayersWithNativeIds=function(e){return r(u,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=e.length,n=new s.default({playerIds:e,limit:t}),[4,this.getPlayers(n)];case 1:return(r=i.sent()).data.sort((function(e,t){return e.id.localeCompare(t.id)})),[4,this.idMapping.remapEntities(r.data,"player")];case 2:return[2,i.sent()]}}))}))},this.getPlayersMapWithNativeIds=function(e){return r(u,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t={},(n=(0,a.transformIdsToBeUnique)(e)).sort((function(e,t){return e.localeCompare(t)})),[4,this.getPlayersWithNativeIds(n)];case 1:return r=i.sent(),n.forEach((function(e,n){return t[e]=r[n]})),[2,t]}}))}))},this.getPlayers=function(e,t){return r(u,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getPlayers(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the players",n),n;case 3:return[2]}}))}))},this.getPlayerIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"player","native")];case 1:return n=i.sent(),[4,this.getPlayerById(n.player[0],t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"player")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the following player:"+e,s),s;case 5:return[2]}}))}))},this.getPlayerById=function(e,t){return r(u,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getPlayerById(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the following player: "+e,n),n;case 3:return[2]}}))}))},this.getTopPlayersIdMapping=function(e){return r(u,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.getTopPlayers(e)];case 1:return t=r.sent(),[4,this.idMapping.remapEntities(t,"player")];case 2:return[2,r.sent()];case 3:throw n=r.sent(),console.warn("There was a problem browsing the top players",n),n;case 4:return[2]}}))}))},this.getTopPlayers=function(e){return r(u,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTopPlayers(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem retrieving the top players",t),t;case 3:return[2]}}))}))},this.getNextMatchForPlayerIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"player","native")];case 1:return n=i.sent(),e=n.player[0],[4,this.getNextMatchForPlayer(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"match")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the next match for player:"+e,s),s;case 5:return[2]}}))}))},this.getNextMatchForPlayer=function(e,t){return r(u,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=t||!1,[4,this.https.getNextMatchForPlayer(e,t)];case 1:return n=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),console.warn("There was a problem retrieving the next match for player: "+e,r),r;case 4:return[2]}}))}))},this.getPrevMatchForPlayerIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"player","native")];case 1:return n=i.sent(),e=n.player[0],[4,this.getPrevMatchForPlayer(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"match")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the previous match for player:"+e,s),s;case 5:return[2]}}))}))},this.getPrevMatchForPlayer=function(e,t){return r(u,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=t||!1,[4,this.https.getPrevMatchForPlayer(e,t)];case 1:return n=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),console.warn("There was a problem retrieving the previous match for player: "+e,r),r;case 4:return[2]}}))}))},this.idMapping=n,this.https=t,this.footballService=new o.default(e)}},2140:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(604);t.default=function(e,t){var n=this;this.https=null,this.idMapping=null,this.searchIdMapping=function(e,t){return r(n,void 0,void 0,(function(){var n,r,a,o,u,l;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,10,,11]),(e=new s.default(e)).scope?[4,this.idMapping.getEntityIdsBySchemaId(e.scope,"competition","native")]:[3,2];case 1:n=i.sent(),e.scope=n.competition,i.label=2;case 2:return[4,this.search(e,t)];case 3:return(r=i.sent()).teams&&r.teams.length>0?[4,this.idMapping.remapEntities(r.teams,"team")]:[3,5];case 4:a=i.sent(),r.teams=a,i.label=5;case 5:return r.players&&r.players.length>0?[4,this.idMapping.remapEntities(r.players,"player")]:[3,7];case 6:o=i.sent(),r.players=o,i.label=7;case 7:return r.competitions&&r.competitions.length>0?[4,this.idMapping.remapEntities(r.competitions,"competition")]:[3,9];case 8:u=i.sent(),r.competitions=u,i.label=9;case 9:return[2,r];case 10:throw l=i.sent(),console.warn("There was a problem with browsing the search result",l),l;case 11:return[2]}}))}))},this.search=function(e,t){return r(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.https.search(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the search response",n),n;case 3:return[2]}}))}))},this.https=e,this.idMapping=t}},9693:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(9920),a=n(9582),o=n(712);t.default=function(e,t,n){var u=this;this.footballService=null,this.https=null,this.idMapping=null,this.getTeamsIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,a,o,u,l,c;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,9,,10]),n=!1,e?(e=new s.default(e)).countryId?[4,this.idMapping.getEntityIdsBySchemaId([""+e.countryId],"country","native")]:[3,2]:[3,6];case 1:0===(r=i.sent()).country.length&&(n=!0),e.countryId=r.country[0],i.label=2;case 2:return e.scope?[4,this.idMapping.getEntityIdsBySchemaId(e.scope,"competition","native")]:[3,4];case 3:0===(a=i.sent()).competition.length&&(n=!0),e.scope=a.competition,i.label=4;case 4:return e.teamIds?[4,this.idMapping.getEntityIdsBySchemaId(e.teamIds,"team","native")]:[3,6];case 5:0===(o=i.sent()).team.length&&(n=!0),e.teamIds=o.team,i.label=6;case 6:return n?[2,[]]:[4,this.getTeams(e,t)];case 7:return u=i.sent(),l=u,[4,this.idMapping.remapEntities(u.data,"team")];case 8:return l.data=i.sent(),[2,u];case 9:throw c=i.sent(),console.warn("There was a problem browsing all teams",c),c;case 10:return[2]}}))}))},this.getTeamsMapWithNativeIds=function(e){return r(u,void 0,void 0,(function(){var t,n,r,a,u,l;return i(this,(function(i){switch(i.label){case 0:return t=new Map,n=e.length,r=new s.default({teamIds:e,limit:n}),[4,this.getTeams(r)];case 1:return(a=i.sent().data).sort((function(e,t){return e.id.localeCompare(t.id)})),u=(0,o.sortArrayInAscOrder)(e),[4,this.idMapping.remapEntities(a,"team")];case 2:return l=i.sent(),u.forEach((function(e,n){return t.set(e,l[n])})),[2,t]}}))}))},this.getTeams=function(e,t){return r(u,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTeams(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving all teams",n),n;case 3:return[2]}}))}))},this.getTeamByIdIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"team","native")];case 1:return n=i.sent(),e=n.team[0],[4,this.getTeamById(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"team")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the following team:"+e,s),s;case 5:return[2]}}))}))},this.getTeamById=function(e,t){return r(u,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTeamById(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the following team: "+e,n),n;case 3:return[2]}}))}))},this.getTopTeamsIdMapping=function(e){return r(u,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.getTopTeams(e)];case 1:return t=r.sent(),[4,this.idMapping.remapEntities(t,"team")];case 2:return[2,r.sent()];case 3:throw n=r.sent(),console.warn("There was a problem browsing the top teams",n),n;case 4:return[2]}}))}))},this.getTopTeams=function(e){return r(u,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTopTeams(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem retrieving the top teams",t),t;case 3:return[2]}}))}))},this.getNextMatchForTeamIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"team","native")];case 1:return n=i.sent(),e=n.team[0],[4,this.getNextMatchForTeam(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"match")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the next match for the following team:"+e,s),s;case 5:return[2]}}))}))},this.getNextMatchForTeam=function(e,t){return r(u,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=t||!1,[4,this.https.getNextMatchForTeam(e,t)];case 1:return n=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),console.warn("There was a problem retrieving the next match for the following team: "+e,r),r;case 4:return[2]}}))}))},this.getPrevMatchForTeamIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"team","native")];case 1:return n=i.sent(),e=n.team[0],[4,this.getPrevMatchForTeam(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"match")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the previous match for the following team:"+e,s),s;case 5:return[2]}}))}))},this.getPrevMatchForTeam=function(e,t){return r(u,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=t||!1,[4,this.https.getPrevMatchForTeam(e,t)];case 1:return n=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),console.warn("There was a problem retrieving the previous match for the following team: "+e,r),r;case 4:return[2]}}))}))},this.idMapping=n,this.https=t,this.footballService=new a.default(e)}},8808:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8900),a=n(5601),o=n(595),u=n(4289);t.default=function(e){var t=this;this.https=null,this.idMapping=null,this.localStorage=null,this.footballFacade=null,this.getCountries=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getCountries(e)];case 1:return[2,t.sent()]}}))}))},this.getCompetitions=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getCompetitions(e,n)];case 1:return[2,t.sent()]}}))}))},this.getCompetitionById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getCompetitionById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTopCompetitions=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTopCompetitions(e)];case 1:return[2,t.sent()]}}))}))},this.getTeams=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTeams(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTeamById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTeamById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTopTeams=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTopTeams(e)];case 1:return[2,t.sent()]}}))}))},this.getNextMatchForTeam=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getNextMatchForTeam(e,n)];case 1:return[2,t.sent()]}}))}))},this.getPrevMatchForTeam=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getPrevMatchForTeam(e,n)];case 1:return[2,t.sent()]}}))}))},this.getPlayers=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getPlayers(e,n)];case 1:return[2,t.sent()]}}))}))},this.getPlayerById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getPlayerById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTopPlayers=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTopPlayers(e)];case 1:return[2,t.sent()]}}))}))},this.getNextMatchForPlayer=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getNextMatchForPlayer(e,n)];case 1:return[2,t.sent()]}}))}))},this.getPrevMatchForPlayer=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getPrevMatchForPlayer(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMatches=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getMatches(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMatchById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getMatchById(e,n)];case 1:return[2,t.sent()]}}))}))},this.search=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.search(e,n)];case 1:return[2,t.sent()]}}))}))},this.https=new o.default(e),this.idMapping=new s.default(e),this.localStorage=new a.default(e),this.footballFacade=new u.default(e,this.localStorage,this.https,this.idMapping)}},6975:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.type="",this.name=""}},2754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.countryId=null,this.name=null,this.gender=null,this.type=null,this.sortField=null,this.sortOrder=null,this.competitionIds=null,this.constructFilterUrl=function(){var e="";return t.countryId&&(e=(e+="&")+"country_id="+t.countryId),t.gender&&(e=(e+="&")+"gender="+t.gender),t.type&&(e=(e+="&")+"type="+t.type),t.sortField&&(e=(e+="&")+"sort_field="+t.sortField),t.sortOrder&&(e=(e+="&")+"sort_order="+t.sortOrder),t.name&&(e=(e+="&")+"name="+t.name),t.competitionIds&&(e=(e+="&")+"competition_ids="+t.competitionIds.join(",")),e},this.competitionSearchFilter=function(e){try{var n=t.filter(e);return t.sortField||t.sortOrder?t.sort(n):n}catch(e){return console.warn("There was a problem filtering the local competitions",e),[]}},this.filter=function(e){var n=t.entitiesToSearchWith();return e.filter((function(e){var r=!0;return n.forEach((function(n){"sortOrder"!==n&&"sortField"!==n&&("countryId"===n?r&&(r=e.country.id===t[n]):"name"===n?r&&(r=e.name.toLocaleLowerCase().includes(t[n].toLocaleLowerCase())):"competitionIds"===n?r&&(r=t[n].some((function(t){return e.id===t}))):r&&(r=e[n].toLocaleLowerCase()===t[n].toLocaleLowerCase()))})),r}))},this.entitiesToSearchWith=function(){var e=[];return t.countryId&&e.push("countryId"),t.name&&e.push("name"),t.gender&&e.push("gender"),t.type&&e.push("type"),t.sortField&&e.push("sortField"),t.sortOrder&&e.push("sortOrder"),t.competitionIds&&e.push("competitionIds"),e},this.sort=function(e){var n=[];return"name"===t.sortField?n=e.sort((function(e,n){return t.sortOrder&&"desc"===t.sortOrder?n.name.localeCompare(e.name):e.name.localeCompare(n.name)})):"country"===t.sortField?n=e.sort((function(e,n){return t.sortOrder&&"desc"===t.sortOrder?n.country.name.localeCompare(e.country.name):e.country.name.localeCompare(n.country.name)})):"scope"===t.sortField?e.forEach((function(e){return n[t.competitionIds.indexOf(e.id)]=e})):t.sortField||"desc"!==t.sortOrder||(n=e.sort((function(e,t){return t.id.localeCompare(e.id)}))),n},this.countryId=e.countryId?""+e.countryId:null,this.name=e.name?e.name:null,this.gender=e.gender?e.gender:null,this.type=e.type?e.type:null,this.sortField=e.sortField?""+e.sortField:null,this.sortOrder=e.sortOrder?""+e.sortOrder:null,this.competitionIds=e.competitionIds?e.competitionIds:null}},3321:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.type="",this.name="",this.participants=[]}},7316:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6975),i=n(3430),s=function(){function e(){this.countryRemapper=null,this.countryRemapper=new i.default}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.id=e.id,t.country=this.countryRemapper.countryFromResponse(e.country),t.gender=e.gender,t.assets=e.assets,t.type=e.type,t.name=e.name,t}catch(e){throw console.warn("There was a problem remapping the competition response",e),e}},e}();t.default=s},8758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3321),i=n(3430),s=n(5827),a=function(){function e(){this.countryRemapper=null,this.teamBasicRemapper=null,this.countryRemapper=new i.default,this.teamBasicRemapper=new s.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new r.default;return n.id=e.id,n.country=this.countryRemapper.countryFromResponse(e.country),n.gender=e.gender,n.assets=e.assets,n.type=e.type,n.name=e.name,n.participants=e.participants.map((function(e){return t.teamBasicRemapper.fromResponse(e)})),n}catch(e){throw console.warn("There was a problem remapping the competition response",e),e}},e}();t.default=a},4427:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.alias="",this.countryCode="",this.assets=null,this.name=""}},3430:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4427);t.default=function(){var e=this;this.countriesFromResponse=function(t){if(t)return t.map((function(t){return e.countryFromResponse(t)}))},this.countryFromResponse=function(e){try{if(e){var t=new r.default;return t.id=e.id,t.alias=e.alias,t.assets=e.assets,t.countryCode=e.country_code,t.name=e.name,t}}catch(e){throw e}return null}}},8470:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.homeTeam={players:[]},this.awayTeam={players:[]}}},3098:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8470),i=n(3550),s=function(){function e(){this.playerRemapper=null,this.playerRemapper=new i.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new r.default;return n.homeTeam.players=e.home_team&&e.home_team.players?e.home_team.players.map((function(e){return t.playerRemapper.fromResponse(e)})):[],n.awayTeam.players=e.away_team&&e.away_team.players?e.away_team.players.map((function(e){return t.playerRemapper.fromResponse(e)})):[],n}catch(e){throw console.warn("There was a problem remapping the lineups",e),e}},e}();t.default=s},2579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.kickoffAt="",this.finishedAt="",this.updatedAt="",this.availableMarkets=null,this.homeTeam=null,this.awayTeam=null,this.isDeleted=!1,this.lineupsConfirmed=!1,this.startedAt="",this.minute="",this.scores=null,this.context={competition:null},this.status={type:null,subType:null}}},6134:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.countryIds=null,this.competitionIds=null,this.matchIds=null,this.status=null,this.teamIds=null,this.fromDate=null,this.toDate=null,this.limit=null,this.page=null,this.sortField=null,this.sortOrder=null,this.constructFilterUrl=function(){var e="";return t.countryIds&&(e=(e+="&")+"countries="+t.countryIds.join(",")),t.competitionIds&&(e=(e+="&")+"competitions="+t.competitionIds.join(",")),t.matchIds&&(e=(e+="&")+"matches="+t.matchIds.join(",")),t.status&&(e=(e+="&")+"status="+t.status),t.teamIds&&(e=(e+="&")+"teams="+t.teamIds.join(",")),t.fromDate&&(e=(e+="&")+"from_date="+t.fromDate),t.toDate&&(e=(e+="&")+"to_date="+t.toDate),t.limit&&(e=(e+="&")+"limit="+t.limit),t.page&&(e=(e+="&")+"page="+t.page),t.sortField&&(e=(e+="&")+"sort_field="+t.sortField),t.sortOrder&&(e=(e+="&")+"sort_order="+t.sortOrder),e},this.countryIds=e.countryIds?e.countryIds:null,this.competitionIds=e.competitionIds?e.competitionIds:null,this.matchIds=e.matchIds?e.matchIds:null,this.status=e.status?e.status:null,this.teamIds=e.teamIds?e.teamIds:null,this.fromDate=e.fromDate?e.fromDate:null,this.toDate=e.toDate?e.toDate:null,this.limit=e.limit?e.limit:null,this.page=e.page?e.page:null,this.sortField=e.sortField?e.sortField:null,this.sortOrder=e.sortOrder?e.sortOrder:null}},9661:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6899);t.default=function(){this.id="",this.kickoffAt="",this.finishedAt="",this.updatedAt="",this.availableMarkets=null,this.isDeleted=!1,this.homeTeam=null,this.awayTeam=null,this.lineupsConfirmed=!1,this.startedAt="",this.minute="",this.scores=null,this.stats=null,this.context={competition:null},this.timeline=[],this.status=new r.default,this.lineups=null}},5284:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2579),i=n(5827),s=n(7316),a=n(3949),o=function(){function e(){this.teamRemapper=null,this.competitionRemapper=null,this.scoresRemapper=null,this.teamRemapper=new i.default,this.competitionRemapper=new s.default,this.scoresRemapper=new a.default}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.id=e.id,t.kickoffAt=e.kickoff_at,t.finishedAt=e.finished_at,t.updatedAt=e.updated_at,t.isDeleted=e.is_deleted,t.homeTeam=this.teamRemapper.fromResponse(e.home_team),t.awayTeam=this.teamRemapper.fromResponse(e.away_team),t.lineupsConfirmed=e.lineups_confirmed,t.startedAt=e.started_at,t.minute=e.minute,t.scores=this.scoresRemapper.fromResponse(e.scores),t.context={competition:e.context.competition?this.competitionRemapper.fromResponse(e.context.competition):null},t.status={type:e.status.type,subType:e.status.sub_type},t}catch(e){throw console.warn("There was a problem remapping the match response",e),e}},e}();t.default=o},9330:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9661),i=n(5827),s=n(7316),a=n(7122),o=n(3949),u=n(3098),l=n(8470),c=n(92),d=function(){function e(){this.teamMapper=null,this.competitionsMapper=null,this.lineupsMapper=null,this.scoresMapper=null,this.statsMapper=null,this.timelineMapper=null,this.teamMapper=new i.default,this.competitionsMapper=new s.default,this.lineupsMapper=new u.default,this.scoresMapper=new o.default,this.statsMapper=new a.default,this.timelineMapper=new c.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new r.default;return n.id=e.id,n.kickoffAt=e.kickoff_at,n.finishedAt=e.finished_at,n.updatedAt=e.updated_at,n.isDeleted=e.is_deleted,n.homeTeam=e.home_team?this.teamMapper.fromResponse(e.home_team):null,n.awayTeam=e.away_team?this.teamMapper.fromResponse(e.away_team):null,n.lineupsConfirmed=e.lineups_confirmed,n.startedAt=e.started_at,n.minute=e.minute,n.scores=this.scoresMapper.fromResponse(e.scores),n.stats=this.statsMapper.fromResponse(e.stats),n.context={competition:this.competitionsMapper.fromResponse(e.context.competition)},n.timeline=e.timeline?e.timeline.map((function(e){return t.timelineMapper.fromResponse(e)})):[],n.status={type:e.status.type,subType:e.status.sub_type},n.lineups=e.lineups?this.lineupsMapper.fromResponse(e.lineups):new l.default,n}catch(e){throw console.warn("There was a problem remapping the match response",e),e}},e}();t.default=d},4652:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.ftScore=null,this.htScore=null,this.aetScore=null,this.aggScore=null,this.penScore=null}},3949:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4652),i=function(){function e(){this.statEntityFromResponse=function(e){return{homeGoals:e.home_goals,awayGoals:e.away_goals}}}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.ftScore=this.statEntityFromResponse(e.ft_score),t.htScore=this.statEntityFromResponse(e.ht_score),t.aetScore=this.statEntityFromResponse(e.aet_score),t.aggScore=this.statEntityFromResponse(e.agg_score),t.penScore=this.statEntityFromResponse(e.pen_score),t}catch(e){throw console.warn("There was a problem remapping the scores",e),e}},e}();t.default=i},7950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.corners=null,this.cornersFirstHalf=null,this.cornersSecondHalf=null,this.cornersExtraTime=null,this.crosses=null,this.crossesFirstHalf=null,this.crossesSecondHalf=null,this.crossesExtraTime=null,this.offside=null,this.offsideFirstHalf=null,this.offsideSecondHalf=null,this.offsideExtraTime=null,this.shotsOn=null,this.shotsOnFirstHalf=null,this.shotsOnSecondHalf=null,this.shotsOnExtraTime=null,this.throwIn=null,this.throwInFirstHalf=null,this.throwInSecondHalf=null,this.throwInExtraTime=null,this.redCards=null,this.redCardsFirstHalf=null,this.redCardsSecondHalf=null,this.redCardsExtraTime=null,this.shotsOff=null,this.shotsOffFirstHalf=null,this.shotsOffSecondHalf=null,this.shotsOffExtraTime=null,this.goalKicks=null,this.goalKicksFirstHalf=null,this.goalKicksSecondHalf=null,this.goalKicksExtraTime=null,this.possession=null,this.possessionFirstHalf=null,this.possessionSecondHalf=null,this.possessionExtraTime=null,this.treatments=null,this.treatmentsFirstHalf=null,this.treatmentsSecondHalf=null,this.treatmentsExtraTime=null,this.yellowCards=null,this.yellowCardsFirstHalf=null,this.yellowCardsSecondHalf=null,this.yellowCardsExtraTime=null,this.shotsBlocked=null,this.shotsBlockedFirstHalf=null,this.shotsBlockedSecondHalf=null,this.shotsBlockedExtraTime=null,this.substitutions=null,this.substitutionsFirstHalf=null,this.substitutionsSecondHalf=null,this.substitutionsExtraTime=null,this.counterAttacks=null,this.counterAttacksFirstHalf=null,this.counterAttacksSecondHalf=null,this.counterAttacksExtraTime=null,this.foulsCommitted=null,this.foulsCommittedFirstHalf=null,this.foulsCommittedSecondHalf=null,this.foulsCommittedExtraTime=null}},7122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7950),i=function(){function e(){this.statEntityFromResponse=function(e){return{homeTeam:e?e.home_team:null,awayTeam:e?e.away_team:null}}}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.corners=this.statEntityFromResponse(e.corners),t.cornersFirstHalf=this.statEntityFromResponse(e.corners_1h),t.cornersSecondHalf=this.statEntityFromResponse(e.corners_2h),t.cornersExtraTime=this.statEntityFromResponse(e.corners_et),t.crosses=this.statEntityFromResponse(e.crosses),t.crossesFirstHalf=this.statEntityFromResponse(e.crosses_1h),t.crossesSecondHalf=this.statEntityFromResponse(e.crosses_2h),t.crossesExtraTime=this.statEntityFromResponse(e.crosses_et),t.offside=this.statEntityFromResponse(e.offside),t.offsideFirstHalf=this.statEntityFromResponse(e.offside_1h),t.offsideSecondHalf=this.statEntityFromResponse(e.offside_2h),t.offsideExtraTime=this.statEntityFromResponse(e.offside_et),t.shotsOn=this.statEntityFromResponse(e.shots_on),t.shotsOnFirstHalf=this.statEntityFromResponse(e.shots_on_1h),t.shotsOnSecondHalf=this.statEntityFromResponse(e.shots_on_2h),t.shotsOnExtraTime=this.statEntityFromResponse(e.shots_on_et),t.throwIn=this.statEntityFromResponse(e.throw_in),t.throwInFirstHalf=this.statEntityFromResponse(e.throw_in_1h),t.throwInSecondHalf=this.statEntityFromResponse(e.throw_in_2h),t.throwInExtraTime=this.statEntityFromResponse(e.throw_in_et),t.redCards=this.statEntityFromResponse(e.red_cards),t.redCardsFirstHalf=this.statEntityFromResponse(e.red_cards_1h),t.redCardsSecondHalf=this.statEntityFromResponse(e.red_cards_2h),t.redCardsExtraTime=this.statEntityFromResponse(e.red_cards_et),t.shotsOff=this.statEntityFromResponse(e.shots_off),t.shotsOffFirstHalf=this.statEntityFromResponse(e.shots_off_1h),t.shotsOffSecondHalf=this.statEntityFromResponse(e.shots_off_2h),t.shotsOffExtraTime=this.statEntityFromResponse(e.shots_off_et),t.goalKicks=this.statEntityFromResponse(e.goal_kicks),t.goalKicksFirstHalf=this.statEntityFromResponse(e.goal_kicks_1h),t.goalKicksSecondHalf=this.statEntityFromResponse(e.goal_kicks_2h),t.goalKicksExtraTime=this.statEntityFromResponse(e.goal_kicks_et),t.possession=this.statEntityFromResponse(e.possession),t.possessionFirstHalf=this.statEntityFromResponse(e.possession_1h),t.possessionSecondHalf=this.statEntityFromResponse(e.possession_2h),t.possessionExtraTime=this.statEntityFromResponse(e.possession_et),t.treatments=this.statEntityFromResponse(e.treatments),t.treatmentsFirstHalf=this.statEntityFromResponse(e.treatments_1h),t.treatmentsSecondHalf=this.statEntityFromResponse(e.treatments_2h),t.treatmentsExtraTime=this.statEntityFromResponse(e.treatments_et),t.yellowCards=this.statEntityFromResponse(e.yellow_cards),t.yellowCardsFirstHalf=this.statEntityFromResponse(e.yellow_cards_1h),t.yellowCardsSecondHalf=this.statEntityFromResponse(e.yellow_cards_2h),t.yellowCardsExtraTime=this.statEntityFromResponse(e.yellow_cards_et),t.shotsBlocked=this.statEntityFromResponse(e.shots_blocked),t.shotsBlockedFirstHalf=this.statEntityFromResponse(e.shots_blocked_1h),t.shotsBlockedSecondHalf=this.statEntityFromResponse(e.shots_blocked_2h),t.shotsBlockedExtraTime=this.statEntityFromResponse(e.shots_blocked_et),t.substitutions=this.statEntityFromResponse(e.substitutions),t.substitutionsFirstHalf=this.statEntityFromResponse(e.substitutions_1h),t.substitutionsSecondHalf=this.statEntityFromResponse(e.substitutions_2h),t.substitutionsExtraTime=this.statEntityFromResponse(e.substitutions_et),t.counterAttacks=this.statEntityFromResponse(e.counter_attacks),t.counterAttacksFirstHalf=this.statEntityFromResponse(e.counter_attacks_1h),t.counterAttacksSecondHalf=this.statEntityFromResponse(e.counter_attacks_2h),t.counterAttacksExtraTime=this.statEntityFromResponse(e.counter_attacks_et),t.foulsCommitted=this.statEntityFromResponse(e.fouls_committed),t.foulsCommittedFirstHalf=this.statEntityFromResponse(e.fouls_committed_1h),t.foulsCommittedSecondHalf=this.statEntityFromResponse(e.fouls_committed_2h),t.foulsCommittedExtraTime=this.statEntityFromResponse(e.fouls_committed_et),t}catch(e){throw console.warn("There was a problem remapping the stats",e),e}},e}();t.default=i},6899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.type=null,this.subType=null}},9452:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.minute="",this.type="",this.teamId="",this.player=null,this.relatedPlayer=null,this.updatedAt=""}},92:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9452),i=n(3550),s=function(){function e(){this.playerRemapper=null,this.playerRemapper=new i.default}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.minute=e.minute,t.type=e.type,t.teamId=e.team_id,t.player=this.playerRemapper.fromResponse(e.player),t.relatedPlayer=e.related_player?this.playerRemapper.fromResponse(e.related_player):null,t.updatedAt=e.updated_at,t}catch(e){throw console.warn("There was a problem remapping timeline",e),e}},e}();t.default=s},753:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3569);t.default=function(){this.meta=new r.default,this.data=[]}},3569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(155);t.default=function(){this.pagination=new r.default}},155:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.currentPage=null,this.itemsPerPage=null,this.totalItems=null,this.numberOfPages=null}},1925:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3569);t.default=function(){this.remapMetaProp=function(e){var t=new r.default;return t.pagination.currentPage=e.pagination.current_page,t.pagination.itemsPerPage=e.pagination.items_per_page,t.pagination.totalItems=e.pagination.total_items,t.pagination.numberOfPages=e.pagination.number_of_pages,t}}},4426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null,this.isDeleted=!1,this.teams=[]}},6477:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.countryId=null,this.scope=null,this.name=null,this.playerIds=null,this.limit=null,this.page=null,this.sortField=null,this.sortOrder=null,this.constructFilterUrl=function(){var e="";return t.countryId&&(e=(e+="&")+"country_id="+t.countryId),t.scope&&(e=(e+="&")+"scope="+t.scope.join(",")),t.name&&(e=(e+="&")+"name="+t.name),t.playerIds&&(e=(e+="&")+"player_ids="+t.playerIds.join(",")),t.limit&&(e=(e+="&")+"limit="+t.limit),t.page&&(e=(e+="&")+"page="+t.page),t.sortField&&(e=(e+="&")+"sort_field="+t.sortField),t.sortOrder&&(e=(e+="&")+"sort_order="+t.sortOrder),e},this.countryId=e.countryId?e.countryId:null,this.scope=e.scope?e.scope:null,this.name=e.name?e.name:null,this.playerIds=e.playerIds?e.playerIds:null,this.limit=e.limit?e.limit:null,this.page=e.page?e.page:null,this.sortField=e.sortField?e.sortField:null,this.sortOrder=e.sortOrder?e.sortOrder:null}},1837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null,this.isDeleted=!1,this.competitions=[],this.teams=[]}},4803:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.name="",this.position="",this.assets=null,this.type=""}},9071:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.startDate="",this.endDate="",this.loan=!1,this.position="",this.country=null,this.name="",this.assets=null,this.birthDate=""}},5157:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(4426),s=n(5827),a=function(){function e(){this.countryRemapper=null,this.teamRemapper=null,this.countryRemapper=new r.default,this.teamRemapper=new s.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new i.default;return n.id=e.id,n.firstName=e.first_name?e.first_name:null,n.lastName=e.last_name?e.last_name:null,n.name=e.name?e.name:null,n.birthDate=e.birth_date,n.country=this.countryRemapper.countryFromResponse(e.country),n.assets=e.assets,n.teams=e.teams?e.teams.map((function(e){return t.teamRemapper.fromResponse(e)})):[],n.position=e.position,n.isDeleted=e.is_deleted,n}catch(e){throw console.warn("There was a problem remapping players response",e),e}},e}();t.default=a},7943:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(1837),s=n(5827),a=n(7316),o=function(){function e(){this.countryRemapper=null,this.teamRemapper=null,this.competitionRemapper=null,this.countryRemapper=new r.default,this.teamRemapper=new s.default,this.competitionRemapper=new a.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new i.default;return n.id=e.id,n.firstName=e.first_name?e.first_name:null,n.lastName=e.last_name?e.last_name:null,n.name=e.name?e.name:null,n.birthDate=e.birth_date,n.country=this.countryRemapper.countryFromResponse(e.country),n.assets=e.assets,n.teams=e.teams?e.teams.map((function(e){return t.teamRemapper.fromResponse(e)})):[],n.position=e.position,n.isDeleted=e.is_deleted,n.competitions=e.competitions?e.competitions.map((function(e){return t.competitionRemapper.fromResponse(e)})):[],n}catch(e){throw console.warn("There was a problem remapping player response",e),e}},e}();t.default=o},3550:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4803),i=function(){function e(){}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.id=e.id,t.name=e.name,t.position=e.position,t.shirtNumber=e.shirt_number,t.assets=e.assets,t.type=e.type,t}catch(e){throw console.warn("There was a problem remapping the player from timeline",e),e}},e}();t.default=i},4085:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(9071),s=function(){function e(){this.countryRemapper=null,this.countryRemapper=new r.default}return e.prototype.fromResponse=function(e){try{var t=new i.default;return t.id=e.id,t.startDate=e.start_date,t.endDate=e.end_date,t.shirtNumber=e.shirt_number,t.loan=e.loan,t.position=e.position,t.country=this.countryRemapper.countryFromResponse(e.country),t.name=e.name,t.assets=e.assets,t.birthDate=e.birth_date,t}catch(e){throw console.warn("There was a problem remapping the player from squad",e),e}},e}();t.default=s},4729:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(56),s=function(){function e(){this.countryRemapper=null,this.countryRemapper=new r.default}return e.prototype.fromResponse=function(e){try{var t=new i.default;return t.id=e.id,t.firstName=e.first_name?e.first_name:null,t.lastName=e.last_name?e.last_name:null,t.name=e.name?e.name:null,t.birthDate=e.birth_date,t.country=this.countryRemapper.countryFromResponse(e.country),t.assets=e.assets,t.position=e.position,t}catch(e){throw console.warn("There was a problem remapping top player response",e),e}},e}();t.default=s},56:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null}},604:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.entities=null,this.query=null,this.scope=null,this.constructFilterUrl=function(){var e="";return t.entities&&(e=(e+="&")+"entities="+t.entities.join(",")),t.query&&(e=(e+="&")+"q="+t.query),t.scope&&(e=(e+="&")+"scope="+t.scope.join(",")),e},this.entities=e.entities?e.entities:null,this.query=e.query?e.query:null,this.scope=e.scope?e.scope:null}},6967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.teams=null,this.players=null,this.competitions=null}},7287:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5827),i=n(5157),s=n(7316),a=n(6967),o=function(){function e(){this.teamRemapper=null,this.playerRemapper=null,this.competitionremapper=null,this.teamRemapper=new r.default,this.playerRemapper=new i.default,this.competitionremapper=new s.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new a.default;return n.teams=e.teams?e.teams.map((function(e){return t.teamRemapper.fromResponse(e)})):[],n.players=e.players?e.players.map((function(e){return t.playerRemapper.fromResponse(e)})):[],n.competitions=e.competitions?e.competitions.map((function(e){return t.competitionremapper.fromResponse(e)})):[],n}catch(e){throw console.warn("There was a problem remapping search response",e),e}},e}();t.default=o},5827:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(9314),s=function(){function e(){this.countryRemapper=null,this.countryRemapper=new r.default}return e.prototype.fromResponse=function(e){try{var t=new i.default;return t.id=e.id,t.country=this.countryRemapper.countryFromResponse(e.country),t.gender=e.gender,t.assets=e.assets,t.code=e.code,t.national=e.national,t.fullName=e.full_name,t.shortName=e.short_name,t.name=e.name,t.isDeleted=e.is_deleted,t}catch(e){throw console.warn("There was a problem remapping teams response",e),e}},e}();t.default=s},7821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(1986),s=n(4085),a=n(7316),o=function(){function e(){this.countryRemapper=null,this.competitionRemapper=null,this.playerRemapper=null,this.countryRemapper=new r.default,this.competitionRemapper=new a.default,this.playerRemapper=new s.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new i.default;return n.id=e.id,n.country=this.countryRemapper.countryFromResponse(e.country),n.gender=e.gender,n.assets=e.assets,n.code=e.code,n.national=e.national,n.fullName=e.full_name,n.shortName=e.short_name,n.name=e.name,n.isDeleted=e.is_deleted,n.competitions=e.competitions?e.competitions.map((function(e){return t.competitionRemapper.fromResponse(e)})):[],n.colors=e.colors?e.colors:n.colors,n.squad=e.squad?e.squad.map((function(e){return t.playerRemapper.fromResponse(e)})):[],n}catch(e){throw console.warn("There was a problem remapping team response",e),e}},e}();t.default=o},9314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.name="",this.code="",this.national=!1,this.fullName="",this.shortName="",this.isDeleted=!1}},3773:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.primary=null,this.secondary=null,this.tertiary=null}},9920:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.name=null,this.countryId=null,this.national=!1,this.gender=null,this.limit=null,this.page=null,this.scope=null,this.sortField=null,this.sortOrder=null,this.teamIds=null,this.constructFilterUrl=function(){var e="";return t.name&&(e=(e+="&")+"name="+t.name),t.countryId&&(e=(e+="&")+"country_id="+t.countryId),t.national&&(e=(e+="&")+"national="+t.national),t.gender&&(e=(e+="&")+"gender="+t.gender),t.limit&&(e=(e+="&")+"limit="+t.limit),t.scope&&(e=(e+="&")+"scope="+t.scope.join(",")),t.page&&(e=(e+="&")+"page="+t.page),t.sortField&&(e=(e+="&")+"sort_field="+t.sortField),t.sortOrder&&(e=(e+="&")+"sort_order="+t.sortOrder),t.teamIds&&(e=(e+="&")+"team_ids="+t.teamIds.join(",")),e},this.name=e.name?e.name:null,this.countryId=e.countryId?""+e.countryId:null,this.national=!!e.national&&e.national,this.gender=e.gender?e.gender:null,this.limit=e.limit?e.limit:null,this.page=e.page?e.page:null,this.scope=e.scope?e.scope:null,this.sortField=e.sortField?""+e.sortField:null,this.sortOrder=e.sortOrder?""+e.sortOrder:null,this.teamIds=e.teamIds?e.teamIds:null}},1986:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3773);t.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.name="",this.competitions=[],this.code="",this.national=!1,this.fullName="",this.shortName="",this.isDeleted=!1,this.colors=new r.default,this.squad=[]}},9582:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(7686);t.default=function(e){var t=this;this.clientHttps=null,this.setAvailableMarketsForMatch=function(e){return r(t,void 0,void 0,(function(){var t,n,r,a=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.clientHttps.getConfig(s.FeatureConfigType.PREDICTOR)];case 1:return t=i.sent(),n=t.fullCoverageCompetitions,r=t.markets,Array.isArray(e)?[2,e.map((function(e){return a.setAvailableMarkets(e,n,r)}))]:"object"==typeof e&&Object.keys(e).length?[2,this.setAvailableMarkets(e,n,r)]:[2]}}))}))},this.setAvailableMarkets=function(e,n,r){var i,s=null===(i=e.context.competition)||void 0===i?void 0:i.id;return s&&t.isMatchInCoverageCompetition(s,n)?(e.availableMarkets=r.all,e):(e.availableMarkets=r.main,e)},this.isMatchInCoverageCompetition=function(e,t){var n=!1;return t.includes(e)?n=!0:n},this.clientHttps=new s.default(e)}},3822:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var a=n(4946),o=n(7686),u=n(3142),l=n(7232),c=n(1139),d=n(9502),h=n(8900),p=n(1859),f=n(2793),m=n(3247);t.default=function(e,t,n,v,y){var g=this;this.config=null,this.clientHttps=null,this.loyaltyHttps=null,this.loyaltyService=null,this.profileFacade=null,this.loyaltyValidator=null,this.idMapping=null,this.topXFacade=null,this.matchQuizFacade=null,this.predictorHttps=null,this.errorHandlingMode=null,this.getConfig=function(){return r(g,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.clientHttps.getConfig(o.FeatureConfigType.LOYALTY)];case 1:return[2,e.sent()]}}))}))},this.getClientBadges=function(){return r(g,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return e=t.sent(),[2,this.loyaltyService.buildClientBadges(e.rewards.badges)]}}))}))},this.getTemplates=function(e){return r(g,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=!0,this.config.idSchema!==a.IdSchemaEnum.NATIVE?[3,2]:[4,this.loyaltyHttps.getTemplates(e,t)];case 1:return[2,i.sent()];case 2:return[4,this.loyaltyHttps.getTemplates(e,t)];case 3:return n=i.sent(),r=n,[4,this.loyaltyService.remapTemplatesIds(s([],n.data,!0))];case 4:return r.data=i.sent(),[2,n]}}))}))},this.getTemplateById=function(e,t){return r(g,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.loyaltyHttps.getTemplateById(e,t)];case 1:return n=r.sent(),this.config.idSchema===a.IdSchemaEnum.NATIVE?[2,n]:[4,this.loyaltyService.remapTemplatesIds([n])];case 2:return[2,r.sent()[0]]}}))}))},this.getLeaderboard=function(e,t,n){return r(g,void 0,void 0,(function(){var r,s;return i(this,(function(i){switch(i.label){case 0:return t=this.loyaltyService.initFilters(t,"loyalty"),[4,this.loyaltyHttps.getLeaderboard(e,n,t)];case 1:return r=i.sent(),s=r,[4,this.loyaltyService.addProfileModelToLeaderboad(r.data)];case 2:return s.data=i.sent(),[2,r]}}))}))},this.getLeaderboardForGame=function(e,t,n){return r(g,void 0,void 0,(function(){var r,s;return i(this,(function(i){switch(i.label){case 0:return t=this.loyaltyService.initFilters(t,"loyalty"),[4,this.loyaltyHttps.getLeaderboardForGame(e,n,t)];case 1:return r=i.sent(),s=r,[4,this.loyaltyService.addProfileModelToLeaderboad(r.data)];case 2:return s.data=i.sent(),[2,r]}}))}))},this.getOwnRankings=function(e,t){return r(g,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.profileFacade.getOwn()];case 1:return n=r.sent().id,[2,this.getUserRankings(n,e,t)]}}))}))},this.getUserRankings=function(e,t,n){return r(g,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return t=this.loyaltyService.initFilters(t,"rankings"),[4,this.loyaltyHttps.getUserRankings(e,t,n)];case 1:return r=i.sent(),[4,this.getModelsForUserRankings(r)];case 2:return[2,i.sent()]}}))}))},this.getHighestSuccessRate=function(e,t){return r(g,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return e&&(e=new m.default(e),this.loyaltyValidator.validate(e,this.errorHandlingMode)),[4,this.loyaltyHttps.getHighestSuccessRate(e,t)];case 1:return n=r.sent(),[2,this.loyaltyService.addProfileModelToHighestSuccessRate(n)]}}))}))},this.getTemplateWinners=function(e){return r(g,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(e)];case 1:return t=r.sent(),[4,this.getTemplateById(e)];case 2:return n=r.sent(),t.contestModel=n,[2,this.loyaltyService.completeContestWinners(t)]}}))}))},this.getEntitiesFollows=function(e,t){return r(g,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return this.loyaltyService.validateEntitiesFollowsFilters(e),this.config.idSchema===a.IdSchemaEnum.NATIVE?[3,2]:[4,this.loyaltyService.remapEntitiesFollowsFilters(e)];case 1:e=r.sent(),r.label=2;case 2:return[4,this.loyaltyHttps.getEntitiesFollows(e,t)];case 3:return n=r.sent(),[4,this.loyaltyService.addModelsToEntitiesFollows(n)];case 4:return[2,r.sent()]}}))}))},this.getModelsForUserRankings=function(e){return r(g,void 0,void 0,(function(){var t,n,r,s,a,o,u,l,c,d,h,p;return i(this,(function(i){switch(i.label){case 0:return t=null,n=null,r=null,s=this.loyaltyService.extractRankingsIdsMap(e.data),a=s[0],o=s[1],(u=s[2]).length?[4,this.getTemplates()]:[3,2];case 1:l=i.sent(),t=l.data.filter((function(e){return u.includes(e.id)})),i.label=2;case 2:return a.length?(c={gameIds:a},[4,this.topXFacade.getGames(c)]):[3,4];case 3:d=i.sent(),n=d.data,i.label=4;case 4:return o.length?(h={gameIds:o},[4,this.matchQuizFacade.getGames(h)]):[3,6];case 5:p=i.sent(),r=p.data,i.label=6;case 6:return[2,this.loyaltyService.setModelsForUserRankings(n,r,t,e)]}}))}))},this.config=e,this.clientHttps=t,this.loyaltyHttps=n,this.profileFacade=new l.default(y,v),this.loyaltyService=new u.default(this.config),this.loyaltyValidator=new c.default,this.idMapping=new h.default(e),this.topXFacade=new d.default(e,this.idMapping),this.matchQuizFacade=new p.default(e),this.predictorHttps=new f.default(e,this.idMapping),this.errorHandlingMode=e.errorHandlingMode}},2962:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(7686),a=n(7059),o=n(3822),u=n(4275),l=n(5601);t.default=function(e){var t=this;this.clientHttps=null,this.profileHttps=null,this.loyaltyHttps=null,this.loyaltyFacade=null,this.localStorage=null,this.getConfig=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getConfig()];case 1:return[2,e.sent()]}}))}))},this.getClientBadges=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getClientBadges()];case 1:return[2,e.sent()]}}))}))},this.getTemplates=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getTemplates(e)];case 1:return[2,t.sent()]}}))}))},this.getTemplateById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getTemplateById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getLeaderboard=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getLeaderboard(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getLeaderboardForGame=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getLeaderboardForGame(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getOwnRankings=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getOwnRankings(e,n)];case 1:return[2,t.sent()]}}))}))},this.getUserRankings=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getUserRankings(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getHighestSuccessRate=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getHighestSuccessRate(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTemplateWinners=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getTemplateWinners(e)];case 1:return[2,t.sent()]}}))}))},this.getEntitiesFollows=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getEntitiesFollows(e,n)];case 1:return[2,t.sent()]}}))}))},this.clientHttps=new s.default(e),this.profileHttps=new u.default(e),this.loyaltyHttps=new a.default(e),this.localStorage=new l.default(e),this.loyaltyFacade=new o.default(e,this.clientHttps,this.loyaltyHttps,this.profileHttps,this.localStorage)}},8153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},5111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8153);t.default=function(){this.value=[new r.default]}},8608:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.general=[],this.predictor=[],this.topX=[],this.matchQuiz=[]}},246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1429);t.default=function(){this.assets={mainImageUrl:""},this.requirements=new r.default}},8687:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},1429:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.points=null,this.gameParticipationCount=null,this.entityId=null,this.entityType=null,this.predictionsMade=null,this.correctPredictions=null}},515:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5111),i=n(4226);t.default=function(){this.enabled=!1,this.conditions={list:null},this.actions=new r.default,this.rewards=new i.default}},3247:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.market=e.market?e.market:null,this.fromDate=e.fromDate?e.fromDate:null,this.toDate=e.toDate?e.toDate:null,this.usersCount=e.usersCount?e.usersCount:null,this.minimumPredictions=e.minimumPredictions?e.minimumPredictions:null}return e.prototype.constructFiltersUrl=function(){var e="";return this.market&&(e+="&",e+="market="+this.market),this.fromDate&&(e+="&",e+="from_date="+this.fromDate),this.toDate&&(e+="&",e+="to_date="+this.toDate),this.usersCount&&(e+="&",e+="users_count="+this.usersCount),this.minimumPredictions&&(e+="&",e+="minimum_predictions="+this.minimumPredictions),e},e}();t.default=n},7910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.limit=null,this.page=null,this.limit=e.limit?e.limit:null,this.page=e.page?e.page:null}return e.prototype.constructFiltersUrl=function(){var e="";return this.limit&&(e+="&",e+="limit="+this.limit),this.page&&(e+="&",e+="page="+this.page),e},e}();t.default=n},4996:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var n=e.call(this,t)||this;return n.sortOrder=null,n.rankType=null,n.leaderboardIds=null,n.gameType=null,n.constructFiltersUrl=function(){var t=e.prototype.constructFiltersUrl.call(n);return n.sortOrder&&(t+="&",t+="sort_order="+n.sortOrder),n.rankType&&(t+="&",t+="rank_type="+n.rankType),n.leaderboardIds&&(t+="&",t+="type_ids="+n.leaderboardIds.join(",")),n.gameType&&(t+="&",t+="game_type="+n.gameType),t},n.sortOrder=t.sortOrder,n.rankType=t.rankType,n.leaderboardIds=t.leaderboardIds,n.gameType=t.type&&"game"===t.type.toLowerCase()?t.gameType:null,n}return i(t,e),t}(n(7910).default);t.default=s},6507:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.position=null,this.points=null,this.predictionsMade=null,this.profileId=null,this.profileModel=null,this.successRatePercent=null}},7746:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6507);t.default=function(){this.remapHighestSuccessRate=function(e){return e.map((function(e){var t=new r.default;return t.position=e.position,t.points=e.points,t.predictionsMade=e.predictions_made,t.profileId=e.profile_id,t.successRatePercent=e.success_rate_percent,t}))}}},9642:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.position=null,this.profileId=null,this.profileModel=null,this.points=null,this.predictionsMade=null}},7419:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5828),i=n(9642);t.default=function(){var e=this;this.remapResponse=function(t){return t.meta=e.remapMeta(t.meta),t.data=e.remapData(t.data),t},this.remapMeta=function(e){var t=new r.default;return t.rankType=e.rank_type,t.fromDate=e.from_date,t.toDate=e.to_date,t.pagination.currentPage=e.pagination.current_page,t.pagination.itemsPerPage=e.pagination.items_per_page,t.pagination.totalItems=e.pagination.total_items,t.pagination.numberOfPages=e.pagination.number_of_pages,t},this.remapData=function(e){var t=[];return e.forEach((function(e){var n=new i.default;n.position=e.position,n.profileId=e.profile_id,n.points=e.points,n.predictionsMade=e.predictions_made,t.push(n)})),t}}},5828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(155);t.default=function(){this.rankType=null,this.fromDate=null,this.toDate=null,this.pagination=new r.default}},4187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.general=null,this.comments=null,this.predictor=null,this.activity=null,this.topX=null,this.matchQuiz=null}},9013:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.id=null,t.rankType=null,t.model=null,t.gameType=null,t}return i(t,e),t}(n(9642).default);t.default=s},4533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3569),i=n(9013),s=function(){function e(){var e=this;this.remapRankings=function(t){return t.meta=e.remapMeta(t.meta),t.data=e.remapData(t.data),t},this.remapMeta=function(e){var t=new r.default;return t.pagination.currentPage=e.pagination.current_page,t.pagination.itemsPerPage=e.pagination.items_per_page,t.pagination.numberOfPages=e.pagination.number_of_pages,t.pagination.totalItems=e.pagination.total_items,t}}return e.prototype.remapData=function(e){var t=[];return e.forEach((function(e){var n=new i.default;n.id=e.id,n.rankType=e.rank_type,n.position=e.position,n.points=e.points,n.gameType=e.game_type,delete n.profileId,delete n.profileModel,delete n.predictionsMade,t.push(n)})),t},e}();t.default=s},4226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.points=null,this.tiers=null,this.badges=null}},4982:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.labels=null,t.customFields=null,t.adContent=null,t}return i(t,e),t}(n(194).default);t.default=s},194:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(439);t.default=function(){this.id=null,this.name=null,this.description=null,this.type=null,this.fromDate=null,this.toDate=null,this.markets=[],this.teamIds=[],this.matchIds=[],this.gameIds=[],this.gameTypes=[],this.competitionIds=[],this.excludedProfileIds=[],this.rules=null,this.flags=null,this.images=new r.default,this.status=null,this.automaticallyChangeStatus=!0,this.createdAt=null,this.updatedAt=null,this.related=null}},8899:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3483),i=n(4982),s=n(194);t.default=function(){var e=this;this.remapResponse=function(t){var n=[];return t.forEach((function(t){var r=new s.default;r.id=t.id,r.name=t.name,r.description=t.description,r.type=t.type,r.fromDate=t.from_date,r.toDate=t.to_date,r.markets=t.markets?t.markets:null,r.teamIds=t.team_ids?t.team_ids:null,r.matchIds=t.match_ids?t.match_ids:null,r.gameIds=t.game_ids?t.game_ids:null,r.gameTypes=t.game_types?t.game_types:null,r.competitionIds=t.competition_ids?t.competition_ids:null,r.excludedProfileIds=t.excluded_profile_ids?t.excluded_profile_ids:null,r.rules=t.rules?t.rules:null,r.flags=t.flags?t.flags:null,r.images=t.images?t.images:null,r.status=t.status?t.status:null,r.automaticallyChangeStatus=t.automatically_change_status,r.createdAt=t.created_at,r.updatedAt=t.updated_at,r.related=t.related?e.remapRelated(t.related):null,n.push(r)})),n},this.remapResponseId=function(t){var n=new i.default;return n.id=t.id,n.name=t.name,n.description=t.description,n.type=t.type,n.fromDate=t.from_date,n.toDate=t.to_date,n.markets=t.markets?t.markets:null,n.teamIds=t.team_ids?t.team_ids:null,n.matchIds=t.match_ids?t.match_ids:null,n.gameIds=t.game_ids?t.game_ids:null,n.gameTypes=t.game_types?t.game_types:null,n.competitionIds=t.competition_ids?t.competition_ids:null,n.excludedProfileIds=t.excluded_profile_ids?t.excluded_profile_ids:null,n.rules=t.rules?t.rules:null,n.flags=t.flags?t.flags:null,n.images=t.images?t.images:null,n.status=t.status?t.status:null,n.automaticallyChangeStatus=t.automatically_change_status,n.related=t.related?e.remapRelated(t.related):null,n.labels=t.labels,n.customFields=t.custom_fields,n.adContent=t.ad_content,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapMeta=function(e){var t={};return t.totalItems=e.pagination.total_items,t},this.remapRelated=function(e){return e.map((function(e){var t=new r.default;return t.entityId=e.entity_id,t.entityType=e.entity_type,t}))}}},3142:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var a=n(4946),o=n(4021),u=n(4904),l=n(8097),c=n(2535),d=n(5318),h=n(8900),p=n(8808),f=n(6409),m=n(8687),v=n(7910),y=n(4996);t.default=function(e){var t=this;this.idMappingService=null,this.profileNamespace=null,this.footballNamespace=null,this.errorHandlingMode=null,this.remapTemplatesIds=function(e){return r(t,void 0,void 0,(function(){var t,n,r,a,o;return i(this,(function(i){switch(i.label){case 0:return e.length>0?(t=[],n=[],r=[],e.forEach((function(e){e.teamIds&&e.teamIds.length>0?t=s(s([],t,!0),e.teamIds,!0):e.matchIds&&e.matchIds.length>0?n=s(s([],n,!0),e.matchIds,!0):e.competitionIds&&e.competitionIds.length>0&&(r=s(s([],r,!0),e.competitionIds,!0))})),a={team:t,match:n,competition:r},[4,this.idMappingService.idMappingFacade.getEntitiesByIds(a,"native",this.idMappingService.idSchema)]):[3,2];case 1:return o=i.sent(),s([],o.team,!0),s([],o.match,!0),s([],o.competition,!0),e.forEach((function(e){e.teamIds&&e.teamIds.length>0?e.teamIds=e.teamIds.map((function(e){return o.team.shift()})):e.matchIds&&e.matchIds.length>0?e.matchIds=e.matchIds.map((function(e){return o.match.shift()})):e.competitionIds&&e.competitionIds.length>0&&(e.competitionIds=e.competitionIds.map((function(e){return o.competition.shift()})))})),[2,e];case 2:return[2,e]}}))}))},this.addProfileModelToLeaderboad=function(e){return r(t,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return e.length>0?(t=[],(n=e.map((function(e){return e.profileId}))).length?[4,this.profileNamespace.getByIds(n)]:[2,e]):[3,2];case 1:return r=i.sent(),e.forEach((function(e){r.forEach((function(t){t.id===e.profileId&&(delete t.interests,e.profileModel=t)})),e.profileModel||(e.profileModel=null),t.push(e)})),[2,t];case 2:return[2,e]}}))}))},this.buildClientBadges=function(e){var n=new m.default;return n.general=t.extractEnabledBadgesId(e.general),n.predictor=t.extractEnabledBadgesId(e.predictor),n.topX=t.extractEnabledBadgesId(e.topX),n.matchQuiz=t.extractEnabledBadgesId(e.matchQuiz),n},this.initFilters=function(e,t){switch(t){case"loyalty":e&&(e=new v.default(e));break;case"rankings":e&&(e=new y.default(e))}return e},this.addProfileModelToHighestSuccessRate=function(e){return r(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return(t=e.map((function(e){return e.profileId}))).length?[4,this.profileNamespace.getByIds(t)]:[2,e];case 1:return n=r.sent(),[2,e.map((function(e){return n.forEach((function(t){t.id===e.profileId&&(delete t.interests,e.profileModel=t)})),e}))]}}))}))},this.extractRankingsIdsMap=function(e){var t=[],n=[],r=[];return e.forEach((function(e){"GAME"===e.rankType&&"TOP_X"===e.gameType?t.push(e.id):"GAME"===e.rankType&&"MATCH_QUIZ"===e.gameType?n.push(e.id):"TEMPLATE"===e.rankType&&r.push(e.id)})),[t,n,r]},this.setModelsForUserRankings=function(e,t,n,r){return r.data.forEach((function(r){"MATCH_QUIZ"===r.gameType&&t?r.model=t.filter((function(e){return e.id===r.id}))[0]:"TOP_X"===r.gameType&&e?r.model=e.filter((function(e){return e.id===r.id}))[0]:"TEMPLATE"===r.rankType&&n&&(r.model=n.filter((function(e){return e.id===r.id}))[0])})),r},this.completeContestWinners=function(e){return r(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return t=e.userList.map((function(e){return e.profileId})),[4,this.profileNamespace.getByIds(t)];case 1:return n=r.sent(),e.userList.forEach((function(e){var t=n.filter((function(t){return t.id===e.profileId}))[0];delete t.interests,e.profileModel=t})),[2,e]}}))}))},this.validateEntitiesFollowsFilters=function(e){if(!e||!(e.footballCompetitions&&e.footballCompetitions.length||e.footballTeams&&e.footballTeams.length||e.footballPlayers&&e.footballPlayers.length)){if("default"===t.errorHandlingMode)throw new l.default(o.ErrorCodes.BAD_METHOD_CALL,u.ErrorStatuses.INVALID_FILTERS,d.ErrorMessages.ENTITIES_NEEDED);throw new c.default(o.ErrorCodes.BAD_METHOD_CALL,u.ErrorStatuses.INVALID_FILTERS,d.ErrorMessages.ENTITIES_NEEDED).response}if(e.footballCompetitions&&e.footballCompetitions.length>24||e.footballTeams&&e.footballTeams.length>24||e.footballPlayers&&e.footballPlayers.length>24){if("default"===t.errorHandlingMode)throw new l.default(o.ErrorCodes.BAD_METHOD_CALL,u.ErrorStatuses.EXCEEDED_LENGTH,d.ErrorMessages.ENTITIES_FOLLOWS_FILTERS_EXCEEDED);throw new c.default(o.ErrorCodes.BAD_METHOD_CALL,u.ErrorStatuses.EXCEEDED_LENGTH,d.ErrorMessages.ENTITIES_FOLLOWS_FILTERS_EXCEEDED).response}},this.remapEntitiesFollowsFilters=function(e){return r(t,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return t=JSON.parse(JSON.stringify(e)),n={},r={},t.footballCompetitions&&t.footballCompetitions.length&&(r.competition=t.footballCompetitions),t.footballTeams&&t.footballTeams.length&&(r.team=t.footballTeams),t.footballPlayers&&t.footballPlayers.length&&(r.player=t.footballPlayers),[4,this.idMappingService.idMappingFacade.getEntitiesByIds(r,this.idMappingService.idSchema,a.IdSchemaEnum.NATIVE)];case 1:return s=i.sent(),Object.keys(s).forEach((function(e){"competition"===e?n.footballCompetitions=s[e]:"team"===e?n.footballTeams=s[e]:"player"===e&&(n.footballPlayers=s[e])})),[2,n]}}))}))},this.addModelsToEntitiesFollows=function(e){return r(t,void 0,void 0,(function(){var t,n,r,s,a,o,u,l,c;return i(this,(function(i){switch(i.label){case 0:return t=[],n="fb:c:",r=new Map,s=[],a="fb:t:",o=new Map,u=[],l="fb:p:",c=null,e.breakdown.forEach((function(e){e.id.includes(n)?t.push(e.id):e.id.includes(a)?s.push(e.id):e.id.includes(l)&&u.push(e.id)})),t.length?[4,this.footballNamespace.footballFacade.competitionsFacade.getCompetitionsMapWithNativeIds(t)]:[3,2];case 1:r=i.sent(),i.label=2;case 2:return s.length?[4,this.footballNamespace.footballFacade.teamsFacade.getTeamsMapWithNativeIds(s)]:[3,4];case 3:o=i.sent(),i.label=4;case 4:return u.length?[4,this.footballNamespace.footballFacade.playerFacade.getPlayersMapWithNativeIds(u)]:[3,6];case 5:c=i.sent(),i.label=6;case 6:return e.breakdown.forEach((function(e){e.id.includes(n)?(e.model=r.get(e.id),e.id=e.model.id):e.id.includes(a)?(e.model=o.get(e.id),e.id=e.model.id):e.id.includes(l)&&(e.model=c[e.id],e.id=e.model.id)})),[2,e]}}))}))},this.extractEnabledBadgesId=function(e){var t=[];return e.forEach((function(e){e.enabled&&t.push(e.id)})),t},this.idMappingService=new h.default(e),this.profileNamespace=new f.default(e),this.footballNamespace=new p.default(e),this.errorHandlingMode=e.errorHandlingMode}},1139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4021),i=n(4904),s=n(8097),a=n(2535),o=n(5318),u=n(7974);t.default=function(){var e=this;this.validate=function(t,n){t.market&&e.validateMarket(t.market,n),t.fromDate&&e.validateDate(t.fromDate,"fromDate",n),t.toDate&&e.validateDate(t.toDate,"toDate",n),t.usersCount&&e.validateNumberFilters(t.usersCount,"usersCount",n),t.minimumPredictions&&e.validateNumberFilters(t.minimumPredictions,"minimumPredictions",n)},this.validateMarket=function(e,t){if(!Object.keys(u.MarketEnum).includes(e)){var n=(0,o.invalidMarketMessage)(e);if("default"===t)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_MARKET,n);throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_MARKET,n).response}},this.validateDate=function(e,t,n){if("string"!=typeof e){if("default"===n)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_TYPE+"string for "+t+" filter");throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_TYPE+"string for "+t+" filter").response}if(!/^\d{4}-\d{2}-\d{2}$/.test(e)){if("default"===n)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_VALUE+"YYYY-MM-DD for "+t);throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_VALUE+"YYYY-MM-DD for "+t).response}},this.validateNumberFilters=function(e,t,n){var u="usersCount"===t?1:0,l="usersCount"===t?1e3:1e6;if("number"!=typeof e){if("default"===n)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_TYPE+"number for "+t+" filter");throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_TYPE+"number for "+t+" filter").response}if(e<u||e>l){if("default"===n)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_VALUE+"between "+u+" and "+l);throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_VALUE+"between "+u+" and "+l).response}}}},1859:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4946),a=n(1553),o=n(7686),u=n(2793),l=n(8900),c=n(1732),d=n(7782),h=n(5013),p=n(853),f=n(7299),m=n(2310),v=n(4800),y=n(8097),g=n(4021),w=n(4904),b=n(5318),_=n(2535);t.default=function(e){var t=this;this.predictorHttps=null,this.predictorService=null,this.idMapping=null,this.clientHttps=null,this.predictorValidator=null,this.errorHandlingMode=null,this.getConfig=function(){return r(t,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(o.FeatureConfigType.MATCH_QUIZ)];case 1:return e=t.sent(),this.idMapping.idSchema===s.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(e)];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},this.play=function(e){return r(t,void 0,void 0,(function(){var t,n,r,a,o,u=this;return i(this,(function(i){switch(i.label){case 0:return e=this.predictorValidator.validateBodyFields("MATCH_QUIZ",e),(t=e.fixtures.map((function(e){return u.predictorValidator.validateFixture(e.matchId,e.market,e.prediction.value,e.prediction.playerId)})))&&t.length?this.idMapping.idSchema===s.IdSchemaEnum.NATIVE?[3,4]:(n=[],r=[],t.forEach((function(e){n.push(e.matchId),e instanceof c.default&&e.prediction.playerId&&"OWN_GOAL"!==e.prediction.playerId&&r.push(e.prediction.playerId)})),[4,this.predictorService.remapMatchIdToNative(n)]):[3,4];case 1:return a=i.sent(),o={},r&&r.length>0?[4,this.predictorService.remapPlayerIdMapToNative(r)]:[3,3];case 2:o=i.sent(),i.label=3;case 3:t.forEach((function(e,t){e.matchId=a[t],e instanceof c.default&&"OWN_GOAL"!==e.prediction.playerId&&(e.prediction.playerId=o[e.prediction.playerId])})),i.label=4;case 4:return e.fixtures=t,[4,this.predictorHttps.makeFootballPrediction(e)];case 5:return[2,i.sent()]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getGames=function(e,n){return r(t,void 0,void 0,(function(){var t,r;return i(this,(function(i){switch(i.label){case 0:return n=n||!1,t=this.predictorService.initGameFilters("MATCH_QUIZ",e),[4,this.predictorHttps.getGames(t,n)];case 1:return r=i.sent(),[4,this.predictorService.remapMatchIdsFixtures(r)];case 2:return[2,i.sent()]}}))}))},this.getGameById=function(e,n){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return n=n||!1,[4,this.predictorHttps.getGameById(e,n)];case 1:return t=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(t)];case 2:return[2,r.sent()]}}))}))},this.getGamePredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return s=s||!1,n&&(n.type&&delete n.type,n.status&&delete n.status,n=new d.default(n)),[4,this.predictorHttps.getGamePredictions(e,s,n)];case 1:return[2,t.sent()]}}))}))},this.getGameResults=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return s=s||!1,n&&(n=new v.default(n)),[4,this.predictorHttps.getGameResults(e,s,n)];case 1:return t=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(t)];case 2:return[2,r.sent()]}}))}))},this.getCurrentGameResults=function(e){return r(t,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=e||!1,t={status:p.GameStatusEnum.OPEN,type:"MATCH_QUIZ"},t=new f.default(t),[4,this.predictorHttps.getGames(t,e)];case 1:return n=i.sent(),r=this.predictorService.getCurrentGameId(n),[4,this.getGameResults(r,null,e)];case 2:return[2,i.sent().data[0]]}}))}))},this.getMyGameEditions=function(e,n){return r(t,void 0,void 0,(function(){var t,r,s,o,u;return i(this,(function(i){switch(i.label){case 0:return e&&e.limit&&this.validateLimitFilterOnGames(e.limit),n=n||!1,t=this.predictorService.initGameTypePredictions("MATCH_QUIZ",e),r=[],[4,this.predictorHttps.getMyPredictionsNoRemap(t)];case 1:return(s=i.sent()).data.length>0?(s.data.forEach((function(e){e.game_instance_id&&r.push(e.game_instance_id)})),o=this.predictorService.initGameFilters("MATCH_QUIZ",null,r),[4,this.predictorHttps.getUserGameEditions(o,n)]):[3,4];case 2:return u=i.sent(),[4,this.predictorService.addPredictionProp(s,u)];case 3:return[2,i.sent()];case 4:return[2,new a.default]}}))}))},this.getMyGamePrediction=function(e){return r(t,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=this.predictorService.initGameTypePredictions("MATCH_QUIZ"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return(n=i.sent()).data.length>0?[2,(r=n.data.filter((function(t){return t.gameInstanceId===e}))).length?r[0]:null]:[2,null]}}))}))},this.getUserGameEditions=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r,o,u,l;return i(this,(function(i){switch(i.label){case 0:return n&&n.limit&&this.validateLimitFilterOnGames(n.limit),s=s||!1,t=this.predictorService.initGameTypePredictions("MATCH_QUIZ",n),r=[],[4,this.predictorHttps.getUserPredictionsNoRemap(e,t)];case 1:return(o=i.sent()).data.length>0?(o.data.forEach((function(e){e.game_instance_id&&r.push(e.game_instance_id)})),u=this.predictorService.initGameFilters("MATCH_QUIZ",null,r),[4,this.predictorHttps.getUserGameEditions(u,s)]):[3,4];case 2:return l=i.sent(),[4,this.predictorService.addPredictionProp(o,l)];case 3:return[2,i.sent()];case 4:return[2,new a.default]}}))}))},this.getUserGamePrediction=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r,a;return i(this,(function(i){switch(i.label){case 0:return s=s||!1,t=this.predictorService.initGameTypePredictions("MATCH_QUIZ"),[4,this.predictorHttps.getUserPredictions(e,s,t)];case 1:return(r=i.sent()).data.length>0?[2,(a=r.data.filter((function(e){return e.gameInstanceId===n}))).length?a[0]:null]:[2,null]}}))}))},this.getMarketsResultsForGame=function(e,n){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getMarketResultsForGame(e,n)];case 1:return t=r.sent(),[4,this.predictorService.completeGameMarketResults(t,"MATCH_QUIZ")];case 2:return[2,r.sent()]}}))}))},this.getGameWinners=function(e){return r(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(e)];case 1:return t=r.sent(),[4,this.getGameById(e)];case 2:return n=r.sent(),t.contestModel=n,[2,this.predictorService.completeContestWinners(t)]}}))}))},this.validateLimitFilterOnGames=function(e){if("default"===t.errorHandlingMode&&e>50)throw new y.default(g.ErrorCodes.BAD_METHOD_CALL,w.ErrorStatuses.EXCEEDED_LENGTH,b.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED);if("standard"===t.errorHandlingMode&&e>50)throw new _.default(g.ErrorCodes.BAD_METHOD_CALL,w.ErrorStatuses.EXCEEDED_LENGTH,b.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED).response},this.predictorValidator=new m.default(e.errorHandlingMode),this.idMapping=new l.default(e),this.predictorHttps=new u.default(e,this.idMapping),this.predictorService=new h.default(e,this.idMapping),this.clientHttps=new o.default(e),this.errorHandlingMode=e.errorHandlingMode}},267:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1859);t.default=function(e){var t=this;this.matchQuizFacade=null,this.getConfig=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getConfig()];case 1:return[2,e.sent()]}}))}))},this.play=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.play(e)];case 1:return[2,t.sent()]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.delete(e)];case 1:return[2,t.sent()]}}))}))},this.getGames=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGames(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGameById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGameById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGamePredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGamePredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getGameResults=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGameResults(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getCurrentGameResults=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getCurrentGameResults(e)];case 1:return[2,t.sent()]}}))}))},this.getMyGameEditions=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getMyGameEditions(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMyGamePrediction=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getMyGamePrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getUserGameEditions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getUserGameEditions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserGamePrediction=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getUserGamePrediction(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getMarketsResultsForGame=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getMarketsResultsForGame(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGameWinners=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGameWinners(e)];case 1:return[2,t.sent()]}}))}))},this.matchQuizFacade=new s.default(e)}},5765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.enabled=!1,this.defaultMarkets=null,this.competitionsWhitelist=null}},8410:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6899),i=n(8042);t.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default,this.prediction=new i.default}},670:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.gameId=null,this.results=null,this.tieBreakers=null}},7243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4916);t.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.outcome=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new r.default,this.predictionId=null,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.points=null,this.createdAt=null,this.updatedAt=null,this.predictionsMadeAt=null,this.images=null,this.scheduleOpenAt=null}},8042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null,this.target=null,this.playerId=null,this.playerModel=null,this.result=null}},7974:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.playerMarketNobodyPrediction=t.endMarkMarkets=t.playerMarkets=t.MarketsOverCorners=t.MarketsOverGoals=t.MarketEnum=void 0,function(e){e.FT_1X2="FT_1X2",e.HT_1X2="HT_1X2",e.BOTH_TEAMS_SCORE="BOTH_TEAMS_SCORE",e.DOUBLE_CHANCE="DOUBLE_CHANCE",e.HT_FT="HT_FT",e.PLAYER_SCORE="PLAYER_SCORE",e.PLAYER_YELLOW_CARD="PLAYER_YELLOW_CARD",e.PLAYER_RED_CARD="PLAYER_RED_CARD",e.RED_CARD_MATCH="RED_CARD_MATCH",e.PENALTY_MATCH="PENALTY_MATCH",e.PLAYER_SCORE_FIRST_GOAL="PLAYER_SCORE_FIRST_GOAL",e.CORNERS_MATCH="CORNERS_MATCH",e.CORRECT_SCORE="CORRECT_SCORE",e.CORRECT_SCORE_ADVANCED="CORRECT_SCORE_ADVANCED",e.CORRECT_SCORE_HT="CORRECT_SCORE_HT",e.PLAYER_SCORE_HATTRICK="PLAYER_SCORE_HATTRICK",e.PLAYER_SCORE_TWICE="PLAYER_SCORE_TWICE",e.OVER_GOALS_0_5="OVER_GOALS_0_5",e.OVER_GOALS_1_5="OVER_GOALS_1_5",e.OVER_GOALS_2_5="OVER_GOALS_2_5",e.OVER_GOALS_3_5="OVER_GOALS_3_5",e.OVER_GOALS_4_5="OVER_GOALS_4_5",e.OVER_GOALS_5_5="OVER_GOALS_5_5",e.OVER_GOALS_6_5="OVER_GOALS_6_5",e.OVER_CORNERS_6_5="OVER_CORNERS_6_5",e.OVER_CORNERS_7_5="OVER_CORNERS_7_5",e.OVER_CORNERS_8_5="OVER_CORNERS_8_5",e.OVER_CORNERS_9_5="OVER_CORNERS_9_5",e.OVER_CORNERS_10_5="OVER_CORNERS_10_5",e.OVER_CORNERS_11_5="OVER_CORNERS_11_5",e.OVER_CORNERS_12_5="OVER_CORNERS_12_5",e.OVER_CORNERS_13_5="OVER_CORNERS_13_5"}(n=t.MarketEnum||(t.MarketEnum={})),t.MarketsOverGoals=[n.OVER_GOALS_0_5,n.OVER_GOALS_1_5,n.OVER_GOALS_2_5,n.OVER_GOALS_3_5,n.OVER_GOALS_4_5,n.OVER_GOALS_5_5,n.OVER_GOALS_6_5],t.MarketsOverCorners=[n.OVER_CORNERS_6_5,n.OVER_CORNERS_7_5,n.OVER_CORNERS_8_5,n.OVER_CORNERS_9_5,n.OVER_CORNERS_10_5,n.OVER_CORNERS_11_5,n.OVER_CORNERS_12_5,n.OVER_CORNERS_13_5],t.playerMarkets=[n.PLAYER_RED_CARD,n.PLAYER_SCORE,n.PLAYER_SCORE_FIRST_GOAL,n.PLAYER_SCORE_HATTRICK,n.PLAYER_SCORE_TWICE,n.PLAYER_YELLOW_CARD],t.endMarkMarkets=[n.FT_1X2,n.HT_1X2,n.HT_FT,n.DOUBLE_CHANCE,n.CORNERS_MATCH,n.CORRECT_SCORE,n.CORRECT_SCORE_HT,n.CORRECT_SCORE_ADVANCED],t.playerMarketNobodyPrediction=n.PLAYER_SCORE_FIRST_GOAL},6147:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.pastStatuses=t.StatusEnum=void 0,function(e){e.ACTIVE="ACTIVE",e.WON="WON",e.LOST="LOST",e.PARTIALLY_WON="PARTIALLY_WON",e.CANCELED="CANCELED"}(n=t.StatusEnum||(t.StatusEnum={})),t.pastStatuses=[n.WON,n.LOST,n.PARTIALLY_WON,n.CANCELED]},1976:(e,t)=>{"use strict";var n,r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.HalfTimeFullTimeEnum=t.DoubleChanceEnum=t.OneXTwoEnum=void 0,(i=t.OneXTwoEnum||(t.OneXTwoEnum={})).ONE="1",i.X="x",i.TWO="2",(r=t.DoubleChanceEnum||(t.DoubleChanceEnum={})).ONE_X="1x",r.X_TWO="x2",r.ONE_TWO="12",(n=t.HalfTimeFullTimeEnum||(t.HalfTimeFullTimeEnum={})).ONE_ONE="1/1",n.ONE_X="1/x",n.ONE_TWO="1/2",n.X_ONE="x/1",n.X_X="x/x",n.X_TWO="x/2",n.TWO_ONE="2/1",n.TWO_X="2/x",n.TWO_TWO="2/2"},2929:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var a=n(4946),o=n(7974),u=n(7686),l=n(5013),c=n(3950),d=n(1732),h=n(2310),p=n(8097),f=n(4021),m=n(4904),v=n(5318),y=n(2535);t.default=function(e,t,n,g){var w=this;this.predictorHttps=null,this.clientHttps=null,this.idMapping=null,this.predictorService=null,this.predictorValidator=null,this.errorHandlingMode=null,this.makeFootballPrediction=function(e,t,n,s){return r(w,void 0,void 0,(function(){var r,u,l,h,g,w,b;return i(this,(function(i){switch(i.label){case 0:return r=this.predictorValidator.validateFixture(e,t,n,s),u=new c.default,this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,6]:(l=r.matchId,h="",[4,this.predictorService.remapMatchIdToNative([l])]);case 1:if(g=i.sent(),r.matchId=g[0],"default"===this.errorHandlingMode&&!r.matchId)throw new p.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.INVALID_FIELD,v.ErrorMessages.INVALID_MATCH_ID).errorMessage();if("standard"===this.errorHandlingMode&&!r.matchId)throw new y.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.INVALID_FIELD,v.ErrorMessages.INVALID_MATCH_ID).response;return r instanceof d.default&&"OWN_GOAL"!==r.prediction.playerId?r.prediction.playerId?(h=r.prediction.playerId,w=r.prediction,[4,this.predictorService.remapPlayerIdToNative([h])]):[3,3]:[3,4];case 2:w.playerId=i.sent(),i.label=3;case 3:if("default"===this.errorHandlingMode&&r.market!==o.playerMarketNobodyPrediction&&!r.prediction.playerId)throw new p.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.INVALID_FIELD,v.ErrorMessages.INVALID_PLAYER_ID).errorMessage();if("standard"===this.errorHandlingMode&&r.market!==o.playerMarketNobodyPrediction&&!r.prediction.playerId)throw new y.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.INVALID_FIELD,v.ErrorMessages.INVALID_PLAYER_ID).response;i.label=4;case 4:return u.fixtures=[r],[4,this.predictorHttps.makeFootballPrediction(u)];case 5:return(b=i.sent()).fixtures.forEach((function(e){e.prediction.playerId&&"OWN_GOAL"!==e.prediction.playerId&&(e.prediction.playerId=h),e.matchId=l})),[2,b];case 6:return u.fixtures=[r],[4,this.predictorHttps.makeFootballPrediction(u)];case 7:return[2,i.sent()]}}))}))},this.getMatchSummary=function(e,t){return r(w,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return[4,this.getMatchSummaryBase(e,t)];case 1:return n=i.sent(),r=JSON.parse(JSON.stringify(n.predictions)),[4,this.predictorService.remapPlayerIdToIdSchema(r)];case 2:return s=i.sent(),n.predictions=s,[2,n]}}))}))},this.getMarketSummary=function(e,t,n,s){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getMatchSummaryBase(e,s)];case 1:return r=i.sent(),[4,this.predictorService.getMarketSummary(r,t,n)];case 2:return[2,i.sent()];case 3:throw i.sent();case 4:return[2]}}))}))},this.getMatchSummaryBase=function(e,t){return r(w,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapMatchIdToNative([e])];case 1:return n=i.sent(),r=n[0],[4,this.predictorHttps.getMatchSummary(r,t)];case 2:return(s=i.sent()).matchId=e,[2,s];case 3:return[4,this.predictorHttps.getMatchSummary(e,t)];case 4:return[2,i.sent()]}}))}))},this.getConfig=function(){return r(w,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(u.FeatureConfigType.PREDICTOR)];case 1:return e=t.sent(),this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(e)];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},this.deleteFootballPrediction=function(e){return r(w,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getMyPredictions=function(e){return r(w,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t=this.predictorService.initPredictionsFilters(e,"user"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return[2,n.sent()]}}))}))},this.getMyPredictionsForMatches=function(e,t){return r(w,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:if("default"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(e))throw new p.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.EXCEEDED_LENGTH,v.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).errorMessage();if("standard"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(e))throw new y.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.EXCEEDED_LENGTH,v.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).response;return this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,2]:[4,this.predictorService.remapMatchIdToNative(s([],e,!0))];case 1:e=r.sent(),r.label=2;case 2:return n=this.predictorService.initPredictionsFilters(t,"matches",e),[4,this.predictorHttps.getMyPredictions(n)];case 3:return[2,r.sent()]}}))}))},this.getMyCurrentPredictions=function(e){return r(w,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t=this.predictorService.initPredictionsFilters(e,"current"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return[2,n.sent()]}}))}))},this.getMyPastPredictions=function(e){return r(w,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t=this.predictorService.initPredictionsFilters(e,"past"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return[2,n.sent()]}}))}))},this.getUserPredictions=function(e,t,n){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return r=this.predictorService.initPredictionsFilters(t,"user"),[4,this.predictorHttps.getUserPredictions(e,n,r)];case 1:return[2,i.sent()]}}))}))},this.getUserCurrentPredictions=function(e,t,n){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return r=this.predictorService.initPredictionsFilters(t,"current"),[4,this.predictorHttps.getUserPredictions(e,n,r)];case 1:return[2,i.sent()]}}))}))},this.getUserPastPredictions=function(e,t,n){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return r=this.predictorService.initPredictionsFilters(t,"past"),[4,this.predictorHttps.getUserPredictions(e,n,r)];case 1:return[2,i.sent()]}}))}))},this.getUserPredictionsForMatches=function(e,t,n,o){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:if("default"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(t))throw new p.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.EXCEEDED_LENGTH,v.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).errorMessage();if("standard"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(t))throw new y.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.EXCEEDED_LENGTH,v.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).response;return this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,2]:[4,this.predictorService.remapMatchIdToNative(s([],t,!0))];case 1:t=i.sent(),i.label=2;case 2:return r=this.predictorService.initPredictionsFilters(n,"matches",t),[4,this.predictorHttps.getUserPredictions(e,o,r)];case 3:return[2,i.sent()]}}))}))},this.getPredictionById=function(e){return r(w,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorHttps.getPredictionById(e)];case 1:return[2,t.sent()]}}))}))},this.predictorHttps=t,this.idMapping=g,this.clientHttps=n,this.errorHandlingMode=e.errorHandlingMode,this.predictorValidator=new h.default(e.errorHandlingMode),this.predictorService=new l.default(e,g)}},704:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8608),i=n(246),s=n(1429),a=n(515),o=n(4187),u=n(4226),l=n(5765),c=n(1180),d=n(8452);t.default=function(){var e=this;this.remapPredictorConfig=function(e){var t=new d.default;return t.enabled=e.enabled,t.fullCoverageCompetitions=e.full_coverage_competitions,t.markets=e.markets,t.successRateScopes=e.success_rate_scopes,t},this.remapTopXConfig=function(e){var t=new c.default;return t.enabled=e.enabled,t.minFixtures=e.min_fixtures,t.maxFixtures=e.max_fixtures,t.competitionsWhitelist=e.competitions_whitelist,t},this.remapMatchQuizConfig=function(e){var t=new l.default;return t.enabled=e.enabled,t.defaultMarkets=e.default_markets,t.competitionsWhitelist=e.competitions_whitelist,t},this.remapLoyaltyConfig=function(t){var n=new a.default;return n.enabled=t.enabled,n.conditions.list=t.conditions.list,n.actions.value=t.actions.value,n.rewards=e.remapRewards(t.rewards),n},this.remapRewards=function(t){var n=new u.default;return n.points=e.remapPoints(t.points),n.tiers=t.tiers,n.badges=e.remapBadges(t.badges),n},this.remapPoints=function(e){var t=new o.default;return t.general=e.general,t.comments=e.comments,t.predictor=e.predictor,t.activity=e.activity,t.topX=e.top_x,t.matchQuiz=e.match_quiz,t},this.remapBadges=function(t){var n=new r.default;return n.general=t.general,n.predictor=e.remapBadgeValues(t.predictor),n.topX=e.remapBadgeValues(t.top_x),n.matchQuiz=e.remapBadgeValues(t.match_quiz),n},this.remapBadgeValues=function(t){return t.map((function(t){var n=new i.default;return n.id=t.id,n.label=t.label,n.enabled=t.enabled,t.assets?n.assets.mainImageUrl=t.assets.main_image_url:n.assets=t.assets,n.requirements=e.remapRequirements(t.requirements),n}))},this.remapRequirements=function(e){var t=new s.default;return t.points=e.points,t.gameParticipationCount=e.game_participation_count,t.entityId=e.entity_id,t.entityType=e.entity_type,t.predictionsMade=e.predictions_made,t.correctPredictions=e.correct_predictions,t}}},8452:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(442);t.default=function(){this.enabled=!1,this.fullCoverageCompetitions=null,this.markets=null,this.successRateScopes=new r.default}},442:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.competitions=[],this.teams=[],this.markets=[]}},6367:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null,this.playerId=null,this.playerModel=null}},1406:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(2524),a=n(1732),o=n(4119),u=n(1465),l=n(5132),c=n(7344);t.default=function(e,t,n){var d=this;this.matchFacade=null,this.playerFacade=null,this.predictorService=null,this.remapFixturesRequest=function(e){var t={};if(t.match_id=e.matchId,t.match_type="FOOTBALL",e instanceof a.default)t.market=e.market,t.prediction=e.prediction.value,t.player_id=e.prediction.playerId;else if(e instanceof l.default||e instanceof c.default)t.market=e.market,t.prediction=e.prediction.value;else if(e instanceof u.default){t.market=e.market;var n=e.prediction.value.split(":");t.goals_home=Number(n[0]),t.goals_away=Number(n[1])}else t.market=e.market,t.prediction=e.prediction.value;return t},this.remapFixturesResponse=function(e){return r(d,void 0,void 0,(function(){var t,n,r,a,o,u,l,c,d,h,p,f;return i(this,(function(i){switch(i.label){case 0:for(t="OWN_GOAL",n=[],r=[],a=null,o=[],e.length>1&&e.sort((function(e,t){return e.match_id.localeCompare(t.match_id)})),u=0,l=e;u<l.length;u++)p=l[u],n.push(p.match_id),p.player_id&&!r.includes(p.player_id)&&r.push(p.player_id);return[4,this.matchFacade.getMatchesMapWithNativeIds(n)];case 1:return c=i.sent(),r.sort((function(e,t){return e.localeCompare(t)})),r&&r.length>0&&!r.includes(t)?[4,this.playerFacade.getPlayersMapWithNativeIds(r)]:[3,3];case 2:a=i.sent(),i.label=3;case 3:for(d=0,h=e;d<h.length;d++)p=h[d],f=new s.default,p.target?f.market=this.predictorService.convertMarketForResponseModel(p.market,p.target):f.market=p.market,f.matchId=c[p.match_id].id,f.matchType=p.match_type,f.matchModel=c?c[p.match_id]:null,delete f.matchModel.availableMarkets,void 0!==p.goals_home&&void 0!==p.goals_away?f.prediction.value=p.goals_home.toString()+":"+p.goals_away.toString():f.prediction.value=p.prediction,f.prediction.playerId=p.player_id?p.player_id:null,f.prediction.playerId&&f.prediction.playerId!==t&&(f.prediction.playerModel=a[p.player_id],f.prediction.playerId=a[p.player_id].id),f.result=this.remapResult(p.result),o.push(f);return[2,o]}}))}))},this.remapResult=function(e){var t=new o.default;return t.settledAt=e.settled_at,t.resettledAt=e.resettled_at,t.status=e.status,t.outcome=e.outcome,t.points=e.points,t},this.matchFacade=e,this.playerFacade=t,this.predictorService=n}},2524:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6367);t.default=function(){this.market=null,this.matchId=null,this.matchType=null,this.matchModel=null,this.prediction=new r.default,this.result=null}},1206:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(9883);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.BOTH_TEAMS_SCORE,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},5274:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(8038);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.CORNERS_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},1465:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3125);t.default=function(e,t,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n}},7535:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(6902);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.DOUBLE_CHANCE,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},7307:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(6642);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.HT_FT,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},1718:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2782);t.default=function(e,t,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n}},5132:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9883);t.default=function(e,t,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n}},7344:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9883);t.default=function(e,t,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n}},1855:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(9883);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.PENALTY_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},1732:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7321);t.default=function(e,t,n,i){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n,this.prediction.playerId=i}},5814:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(9883);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.RED_CARD_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},4119:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.settledAt=null,this.resettledAt=null,this.status=null,this.outcome=null,this.points=0}},5908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.no=0,this.yes=0}},2726:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1406),a=n(2532),o=n(3792),u=n(595),l=n(4545),c=n(4272),d=n(2524),h=n(5013),p=n(1399);t.default=function(e,t){var n=this;this.fixturesRemapper=null,this.footballHttps=null,this.matchFacade=null,this.playerFacade=null,this.predictorService=null,this.remapRequestBody=function(e){var t={};return t.game_instance_id=e.gameInstanceId,t.fixtures=e.fixtures.map((function(e){return n.fixturesRemapper.remapFixturesRequest(e)})),e instanceof p.default&&e.tiebreaker&&(t.tiebreaker={},t.tiebreaker.golden_goal=e.tiebreaker.goldenGoal?e.tiebreaker.goldenGoal:null),t},this.remapResponseArrayBody=function(e){return r(n,void 0,void 0,(function(){var t,n,r,s,o,u,l=this;return i(this,(function(i){switch(i.label){case 0:return e.length?(t="OWN_GOAL",n=[],r=[],s={},o=[],e.forEach((function(e){e.fixtures.forEach((function(e){n.push(e.match_id),e.player_id&&e.player_id!==t&&r.push(e.player_id)}))})),[4,this.matchFacade.getMatchesMapWithNativeIds(n)]):[3,4];case 1:return u=i.sent(),r.length>0?[4,this.playerFacade.getPlayersMapWithNativeIds(r)]:[3,3];case 2:s=i.sent(),i.label=3;case 3:return e.forEach((function(e){var n=new a.default,r=[];n.id=e.id,n.gameInstanceId=e.game_instance_id,n.gameType=e.game_type,n.wager=e.wager,n.totalFixtures=e.total_fixtures,n.settledFixtures=e.settled_fixtures,n.userId=e.user_id,e.fixtures.forEach((function(e){var n=new d.default;e.target?n.market=l.predictorService.convertMarketForResponseModel(e.market,e.target):n.market=e.market,n.matchId=u[e.match_id].id,n.matchType=e.match_type,n.matchModel=u[e.match_id],delete n.matchModel.availableMarkets,void 0!==e.goals_home&&void 0!==e.goals_away?n.prediction.value=e.goals_home.toString()+":"+e.goals_away.toString():n.prediction.value=e.prediction,n.prediction.playerId=e.player_id?e.player_id:null,n.prediction.playerId&&n.prediction.playerId!==t&&(n.prediction.playerModel=s[n.prediction.playerId],n.prediction.playerId=s[n.prediction.playerId].id),n.result=l.fixturesRemapper.remapResult(e.result),r.push(n)})),n.fixtures=r,n.status=e.status,e.tiebreaker?n.tiebreaker.goldenGoal=e.tiebreaker.golden_goal:n.tiebreaker=null,n.points=e.points,n.createdAt=e.created_at,n.updatedAt=e.updated_at,o.push(n)})),[2,o];case 4:return[2,e]}}))}))},this.remapResponseObjBody=function(e){return r(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return(t=new a.default).id=e.id,t.gameInstanceId=e.game_instance_id,t.gameType=e.game_type,t.wager=e.wager,t.totalFixtures=e.total_fixtures,t.settledFixtures=e.settled_fixtures,t.userId=e.user_id,n=t,[4,this.fixturesRemapper.remapFixturesResponse(e.fixtures)];case 1:return n.fixtures=r.sent(),t.status=e.status,e.tiebreaker?t.tiebreaker.goldenGoal=e.tiebreaker.golden_goal:t.tiebreaker=null,t.points=e.points,t.createdAt=e.created_at,t.updatedAt=e.updated_at,[2,t]}}))}))},this.remapPredictionModel=function(e){var t=new o.default;return t.fullTimeOneXTwo=e.FT_1X2,t.halfTimeOneXTwo=e.HT_1X2,t.bothTeamsScore=e.BOTH_TEAMS_SCORE,t.overZeroPointFiveGoals=e.OVER_GOALS_0_5,t.overOnePointFiveGoals=e.OVER_GOALS_1_5,t.overTwoPointFiveGoals=e.OVER_GOALS_2_5,t.overThreePointFiveGoals=e.OVER_GOALS_3_5,t.overFourPointFiveGoals=e.OVER_GOALS_4_5,t.overFivePointFiveGoals=e.OVER_GOALS_5_5,t.overSixPointFiveGoals=e.OVER_GOALS_6_5,t.overSixPointFiveCorners=e.OVER_CORNERS_6_5,t.overSevenPointFiveCorners=e.OVER_CORNERS_7_5,t.overEightPointFiveCorners=e.OVER_CORNERS_8_5,t.overNinePointFiveCorners=e.OVER_CORNERS_9_5,t.overTenPointFiveCorners=e.OVER_CORNERS_10_5,t.overElevenPointFiveCorners=e.OVER_CORNERS_11_5,t.overTwelvePointFiveCorners=e.OVER_CORNERS_12_5,t.overThirteenPointFiveCorners=e.OVER_CORNERS_13_5,t.doubleChance=e.DOUBLE_CHANCE,t.halfTimeFullTime=e.HT_FT,t.playerScore=e.PLAYER_SCORE,t.playerYellowCard=e.PLAYER_YELLOW_CARD,t.playerRedCard=e.PLAYER_RED_CARD,t.redCardMatch=e.RED_CARD_MATCH,t.penaltyMatch=e.PENALTY_MATCH,t.playerScoreFirstGoal=e.PLAYER_SCORE_FIRST_GOAL,t.cornersMatch=e.CORNERS_MATCH,t.correctScore=e.CORRECT_SCORE,t.correctScoreHalfTime=e.CORRECT_SCORE_HT,t.correctScoreAdvanced=e.CORRECT_SCORE_ADVANCED,t.playerScoreHattrick=e.PLAYER_SCORE_HATTRICK,t.playerScoreTwice=e.PLAYER_SCORE_TWICE,t},this.footballHttps=new u.default(e),this.matchFacade=new l.default(e,this.footballHttps,t),this.playerFacade=new c.default(e,this.footballHttps,t),this.predictorService=new h.default(e,t),this.fixturesRemapper=new s.default(this.matchFacade,this.playerFacade,this.predictorService)}},3950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.gameInstanceId=null,this.fixtures=null}},2532:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7640);t.default=function(){this.id=null,this.gameInstanceId=null,this.gameType=null,this.wager=null,this.totalFixtures=null,this.settledFixtures=null,this.userId=null,this.fixtures=[],this.status=null,this.tiebreaker=new r.default,this.points=null,this.createdAt=null,this.updatedAt=null}},7782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6147);t.default=function(e){var t=this;this.limit=null,this.startAfter=null,this.status=null,this.type=null,this.matchIds=null,this.constructFiltersUrl=function(){var e="",n=!1;return t.status&&(n=Object.values(r.StatusEnum).some((function(e){return t.status.includes(e)}))),t.limit&&(e+="&",e+="limit="+t.limit),t.startAfter&&(e+="&",e+="start_after="+t.startAfter),t.status&&n&&(e+="&",e+="status="+t.status.join(",")),t.type&&(e+="&",e+="game_types="+t.type),t.matchIds&&(e+="&",e+="match_ids="+t.matchIds.join(",")),e},this.limit=e.limit?e.limit:null,this.startAfter=e.startAfter?e.startAfter:null,this.status=e.status?e.status:null,this.type=e.type?e.type:null,this.matchIds=e.matchIds?e.matchIds:null}},3792:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5908);t.default=function(){this.fullTimeOneXTwo={},this.halfTimeOneXTwo={},this.bothTeamsScore=new r.default,this.doubleChance={},this.halfTimeFullTime={},this.playerScore={},this.playerYellowCard={},this.playerRedCard={},this.redCardMatch=new r.default,this.penaltyMatch=new r.default,this.playerScoreFirstGoal={},this.cornersMatch={},this.correctScore={},this.correctScoreHalfTime={},this.correctScoreAdvanced={},this.playerScoreHattrick={},this.playerScoreTwice={},this.overZeroPointFiveGoals=new r.default,this.overOnePointFiveGoals=new r.default,this.overTwoPointFiveGoals=new r.default,this.overThreePointFiveGoals=new r.default,this.overFourPointFiveGoals=new r.default,this.overFivePointFiveGoals=new r.default,this.overSixPointFiveGoals=new r.default,this.overSixPointFiveCorners=new r.default,this.overSevenPointFiveCorners=new r.default,this.overEightPointFiveCorners=new r.default,this.overNinePointFiveCorners=new r.default,this.overTenPointFiveCorners=new r.default,this.overElevenPointFiveCorners=new r.default,this.overTwelvePointFiveCorners=new r.default,this.overThirteenPointFiveCorners=new r.default}},9378:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.matchId=null,this.matchType=null,this.predictions=null}},9679:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2726),i=n(9378);t.default=function(e,t){var n=this;this.remapPredictions=null,this.remapResponse=function(e){var t=new i.default;return t.matchId=e.match_id,t.matchType=e.match_type,t.predictions=n.remapPredictions.remapPredictionModel(e.predictions),t},this.remapPredictions=new r.default(e,t)}},7321:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=!1,this.playerId=null}},9883:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=!1}},8038:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},3125:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null}},6902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null}},6642:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null}},2782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null}},1259:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(2793),a=n(8900),o=n(2929),u=n(7686);t.default=function(e){var t=this;this.predictorHttps=null,this.clientHttps=null,this.predictorFacade=null,this.idMapping=null,this.makeFootballPrediction=function(e,n,s,a){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.makeFootballPrediction(e,n,s,a)];case 1:return[2,t.sent()]}}))}))},this.getMatchSummary=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMatchSummary(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMarketSummary=function(e,n,s,a){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMarketSummary(e,n,s,a)];case 1:return[2,t.sent()]}}))}))},this.getConfig=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getConfig()];case 1:return[2,e.sent()]}}))}))},this.deleteFootballPrediction=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.deleteFootballPrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getMyPredictions=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMyPredictions(e)];case 1:return[2,t.sent()]}}))}))},this.getMyCurrentPredictions=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMyCurrentPredictions(e)];case 1:return[2,t.sent()]}}))}))},this.getMyPastPredictions=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMyPastPredictions(e)];case 1:return[2,t.sent()]}}))}))},this.getMyPredictionsForMatches=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMyPredictionsForMatches(e,n)];case 1:return[2,t.sent()]}}))}))},this.getUserPredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getUserPredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserCurrentPredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getUserCurrentPredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserPastPredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getUserPastPredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserPredictionsForMatches=function(e,n,s,a){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getUserPredictionsForMatches(e,n,s,a)];case 1:return[2,t.sent()]}}))}))},this.getPredictionById=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getPredictionById(e)];case 1:return[2,t.sent()]}}))}))},this.idMapping=new a.default(e),this.predictorHttps=new s.default(e,this.idMapping),this.clientHttps=new u.default(e),this.predictorFacade=new o.default(e,this.predictorHttps,this.clientHttps,this.idMapping)}},5013:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var o=n(7974),u=n(3792),l=n(8452),c=n(5908),d=n(8950),h=n(6890),p=n(595),f=n(4545),m=n(7782),v=n(7299),y=n(712),g=n(4119),w=n(3751),b=n(7243),_=n(4272),E=n(1180),I=n(5765),M=n(6147),O=n(5318),T=n(4946),S=n(6409),R=n(1260),P=n(6247);t.default=function(e,t){var n=this;this.footballHttps=null,this.idMapping=null,this.matchFacade=null,this.playerFacade=null,this.profileNamespace=null,this.remapMatchIdToNative=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.idMapping.getEntityIdsBySchemaId(e,"match","native")];case 1:return[2,t.sent().match]}}))}))},this.remapPlayerIdToNative=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.idMapping.getEntityIdsBySchemaId(e,"player","native")];case 1:return[2,t.sent().player[0]]}}))}))},this.remapPlayerIdMapToNative=function(e){return i(n,void 0,void 0,(function(){var t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return t={},n=(0,y.transformIdsToBeUnique)(e),[4,this.idMapping.getEntityIdsBySchemaId(n,"player","native")];case 1:return r=s.sent(),i=r.player,n.forEach((function(e,n){return t[e]=i[n]})),[2,t]}}))}))},this.remapPlayerIdToIdSchema=function(e){return i(n,void 0,void 0,(function(){var t,n,r,i,a,o,u,l,c,d,h,p,f,m,v,y,g,w,b;return s(this,(function(s){switch(s.label){case 0:for(t=["playerScore","playerYellowCard","playerRedCard","playerScoreFirstGoal","playerScoreHattrick","playerScoreTwice"],n=[],r=0,i=Object.entries(e);r<i.length;r++)if(a=i[r],o=a[0],u=a[1],t.includes(o))for(l=0,c=Object.keys(u);l<c.length;l++)"NOBODY"!==(d=c[l])&&"OWN_GOAL"!==d&&n.push(d);return n.length?[4,this.playerFacade.getPlayersMapWithNativeIds(n)]:[2,e];case 1:for(h=s.sent(),p=0,f=Object.entries(e);p<f.length;p++)if(m=f[p],v=m[0],y=m[1],t.includes(v))for(g=0,w=Object.keys(y);g<w.length;g++)"NOBODY"!==(b=w[g])&&"OWN_GOAL"!==b&&(y[h[b].id]=y[b],y[h[b].id].model=h[b],this.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&delete y[b]);return[2,e]}}))}))},this.convertMarket=function(e){for(var t=Object.keys(new u.default),n=Object.values(o.MarketEnum),r=0;r<n.length;r++)e===n[r]&&(e=t[r]);return e},this.convertMarketForResponseModel=function(e,t){return e+"_"+t.toString()},this.getMarketSummary=function(e,t,r){return i(n,void 0,void 0,(function(){var n,i,a,u,l,d,h,p,f=this;return s(this,(function(s){switch(s.label){case 0:if(n=this.convertMarket(t),(i={}).matchId=e.matchId,i.matchType=e.matchType,!Object.keys(e.predictions).includes(n))throw new Error("You have passed invalid market");return i[n]=e.predictions[n],o.playerMarkets.includes(t)&&r?(a="","OWN_GOAL"===r||"NOBODY"===r?[3,2]:[4,this.idMapping.idMappingFacade.getEntitiesByIds({player:[r]},this.idMapping.idSchema,"native")]):[3,6];case 1:u=s.sent(),a=u.player[0],s.label=2;case 2:return a&&i[n][a]?[4,this.playerFacade.getPlayersMapWithNativeIds([a])]:[3,4];case 3:return l=s.sent(),i[n][a].model=l[a],[2,i[n][a]];case 4:return a?(i[n][a]=new c.default,[2,i[n][a]]):[2,i[n][r]];case 5:return[3,10];case 6:return!o.playerMarkets.includes(t)||r?[3,10]:(d=Object.keys(i[n]).filter((function(e){return"NOBODY"!==e&&"OWN_GOAL"!==e}))).length?[4,this.playerFacade.getPlayersMapWithNativeIds(d)]:[3,8];case 7:return p=s.sent(),[3,9];case 8:p={},s.label=9;case 9:h=p,Object.keys(h).length&&Object.keys(i[n]).forEach((function(e){"NOBODY"!==e&&"OWN_GOAL"!==e&&(i[n][h[e].id]=i[n][e],i[n][h[e].id].model=h[e],f.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&delete i[n][e])})),s.label=10;case 10:return[2,i]}}))}))},this.remapCompetitionsFromConfig=function(e){return i(n,void 0,void 0,(function(){var t,n,r,i,a,o,u,c;return s(this,(function(s){switch(s.label){case 0:return e instanceof l.default?(t={competition:e.fullCoverageCompetitions},n={competition:e.successRateScopes.competitions},r={team:e.successRateScopes.teams},[4,this.idMapping.idMappingFacade.getEntitiesByIds(t,"native",this.idMapping.idSchema)]):[3,4];case 1:return i=s.sent(),[4,this.idMapping.idMappingFacade.getEntitiesByIds(n,"native",this.idMapping.idSchema)];case 2:return a=s.sent(),[4,this.idMapping.idMappingFacade.getEntitiesByIds(r,"native",this.idMapping.idSchema)];case 3:return o=s.sent(),e.fullCoverageCompetitions=i.competition,e.successRateScopes.competitions=a.competition,e.successRateScopes.teams=o.team,[2,e];case 4:return e instanceof E.default||e instanceof I.default?(u={competition:e.competitionsWhitelist},[4,this.idMapping.idMappingFacade.getEntitiesByIds(u,"native",this.idMapping.idSchema)]):[3,6];case 5:return c=s.sent(),e.competitionsWhitelist=c.competition,[2,e];case 6:return[2]}}))}))},this.remapMatchIdsFixtures=function(e){return i(n,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return Array.isArray(e.data)?e.data.length>0?(t=[],n=[],e.data.forEach((function(e){e instanceof w.default||e instanceof d.default||e instanceof b.default||e instanceof P.default?(e.fixtures.forEach((function(e){return t.push(e.matchId)})),e instanceof b.default&&e.fixtures.forEach((function(e){e.prediction.playerId&&"OWN_GOAL"!==e.prediction.playerId&&n.push(e.prediction.playerId)}))):e instanceof h.default&&e.results.forEach((function(e){return t.push(e.matchId)}))})),[4,this.refactorResponseArrModel(e,t,n)]):[3,2]:[3,4];case 1:case 5:return[2,r.sent()];case 2:return[2,e];case 3:return[3,6];case 4:return[4,this.refactorResponseObjModel(e)];case 6:return[2]}}))}))},this.refactorResponseArrModel=function(e,t,r){return i(n,void 0,void 0,(function(){var n,i,a,o=this;return s(this,(function(s){switch(s.label){case 0:return n=[],[4,this.matchFacade.getMatchesMapWithNativeIds(t)];case 1:return i=s.sent(),a={},r.length>0?[4,this.playerFacade.getPlayersMapWithNativeIds(r)]:[3,3];case 2:a=s.sent(),s.label=3;case 3:return e.data.forEach((function(e){e instanceof w.default||e instanceof d.default||e instanceof b.default?(e.fixtures.forEach((function(t){o.handleMatchModel(i,t),e instanceof b.default&&t.prediction.playerId&&"OWN_GOAL"!==t.prediction.playerId&&(t.prediction.playerModel=a[t.prediction.playerId],t.prediction.playerId=a[t.prediction.playerId].id)})),n.push(e)):e instanceof h.default&&(e.results.forEach((function(e){e.matchModel=i[e.matchId],delete e.matchModel.availableMarkets,e.matchId=e.matchModel.id})),n.push(e))})),e.data=n,[2,e]}}))}))},this.refactorResponseObjModel=function(e){return i(n,void 0,void 0,(function(){var t,n,r=this;return s(this,(function(i){switch(i.label){case 0:return t=[],e.fixtures.forEach((function(e){return t.push(e.matchId)})),[4,this.matchFacade.getMatchesMapWithNativeIds(t)];case 1:return n=i.sent(),e.fixtures.forEach((function(e){return r.handleMatchModel(n,e)})),[2,e]}}))}))},this.getCurrentGameId=function(e){var t=new Date;if(e.data.length>1){var n=[];return e.data.forEach((function(e){return n.push(e.predictionsCutoff)})),e.data.sort((function(e,n){var r=[e.predictionsCutoff,n.predictionsCutoff].map((function(e){return Math.abs(new Date(e)-t)}));return r[0]-r[1]}))[0].id}return e.data[0].id},this.initGameTypePredictions=function(e,t){var n={type:e,limit:null,startAfter:null};return t&&(n=r(r({},n),{limit:t.limit,startAfter:t.startAfter})),new m.default(n)},this.initGameFilters=function(e,t,n){if(t&&n)return t.type=e,t.gameIds=n,new v.default(t);if(t&&!n)return t.type=e,new v.default(t);if(!t&&n){var r={type:e,gameIds:n};return new v.default(r)}return r={type:e},new v.default(r)},this.addPredictionProp=function(e,t){return i(n,void 0,void 0,(function(){var n=this;return s(this,(function(r){switch(r.label){case 0:return t.data.forEach((function(t){e.data.forEach((function(e){t.id===e.game_instance_id&&(t.predictionId=e.id,t.outcome=e.status,t.fixtures.forEach((function(t,r){void 0!==e.fixtures[r].goals_home&&void 0!==e.fixtures[r].goals_away?t.prediction.value=e.fixtures[r].goals_home+":"+e.fixtures[r].goals_away:t.prediction.value=e.fixtures[r].prediction,e.fixtures[r].player_id?t.prediction.playerId=e.fixtures[r].player_id:e.fixtures[r].target&&(t.prediction.target=e.fixtures[r].target),t.prediction.result=n.remapResult(e.fixtures[r].result)})),t.predictionsMadeAt=e.created_at,t.points=e.points,t instanceof d.default&&(e.tiebreaker?t.predictionTiebreaker.goldenGoal=e.tiebreaker.golden_goal:t.predictionTiebreaker=e.tiebreaker))}))})),t.meta.pagination.nextPageStartsAfter=e.meta.pagination.next_page_starts_after,[4,this.remapMatchIdsFixtures(t)];case 1:return[2,r.sent()]}}))}))},this.remapResult=function(e){var t=new g.default;return t.settledAt=e.settled_at,t.resettledAt=e.resettled_at,t.status=e.status,t.outcome=e.outcome,t.points=e.points,t},this.areIdsExceeded=function(e){return e.length>10},this.initPredictionsFilters=function(e,t,r){switch(t){case"user":e&&(e=new m.default(e));break;case"current":if(e)n.deleteUnexpectedProperties(e),e.status=[M.StatusEnum.ACTIVE],e=new m.default(e);else{var i={status:[M.StatusEnum.ACTIVE]};e=new m.default(i)}break;case"past":e?(n.deleteUnexpectedProperties(e),e.status=M.pastStatuses,e=new m.default(e)):(i={status:M.pastStatuses},e=new m.default(i));break;case"matches":e?(n.deleteUnexpectedProperties(e),e.matchIds=r,e=new m.default(e)):(i={matchIds:r},e=new m.default(i))}return e},this.completeGameMarketResults=function(e,t){return i(n,void 0,void 0,(function(){var n,r,i,u,l,c,d,h,p=this;return s(this,(function(s){switch(s.label){case 0:switch(t){case"MATCH_QUIZ":return[3,1];case"TOP_X":return[3,5]}return[3,9];case 1:return n={},r=e.results[0].matchId,i=e.results.map((function(e){return o.playerMarkets.includes(e.market)&&!e.result.includes("OWN_GOAL")?a([],e.result,!0):[]})).flat(),[4,this.matchFacade.getMatchesMapWithNativeIds([r])];case 2:return u=s.sent(),i.length?[4,this.playerFacade.getPlayersMapWithNativeIds(i)]:[3,4];case 3:n=s.sent(),s.label=4;case 4:return e.results=e.results.map((function(e){if(e.matchModel=u[e.matchId]?u[e.matchId]:null,e.playerModels&&Object.keys(n).length&&(t=e.result).forEach((function(t){var r=n[t];e.playerModels.push(r)})),p.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&(p.remapMatchIdForResultsMarkets(u,e),e.playerModels&&Object.keys(n).length)){var t=e.result;e.result=t.map((function(e){return n[e].id}))}return e})),[2,e];case 5:return l=e.results.map((function(e){return e.matchId})),[4,this.matchFacade.getMatchesMapWithNativeIds(l)];case 6:return c=s.sent(),e.results=e.results.map((function(e){return e.matchModel=c[e.matchId]?c[e.matchId]:null,p.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&p.remapMatchIdForResultsMarkets(c,e),e})),e.tieBreakers.goldenGoals.length?(d=e.tieBreakers.goldenGoals.map((function(e){return e.playerId})),[4,this.playerFacade.getPlayersMapWithNativeIds(d)]):[3,8];case 7:h=s.sent(),e.tieBreakers.goldenGoals=e.tieBreakers.goldenGoals.map((function(e){return e.matchModel=c[e.matchId],e.playerModel=h[e.playerId],p.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&(e.matchId=c[e.matchId].id,e.playerId=h[e.playerId].id),e})),s.label=8;case 8:return[2,e];case 9:return[2]}}))}))},this.completeContestWinners=function(e){return i(n,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return t=e.userList.map((function(e){return e.profileId})),[4,this.profileNamespace.getByIds(t)];case 1:return n=r.sent(),e.userList.forEach((function(e){var t=n.filter((function(t){return t.id===e.profileId}))[0];delete t.interests,e.profileModel=t})),[2,e]}}))}))},this.handleMatchModel=function(e,t){e[t.matchId]?(t.matchModel=e[t.matchId],delete t.matchModel.availableMarkets,t.matchId=t.matchModel.id):(t.matchModel=null,n.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&n.idMapping.idMappingFacade.getEntityById(t.matchId,"match","native").then((function(e){t.matchId=e[R.ID_TYPES[n.idMapping.idSchema]]})))},this.remapMatchIdForResultsMarkets=function(e,t){e[t.matchId]?t.matchId=e[t.matchId].id:n.idMapping.idMappingFacade.getEntityById(t.matchId,"match","native").then((function(e){t.matchId=e[R.ID_TYPES[n.idMapping.idSchema]]}))},this.deleteUnexpectedProperties=function(e){return e.status&&(console.warn(O.WarningMessages.UNEXPECTED_STATUS_PROP),delete e.status),e.type&&(console.warn(O.WarningMessages.UNEXPECTED_TYPE_PROP),delete e.type),e},this.footballHttps=new p.default(e),this.idMapping=t,this.matchFacade=new f.default(e,this.footballHttps,t),this.playerFacade=new _.default(e,this.footballHttps,t),this.profileNamespace=new S.default(e)}},2310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4021),i=n(4904),s=n(8097),a=n(5318),o=n(7974),u=n(1976),l=n(1206),c=n(5274),d=n(1465),h=n(7535),p=n(1718),f=n(7307),m=n(5132),v=n(7344),y=n(1855),g=n(1732),w=n(5814),b=n(3950),_=n(1260),E=n(7640),I=n(2535);t.default=function(e){var t=this;this.errorHandlingMode=null,this.validateBodyFields=function(e,n){var r=Object.keys(n),i=Object.keys(new b.default);switch(e){case"MATCH_QUIZ":r.forEach((function(e){i.includes(e)||t.throwInvalidParamException([e])}));break;case"TOP_X":var s=n;s.fixtures.forEach((function(e){return t.validateMarketTopX(e.market)})),r.includes("tiebreaker")&&s.tiebreaker&&t.validateTiebreaker(s.tiebreaker),r.forEach((function(e){"tiebreaker"===e||i.includes(e)||t.throwInvalidParamException([e])}))}var a=i.filter((function(e){return!r.includes(e)}));return a.length&&t.throwMissingFieldsException("game prediction body",a),n.fixtures.forEach((function(e){t.validateFixtureFields(e)})),n},this.validateFixture=function(e,n,r,i){t.validateMarket(n);var s=Object.values(u.OneXTwoEnum),a=Object.values(u.HalfTimeFullTimeEnum),b=Object.values(u.DoubleChanceEnum);if(n===o.MarketEnum.FT_1X2||n===o.MarketEnum.HT_1X2){if(s.includes(r))return new p.default(e,n,r)}else if(n===o.MarketEnum.HT_FT){if(a.includes(r))return new f.default(e,r)}else if(n===o.MarketEnum.DOUBLE_CHANCE){if(b.includes(r))return new h.default(e,r)}else if(n===o.MarketEnum.CORRECT_SCORE||n===o.MarketEnum.CORRECT_SCORE_ADVANCED||n===o.MarketEnum.CORRECT_SCORE_HT){if("string"==typeof r&&/\d+:\d+/.test(r))return new d.default(e,n,r)}else if(n===o.MarketEnum.CORNERS_MATCH){if("number"==typeof r)return new c.default(e,r)}else if(n===o.MarketEnum.BOTH_TEAMS_SCORE){if(t.isPredictionBoolean(r))return new l.default(e,r)}else if(n===o.MarketEnum.RED_CARD_MATCH){if(t.isPredictionBoolean(r))return new w.default(e,r)}else if(n===o.MarketEnum.PENALTY_MATCH){if(t.isPredictionBoolean(r))return new y.default(e,r)}else if(o.playerMarkets.includes(n)){var _="OWN_GOAL";if(t.validatePlayerId(n,i),n===o.playerMarketNobodyPrediction&&t.isPredictionBoolean(r)){var E=i&&i===_?_:i;return new g.default(e,n,r,E)}if(i&&t.isPredictionBoolean(r))return new g.default(e,n,r,i)}else if(o.MarketsOverGoals.includes(n)){if(t.isPredictionBoolean(r))return new v.default(e,n,r)}else if(o.MarketsOverCorners.includes(n)&&t.isPredictionBoolean(r))return new m.default(e,n,r);t.throwInvalidPredictionException(r,n)},this.validateFixtureFields=function(e){var n=Object.keys(e);n.forEach((function(e){_.validFixtureFields.includes(e)||t.throwInvalidParamException([e])}));var r=_.validFixtureFields.filter((function(e){if("matchType"!==e&&!n.includes(e))return e}));r.length&&t.throwMissingFieldsException("fixtures",r),t.validatePredictionKey(e.market,e.prediction)},this.validateTiebreaker=function(e){var n=Object.keys(e);n.length&&"object"==typeof e||t.throwInvalidType("tiebreaker","object");var r=Object.keys(new E.default)[0];n.forEach((function(e){r!==e&&t.throwInvalidParamException([e])})),n.includes(r)||t.throwMissingFieldsException("tiebreaker",[r]),"number"!=typeof e.goldenGoal&&t.throwInvalidType("goldenGoal","number")},this.validatePredictionKey=function(e,n){if("object"==typeof n){var r=Object.keys(n),i=["value"];if(r.length||t.throwMissingFieldsException("prediction",i),1!==r.length||r.includes(i[0])||t.throwInvalidParamException(r),r.length>1){o.playerMarkets.includes(e)&&i.push("playerId");var s=r.filter((function(e){return!i.includes(e)}));s.length&&t.throwInvalidParamException(s)}}else t.throwInvalidType("prediction","object")},this.validatePlayerId=function(e,n){var r="playerId";e!==o.playerMarketNobodyPrediction&&(n||t.throwInvalidParamException([r]),"string"!=typeof n&&t.throwInvalidType(r,"string"))},this.validateMarket=function(e){Object.values(o.MarketEnum).includes(e)||t.throwInvalidMarketException(e)},this.validateMarketTopX=function(e){e!==o.MarketEnum.CORRECT_SCORE&&e!==o.MarketEnum.CORRECT_SCORE_ADVANCED&&t.throwInvalidMarketException(e,"TOP_X")},this.isPredictionBoolean=function(e){return"boolean"==typeof e},this.throwInvalidPredictionException=function(e,n){var o=(0,a.invalidPredictionMessage)(e,n);if("default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_PREDICTION,o);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o).response},this.throwInvalidMarketException=function(e,n){var o;if(o=n&&"TOP_X"===n?(0,a.invalidMarketTopXMessage)(e):(0,a.invalidMarketMessage)(e),"default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_MARKET,o);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o).response},this.throwInvalidParamException=function(e){var n=(0,a.invalidFieldMessage)(e);if("default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FIELD,n);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,n).response},this.throwMissingFieldsException=function(e,n){var o=(0,a.missingFieldsMessage)(e,n);if("default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FIELD,o);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o).response},this.throwInvalidType=function(e,n){var o=(0,a.invalidTypeMessage)(e,n);if("default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o).response},this.errorHandlingMode=e}},4831:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var o=n(9072),u=n(7232),l=n(4268),c=n(8097),d=n(2535),h=n(4021),p=n(4904),f=n(5318);t.default=function(e,t,n,m,v){var y=this;this.idsRemapper=null,this.profileHttps=null,this.profileService=null,this.localStorage=null,this.profileFacade=null,this.ownProfile=null,this.modified=!1,this.expireAt=0,this.promises=[],this.isFetching=!1,this.errorHandlingMode=null,this.getOwnProfile=function(){return i(y,void 0,void 0,(function(){var e,t,n;return s(this,(function(r){switch(r.label){case 0:return this.isFetching?(console.log("Another thread is fetching profile..."),[4,this.delay(100)]):[3,2];case 1:return r.sent(),[3,0];case 2:if(this.modified&&this.ownProfile)return console.log("Timestamp is less than 10 minutes OR profile is modifying "),[2,this.ownProfile];if(e=Math.floor(Date.now()/1e3),this.ownProfile&&!(this.expireAt<e))return[3,7];this.isFetching=!0,this.expireAt=Math.floor(Date.now()/1e3)+600,r.label=3;case 3:return r.trys.push([3,5,,6]),[4,this.profileFacade.getOwn()];case 4:return t=r.sent(),this.setOwnProfile(t),[3,6];case 5:throw n=r.sent(),this.isFetching=!1,n;case 6:return this.modified=!1,this.isFetching=!1,[2,this.ownProfile];case 7:return[2,this.ownProfile]}}))}))},this.delay=function(e){return new Promise((function(t){setTimeout(t,e)}))},this.setOwnProfile=function(e){y.ownProfile=e},this.getInfo=function(){return i(y,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return e=n.sent(),delete(t=JSON.parse(JSON.stringify(e))).interests,[2,t]}}))}))},this.showInterests=function(){return i(y,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[4,this.idsRemapper.remapInterests(t.interests)];case 2:return[2,n.sent()]}}))}))},this.showFullInterests=function(){return i(y,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[4,this.idsRemapper.showFullInterests(t.interests)];case 2:return[2,n.sent()]}}))}))},this.getFollowers=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getFollowers(e)];case 1:return[2,t.sent()]}}))}))},this.getFollowing=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getFollowing(e)];case 1:return[2,t.sent()]}}))}))},this.follow=function(e){return i(y,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return[4,this.profileFacade.follow(e)];case 1:return t=r.sent(),[4,this.profileFacade.updateOwnProfile()];case 2:return n=r.sent(),this.setOwnProfile(n),[2,t]}}))}))},this.unfollow=function(e){return i(y,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return[4,this.profileFacade.unfollow(e)];case 1:return t=r.sent(),[4,this.profileFacade.updateOwnProfile()];case 2:return n=r.sent(),this.setOwnProfile(n),[2,t]}}))}))},this.getStats=function(){return i(y,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getStats()];case 1:return e=t.sent(),[4,this.idsRemapper.remapSuccessRatesEntities(e)];case 2:return[2,t.sent()]}}))}))},this.getBadges=function(){return i(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getBadges()];case 1:return[2,e.sent()]}}))}))},this.addInterestPromise=function(e){return i(y,void 0,void 0,(function(){var t,n,i;return s(this,(function(s){switch(s.label){case 0:return this.modified=!0,t=r({},e),[4,this.getOwnProfile()];case 1:return s.sent(),n=null,"custom"===e.source?[3,3]:[4,this.idsRemapper.remapInterestToNative(t)];case 2:return n=s.sent(),[3,4];case 3:n=t,s.label=4;case 4:return i=this.ownProfile.interests.filter((function(e){return e.id!==n.id||e.type!==n.type||e.source!==n.source})),this.ownProfile.interests=a([],i,!0),this.ownProfile.interests.push(n),[2,this]}}))}))},this.addInterest=function(e){return y.promises.push(y.addInterestPromise(e)),y},this.removeInterestPromise=function(e){return i(y,void 0,void 0,(function(){var t,n;return s(this,(function(i){switch(i.label){case 0:return this.modified=!0,t=r({},e),[4,this.getOwnProfile()];case 1:return i.sent(),n=null,"custom"===e.source?[3,3]:[4,this.idsRemapper.remapInterestToNative(t)];case 2:return n=i.sent(),[3,4];case 3:n=t,i.label=4;case 4:return this.ownProfile.interests=this.ownProfile.interests.filter((function(e){return e.id!==n.id||e.type!==n.type||e.source!==n.source})),[2,this]}}))}))},this.removeInterest=function(e){return y.promises.push(y.removeInterestPromise(e)),y},this.setBirthdatePromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),this.ownProfile.birthDate=e||null,[2,this]}}))}))},this.setBirthdate=function(e){return y.promises.push(y.setBirthdatePromise(e)),y},this.setGenderPromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),this.ownProfile.gender="male"===e||"female"===e?e:"unspecified",[2,this]}}))}))},this.setGender=function(e){return y.promises.push(y.setGenderPromise(e)),y},this.setNicknamePromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),this.ownProfile.nickname=e,[2,this]}}))}))},this.setNickname=function(e){return y.promises.push(y.setNicknamePromise(e)),y},this.setNamePromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),this.ownProfile.name=e,[2,this]}}))}))},this.setName=function(e){return y.promises.push(y.setNamePromise(e)),y},this.setCountryPromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),e&&!this.ownProfile.country?(this.ownProfile.country=new o.default,this.ownProfile.country.id=e):e&&this.ownProfile.country?this.ownProfile.country.id=e:this.ownProfile.country=null,[2,this]}}))}))},this.setCountry=function(e){return y.promises.push(y.setCountryPromise(e)),y},this.showFullnessProfile=function(){return i(y,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[2,this.profileFacade.showFullnessProfile(t)]}}))}))},this.setAvatarPromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:if(t.sent(),this.profileService.isAvatarValidURL(e))this.ownProfile.avatar=e;else{if("default"===this.errorHandlingMode)throw new c.default(h.ErrorCodes.BAD_METHOD_CALL,p.ErrorStatuses.INVALID_AVATAR,f.ErrorMessages.INVALID_AVATAR);if("standard"===this.errorHandlingMode)throw new d.default(h.ErrorCodes.BAD_METHOD_CALL,p.ErrorStatuses.INVALID_AVATAR,f.ErrorMessages.INVALID_AVATAR).response}return[2,this]}}))}))},this.setAvatar=function(e){return y.promises.push(y.setAvatarPromise(e)),y},this.update=function(){return i(y,void 0,void 0,(function(){var e,t,n,r,i,a;return s(this,(function(s){switch(s.label){case 0:return 0===this.promises.length?[2,this.ownProfile]:[4,Promise.all(this.promises)];case 1:return s.sent(),[4,this.profileFacade.getOwn()];case 2:return e=s.sent(),[4,this.getOwnProfile()];case 3:return t=s.sent(),n=this.profileService.extractUpdatedProps(e,t),this.modified=!1,this.expireAt=0,Object.keys(n).length?[4,this.profileHttps.updateProfile(n)]:[3,5];case 4:return r=s.sent(),i=JSON.parse(JSON.stringify(r)),this.setOwnProfile(i),this.localStorage.setOwnProfile(i),delete r.interests,[2,r];case 5:return delete(a=JSON.parse(JSON.stringify(this.ownProfile))).interests,[2,a]}}))}))},this.idsRemapper=e,this.localStorage=t,this.profileHttps=n,this.errorHandlingMode=v,this.profileService=new l.default,this.profileFacade=new u.default(t,n,m)}},642:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(7232);t.default=function(e,t,n,a){var o=this;this.idsRemapper=null,this.profileHttps=null,this.activityHttps=null,this.profileFacade=null,this.profileId="",this.setId=function(e){return o.profileId=e,o},this.getProfile=function(){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getById(this.profileId)];case 1:return[2,e.sent()]}}))}))},this.getInfo=function(){return r(o,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.getProfile()];case 1:return delete(e=t.sent()).interests,[2,e]}}))}))},this.showInterests=function(){return r(o,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return[4,this.getProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[4,this.idsRemapper.remapInterests(t.interests)];case 2:return[2,n.sent()]}}))}))},this.showFullInterests=function(){return r(o,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return[4,this.getProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[4,this.idsRemapper.showFullInterests(t.interests)];case 2:return[2,n.sent()]}}))}))},this.getFollowers=function(e){return r(o,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getFollowers(e,this.profileId)];case 1:return[2,t.sent()]}}))}))},this.getFollowing=function(e){return r(o,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getFollowing(e,this.profileId)];case 1:return[2,t.sent()]}}))}))},this.showFullnessProfile=function(){return r(o,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.getProfile()];case 1:return e=t.sent(),[2,this.profileFacade.showFullnessProfile(e)]}}))}))},this.getStats=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.activityHttps.getStats(this.profileId,e)];case 1:return t=n.sent(),[4,this.idsRemapper.remapSuccessRatesEntities(t)];case 2:return[2,n.sent()]}}))}))},this.getBadges=function(){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.profileHttps.getBadges(this.profileId)];case 1:return[2,e.sent()]}}))}))},this.idsRemapper=e,this.profileHttps=n,this.activityHttps=a,this.profileFacade=new s.default(t,n,a)}},7232:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(9037),a=n(9523);t.default=function(e,t,n){var o=this;this.isBrowser=!1,this.localStorage={},this.profileHttps=null,this.activityHttps=null,this.getOwn=function(){return r(o,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?(e=this.getLocalStorageData("profile"))?[2,JSON.parse(JSON.stringify(e))]:[3,1]:[3,5];case 1:return i.trys.push([1,3,,4]),[4,this.profileHttps.getProfile()];case 2:return n=i.sent(),this.localStorage.setOwnProfile(n),[2,n];case 3:throw t=i.sent(),console.warn("There was a problem retrieving your profile: ",t),t;case 4:return[3,8];case 5:return i.trys.push([5,7,,8]),[4,this.profileHttps.getProfile()];case 6:return[2,n=i.sent()];case 7:throw r=i.sent(),console.warn("There was a problem retrieving your profile: ",r),r;case 8:return[2]}}))}))},this.updateOwnProfile=function(){return r(o,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.getProfile()];case 1:return e=n.sent(),this.localStorage.setOwnProfile(e),[2,e];case 2:throw t=n.sent(),console.warn("There was a problem retrieving your profile: ",t),t;case 3:return[2]}}))}))},this.getByIds=function(e,t){return r(o,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.profileHttps.getProfiles(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the selected profiles: "+e.join(",")+" ",n),n;case 3:return[2]}}))}))},this.getById=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.getProfile(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem retrieving the selected profile: "+e+" ",t),t;case 3:return[2]}}))}))},this.getCountries=function(e){return r(o,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=e||!1,this.isBrowser?(t=this.localStorage.getProfileCountries())&&t.length>0?[2,t]:[3,1]:[3,5];case 1:return i.trys.push([1,3,,4]),[4,this.profileHttps.getCountries(e)];case 2:return n=i.sent(),this.localStorage.setProfileCountries(n),[2,n];case 3:throw r=i.sent(),console.warn("There was a problem retrieving profile countries: ",r),r;case 4:return[3,8];case 5:return i.trys.push([5,7,,8]),[4,this.profileHttps.getCountries(e)];case 6:return[2,i.sent()];case 7:throw s=i.sent(),console.warn("There was a problem retrieving profile countries: ",s),s;case 8:return[2]}}))}))},this.getFollowers=function(e,t){return r(o,void 0,void 0,(function(){var n,r,s,o,u;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),e&&(e=new a.default(e)),[4,this.profileHttps.getFollowers(e,t)];case 1:return n=i.sent(),(r=n.data.map((function(e){return e.followerId}))).length?[4,this.getByIds(r)]:[3,3];case 2:return s=i.sent(),o=n.data.map((function(e){return s.forEach((function(t){e.followerId===t.id&&(e.name=t.name,e.nickname=t.nickname,e.avatar=t.avatar)})),e})),n.data=o,[2,n];case 3:return[2,n];case 4:throw u=i.sent(),console.warn("There was a problem retrieving your followers: ",u),u;case 5:return[2]}}))}))},this.getFollowing=function(e,t){return r(o,void 0,void 0,(function(){var n,r,s,o,u;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),e&&(e=new a.default(e)),[4,this.profileHttps.getFollowing(e,t)];case 1:return n=i.sent(),(r=n.data.map((function(e){return e.followingId}))).length?[4,this.getByIds(r)]:[3,3];case 2:return s=i.sent(),o=n.data.map((function(e){return s.forEach((function(t){e.followingId===t.id&&(e.name=t.name,e.nickname=t.nickname,e.avatar=t.avatar)})),e})),n.data=o,[2,n];case 3:return[2,n];case 4:throw u=i.sent(),console.warn("There was a problem retrieving your following profiles: ",u),u;case 5:return[2]}}))}))},this.follow=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.follow(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem following profiles: "+e.join(",")+" ",t),t;case 3:return[2]}}))}))},this.unfollow=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.unfollow(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem unfollowing profiles: "+e.join(",")+" ",t),t;case 3:return[2]}}))}))},this.showFullnessProfile=function(e){var t=new s.default,n=0;return e.avatar&&(t.breakdown.addedAvatar.completed=!0,n+=t.breakdown.addedAvatar.percentage),e.birthDate&&(t.breakdown.addedBirthdate.completed=!0,n+=t.breakdown.addedBirthdate.percentage),e.country&&(t.breakdown.addedCountry.completed=!0,n+=t.breakdown.addedCountry.percentage),e.gender&&(t.breakdown.addedGender.completed=!0,n+=t.breakdown.addedGender.percentage),e.interests&&e.interests.length>0&&(e.interests.find((function(e){return"team"===e.type&&e.favourite}))&&(t.breakdown.teamFavourite.completed=!0,n+=t.breakdown.teamFavourite.percentage),e.interests.find((function(e){return"team"===e.type}))&&(t.breakdown.teamFollowed.completed=!0,n+=t.breakdown.teamFollowed.percentage),e.interests.find((function(e){return"player"===e.type&&e.favourite}))&&(t.breakdown.playerFavourite.completed=!0,n+=t.breakdown.playerFavourite.percentage),e.interests.find((function(e){return"player"===e.type}))&&(t.breakdown.playerFollowed.completed=!0,n+=t.breakdown.playerFollowed.percentage),e.interests.find((function(e){return"competition"===e.type&&e.favourite}))&&(t.breakdown.competitionFavourite.completed=!0,n+=t.breakdown.competitionFavourite.percentage),e.interests.find((function(e){return"competition"===e.type}))&&(t.breakdown.competitionFollowed.completed=!0,n+=t.breakdown.competitionFollowed.percentage)),t.totalPercentage=n,t},this.getStats=function(){return r(o,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?(e=this.getLocalStorageData("statistics"))&&Object.keys(e).length?[2,JSON.parse(JSON.stringify(e))]:[3,1]:[3,5];case 1:return i.trys.push([1,3,,4]),[4,this.activityHttps.getStats()];case 2:return t=i.sent(),this.localStorage.setProfileStats(t),[2,t];case 3:throw n=i.sent(),console.warn("There was a problem retrieving own profile statistics: ",n),n;case 4:return[3,8];case 5:return i.trys.push([5,7,,8]),[4,this.activityHttps.getStats()];case 6:return[2,i.sent()];case 7:throw r=i.sent(),console.warn("There was a problem retrieving own profile statistics: ",r),r;case 8:return[2]}}))}))},this.getBadges=function(){return r(o,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?(e=this.getLocalStorageData("badges"))?[2,e]:[3,1]:[3,5];case 1:return i.trys.push([1,3,,4]),[4,this.profileHttps.getBadges()];case 2:return t=i.sent(),this.localStorage.setProfileBadges(t),[2,t];case 3:throw n=i.sent(),console.warn("There was a problem retrieving own profile badges: ",n),n;case 4:return[3,8];case 5:return i.trys.push([5,7,,8]),[4,this.profileHttps.getBadges()];case 6:return[2,i.sent()];case 7:throw r=i.sent(),console.warn("There was a problem retrieving own profile badges: ",r),r;case 8:return[2]}}))}))},this.getLocalStorageData=function(e){var t=Math.floor(Date.now()/1e3),n=o.localStorage.getExpiration("profile",e);switch(e){case"profile":if(n>t)return o.localStorage.getOwnProfile();case"statistics":if(n>t)return o.localStorage.getProfileStats();case"badges":if(n>t)return o.localStorage.getProfileBadges();default:return null}},this.isBrowser="undefined"!=typeof window,this.localStorage=e,this.profileHttps=t,this.activityHttps=n}},9523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.limit=0,this.startAfter=null,this.constructFilterUrl=function(){var e="";return t.limit&&(e=(e+="&")+"limit="+t.limit),t.startAfter&&(e=(e+="&")+"start_after="+t.startAfter),e},this.limit=e.limit?e.limit:20,this.startAfter=e.startAfter?e.startAfter:null}},4782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.avatar=null,this.followerId=null,this.name=null,this.nickname=null,this.profileId=null}},1712:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.profile_ids=[]}},3106:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.avatar=null,this.followingId=null,this.name=null,this.nickname=null,this.profileId=null}},5156:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.model=null,t}return i(t,e),t}(n(5867).default);t.default=s},6620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7312);t.default=function(){this.teamFollowed=new r.default(10),this.teamFavourite=new r.default(15),this.playerFollowed=new r.default(10),this.playerFavourite=new r.default(10),this.competitionFollowed=new r.default(10),this.competitionFavourite=new r.default(5),this.addedBirthdate=new r.default(10),this.addedGender=new r.default(10),this.addedCountry=new r.default(10),this.addedAvatar=new r.default(10)}},7312:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.completed=!1,this.percentage=e}},9037:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6620);t.default=function(){this.breakdown=new r.default}},5867:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.source="",this.type="",this.favourite=!1}},9072:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id=null,this.name=null,this.assets=null}},3546:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id=null,this.name=null,this.nickname=null,this.avatar=null,this.gender=null,this.country=null,this.birthDate=null,this.interests=[],this.followingCount=0,this.followersCount=0}},6277:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1553),i=n(4782);t.default=function(){var e=this;this.followersFromResponse=function(t){var n=new r.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapResponse(t)})),n},this.remapResponse=function(e){var t=new i.default;return t.avatar=e.avatar,t.followerId=e.follower_id,t.name=e.name,t.profileId=e.profile_id,t}}},8673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1553),i=n(3106);t.default=function(){var e=this;this.followResponse=function(t){return t.map((function(t){return e.remapResponse(t)}))},this.followingFromResponse=function(t){var n=new r.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapResponse(t)})),n},this.remapResponse=function(e){var t=new i.default;return t.avatar=e.avatar,t.followingId=e.following_id,t.name=e.name,t.profileId=e.profile_id,t.nickname=e.nickname,t}}},441:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3546);t.default=function(){var e=this;this.profilesFromResponse=function(t){return t?t.map((function(t){return e.fullProfileFromResponse(t)})):null},this.fullProfileFromResponse=function(e){var t=new r.default;return t.id=e.id,t.name=e.name,t.nickname=e.nickname,t.avatar=e.avatar,t.gender=e.gender,t.country=e.country,t.birthDate=e.birth_date,t.interests=e.interests?e.interests:[],t.followingCount=e.following_count,t.followersCount=e.followers_count,t}}},1316:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5123);t.default=function(){this.successRates=new r.default}},9826:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.model=null}},5123:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},6409:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4275),a=n(8900),o=n(7232),u=n(5601),l=n(4831),c=n(642),d=n(4289),h=n(595),p=n(1022),f=n(4912);t.default=function(e){var t=this;this.idsRemapper=null,this.profileHttps=null,this.activityHttps=null,this.footballHttps=null,this.footballFacade=null,this.idMapping=null,this.localStorage=null,this.profileFacade=null,this.ownProfileBuilder=null,this.profileBuilder=null,this.getOwn=function(){return t.ownProfileBuilder},this.getById=function(e){return t.profileBuilder.setId(e)},this.getCountries=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getCountries(e)];case 1:return[2,t.sent()]}}))}))},this.getByIds=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getByIds(e,n)];case 1:return[2,t.sent()]}}))}))},this.profileHttps=new s.default(e),this.activityHttps=new p.default(e),this.footballHttps=new h.default(e),this.idMapping=new a.default(e),this.localStorage=new u.default(e),this.footballFacade=new d.default(e,this.localStorage,this.footballHttps,this.idMapping),this.profileFacade=new o.default(this.localStorage,this.profileHttps,this.activityHttps),this.idsRemapper=new f.default(e,this.footballFacade),this.ownProfileBuilder=new l.default(this.idsRemapper,this.localStorage,this.profileHttps,this.activityHttps,e.errorHandlingMode),this.profileBuilder=new c.default(this.idsRemapper,this.localStorage,this.profileHttps,this.activityHttps)}},4268:function(e,t){"use strict";var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=this;this.extractUpdatedProps=function(t,n){var r=["name","nickname","gender","avatar"],i={};return Object.keys(t).forEach((function(s){if(r.includes(s)&&t[s]!==n[s])i[s]=n[s];else if("birthDate"===s)(null===n[s]||null===t[s]&&n[s]||t[s]!==n[s])&&(i.birth_date=n[s]);else if("country"===s)null===n[s]?i.country_id=n[s]:(null===t[s]&&n[s]||t[s].id!==n[s].id)&&(i.country_id=n[s].id);else if("interests"===s){var a=t[s],o=n[s];o.length&&e.isNewInterest(a,o)?i[s]=e.updateInterests(a,o):!o.length&&a.length?i[s]=o:a.length===o.length||e.isNewInterest(a,o)||(i[s]=o)}})),i},this.updateInterests=function(t,r){if(t.length===r.length){var i=e.extractSameAndNewInterests(t,r),s=i[0],a=i[1];return n(n([],a,!0),s,!0)}return r},this.isNewInterest=function(t,n){var r=!1;return e.extractSameAndNewInterests(t,n)[0].length?r=!0:r},this.extractSameAndNewInterests=function(e,t){var n=t.filter((function(t){return e.some((function(e){return t.id===e.id&&t.type===e.type&&t.source===e.source&&t.favourite===e.favourite}))}));return[t.filter((function(t){return!e.some((function(e){return t.id===e.id&&t.type===e.type&&t.source===e.source&&t.favourite===e.favourite}))})),n]},this.isAvatarValidURL=function(e){try{return new URL(e),!0}catch(e){return!1}}}},853:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.GameStatusEnum=void 0,(n=t.GameStatusEnum||(t.GameStatusEnum={})).OPEN="OPEN",n.LIVE="LIVE",n.PENDING="PENDING",n.CANCELED="CANCELED",n.CLOSED="CLOSED",n.SETTLED="SETTLED"},9502:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4946),a=n(2793),o=n(5013),u=n(853),l=n(7299),c=n(1553),d=n(1399),h=n(7782),p=n(7686),f=n(2310),m=n(8097),v=n(4904),y=n(5318),g=n(4021),w=n(2535);t.default=function(e,t){var n=this;this.idMapping=null,this.predictorHttps=null,this.predictorService=null,this.predictorValidator=null,this.clientHttps=null,this.errorHandlingMode=null,this.getConfig=function(){return r(n,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(p.FeatureConfigType.TOP_X)];case 1:return e=t.sent(),this.idMapping.idSchema===s.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(e)];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},this.getGames=function(e,t){return r(n,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return t=t||!1,n=this.predictorService.initGameFilters("TOP_X",e),[4,this.predictorHttps.getGames(n,t)];case 1:return r=i.sent(),[4,this.predictorService.remapMatchIdsFixtures(r)];case 2:return[2,i.sent()]}}))}))},this.getGameById=function(e,t){return r(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return t=t||!1,[4,this.predictorHttps.getGameById(e,t)];case 1:return n=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(n)];case 2:return[2,r.sent()]}}))}))},this.getGamePredictions=function(e,t,s){return r(n,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return s=s||!1,t&&(t.type&&delete t.type,t.status&&delete t.status,t=new h.default(t)),[4,this.predictorHttps.getGamePredictions(e,s,t)];case 1:return[2,n.sent()]}}))}))},this.getGameResults=function(e,t,s){return r(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return s=s||!1,t&&(t=new l.default(t)),[4,this.predictorHttps.getGameResults(e,s,t)];case 1:return n=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(n)];case 2:return[2,r.sent()]}}))}))},this.getCurrentGameResults=function(e){return r(n,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=e||!1,t={status:u.GameStatusEnum.OPEN,type:"TOP_X"},t=new l.default(t),[4,this.predictorHttps.getGames(t,e)];case 1:return n=i.sent(),r=this.predictorService.getCurrentGameId(n),[4,this.getGameResults(r,null,e)];case 2:return[2,i.sent().data[0]]}}))}))},this.play=function(e){return r(n,void 0,void 0,(function(){var t,n,r,a,o=this;return i(this,(function(i){switch(i.label){case 0:return t=new d.default(e),(t=this.predictorValidator.validateBodyFields("TOP_X",t)).fixtures=t.fixtures.map((function(e){return o.predictorValidator.validateFixture(e.matchId,e.market,e.prediction.value)})),this.idMapping.idSchema===s.IdSchemaEnum.NATIVE?[3,2]:(n=[],t.fixtures.forEach((function(e){return n.push(e.matchId)})),[4,this.predictorService.remapMatchIdToNative(n)]);case 1:r=i.sent(),t.fixtures.forEach((function(e){return e.matchId=r.shift()})),i.label=2;case 2:return[4,this.predictorHttps.makeFootballPrediction(t)];case 3:return(a=i.sent()).fixtures.forEach((function(e){e.matchId=e.matchModel.id})),[2,a]}}))}))},this.delete=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getMyGameEditions=function(e,t){return r(n,void 0,void 0,(function(){var n,r,s,a,o;return i(this,(function(i){switch(i.label){case 0:return e&&e.limit&&this.validateLimitFilterOnGames(e.limit),t=t||!1,n=this.predictorService.initGameTypePredictions("TOP_X",e),r=[],[4,this.predictorHttps.getMyPredictionsNoRemap(n)];case 1:return(s=i.sent()).data.length>0?(s.data.forEach((function(e){e.game_instance_id&&r.push(e.game_instance_id)})),a=this.predictorService.initGameFilters("TOP_X",null,r),[4,this.predictorHttps.getUserGameEditions(a,t)]):[3,4];case 2:return o=i.sent(),[4,this.predictorService.addPredictionProp(s,o)];case 3:return[2,i.sent()];case 4:return[2,new c.default]}}))}))},this.getMyGamePrediction=function(e){return r(n,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=this.predictorService.initGameTypePredictions("TOP_X"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return(n=i.sent()).data.length>0?[2,(r=n.data.filter((function(t){return t.gameInstanceId===e}))).length?r[0]:null]:[2,null]}}))}))},this.getUserGameEditions=function(e,t,s){return r(n,void 0,void 0,(function(){var n,r,a,o,u;return i(this,(function(i){switch(i.label){case 0:return t&&t.limit&&this.validateLimitFilterOnGames(t.limit),s=s||!1,n=this.predictorService.initGameTypePredictions("TOP_X",t),r=[],[4,this.predictorHttps.getUserPredictionsNoRemap(e,n)];case 1:return(a=i.sent()).data.length>0?(a.data.forEach((function(e){e.game_instance_id&&r.push(e.game_instance_id)})),o=this.predictorService.initGameFilters("TOP_X",null,r),[4,this.predictorHttps.getUserGameEditions(o,s)]):[3,4];case 2:return u=i.sent(),[4,this.predictorService.addPredictionProp(a,u)];case 3:return[2,i.sent()];case 4:return[2,new c.default]}}))}))},this.getUserGamePrediction=function(e,t,s){return r(n,void 0,void 0,(function(){var n,r,a;return i(this,(function(i){switch(i.label){case 0:return s=s||!1,n=this.predictorService.initGameTypePredictions("TOP_X"),[4,this.predictorHttps.getUserPredictions(e,s,n)];case 1:return(r=i.sent()).data.length>0?[2,(a=r.data.filter((function(e){return e.gameInstanceId===t}))).length?a[0]:null]:[2,null]}}))}))},this.getMarketsResultsForGame=function(e,t){return r(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getMarketResultsForGame(e,t)];case 1:return n=r.sent(),[4,this.predictorService.completeGameMarketResults(n,"TOP_X")];case 2:return[2,r.sent()]}}))}))},this.getGameWinners=function(e){return r(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(e)];case 1:return t=r.sent(),[4,this.getGameById(e)];case 2:return n=r.sent(),t.contestModel=n,[2,this.predictorService.completeContestWinners(t)]}}))}))},this.validateLimitFilterOnGames=function(e){if("default"===n.errorHandlingMode&&e>50)throw new m.default(g.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,y.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED);if("standard"===n.errorHandlingMode&&e>50)throw new w.default(g.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,y.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED).response},this.idMapping=t,this.errorHandlingMode=e.errorHandlingMode,this.predictorValidator=new f.default(e.errorHandlingMode),this.predictorHttps=new a.default(e,t),this.predictorService=new o.default(e,t),this.clientHttps=new p.default(e)}},1180:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.enabled=!1,this.minFixtures=null,this.maxFixtures=null,this.competitionsWhitelist=null}},7482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6899);t.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default}},5967:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6899),i=n(3381);t.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default,this.prediction=new i.default}},6247:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.adContent=null,t.labels=null,t.customFields=null,t}return i(t,e),t}(n(3751).default);t.default=s},6890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.userId=null,this.points=null,this.results=[],this.tiebreaker=null}},6160:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.matchId=null,this.matchModel=null,this.outcome=null}},7299:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=n(4800),a=n(853),o=function(e){function t(t){var n=e.call(this,t)||this;return n.status=null,n.type=null,n.gameIds=null,n.sortOrder=null,n.constructFiltersUrl=function(){var t=e.prototype.constructMainFiltersUrl.call(n);return n.status&&Object.values(a.GameStatusEnum).includes(n.status)&&(t+="&",t+="status="+n.status),n.type&&(t+="&",t+="type="+n.type),n.gameIds&&n.gameIds.length>0&&(t+="&",t+="game_ids="+n.gameIds.join(",")),n.sortOrder&&(t+="&",t+="sort_order="+n.sortOrder),t},n.status=t.status?t.status:null,n.type=t.type?t.type:null,n.gameIds=t.gameIds?t.gameIds:null,n.sortOrder=t.sortOrder?t.sortOrder:null,n}return i(t,e),t}(s.default);t.default=o},3751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(439),i=n(4916);t.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.scheduleOpenAt=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new i.default,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.images=new r.default,this.createdAt=null,this.updatedAt=null}},4780:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7482),i=n(8410),s=n(5967),a=n(6890),o=n(6160),u=n(3751),l=n(7243),c=n(8950),d=n(7640),h=n(1553),p=n(670),f=n(7974),m=n(4916),v=n(3483),y=n(1784),g=n(824),w=n(6899),b=n(6247);t.default=function(){var e=this;this.remapPaginatedGames=function(t){var n=new h.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapGamesListResponse(t)})),n},this.remapGamesListResponse=function(t){var n=new u.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.scheduleOpenAt=t.schedule_open_at,n.predictionsCutoff=t.predictions_cutoff,n.fixtures=t.fixtures.map((function(t){return e.remapFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapGameByIdResponse=function(t){var n=new b.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.scheduleOpenAt=t.schedule_open_at,n.predictionsCutoff=t.predictions_cutoff,n.fixtures=t.fixtures.map((function(t){return e.remapFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.adContent=t.ad_content,n.labels=t.labels,n.customFields=t.custom_fields,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapFixturesResponse=function(e){var t=new r.default;return t.matchId=e.match_id,t.matchType=e.match_type,t.market=e.market,t.matchStatus.type=e.match_status.type,t.matchStatus.subType=e.match_status.sub_type,t},this.remapPaginatedUserTopXEditions=function(t){var n=new h.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapUserTopXEditionsResponse(t)})),n},this.remapUserTopXEditionsResponse=function(t){var n=new c.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.predictionsCutoff=t.predictions_cutoff,n.scheduleOpenAt=t.schedule_open_at,n.fixtures=t.fixtures.map((function(t){return e.remapTopXFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapTopXFixturesResponse=function(e){var t=new s.default;return t.matchId=e.match_id,t.matchType=e.match_type,t.market=e.market,t.matchStatus.type=e.match_status.type,t.matchStatus.subType=e.match_status.sub_type,t},this.remapPaginatedUserMathQuizEditions=function(t){var n=new h.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapUserMatchQuizEditionsResponse(t)})),n},this.remapUserMatchQuizEditionsResponse=function(t){var n=new l.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.predictionsCutoff=t.predictions_cutoff,n.scheduleOpenAt=t.schedule_open_at,n.fixtures=t.fixtures.map((function(t){return e.remapMatchQuizFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapMatchQuizFixturesResponse=function(e){var t=new i.default;return t.matchId=e.match_id,t.matchType=e.match_type,t.market=e.market,t.matchStatus.type=e.match_status.type,t.matchStatus.subType=e.match_status.sub_type,t},this.remapPaginatedGameResults=function(t){var n=new h.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapGameResults(t)})),n},this.remapGameResults=function(t){var n=new a.default;return n.userId=t.user_id,n.points=t.points?t.points:0,n.results=t.results.map((function(t){return e.remapResults(t)})),n.tiebreaker=t.tiebreaker?e.remapTiebreaker(t.tiebreaker):null,n},this.remapGameMarketsResults=function(t){var n=new p.default;return n.gameId=t.game_id,n.results=e.remapMarketsResults(t.results),n.tieBreakers=t.tie_breakers?e.remapTieBreakers(t.tie_breakers):null,n},this.remapContestWinners=function(t){var n=new y.default;return n.contestId=t.contest_id,n.contestType=t.contest_type,n.description=t.description,n.userList=t.user_list.map((function(t){return e.remapUserListWinners(t)})),n},this.remapUserListWinners=function(e){var t=new g.default;return t.position=e.position,t.profileId=e.profile_id,t.note=e.note,t.tags=e.tags,t},this.remapTieBreakers=function(e){var t={goldenGoals:[]};return t.goldenGoals=e.golden_goals.map((function(e){return{minute:e.minute,matchId:e.match_id,matchModel:null,playerId:e.player_id,playerModel:null,goalType:e.goal_type}})),t},this.remapMarketsResults=function(t){var n=[];return t.forEach((function(t){var r={matchId:t.match_id,market:t.market,result:e.remapMarketResult(t.market,t.result),matchModel:null,playerModels:[],matchStatus:e.remapMarketsResultsMatchStatus(t.match_status)};n.push(e.deleteUnusefulField(r))})),n},this.remapMarketsResultsMatchStatus=function(e){var t=new w.default;return t.type=e.type,t.subType=e.sub_type,t},this.remapMarketResult=function(e,t){return f.endMarkMarkets.includes(e)?t[0]:f.playerMarkets.includes(e)?t:"true"===t[0]||"false"!==t[0]&&void 0},this.deleteUnusefulField=function(t){return f.playerMarkets.includes(t.market)&&!e.isPlayerMarketWithNoResult(t.market,t.result)||delete t.playerModels,t},this.isPlayerMarketWithNoResult=function(e,t){return f.playerMarkets.includes(e)&&0===t.length},this.remapResults=function(e){var t=new o.default;return t.matchId=e.match_id,t.outcome=e.outcome,t},this.remapTiebreaker=function(e){var t=new d.default;return t.goldenGoal=e.golden_goal,t},this.remapTimeTiebreaker=function(e){var t=new m.default;return t.timeTiebreaker=e,t},this.remapRelated=function(e){return e.map((function(e){var t=new v.default;return t.entityId=e.entity_id,t.entityType=e.entity_type,t}))}}},8950:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4916),i=n(7640);t.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.outcome=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new r.default,this.predictionId=null,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.points=null,this.createdAt=null,this.updatedAt=null,this.predictionsMadeAt=null,this.scheduleOpenAt=null,this.images=null,this.predictionTiebreaker=new i.default}},7640:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.goldenGoal=null}},4916:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.timeTiebreaker=!1}},1784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.contestId="",this.contestType="GAME",this.contestModel=null,this.description="",this.userList=[]}},824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.position="",this.profileId="",this.profileModel=null,this.note="",this.tags=[]}},3381:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null,this.result=null}},1399:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1465);t.default=function(e){var t=this;this.gameInstanceId=null,this.fixtures=[],this.tiebreaker=null,this.gameInstanceId=e.gameInstanceId,e.fixtures.forEach((function(e){return t.fixtures.push(new r.default(e.matchId,e.market,e.prediction.value))})),this.tiebreaker=e.tiebreaker?e.tiebreaker:null}},9596:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8900),a=n(9502);t.default=function(e){var t=this;this.topXFacade=null,this.idMapping=null,this.getConfig=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getConfig()];case 1:return[2,e.sent()]}}))}))},this.getGames=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGames(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGameById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGameById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGamePredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGamePredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getGameResults=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGameResults(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getCurrentGameResults=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getCurrentGameResults(e)];case 1:return[2,t.sent()]}}))}))},this.play=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.play(e)];case 1:return[2,t.sent()]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.delete(e)];case 1:return[2,t.sent()]}}))}))},this.getMyGameEditions=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getMyGameEditions(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMyGamePrediction=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getMyGamePrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getUserGameEditions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getUserGameEditions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserGamePrediction=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getUserGamePrediction(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getMarketsResultsForGame=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getMarketsResultsForGame(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGameWinners=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGameWinners(e)];case 1:return[2,t.sent()]}}))}))},this.idMapping=new s.default(e),this.topXFacade=new a.default(e,this.idMapping)}},4806:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(4946),o=n(817),u=n(5409),l=n(5156);t.default=function(e,t,n){var c=this;this.idMapping=null,this.idSchema=null,this.native=a.IdSchemaEnum.NATIVE,this.footballFacade=null,this.remapSuccessRatesEntities=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.successRates,n={competition:this.getIdsKeys(t.byFootballCompetition),team:this.getIdsKeys(t.byFootballTeam)},Object.values(n.competition).length?(r=e.successRates.byFootballCompetition,i=e.successRates,[4,this.setModels(r,n.competition,o.EntityTypeEnum.COMPETITION)]):[3,2];case 1:i.byFootballCompetition=s.sent(),s.label=2;case 2:return Object.values(n.team).length?(a=e.successRates.byFootballTeam,u=e.successRates,[4,this.setModels(a,n.team,o.EntityTypeEnum.TEAM)]):[3,4];case 3:u.byFootballTeam=s.sent(),s.label=4;case 4:return[2,e]}}))}))},this.setModels=function(e,t,n){return i(c,void 0,void 0,(function(){var i,a;return s(this,(function(s){switch(s.label){case 0:switch(i=null,n){case"competition":return[3,1];case"team":return[3,3]}return[3,5];case 1:return[4,this.footballFacade.getCompetitionsMapWithNativeIds(t)];case 2:case 4:return i=s.sent(),[3,5];case 3:return[4,this.footballFacade.getTeamsMapWithNativeIds(t)];case 5:return Object.keys(e).forEach((function(t){var n,s=i.get(t);(a=r(r({},a),((n={})[s.id]=e[t],n)))[s.id].model=s})),[2,a]}}))}))},this.getIdsKeys=function(e){var t=JSON.parse(JSON.stringify(e));return Object.keys(t)},this.remapInterestsToIdSchema=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i,a,o,l,c,d,h,p,f;return s(this,(function(s){switch(s.label){case 0:return this.idSchema===this.native?[3,3]:e&&e.length>0?(t={},n={},r=e.filter((function(e){return e.source.toLocaleUpperCase()===u.SportSourceEnum.FOOTBALL})),i=e.filter((function(e){return e.source.toLocaleUpperCase()!==u.SportSourceEnum.FOOTBALL})),r.forEach((function(e){t.hasOwnProperty(e.type)||(t[e.type]=[],n[e.type]=[]),t[e.type].push(e.id),n[e.type].push(e)})),[4,this.remapIdsObj(t,this.native,this.idSchema)]):[3,2];case 1:for(a=s.sent(),o=[],l=function(e,t){t.forEach((function(t,n){t.id=a[e][n],o.push(t)}))},c=0,d=Object.entries(n);c<d.length;c++)h=d[c],p=h[0],f=h[1],l(p,f);return[2,o.concat(i)];case 2:case 3:return[2,e]}}))}))},this.remapInterestToNative=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return this.idSchema===this.native||e.source.toLocaleUpperCase()!==u.SportSourceEnum.FOOTBALL?[3,2]:(t={},n=e.id,r=e.type,t[r]=[n],[4,this.remapIdsObj(t,this.idSchema,this.native)]);case 1:return i=s.sent(),e.id=i[r][0],[2,e];case 2:return[2,e]}}))}))},this.inquiryCustomInterests=function(e,t){var n=[];return e&&e.length>0&&(n=e.filter((function(e){return e.source.toLocaleUpperCase()===u.SportSourceEnum.CUSTOM})),t)?n.map((function(e){var t=new l.default;return t.id=e.id,t.type=e.type,t.source=e.source,t.favourite=e.favourite,t})):n},this.remapInterests=function(e){return i(c,void 0,void 0,(function(){var t,n,r;return s(this,(function(i){switch(i.label){case 0:return(t=this.inquiryCustomInterests(e,!1))&&t.length>0?(n=e.filter((function(e){return e.source.toLocaleUpperCase()!==u.SportSourceEnum.CUSTOM})),[4,this.remapInterestsToIdSchema(n)]):[3,2];case 1:return r=i.sent(),t.forEach((function(e){return r.push(e)})),[2,r];case 2:return[4,this.remapInterestsToIdSchema(e)];case 3:return[2,i.sent()]}}))}))},this.showFullInterests=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i,a,l,c,d;return s(this,(function(s){switch(s.label){case 0:return t=[],e&&e.length>0?(n=this.inquiryCustomInterests(e,!0),t.push(n),r=e.filter((function(e){return e.source.toLocaleUpperCase()!==u.SportSourceEnum.CUSTOM})),[4,this.getInterestsEntitiesMap(r)]):[3,2];case 1:return i=s.sent(),a=i.competitionsMap,l=i.teamsMap,c=i.playersMap,d=r.map((function(e){var t=null;return e.source.toLocaleUpperCase()!==u.SportSourceEnum.FOOTBALL?(e.model=t,e):e.type===o.EntityTypeEnum.COMPETITION?((t=a.get(e.id))&&(e.id=t.id),e.model=t,e):e.type===o.EntityTypeEnum.TEAM?((t=l.get(e.id))&&(e.id=t.id),e.model=t,e):e.type===o.EntityTypeEnum.PLAYER?(c?(e.model=c[e.id],e.id=c[e.id].id):e.model=t,e):void 0})),t.push(d),[2,t.flat()];case 2:return[2,t]}}))}))},this.getInterestsEntitiesMap=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i,a,l;return s(this,(function(s){switch(s.label){case 0:return t=[],n=[],r=[],i=new Map,a=new Map,l=null,e.forEach((function(e){e.type===o.EntityTypeEnum.COMPETITION&&e.source.toLocaleUpperCase()===u.SportSourceEnum.FOOTBALL?t.push(e.id):e.type===o.EntityTypeEnum.TEAM&&e.source.toLocaleUpperCase()===u.SportSourceEnum.FOOTBALL?n.push(e.id):e.type===o.EntityTypeEnum.PLAYER&&e.source.toLocaleUpperCase()===u.SportSourceEnum.FOOTBALL&&r.push(e.id)})),t.length?[4,this.footballFacade.getCompetitionsMapWithNativeIds(t)]:[3,2];case 1:i=s.sent(),s.label=2;case 2:return n.length?[4,this.footballFacade.getTeamsMapWithNativeIds(n)]:[3,4];case 3:a=s.sent(),s.label=4;case 4:return r.length?[4,this.footballFacade.getPlayersMapWithNativeIds(r)]:[3,6];case 5:l=s.sent(),s.label=6;case 6:return[2,{competitionsMap:i,teamsMap:a,playersMap:l}]}}))}))},this.remapIdsObj=function(e,t,n){return i(c,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.idMapping.idMappingFacade.getEntitiesByIds(e,t,n)];case 1:return[2,r.sent()]}}))}))},this.idMapping=n,this.idSchema=e.idSchema,this.footballFacade=t}},4912:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8900),a=n(4806);t.default=function(e,t){var n=this;this.idMapping=null,this.profileOperations=null,this.remapSuccessRatesEntities=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileOperations.remapSuccessRatesEntities(e)];case 1:return[2,t.sent()]}}))}))},this.remapInterestToNative=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileOperations.remapInterestToNative(e)];case 1:return[2,t.sent()]}}))}))},this.remapInterests=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileOperations.remapInterests(e)];case 1:return[2,t.sent()]}}))}))},this.showFullInterests=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileOperations.showFullInterests(e)];case 1:return[2,t.sent()]}}))}))},this.idMapping=new s.default(e),this.profileOperations=new a.default(e,t,this.idMapping)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.FansUnitedSDK=void 0;var t=n(6409),i=n(6595),s=n(8808),a=n(4946),o=n(1259),u=n(2962),l=n(9627),c=n(2671),d=n(9377),h=n(9596),p=n(267),f=n(7302),m=n(2141),v=n(7070),y=n(9580);e.FansUnitedSDK=function(e){var n=(new i.default).validate(e);if(n.idSchema.validation!==l.ValidationResponseEnum.MISSING_VALUE&&n.idSchema.validation!==l.ValidationResponseEnum.INVALID_VALUE||(console.warn(n.idSchema.message.text),e.idSchema=a.IdSchemaEnum.NATIVE),n.environment.validation!==l.ValidationResponseEnum.MISSING_VALUE&&n.environment.validation!==l.ValidationResponseEnum.INVALID_VALUE||(console.warn(n.environment.message.text),e.environment=c.EnvironmentEnum.PROD),n.lang.validation!==l.ValidationResponseEnum.MISSING_VALUE&&n.lang.validation!==l.ValidationResponseEnum.INVALID_VALUE||(console.warn(n.lang.message.text),e.lang=d.LangEnum.EN),n.errorHandlingMode.validation!==l.ValidationResponseEnum.MISSING_VALUE&&n.errorHandlingMode.validation!==l.ValidationResponseEnum.INVALID_VALUE||(console.warn(n.errorHandlingMode.message.text),e.errorHandlingMode=y.ErrorHandlingModeEnum.DEFAULT),n.authProvider.validation===l.ValidationResponseEnum.INVALID_VALUE&&console.warn(n.authProvider.message.text),n.isValid)return{profile:new t.default(e),football:new s.default(e),predictor:new o.default(e),loyalty:new u.default(e),topX:new h.default(e),matchQuiz:new p.default(e),activity:new f.default(e)};g(n)};var g=function(e){var t="authProvider",n="isValid";Object.keys(e).forEach((function(r){var i=e[r];if(r!==n&&r!==t){if(i.message.type===m.LogEnum.ERROR)throw new Error(i.message.text)}else r!==n&&r===t&&Object.keys(new v.default).forEach((function(e){if(i[e].message.type===m.LogEnum.ERROR)throw new Error(i[e].message.text)}))}))}})(),r})()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FansUnitedSDK=t():e.FansUnitedSDK=t()}(self,(function(){return(()=>{var e={9669:(e,t,n)=>{e.exports=n(1609)},5448:(e,t,n)=>{"use strict";var r=n(4867),i=n(6026),s=n(4372),a=n(5327),o=n(4097),u=n(4109),l=n(7985),c=n(5061),d=n(5655),h=n(5263);e.exports=function(e){return new Promise((function(t,n){var p,f=e.data,m=e.headers,v=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}r.isFormData(f)&&delete m["Content-Type"];var g=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(w+":"+_)}var b=o(e.baseURL,e.url);function E(){if(g){var r="getAllResponseHeaders"in g?u(g.getAllResponseHeaders()):null,s={data:v&&"text"!==v&&"json"!==v?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g};i((function(e){t(e),y()}),(function(e){n(e),y()}),s),g=null}}if(g.open(e.method.toUpperCase(),a(b,e.params,e.paramsSerializer),!0),g.timeout=e.timeout,"onloadend"in g?g.onloadend=E:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(E)},g.onabort=function(){g&&(n(c("Request aborted",e,"ECONNABORTED",g)),g=null)},g.onerror=function(){n(c("Network Error",e,null,g)),g=null},g.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||d.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(c(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",g)),g=null},r.isStandardBrowserEnv()){var I=(e.withCredentials||l(b))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;I&&(m[e.xsrfHeaderName]=I)}"setRequestHeader"in g&&r.forEach(m,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete m[t]:g.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(g.withCredentials=!!e.withCredentials),v&&"json"!==v&&(g.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&g.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&g.upload&&g.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){g&&(n(!e||e&&e.type?new h("canceled"):e),g.abort(),g=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),f||(f=null),g.send(f)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),i=n(1849),s=n(321),a=n(7185),o=function e(t){var n=new s(t),o=i(s.prototype.request,n);return r.extend(o,s.prototype,n),r.extend(o,n),o.create=function(n){return e(a(t,n))},o}(n(5655));o.Axios=s,o.Cancel=n(5263),o.CancelToken=n(4972),o.isCancel=n(6502),o.VERSION=n(7288).version,o.all=function(e){return Promise.all(e)},o.spread=n(8713),o.isAxiosError=n(6268),e.exports=o,e.exports.default=o},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),i=n(5327),s=n(782),a=n(3572),o=n(7185),u=n(4875),l=u.validators;function c(e){this.defaults=e,this.interceptors={request:new s,response:new s}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=o(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var i,s=[];if(this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)})),!r){var c=[a,void 0];for(Array.prototype.unshift.apply(c,n),c=c.concat(s),i=Promise.resolve(e);c.length;)i=i.then(c.shift(),c.shift());return i}for(var d=e;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{i=a(d)}catch(e){return Promise.reject(e)}for(;s.length;)i=i.then(s.shift(),s.shift());return i},c.prototype.getUri=function(e){return e=o(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(o(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,r){return this.request(o(r||{},{method:e,url:t,data:n}))}})),e.exports=c},782:(e,t,n)=>{"use strict";var r=n(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,n)=>{"use strict";var r=n(1793),i=n(7303);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,i,s){var a=new Error(e);return r(a,t,n,i,s)}},3572:(e,t,n)=>{"use strict";var r=n(4867),i=n(8527),s=n(6502),a=n(5655),o=n(5263);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new o("canceled")}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={};function i(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(e[n],t[n])}function a(e){if(!r.isUndefined(t[e]))return i(void 0,t[e])}function o(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(void 0,t[n])}function u(n){return n in t?i(e[n],t[n]):n in e?i(void 0,e[n]):void 0}var l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||s,i=t(e);r.isUndefined(i)&&t!==u||(n[e]=i)})),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867),i=n(5655);e.exports=function(e,t,n){var s=this||i;return r.forEach(n,(function(n){e=n.call(s,e,t)})),e}},5655:(e,t,n)=>{"use strict";var r=n(4867),i=n(6016),s=n(481),a={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=n(5448)),u),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(o(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(0,JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||i&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(a)})),e.exports=l},7288:e=>{e.exports={version:"0.24.0"}},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},5327:(e,t,n)=>{"use strict";var r=n(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(r.isURLSearchParams(t))s=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(i(t)+"="+i(e))})))})),s=a.join("&")}if(s){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,s,a){var o=[];o.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),r.isString(i)&&o.push("path="+i),r.isString(s)&&o.push("domain="+s),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,s,a={};return e?(r.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,n)=>{"use strict";var r=n(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var s={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new Error(i(r," has been removed"+(t?" in "+t:"")));return t&&!s[r]&&(s[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var s=r[i],a=t[s];if(a){var o=e[s],u=void 0===o||a(o,s,e);if(!0!==u)throw new TypeError("option "+s+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+s)}},validators:i}},4867:(e,t,n)=>{"use strict";var r=n(1849),i=Object.prototype.toString;function s(e){return"[object Array]"===i.call(e)}function a(e){return void 0===e}function o(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:o,isPlainObject:u,isUndefined:a,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:l,isStream:function(e){return o(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):s(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,(function(t,i){e[i]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},6245:(e,t,n)=>{"use strict";function r(e){this.message=e}n.r(t),n.d(t,{default:()=>o,InvalidTokenError:()=>a}),r.prototype=new Error,r.prototype.name="InvalidCharacterError";var i="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,a=0,o="";i=t.charAt(a++);~i&&(n=s%4?64*n+i:i,s++%4)?o+=String.fromCharCode(255&n>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};function s(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(i(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return i(t)}}function a(e){this.message=e}a.prototype=new Error,a.prototype.name="InvalidTokenError";const o=function(e,t){if("string"!=typeof e)throw new a("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(s(e.split(".")[n]))}catch(e){throw new a("Invalid token specified: "+e.message)}}},6595:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(682),i=n(2141),s=n(4241),a=n(6391),o=n(1512),u=n(4392),l=n(320),c=n(7631),d=n(6965),h=n(9158);t.default=function(){var e=this;this.validate=function(t){var n=e.checkFieldsForValues(t);return n.isValid=e.containsErrorMessage(n),n},this.checkFieldsForValues=function(e){for(var t=new c.default,n={apiKey:new o.default,environment:new a.default,idSchema:new u.default,clientId:new d.default,lang:new s.default,errorHandlingMode:new h.default,authProvider:new l.default},r=0,i=Object.entries(t);r<i.length;r++){var p=i[r],f=p[0];p[1],"isValid"!==f&&n[f].validate(e)}return Object.keys(n).forEach((function(r){t[r]=n[r].validate(e)})),t},this.containsErrorMessage=function(e){for(var t=!0,n=0,s=Object.entries(e);n<s.length;n++){var a=s[n],o=a[0],u=a[1];if(o!==r.ConfigFieldEnum.authProvider){if("isValid"!==o&&u.message.type===i.LogEnum.ERROR)return!1;if("isValid"!==o&&u.message.type===i.LogEnum.WARNING)return!0}else if(u.message.type===i.LogEnum.ERROR)return!1}return t}}},682:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigFieldEnum=void 0,(n=t.ConfigFieldEnum||(t.ConfigFieldEnum={})).apiKey="apiKey",n.environment="environment",n.idSchema="idSchema",n.clientId="clientId",n.lang="lang",n.authProvider="authProvider"},2671:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentEnum=void 0,(n=t.EnvironmentEnum||(t.EnvironmentEnum={})).DEV="dev",n.PROD="prod",n.STAGING="staging"},9580:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorHandlingModeEnum=void 0,(n=t.ErrorHandlingModeEnum||(t.ErrorHandlingModeEnum={})).DEFAULT="default",n.STANDARD="standard"},4946:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.IdSchemaEnum=void 0,(n=t.IdSchemaEnum||(t.IdSchemaEnum={})).NATIVE="native",n.ENETPULSE="enetpulse",n.SPORTRADAR="sportradar",n.SPORTAL_365="sportal365"},9377:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LangEnum=void 0,(n=t.LangEnum||(t.LangEnum={})).EN="en",n.BG="bg",n.RO="ro",n.EL="el"},2141:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogEnum=void 0,(n=t.LogEnum||(t.LogEnum={})).ERROR="error",n.WARNING="warning"},9028:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationMessageEnum=void 0,(n=t.ValidationMessageEnum||(t.ValidationMessageEnum={})).API_KEY="The field apiKey with valid value must be provided to use Fans United JS SDK",n.CLIENT_ID="The field clientId must be provided to use Fans United JS SDK",n.LANG_MISSING="If no lang is passed the default one will be set which is: en",n.LANG_INVALID="This lang value is not supported, the default one will be set which is: en",n.ID_SCHEMA_MISSING="If no idSchema is passed the default one will be set which is: native",n.ID_SCHEMA_INVALID="This idSchema value is not supported, the default one will be set which is: native",n.ENVIRONMENT_MISSING="If no environment is passed the default one will be set which is: prod",n.ENVIRONMENT_INVALID="This environment value is not supported, the default one will be set which is: prod",n.ERROR_HANDLING_MODE_MISSING="If no errorHandlingMode is passed the default one will be set which is: default",n.ERROR_HANDLING_MODE_INVALID="This errorHandlingMode value is not supported, the default one will be set which is: default",n.AUTH_PROVIDER_CONFIG_PROP_MISSING="The following property is missing from the authProvider object:",n.AUTH_PROVIDER_CONFIG_INVALID_PROP="You have passed a property which is not supported for the authentication provider:",n.AUTH_PROVIDER_CONFIG_MISSING="The field authProvider must be provided to use this SDK",n.AUTH_PROVIDER_CONFIG_MISSING_CONFIG="The field authProvider has missing properties"},9627:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationResponseEnum=void 0,(n=t.ValidationResponseEnum||(t.ValidationResponseEnum={})).MISSING_VALUE="missing",n.INVALID_VALUE="invalid",n.VALID_VALUE="valid"},7070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.getIdToken=null,this.logout=null}},2379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3220);t.default=function(){this.validation=null,this.message=new r.default,this.getIdToken={validation:null,message:new r.default},this.logout={validation:null,message:new r.default}}},7631:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3074);t.default=function(){this.apiKey=null,this.environment=null,this.idSchema=null,this.clientId=null,this.lang=null,this.errorHandlingMode=null,this.authProvider={getIdToken:new r.default,logout:new r.default},this.isValid=!1}},3220:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.text=null,this.type=null}},3074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},1512:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=function(){function e(){this.validateField=function(e){return null!=e&&e.length>0?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=s.LogEnum.ERROR;return e===r.ValidationResponseEnum.MISSING_VALUE&&(t=i.ValidationMessageEnum.API_KEY),e===r.ValidationResponseEnum.VALID_VALUE&&(n=null),{text:t,type:n}}}return e.prototype.validate=function(e){var t=this.validateField(e.apiKey);return{validation:t,message:this.generateMessage(t)}},e}();t.default=a},320:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=n(7070),o=n(2379),u=function(){function e(){this.validateAuthProvider=function(e){var t=Object.keys(new a.default),n=new o.default;if(e){var u=Object.keys(e).filter((function(e){return!t.includes(e)}));u.length>0?(n.validation=r.ValidationResponseEnum.INVALID_VALUE,n.message.type=s.LogEnum.WARNING,n.message.text=i.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_INVALID_PROP+" "+u.join(",")):n.validation=r.ValidationResponseEnum.VALID_VALUE}else n.validation=r.ValidationResponseEnum.MISSING_VALUE,n.message.type=s.LogEnum.ERROR,n.message.text=i.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_MISSING;return n},this.validateAuthProviderConfigFields=function(e,t){return Object.keys(new a.default).forEach((function(n){e[n]?t[n].validation=r.ValidationResponseEnum.VALID_VALUE:t[n].validation=r.ValidationResponseEnum.MISSING_VALUE})),t},this.generateAuthProviderConfigMessages=function(e){return Object.keys(e).filter((function(e){return"validation"!==e&&"message"!==e})).forEach((function(t){var n=e[t];n.validation===r.ValidationResponseEnum.MISSING_VALUE&&(n.message.text=i.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_PROP_MISSING+" "+t,n.message.type=s.LogEnum.ERROR)})),e},this.checkAuthProviderConfigMessagesForErrors=function(e){return Object.keys(e).filter((function(e){return"validation"!==e&&"message"!==e})).forEach((function(t){e[t].validation===r.ValidationResponseEnum.MISSING_VALUE&&e.validation===r.ValidationResponseEnum.VALID_VALUE&&(e.validation=r.ValidationResponseEnum.INVALID_VALUE,e.message.type=s.LogEnum.ERROR,e.message.text=i.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_MISSING_CONFIG)})),e}}return e.prototype.validate=function(e){var t=this.validateAuthProvider(e.authProvider);return t.validation!==r.ValidationResponseEnum.MISSING_VALUE&&(t=this.validateAuthProviderConfigFields(e.authProvider,t),t=this.generateAuthProviderConfigMessages(t),t=this.checkAuthProviderConfigMessagesForErrors(t)),t},e}();t.default=u},6965:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=function(){function e(){this.validateField=function(e){return null!=e&&e.length>0?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=s.LogEnum.ERROR;return e===r.ValidationResponseEnum.MISSING_VALUE&&(t=i.ValidationMessageEnum.CLIENT_ID),e===r.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}return e.prototype.validate=function(e){var t=this.validateField(e.clientId);return{validation:t,message:this.generateMessage(t)}},e}();t.default=a},6391:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=n(2671),o=function(){function e(){this.validateField=function(e){var t=[a.EnvironmentEnum.DEV,a.EnvironmentEnum.STAGING,a.EnvironmentEnum.PROD];return null!=e&&e.length>0?t.includes(e)?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.INVALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=s.LogEnum.WARNING;return e===r.ValidationResponseEnum.MISSING_VALUE&&(t=i.ValidationMessageEnum.ENVIRONMENT_MISSING),e===r.ValidationResponseEnum.INVALID_VALUE&&(t=i.ValidationMessageEnum.ENVIRONMENT_INVALID),e===r.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}return e.prototype.validate=function(e){var t=this.validateField(e.environment);return{validation:t,message:this.generateMessage(t)}},e}();t.default=o},9158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9580),i=n(2141),s=n(9028),a=n(9627);t.default=function(){var e=this;this.validate=function(t){var n=e.validateField(t.errorHandlingMode);return{validation:n,message:e.generateMessage(n)}},this.validateField=function(e){var t=[r.ErrorHandlingModeEnum.DEFAULT,r.ErrorHandlingModeEnum.STANDARD];return e?t.includes(e)?a.ValidationResponseEnum.VALID_VALUE:a.ValidationResponseEnum.INVALID_VALUE:a.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=i.LogEnum.WARNING;return e===a.ValidationResponseEnum.MISSING_VALUE&&(t=s.ValidationMessageEnum.ERROR_HANDLING_MODE_MISSING),e===a.ValidationResponseEnum.INVALID_VALUE&&(t=s.ValidationMessageEnum.ERROR_HANDLING_MODE_INVALID),e===a.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}},4392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9627),i=n(9028),s=n(2141),a=n(4946),o=function(){function e(){this.validateField=function(e){var t=[a.IdSchemaEnum.NATIVE,a.IdSchemaEnum.SPORTAL_365,a.IdSchemaEnum.ENETPULSE,a.IdSchemaEnum.SPORTRADAR];return null!=e&&e.length>0?t.includes(e)?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.INVALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=s.LogEnum.WARNING;return e===r.ValidationResponseEnum.MISSING_VALUE&&(t=i.ValidationMessageEnum.ID_SCHEMA_MISSING),e===r.ValidationResponseEnum.INVALID_VALUE&&(t=i.ValidationMessageEnum.ID_SCHEMA_INVALID),e===r.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}return e.prototype.validate=function(e){var t=this.validateField(e.idSchema);return{validation:t,message:this.generateMessage(t)}},e}();t.default=o},4241:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9377),i=n(9627),s=n(9028),a=n(2141);t.default=function(){var e=this;this.validate=function(t){var n=e.validateField(t.lang);return{validation:n,message:e.generateMessage(n)}},this.validateField=function(e){var t=[r.LangEnum.BG,r.LangEnum.RO,r.LangEnum.EN,r.LangEnum.EL];return null!=e&&e.length>0?t.includes(e)?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.INVALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(e){var t=null,n=a.LogEnum.WARNING;return e===i.ValidationResponseEnum.MISSING_VALUE&&(t=s.ValidationMessageEnum.LANG_MISSING),e===i.ValidationResponseEnum.INVALID_VALUE&&(t=s.ValidationMessageEnum.LANG_INVALID),e===i.ValidationResponseEnum.VALID_VALUE&&(t=null,n=null),{text:t,type:n}}}},4021:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCodes=void 0,(n=t.ErrorCodes||(t.ErrorCodes={}))[n.BAD_METHOD_CALL=400]="BAD_METHOD_CALL",n[n.UNAUTHORIZED=401]="UNAUTHORIZED"},4904:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorStatuses=void 0,(n=t.ErrorStatuses||(t.ErrorStatuses={})).INVALID_TEMPLATE="INVALID_TEMPLATE",n.INVALID_PREDICTION="INVALID_PREDICTION",n.INVALID_MARKET="INVALID_MARKET",n.INVALID_FIELD="INVALID_FIELD",n.INVALID_TYPE="INVALID_TYPE",n.EXCEEDED_LENGTH="EXCEEDED_LENGTH",n.INVALID_TOKEN="invalid_token",n.UNAUTHORIZED="unauthorized",n.INVALID_FILTERS="invalid_filters",n.INVALID_AVATAR="invalid_avatar"},8097:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t,n,r){var i=e.call(this)||this;return i.code=0,i.status=null,i.message=null,i.errorMessage=function(){return i.message},i.code=t,i.status=n,i.message=r,i}return r(t,e),t}(Error);t.default=i},2535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t,n){this.response={error:{code:0,status:"",message:""}},this.response.error.code=e,this.response.error.status=t,this.response.error.message=n}},1260:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validFixtureFields=t.documentationLinks=t.ID_TYPES=void 0,t.ID_TYPES={native:"id",sportradar:"sportradar_id",sportal365:"sportal365_id",enetpulse:"enetpulse_id"},t.documentationLinks={PREDICTOR_USER_RELATED_OPERATION:"https://docs.fansunitedmedia.com/docs/predictor-operations#user-related-operations"},t.validFixtureFields=["matchId","matchType","market","prediction"]},817:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EntityTypeEnum=void 0,(n=t.EntityTypeEnum||(t.EntityTypeEnum={})).COMPETITION="competition",n.TEAM="team",n.PLAYER="player"},5409:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SportSourceEnum=void 0,(n=t.SportSourceEnum||(t.SportSourceEnum={})).FOOTBALL="FOOTBALL",n.CUSTOM="CUSTOM"},712:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.constructStringArrayWithProvidedLength=t.sortArrayInAscOrder=t.initDisableCache=t.isDisabledCache=t.transformIdsToBeUnique=t.setBaseUrl=t.limitIds=t.requestChunkBuild=void 0;var r=n(2671);t.requestChunkBuild=function(e){var t=[],n=0;return t[n]=[],e.forEach((function(e){t[n].length<=199?t[n].push(e):(n++,t[n]=[e])})),t},t.limitIds=function(e,t){for(var n=[];e.length>t;){var r=e.splice(0,t);n.push(r)}return n.push(e),n},t.setBaseUrl=function(e,t){return e===r.EnvironmentEnum.PROD?{profile:"https://profile.fansunitedapi.com/v1",football:"https://football.fansunitedapi.com/v1",idMapping:"https://id-mapping.fansunitedapi.com/v1",predictor:"https://prediction.fansunitedapi.com/v1",client:"https://client.fansunitedapi.com/v1",loyalty:"https://loyalty.fansunitedapi.com/v1"}[t]:e===r.EnvironmentEnum.DEV?{profile:"http://localhost:8010/v1",football:"http://localhost:8080/v1",idMapping:"http://localhost:8030/v1",predictor:"http://localhost:8040/v1",client:"http://localhost:8070/v1",loyalty:"http://localhost:8060/v1"}[t]:{profile:"https://profile.fansunitedstagingapi.com/v1",football:"https://football.fansunitedstagingapi.com/v1",idMapping:"https://id-mapping.fansunitedstagingapi.com/v1",predictor:"https://prediction.fansunitedstagingapi.com/v1",client:"https://client.fansunitedstagingapi.com/v1",loyalty:"https://loyalty.fansunitedstagingapi.com/v1"}[t]},t.transformIdsToBeUnique=function(e){return e.filter((function(e,t,n){return t===n.indexOf(e)}))},t.isDisabledCache=function(e){return e||!1},t.initDisableCache=function(){return"&disable_cache="+Date.now()},t.sortArrayInAscOrder=function(e){return JSON.parse(JSON.stringify(e.sort((function(e,t){return e.localeCompare(t)}))))},t.constructStringArrayWithProvidedLength=function(e,t){for(var n=[],r=0;r<t;r++)n[r]=e;return n}},5601:function(e,t,n){"use strict";var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1260),s="FansUnited",a={football:{ids:[],countries:[],competitions:[],expirations:{ids:0}},profile:{info:{},statistics:{},badges:null,countries:[],expirations:{profile:0,statistics:0,badges:0}},client:{features:{},expirations:{features:0}}};t.default=function(e){var t=this;this.idSchema="",this.expirationProfileTimeout=600,this.expirationBadgesTimeout=3600,this.expirationClientFeaturesTimeout=14400,this.expirationFootballIdsTimeout=604800,this.clearData=function(){t.setData(a)},this.getEntityById=function(e,n){return void 0===e&&(e=""),void 0===n&&(n=""),t.getData().football.ids.find((function(r){var s=i.ID_TYPES[t.idSchema];return r&&""+r[s]===n&&r.resource===e}))},this.getEntity=function(e,n,r){return Array.isArray(e)?t.getData().football.ids.filter((function(t){var s=i.ID_TYPES[r];return t&&e.includes(""+t[s])&&t.resource===n})):t.getData().football.ids.find((function(t){var s=i.ID_TYPES[r];return t&&""+t[s]===e&&t.resource===n}))},this.getEntityByNativeId=function(e,n){return void 0===e&&(e=""),void 0===n&&(n=""),t.getData().football.ids.find((function(t){return t&&""+t.id===n&&t.resource===e}))},this.checkForExistingIdObjs=function(e,n){var r=i.ID_TYPES[n],s={};return Object.keys(e).forEach((function(i){var a=e[i],o=t.getEntity(a,i,n).map((function(e){return e[r]})),u=e[i].filter((function(e){return!o.includes(e)}));s[i]=a.map((function(e){return u.includes(e)?{id:e,exists:!1}:{id:e,exists:!0}}))})),s},this.getIdsByType=function(e,n,r){var s=i.ID_TYPES[r],a=i.ID_TYPES[n],o={};return Object.keys(e).forEach((function(n){var r=e[n],i=[];t.getData().football.ids.forEach((function(e){r.forEach((function(t,r){t===e[a]&&n===e.resource&&(i[r]=e[s])}))})),o[n]=i})),o},this.addIdMapping=function(e){var n=t.getData();n.football.ids.push(e),t.setData(n)},this.addIdMappings=function(e){var n=t.getData(),i=n.football.ids;i=r(r([],i,!0),e,!0),n.football.ids=i,t.setData(n)},this.addTopIdMappings=function(e){var n=t.getData();if(n.football.ids.length){var i=JSON.parse(JSON.stringify(n.football.ids));i=i.filter((function(e){return"match"!==e.resource})),e=e.filter((function(e){return"match"===e.resource})),i=r(r([],i,!0),e,!0),n.football.ids=i}else n.football.ids=e;n.football.expirations.ids=Math.floor(Date.now()/1e3)+t.expirationFootballIdsTimeout,t.setData(n)},this.setOwnProfile=function(e){var n=t.getData();n.profile.info=e,n.profile.expirations.profile=Math.floor(Date.now()/1e3)+t.expirationProfileTimeout,t.setData(n)},this.getOwnProfile=function(){return t.getData().profile.info},this.getProfileCountries=function(){return t.getData().profile.countries},this.setProfileCountries=function(e){var n=t.getData();n.profile.countries=e,t.setData(n)},this.getProfileStats=function(){return t.getData().profile.statistics},this.setProfileStats=function(e){var n=t.getData();n.profile.statistics=e,n.profile.expirations.statistics=Math.floor(Date.now()/1e3)+t.expirationProfileTimeout,t.setData(n)},this.getProfileBadges=function(){return t.getData().profile.badges},this.setProfileBadges=function(e){var n=t.getData();n.profile.badges=e,n.profile.expirations.badges=Math.floor(Date.now()/1e3)+t.expirationBadgesTimeout,t.setData(n)},this.getFootballCountries=function(){return t.getData().football.countries},this.setFootballCountries=function(e){var n=t.getData();n.football.countries=e,t.setData(n)},this.getCompetitions=function(e){var n=t.getData();return e?e.competitionSearchFilter(n.football.competitions):n.football.competitions},this.setCompetitions=function(e){var n=t.getData(),i=r([],n.football.competitions,!0);i.push.apply(i,e),n.football.competitions=t.makeCompetitionsUnique(i),t.setData(n)},this.getCompetitionsLength=function(){return t.getData().football.competitions.length},this.getClientFeatures=function(){return t.getData().client.features},this.setClientFeatures=function(e){var n=t.getData(),r=JSON.parse(JSON.stringify(e));n.client.expirations.features=Math.floor(Date.now()/1e3)+t.expirationClientFeaturesTimeout,n.client.features=r,t.setData(n)},this.deleteClientFeatures=function(){var e=t.getData(),n=JSON.parse(JSON.stringify(e));n.client={features:{},expirations:{features:0}},t.setData(n)},this.getExpiration=function(e,n){t.initialNewSchema(e,"expirations");var r=t.getData();switch(n){case"profile":return r.profile.expirations.profile;case"statistics":return r.profile.expirations.statistics;case"badges":return r.profile.expirations.badges;case"features":return r.client.expirations.features;case"ids":return r.football.expirations.ids}},this.makeCompetitionsUnique=function(e){var t=new Set;return e.filter((function(e){var n=!t.has(e.id);return t.add(e.id),n}))},this.getData=function(){return JSON.parse(localStorage.getItem(s))},this.setData=function(e){localStorage.setItem(s,JSON.stringify(e))},this.initialNewSchema=function(e,n){var r=t.getData();r&&r[e]&&r[e][n]||t.setData(a)},this.idSchema=e.idSchema,void 0!==this.getData()&&null!==this.getData()||this.setData(a)}},5318:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invalidTypeMessage=t.missingFieldsMessage=t.invalidFieldMessage=t.invalidMarketTopXMessage=t.invalidMarketMessage=t.invalidPredictionMessage=t.WarningMessages=t.ErrorMessages=void 0;var r,i=n(1260);(r=t.ErrorMessages||(t.ErrorMessages={})).LOYALTY_INVALID_TEMPLATE_ID="Provided template ID does NOT exist! Try again with existing template ID.",r.INVALID_MATCH_ID="Match id is invalid!",r.INVALID_PLAYER_ID="Player id is invalid!",r.QUERY_PARAM_MATCH_IDS_EXCEEDED="Maximum matchIds in PredictionFilters should be 10 or less.",r.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED="Maximum limit for filtering games is 50 or less.",r.INVALID_PREDICTION_FIELD="Prediction field is invalid. For more information please visit our documentation",r.INVALID_TOKEN="Invalid JWT token is provided",r.EXPIRED_TOKEN="The provided JWT token is expired",r.ENTITIES_NEEDED="At least one of footballCompetitions, footballTeams or footballPlayers properties should be provided for filters.",r.ENTITIES_FOLLOWS_FILTERS_EXCEEDED="Maximum length per entity should be 24 or less.",r.INVALID_TYPE="You have provided invalid type. The valid type is ",r.INVALID_VALUE="You have provided invalid value. The valid value is ",r.INVALID_AVATAR="Invalid URL syntax for avatar image.",t.WarningMessages={UNEXPECTED_STATUS_PROP:"Unexpected provided property 'status'. You can NOT use this property for this method. For more information visit our documentation: \n "+i.documentationLinks.PREDICTOR_USER_RELATED_OPERATION,UNEXPECTED_TYPE_PROP:"Unexpected provided property 'type'. You can NOT use this property for this method. For more information visit our documentation: \n "+i.documentationLinks.PREDICTOR_USER_RELATED_OPERATION},t.invalidPredictionMessage=function(e,t){return"The prediction '"+e+"' is invalid for market '"+t+"'. Please check again have you passed appropriate prediction model. For more information please visit our documentation: https://docs.fansunitedmedia.com/sdks/js/match.quiz#gamerelatedoperations"},t.invalidMarketMessage=function(e){return"The market '"+e+"' is not supported from Fans United. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/predictor-operations#make-football-prediction"},t.invalidMarketTopXMessage=function(e){return"The market '"+e+"' is not valid for Top X game. The only available market is CORRECT_SCORE."},t.invalidFieldMessage=function(e){return"The field/s '"+(e.length>1?e.join(", "):e[0])+"' is/are invalid. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/javascript-sdk"},t.missingFieldsMessage=function(e,t){return"The following field/s is/are missing from "+e+": '"+(t.length>1?t.join(", "):t[0])+"'. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/predictor-operations#make-football-prediction"},t.invalidTypeMessage=function(e,t){return"The field "+e+" has incorrect type. The correct type is "+t}},4800:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.limit=e.limit?e.limit:null,this.startAfter=e.startAfter?e.startAfter:null}return e.prototype.constructMainFiltersUrl=function(){var e="";return this.limit&&(e+="&",e+="limit="+this.limit),this.startAfter&&(e+="&",e+="start_after="+this.startAfter),e},e}();t.default=n},439:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.main=null,this.cover=null,this.mobile=null}},8872:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8902);t.default=function(){this.pagination=new r.default}},8902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.nextPageStartsAfter=null,this.itemsPerPage=null}},1553:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8872);t.default=function(){this.meta=new r.default,this.data=[]}},3623:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8872);t.default=function(){this.remapMetaData=function(e){var t=new r.default;return t.pagination.nextPageStartsAfter=e.pagination.next_page_starts_after,t.pagination.itemsPerPage=e.pagination.items_per_page,t}}},3483:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.entityId=null,this.entityType=null}},6208:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.axiosError=void 0,t.axiosError=function(e,t,n){var r={data:e.data,status:t,statusText:n,headers:e.headers,config:e};return{code:String(t),config:e,isAxiosError:!0,toJSON:function(){return{}},name:"Unauthorized",message:n,response:r}}},1022:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(2453),l=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"loyalty"))||this;return n.activityRemapper=null,n.createActivity=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),t="/activities"+this.apiSignInUrl,[4,this.instanceAuth.post(t,JSON.stringify(e))];case 1:return n=s.sent(),[2,this.activityRemapper.remapSingleResponse(n.data)];case 2:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem with creating activity for user",i),i.response;case 3:return[2]}}))}))},n.deleteActivity=function(e){return s(n,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t="/activities/"+e+this.apiSignInUrl,[4,this.instanceAuth.delete(t)];case 1:return i.sent(),[2,!0];case 2:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem deleting the following activity: "+e,r),r.response;case 3:return[2]}}))}))},n.getOwnActivities=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/activities"+this.apiSignInUrl,r=Date.now(),e&&(n+=""+e.constructFilterUrl()),t&&(n+="disable_cache="+r),[4,this.instanceAuth.get(n)];case 1:return i=a.sent(),[2,this.activityRemapper.remapActivitiesResponse(i.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with fetching own activities",o),o.response;case 3:return[2]}}))}))},n.getActivitiesForUser=function(e,t,r){return s(n,void 0,void 0,(function(){var n,i,s,o,u;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/users/"+e+"/activities"+this.apiSignInUrl,i=Date.now(),t&&(n+=""+t.constructFilterUrl()),r&&(n+="disable_cache="+i),[4,this.instance.get(n)];case 1:return s=a.sent(),[2,this.activityRemapper.remapActivitiesResponse(s.data)];case 2:throw o=a.sent(),u=this.transformAxiosErrorToFansUnitedException(o),console.warn("There was a problem with fetching activities for user "+e,u),u.response;case 3:return[2]}}))}))},n.getStats=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),n="",r=null,e?(n+=(0,o.isDisabledCache)(t)?"/users/"+e+"/statistics"+this.apiSignInUrl+(0,o.initDisableCache)():"/users/"+e+"/statistics"+this.apiSignInUrl,[4,this.instance.get(n)]):[3,2];case 1:return r=a.sent(),[3,4];case 2:return n+="/statistics"+this.apiSignInUrl,[4,this.instanceAuth.get(n)];case 3:r=a.sent(),a.label=4;case 4:return[2,this.activityRemapper.remapStatsReponse(r.data.data)];case 5:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching profile`s statistics:",s),s.response;case 6:return[2]}}))}))},n.activityRemapper=new u.default,n}return i(t,e),t}(n(7724).default);t.default=l},7686:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureConfigType=void 0;var o,u=n(712),l=n(704),c=n(7724),d=n(5601);(o=t.FeatureConfigType||(t.FeatureConfigType={})).PREDICTOR="predictor",o.TOP_X="topX",o.MATCH_QUIZ="matchQuiz",o.LOYALTY="loyalty";var h=function(e){function t(t){var n=e.call(this,t,(0,u.setBaseUrl)(t.environment,"client"))||this;return n.featureConfigRemapper=null,n.localStorage=null,n.clientId=null,n.getConfig=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(t=this.getCachedFeatures())?[3,2]:(n="/clients/"+this.clientId+"/features",r=this.apiSignInUrl.split("&")[0],[4,this.instance.get(""+n+r)]);case 1:i=a.sent(),t=i.data.data,this.localStorage.setClientFeatures(t),a.label=2;case 2:switch(e){case"predictor":return[2,this.featureConfigRemapper.remapPredictorConfig(t.predictor)];case"topX":return[2,this.featureConfigRemapper.remapTopXConfig(t.top_x)];case"matchQuiz":return[2,this.featureConfigRemapper.remapMatchQuizConfig(t.match_quiz)];case"loyalty":return[2,this.featureConfigRemapper.remapLoyaltyConfig(t.loyalty)]}return[3,4];case 3:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching configuration from Client API",o),o.response;case 4:return[2]}}))}))},n.getCachedFeatures=function(){var e=n.getLocalStorageData();if(e&&Object.keys(e).length)return e.predictor.client_id&&e.predictor.client_id!==n.clientId?(n.localStorage.deleteClientFeatures(),null):e},n.getLocalStorageData=function(){var e=Math.floor(Date.now()/1e3);return n.localStorage.getExpiration("client","features")>e?n.localStorage.getClientFeatures():null},n.clientId=t.clientId,n.localStorage=new d.default(t),n.featureConfigRemapper=new l.default,n}return i(t,e),t}(c.default);t.default=h},595:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(3430),l=n(7316),c=n(8758),d=n(5827),h=n(7821),p=n(5284),f=n(9330),m=n(4729),v=n(5157),y=n(7943),g=n(7287),w=n(753),_=n(1925),b=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"football"))||this;return n.limitIds=200,n.countryRemapper=null,n.competitionBasicRemapper=null,n.competitionFullRemapper=null,n.teamBasicRemapper=null,n.teamFullRemapper=null,n.matchBasicRemapper=null,n.matchFullRemapper=null,n.playerBasicRemapper=null,n.playerFullRemapper=null,n.topPlayerRemapper=null,n.searchRemapper=null,n.footballMetaRemapper=null,n.getCountries=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="/countries"+this.apiSignInUrl,n=Date.now(),e&&(t+="&disable_cache="+n),[4,this.instance.get(t)];case 1:return r=a.sent(),[2,this.countryRemapper.countriesFromResponse(r.data.data)];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem with the football countries request",s),s.response;case 3:return[2]}}))}))},n.getCompetitions=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,l,c,d,h,p,f=this;return a(this,(function(a){switch(a.label){case 0:if(a.trys.push([0,8,,9]),n={},r=Date.now(),t=t||!1,!(e&&e.competitionIds&&e.competitionIds.length>this.limitIds-1))return[3,5];i=[],s=(0,o.limitIds)(e.competitionIds,this.limitIds),u=0,l=s,a.label=1;case 1:return u<l.length?(c=l[u],e.competitionIds=c,d="/competitions"+this.apiSignInUrl+e.constructFilterUrl(),t&&(d+="&disable_cache="+r),[4,this.instance.get(d)]):[3,4];case 2:n=a.sent(),i.push(n.data.data.map((function(e){return f.competitionBasicRemapper.fromResponse(e)}))),a.label=3;case 3:return u++,[3,1];case 4:return[2,Array.prototype.concat.apply([],i)];case 5:return d="/competitions"+this.apiSignInUrl,e&&(d+=""+e.constructFilterUrl()),t&&(d+="&disable_cache="+r),[4,this.instance.get(d)];case 6:return[2,(n=a.sent()).data.data.map((function(e){return f.competitionBasicRemapper.fromResponse(e)}))];case 7:return[3,9];case 8:throw h=a.sent(),p=this.transformAxiosErrorToFansUnitedException(h),console.warn("There was a problem with getCompetitions request",p),p.response;case 9:return[2]}}))}))},n.getCompetitionById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/competitions/"+e+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.competitionFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getCompetitionById request",o),o.response;case 3:return[2]}}))}))},n.getTopCompetitions=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="/competitions/top"+this.apiSignInUrl,n=Date.now(),e&&(t+="&disable_cache="+n),[4,this.instance.get(t)];case 1:return[2,a.sent().data.data.map((function(e){return s.competitionBasicRemapper.fromResponse(e)}))];case 2:throw r=a.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem with getTopCompetitions request",i),i.response;case 3:return[2]}}))}))},n.getTeams=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,l,c,d,h,p,f,m=this;return a(this,(function(a){switch(a.label){case 0:if(a.trys.push([0,8,,9]),n={},r=Date.now(),!(e&&e.teamIds&&e.teamIds.length>this.limitIds))return[3,5];i=[],s=(0,o.limitIds)(e.teamIds,this.limitIds),u=0,l=s,a.label=1;case 1:return u<l.length?(c=l[u],e.teamIds=c,h="/teams"+this.apiSignInUrl+e.constructFilterUrl(),t&&(h+="disable_cache="+r),[4,this.instance.get(h)]):[3,4];case 2:n=a.sent(),i.push(n.data.data.map((function(e){return m.teamBasicRemapper.fromResponse(e)}))),a.label=3;case 3:return u++,[3,1];case 4:return[2,Array.prototype.concat.apply([],i)];case 5:return d=new w.default,h="/teams"+this.apiSignInUrl,e&&(h+=""+e.constructFilterUrl()),t&&(h+="&disable_cache="+r),[4,this.instance.get(h)];case 6:return n=a.sent(),d.meta=this.footballMetaRemapper.remapMetaProp(n.data.meta),d.data=n.data.data.map((function(e){return m.teamBasicRemapper.fromResponse(e)})),[2,d];case 7:return[3,9];case 8:throw p=a.sent(),f=this.transformAxiosErrorToFansUnitedException(p),console.warn("There was a problem with getTeams request",f),f.response;case 9:return[2]}}))}))},n.getTeamById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/teams/"+e+this.apiSignInUrl,r=Date.now(),t&&(n+="disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.teamFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getTeamById request",o),o.response;case 3:return[2]}}))}))},n.getTopTeams=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s,o=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="/teams/top"+this.apiSignInUrl,n=Date.now(),e&&(t+="$disable_cache="+n),[4,this.instance.get(t)];case 1:return[2,(r=a.sent()).data.data?r.data.data.map((function(e){return o.teamBasicRemapper.fromResponse(e)})):[]];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem with getTopTeams request",s),s.response;case 3:return[2]}}))}))},n.getNextMatchForTeam=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/teams/"+e+"/next-match"+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getNextMatchForTeam request",o),o.response;case 3:return[2]}}))}))},n.getPrevMatchForTeam=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/teams/"+e+"/previous-match"+this.apiSignInUrl,r=Date.now(),t&&(n+="disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getPrevMatchForTeam request",o),o.response;case 3:return[2]}}))}))},n.getPlayers=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,l,c,d,h,p,f,m=this;return a(this,(function(a){switch(a.label){case 0:if(a.trys.push([0,8,,9]),n={},r=Date.now(),!(e&&e.playerIds&&e.playerIds.length>this.limitIds-1))return[3,5];i=[],s=(0,o.limitIds)(e.playerIds,this.limitIds),u=0,l=s,a.label=1;case 1:return u<l.length?(c=l[u],e.playerIds=c,h="/players"+this.apiSignInUrl+e.constructFilterUrl(),t&&(h+="&disable_cache="+r),[4,this.instance.get(h)]):[3,4];case 2:n=a.sent(),i.push(n.data.data.map((function(e){return m.teamBasicRemapper.fromResponse(e)}))),a.label=3;case 3:return u++,[3,1];case 4:return[2,Array.prototype.concat.apply([],i)];case 5:return d=new w.default,h="/players"+this.apiSignInUrl,e&&(h+=""+e.constructFilterUrl()),t&&(h+="&disable_cache="+r),[4,this.instance.get(h)];case 6:return n=a.sent(),d.meta=this.footballMetaRemapper.remapMetaProp(n.data.meta),d.data=n.data.data.map((function(e){return m.playerBasicRemapper.fromResponse(e)})),[2,d];case 7:return[3,9];case 8:throw p=a.sent(),f=this.transformAxiosErrorToFansUnitedException(p),console.warn("There was a problem with getPlayers request",f),f.response;case 9:return[2]}}))}))},n.getPlayerById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/players/"+e+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.playerFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getPlayerById request",o),o.response;case 3:return[2]}}))}))},n.getTopPlayers=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="/players/top"+this.apiSignInUrl,n=Date.now(),e&&(t+="&disable_cache="+n),[4,this.instance.get(t)];case 1:return[2,a.sent().data.data.map((function(e){return s.topPlayerRemapper.fromResponse(e)}))];case 2:throw r=a.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem with getTopPlayers request",i),i.response;case 3:return[2]}}))}))},n.getNextMatchForPlayer=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/players/"+e+"/next-match"+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getNextMatchForPlayer request",o),o.response;case 3:return[2]}}))}))},n.getPrevMatchForPlayer=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/players/"+e+"/previous-match"+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getPrevMatchForPlayer request",o),o.response;case 3:return[2]}}))}))},n.getMatchById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/matches/"+e+this.apiSignInUrl,r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.matchFullRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with getMatchById request",o),o.response;case 3:return[2]}}))}))},n.getMatches=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o,u,l=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=new w.default,r="/matches"+this.apiSignInUrl,i=Date.now(),e&&(r+=""+e.constructFilterUrl()),t&&(r+="&disable_cache="+i),[4,this.instance.get(r)];case 1:return s=a.sent(),n.meta=this.footballMetaRemapper.remapMetaProp(s.data.meta),n.data=s.data.data.map((function(e){return l.matchBasicRemapper.fromResponse(e)})),[2,n];case 2:throw o=a.sent(),u=this.transformAxiosErrorToFansUnitedException(o),console.warn("There was a problem with getMatches request",u),u.response;case 3:return[2]}}))}))},n.search=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n="/search"+this.apiSignInUrl+e.constructFilterUrl(),r=Date.now(),t&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return i=a.sent(),[2,this.searchRemapper.fromResponse(i.data.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem with search request",o),o.response;case 3:return[2]}}))}))},n.apiSignInUrl="en"!==t.lang?n.apiSignInUrl+"&lang="+t.lang:n.apiSignInUrl,n.countryRemapper=new u.default,n.competitionBasicRemapper=new l.default,n.competitionFullRemapper=new c.default,n.teamBasicRemapper=new d.default,n.teamFullRemapper=new h.default,n.matchBasicRemapper=new p.default,n.matchFullRemapper=new f.default,n.playerBasicRemapper=new v.default,n.playerFullRemapper=new y.default,n.topPlayerRemapper=new m.default,n.searchRemapper=new g.default,n.footballMetaRemapper=new _.default,n}return i(t,e),t}(n(7724).default);t.default=b},7724:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9669),i=n(6245),s=n(4021),a=n(4904),o=n(2535),u=n(6208),l=n(5318);t.default=function(e,t){var n=this;this.apiSignInUrl=null,this.instanceAuth=null,this.instance=null,this.errorHandlingMode=null,this.transformAxiosErrorToFansUnitedException=function(e){if("standard"===n.errorHandlingMode&&e.response&&e.response.data&&e.response.data.error){var t=e.response.data.error,r=t.code,i=t.status,s=t.message;return new o.default(r,i,s)}return e},this.apiSignInUrl="?key="+e.apiKey+"&client_id="+e.clientId,this.errorHandlingMode=e.errorHandlingMode,this.instanceAuth=r.default.create({baseURL:t,headers:{Authorization:"Bearer "+e.authProvider.getIdToken(),"Content-Type":"application/json"}}),this.instanceAuth.interceptors.request.use((function(t){var c=null;try{c=(0,i.default)(e.authProvider.getIdToken())}catch(e){if("default"===n.errorHandlingMode)throw(0,u.axiosError)(t,401,e.message);if("standard"===n.errorHandlingMode)throw new o.default(s.ErrorCodes.UNAUTHORIZED,a.ErrorStatuses.INVALID_TOKEN,l.ErrorMessages.INVALID_TOKEN)}return Date.now()>c.exp?(r.default.defaults.headers.common.Authorization="Bearer "+e.authProvider.getIdToken(),t.headers.Authorization="Bearer "+e.authProvider.getIdToken(),t):t}),(function(e){Promise.reject(e)})),this.instanceAuth.interceptors.response.use((function(e){return e}),(function(t){var r,i,u,c=t.config;if((403===(null===(r=t.response)||void 0===r?void 0:r.status)||401===(null===(i=t.response)||void 0===i?void 0:i.status))&&!c._retry){c._retry=!0;var d=e.authProvider.getIdToken();return c.headers.Authorization="Bearer "+d,n.instanceAuth(c)}if("standard"===n.errorHandlingMode&&401===(null===(u=t.response)||void 0===u?void 0:u.status)){var h=new o.default(s.ErrorCodes.UNAUTHORIZED,a.ErrorStatuses.UNAUTHORIZED,l.ErrorMessages.EXPIRED_TOKEN);return Promise.reject(h)}return Promise.reject(t)})),this.instance=r.default.create({baseURL:t,headers:{"Content-Type":"application/json"}})}},8539:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(7724),l={player:"players",team:"teams",homeTeam:"teams",awayTeam:"teams",country:"countries",competition:"competitions",match:"matches"},c=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"idMapping"))||this;return n.getEntityById=function(e,r){try{return n.instance.get("/football"+n.apiSignInUrl+"&input_provider="+t.idSchema+"&"+l[e]+"="+r)}catch(e){throw console.warn("There was a problem with id mapping request for the following id:"+r,e),e.response}},n.getEntityByIdAndSchema=function(e,t,r){try{return n.instance.get("/football"+n.apiSignInUrl+"&input_provider="+r+"&"+l[e]+"="+t)}catch(e){throw console.warn("There was a problem with id mapping request for the following id:"+t,e),e.response}},n.getEntityIdsByIdsAndSchema=function(e,t,r){try{return n.instance.get("/football"+n.apiSignInUrl+"&input_provider="+r+"&"+l[e]+"="+t.join(","))}catch(e){throw console.warn("There was a problem with id mapping request for the following ids:"+t.join(","),e),e.response}},n.getEntitiesByIds=function(e,t,r){t.sort((function(e,t){return e.localeCompare(t)}));var i=(0,o.requestChunkBuild)(t).map((function(t){try{return n.instance.get("/football"+n.apiSignInUrl+"&input_provider="+r+"&"+l[e]+"="+t.join(","))}catch(e){var i=n.transformAxiosErrorToFansUnitedException(e);throw console.warn("There was a problem with id mapping request for the following ids:"+t.join(","),i),i.response}}));return Promise.all(i).then((function(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.data.data)})),t}))},n.getEntitiesByIdObjs=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,c,d,h,p,f;return a(this,(function(m){switch(m.label){case 0:n=[],r={},i=[],Object.keys(e).forEach((function(t){n.push.apply(n,e[t])})),s=(0,o.transformIdsToBeUnique)(n),u=(0,o.requestChunkBuild)(s),c=function(n){var s,o,u,c;return a(this,(function(a){switch(a.label){case 0:if(s="",Object.keys(e).forEach((function(t){r[t]=[];var i=n.filter((function(n){return e[t].includes(n)}));i&&i.length>0&&(r[t]=i)})),Object.keys(r).forEach((function(e){r[e].length>0&&(r[e].sort((function(e,t){return e.localeCompare(t)})),s+="&",s+=l[e]+"="+r[e].join(","))})),!(s&&s.length>0))return[3,5];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,d.instance.get("/football"+d.apiSignInUrl+"&input_provider="+(t||"native")+s)];case 2:return o=a.sent(),i.push(o.data.data),[3,4];case 3:throw u=a.sent(),c=d.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem with id mapping request",c),c.response;case 4:return[3,6];case 5:i.push([]),a.label=6;case 6:return[2]}}))},d=this,h=0,p=u,m.label=1;case 1:return h<p.length?(f=p[h],[5,c(f)]):[3,4];case 2:m.sent(),m.label=3;case 3:return h++,[3,1];case 4:return[2,Array.prototype.concat.apply([],i)]}}))}))},n.getTopEntities=function(){return s(n,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.instance.get("/football/top"+this.apiSignInUrl)];case 1:return[2,n.sent().data.data];case 2:throw e=n.sent(),t=this.transformAxiosErrorToFansUnitedException(e),console.warn("There was a problem with top id mappings request",t),t.response;case 3:return[2]}}))}))},n}return i(t,e),t}(u.default);t.default=c},7059:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(7419),l=n(4533),c=n(8899),d=n(7746),h=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"loyalty"))||this;return n.templateRemapper=null,n.leaderboardRemapper=null,n.rankingsRemapper=null,n.highestSuccessRateRemapper=null,n.getTemplates=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,o.isDisabledCache)(e)?"/leaderboard/templates/"+this.apiSignInUrl+(0,o.initDisableCache)():"/leaderboard/templates/"+this.apiSignInUrl,[4,this.instance.get(n)];case 1:return r=a.sent(),t?((i=JSON.parse(JSON.stringify(r.data))).meta=this.templateRemapper.remapMeta(r.data.meta),i.data=this.templateRemapper.remapResponse(r.data.data),[2,i]):[2,this.templateRemapper.remapResponse(r.data.data)];case 2:throw s=a.sent(),u=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching the list of templates",u),u.response;case 3:return[2]}}))}))},n.getTemplateById=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,o.isDisabledCache)(t)?"/leaderboard/templates/"+e+this.apiSignInUrl+(0,o.initDisableCache)():"/leaderboard/templates/"+e+this.apiSignInUrl,[4,this.instance.get(n)];case 1:return r=a.sent(),[2,this.templateRemapper.remapResponseId(r.data.data)];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem requesting the following template: "+e,s),s.response;case 3:return[2]}}))}))},n.getLeaderboard=function(e,t,r){return s(n,void 0,void 0,(function(){var n,i,s,u,l;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,o.isDisabledCache)(t)?"/leaderboard/"+e+"/"+this.apiSignInUrl+(0,o.initDisableCache)():"/leaderboard/"+e+"/"+this.apiSignInUrl,r&&(n+=""+r.constructFiltersUrl()),[4,this.instance.get(n)];case 1:return i=a.sent(),s=JSON.parse(JSON.stringify(i.data)),[2,this.leaderboardRemapper.remapResponse(s)];case 2:throw u=a.sent(),l=this.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem fetching the leaderboard for the following template: "+e,l),l.response;case 3:return[2]}}))}))},n.getLeaderboardForGame=function(e,t,r){return s(n,void 0,void 0,(function(){var n,i,s,u,l;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,o.isDisabledCache)(t)?"/leaderboard/games/"+e+"/"+this.apiSignInUrl+(0,o.initDisableCache)():"/leaderboard/games/"+e+"/"+this.apiSignInUrl,r&&(n+=""+r.constructFiltersUrl()),[4,this.instance.get(n)];case 1:return i=a.sent(),s=JSON.parse(JSON.stringify(i.data)),[2,this.leaderboardRemapper.remapResponse(s)];case 2:throw u=a.sent(),l=this.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem fetching the leaderboard for the following game: "+e,l),l.response;case 3:return[2]}}))}))},n.getUserRankings=function(e,t,r){return s(n,void 0,void 0,(function(){var n,i,s,u;return a(this,(function(a){switch(a.label){case 0:n="/leaderboard/users/"+e+"/rankings/"+this.apiSignInUrl,t&&(n+=""+t.constructFiltersUrl()),(0,o.isDisabledCache)(r)&&(n+=""+(0,o.initDisableCache)()),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return i=a.sent(),[2,this.rankingsRemapper.remapRankings(i.data)];case 3:throw s=a.sent(),u=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching the rankings for the following user: "+e,u),u.response;case 4:return[2]}}))}))},n.getHighestSuccessRate=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:n="/statistics/top"+this.apiSignInUrl,e&&(n+=""+e.constructFiltersUrl()),(0,o.isDisabledCache)(t)&&(n+=""+(0,o.initDisableCache)()),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return r=a.sent(),[2,this.highestSuccessRateRemapper.remapHighestSuccessRate(r.data.data)];case 3:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching highest success rate",s),s.response;case 4:return[2]}}))}))},n.getEntitiesFollows=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i;return a(this,(function(s){switch(s.label){case 0:n=(0,o.isDisabledCache)(t)?"/statistics/follows"+this.apiSignInUrl+(0,o.initDisableCache)():"/statistics/follows"+this.apiSignInUrl,e.footballCompetitions&&(n+="&competitions="+e.footballCompetitions.join(",")),e.footballTeams&&(n+="&teams="+e.footballTeams.join(",")),e.footballPlayers&&(n+="&players="+e.footballPlayers.join(",")),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return[2,s.sent().data.data];case 3:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem fetching follows for entities",i),i.response;case 4:return[2]}}))}))},n.templateRemapper=new c.default,n.leaderboardRemapper=new u.default,n.rankingsRemapper=new l.default,n.highestSuccessRateRemapper=new d.default,n}return i(t,e),t}(n(7724).default);t.default=h},2793:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2726),u=n(9679),l=n(712),c=n(4780),d=n(1553),h=n(3623),p=function(e){function t(t,n){var r=e.call(this,t,(0,l.setBaseUrl)(t.environment,"predictor"))||this;return r.predictionRemapper=null,r.matchSummaryRemapper=null,r.gamesRemapper=null,r.metaRemapper=null,r.makeFootballPrediction=function(e){return s(r,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),t=this.predictionRemapper.remapRequestBody(e),[4,this.instanceAuth.post("/predictions"+this.apiSignInUrl,JSON.stringify(t))];case 1:return n=s.sent(),[4,this.predictionRemapper.remapResponseObjBody(n.data)];case 2:return[2,s.sent()];case 3:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem making POST request: ",i),i.response;case 4:return[2]}}))}))},r.getMatchSummary=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:n=(0,l.isDisabledCache)(t)?"/predictions/summary/"+e+this.apiSignInUrl+(0,l.initDisableCache)():"/predictions/summary/"+e+this.apiSignInUrl,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return r=a.sent(),[2,this.matchSummaryRemapper.remapResponse(r.data)];case 3:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching predictions for match: "+e+" ",s),s.response;case 4:return[2]}}))}))},r.deleteFootballPrediction=function(e){return s(r,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.instanceAuth.delete("/predictions/"+e+this.apiSignInUrl)];case 1:return r.sent(),[2,!0];case 2:throw t=r.sent(),n=this.transformAxiosErrorToFansUnitedException(t),console.warn("There was a problem deleting your prediction: "+e,n),n.response;case 3:return[2]}}))}))},r.getMyPredictions=function(e){return s(r,void 0,void 0,(function(){var t,n,r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),t=new d.default,n="/predictions"+this.apiSignInUrl,e&&(n+=""+e.constructFiltersUrl()),[4,this.instanceAuth.get(n)];case 1:return r=a.sent(),t.meta=this.metaRemapper.remapMetaData(r.data.meta),i=t,[4,this.predictionRemapper.remapResponseArrayBody(r.data.data)];case 2:return i.data=a.sent(),[2,t];case 3:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching own predictions",o),o.response;case 4:return[2]}}))}))},r.getMyPredictionsNoRemap=function(e){return s(r,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.instanceAuth.get("/predictions"+this.apiSignInUrl+e.constructFiltersUrl())];case 1:return[2,r.sent().data];case 2:throw t=r.sent(),n=this.transformAxiosErrorToFansUnitedException(t),console.warn("There was a problem fetching own predictions",n),n.response;case 3:return[2]}}))}))},r.getUserPredictions=function(e,t,n){return s(r,void 0,void 0,(function(){var r,i,s,o,u,c;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r=new d.default,i=(0,l.isDisabledCache)(t)?"/predictions/users/"+e+this.apiSignInUrl+(0,l.initDisableCache)():"/predictions/users/"+e+this.apiSignInUrl,n&&(i+=""+n.constructFiltersUrl()),[4,this.instance.get(i)];case 1:return s=a.sent(),r.meta=this.metaRemapper.remapMetaData(s.data.meta),o=r,[4,this.predictionRemapper.remapResponseArrayBody(s.data.data)];case 2:return o.data=a.sent(),[2,r];case 3:throw u=a.sent(),c=this.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem fetching predictions for user: "+e,c),c.response;case 4:return[2]}}))}))},r.getUserPredictionsNoRemap=function(e,t){return s(r,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.instance.get("/predictions/users/"+e+this.apiSignInUrl+t.constructFiltersUrl())];case 1:return[2,i.sent().data];case 2:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem fetching predictions for user: "+e,r),r.response;case 3:return[2]}}))}))},r.getGames=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,l.isDisabledCache)(t)?"/games/"+this.apiSignInUrl+e.constructFiltersUrl()+(0,l.initDisableCache)():"/games/"+this.apiSignInUrl+e.constructFiltersUrl(),[4,this.instance.get(n)];case 1:return r=a.sent(),[2,this.gamesRemapper.remapPaginatedGames(r.data)];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the games list",s),s.response;case 3:return[2]}}))}))},r.getGameById=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=(0,l.isDisabledCache)(t)?"/games/"+e+this.apiSignInUrl+(0,l.initDisableCache)():"/games/"+e+this.apiSignInUrl,[4,this.instance.get(n)];case 1:return r=a.sent(),[2,this.gamesRemapper.remapGameByIdResponse(r.data)];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the following game: "+e,s),s.response;case 3:return[2]}}))}))},r.getGamePredictions=function(e,t,n){return s(r,void 0,void 0,(function(){var r,i,s,o,u,c;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r=new d.default,i=(0,l.isDisabledCache)(t)?"/games/"+e+"/predictions"+this.apiSignInUrl+(0,l.initDisableCache)():"/games/"+e+"/predictions"+this.apiSignInUrl,n&&(i+=""+n.constructFiltersUrl()),[4,this.instance.get(i)];case 1:return s=a.sent(),r.meta=this.metaRemapper.remapMetaData(s.data.meta),o=r,[4,this.predictionRemapper.remapResponseArrayBody(s.data.data)];case 2:return o.data=a.sent(),[2,r];case 3:throw u=a.sent(),c=this.transformAxiosErrorToFansUnitedException(u),console.warn("There was a problem fetching the predictions for game: "+e,c),c.response;case 4:return[2]}}))}))},r.getUserGameEditions=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s,o,u=this;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=null,r=(0,l.isDisabledCache)(t)?"/games/"+this.apiSignInUrl+e.constructFiltersUrl()+(0,l.initDisableCache)():"/games/"+this.apiSignInUrl+e.constructFiltersUrl(),[4,this.instance.get(r)];case 1:return(i=a.sent()).data.data.forEach((function(e){"TOP_X"===e.type?n=u.gamesRemapper.remapPaginatedUserTopXEditions(i.data):"MATCH_QUIZ"===e.type&&(n=u.gamesRemapper.remapPaginatedUserMathQuizEditions(i.data))})),[2,n];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching the games list",o),o.response;case 3:return[2]}}))}))},r.getGameResults=function(e,t,n){return s(r,void 0,void 0,(function(){var r,i,s,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),r=(0,l.isDisabledCache)(t)?"/games/"+e+"/results/"+this.apiSignInUrl+(0,l.initDisableCache)():"/games/"+e+"/results/"+this.apiSignInUrl,n&&(r+=""+n.constructMainFiltersUrl()),[4,this.instance.get(r)];case 1:return i=a.sent(),[2,this.gamesRemapper.remapPaginatedGameResults(i.data)];case 2:throw s=a.sent(),o=this.transformAxiosErrorToFansUnitedException(s),console.warn("There was a problem fetching the results for the following game: "+e,o),o.response;case 3:return[2]}}))}))},r.getMarketResultsForGame=function(e,t){return s(r,void 0,void 0,(function(){var n,r,i,s;return a(this,(function(a){switch(a.label){case 0:n="/games/"+e+"/correct-results/"+this.apiSignInUrl,(0,l.isDisabledCache)(t)&&(n+=""+(0,l.initDisableCache)()),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(n)];case 2:return r=a.sent(),[2,this.gamesRemapper.remapGameMarketsResults(r.data.data)];case 3:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the markets correct results for the following game: "+e,s),s.response;case 4:return[2]}}))}))},r.getContestWinners=function(e){return s(r,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.instance.get("/winners/"+this.apiSignInUrl+"&contest_id="+e)];case 1:return t=i.sent(),[2,this.gamesRemapper.remapContestWinners(t.data)];case 2:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem fetching winners for the following game: "+e,r),r.response;case 3:return[2]}}))}))},r.getPredictionById=function(e){return s(r,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),t="/predictions/"+e+this.apiSignInUrl,[4,this.instanceAuth.get(t)];case 1:return n=s.sent(),[4,this.predictionRemapper.remapResponseArrayBody([n.data.data])];case 2:return[2,s.sent()[0]];case 3:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem fetching info for the following prediction: "+e,i),i.response;case 4:return[2]}}))}))},r.predictionRemapper=new o.default(t,n),r.matchSummaryRemapper=new u.default(t,n),r.gamesRemapper=new c.default,r.metaRemapper=new h.default,r}return i(t,e),t}(n(7724).default);t.default=p},4275:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(712),u=n(441),l=n(8673),c=n(6277),d=n(1712),h=function(e){function t(t){var n=e.call(this,t,(0,o.setBaseUrl)(t.environment,"profile"))||this;return n.profileRemapper=null,n.followingRemapper=null,n.followersRemapper=null,n.lang=null,n.limitIds=100,n.getCountries=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t="&lang="+this.lang,n="/countries"+this.apiSignInUrl+t,r=Date.now(),e&&(n+="&disable_cache="+r),[4,this.instance.get(n)];case 1:return[2,a.sent().data.data];case 2:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the countries:",s),s.response;case 3:return[2]}}))}))},n.getProfile=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i,s;return a(this,(function(a){switch(a.label){case 0:if(t="/profile"+this.apiSignInUrl,!e)return[3,5];t="/profiles/"+e+this.apiSignInUrl,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.get(t)];case 2:return r=a.sent(),[2,this.profileRemapper.fullProfileFromResponse(r.data.data)];case 3:throw n=a.sent(),s=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem fetching the following profile: "+e,s),s.response;case 4:return[3,8];case 5:return a.trys.push([5,7,,8]),[4,this.instanceAuth.get(t)];case 6:return r=a.sent(),[2,this.profileRemapper.fullProfileFromResponse(r.data.data)];case 7:throw i=a.sent(),s=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching your profile from API:",s),s.response;case 8:return[2]}}))}))},n.getProfiles=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,u,l,c,d,h,p,f,m;return a(this,(function(a){switch(a.label){case 0:if(a.trys.push([0,7,,8]),n=Date.now(),!(e.length>this.limitIds))return[3,5];r=[],i=(0,o.limitIds)(e,this.limitIds),s=0,u=i,a.label=1;case 1:return s<u.length?(l=u[s],c="/profiles"+this.apiSignInUrl+"&profile_ids="+l.join(","),t&&(c+="&disable_cache="+n),[4,this.instance.get(c)]):[3,4];case 2:d=a.sent(),r.push.apply(r,this.profileRemapper.profilesFromResponse(d.data.data)),a.label=3;case 3:return s++,[3,1];case 4:return[2,r];case 5:return h="/profiles"+this.apiSignInUrl+"&profile_ids="+e.join(","),t&&(h+="&disable_cache="+n),[4,this.instance.get(h)];case 6:return p=a.sent(),[2,this.profileRemapper.profilesFromResponse(p.data.data)];case 7:throw f=a.sent(),m=this.transformAxiosErrorToFansUnitedException(f),console.warn("There was a problem fetching the following profiles: "+e.join(","),m),m.response;case 8:return[2]}}))}))},n.getFollowers=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o,u;return a(this,(function(a){switch(a.label){case 0:if(n="/profile/followers"+this.apiSignInUrl,!e||t)return[3,5];n="/profile/followers"+this.apiSignInUrl+e.constructFilterUrl(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instanceAuth.get(n)];case 2:return s=a.sent(),[2,this.followersRemapper.followersFromResponse(s.data)];case 3:throw r=a.sent(),u=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem fetching the followers for own profile",u),u.response;case 4:return[3,9];case 5:if(e||t)return[3,9];a.label=6;case 6:return a.trys.push([6,8,,9]),[4,this.instanceAuth.get(n)];case 7:return s=a.sent(),[2,this.followersRemapper.followersFromResponse(s.data)];case 8:throw i=a.sent(),u=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the followers for own profile",u),u.response;case 9:e&&t?n="/profile/"+t+"/followers"+this.apiSignInUrl+e.constructFilterUrl():!e&&t&&(n="/profile/"+t+"/followers"+this.apiSignInUrl),a.label=10;case 10:return a.trys.push([10,12,,13]),[4,this.instance.get(n)];case 11:return s=a.sent(),[2,this.followersRemapper.followersFromResponse(s.data)];case 12:throw o=a.sent(),u=this.transformAxiosErrorToFansUnitedException(o),console.warn("There was a problem fetching the followers for profile: "+t,u),u.response;case 13:return[2]}}))}))},n.getFollowing=function(e,t){return s(n,void 0,void 0,(function(){var n,r,i,s,o,u;return a(this,(function(a){switch(a.label){case 0:if(n="/profile/following"+this.apiSignInUrl,!e||t)return[3,5];n="/profile/following"+this.apiSignInUrl+e.constructFilterUrl(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instanceAuth.get(n)];case 2:return s=a.sent(),[2,this.followingRemapper.followingFromResponse(s.data)];case 3:throw r=a.sent(),u=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem fetching the followers of own profile",u),u.response;case 4:return[3,9];case 5:if(e||t)return[3,9];a.label=6;case 6:return a.trys.push([6,8,,9]),[4,this.instanceAuth.get(n)];case 7:return s=a.sent(),[2,this.followingRemapper.followingFromResponse(s.data)];case 8:throw i=a.sent(),u=this.transformAxiosErrorToFansUnitedException(i),console.warn("There was a problem fetching the followers of own profile",u),u.response;case 9:e&&t?n="/profile/"+t+"/following"+this.apiSignInUrl+e.constructFilterUrl():!e&&t&&(n="/profile/"+t+"/following"+this.apiSignInUrl),a.label=10;case 10:return a.trys.push([10,12,,13]),[4,this.instance.get(n)];case 11:return s=a.sent(),[2,this.followingRemapper.followingFromResponse(s.data)];case 12:throw o=a.sent(),u=this.transformAxiosErrorToFansUnitedException(o),console.warn("There was a problem fetching the followers of the following profile: "+t,u),u.response;case 13:return[2]}}))}))},n.follow=function(e){return s(n,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(s){switch(s.label){case 0:(t=new d.default).profile_ids=e,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.instanceAuth.post("/profile/follow"+this.apiSignInUrl,JSON.stringify(t))];case 2:return n=s.sent(),[2,this.followingRemapper.followResponse(n.data.data)];case 3:throw r=s.sent(),i=this.transformAxiosErrorToFansUnitedException(r),console.warn("There was a problem with POST request for profiles: "+e.join(",")+" ",i),i.response;case 4:return[2]}}))}))},n.unfollow=function(e){return s(n,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:(t=new d.default).profile_ids=e,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.instanceAuth.delete("/profile/follow"+this.apiSignInUrl,{data:JSON.stringify(t)})];case 2:return i.sent(),[2,!0];case 3:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem with DELETE request for profiles: "+e.join(",")+" ",r),r.response;case 4:return[2]}}))}))},n.getBadges=function(e){return s(n,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:t="/profile/badges"+this.apiSignInUrl,i.label=1;case 1:return i.trys.push([1,5,,6]),e?(t="/profile/"+e+"/badges"+this.apiSignInUrl,[4,this.instance.get(t)]):[3,3];case 2:return[2,i.sent().data.data];case 3:return[4,this.instanceAuth.get(t)];case 4:return[2,i.sent().data.data];case 5:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem with fetching the badges",r),r.response;case 6:return[2]}}))}))},n.updateProfile=function(e){return s(n,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.instanceAuth.patch("/profile"+this.apiSignInUrl,e)];case 1:return t=i.sent(),[2,this.profileRemapper.fullProfileFromResponse(t.data.data)];case 2:throw n=i.sent(),r=this.transformAxiosErrorToFansUnitedException(n),console.warn("There was a problem updating the own profile:",r),r.response;case 3:return[2]}}))}))},n.lang=t.lang,n.profileRemapper=new u.default,n.followingRemapper=new l.default,n.followersRemapper=new c.default,n}return i(t,e),t}(n(7724).default);t.default=h},5792:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(5601),a=n(8539),o=n(1260);t.default=function(e){var t=this;this.isBrowser=!1,this.localStorage=null,this.https=null,this.getEntitiesByIds=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r,a,u,l,c;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?[4,this.setTopIdMappings()]:[3,6];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,4,,5]),t=this.localStorage.checkForExistingIdObjs(e,n),r=this.splitForRequestAndExisting(t),[4,this.https.getEntitiesByIdObjs(r.request,n)];case 3:return a=i.sent(),this.localStorage.addIdMappings(a),[2,this.localStorage.getIdsByType(e,n,s)];case 4:return u=i.sent(),console.warn("There was a problem retrieving the entity ids ",u),[2,Promise.resolve([])];case 5:return[3,9];case 6:return i.trys.push([6,8,,9]),[4,this.https.getEntitiesByIdObjs(e,n)];case 7:return l=i.sent(),Object.keys(e).forEach((function(t){e[t]=l.filter((function(e){return e.resource===t})).map((function(e){return e[o.ID_TYPES[s]]}))})),[2,e];case 8:return c=i.sent(),console.warn("There was a problem retrieving the entity ids ",c),[2,Promise.resolve([])];case 9:return[2]}}))}))},this.getEntityById=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?(t=this.localStorage.getEntity(e,n,s))?[2,t]:[3,1]:[3,4];case 1:case 4:return[4,this.requestEntity(e,n,s)];case 2:return r=i.sent(),this.localStorage.addIdMappings(r),[2,r];case 3:return[3,6];case 5:return[2,i.sent()];case 6:return[2]}}))}))},this.splitForRequestAndExisting=function(e){var t={},n={};return Object.keys(e).forEach((function(r){t[r]=e[r].filter((function(e){return!e.exists})).map((function(e){return e.id})),n[r]=e[r].filter((function(e){return e.exists})).map((function(e){return e.id}))})),{existing:n,request:t}},this.requestEntity=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=Array.isArray(e)?e:[e],[4,this.https.getEntitiesByIds(n,e,s)];case 1:return[2,r.sent()];case 2:return t=r.sent(),console.warn("There was a problem retrieving the requested entity: "+t),[2,null];case 3:return[2]}}))}))},this.setTopIdMappings=function(){return r(t,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return e=Math.floor(Date.now()/1e3),this.localStorage.getExpiration("football","ids")>e?[2,Promise.resolve()]:[4,this.https.getTopEntities()];case 1:return t=n.sent(),this.localStorage.addTopIdMappings(t),[2]}}))}))},this.isBrowser="undefined"!=typeof window,this.localStorage=new s.default(e),this.https=new a.default(e)}},8900:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4946),a=n(5792),o=n(7611),u=n(9052);t.default=function(e){var t=this;this.idSchema="",this.idMappingFacade=null,this.getEntityIdBySchemaId=function(e,n){return t.idMappingFacade.getEntityById(e,n,t.idSchema)},this.remapEntities=function(e,n){return r(t,void 0,void 0,(function(){var t,r,a;return i(this,(function(i){t=JSON.parse(JSON.stringify(e));try{return this.idSchema!==s.IdSchemaEnum.NATIVE?(r=new o.default,a=r.traverse(t,n),[2,this.idMappingFacade.getEntitiesByIds(a,"native",this.idSchema).then((function(e){return(new u.default).traverse(t,n,e)}))]):[2,e]}catch(e){return console.warn("There was a problem remapping entity: "+n+" with inner entity ",e),[2,[]]}return[2]}))}))},this.getEntityIdsBySchemaId=function(e,n,a){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return(t={})[n]=e,this.idSchema===s.IdSchemaEnum.NATIVE?[3,2]:[4,this.idMappingFacade.getEntitiesByIds(t,this.idSchema,a)];case 1:return[2,r.sent()];case 2:return[2,t]}}))}))},this.idSchema=e.idSchema,this.idMappingFacade=new a.default(e)}},3845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeConvert=void 0,t.typeConvert=function(e){switch(e){case"competitions":return"competition";case"players":case"relatedPlayer":case"squad":return"player";case"teams":case"participants":case"homeTeam":case"awayTeam":case"timeline":case"teamId":return"team";default:return e}}},7611:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3845);t.default=function(){var e=this;this.extractedObjIds={},this.traverse=function(t,n){return n=(0,r.typeConvert)(n),Array.isArray(t)?e.traverseArrExtract(t,n):t&&"object"==typeof t&&e.traverseObjExtract(t,n),e.extractedObjIds},this.traverseArrExtract=function(t,n){t&&t.length>0&&t.forEach((function(t){e.traverseObjExtract(t,n)}))},this.traverseObjExtract=function(t,n){t&&Object.keys(t).length>0&&Object.keys(t).forEach((function(r){var i=t[r];"id"===r||"teamId"===r?(e.extractedObjIds.hasOwnProperty(n)||(e.extractedObjIds[n]=[]),i&&e.extractedObjIds[n].push(i)):t[r]&&e.traverse(t[r],r)}))}}},9052:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3845);t.default=function(){var e=this;this.replaceObjIdsIndex=null,this.remappedIdsObj={},this.traverse=function(t,n,i){return n=(0,r.typeConvert)(n),null===e.replaceObjIdsIndex&&(e.initReplaceObjIdsIndex(i),e.remappedIdsObj=i),Array.isArray(t)?e.traverseArrReplace(t,n):t&&"object"==typeof t&&e.traverseObjReplace(t,n),t},this.initReplaceObjIdsIndex=function(t){e.replaceObjIdsIndex={},Object.keys(t).forEach((function(t){e.replaceObjIdsIndex[t]=0}))},this.traverseArrReplace=function(t,n){t&&t.length>0&&t.forEach((function(t){e.traverseObjReplace(t,n)}))},this.traverseObjReplace=function(t,n){t&&Object.keys(t).length>0&&Object.keys(t).forEach((function(r){"id"===r||"teamId"===r?t[r]&&(t[r]=e.remappedIdsObj[n][e.replaceObjIdsIndex[n]],e.replaceObjIdsIndex[n]=e.replaceObjIdsIndex[n]+1):t[r]&&e.traverse(t[r],r,e.remappedIdsObj)}))}}},7302:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(5936);t.default=function(e){var t=this;this.add=function(e,n,s,a){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.add(e,n,s,a)];case 1:return[2,t.sent()]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.delete(e)];case 1:return[2,t.sent()]}}))}))},this.like=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.like(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.dislike=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.dislike(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addPageview=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addPageview(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addContentConsumed=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addContentConsumed(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addShare=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addShare(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addComment=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addComment(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addClickAd=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addClickAd(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.addConversion=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.addConversion(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getOwn=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.getOwn(e,n)];case 1:return[2,t.sent()]}}))}))},this.getForUser=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityFacade.getForUser(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.activityFacade=new s.default(e)}},1491:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionsEnum=void 0,(n=t.ActionsEnum||(t.ActionsEnum={})).LIKE="like",n.DISLIKE="dislike",n.PAGE_VIEW="page_view",n.CONTENT_CONSUMED="content_consumed",n.SHARE="share",n.COMMENT="comment",n.CLICK_AD="click_ad",n.CONVERSION="conversion",n.PREDICTION_MADE="prediction_made",n.CONVERT="convert",n.MANAGE_INTERESTS="manage_interests",n.GAME_PARTICIPATION="game_participation",n.ARTICLE_CONSUMED="article_consumed",n.VIDEO_CONSUMED="video_consumed",n.SHORT_VIDEO_CONSUMED="short_video_consumed",n.LONG_VIDEO_CONSUMED="long_video_consumed",n.AUDIO_CONSUMED="audio_consumed",n.GALLERY_CONSUMED="gallery_consumed",n.IMAGE_CONSUMED="image_consumed",n.POLL_PARTICIPATION="poll_participation"},5936:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4946),a=n(1022),o=n(1491),u=n(4630),l=n(8261),c=n(629),d=n(8636);t.default=function(e){var t=this;this.add=function(e,n,a,o){return r(t,void 0,void 0,(function(){var t,r,l,c,d;return i(this,(function(i){switch(i.label){case 0:return this.idSchema==s.IdSchemaEnum.NATIVE?[3,3]:(t=JSON.parse(JSON.stringify(n)),[4,this.activityService.remapTagsIds(n,this.idSchema,s.IdSchemaEnum.NATIVE)]);case 1:return r=i.sent(),l=new u.default(e,r,a,o),[4,this.activityHttps.createActivity(l)];case 2:return(c=i.sent()).context.tags=t,[2,c];case 3:return d=new u.default(e,n,a,o),[2,this.activityHttps.createActivity(d)]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.activityHttps.deleteActivity(e)];case 1:return[2,t.sent()]}}))}))},this.like=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.LIKE,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.dislike=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.DISLIKE,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addPageview=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.PAGE_VIEW,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addContentConsumed=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.CONTENT_CONSUMED,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addShare=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.SHARE,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addComment=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.COMMENT,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addClickAd=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.CLICK_AD,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.addConversion=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=o.ActionsEnum.CONVERSION,[4,this.add(t,e,n,s)];case 1:return[2,r.sent()]}}))}))},this.getOwn=function(e,n){return r(t,void 0,void 0,(function(){var t,r,a,o;return i(this,(function(i){switch(i.label){case 0:return n=n||!1,e&&(e=new c.default(e)),this.idSchema==s.IdSchemaEnum.NATIVE?[3,6]:[4,this.activityHttps.getOwnActivities(e,n)];case 1:t=i.sent(),r=0,a=t.data,i.label=2;case 2:return r<a.length?(o=a[r],[4,this.activityService.remapTagsIds(o.context.tags,s.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:i.sent(),i.label=4;case 4:return r++,[3,2];case 5:return[2,t];case 6:return[4,this.activityHttps.getOwnActivities(e,n)];case 7:return[2,i.sent()]}}))}))},this.getForUser=function(e,n,a){return r(t,void 0,void 0,(function(){var t,r,o,u;return i(this,(function(i){switch(i.label){case 0:return a=a||!1,n&&(n=new d.default(n)),this.idSchema==s.IdSchemaEnum.NATIVE?[3,6]:[4,this.activityHttps.getActivitiesForUser(e,n,a)];case 1:t=i.sent(),r=0,o=t.data,i.label=2;case 2:return r<o.length?(u=o[r],[4,this.activityService.remapTagsIds(u.context.tags,s.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:i.sent(),i.label=4;case 4:return r++,[3,2];case 5:return[2,t];case 6:return[4,this.activityHttps.getActivitiesForUser(e,n,a)];case 7:return[2,i.sent()]}}))}))},this.idSchema=e.idSchema,this.activityHttps=new a.default(e),this.activityService=new l.default(e)}},1517:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2820);t.default=function(){this.id=null,this.profileId=null,this.property=null,this.value=null,this.action=null,this.context=new r.default,this.points=0}},2195:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.page=null,this.limit=null,this.page=e.page?e.page:null,this.limit=e.limit?e.limit:null}},629:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var n=e.call(this,t)||this;return n.action=null,n.action=t.action?t.action:null,n}return i(t,e),t.prototype.constructFilterUrl=function(){var e="";return this.action&&(e+="&",e+="action="+this.action),this.page&&(e+="&",e+="page="+this.page),this.limit&&(e+="&",e+="limit="+this.limit),e},t}(n(2195).default);t.default=s},8636:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var n=e.call(this,t)||this;return n.action=null,n.action=t.action?t.action:null,n}return i(t,e),t.prototype.constructFilterUrl=function(){var e="";return this.action&&(e+="&",e+="action="+this.action),this.page&&(e+="&",e+="page="+this.page),this.limit&&(e+="&",e+="limit="+this.limit),e},t}(n(2195).default);t.default=s},6021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3569),i=n(1517);t.default=function(){this.meta=new r.default,this.data=[new i.default]}},2820:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.content=null,this.tags=[],this.campaign=null}},4630:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2820);t.default=function(e,t,n,i){this.action=null,this.context=new r.default,this.action=e,this.context.tags=t,n&&(this.context.content=n),i&&(this.context.campaign=i)}},2453:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(7974),s=n(1316),a=n(9826),o=n(1517),u=n(6021);t.default=function(){var e=this;this.remapSingleResponse=function(e){var t=new o.default;return t.id=e.id,t.profileId=e.profile_id,t.property=e.property,t.value=e.value,t.action=e.action,t.context.content=e.context.content,t.context.tags=e.context.tags,t.context.campaign=e.context.campaign,t.points=e.points,t},this.remapActivitiesResponse=function(t){var n=new u.default;return n.meta.pagination.currentPage=t.meta.pagination.current_page,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.meta.pagination.numberOfPages=t.meta.pagination.number_of_pages,n.meta.pagination.totalItems=t.meta.pagination.total_items,n.data=t.data.map((function(t){return e.remapSingleResponse(t)})),n},this.remapStatsReponse=function(t){var n=new s.default;return n.profileId=t.profile_id,n.tier=t.tier,n.points=t.points,n.successRates.overallPercent=t.success_rates.overall_percent,n.successRates.byFootballCompetition=e.constructNewRecord(t.success_rates.by_competition),n.successRates.byFootballTeam=e.constructNewRecord(t.success_rates.by_team),n.successRates.byFootballMarket=e.constructNewRecord(t.success_rates.by_market),n},this.constructNewRecord=function(t){var n;return Object.entries(t).length?(Object.entries(t).forEach((function(t){var s,a=t[0],o=t[1];n=r(r({},n),((s={})[a]=e.remapSuccessRatePercent(o),s)),i.MarketEnum[a]&&delete n[a].model})),n):t},this.remapSuccessRatePercent=function(e){var t=new a.default;return t.successRatePercent=e.success_rate_percent,t}}},8261:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8900);t.default=function(e){var t=this;this.remapTagsIds=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r,a,o,u,l,c,d,h,p;return i(this,(function(i){switch(i.label){case 0:return e&&e.length?(t={},r={},a=[],e.forEach((function(e){t.hasOwnProperty(e.type)||(t[e.type]=[],r[e.type]=[]),t[e.type].push(e.id),r[e.type].push(e)})),[4,this.idMapping.idMappingFacade.getEntitiesByIds(t,n,s)]):[2,e];case 1:for(o=i.sent(),u=function(e,t){t.forEach((function(t,n){t.id=o[e][n],a.push(t)}))},l=0,c=Object.entries(r);l<c.length;l++)d=c[l],h=d[0],p=d[1],u(h,p);return[2,a]}}))}))},this.idSchema=e.idSchema,this.idMapping=new s.default(e)}},7e3:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(2754),a=n(712);t.default=function(e,t,n){var o=this;this.isBrowser=!1,this.localStorage={},this.https=null,this.idMapping=null,this.getCompetitionsIdMapping=function(e,t){return r(o,void 0,void 0,(function(){var n,r,a,o,u;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,8,,9]),n=!1,e?(e=new s.default(e)).countryId?[4,this.idMapping.getEntityIdsBySchemaId([""+e.countryId],"country","native")]:[3,2]:[3,5];case 1:0===(r=i.sent()).country.length&&(n=!0),e.countryId=r.country[0],i.label=2;case 2:return e.competitionIds?[4,this.idMapping.getEntityIdsBySchemaId(e.competitionIds,"competition","native")]:[3,4];case 3:0===(a=i.sent()).competition.length&&(n=!0),e.competitionIds=a.competition,i.label=4;case 4:if(n)return[2,[]];i.label=5;case 5:return[4,this.getCompetitions(e,t)];case 6:return o=i.sent(),[4,this.idMapping.remapEntities(o,"competition")];case 7:return[2,i.sent()];case 8:throw u=i.sent(),console.warn("There was a problem browsing all of the competitions",u),u;case 9:return[2]}}))}))},this.getCompetitionsMapWithNativeIds=function(e){return r(o,void 0,void 0,(function(){var t,n,r,o,u,l;return i(this,(function(i){switch(i.label){case 0:return t=new Map,n=e.length,r=new s.default({competitionIds:e,limit:n}),[4,this.getCompetitions(r)];case 1:return(o=i.sent()).sort((function(e,t){return e.id.localeCompare(t.id)})),u=(0,a.sortArrayInAscOrder)(e),[4,this.idMapping.remapEntities(o,"competition")];case 2:return l=i.sent(),u.forEach((function(e,n){return t.set(e,l[n])})),[2,t]}}))}))},this.getCompetitions=function(e,t){return r(o,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:if(n=null,t=t||!1,!this.isBrowser)return[3,6];if(this.localStorage.getCompetitionsLength())return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.https.getCompetitions()];case 2:return n=i.sent(),[3,4];case 3:throw r=i.sent(),console.warn("There was a problem retrieving all competitions",r),r;case 4:this.localStorage.setCompetitions(n),i.label=5;case 5:return[2,this.localStorage.getCompetitions(e)];case 6:return[2,this.https.getCompetitions(e,t)]}}))}))},this.getCompetitionByIdIdMapping=function(e,t){return r(o,void 0,void 0,(function(){var n,r,s,a;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"competition","native")];case 1:return n=i.sent(),r=n.competition[0],[4,this.getCompetitionById(r,t)];case 2:return s=i.sent(),[4,this.idMapping.remapEntities(s,"competition")];case 3:return[2,i.sent()];case 4:throw a=i.sent(),console.warn("There was a problem browsing the following competition:"+e,a),a;case 5:return[2]}}))}))},this.getCompetitionById=function(e,t){return r(o,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getCompetitionById(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the competition with the following id: "+e,n),n;case 3:return[2]}}))}))},this.getTopCompetitionsIdMapping=function(e){return r(o,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.getTopCompetitions(e)];case 1:return t=r.sent(),[4,this.idMapping.remapEntities(t,"competition")];case 2:return[2,r.sent()];case 3:throw n=r.sent(),console.warn("There was a problem browsing the top competitions",n),n;case 4:return[2]}}))}))},this.getTopCompetitions=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTopCompetitions(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem retrieving the top competitions",t),t;case 3:return[2]}}))}))},this.isBrowser="undefined"!=typeof window,this.localStorage=e,this.idMapping=n,this.https=t}},8350:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t,i){var s=this;this.isBrowser=!1,this.localStorage={},this.https=null,this.idMapping=null,this.getCountriesWithIdMapping=function(e){return n(s,void 0,void 0,(function(){var t,n;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getCountries(e)];case 1:return t=r.sent(),[2,this.idMapping.remapEntities(t,"country")];case 2:throw n=r.sent(),console.warn("There was a problem browsing countries as football entities",n),n;case 3:return[2]}}))}))},this.getCountries=function(e){return n(s,void 0,void 0,(function(){var t,n,i;return r(this,(function(r){switch(r.label){case 0:return e=e||!1,this.isBrowser?(t=this.localStorage.getFootballCountries())&&t.length>0?[2,t]:[3,1]:[3,5];case 1:return r.trys.push([1,3,,4]),[4,this.https.getCountries(e)];case 2:return n=r.sent(),this.localStorage.setFootballCountries(n),[2,n];case 3:throw i=r.sent(),console.warn("There was a problem retrieving countries as football entities",i),i;case 4:return[3,6];case 5:return[2,this.https.getCountries(e)];case 6:return[2]}}))}))},this.isBrowser="undefined"!=typeof window,this.localStorage=e,this.idMapping=i,this.https=t}},4289:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8350),a=n(7e3),o=n(9693),u=n(4272),l=n(4545),c=n(2140);t.default=function(e,t,n,d){var h=this;this.countriesFacade=null,this.competitionsFacade=null,this.teamsFacade=null,this.playerFacade=null,this.matchFacade=null,this.searchFacade=null,this.getCountries=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.countriesFacade.getCountriesWithIdMapping(e)]}))}))},this.getCompetitions=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.competitionsFacade.getCompetitionsIdMapping(e,t)]}))}))},this.getCompetitionById=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.competitionsFacade.getCompetitionByIdIdMapping(e,t)]}))}))},this.getTopCompetitions=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.competitionsFacade.getTopCompetitionsIdMapping(e)]}))}))},this.getCompetitionsMapWithNativeIds=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.competitionsFacade.getCompetitionsMapWithNativeIds(e)];case 1:return[2,t.sent()]}}))}))},this.getTeams=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.teamsFacade.getTeamsIdMapping(e,t)]}))}))},this.getTeamById=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.teamsFacade.getTeamByIdIdMapping(e,t)]}))}))},this.getTopTeams=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.teamsFacade.getTopTeamsIdMapping(e)]}))}))},this.getNextMatchForTeam=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.teamsFacade.getNextMatchForTeamIdMapping(e,t)]}))}))},this.getPrevMatchForTeam=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.teamsFacade.getPrevMatchForTeamIdMapping(e,t)]}))}))},this.getTeamsMapWithNativeIds=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.teamsFacade.getTeamsMapWithNativeIds(e)];case 1:return[2,t.sent()]}}))}))},this.getPlayers=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.playerFacade.getPlayersIdMapping(e,t)]}))}))},this.getPlayerById=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.playerFacade.getPlayerIdMapping(e,t)]}))}))},this.getTopPlayers=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.playerFacade.getTopPlayersIdMapping(e)]}))}))},this.getNextMatchForPlayer=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.playerFacade.getNextMatchForPlayerIdMapping(e,t)]}))}))},this.getPrevMatchForPlayer=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.playerFacade.getPrevMatchForPlayerIdMapping(e,t)]}))}))},this.getPlayersMapWithNativeIds=function(e){return r(h,void 0,void 0,(function(){return i(this,(function(t){return[2,this.playerFacade.getPlayersMapWithNativeIds(e)]}))}))},this.getMatches=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.matchFacade.getMatchesIdMapping(e,t)]}))}))},this.getMatchById=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.matchFacade.getMatchIdMapping(e,t)]}))}))},this.search=function(e,t){return r(h,void 0,void 0,(function(){return i(this,(function(n){return[2,this.searchFacade.searchIdMapping(e,t)]}))}))},this.countriesFacade=new s.default(t,n,d),this.competitionsFacade=new a.default(t,n,d),this.teamsFacade=new o.default(e,n,d),this.playerFacade=new u.default(e,n,d),this.matchFacade=new l.default(e,n,d),this.searchFacade=new c.default(n,d)}},4545:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var a=n(712),o=n(6134),u=n(9582);t.default=function(e,t,n){var l=this;this.https=null,this.idMapping=null,this.footballService=null,this.getMatchesIdMapping=function(e,t){return r(l,void 0,void 0,(function(){var n,r,a,u,l,c,d,h;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,12,,13]),e?(e=new o.default(e)).countryIds?[4,this.idMapping.getEntityIdsBySchemaId(e.countryIds,"country","native")]:[3,2]:[3,8];case 1:n=i.sent(),e.countryIds=n.country,i.label=2;case 2:return e.competitionIds?[4,this.idMapping.getEntityIdsBySchemaId(e.competitionIds,"competition","native")]:[3,4];case 3:r=i.sent(),e.competitionIds=r.competition,i.label=4;case 4:return e.matchIds?[4,this.idMapping.getEntityIdsBySchemaId(e.matchIds,"match","native")]:[3,6];case 5:a=i.sent(),e.matchIds=a.match,i.label=6;case 6:return e.teamIds?[4,this.idMapping.getEntityIdsBySchemaId(e.teamIds,"team","native")]:[3,8];case 7:u=i.sent(),e.teamIds=u.team,i.label=8;case 8:return[4,this.getMatches(e,t)];case 9:return l=i.sent(),c=l,[4,this.footballService.setAvailableMarketsForMatch(s([],l.data,!0))];case 10:return c.data=i.sent(),d=l,[4,this.idMapping.remapEntities(l.data,"match")];case 11:return d.data=i.sent(),[2,l];case 12:throw h=i.sent(),console.warn("There was a problem browsing the matches",h),h;case 13:return[2]}}))}))},this.getMatchesWithNativeIds=function(e){return r(l,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=e.length,n=new o.default({matchIds:e,limit:t}),[4,this.getMatches(n)];case 1:return(r=i.sent()).data.sort((function(e,t){return e.id.localeCompare(t.id)})),[4,this.idMapping.remapEntities(r.data,"match")];case 2:return[2,i.sent()]}}))}))},this.getMatchesMapWithNativeIds=function(e){return r(l,void 0,void 0,(function(){var t,n,r,s,u,l;return i(this,(function(i){switch(i.label){case 0:return t={},(n=(0,a.transformIdsToBeUnique)(e)).sort((function(e,t){return e.localeCompare(t)})),[4,this.getMatchesWithNativeIds(n)];case 1:return r=i.sent(),n.length===r.length?[3,3]:(s=new o.default({matchIds:n,limit:n.length}),[4,this.getMatches(s)]);case 2:u=i.sent(),l=n.filter((function(e){if(u.data.every((function(t){return t.id!==e})))return e})),n=n.filter((function(e){if(!l.includes(e))return e})),i.label=3;case 3:return n.forEach((function(e,n){return t[e]=r[n]})),[2,t]}}))}))},this.getMatches=function(e,t){return r(l,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getMatches(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the matches",n),n;case 3:return[2]}}))}))},this.getMatchIdMapping=function(e,t){return r(l,void 0,void 0,(function(){var n,r,s,a;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),[4,this.idMapping.getEntityIdsBySchemaId([e],"match","native")];case 1:return n=i.sent(),[4,this.getMatchById(n.match[0],t)];case 2:return r=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(r)];case 3:return s=i.sent(),[4,this.idMapping.remapEntities(s,"match")];case 4:return[2,i.sent()];case 5:throw a=i.sent(),console.warn("There was a problem browsing the following match: "+e,a),a;case 6:return[2]}}))}))},this.getMatchById=function(e,t){return r(l,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getMatchById(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the following match: "+e,n),n;case 3:return[2]}}))}))},this.https=t,this.idMapping=n,this.footballService=new u.default(e)}},4272:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(6477),a=n(712),o=n(9582);t.default=function(e,t,n){var u=this;this.https=null,this.footballService=null,this.idMapping=null,this.getPlayersIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,a,o,u,l,c;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,10,,11]),n=!1,e?(e=new s.default(e)).countryId?[4,this.idMapping.getEntityIdsBySchemaId([e.countryId],"country","native")]:[3,2]:[3,7];case 1:0===(r=i.sent()).country.length&&(n=!0),e.countryId=r.country[0],i.label=2;case 2:return e.playerIds?[4,this.idMapping.getEntityIdsBySchemaId(e.playerIds,"player","native")]:[3,4];case 3:0===(a=i.sent()).player.length&&(n=!0),e.playerIds=a.player,i.label=4;case 4:return e.scope?[4,this.idMapping.getEntityIdsBySchemaId(e.scope,"competition","native")]:[3,6];case 5:0===(o=i.sent()).competition.length&&(n=!0),e.scope=o.competition,i.label=6;case 6:if(n)return[2,[]];i.label=7;case 7:return[4,this.getPlayers(e,t)];case 8:return u=i.sent(),l=u,[4,this.idMapping.remapEntities(u.data,"player")];case 9:return l.data=i.sent(),[2,u];case 10:throw c=i.sent(),console.warn("There was a problem browsing the players",c),c;case 11:return[2]}}))}))},this.getPlayersWithNativeIds=function(e){return r(u,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=e.length,n=new s.default({playerIds:e,limit:t}),[4,this.getPlayers(n)];case 1:return(r=i.sent()).data.sort((function(e,t){return e.id.localeCompare(t.id)})),[4,this.idMapping.remapEntities(r.data,"player")];case 2:return[2,i.sent()]}}))}))},this.getPlayersMapWithNativeIds=function(e){return r(u,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t={},(n=(0,a.transformIdsToBeUnique)(e)).sort((function(e,t){return e.localeCompare(t)})),[4,this.getPlayersWithNativeIds(n)];case 1:return r=i.sent(),n.forEach((function(e,n){return t[e]=r[n]})),[2,t]}}))}))},this.getPlayers=function(e,t){return r(u,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getPlayers(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the players",n),n;case 3:return[2]}}))}))},this.getPlayerIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"player","native")];case 1:return n=i.sent(),[4,this.getPlayerById(n.player[0],t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"player")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the following player:"+e,s),s;case 5:return[2]}}))}))},this.getPlayerById=function(e,t){return r(u,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getPlayerById(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the following player: "+e,n),n;case 3:return[2]}}))}))},this.getTopPlayersIdMapping=function(e){return r(u,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.getTopPlayers(e)];case 1:return t=r.sent(),[4,this.idMapping.remapEntities(t,"player")];case 2:return[2,r.sent()];case 3:throw n=r.sent(),console.warn("There was a problem browsing the top players",n),n;case 4:return[2]}}))}))},this.getTopPlayers=function(e){return r(u,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTopPlayers(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem retrieving the top players",t),t;case 3:return[2]}}))}))},this.getNextMatchForPlayerIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"player","native")];case 1:return n=i.sent(),e=n.player[0],[4,this.getNextMatchForPlayer(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"match")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the next match for player:"+e,s),s;case 5:return[2]}}))}))},this.getNextMatchForPlayer=function(e,t){return r(u,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=t||!1,[4,this.https.getNextMatchForPlayer(e,t)];case 1:return n=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),console.warn("There was a problem retrieving the next match for player: "+e,r),r;case 4:return[2]}}))}))},this.getPrevMatchForPlayerIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"player","native")];case 1:return n=i.sent(),e=n.player[0],[4,this.getPrevMatchForPlayer(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"match")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the previous match for player:"+e,s),s;case 5:return[2]}}))}))},this.getPrevMatchForPlayer=function(e,t){return r(u,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=t||!1,[4,this.https.getPrevMatchForPlayer(e,t)];case 1:return n=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),console.warn("There was a problem retrieving the previous match for player: "+e,r),r;case 4:return[2]}}))}))},this.idMapping=n,this.https=t,this.footballService=new o.default(e)}},2140:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(604);t.default=function(e,t){var n=this;this.https=null,this.idMapping=null,this.searchIdMapping=function(e,t){return r(n,void 0,void 0,(function(){var n,r,a,o,u,l;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,10,,11]),(e=new s.default(e)).scope?[4,this.idMapping.getEntityIdsBySchemaId(e.scope,"competition","native")]:[3,2];case 1:n=i.sent(),e.scope=n.competition,i.label=2;case 2:return[4,this.search(e,t)];case 3:return(r=i.sent()).teams&&r.teams.length>0?[4,this.idMapping.remapEntities(r.teams,"team")]:[3,5];case 4:a=i.sent(),r.teams=a,i.label=5;case 5:return r.players&&r.players.length>0?[4,this.idMapping.remapEntities(r.players,"player")]:[3,7];case 6:o=i.sent(),r.players=o,i.label=7;case 7:return r.competitions&&r.competitions.length>0?[4,this.idMapping.remapEntities(r.competitions,"competition")]:[3,9];case 8:u=i.sent(),r.competitions=u,i.label=9;case 9:return[2,r];case 10:throw l=i.sent(),console.warn("There was a problem with browsing the search result",l),l;case 11:return[2]}}))}))},this.search=function(e,t){return r(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.https.search(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the search response",n),n;case 3:return[2]}}))}))},this.https=e,this.idMapping=t}},9693:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(9920),a=n(9582),o=n(712);t.default=function(e,t,n){var u=this;this.footballService=null,this.https=null,this.idMapping=null,this.getTeamsIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,a,o,u,l,c;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,9,,10]),n=!1,e?(e=new s.default(e)).countryId?[4,this.idMapping.getEntityIdsBySchemaId([""+e.countryId],"country","native")]:[3,2]:[3,6];case 1:0===(r=i.sent()).country.length&&(n=!0),e.countryId=r.country[0],i.label=2;case 2:return e.scope?[4,this.idMapping.getEntityIdsBySchemaId(e.scope,"competition","native")]:[3,4];case 3:0===(a=i.sent()).competition.length&&(n=!0),e.scope=a.competition,i.label=4;case 4:return e.teamIds?[4,this.idMapping.getEntityIdsBySchemaId(e.teamIds,"team","native")]:[3,6];case 5:0===(o=i.sent()).team.length&&(n=!0),e.teamIds=o.team,i.label=6;case 6:return n?[2,[]]:[4,this.getTeams(e,t)];case 7:return u=i.sent(),l=u,[4,this.idMapping.remapEntities(u.data,"team")];case 8:return l.data=i.sent(),[2,u];case 9:throw c=i.sent(),console.warn("There was a problem browsing all teams",c),c;case 10:return[2]}}))}))},this.getTeamsMapWithNativeIds=function(e){return r(u,void 0,void 0,(function(){var t,n,r,a,u,l;return i(this,(function(i){switch(i.label){case 0:return t=new Map,n=e.length,r=new s.default({teamIds:e,limit:n}),[4,this.getTeams(r)];case 1:return(a=i.sent().data).sort((function(e,t){return e.id.localeCompare(t.id)})),u=(0,o.sortArrayInAscOrder)(e),[4,this.idMapping.remapEntities(a,"team")];case 2:return l=i.sent(),u.forEach((function(e,n){return t.set(e,l[n])})),[2,t]}}))}))},this.getTeams=function(e,t){return r(u,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTeams(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving all teams",n),n;case 3:return[2]}}))}))},this.getTeamByIdIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"team","native")];case 1:return n=i.sent(),e=n.team[0],[4,this.getTeamById(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"team")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the following team:"+e,s),s;case 5:return[2]}}))}))},this.getTeamById=function(e,t){return r(u,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTeamById(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the following team: "+e,n),n;case 3:return[2]}}))}))},this.getTopTeamsIdMapping=function(e){return r(u,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.getTopTeams(e)];case 1:return t=r.sent(),[4,this.idMapping.remapEntities(t,"team")];case 2:return[2,r.sent()];case 3:throw n=r.sent(),console.warn("There was a problem browsing the top teams",n),n;case 4:return[2]}}))}))},this.getTopTeams=function(e){return r(u,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTopTeams(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem retrieving the top teams",t),t;case 3:return[2]}}))}))},this.getNextMatchForTeamIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"team","native")];case 1:return n=i.sent(),e=n.team[0],[4,this.getNextMatchForTeam(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"match")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the next match for the following team:"+e,s),s;case 5:return[2]}}))}))},this.getNextMatchForTeam=function(e,t){return r(u,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=t||!1,[4,this.https.getNextMatchForTeam(e,t)];case 1:return n=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),console.warn("There was a problem retrieving the next match for the following team: "+e,r),r;case 4:return[2]}}))}))},this.getPrevMatchForTeamIdMapping=function(e,t){return r(u,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([e],"team","native")];case 1:return n=i.sent(),e=n.team[0],[4,this.getPrevMatchForTeam(e,t)];case 2:return r=i.sent(),[4,this.idMapping.remapEntities(r,"match")];case 3:return[2,i.sent()];case 4:throw s=i.sent(),console.warn("There was a problem browsing the previous match for the following team:"+e,s),s;case 5:return[2]}}))}))},this.getPrevMatchForTeam=function(e,t){return r(u,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=t||!1,[4,this.https.getPrevMatchForTeam(e,t)];case 1:return n=i.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),console.warn("There was a problem retrieving the previous match for the following team: "+e,r),r;case 4:return[2]}}))}))},this.idMapping=n,this.https=t,this.footballService=new a.default(e)}},8808:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8900),a=n(5601),o=n(595),u=n(4289);t.default=function(e){var t=this;this.https=null,this.idMapping=null,this.localStorage=null,this.footballFacade=null,this.getCountries=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getCountries(e)];case 1:return[2,t.sent()]}}))}))},this.getCompetitions=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getCompetitions(e,n)];case 1:return[2,t.sent()]}}))}))},this.getCompetitionById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getCompetitionById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTopCompetitions=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTopCompetitions(e)];case 1:return[2,t.sent()]}}))}))},this.getTeams=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTeams(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTeamById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTeamById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTopTeams=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTopTeams(e)];case 1:return[2,t.sent()]}}))}))},this.getNextMatchForTeam=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getNextMatchForTeam(e,n)];case 1:return[2,t.sent()]}}))}))},this.getPrevMatchForTeam=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getPrevMatchForTeam(e,n)];case 1:return[2,t.sent()]}}))}))},this.getPlayers=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getPlayers(e,n)];case 1:return[2,t.sent()]}}))}))},this.getPlayerById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getPlayerById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTopPlayers=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getTopPlayers(e)];case 1:return[2,t.sent()]}}))}))},this.getNextMatchForPlayer=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getNextMatchForPlayer(e,n)];case 1:return[2,t.sent()]}}))}))},this.getPrevMatchForPlayer=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getPrevMatchForPlayer(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMatches=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getMatches(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMatchById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.getMatchById(e,n)];case 1:return[2,t.sent()]}}))}))},this.search=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.footballFacade.search(e,n)];case 1:return[2,t.sent()]}}))}))},this.https=new o.default(e),this.idMapping=new s.default(e),this.localStorage=new a.default(e),this.footballFacade=new u.default(e,this.localStorage,this.https,this.idMapping)}},6975:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.type="",this.name=""}},2754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.countryId=null,this.name=null,this.gender=null,this.type=null,this.sortField=null,this.sortOrder=null,this.competitionIds=null,this.constructFilterUrl=function(){var e="";return t.countryId&&(e=(e+="&")+"country_id="+t.countryId),t.gender&&(e=(e+="&")+"gender="+t.gender),t.type&&(e=(e+="&")+"type="+t.type),t.sortField&&(e=(e+="&")+"sort_field="+t.sortField),t.sortOrder&&(e=(e+="&")+"sort_order="+t.sortOrder),t.name&&(e=(e+="&")+"name="+t.name),t.competitionIds&&(e=(e+="&")+"competition_ids="+t.competitionIds.join(",")),e},this.competitionSearchFilter=function(e){try{var n=t.filter(e);return t.sortField||t.sortOrder?t.sort(n):n}catch(e){return console.warn("There was a problem filtering the local competitions",e),[]}},this.filter=function(e){var n=t.entitiesToSearchWith();return e.filter((function(e){var r=!0;return n.forEach((function(n){"sortOrder"!==n&&"sortField"!==n&&("countryId"===n?r&&(r=e.country.id===t[n]):"name"===n?r&&(r=e.name.toLocaleLowerCase().includes(t[n].toLocaleLowerCase())):"competitionIds"===n?r&&(r=t[n].some((function(t){return e.id===t}))):r&&(r=e[n].toLocaleLowerCase()===t[n].toLocaleLowerCase()))})),r}))},this.entitiesToSearchWith=function(){var e=[];return t.countryId&&e.push("countryId"),t.name&&e.push("name"),t.gender&&e.push("gender"),t.type&&e.push("type"),t.sortField&&e.push("sortField"),t.sortOrder&&e.push("sortOrder"),t.competitionIds&&e.push("competitionIds"),e},this.sort=function(e){var n=[];return"name"===t.sortField?n=e.sort((function(e,n){return t.sortOrder&&"desc"===t.sortOrder?n.name.localeCompare(e.name):e.name.localeCompare(n.name)})):"country"===t.sortField?n=e.sort((function(e,n){return t.sortOrder&&"desc"===t.sortOrder?n.country.name.localeCompare(e.country.name):e.country.name.localeCompare(n.country.name)})):"scope"===t.sortField?e.forEach((function(e){return n[t.competitionIds.indexOf(e.id)]=e})):t.sortField||"desc"!==t.sortOrder||(n=e.sort((function(e,t){return t.id.localeCompare(e.id)}))),n},this.countryId=e.countryId?""+e.countryId:null,this.name=e.name?e.name:null,this.gender=e.gender?e.gender:null,this.type=e.type?e.type:null,this.sortField=e.sortField?""+e.sortField:null,this.sortOrder=e.sortOrder?""+e.sortOrder:null,this.competitionIds=e.competitionIds?e.competitionIds:null}},3321:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.type="",this.name="",this.participants=[]}},7316:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6975),i=n(3430),s=function(){function e(){this.countryRemapper=null,this.countryRemapper=new i.default}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.id=e.id,t.country=this.countryRemapper.countryFromResponse(e.country),t.gender=e.gender,t.assets=e.assets,t.type=e.type,t.name=e.name,t}catch(e){throw console.warn("There was a problem remapping the competition response",e),e}},e}();t.default=s},8758:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3321),i=n(3430),s=n(5827),a=function(){function e(){this.countryRemapper=null,this.teamBasicRemapper=null,this.countryRemapper=new i.default,this.teamBasicRemapper=new s.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new r.default;return n.id=e.id,n.country=this.countryRemapper.countryFromResponse(e.country),n.gender=e.gender,n.assets=e.assets,n.type=e.type,n.name=e.name,n.participants=e.participants.map((function(e){return t.teamBasicRemapper.fromResponse(e)})),n}catch(e){throw console.warn("There was a problem remapping the competition response",e),e}},e}();t.default=a},4427:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.alias="",this.countryCode="",this.assets=null,this.name=""}},3430:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4427);t.default=function(){var e=this;this.countriesFromResponse=function(t){if(t)return t.map((function(t){return e.countryFromResponse(t)}))},this.countryFromResponse=function(e){try{if(e){var t=new r.default;return t.id=e.id,t.alias=e.alias,t.assets=e.assets,t.countryCode=e.country_code,t.name=e.name,t}}catch(e){throw e}return null}}},8470:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.homeTeam={players:[]},this.awayTeam={players:[]}}},3098:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8470),i=n(3550),s=function(){function e(){this.playerRemapper=null,this.playerRemapper=new i.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new r.default;return n.homeTeam.players=e.home_team&&e.home_team.players?e.home_team.players.map((function(e){return t.playerRemapper.fromResponse(e)})):[],n.awayTeam.players=e.away_team&&e.away_team.players?e.away_team.players.map((function(e){return t.playerRemapper.fromResponse(e)})):[],n}catch(e){throw console.warn("There was a problem remapping the lineups",e),e}},e}();t.default=s},2579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.kickoffAt="",this.finishedAt="",this.updatedAt="",this.availableMarkets=null,this.homeTeam=null,this.awayTeam=null,this.isDeleted=!1,this.lineupsConfirmed=!1,this.startedAt="",this.minute="",this.scores=null,this.context={competition:null},this.status={type:null,subType:null}}},6134:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.countryIds=null,this.competitionIds=null,this.matchIds=null,this.status=null,this.teamIds=null,this.fromDate=null,this.toDate=null,this.limit=null,this.page=null,this.sortField=null,this.sortOrder=null,this.constructFilterUrl=function(){var e="";return t.countryIds&&(e=(e+="&")+"countries="+t.countryIds.join(",")),t.competitionIds&&(e=(e+="&")+"competitions="+t.competitionIds.join(",")),t.matchIds&&(e=(e+="&")+"matches="+t.matchIds.join(",")),t.status&&(e=(e+="&")+"status="+t.status),t.teamIds&&(e=(e+="&")+"teams="+t.teamIds.join(",")),t.fromDate&&(e=(e+="&")+"from_date="+t.fromDate),t.toDate&&(e=(e+="&")+"to_date="+t.toDate),t.limit&&(e=(e+="&")+"limit="+t.limit),t.page&&(e=(e+="&")+"page="+t.page),t.sortField&&(e=(e+="&")+"sort_field="+t.sortField),t.sortOrder&&(e=(e+="&")+"sort_order="+t.sortOrder),e},this.countryIds=e.countryIds?e.countryIds:null,this.competitionIds=e.competitionIds?e.competitionIds:null,this.matchIds=e.matchIds?e.matchIds:null,this.status=e.status?e.status:null,this.teamIds=e.teamIds?e.teamIds:null,this.fromDate=e.fromDate?e.fromDate:null,this.toDate=e.toDate?e.toDate:null,this.limit=e.limit?e.limit:null,this.page=e.page?e.page:null,this.sortField=e.sortField?e.sortField:null,this.sortOrder=e.sortOrder?e.sortOrder:null}},9661:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6899);t.default=function(){this.id="",this.kickoffAt="",this.finishedAt="",this.updatedAt="",this.availableMarkets=null,this.isDeleted=!1,this.homeTeam=null,this.awayTeam=null,this.lineupsConfirmed=!1,this.startedAt="",this.minute="",this.scores=null,this.stats=null,this.context={competition:null},this.timeline=[],this.status=new r.default,this.lineups=null}},5284:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2579),i=n(5827),s=n(7316),a=n(3949),o=function(){function e(){this.teamRemapper=null,this.competitionRemapper=null,this.scoresRemapper=null,this.teamRemapper=new i.default,this.competitionRemapper=new s.default,this.scoresRemapper=new a.default}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.id=e.id,t.kickoffAt=e.kickoff_at,t.finishedAt=e.finished_at,t.updatedAt=e.updated_at,t.isDeleted=e.is_deleted,t.homeTeam=this.teamRemapper.fromResponse(e.home_team),t.awayTeam=this.teamRemapper.fromResponse(e.away_team),t.lineupsConfirmed=e.lineups_confirmed,t.startedAt=e.started_at,t.minute=e.minute,t.scores=this.scoresRemapper.fromResponse(e.scores),t.context={competition:e.context.competition?this.competitionRemapper.fromResponse(e.context.competition):null},t.status={type:e.status.type,subType:e.status.sub_type},t}catch(e){throw console.warn("There was a problem remapping the match response",e),e}},e}();t.default=o},9330:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9661),i=n(5827),s=n(7316),a=n(7122),o=n(3949),u=n(3098),l=n(8470),c=n(92),d=function(){function e(){this.teamMapper=null,this.competitionsMapper=null,this.lineupsMapper=null,this.scoresMapper=null,this.statsMapper=null,this.timelineMapper=null,this.teamMapper=new i.default,this.competitionsMapper=new s.default,this.lineupsMapper=new u.default,this.scoresMapper=new o.default,this.statsMapper=new a.default,this.timelineMapper=new c.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new r.default;return n.id=e.id,n.kickoffAt=e.kickoff_at,n.finishedAt=e.finished_at,n.updatedAt=e.updated_at,n.isDeleted=e.is_deleted,n.homeTeam=e.home_team?this.teamMapper.fromResponse(e.home_team):null,n.awayTeam=e.away_team?this.teamMapper.fromResponse(e.away_team):null,n.lineupsConfirmed=e.lineups_confirmed,n.startedAt=e.started_at,n.minute=e.minute,n.scores=this.scoresMapper.fromResponse(e.scores),n.stats=this.statsMapper.fromResponse(e.stats),n.context={competition:this.competitionsMapper.fromResponse(e.context.competition)},n.timeline=e.timeline?e.timeline.map((function(e){return t.timelineMapper.fromResponse(e)})):[],n.status={type:e.status.type,subType:e.status.sub_type},n.lineups=e.lineups?this.lineupsMapper.fromResponse(e.lineups):new l.default,n}catch(e){throw console.warn("There was a problem remapping the match response",e),e}},e}();t.default=d},4652:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.ftScore=null,this.htScore=null,this.aetScore=null,this.aggScore=null,this.penScore=null}},3949:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4652),i=function(){function e(){this.statEntityFromResponse=function(e){return{homeGoals:e.home_goals,awayGoals:e.away_goals}}}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.ftScore=this.statEntityFromResponse(e.ft_score),t.htScore=this.statEntityFromResponse(e.ht_score),t.aetScore=this.statEntityFromResponse(e.aet_score),t.aggScore=this.statEntityFromResponse(e.agg_score),t.penScore=this.statEntityFromResponse(e.pen_score),t}catch(e){throw console.warn("There was a problem remapping the scores",e),e}},e}();t.default=i},7950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.corners=null,this.cornersFirstHalf=null,this.cornersSecondHalf=null,this.cornersExtraTime=null,this.crosses=null,this.crossesFirstHalf=null,this.crossesSecondHalf=null,this.crossesExtraTime=null,this.offside=null,this.offsideFirstHalf=null,this.offsideSecondHalf=null,this.offsideExtraTime=null,this.shotsOn=null,this.shotsOnFirstHalf=null,this.shotsOnSecondHalf=null,this.shotsOnExtraTime=null,this.throwIn=null,this.throwInFirstHalf=null,this.throwInSecondHalf=null,this.throwInExtraTime=null,this.redCards=null,this.redCardsFirstHalf=null,this.redCardsSecondHalf=null,this.redCardsExtraTime=null,this.shotsOff=null,this.shotsOffFirstHalf=null,this.shotsOffSecondHalf=null,this.shotsOffExtraTime=null,this.goalKicks=null,this.goalKicksFirstHalf=null,this.goalKicksSecondHalf=null,this.goalKicksExtraTime=null,this.possession=null,this.possessionFirstHalf=null,this.possessionSecondHalf=null,this.possessionExtraTime=null,this.treatments=null,this.treatmentsFirstHalf=null,this.treatmentsSecondHalf=null,this.treatmentsExtraTime=null,this.yellowCards=null,this.yellowCardsFirstHalf=null,this.yellowCardsSecondHalf=null,this.yellowCardsExtraTime=null,this.shotsBlocked=null,this.shotsBlockedFirstHalf=null,this.shotsBlockedSecondHalf=null,this.shotsBlockedExtraTime=null,this.substitutions=null,this.substitutionsFirstHalf=null,this.substitutionsSecondHalf=null,this.substitutionsExtraTime=null,this.counterAttacks=null,this.counterAttacksFirstHalf=null,this.counterAttacksSecondHalf=null,this.counterAttacksExtraTime=null,this.foulsCommitted=null,this.foulsCommittedFirstHalf=null,this.foulsCommittedSecondHalf=null,this.foulsCommittedExtraTime=null}},7122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7950),i=function(){function e(){this.statEntityFromResponse=function(e){return{homeTeam:e?e.home_team:null,awayTeam:e?e.away_team:null}}}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.corners=this.statEntityFromResponse(e.corners),t.cornersFirstHalf=this.statEntityFromResponse(e.corners_1h),t.cornersSecondHalf=this.statEntityFromResponse(e.corners_2h),t.cornersExtraTime=this.statEntityFromResponse(e.corners_et),t.crosses=this.statEntityFromResponse(e.crosses),t.crossesFirstHalf=this.statEntityFromResponse(e.crosses_1h),t.crossesSecondHalf=this.statEntityFromResponse(e.crosses_2h),t.crossesExtraTime=this.statEntityFromResponse(e.crosses_et),t.offside=this.statEntityFromResponse(e.offside),t.offsideFirstHalf=this.statEntityFromResponse(e.offside_1h),t.offsideSecondHalf=this.statEntityFromResponse(e.offside_2h),t.offsideExtraTime=this.statEntityFromResponse(e.offside_et),t.shotsOn=this.statEntityFromResponse(e.shots_on),t.shotsOnFirstHalf=this.statEntityFromResponse(e.shots_on_1h),t.shotsOnSecondHalf=this.statEntityFromResponse(e.shots_on_2h),t.shotsOnExtraTime=this.statEntityFromResponse(e.shots_on_et),t.throwIn=this.statEntityFromResponse(e.throw_in),t.throwInFirstHalf=this.statEntityFromResponse(e.throw_in_1h),t.throwInSecondHalf=this.statEntityFromResponse(e.throw_in_2h),t.throwInExtraTime=this.statEntityFromResponse(e.throw_in_et),t.redCards=this.statEntityFromResponse(e.red_cards),t.redCardsFirstHalf=this.statEntityFromResponse(e.red_cards_1h),t.redCardsSecondHalf=this.statEntityFromResponse(e.red_cards_2h),t.redCardsExtraTime=this.statEntityFromResponse(e.red_cards_et),t.shotsOff=this.statEntityFromResponse(e.shots_off),t.shotsOffFirstHalf=this.statEntityFromResponse(e.shots_off_1h),t.shotsOffSecondHalf=this.statEntityFromResponse(e.shots_off_2h),t.shotsOffExtraTime=this.statEntityFromResponse(e.shots_off_et),t.goalKicks=this.statEntityFromResponse(e.goal_kicks),t.goalKicksFirstHalf=this.statEntityFromResponse(e.goal_kicks_1h),t.goalKicksSecondHalf=this.statEntityFromResponse(e.goal_kicks_2h),t.goalKicksExtraTime=this.statEntityFromResponse(e.goal_kicks_et),t.possession=this.statEntityFromResponse(e.possession),t.possessionFirstHalf=this.statEntityFromResponse(e.possession_1h),t.possessionSecondHalf=this.statEntityFromResponse(e.possession_2h),t.possessionExtraTime=this.statEntityFromResponse(e.possession_et),t.treatments=this.statEntityFromResponse(e.treatments),t.treatmentsFirstHalf=this.statEntityFromResponse(e.treatments_1h),t.treatmentsSecondHalf=this.statEntityFromResponse(e.treatments_2h),t.treatmentsExtraTime=this.statEntityFromResponse(e.treatments_et),t.yellowCards=this.statEntityFromResponse(e.yellow_cards),t.yellowCardsFirstHalf=this.statEntityFromResponse(e.yellow_cards_1h),t.yellowCardsSecondHalf=this.statEntityFromResponse(e.yellow_cards_2h),t.yellowCardsExtraTime=this.statEntityFromResponse(e.yellow_cards_et),t.shotsBlocked=this.statEntityFromResponse(e.shots_blocked),t.shotsBlockedFirstHalf=this.statEntityFromResponse(e.shots_blocked_1h),t.shotsBlockedSecondHalf=this.statEntityFromResponse(e.shots_blocked_2h),t.shotsBlockedExtraTime=this.statEntityFromResponse(e.shots_blocked_et),t.substitutions=this.statEntityFromResponse(e.substitutions),t.substitutionsFirstHalf=this.statEntityFromResponse(e.substitutions_1h),t.substitutionsSecondHalf=this.statEntityFromResponse(e.substitutions_2h),t.substitutionsExtraTime=this.statEntityFromResponse(e.substitutions_et),t.counterAttacks=this.statEntityFromResponse(e.counter_attacks),t.counterAttacksFirstHalf=this.statEntityFromResponse(e.counter_attacks_1h),t.counterAttacksSecondHalf=this.statEntityFromResponse(e.counter_attacks_2h),t.counterAttacksExtraTime=this.statEntityFromResponse(e.counter_attacks_et),t.foulsCommitted=this.statEntityFromResponse(e.fouls_committed),t.foulsCommittedFirstHalf=this.statEntityFromResponse(e.fouls_committed_1h),t.foulsCommittedSecondHalf=this.statEntityFromResponse(e.fouls_committed_2h),t.foulsCommittedExtraTime=this.statEntityFromResponse(e.fouls_committed_et),t}catch(e){throw console.warn("There was a problem remapping the stats",e),e}},e}();t.default=i},6899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.type=null,this.subType=null}},9452:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.minute="",this.type="",this.teamId="",this.player=null,this.relatedPlayer=null,this.updatedAt=""}},92:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9452),i=n(3550),s=function(){function e(){this.playerRemapper=null,this.playerRemapper=new i.default}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.minute=e.minute,t.type=e.type,t.teamId=e.team_id,t.player=this.playerRemapper.fromResponse(e.player),t.relatedPlayer=e.related_player?this.playerRemapper.fromResponse(e.related_player):null,t.updatedAt=e.updated_at,t}catch(e){throw console.warn("There was a problem remapping timeline",e),e}},e}();t.default=s},753:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3569);t.default=function(){this.meta=new r.default,this.data=[]}},3569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(155);t.default=function(){this.pagination=new r.default}},155:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.currentPage=null,this.itemsPerPage=null,this.totalItems=null,this.numberOfPages=null}},1925:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3569);t.default=function(){this.remapMetaProp=function(e){var t=new r.default;return t.pagination.currentPage=e.pagination.current_page,t.pagination.itemsPerPage=e.pagination.items_per_page,t.pagination.totalItems=e.pagination.total_items,t.pagination.numberOfPages=e.pagination.number_of_pages,t}}},4426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null,this.isDeleted=!1,this.teams=[]}},6477:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.countryId=null,this.scope=null,this.name=null,this.playerIds=null,this.limit=null,this.page=null,this.sortField=null,this.sortOrder=null,this.constructFilterUrl=function(){var e="";return t.countryId&&(e=(e+="&")+"country_id="+t.countryId),t.scope&&(e=(e+="&")+"scope="+t.scope.join(",")),t.name&&(e=(e+="&")+"name="+t.name),t.playerIds&&(e=(e+="&")+"player_ids="+t.playerIds.join(",")),t.limit&&(e=(e+="&")+"limit="+t.limit),t.page&&(e=(e+="&")+"page="+t.page),t.sortField&&(e=(e+="&")+"sort_field="+t.sortField),t.sortOrder&&(e=(e+="&")+"sort_order="+t.sortOrder),e},this.countryId=e.countryId?e.countryId:null,this.scope=e.scope?e.scope:null,this.name=e.name?e.name:null,this.playerIds=e.playerIds?e.playerIds:null,this.limit=e.limit?e.limit:null,this.page=e.page?e.page:null,this.sortField=e.sortField?e.sortField:null,this.sortOrder=e.sortOrder?e.sortOrder:null}},1837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null,this.isDeleted=!1,this.competitions=[],this.teams=[]}},4803:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.name="",this.position="",this.assets=null,this.type=""}},9071:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.startDate="",this.endDate="",this.loan=!1,this.position="",this.country=null,this.name="",this.assets=null,this.birthDate=""}},5157:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(4426),s=n(5827),a=function(){function e(){this.countryRemapper=null,this.teamRemapper=null,this.countryRemapper=new r.default,this.teamRemapper=new s.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new i.default;return n.id=e.id,n.firstName=e.first_name?e.first_name:null,n.lastName=e.last_name?e.last_name:null,n.name=e.name?e.name:null,n.birthDate=e.birth_date,n.country=this.countryRemapper.countryFromResponse(e.country),n.assets=e.assets,n.teams=e.teams?e.teams.map((function(e){return t.teamRemapper.fromResponse(e)})):[],n.position=e.position,n.isDeleted=e.is_deleted,n}catch(e){throw console.warn("There was a problem remapping players response",e),e}},e}();t.default=a},7943:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(1837),s=n(5827),a=n(7316),o=function(){function e(){this.countryRemapper=null,this.teamRemapper=null,this.competitionRemapper=null,this.countryRemapper=new r.default,this.teamRemapper=new s.default,this.competitionRemapper=new a.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new i.default;return n.id=e.id,n.firstName=e.first_name?e.first_name:null,n.lastName=e.last_name?e.last_name:null,n.name=e.name?e.name:null,n.birthDate=e.birth_date,n.country=this.countryRemapper.countryFromResponse(e.country),n.assets=e.assets,n.teams=e.teams?e.teams.map((function(e){return t.teamRemapper.fromResponse(e)})):[],n.position=e.position,n.isDeleted=e.is_deleted,n.competitions=e.competitions?e.competitions.map((function(e){return t.competitionRemapper.fromResponse(e)})):[],n}catch(e){throw console.warn("There was a problem remapping player response",e),e}},e}();t.default=o},3550:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4803),i=function(){function e(){}return e.prototype.fromResponse=function(e){try{var t=new r.default;return t.id=e.id,t.name=e.name,t.position=e.position,t.shirtNumber=e.shirt_number,t.assets=e.assets,t.type=e.type,t}catch(e){throw console.warn("There was a problem remapping the player from timeline",e),e}},e}();t.default=i},4085:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(9071),s=function(){function e(){this.countryRemapper=null,this.countryRemapper=new r.default}return e.prototype.fromResponse=function(e){try{var t=new i.default;return t.id=e.id,t.startDate=e.start_date,t.endDate=e.end_date,t.shirtNumber=e.shirt_number,t.loan=e.loan,t.position=e.position,t.country=this.countryRemapper.countryFromResponse(e.country),t.name=e.name,t.assets=e.assets,t.birthDate=e.birth_date,t}catch(e){throw console.warn("There was a problem remapping the player from squad",e),e}},e}();t.default=s},4729:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(56),s=function(){function e(){this.countryRemapper=null,this.countryRemapper=new r.default}return e.prototype.fromResponse=function(e){try{var t=new i.default;return t.id=e.id,t.firstName=e.first_name?e.first_name:null,t.lastName=e.last_name?e.last_name:null,t.name=e.name?e.name:null,t.birthDate=e.birth_date,t.country=this.countryRemapper.countryFromResponse(e.country),t.assets=e.assets,t.position=e.position,t}catch(e){throw console.warn("There was a problem remapping top player response",e),e}},e}();t.default=s},56:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null}},604:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.entities=null,this.query=null,this.scope=null,this.constructFilterUrl=function(){var e="";return t.entities&&(e=(e+="&")+"entities="+t.entities.join(",")),t.query&&(e=(e+="&")+"q="+t.query),t.scope&&(e=(e+="&")+"scope="+t.scope.join(",")),e},this.entities=e.entities?e.entities:null,this.query=e.query?e.query:null,this.scope=e.scope?e.scope:null}},6967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.teams=null,this.players=null,this.competitions=null}},7287:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5827),i=n(5157),s=n(7316),a=n(6967),o=function(){function e(){this.teamRemapper=null,this.playerRemapper=null,this.competitionremapper=null,this.teamRemapper=new r.default,this.playerRemapper=new i.default,this.competitionremapper=new s.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new a.default;return n.teams=e.teams?e.teams.map((function(e){return t.teamRemapper.fromResponse(e)})):[],n.players=e.players?e.players.map((function(e){return t.playerRemapper.fromResponse(e)})):[],n.competitions=e.competitions?e.competitions.map((function(e){return t.competitionremapper.fromResponse(e)})):[],n}catch(e){throw console.warn("There was a problem remapping search response",e),e}},e}();t.default=o},5827:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(9314),s=function(){function e(){this.countryRemapper=null,this.countryRemapper=new r.default}return e.prototype.fromResponse=function(e){try{var t=new i.default;return t.id=e.id,t.country=this.countryRemapper.countryFromResponse(e.country),t.gender=e.gender,t.assets=e.assets,t.code=e.code,t.national=e.national,t.fullName=e.full_name,t.shortName=e.short_name,t.name=e.name,t.isDeleted=e.is_deleted,t}catch(e){throw console.warn("There was a problem remapping teams response",e),e}},e}();t.default=s},7821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3430),i=n(1986),s=n(4085),a=n(7316),o=function(){function e(){this.countryRemapper=null,this.competitionRemapper=null,this.playerRemapper=null,this.countryRemapper=new r.default,this.competitionRemapper=new a.default,this.playerRemapper=new s.default}return e.prototype.fromResponse=function(e){var t=this;try{var n=new i.default;return n.id=e.id,n.country=this.countryRemapper.countryFromResponse(e.country),n.gender=e.gender,n.assets=e.assets,n.code=e.code,n.national=e.national,n.fullName=e.full_name,n.shortName=e.short_name,n.name=e.name,n.isDeleted=e.is_deleted,n.competitions=e.competitions?e.competitions.map((function(e){return t.competitionRemapper.fromResponse(e)})):[],n.colors=e.colors?e.colors:n.colors,n.squad=e.squad?e.squad.map((function(e){return t.playerRemapper.fromResponse(e)})):[],n}catch(e){throw console.warn("There was a problem remapping team response",e),e}},e}();t.default=o},9314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.name="",this.code="",this.national=!1,this.fullName="",this.shortName="",this.isDeleted=!1}},3773:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.primary=null,this.secondary=null,this.tertiary=null}},9920:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.name=null,this.countryId=null,this.national=!1,this.gender=null,this.limit=null,this.page=null,this.scope=null,this.sortField=null,this.sortOrder=null,this.teamIds=null,this.constructFilterUrl=function(){var e="";return t.name&&(e=(e+="&")+"name="+t.name),t.countryId&&(e=(e+="&")+"country_id="+t.countryId),t.national&&(e=(e+="&")+"national="+t.national),t.gender&&(e=(e+="&")+"gender="+t.gender),t.limit&&(e=(e+="&")+"limit="+t.limit),t.scope&&(e=(e+="&")+"scope="+t.scope.join(",")),t.page&&(e=(e+="&")+"page="+t.page),t.sortField&&(e=(e+="&")+"sort_field="+t.sortField),t.sortOrder&&(e=(e+="&")+"sort_order="+t.sortOrder),t.teamIds&&(e=(e+="&")+"team_ids="+t.teamIds.join(",")),e},this.name=e.name?e.name:null,this.countryId=e.countryId?""+e.countryId:null,this.national=!!e.national&&e.national,this.gender=e.gender?e.gender:null,this.limit=e.limit?e.limit:null,this.page=e.page?e.page:null,this.scope=e.scope?e.scope:null,this.sortField=e.sortField?""+e.sortField:null,this.sortOrder=e.sortOrder?""+e.sortOrder:null,this.teamIds=e.teamIds?e.teamIds:null}},1986:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3773);t.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.name="",this.competitions=[],this.code="",this.national=!1,this.fullName="",this.shortName="",this.isDeleted=!1,this.colors=new r.default,this.squad=[]}},9582:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(7686);t.default=function(e){var t=this;this.clientHttps=null,this.setAvailableMarketsForMatch=function(e){return r(t,void 0,void 0,(function(){var t,n,r,a=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.clientHttps.getConfig(s.FeatureConfigType.PREDICTOR)];case 1:return t=i.sent(),n=t.fullCoverageCompetitions,r=t.markets,Array.isArray(e)?[2,e.map((function(e){return a.setAvailableMarkets(e,n,r)}))]:"object"==typeof e&&Object.keys(e).length?[2,this.setAvailableMarkets(e,n,r)]:[2]}}))}))},this.setAvailableMarkets=function(e,n,r){var i,s=null===(i=e.context.competition)||void 0===i?void 0:i.id;return s&&t.isMatchInCoverageCompetition(s,n)?(e.availableMarkets=r.all,e):(e.availableMarkets=r.main,e)},this.isMatchInCoverageCompetition=function(e,t){var n=!1;return t.includes(e)?n=!0:n},this.clientHttps=new s.default(e)}},3822:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var a=n(4946),o=n(7686),u=n(3142),l=n(7232),c=n(1139),d=n(9502),h=n(8900),p=n(1859),f=n(2793),m=n(3247);t.default=function(e,t,n,v,y){var g=this;this.config=null,this.clientHttps=null,this.loyaltyHttps=null,this.loyaltyService=null,this.profileFacade=null,this.loyaltyValidator=null,this.idMapping=null,this.topXFacade=null,this.matchQuizFacade=null,this.predictorHttps=null,this.errorHandlingMode=null,this.getConfig=function(){return r(g,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.clientHttps.getConfig(o.FeatureConfigType.LOYALTY)];case 1:return[2,e.sent()]}}))}))},this.getClientBadges=function(){return r(g,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return e=t.sent(),[2,this.loyaltyService.buildClientBadges(e.rewards.badges)]}}))}))},this.getTemplates=function(e){return r(g,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=!0,this.config.idSchema!==a.IdSchemaEnum.NATIVE?[3,2]:[4,this.loyaltyHttps.getTemplates(e,t)];case 1:return[2,i.sent()];case 2:return[4,this.loyaltyHttps.getTemplates(e,t)];case 3:return n=i.sent(),r=n,[4,this.loyaltyService.remapTemplatesIds(s([],n.data,!0))];case 4:return r.data=i.sent(),[2,n]}}))}))},this.getTemplateById=function(e,t){return r(g,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.loyaltyHttps.getTemplateById(e,t)];case 1:return n=r.sent(),this.config.idSchema===a.IdSchemaEnum.NATIVE?[2,n]:[4,this.loyaltyService.remapTemplatesIds([n])];case 2:return[2,r.sent()[0]]}}))}))},this.getLeaderboard=function(e,t,n){return r(g,void 0,void 0,(function(){var r,s;return i(this,(function(i){switch(i.label){case 0:return t=this.loyaltyService.initFilters(t,"loyalty"),[4,this.loyaltyHttps.getLeaderboard(e,n,t)];case 1:return r=i.sent(),s=r,[4,this.loyaltyService.addProfileModelToLeaderboad(r.data)];case 2:return s.data=i.sent(),[2,r]}}))}))},this.getLeaderboardForGame=function(e,t,n){return r(g,void 0,void 0,(function(){var r,s;return i(this,(function(i){switch(i.label){case 0:return t=this.loyaltyService.initFilters(t,"loyalty"),[4,this.loyaltyHttps.getLeaderboardForGame(e,n,t)];case 1:return r=i.sent(),s=r,[4,this.loyaltyService.addProfileModelToLeaderboad(r.data)];case 2:return s.data=i.sent(),[2,r]}}))}))},this.getOwnRankings=function(e,t){return r(g,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.profileFacade.getOwn()];case 1:return n=r.sent().id,[2,this.getUserRankings(n,e,t)]}}))}))},this.getUserRankings=function(e,t,n){return r(g,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return t=this.loyaltyService.initFilters(t,"rankings"),[4,this.loyaltyHttps.getUserRankings(e,t,n)];case 1:return r=i.sent(),[4,this.getModelsForUserRankings(r)];case 2:return[2,i.sent()]}}))}))},this.getHighestSuccessRate=function(e,t){return r(g,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return e&&(e=new m.default(e),this.loyaltyValidator.validate(e,this.errorHandlingMode)),[4,this.loyaltyHttps.getHighestSuccessRate(e,t)];case 1:return n=r.sent(),[2,this.loyaltyService.addProfileModelToHighestSuccessRate(n)]}}))}))},this.getTemplateWinners=function(e){return r(g,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(e)];case 1:return t=r.sent(),[4,this.getTemplateById(e)];case 2:return n=r.sent(),t.contestModel=n,[2,this.loyaltyService.completeContestWinners(t)]}}))}))},this.getEntitiesFollows=function(e,t){return r(g,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return this.loyaltyService.validateEntitiesFollowsFilters(e),this.config.idSchema===a.IdSchemaEnum.NATIVE?[3,2]:[4,this.loyaltyService.remapEntitiesFollowsFilters(e)];case 1:e=r.sent(),r.label=2;case 2:return[4,this.loyaltyHttps.getEntitiesFollows(e,t)];case 3:return n=r.sent(),[4,this.loyaltyService.addModelsToEntitiesFollows(n)];case 4:return[2,r.sent()]}}))}))},this.getModelsForUserRankings=function(e){return r(g,void 0,void 0,(function(){var t,n,r,s,a,o,u,l,c,d,h,p;return i(this,(function(i){switch(i.label){case 0:return t=null,n=null,r=null,s=this.loyaltyService.extractRankingsIdsMap(e.data),a=s[0],o=s[1],(u=s[2]).length?[4,this.getTemplates()]:[3,2];case 1:l=i.sent(),t=l.data.filter((function(e){return u.includes(e.id)})),i.label=2;case 2:return a.length?(c={gameIds:a},[4,this.topXFacade.getGames(c)]):[3,4];case 3:d=i.sent(),n=d.data,i.label=4;case 4:return o.length?(h={gameIds:o},[4,this.matchQuizFacade.getGames(h)]):[3,6];case 5:p=i.sent(),r=p.data,i.label=6;case 6:return[2,this.loyaltyService.setModelsForUserRankings(n,r,t,e)]}}))}))},this.config=e,this.clientHttps=t,this.loyaltyHttps=n,this.profileFacade=new l.default(y,v),this.loyaltyService=new u.default(this.config),this.loyaltyValidator=new c.default,this.idMapping=new h.default(e),this.topXFacade=new d.default(e,this.idMapping),this.matchQuizFacade=new p.default(e),this.predictorHttps=new f.default(e,this.idMapping),this.errorHandlingMode=e.errorHandlingMode}},2962:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(7686),a=n(7059),o=n(3822),u=n(4275),l=n(5601);t.default=function(e){var t=this;this.clientHttps=null,this.profileHttps=null,this.loyaltyHttps=null,this.loyaltyFacade=null,this.localStorage=null,this.getConfig=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getConfig()];case 1:return[2,e.sent()]}}))}))},this.getClientBadges=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getClientBadges()];case 1:return[2,e.sent()]}}))}))},this.getTemplates=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getTemplates(e)];case 1:return[2,t.sent()]}}))}))},this.getTemplateById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getTemplateById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getLeaderboard=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getLeaderboard(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getLeaderboardForGame=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getLeaderboardForGame(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getOwnRankings=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getOwnRankings(e,n)];case 1:return[2,t.sent()]}}))}))},this.getUserRankings=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getUserRankings(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getHighestSuccessRate=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getHighestSuccessRate(e,n)];case 1:return[2,t.sent()]}}))}))},this.getTemplateWinners=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getTemplateWinners(e)];case 1:return[2,t.sent()]}}))}))},this.getEntitiesFollows=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getEntitiesFollows(e,n)];case 1:return[2,t.sent()]}}))}))},this.clientHttps=new s.default(e),this.profileHttps=new u.default(e),this.loyaltyHttps=new a.default(e),this.localStorage=new l.default(e),this.loyaltyFacade=new o.default(e,this.clientHttps,this.loyaltyHttps,this.profileHttps,this.localStorage)}},8153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},5111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8153);t.default=function(){this.value=[new r.default]}},8608:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.general=[],this.predictor=[],this.topX=[],this.matchQuiz=[]}},246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1429);t.default=function(){this.assets={mainImageUrl:""},this.requirements=new r.default}},8687:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},1429:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.points=null,this.gameParticipationCount=null,this.entityId=null,this.entityType=null,this.predictionsMade=null,this.correctPredictions=null}},515:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5111),i=n(4226);t.default=function(){this.enabled=!1,this.clientId=null,this.conditions={list:null},this.actions=new r.default,this.rewards=new i.default}},3247:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.market=e.market?e.market:null,this.fromDate=e.fromDate?e.fromDate:null,this.toDate=e.toDate?e.toDate:null,this.usersCount=e.usersCount?e.usersCount:null,this.minimumPredictions=e.minimumPredictions?e.minimumPredictions:null}return e.prototype.constructFiltersUrl=function(){var e="";return this.market&&(e+="&",e+="market="+this.market),this.fromDate&&(e+="&",e+="from_date="+this.fromDate),this.toDate&&(e+="&",e+="to_date="+this.toDate),this.usersCount&&(e+="&",e+="users_count="+this.usersCount),this.minimumPredictions&&(e+="&",e+="minimum_predictions="+this.minimumPredictions),e},e}();t.default=n},7910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.limit=null,this.page=null,this.limit=e.limit?e.limit:null,this.page=e.page?e.page:null}return e.prototype.constructFiltersUrl=function(){var e="";return this.limit&&(e+="&",e+="limit="+this.limit),this.page&&(e+="&",e+="page="+this.page),e},e}();t.default=n},4996:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var n=e.call(this,t)||this;return n.sortOrder=null,n.rankType=null,n.leaderboardIds=null,n.gameType=null,n.constructFiltersUrl=function(){var t=e.prototype.constructFiltersUrl.call(n);return n.sortOrder&&(t+="&",t+="sort_order="+n.sortOrder),n.rankType&&(t+="&",t+="rank_type="+n.rankType),n.leaderboardIds&&(t+="&",t+="type_ids="+n.leaderboardIds.join(",")),n.gameType&&(t+="&",t+="game_type="+n.gameType),t},n.sortOrder=t.sortOrder,n.rankType=t.rankType,n.leaderboardIds=t.leaderboardIds,n.gameType=t.type&&"game"===t.type.toLowerCase()?t.gameType:null,n}return i(t,e),t}(n(7910).default);t.default=s},6507:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.position=null,this.points=null,this.predictionsMade=null,this.profileId=null,this.profileModel=null,this.successRatePercent=null}},7746:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6507);t.default=function(){this.remapHighestSuccessRate=function(e){return e.map((function(e){var t=new r.default;return t.position=e.position,t.points=e.points,t.predictionsMade=e.predictions_made,t.profileId=e.profile_id,t.successRatePercent=e.success_rate_percent,t}))}}},9642:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.position=null,this.profileId=null,this.profileModel=null,this.points=null,this.predictionsMade=null}},7419:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5828),i=n(9642);t.default=function(){var e=this;this.remapResponse=function(t){return t.meta=e.remapMeta(t.meta),t.data=e.remapData(t.data),t},this.remapMeta=function(e){var t=new r.default;return t.rankType=e.rank_type,t.fromDate=e.from_date,t.toDate=e.to_date,t.pagination.currentPage=e.pagination.current_page,t.pagination.itemsPerPage=e.pagination.items_per_page,t.pagination.totalItems=e.pagination.total_items,t.pagination.numberOfPages=e.pagination.number_of_pages,t},this.remapData=function(e){var t=[];return e.forEach((function(e){var n=new i.default;n.position=e.position,n.profileId=e.profile_id,n.points=e.points,n.predictionsMade=e.predictions_made,t.push(n)})),t}}},5828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(155);t.default=function(){this.rankType=null,this.fromDate=null,this.toDate=null,this.pagination=new r.default}},4187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.general=null,this.comments=null,this.predictor=null,this.activity=null,this.topX=null,this.matchQuiz=null}},9013:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.id=null,t.rankType=null,t.model=null,t.gameType=null,t}return i(t,e),t}(n(9642).default);t.default=s},4533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3569),i=n(9013),s=function(){function e(){var e=this;this.remapRankings=function(t){return t.meta=e.remapMeta(t.meta),t.data=e.remapData(t.data),t},this.remapMeta=function(e){var t=new r.default;return t.pagination.currentPage=e.pagination.current_page,t.pagination.itemsPerPage=e.pagination.items_per_page,t.pagination.numberOfPages=e.pagination.number_of_pages,t.pagination.totalItems=e.pagination.total_items,t}}return e.prototype.remapData=function(e){var t=[];return e.forEach((function(e){var n=new i.default;n.id=e.id,n.rankType=e.rank_type,n.position=e.position,n.points=e.points,n.gameType=e.game_type,delete n.profileId,delete n.profileModel,delete n.predictionsMade,t.push(n)})),t},e}();t.default=s},4226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.points=null,this.tiers=null,this.badges=null}},4982:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.labels=null,t.customFields=null,t.adContent=null,t}return i(t,e),t}(n(194).default);t.default=s},194:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(439);t.default=function(){this.id=null,this.name=null,this.description=null,this.type=null,this.fromDate=null,this.toDate=null,this.markets=[],this.teamIds=[],this.matchIds=[],this.gameIds=[],this.gameTypes=[],this.competitionIds=[],this.excludedProfileIds=[],this.rules=null,this.flags=null,this.images=new r.default,this.status=null,this.automaticallyChangeStatus=!0,this.createdAt=null,this.updatedAt=null,this.related=null}},8899:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3483),i=n(4982),s=n(194);t.default=function(){var e=this;this.remapResponse=function(t){var n=[];return t.forEach((function(t){var r=new s.default;r.id=t.id,r.name=t.name,r.description=t.description,r.type=t.type,r.fromDate=t.from_date,r.toDate=t.to_date,r.markets=t.markets?t.markets:null,r.teamIds=t.team_ids?t.team_ids:null,r.matchIds=t.match_ids?t.match_ids:null,r.gameIds=t.game_ids?t.game_ids:null,r.gameTypes=t.game_types?t.game_types:null,r.competitionIds=t.competition_ids?t.competition_ids:null,r.excludedProfileIds=t.excluded_profile_ids?t.excluded_profile_ids:null,r.rules=t.rules?t.rules:null,r.flags=t.flags?t.flags:null,r.images=t.images?t.images:null,r.status=t.status?t.status:null,r.automaticallyChangeStatus=t.automatically_change_status,r.createdAt=t.created_at,r.updatedAt=t.updated_at,r.related=t.related?e.remapRelated(t.related):null,n.push(r)})),n},this.remapResponseId=function(t){var n=new i.default;return n.id=t.id,n.name=t.name,n.description=t.description,n.type=t.type,n.fromDate=t.from_date,n.toDate=t.to_date,n.markets=t.markets?t.markets:null,n.teamIds=t.team_ids?t.team_ids:null,n.matchIds=t.match_ids?t.match_ids:null,n.gameIds=t.game_ids?t.game_ids:null,n.gameTypes=t.game_types?t.game_types:null,n.competitionIds=t.competition_ids?t.competition_ids:null,n.excludedProfileIds=t.excluded_profile_ids?t.excluded_profile_ids:null,n.rules=t.rules?t.rules:null,n.flags=t.flags?t.flags:null,n.images=t.images?t.images:null,n.status=t.status?t.status:null,n.automaticallyChangeStatus=t.automatically_change_status,n.related=t.related?e.remapRelated(t.related):null,n.labels=t.labels,n.customFields=t.custom_fields,n.adContent=t.ad_content,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapMeta=function(e){var t={};return t.totalItems=e.pagination.total_items,t},this.remapRelated=function(e){return e.map((function(e){var t=new r.default;return t.entityId=e.entity_id,t.entityType=e.entity_type,t}))}}},3142:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var a=n(4946),o=n(4021),u=n(4904),l=n(8097),c=n(2535),d=n(5318),h=n(8900),p=n(8808),f=n(6409),m=n(8687),v=n(7910),y=n(4996);t.default=function(e){var t=this;this.idMappingService=null,this.profileNamespace=null,this.footballNamespace=null,this.errorHandlingMode=null,this.remapTemplatesIds=function(e){return r(t,void 0,void 0,(function(){var t,n,r,a,o;return i(this,(function(i){switch(i.label){case 0:return e.length>0?(t=[],n=[],r=[],e.forEach((function(e){e.teamIds&&e.teamIds.length>0?t=s(s([],t,!0),e.teamIds,!0):e.matchIds&&e.matchIds.length>0?n=s(s([],n,!0),e.matchIds,!0):e.competitionIds&&e.competitionIds.length>0&&(r=s(s([],r,!0),e.competitionIds,!0))})),a={team:t,match:n,competition:r},[4,this.idMappingService.idMappingFacade.getEntitiesByIds(a,"native",this.idMappingService.idSchema)]):[3,2];case 1:return o=i.sent(),s([],o.team,!0),s([],o.match,!0),s([],o.competition,!0),e.forEach((function(e){e.teamIds&&e.teamIds.length>0?e.teamIds=e.teamIds.map((function(e){return o.team.shift()})):e.matchIds&&e.matchIds.length>0?e.matchIds=e.matchIds.map((function(e){return o.match.shift()})):e.competitionIds&&e.competitionIds.length>0&&(e.competitionIds=e.competitionIds.map((function(e){return o.competition.shift()})))})),[2,e];case 2:return[2,e]}}))}))},this.addProfileModelToLeaderboad=function(e){return r(t,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return e.length>0?(t=[],(n=e.map((function(e){return e.profileId}))).length?[4,this.profileNamespace.getByIds(n)]:[2,e]):[3,2];case 1:return r=i.sent(),e.forEach((function(e){r.forEach((function(t){t.id===e.profileId&&(delete t.interests,e.profileModel=t)})),e.profileModel||(e.profileModel=null),t.push(e)})),[2,t];case 2:return[2,e]}}))}))},this.buildClientBadges=function(e){var n=new m.default;return n.general=t.extractEnabledBadgesId(e.general),n.predictor=t.extractEnabledBadgesId(e.predictor),n.topX=t.extractEnabledBadgesId(e.topX),n.matchQuiz=t.extractEnabledBadgesId(e.matchQuiz),n},this.initFilters=function(e,t){switch(t){case"loyalty":e&&(e=new v.default(e));break;case"rankings":e&&(e=new y.default(e))}return e},this.addProfileModelToHighestSuccessRate=function(e){return r(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return(t=e.map((function(e){return e.profileId}))).length?[4,this.profileNamespace.getByIds(t)]:[2,e];case 1:return n=r.sent(),[2,e.map((function(e){return n.forEach((function(t){t.id===e.profileId&&(delete t.interests,e.profileModel=t)})),e}))]}}))}))},this.extractRankingsIdsMap=function(e){var t=[],n=[],r=[];return e.forEach((function(e){"GAME"===e.rankType&&"TOP_X"===e.gameType?t.push(e.id):"GAME"===e.rankType&&"MATCH_QUIZ"===e.gameType?n.push(e.id):"TEMPLATE"===e.rankType&&r.push(e.id)})),[t,n,r]},this.setModelsForUserRankings=function(e,t,n,r){return r.data.forEach((function(r){"MATCH_QUIZ"===r.gameType&&t?r.model=t.filter((function(e){return e.id===r.id}))[0]:"TOP_X"===r.gameType&&e?r.model=e.filter((function(e){return e.id===r.id}))[0]:"TEMPLATE"===r.rankType&&n&&(r.model=n.filter((function(e){return e.id===r.id}))[0])})),r},this.completeContestWinners=function(e){return r(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return t=e.userList.map((function(e){return e.profileId})),[4,this.profileNamespace.getByIds(t)];case 1:return n=r.sent(),e.userList.forEach((function(e){var t=n.filter((function(t){return t.id===e.profileId}))[0];delete t.interests,e.profileModel=t})),[2,e]}}))}))},this.validateEntitiesFollowsFilters=function(e){if(!e||!(e.footballCompetitions&&e.footballCompetitions.length||e.footballTeams&&e.footballTeams.length||e.footballPlayers&&e.footballPlayers.length)){if("default"===t.errorHandlingMode)throw new l.default(o.ErrorCodes.BAD_METHOD_CALL,u.ErrorStatuses.INVALID_FILTERS,d.ErrorMessages.ENTITIES_NEEDED);throw new c.default(o.ErrorCodes.BAD_METHOD_CALL,u.ErrorStatuses.INVALID_FILTERS,d.ErrorMessages.ENTITIES_NEEDED).response}if(e.footballCompetitions&&e.footballCompetitions.length>24||e.footballTeams&&e.footballTeams.length>24||e.footballPlayers&&e.footballPlayers.length>24){if("default"===t.errorHandlingMode)throw new l.default(o.ErrorCodes.BAD_METHOD_CALL,u.ErrorStatuses.EXCEEDED_LENGTH,d.ErrorMessages.ENTITIES_FOLLOWS_FILTERS_EXCEEDED);throw new c.default(o.ErrorCodes.BAD_METHOD_CALL,u.ErrorStatuses.EXCEEDED_LENGTH,d.ErrorMessages.ENTITIES_FOLLOWS_FILTERS_EXCEEDED).response}},this.remapEntitiesFollowsFilters=function(e){return r(t,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return t=JSON.parse(JSON.stringify(e)),n={},r={},t.footballCompetitions&&t.footballCompetitions.length&&(r.competition=t.footballCompetitions),t.footballTeams&&t.footballTeams.length&&(r.team=t.footballTeams),t.footballPlayers&&t.footballPlayers.length&&(r.player=t.footballPlayers),[4,this.idMappingService.idMappingFacade.getEntitiesByIds(r,this.idMappingService.idSchema,a.IdSchemaEnum.NATIVE)];case 1:return s=i.sent(),Object.keys(s).forEach((function(e){"competition"===e?n.footballCompetitions=s[e]:"team"===e?n.footballTeams=s[e]:"player"===e&&(n.footballPlayers=s[e])})),[2,n]}}))}))},this.addModelsToEntitiesFollows=function(e){return r(t,void 0,void 0,(function(){var t,n,r,s,a,o,u,l,c;return i(this,(function(i){switch(i.label){case 0:return t=[],n="fb:c:",r=new Map,s=[],a="fb:t:",o=new Map,u=[],l="fb:p:",c=null,e.breakdown.forEach((function(e){e.id.includes(n)?t.push(e.id):e.id.includes(a)?s.push(e.id):e.id.includes(l)&&u.push(e.id)})),t.length?[4,this.footballNamespace.footballFacade.competitionsFacade.getCompetitionsMapWithNativeIds(t)]:[3,2];case 1:r=i.sent(),i.label=2;case 2:return s.length?[4,this.footballNamespace.footballFacade.teamsFacade.getTeamsMapWithNativeIds(s)]:[3,4];case 3:o=i.sent(),i.label=4;case 4:return u.length?[4,this.footballNamespace.footballFacade.playerFacade.getPlayersMapWithNativeIds(u)]:[3,6];case 5:c=i.sent(),i.label=6;case 6:return e.breakdown.forEach((function(e){e.id.includes(n)?(e.model=r.get(e.id),e.id=e.model.id):e.id.includes(a)?(e.model=o.get(e.id),e.id=e.model.id):e.id.includes(l)&&(e.model=c[e.id],e.id=e.model.id)})),[2,e]}}))}))},this.extractEnabledBadgesId=function(e){var t=[];return e.forEach((function(e){e.enabled&&t.push(e.id)})),t},this.idMappingService=new h.default(e),this.profileNamespace=new f.default(e),this.footballNamespace=new p.default(e),this.errorHandlingMode=e.errorHandlingMode}},1139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4021),i=n(4904),s=n(8097),a=n(2535),o=n(5318),u=n(7974);t.default=function(){var e=this;this.validate=function(t,n){t.market&&e.validateMarket(t.market,n),t.fromDate&&e.validateDate(t.fromDate,"fromDate",n),t.toDate&&e.validateDate(t.toDate,"toDate",n),t.usersCount&&e.validateNumberFilters(t.usersCount,"usersCount",n),t.minimumPredictions&&e.validateNumberFilters(t.minimumPredictions,"minimumPredictions",n)},this.validateMarket=function(e,t){if(!Object.keys(u.MarketEnum).includes(e)){var n=(0,o.invalidMarketMessage)(e);if("default"===t)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_MARKET,n);throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_MARKET,n).response}},this.validateDate=function(e,t,n){if("string"!=typeof e){if("default"===n)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_TYPE+"string for "+t+" filter");throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_TYPE+"string for "+t+" filter").response}if(!/^\d{4}-\d{2}-\d{2}$/.test(e)){if("default"===n)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_VALUE+"YYYY-MM-DD for "+t);throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_VALUE+"YYYY-MM-DD for "+t).response}},this.validateNumberFilters=function(e,t,n){var u="usersCount"===t?1:0,l="usersCount"===t?1e3:1e6;if("number"!=typeof e){if("default"===n)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_TYPE+"number for "+t+" filter");throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_TYPE+"number for "+t+" filter").response}if(e<u||e>l){if("default"===n)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_VALUE+"between "+u+" and "+l);throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FILTERS,o.ErrorMessages.INVALID_VALUE+"between "+u+" and "+l).response}}}},1859:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4946),a=n(1553),o=n(7686),u=n(2793),l=n(8900),c=n(1732),d=n(7782),h=n(5013),p=n(853),f=n(7299),m=n(2310),v=n(4800),y=n(8097),g=n(4021),w=n(4904),_=n(5318),b=n(2535);t.default=function(e){var t=this;this.predictorHttps=null,this.predictorService=null,this.idMapping=null,this.clientHttps=null,this.predictorValidator=null,this.errorHandlingMode=null,this.getConfig=function(){return r(t,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(o.FeatureConfigType.MATCH_QUIZ)];case 1:return e=t.sent(),this.idMapping.idSchema===s.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(e)];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},this.play=function(e){return r(t,void 0,void 0,(function(){var t,n,r,a,o,u=this;return i(this,(function(i){switch(i.label){case 0:return e=this.predictorValidator.validateBodyFields("MATCH_QUIZ",e),(t=e.fixtures.map((function(e){return u.predictorValidator.validateFixture(e.matchId,e.market,e.prediction.value,e.prediction.playerId)})))&&t.length?this.idMapping.idSchema===s.IdSchemaEnum.NATIVE?[3,4]:(n=[],r=[],t.forEach((function(e){n.push(e.matchId),e instanceof c.default&&e.prediction.playerId&&"OWN_GOAL"!==e.prediction.playerId&&r.push(e.prediction.playerId)})),[4,this.predictorService.remapMatchIdToNative(n)]):[3,4];case 1:return a=i.sent(),o={},r&&r.length>0?[4,this.predictorService.remapPlayerIdMapToNative(r)]:[3,3];case 2:o=i.sent(),i.label=3;case 3:t.forEach((function(e,t){e.matchId=a[t],e instanceof c.default&&"OWN_GOAL"!==e.prediction.playerId&&(e.prediction.playerId=o[e.prediction.playerId])})),i.label=4;case 4:return e.fixtures=t,[4,this.predictorHttps.makeFootballPrediction(e)];case 5:return[2,i.sent()]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getGames=function(e,n){return r(t,void 0,void 0,(function(){var t,r;return i(this,(function(i){switch(i.label){case 0:return n=n||!1,t=this.predictorService.initGameFilters("MATCH_QUIZ",e),[4,this.predictorHttps.getGames(t,n)];case 1:return r=i.sent(),[4,this.predictorService.remapMatchIdsFixtures(r)];case 2:return[2,i.sent()]}}))}))},this.getGameById=function(e,n){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return n=n||!1,[4,this.predictorHttps.getGameById(e,n)];case 1:return t=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(t)];case 2:return[2,r.sent()]}}))}))},this.getGamePredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return s=s||!1,n&&(n.type&&delete n.type,n.status&&delete n.status,n=new d.default(n)),[4,this.predictorHttps.getGamePredictions(e,s,n)];case 1:return[2,t.sent()]}}))}))},this.getGameResults=function(e,n,s){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return s=s||!1,n&&(n=new v.default(n)),[4,this.predictorHttps.getGameResults(e,s,n)];case 1:return t=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(t)];case 2:return[2,r.sent()]}}))}))},this.getCurrentGameResults=function(e){return r(t,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=e||!1,t={status:p.GameStatusEnum.OPEN,type:"MATCH_QUIZ"},t=new f.default(t),[4,this.predictorHttps.getGames(t,e)];case 1:return n=i.sent(),r=this.predictorService.getCurrentGameId(n),[4,this.getGameResults(r,null,e)];case 2:return[2,i.sent().data[0]]}}))}))},this.getMyGameEditions=function(e,n){return r(t,void 0,void 0,(function(){var t,r,s,o,u;return i(this,(function(i){switch(i.label){case 0:return e&&e.limit&&this.validateLimitFilterOnGames(e.limit),n=n||!1,t=this.predictorService.initGameTypePredictions("MATCH_QUIZ",e),r=[],[4,this.predictorHttps.getMyPredictionsNoRemap(t)];case 1:return(s=i.sent()).data.length>0?(s.data.forEach((function(e){e.game_instance_id&&r.push(e.game_instance_id)})),o=this.predictorService.initGameFilters("MATCH_QUIZ",null,r),[4,this.predictorHttps.getUserGameEditions(o,n)]):[3,4];case 2:return u=i.sent(),[4,this.predictorService.addPredictionProp(s,u)];case 3:return[2,i.sent()];case 4:return[2,new a.default]}}))}))},this.getMyGamePrediction=function(e){return r(t,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=this.predictorService.initGameTypePredictions("MATCH_QUIZ"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return(n=i.sent()).data.length>0?[2,(r=n.data.filter((function(t){return t.gameInstanceId===e}))).length?r[0]:null]:[2,null]}}))}))},this.getUserGameEditions=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r,o,u,l;return i(this,(function(i){switch(i.label){case 0:return n&&n.limit&&this.validateLimitFilterOnGames(n.limit),s=s||!1,t=this.predictorService.initGameTypePredictions("MATCH_QUIZ",n),r=[],[4,this.predictorHttps.getUserPredictionsNoRemap(e,t)];case 1:return(o=i.sent()).data.length>0?(o.data.forEach((function(e){e.game_instance_id&&r.push(e.game_instance_id)})),u=this.predictorService.initGameFilters("MATCH_QUIZ",null,r),[4,this.predictorHttps.getUserGameEditions(u,s)]):[3,4];case 2:return l=i.sent(),[4,this.predictorService.addPredictionProp(o,l)];case 3:return[2,i.sent()];case 4:return[2,new a.default]}}))}))},this.getUserGamePrediction=function(e,n,s){return r(t,void 0,void 0,(function(){var t,r,a;return i(this,(function(i){switch(i.label){case 0:return s=s||!1,t=this.predictorService.initGameTypePredictions("MATCH_QUIZ"),[4,this.predictorHttps.getUserPredictions(e,s,t)];case 1:return(r=i.sent()).data.length>0?[2,(a=r.data.filter((function(e){return e.gameInstanceId===n}))).length?a[0]:null]:[2,null]}}))}))},this.getMarketsResultsForGame=function(e,n){return r(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getMarketResultsForGame(e,n)];case 1:return t=r.sent(),[4,this.predictorService.completeGameMarketResults(t,"MATCH_QUIZ")];case 2:return[2,r.sent()]}}))}))},this.getGameWinners=function(e){return r(t,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(e)];case 1:return t=r.sent(),[4,this.getGameById(e)];case 2:return n=r.sent(),t.contestModel=n,[2,this.predictorService.completeContestWinners(t)]}}))}))},this.validateLimitFilterOnGames=function(e){if("default"===t.errorHandlingMode&&e>50)throw new y.default(g.ErrorCodes.BAD_METHOD_CALL,w.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED);if("standard"===t.errorHandlingMode&&e>50)throw new b.default(g.ErrorCodes.BAD_METHOD_CALL,w.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED).response},this.predictorValidator=new m.default(e.errorHandlingMode),this.idMapping=new l.default(e),this.predictorHttps=new u.default(e,this.idMapping),this.predictorService=new h.default(e,this.idMapping),this.clientHttps=new o.default(e),this.errorHandlingMode=e.errorHandlingMode}},267:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1859);t.default=function(e){var t=this;this.matchQuizFacade=null,this.getConfig=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getConfig()];case 1:return[2,e.sent()]}}))}))},this.play=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.play(e)];case 1:return[2,t.sent()]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.delete(e)];case 1:return[2,t.sent()]}}))}))},this.getGames=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGames(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGameById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGameById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGamePredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGamePredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getGameResults=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGameResults(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getCurrentGameResults=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getCurrentGameResults(e)];case 1:return[2,t.sent()]}}))}))},this.getMyGameEditions=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getMyGameEditions(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMyGamePrediction=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getMyGamePrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getUserGameEditions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getUserGameEditions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserGamePrediction=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getUserGamePrediction(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getMarketsResultsForGame=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getMarketsResultsForGame(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGameWinners=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getGameWinners(e)];case 1:return[2,t.sent()]}}))}))},this.matchQuizFacade=new s.default(e)}},5765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.enabled=!1,this.clientId=null,this.defaultMarkets=null,this.competitionsWhitelist=null}},8410:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6899),i=n(8042);t.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default,this.prediction=new i.default}},670:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.gameId=null,this.results=null,this.tieBreakers=null}},7243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4916);t.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.outcome=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new r.default,this.predictionId=null,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.points=null,this.createdAt=null,this.updatedAt=null,this.predictionsMadeAt=null,this.images=null,this.scheduleOpenAt=null}},8042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null,this.target=null,this.playerId=null,this.playerModel=null,this.result=null}},7974:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.playerMarketNobodyPrediction=t.endMarkMarkets=t.playerMarkets=t.MarketsOverCorners=t.MarketsOverGoals=t.MarketEnum=void 0,function(e){e.FT_1X2="FT_1X2",e.HT_1X2="HT_1X2",e.BOTH_TEAMS_SCORE="BOTH_TEAMS_SCORE",e.DOUBLE_CHANCE="DOUBLE_CHANCE",e.HT_FT="HT_FT",e.PLAYER_SCORE="PLAYER_SCORE",e.PLAYER_YELLOW_CARD="PLAYER_YELLOW_CARD",e.PLAYER_RED_CARD="PLAYER_RED_CARD",e.RED_CARD_MATCH="RED_CARD_MATCH",e.PENALTY_MATCH="PENALTY_MATCH",e.PLAYER_SCORE_FIRST_GOAL="PLAYER_SCORE_FIRST_GOAL",e.CORNERS_MATCH="CORNERS_MATCH",e.CORRECT_SCORE="CORRECT_SCORE",e.CORRECT_SCORE_ADVANCED="CORRECT_SCORE_ADVANCED",e.CORRECT_SCORE_HT="CORRECT_SCORE_HT",e.PLAYER_SCORE_HATTRICK="PLAYER_SCORE_HATTRICK",e.PLAYER_SCORE_TWICE="PLAYER_SCORE_TWICE",e.OVER_GOALS_0_5="OVER_GOALS_0_5",e.OVER_GOALS_1_5="OVER_GOALS_1_5",e.OVER_GOALS_2_5="OVER_GOALS_2_5",e.OVER_GOALS_3_5="OVER_GOALS_3_5",e.OVER_GOALS_4_5="OVER_GOALS_4_5",e.OVER_GOALS_5_5="OVER_GOALS_5_5",e.OVER_GOALS_6_5="OVER_GOALS_6_5",e.OVER_CORNERS_6_5="OVER_CORNERS_6_5",e.OVER_CORNERS_7_5="OVER_CORNERS_7_5",e.OVER_CORNERS_8_5="OVER_CORNERS_8_5",e.OVER_CORNERS_9_5="OVER_CORNERS_9_5",e.OVER_CORNERS_10_5="OVER_CORNERS_10_5",e.OVER_CORNERS_11_5="OVER_CORNERS_11_5",e.OVER_CORNERS_12_5="OVER_CORNERS_12_5",e.OVER_CORNERS_13_5="OVER_CORNERS_13_5"}(n=t.MarketEnum||(t.MarketEnum={})),t.MarketsOverGoals=[n.OVER_GOALS_0_5,n.OVER_GOALS_1_5,n.OVER_GOALS_2_5,n.OVER_GOALS_3_5,n.OVER_GOALS_4_5,n.OVER_GOALS_5_5,n.OVER_GOALS_6_5],t.MarketsOverCorners=[n.OVER_CORNERS_6_5,n.OVER_CORNERS_7_5,n.OVER_CORNERS_8_5,n.OVER_CORNERS_9_5,n.OVER_CORNERS_10_5,n.OVER_CORNERS_11_5,n.OVER_CORNERS_12_5,n.OVER_CORNERS_13_5],t.playerMarkets=[n.PLAYER_RED_CARD,n.PLAYER_SCORE,n.PLAYER_SCORE_FIRST_GOAL,n.PLAYER_SCORE_HATTRICK,n.PLAYER_SCORE_TWICE,n.PLAYER_YELLOW_CARD],t.endMarkMarkets=[n.FT_1X2,n.HT_1X2,n.HT_FT,n.DOUBLE_CHANCE,n.CORNERS_MATCH,n.CORRECT_SCORE,n.CORRECT_SCORE_HT,n.CORRECT_SCORE_ADVANCED],t.playerMarketNobodyPrediction=n.PLAYER_SCORE_FIRST_GOAL},6147:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.pastStatuses=t.StatusEnum=void 0,function(e){e.ACTIVE="ACTIVE",e.WON="WON",e.LOST="LOST",e.PARTIALLY_WON="PARTIALLY_WON",e.CANCELED="CANCELED"}(n=t.StatusEnum||(t.StatusEnum={})),t.pastStatuses=[n.WON,n.LOST,n.PARTIALLY_WON,n.CANCELED]},1976:(e,t)=>{"use strict";var n,r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.HalfTimeFullTimeEnum=t.DoubleChanceEnum=t.OneXTwoEnum=void 0,(i=t.OneXTwoEnum||(t.OneXTwoEnum={})).ONE="1",i.X="x",i.TWO="2",(r=t.DoubleChanceEnum||(t.DoubleChanceEnum={})).ONE_X="1x",r.X_TWO="x2",r.ONE_TWO="12",(n=t.HalfTimeFullTimeEnum||(t.HalfTimeFullTimeEnum={})).ONE_ONE="1/1",n.ONE_X="1/x",n.ONE_TWO="1/2",n.X_ONE="x/1",n.X_X="x/x",n.X_TWO="x/2",n.TWO_ONE="2/1",n.TWO_X="2/x",n.TWO_TWO="2/2"},2929:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var a=n(4946),o=n(7974),u=n(7686),l=n(5013),c=n(3950),d=n(1732),h=n(2310),p=n(8097),f=n(4021),m=n(4904),v=n(5318),y=n(2535);t.default=function(e,t,n,g){var w=this;this.predictorHttps=null,this.clientHttps=null,this.idMapping=null,this.predictorService=null,this.predictorValidator=null,this.errorHandlingMode=null,this.makeFootballPrediction=function(e,t,n,s){return r(w,void 0,void 0,(function(){var r,u,l,h,g,w,_;return i(this,(function(i){switch(i.label){case 0:return r=this.predictorValidator.validateFixture(e,t,n,s),u=new c.default,this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,6]:(l=r.matchId,h="",[4,this.predictorService.remapMatchIdToNative([l])]);case 1:if(g=i.sent(),r.matchId=g[0],"default"===this.errorHandlingMode&&!r.matchId)throw new p.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.INVALID_FIELD,v.ErrorMessages.INVALID_MATCH_ID).errorMessage();if("standard"===this.errorHandlingMode&&!r.matchId)throw new y.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.INVALID_FIELD,v.ErrorMessages.INVALID_MATCH_ID).response;return r instanceof d.default&&"OWN_GOAL"!==r.prediction.playerId?r.prediction.playerId?(h=r.prediction.playerId,w=r.prediction,[4,this.predictorService.remapPlayerIdToNative([h])]):[3,3]:[3,4];case 2:w.playerId=i.sent(),i.label=3;case 3:if("default"===this.errorHandlingMode&&r.market!==o.playerMarketNobodyPrediction&&!r.prediction.playerId)throw new p.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.INVALID_FIELD,v.ErrorMessages.INVALID_PLAYER_ID).errorMessage();if("standard"===this.errorHandlingMode&&r.market!==o.playerMarketNobodyPrediction&&!r.prediction.playerId)throw new y.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.INVALID_FIELD,v.ErrorMessages.INVALID_PLAYER_ID).response;i.label=4;case 4:return u.fixtures=[r],[4,this.predictorHttps.makeFootballPrediction(u)];case 5:return(_=i.sent()).fixtures.forEach((function(e){e.prediction.playerId&&"OWN_GOAL"!==e.prediction.playerId&&(e.prediction.playerId=h),e.matchId=l})),[2,_];case 6:return u.fixtures=[r],[4,this.predictorHttps.makeFootballPrediction(u)];case 7:return[2,i.sent()]}}))}))},this.getMatchSummary=function(e,t){return r(w,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return[4,this.getMatchSummaryBase(e,t)];case 1:return n=i.sent(),r=JSON.parse(JSON.stringify(n.predictions)),[4,this.predictorService.remapPlayerIdToIdSchema(r)];case 2:return s=i.sent(),n.predictions=s,[2,n]}}))}))},this.getMarketSummary=function(e,t,n,s){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getMatchSummaryBase(e,s)];case 1:return r=i.sent(),[4,this.predictorService.getMarketSummary(r,t,n)];case 2:return[2,i.sent()];case 3:throw i.sent();case 4:return[2]}}))}))},this.getMatchSummaryBase=function(e,t){return r(w,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapMatchIdToNative([e])];case 1:return n=i.sent(),r=n[0],[4,this.predictorHttps.getMatchSummary(r,t)];case 2:return(s=i.sent()).matchId=e,[2,s];case 3:return[4,this.predictorHttps.getMatchSummary(e,t)];case 4:return[2,i.sent()]}}))}))},this.getConfig=function(){return r(w,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(u.FeatureConfigType.PREDICTOR)];case 1:return e=t.sent(),this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(e)];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},this.deleteFootballPrediction=function(e){return r(w,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getMyPredictions=function(e){return r(w,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t=this.predictorService.initPredictionsFilters(e,"user"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return[2,n.sent()]}}))}))},this.getMyPredictionsForMatches=function(e,t){return r(w,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:if("default"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(e))throw new p.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.EXCEEDED_LENGTH,v.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).errorMessage();if("standard"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(e))throw new y.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.EXCEEDED_LENGTH,v.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).response;return this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,2]:[4,this.predictorService.remapMatchIdToNative(s([],e,!0))];case 1:e=r.sent(),r.label=2;case 2:return n=this.predictorService.initPredictionsFilters(t,"matches",e),[4,this.predictorHttps.getMyPredictions(n)];case 3:return[2,r.sent()]}}))}))},this.getMyCurrentPredictions=function(e){return r(w,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t=this.predictorService.initPredictionsFilters(e,"current"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return[2,n.sent()]}}))}))},this.getMyPastPredictions=function(e){return r(w,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t=this.predictorService.initPredictionsFilters(e,"past"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return[2,n.sent()]}}))}))},this.getUserPredictions=function(e,t,n){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return r=this.predictorService.initPredictionsFilters(t,"user"),[4,this.predictorHttps.getUserPredictions(e,n,r)];case 1:return[2,i.sent()]}}))}))},this.getUserCurrentPredictions=function(e,t,n){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return r=this.predictorService.initPredictionsFilters(t,"current"),[4,this.predictorHttps.getUserPredictions(e,n,r)];case 1:return[2,i.sent()]}}))}))},this.getUserPastPredictions=function(e,t,n){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return r=this.predictorService.initPredictionsFilters(t,"past"),[4,this.predictorHttps.getUserPredictions(e,n,r)];case 1:return[2,i.sent()]}}))}))},this.getUserPredictionsForMatches=function(e,t,n,o){return r(w,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:if("default"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(t))throw new p.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.EXCEEDED_LENGTH,v.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).errorMessage();if("standard"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(t))throw new y.default(f.ErrorCodes.BAD_METHOD_CALL,m.ErrorStatuses.EXCEEDED_LENGTH,v.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).response;return this.idMapping.idSchema===a.IdSchemaEnum.NATIVE?[3,2]:[4,this.predictorService.remapMatchIdToNative(s([],t,!0))];case 1:t=i.sent(),i.label=2;case 2:return r=this.predictorService.initPredictionsFilters(n,"matches",t),[4,this.predictorHttps.getUserPredictions(e,o,r)];case 3:return[2,i.sent()]}}))}))},this.getPredictionById=function(e){return r(w,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorHttps.getPredictionById(e)];case 1:return[2,t.sent()]}}))}))},this.predictorHttps=t,this.idMapping=g,this.clientHttps=n,this.errorHandlingMode=e.errorHandlingMode,this.predictorValidator=new h.default(e.errorHandlingMode),this.predictorService=new l.default(e,g)}},704:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8608),i=n(246),s=n(1429),a=n(515),o=n(4187),u=n(4226),l=n(5765),c=n(1180),d=n(8452),h=n(8824);t.default=function(){var e=this;this.remapPredictorConfig=function(t){var n=new d.default;return n.enabled=t.enabled,n.clientId=t.client_id,n.fullCoverageCompetitions=t.full_coverage_competitions,n.markets=t.markets,n.successRateScopes=t.success_rate_scopes,n.userDataConfig=t.user_data_config?e.remapUserDataConfig(t.user_data_config):null,n},this.remapTopXConfig=function(e){var t=new c.default;return t.enabled=e.enabled,t.clientId=e.client_id,t.minFixtures=e.min_fixtures,t.maxFixtures=e.max_fixtures,t.competitionsWhitelist=e.competitions_whitelist,t},this.remapMatchQuizConfig=function(e){var t=new l.default;return t.enabled=e.enabled,t.clientId=e.client_id,t.defaultMarkets=e.default_markets,t.competitionsWhitelist=e.competitions_whitelist,t},this.remapLoyaltyConfig=function(t){var n=new a.default;return n.enabled=t.enabled,n.clientId=t.client_id,n.conditions.list=t.conditions.list,n.actions.value=t.actions.value,n.rewards=e.remapRewards(t.rewards),n},this.remapRewards=function(t){var n=new u.default;return n.points=e.remapPoints(t.points),n.tiers=t.tiers,n.badges=e.remapBadges(t.badges),n},this.remapPoints=function(e){var t=new o.default;return t.general=e.general,t.comments=e.comments,t.predictor=e.predictor,t.activity=e.activity,t.topX=e.top_x,t.matchQuiz=e.match_quiz,t},this.remapBadges=function(t){var n=new r.default;return n.general=t.general,n.predictor=e.remapBadgeValues(t.predictor),n.topX=e.remapBadgeValues(t.top_x),n.matchQuiz=e.remapBadgeValues(t.match_quiz),n},this.remapBadgeValues=function(t){return t.map((function(t){var n=new i.default;return n.id=t.id,n.label=t.label,n.enabled=t.enabled,t.assets?n.assets.mainImageUrl=t.assets.main_image_url:n.assets=t.assets,n.requirements=e.remapRequirements(t.requirements),n}))},this.remapRequirements=function(e){var t=new s.default;return t.points=e.points,t.gameParticipationCount=e.game_participation_count,t.entityId=e.entity_id,t.entityType=e.entity_type,t.predictionsMade=e.predictions_made,t.correctPredictions=e.correct_predictions,t},this.remapUserDataConfig=function(e){var t=new h.default;return t.storeIp=e.store_ip,t.storeDeviceId=e.store_device_id,t.storeAgent=e.store_agent,t}}},8452:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(442);t.default=function(){this.enabled=!1,this.clientId=null,this.fullCoverageCompetitions=null,this.markets=null,this.successRateScopes=new r.default,this.userDataConfig=null}},442:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.competitions=[],this.teams=[],this.markets=[]}},8824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.storeIp=!1,this.storeDeviceId=!1,this.storeAgent=!1}},6367:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null,this.playerId=null,this.playerModel=null}},1406:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(2524),a=n(1732),o=n(4119),u=n(1465),l=n(5132),c=n(7344);t.default=function(e,t,n){var d=this;this.matchFacade=null,this.playerFacade=null,this.predictorService=null,this.remapFixturesRequest=function(e){var t={};if(t.match_id=e.matchId,t.match_type="FOOTBALL",e instanceof a.default)t.market=e.market,t.prediction=e.prediction.value,t.player_id=e.prediction.playerId;else if(e instanceof l.default||e instanceof c.default)t.market=e.market,t.prediction=e.prediction.value;else if(e instanceof u.default){t.market=e.market;var n=e.prediction.value.split(":");t.goals_home=Number(n[0]),t.goals_away=Number(n[1])}else t.market=e.market,t.prediction=e.prediction.value;return t},this.remapFixturesResponse=function(e){return r(d,void 0,void 0,(function(){var t,n,r,a,o,u,l,c,d,h,p,f;return i(this,(function(i){switch(i.label){case 0:for(t="OWN_GOAL",n=[],r=[],a=null,o=[],e.length>1&&e.sort((function(e,t){return e.match_id.localeCompare(t.match_id)})),u=0,l=e;u<l.length;u++)p=l[u],n.push(p.match_id),p.player_id&&!r.includes(p.player_id)&&r.push(p.player_id);return[4,this.matchFacade.getMatchesMapWithNativeIds(n)];case 1:return c=i.sent(),r.sort((function(e,t){return e.localeCompare(t)})),r&&r.length>0&&!r.includes(t)?[4,this.playerFacade.getPlayersMapWithNativeIds(r)]:[3,3];case 2:a=i.sent(),i.label=3;case 3:for(d=0,h=e;d<h.length;d++)p=h[d],f=new s.default,p.target?f.market=this.predictorService.convertMarketForResponseModel(p.market,p.target):f.market=p.market,f.matchId=c[p.match_id].id,f.matchType=p.match_type,f.matchModel=c?c[p.match_id]:null,delete f.matchModel.availableMarkets,void 0!==p.goals_home&&void 0!==p.goals_away?f.prediction.value=p.goals_home.toString()+":"+p.goals_away.toString():f.prediction.value=p.prediction,f.prediction.playerId=p.player_id?p.player_id:null,f.prediction.playerId&&f.prediction.playerId!==t&&(f.prediction.playerModel=a[p.player_id],f.prediction.playerId=a[p.player_id].id),f.result=this.remapResult(p.result),o.push(f);return[2,o]}}))}))},this.remapResult=function(e){var t=new o.default;return t.settledAt=e.settled_at,t.resettledAt=e.resettled_at,t.status=e.status,t.outcome=e.outcome,t.points=e.points,t},this.matchFacade=e,this.playerFacade=t,this.predictorService=n}},2524:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6367);t.default=function(){this.market=null,this.matchId=null,this.matchType=null,this.matchModel=null,this.prediction=new r.default,this.result=null}},1206:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(9883);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.BOTH_TEAMS_SCORE,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},5274:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(8038);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.CORNERS_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},1465:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3125);t.default=function(e,t,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n}},7535:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(6902);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.DOUBLE_CHANCE,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},7307:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(6642);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.HT_FT,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},1718:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2782);t.default=function(e,t,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n}},5132:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9883);t.default=function(e,t,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n}},7344:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9883);t.default=function(e,t,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n}},1855:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(9883);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.PENALTY_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},1732:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7321);t.default=function(e,t,n,i){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.market=t,this.prediction=new r.default,this.prediction.value=n,this.prediction.playerId=i}},5814:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7974),i=n(9883);t.default=function(e,t){this.matchId=null,this.market=r.MarketEnum.RED_CARD_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=e,this.prediction=new i.default,this.prediction.value=t}},4119:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.settledAt=null,this.resettledAt=null,this.status=null,this.outcome=null,this.points=0}},5908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.no=0,this.yes=0}},2726:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1406),a=n(2532),o=n(3792),u=n(595),l=n(4545),c=n(4272),d=n(2524),h=n(5013),p=n(1399);t.default=function(e,t){var n=this;this.fixturesRemapper=null,this.footballHttps=null,this.matchFacade=null,this.playerFacade=null,this.predictorService=null,this.remapRequestBody=function(e){var t={};return t.game_instance_id=e.gameInstanceId,t.fixtures=e.fixtures.map((function(e){return n.fixturesRemapper.remapFixturesRequest(e)})),e instanceof p.default&&e.tiebreaker&&(t.tiebreaker={},t.tiebreaker.golden_goal=e.tiebreaker.goldenGoal?e.tiebreaker.goldenGoal:null),t},this.remapResponseArrayBody=function(e){return r(n,void 0,void 0,(function(){var t,n,r,s,o,u,l=this;return i(this,(function(i){switch(i.label){case 0:return e.length?(t="OWN_GOAL",n=[],r=[],s={},o=[],e.forEach((function(e){e.fixtures.forEach((function(e){n.push(e.match_id),e.player_id&&e.player_id!==t&&r.push(e.player_id)}))})),[4,this.matchFacade.getMatchesMapWithNativeIds(n)]):[3,4];case 1:return u=i.sent(),r.length>0?[4,this.playerFacade.getPlayersMapWithNativeIds(r)]:[3,3];case 2:s=i.sent(),i.label=3;case 3:return e.forEach((function(e){var n=new a.default,r=[];n.id=e.id,n.gameInstanceId=e.game_instance_id,n.gameType=e.game_type,n.wager=e.wager,n.totalFixtures=e.total_fixtures,n.settledFixtures=e.settled_fixtures,n.userId=e.user_id,e.fixtures.forEach((function(e){var n=new d.default;e.target?n.market=l.predictorService.convertMarketForResponseModel(e.market,e.target):n.market=e.market,n.matchId=u[e.match_id].id,n.matchType=e.match_type,n.matchModel=u[e.match_id],delete n.matchModel.availableMarkets,void 0!==e.goals_home&&void 0!==e.goals_away?n.prediction.value=e.goals_home.toString()+":"+e.goals_away.toString():n.prediction.value=e.prediction,n.prediction.playerId=e.player_id?e.player_id:null,n.prediction.playerId&&n.prediction.playerId!==t&&(n.prediction.playerModel=s[n.prediction.playerId],n.prediction.playerId=s[n.prediction.playerId].id),n.result=l.fixturesRemapper.remapResult(e.result),r.push(n)})),n.fixtures=r,n.status=e.status,e.tiebreaker?n.tiebreaker.goldenGoal=e.tiebreaker.golden_goal:n.tiebreaker=null,n.points=e.points,n.createdAt=e.created_at,n.updatedAt=e.updated_at,o.push(n)})),[2,o];case 4:return[2,e]}}))}))},this.remapResponseObjBody=function(e){return r(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return(t=new a.default).id=e.id,t.gameInstanceId=e.game_instance_id,t.gameType=e.game_type,t.wager=e.wager,t.totalFixtures=e.total_fixtures,t.settledFixtures=e.settled_fixtures,t.userId=e.user_id,n=t,[4,this.fixturesRemapper.remapFixturesResponse(e.fixtures)];case 1:return n.fixtures=r.sent(),t.status=e.status,e.tiebreaker?t.tiebreaker.goldenGoal=e.tiebreaker.golden_goal:t.tiebreaker=null,t.points=e.points,t.createdAt=e.created_at,t.updatedAt=e.updated_at,[2,t]}}))}))},this.remapPredictionModel=function(e){var t=new o.default;return t.fullTimeOneXTwo=e.FT_1X2,t.halfTimeOneXTwo=e.HT_1X2,t.bothTeamsScore=e.BOTH_TEAMS_SCORE,t.overZeroPointFiveGoals=e.OVER_GOALS_0_5,t.overOnePointFiveGoals=e.OVER_GOALS_1_5,t.overTwoPointFiveGoals=e.OVER_GOALS_2_5,t.overThreePointFiveGoals=e.OVER_GOALS_3_5,t.overFourPointFiveGoals=e.OVER_GOALS_4_5,t.overFivePointFiveGoals=e.OVER_GOALS_5_5,t.overSixPointFiveGoals=e.OVER_GOALS_6_5,t.overSixPointFiveCorners=e.OVER_CORNERS_6_5,t.overSevenPointFiveCorners=e.OVER_CORNERS_7_5,t.overEightPointFiveCorners=e.OVER_CORNERS_8_5,t.overNinePointFiveCorners=e.OVER_CORNERS_9_5,t.overTenPointFiveCorners=e.OVER_CORNERS_10_5,t.overElevenPointFiveCorners=e.OVER_CORNERS_11_5,t.overTwelvePointFiveCorners=e.OVER_CORNERS_12_5,t.overThirteenPointFiveCorners=e.OVER_CORNERS_13_5,t.doubleChance=e.DOUBLE_CHANCE,t.halfTimeFullTime=e.HT_FT,t.playerScore=e.PLAYER_SCORE,t.playerYellowCard=e.PLAYER_YELLOW_CARD,t.playerRedCard=e.PLAYER_RED_CARD,t.redCardMatch=e.RED_CARD_MATCH,t.penaltyMatch=e.PENALTY_MATCH,t.playerScoreFirstGoal=e.PLAYER_SCORE_FIRST_GOAL,t.cornersMatch=e.CORNERS_MATCH,t.correctScore=e.CORRECT_SCORE,t.correctScoreHalfTime=e.CORRECT_SCORE_HT,t.correctScoreAdvanced=e.CORRECT_SCORE_ADVANCED,t.playerScoreHattrick=e.PLAYER_SCORE_HATTRICK,t.playerScoreTwice=e.PLAYER_SCORE_TWICE,t},this.footballHttps=new u.default(e),this.matchFacade=new l.default(e,this.footballHttps,t),this.playerFacade=new c.default(e,this.footballHttps,t),this.predictorService=new h.default(e,t),this.fixturesRemapper=new s.default(this.matchFacade,this.playerFacade,this.predictorService)}},3950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.gameInstanceId=null,this.fixtures=null}},2532:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7640);t.default=function(){this.id=null,this.gameInstanceId=null,this.gameType=null,this.wager=null,this.totalFixtures=null,this.settledFixtures=null,this.userId=null,this.fixtures=[],this.status=null,this.tiebreaker=new r.default,this.points=null,this.createdAt=null,this.updatedAt=null}},7782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6147);t.default=function(e){var t=this;this.limit=null,this.startAfter=null,this.status=null,this.type=null,this.matchIds=null,this.constructFiltersUrl=function(){var e="",n=!1;return t.status&&(n=Object.values(r.StatusEnum).some((function(e){return t.status.includes(e)}))),t.limit&&(e+="&",e+="limit="+t.limit),t.startAfter&&(e+="&",e+="start_after="+t.startAfter),t.status&&n&&(e+="&",e+="status="+t.status.join(",")),t.type&&(e+="&",e+="game_types="+t.type),t.matchIds&&(e+="&",e+="match_ids="+t.matchIds.join(",")),e},this.limit=e.limit?e.limit:null,this.startAfter=e.startAfter?e.startAfter:null,this.status=e.status?e.status:null,this.type=e.type?e.type:null,this.matchIds=e.matchIds?e.matchIds:null}},3792:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5908);t.default=function(){this.fullTimeOneXTwo={},this.halfTimeOneXTwo={},this.bothTeamsScore=new r.default,this.doubleChance={},this.halfTimeFullTime={},this.playerScore={},this.playerYellowCard={},this.playerRedCard={},this.redCardMatch=new r.default,this.penaltyMatch=new r.default,this.playerScoreFirstGoal={},this.cornersMatch={},this.correctScore={},this.correctScoreHalfTime={},this.correctScoreAdvanced={},this.playerScoreHattrick={},this.playerScoreTwice={},this.overZeroPointFiveGoals=new r.default,this.overOnePointFiveGoals=new r.default,this.overTwoPointFiveGoals=new r.default,this.overThreePointFiveGoals=new r.default,this.overFourPointFiveGoals=new r.default,this.overFivePointFiveGoals=new r.default,this.overSixPointFiveGoals=new r.default,this.overSixPointFiveCorners=new r.default,this.overSevenPointFiveCorners=new r.default,this.overEightPointFiveCorners=new r.default,this.overNinePointFiveCorners=new r.default,this.overTenPointFiveCorners=new r.default,this.overElevenPointFiveCorners=new r.default,this.overTwelvePointFiveCorners=new r.default,this.overThirteenPointFiveCorners=new r.default}},9378:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.matchId=null,this.matchType=null,this.predictions=null}},9679:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2726),i=n(9378);t.default=function(e,t){var n=this;this.remapPredictions=null,this.remapResponse=function(e){var t=new i.default;return t.matchId=e.match_id,t.matchType=e.match_type,t.predictions=n.remapPredictions.remapPredictionModel(e.predictions),t},this.remapPredictions=new r.default(e,t)}},7321:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=!1,this.playerId=null}},9883:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=!1}},8038:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},3125:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null}},6902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null}},6642:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null}},2782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null}},1259:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(2793),a=n(8900),o=n(2929),u=n(7686);t.default=function(e){var t=this;this.predictorHttps=null,this.clientHttps=null,this.predictorFacade=null,this.idMapping=null,this.makeFootballPrediction=function(e,n,s,a){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.makeFootballPrediction(e,n,s,a)];case 1:return[2,t.sent()]}}))}))},this.getMatchSummary=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMatchSummary(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMarketSummary=function(e,n,s,a){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMarketSummary(e,n,s,a)];case 1:return[2,t.sent()]}}))}))},this.getConfig=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getConfig()];case 1:return[2,e.sent()]}}))}))},this.deleteFootballPrediction=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.deleteFootballPrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getMyPredictions=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMyPredictions(e)];case 1:return[2,t.sent()]}}))}))},this.getMyCurrentPredictions=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMyCurrentPredictions(e)];case 1:return[2,t.sent()]}}))}))},this.getMyPastPredictions=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMyPastPredictions(e)];case 1:return[2,t.sent()]}}))}))},this.getMyPredictionsForMatches=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getMyPredictionsForMatches(e,n)];case 1:return[2,t.sent()]}}))}))},this.getUserPredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getUserPredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserCurrentPredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getUserCurrentPredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserPastPredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getUserPastPredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserPredictionsForMatches=function(e,n,s,a){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getUserPredictionsForMatches(e,n,s,a)];case 1:return[2,t.sent()]}}))}))},this.getPredictionById=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getPredictionById(e)];case 1:return[2,t.sent()]}}))}))},this.idMapping=new a.default(e),this.predictorHttps=new s.default(e,this.idMapping),this.clientHttps=new u.default(e),this.predictorFacade=new o.default(e,this.predictorHttps,this.clientHttps,this.idMapping)}},5013:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var o=n(7974),u=n(3792),l=n(8452),c=n(5908),d=n(8950),h=n(6890),p=n(595),f=n(4545),m=n(7782),v=n(7299),y=n(712),g=n(4119),w=n(3751),_=n(7243),b=n(4272),E=n(1180),I=n(5765),M=n(6147),O=n(5318),T=n(4946),S=n(6409),R=n(1260),P=n(6247);t.default=function(e,t){var n=this;this.footballHttps=null,this.idMapping=null,this.matchFacade=null,this.playerFacade=null,this.profileNamespace=null,this.remapMatchIdToNative=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.idMapping.getEntityIdsBySchemaId(e,"match","native")];case 1:return[2,t.sent().match]}}))}))},this.remapPlayerIdToNative=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.idMapping.getEntityIdsBySchemaId(e,"player","native")];case 1:return[2,t.sent().player[0]]}}))}))},this.remapPlayerIdMapToNative=function(e){return i(n,void 0,void 0,(function(){var t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return t={},n=(0,y.transformIdsToBeUnique)(e),[4,this.idMapping.getEntityIdsBySchemaId(n,"player","native")];case 1:return r=s.sent(),i=r.player,n.forEach((function(e,n){return t[e]=i[n]})),[2,t]}}))}))},this.remapPlayerIdToIdSchema=function(e){return i(n,void 0,void 0,(function(){var t,n,r,i,a,o,u,l,c,d,h,p,f,m,v,y,g,w,_;return s(this,(function(s){switch(s.label){case 0:for(t=["playerScore","playerYellowCard","playerRedCard","playerScoreFirstGoal","playerScoreHattrick","playerScoreTwice"],n=[],r=0,i=Object.entries(e);r<i.length;r++)if(a=i[r],o=a[0],u=a[1],t.includes(o))for(l=0,c=Object.keys(u);l<c.length;l++)"NOBODY"!==(d=c[l])&&"OWN_GOAL"!==d&&n.push(d);return n.length?[4,this.playerFacade.getPlayersMapWithNativeIds(n)]:[2,e];case 1:for(h=s.sent(),p=0,f=Object.entries(e);p<f.length;p++)if(m=f[p],v=m[0],y=m[1],t.includes(v))for(g=0,w=Object.keys(y);g<w.length;g++)"NOBODY"!==(_=w[g])&&"OWN_GOAL"!==_&&(y[h[_].id]=y[_],y[h[_].id].model=h[_],this.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&delete y[_]);return[2,e]}}))}))},this.convertMarket=function(e){for(var t=Object.keys(new u.default),n=Object.values(o.MarketEnum),r=0;r<n.length;r++)e===n[r]&&(e=t[r]);return e},this.convertMarketForResponseModel=function(e,t){return e+"_"+t.toString()},this.getMarketSummary=function(e,t,r){return i(n,void 0,void 0,(function(){var n,i,a,u,l,d,h,p,f=this;return s(this,(function(s){switch(s.label){case 0:if(n=this.convertMarket(t),(i={}).matchId=e.matchId,i.matchType=e.matchType,!Object.keys(e.predictions).includes(n))throw new Error("You have passed invalid market");return i[n]=e.predictions[n],o.playerMarkets.includes(t)&&r?(a="","OWN_GOAL"===r||"NOBODY"===r?[3,2]:[4,this.idMapping.idMappingFacade.getEntitiesByIds({player:[r]},this.idMapping.idSchema,"native")]):[3,6];case 1:u=s.sent(),a=u.player[0],s.label=2;case 2:return a&&i[n][a]?[4,this.playerFacade.getPlayersMapWithNativeIds([a])]:[3,4];case 3:return l=s.sent(),i[n][a].model=l[a],[2,i[n][a]];case 4:return a?(i[n][a]=new c.default,[2,i[n][a]]):[2,i[n][r]];case 5:return[3,10];case 6:return!o.playerMarkets.includes(t)||r?[3,10]:(d=Object.keys(i[n]).filter((function(e){return"NOBODY"!==e&&"OWN_GOAL"!==e}))).length?[4,this.playerFacade.getPlayersMapWithNativeIds(d)]:[3,8];case 7:return p=s.sent(),[3,9];case 8:p={},s.label=9;case 9:h=p,Object.keys(h).length&&Object.keys(i[n]).forEach((function(e){"NOBODY"!==e&&"OWN_GOAL"!==e&&(i[n][h[e].id]=i[n][e],i[n][h[e].id].model=h[e],f.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&delete i[n][e])})),s.label=10;case 10:return[2,i]}}))}))},this.remapCompetitionsFromConfig=function(e){return i(n,void 0,void 0,(function(){var t,n,r,i,a,o,u,c;return s(this,(function(s){switch(s.label){case 0:return e instanceof l.default?(t={competition:e.fullCoverageCompetitions},n={competition:e.successRateScopes.competitions},r={team:e.successRateScopes.teams},[4,this.idMapping.idMappingFacade.getEntitiesByIds(t,"native",this.idMapping.idSchema)]):[3,4];case 1:return i=s.sent(),[4,this.idMapping.idMappingFacade.getEntitiesByIds(n,"native",this.idMapping.idSchema)];case 2:return a=s.sent(),[4,this.idMapping.idMappingFacade.getEntitiesByIds(r,"native",this.idMapping.idSchema)];case 3:return o=s.sent(),e.fullCoverageCompetitions=i.competition,e.successRateScopes.competitions=a.competition,e.successRateScopes.teams=o.team,[2,e];case 4:return e instanceof E.default||e instanceof I.default?(u={competition:e.competitionsWhitelist},[4,this.idMapping.idMappingFacade.getEntitiesByIds(u,"native",this.idMapping.idSchema)]):[3,6];case 5:return c=s.sent(),e.competitionsWhitelist=c.competition,[2,e];case 6:return[2]}}))}))},this.remapMatchIdsFixtures=function(e){return i(n,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return Array.isArray(e.data)?e.data.length>0?(t=[],n=[],e.data.forEach((function(e){e instanceof w.default||e instanceof d.default||e instanceof _.default||e instanceof P.default?(e.fixtures.forEach((function(e){return t.push(e.matchId)})),e instanceof _.default&&e.fixtures.forEach((function(e){e.prediction.playerId&&"OWN_GOAL"!==e.prediction.playerId&&n.push(e.prediction.playerId)}))):e instanceof h.default&&e.results.forEach((function(e){return t.push(e.matchId)}))})),[4,this.refactorResponseArrModel(e,t,n)]):[3,2]:[3,4];case 1:case 5:return[2,r.sent()];case 2:return[2,e];case 3:return[3,6];case 4:return[4,this.refactorResponseObjModel(e)];case 6:return[2]}}))}))},this.refactorResponseArrModel=function(e,t,r){return i(n,void 0,void 0,(function(){var n,i,a,o=this;return s(this,(function(s){switch(s.label){case 0:return n=[],[4,this.matchFacade.getMatchesMapWithNativeIds(t)];case 1:return i=s.sent(),a={},r.length>0?[4,this.playerFacade.getPlayersMapWithNativeIds(r)]:[3,3];case 2:a=s.sent(),s.label=3;case 3:return e.data.forEach((function(e){e instanceof w.default||e instanceof d.default||e instanceof _.default?(e.fixtures.forEach((function(t){o.handleMatchModel(i,t),e instanceof _.default&&t.prediction.playerId&&"OWN_GOAL"!==t.prediction.playerId&&(t.prediction.playerModel=a[t.prediction.playerId],t.prediction.playerId=a[t.prediction.playerId].id)})),n.push(e)):e instanceof h.default&&(e.results.forEach((function(e){e.matchModel=i[e.matchId],delete e.matchModel.availableMarkets,e.matchId=e.matchModel.id})),n.push(e))})),e.data=n,[2,e]}}))}))},this.refactorResponseObjModel=function(e){return i(n,void 0,void 0,(function(){var t,n,r=this;return s(this,(function(i){switch(i.label){case 0:return t=[],e.fixtures.forEach((function(e){return t.push(e.matchId)})),[4,this.matchFacade.getMatchesMapWithNativeIds(t)];case 1:return n=i.sent(),e.fixtures.forEach((function(e){return r.handleMatchModel(n,e)})),[2,e]}}))}))},this.getCurrentGameId=function(e){var t=new Date;if(e.data.length>1){var n=[];return e.data.forEach((function(e){return n.push(e.predictionsCutoff)})),e.data.sort((function(e,n){var r=[e.predictionsCutoff,n.predictionsCutoff].map((function(e){return Math.abs(new Date(e)-t)}));return r[0]-r[1]}))[0].id}return e.data[0].id},this.initGameTypePredictions=function(e,t){var n={type:e,limit:null,startAfter:null};return t&&(n=r(r({},n),{limit:t.limit,startAfter:t.startAfter})),new m.default(n)},this.initGameFilters=function(e,t,n){if(t&&n)return t.type=e,t.gameIds=n,new v.default(t);if(t&&!n)return t.type=e,new v.default(t);if(!t&&n){var r={type:e,gameIds:n};return new v.default(r)}return r={type:e},new v.default(r)},this.addPredictionProp=function(e,t){return i(n,void 0,void 0,(function(){var n=this;return s(this,(function(r){switch(r.label){case 0:return t.data.forEach((function(t){e.data.forEach((function(e){t.id===e.game_instance_id&&(t.predictionId=e.id,t.outcome=e.status,t.fixtures.forEach((function(t,r){void 0!==e.fixtures[r].goals_home&&void 0!==e.fixtures[r].goals_away?t.prediction.value=e.fixtures[r].goals_home+":"+e.fixtures[r].goals_away:t.prediction.value=e.fixtures[r].prediction,e.fixtures[r].player_id?t.prediction.playerId=e.fixtures[r].player_id:e.fixtures[r].target&&(t.prediction.target=e.fixtures[r].target),t.prediction.result=n.remapResult(e.fixtures[r].result)})),t.predictionsMadeAt=e.created_at,t.points=e.points,t instanceof d.default&&(e.tiebreaker?t.predictionTiebreaker.goldenGoal=e.tiebreaker.golden_goal:t.predictionTiebreaker=e.tiebreaker))}))})),t.meta.pagination.nextPageStartsAfter=e.meta.pagination.next_page_starts_after,[4,this.remapMatchIdsFixtures(t)];case 1:return[2,r.sent()]}}))}))},this.remapResult=function(e){var t=new g.default;return t.settledAt=e.settled_at,t.resettledAt=e.resettled_at,t.status=e.status,t.outcome=e.outcome,t.points=e.points,t},this.areIdsExceeded=function(e){return e.length>10},this.initPredictionsFilters=function(e,t,r){switch(t){case"user":e&&(e=new m.default(e));break;case"current":if(e)n.deleteUnexpectedProperties(e),e.status=[M.StatusEnum.ACTIVE],e=new m.default(e);else{var i={status:[M.StatusEnum.ACTIVE]};e=new m.default(i)}break;case"past":e?(n.deleteUnexpectedProperties(e),e.status=M.pastStatuses,e=new m.default(e)):(i={status:M.pastStatuses},e=new m.default(i));break;case"matches":e?(n.deleteUnexpectedProperties(e),e.matchIds=r,e=new m.default(e)):(i={matchIds:r},e=new m.default(i))}return e},this.completeGameMarketResults=function(e,t){return i(n,void 0,void 0,(function(){var n,r,i,u,l,c,d,h,p=this;return s(this,(function(s){switch(s.label){case 0:switch(t){case"MATCH_QUIZ":return[3,1];case"TOP_X":return[3,5]}return[3,9];case 1:return n={},r=e.results[0].matchId,i=e.results.map((function(e){return o.playerMarkets.includes(e.market)&&!e.result.includes("OWN_GOAL")?a([],e.result,!0):[]})).flat(),[4,this.matchFacade.getMatchesMapWithNativeIds([r])];case 2:return u=s.sent(),i.length?[4,this.playerFacade.getPlayersMapWithNativeIds(i)]:[3,4];case 3:n=s.sent(),s.label=4;case 4:return e.results=e.results.map((function(e){if(e.matchModel=u[e.matchId]?u[e.matchId]:null,e.playerModels&&Object.keys(n).length&&(t=e.result).forEach((function(t){var r=n[t];e.playerModels.push(r)})),p.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&(p.remapMatchIdForResultsMarkets(u,e),e.playerModels&&Object.keys(n).length)){var t=e.result;e.result=t.map((function(e){return n[e].id}))}return e})),[2,e];case 5:return l=e.results.map((function(e){return e.matchId})),[4,this.matchFacade.getMatchesMapWithNativeIds(l)];case 6:return c=s.sent(),e.results=e.results.map((function(e){return e.matchModel=c[e.matchId]?c[e.matchId]:null,p.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&p.remapMatchIdForResultsMarkets(c,e),e})),e.tieBreakers.goldenGoals.length?(d=e.tieBreakers.goldenGoals.map((function(e){return e.playerId})),[4,this.playerFacade.getPlayersMapWithNativeIds(d)]):[3,8];case 7:h=s.sent(),e.tieBreakers.goldenGoals=e.tieBreakers.goldenGoals.map((function(e){return e.matchModel=c[e.matchId],e.playerModel=h[e.playerId],p.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&(e.matchId=c[e.matchId].id,e.playerId=h[e.playerId].id),e})),s.label=8;case 8:return[2,e];case 9:return[2]}}))}))},this.completeContestWinners=function(e){return i(n,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return t=e.userList.map((function(e){return e.profileId})),[4,this.profileNamespace.getByIds(t)];case 1:return n=r.sent(),e.userList.forEach((function(e){var t=n.filter((function(t){return t.id===e.profileId}))[0];delete t.interests,e.profileModel=t})),[2,e]}}))}))},this.handleMatchModel=function(e,t){e[t.matchId]?(t.matchModel=e[t.matchId],delete t.matchModel.availableMarkets,t.matchId=t.matchModel.id):(t.matchModel=null,n.idMapping.idSchema!==T.IdSchemaEnum.NATIVE&&n.idMapping.idMappingFacade.getEntityById(t.matchId,"match","native").then((function(e){t.matchId=e[R.ID_TYPES[n.idMapping.idSchema]]})))},this.remapMatchIdForResultsMarkets=function(e,t){e[t.matchId]?t.matchId=e[t.matchId].id:n.idMapping.idMappingFacade.getEntityById(t.matchId,"match","native").then((function(e){t.matchId=e[R.ID_TYPES[n.idMapping.idSchema]]}))},this.deleteUnexpectedProperties=function(e){return e.status&&(console.warn(O.WarningMessages.UNEXPECTED_STATUS_PROP),delete e.status),e.type&&(console.warn(O.WarningMessages.UNEXPECTED_TYPE_PROP),delete e.type),e},this.footballHttps=new p.default(e),this.idMapping=t,this.matchFacade=new f.default(e,this.footballHttps,t),this.playerFacade=new b.default(e,this.footballHttps,t),this.profileNamespace=new S.default(e)}},2310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4021),i=n(4904),s=n(8097),a=n(5318),o=n(7974),u=n(1976),l=n(1206),c=n(5274),d=n(1465),h=n(7535),p=n(1718),f=n(7307),m=n(5132),v=n(7344),y=n(1855),g=n(1732),w=n(5814),_=n(3950),b=n(1260),E=n(7640),I=n(2535);t.default=function(e){var t=this;this.errorHandlingMode=null,this.validateBodyFields=function(e,n){var r=Object.keys(n),i=Object.keys(new _.default);switch(e){case"MATCH_QUIZ":r.forEach((function(e){i.includes(e)||t.throwInvalidParamException([e])}));break;case"TOP_X":var s=n;s.fixtures.forEach((function(e){return t.validateMarketTopX(e.market)})),r.includes("tiebreaker")&&s.tiebreaker&&t.validateTiebreaker(s.tiebreaker),r.forEach((function(e){"tiebreaker"===e||i.includes(e)||t.throwInvalidParamException([e])}))}var a=i.filter((function(e){return!r.includes(e)}));return a.length&&t.throwMissingFieldsException("game prediction body",a),n.fixtures.forEach((function(e){t.validateFixtureFields(e)})),n},this.validateFixture=function(e,n,r,i){t.validateMarket(n);var s=Object.values(u.OneXTwoEnum),a=Object.values(u.HalfTimeFullTimeEnum),_=Object.values(u.DoubleChanceEnum);if(n===o.MarketEnum.FT_1X2||n===o.MarketEnum.HT_1X2){if(s.includes(r))return new p.default(e,n,r)}else if(n===o.MarketEnum.HT_FT){if(a.includes(r))return new f.default(e,r)}else if(n===o.MarketEnum.DOUBLE_CHANCE){if(_.includes(r))return new h.default(e,r)}else if(n===o.MarketEnum.CORRECT_SCORE||n===o.MarketEnum.CORRECT_SCORE_ADVANCED||n===o.MarketEnum.CORRECT_SCORE_HT){if("string"==typeof r&&/\d+:\d+/.test(r))return new d.default(e,n,r)}else if(n===o.MarketEnum.CORNERS_MATCH){if("number"==typeof r)return new c.default(e,r)}else if(n===o.MarketEnum.BOTH_TEAMS_SCORE){if(t.isPredictionBoolean(r))return new l.default(e,r)}else if(n===o.MarketEnum.RED_CARD_MATCH){if(t.isPredictionBoolean(r))return new w.default(e,r)}else if(n===o.MarketEnum.PENALTY_MATCH){if(t.isPredictionBoolean(r))return new y.default(e,r)}else if(o.playerMarkets.includes(n)){var b="OWN_GOAL";if(t.validatePlayerId(n,i),n===o.playerMarketNobodyPrediction&&t.isPredictionBoolean(r)){var E=i&&i===b?b:i;return new g.default(e,n,r,E)}if(i&&t.isPredictionBoolean(r))return new g.default(e,n,r,i)}else if(o.MarketsOverGoals.includes(n)){if(t.isPredictionBoolean(r))return new v.default(e,n,r)}else if(o.MarketsOverCorners.includes(n)&&t.isPredictionBoolean(r))return new m.default(e,n,r);t.throwInvalidPredictionException(r,n)},this.validateFixtureFields=function(e){var n=Object.keys(e);n.forEach((function(e){b.validFixtureFields.includes(e)||t.throwInvalidParamException([e])}));var r=b.validFixtureFields.filter((function(e){if("matchType"!==e&&!n.includes(e))return e}));r.length&&t.throwMissingFieldsException("fixtures",r),t.validatePredictionKey(e.market,e.prediction)},this.validateTiebreaker=function(e){var n=Object.keys(e);n.length&&"object"==typeof e||t.throwInvalidType("tiebreaker","object");var r=Object.keys(new E.default)[0];n.forEach((function(e){r!==e&&t.throwInvalidParamException([e])})),n.includes(r)||t.throwMissingFieldsException("tiebreaker",[r]),"number"!=typeof e.goldenGoal&&t.throwInvalidType("goldenGoal","number")},this.validatePredictionKey=function(e,n){if("object"==typeof n){var r=Object.keys(n),i=["value"];if(r.length||t.throwMissingFieldsException("prediction",i),1!==r.length||r.includes(i[0])||t.throwInvalidParamException(r),r.length>1){o.playerMarkets.includes(e)&&i.push("playerId");var s=r.filter((function(e){return!i.includes(e)}));s.length&&t.throwInvalidParamException(s)}}else t.throwInvalidType("prediction","object")},this.validatePlayerId=function(e,n){var r="playerId";e!==o.playerMarketNobodyPrediction&&(n||t.throwInvalidParamException([r]),"string"!=typeof n&&t.throwInvalidType(r,"string"))},this.validateMarket=function(e){Object.values(o.MarketEnum).includes(e)||t.throwInvalidMarketException(e)},this.validateMarketTopX=function(e){e!==o.MarketEnum.CORRECT_SCORE&&e!==o.MarketEnum.CORRECT_SCORE_ADVANCED&&t.throwInvalidMarketException(e,"TOP_X")},this.isPredictionBoolean=function(e){return"boolean"==typeof e},this.throwInvalidPredictionException=function(e,n){var o=(0,a.invalidPredictionMessage)(e,n);if("default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_PREDICTION,o);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o).response},this.throwInvalidMarketException=function(e,n){var o;if(o=n&&"TOP_X"===n?(0,a.invalidMarketTopXMessage)(e):(0,a.invalidMarketMessage)(e),"default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_MARKET,o);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o).response},this.throwInvalidParamException=function(e){var n=(0,a.invalidFieldMessage)(e);if("default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FIELD,n);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,n).response},this.throwMissingFieldsException=function(e,n){var o=(0,a.missingFieldsMessage)(e,n);if("default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_FIELD,o);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o).response},this.throwInvalidType=function(e,n){var o=(0,a.invalidTypeMessage)(e,n);if("default"===t.errorHandlingMode)throw new s.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o);throw new I.default(r.ErrorCodes.BAD_METHOD_CALL,i.ErrorStatuses.INVALID_TYPE,o).response},this.errorHandlingMode=e}},4831:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var o=n(9072),u=n(7232),l=n(4268),c=n(8097),d=n(2535),h=n(4021),p=n(4904),f=n(5318);t.default=function(e,t,n,m,v){var y=this;this.idsRemapper=null,this.profileHttps=null,this.profileService=null,this.localStorage=null,this.profileFacade=null,this.ownProfile=null,this.modified=!1,this.expireAt=0,this.promises=[],this.isFetching=!1,this.errorHandlingMode=null,this.getOwnProfile=function(){return i(y,void 0,void 0,(function(){var e,t,n;return s(this,(function(r){switch(r.label){case 0:return this.isFetching?(console.log("Another thread is fetching profile..."),[4,this.delay(100)]):[3,2];case 1:return r.sent(),[3,0];case 2:if(this.modified&&this.ownProfile)return console.log("Timestamp is less than 10 minutes OR profile is modifying "),[2,this.ownProfile];if(e=Math.floor(Date.now()/1e3),this.ownProfile&&!(this.expireAt<e))return[3,7];this.isFetching=!0,this.expireAt=Math.floor(Date.now()/1e3)+600,r.label=3;case 3:return r.trys.push([3,5,,6]),[4,this.profileFacade.getOwn()];case 4:return t=r.sent(),this.setOwnProfile(t),[3,6];case 5:throw n=r.sent(),this.isFetching=!1,n;case 6:return this.modified=!1,this.isFetching=!1,[2,this.ownProfile];case 7:return[2,this.ownProfile]}}))}))},this.delay=function(e){return new Promise((function(t){setTimeout(t,e)}))},this.setOwnProfile=function(e){y.ownProfile=e},this.getInfo=function(){return i(y,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return e=n.sent(),delete(t=JSON.parse(JSON.stringify(e))).interests,[2,t]}}))}))},this.showInterests=function(){return i(y,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[4,this.idsRemapper.remapInterests(t.interests)];case 2:return[2,n.sent()]}}))}))},this.showFullInterests=function(){return i(y,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[4,this.idsRemapper.showFullInterests(t.interests)];case 2:return[2,n.sent()]}}))}))},this.getFollowers=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getFollowers(e)];case 1:return[2,t.sent()]}}))}))},this.getFollowing=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getFollowing(e)];case 1:return[2,t.sent()]}}))}))},this.follow=function(e){return i(y,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return[4,this.profileFacade.follow(e)];case 1:return t=r.sent(),[4,this.profileFacade.updateOwnProfile()];case 2:return n=r.sent(),this.setOwnProfile(n),[2,t]}}))}))},this.unfollow=function(e){return i(y,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return[4,this.profileFacade.unfollow(e)];case 1:return t=r.sent(),[4,this.profileFacade.updateOwnProfile()];case 2:return n=r.sent(),this.setOwnProfile(n),[2,t]}}))}))},this.getStats=function(){return i(y,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getStats()];case 1:return e=t.sent(),[4,this.idsRemapper.remapSuccessRatesEntities(e)];case 2:return[2,t.sent()]}}))}))},this.getBadges=function(){return i(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getBadges()];case 1:return[2,e.sent()]}}))}))},this.addInterestPromise=function(e){return i(y,void 0,void 0,(function(){var t,n,i;return s(this,(function(s){switch(s.label){case 0:return this.modified=!0,t=r({},e),[4,this.getOwnProfile()];case 1:return s.sent(),n=null,"custom"===e.source?[3,3]:[4,this.idsRemapper.remapInterestToNative(t)];case 2:return n=s.sent(),[3,4];case 3:n=t,s.label=4;case 4:return i=this.ownProfile.interests.filter((function(e){return e.id!==n.id||e.type!==n.type||e.source!==n.source})),this.ownProfile.interests=a([],i,!0),this.ownProfile.interests.push(n),[2,this]}}))}))},this.addInterest=function(e){return y.promises.push(y.addInterestPromise(e)),y},this.removeInterestPromise=function(e){return i(y,void 0,void 0,(function(){var t,n;return s(this,(function(i){switch(i.label){case 0:return this.modified=!0,t=r({},e),[4,this.getOwnProfile()];case 1:return i.sent(),n=null,"custom"===e.source?[3,3]:[4,this.idsRemapper.remapInterestToNative(t)];case 2:return n=i.sent(),[3,4];case 3:n=t,i.label=4;case 4:return this.ownProfile.interests=this.ownProfile.interests.filter((function(e){return e.id!==n.id||e.type!==n.type||e.source!==n.source})),[2,this]}}))}))},this.removeInterest=function(e){return y.promises.push(y.removeInterestPromise(e)),y},this.setBirthdatePromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),this.ownProfile.birthDate=e||null,[2,this]}}))}))},this.setBirthdate=function(e){return y.promises.push(y.setBirthdatePromise(e)),y},this.setGenderPromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),this.ownProfile.gender="male"===e||"female"===e?e:"unspecified",[2,this]}}))}))},this.setGender=function(e){return y.promises.push(y.setGenderPromise(e)),y},this.setNicknamePromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),this.ownProfile.nickname=e,[2,this]}}))}))},this.setNickname=function(e){return y.promises.push(y.setNicknamePromise(e)),y},this.setNamePromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),this.ownProfile.name=e,[2,this]}}))}))},this.setName=function(e){return y.promises.push(y.setNamePromise(e)),y},this.setCountryPromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return t.sent(),e&&!this.ownProfile.country?(this.ownProfile.country=new o.default,this.ownProfile.country.id=e):e&&this.ownProfile.country?this.ownProfile.country.id=e:this.ownProfile.country=null,[2,this]}}))}))},this.setCountry=function(e){return y.promises.push(y.setCountryPromise(e)),y},this.showFullnessProfile=function(){return i(y,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[2,this.profileFacade.showFullnessProfile(t)]}}))}))},this.setAvatarPromise=function(e){return i(y,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:if(t.sent(),this.profileService.isAvatarValidURL(e))this.ownProfile.avatar=e;else{if("default"===this.errorHandlingMode)throw new c.default(h.ErrorCodes.BAD_METHOD_CALL,p.ErrorStatuses.INVALID_AVATAR,f.ErrorMessages.INVALID_AVATAR);if("standard"===this.errorHandlingMode)throw new d.default(h.ErrorCodes.BAD_METHOD_CALL,p.ErrorStatuses.INVALID_AVATAR,f.ErrorMessages.INVALID_AVATAR).response}return[2,this]}}))}))},this.setAvatar=function(e){return y.promises.push(y.setAvatarPromise(e)),y},this.update=function(){return i(y,void 0,void 0,(function(){var e,t,n,r,i,a;return s(this,(function(s){switch(s.label){case 0:return 0===this.promises.length?[2,this.ownProfile]:[4,Promise.all(this.promises)];case 1:return s.sent(),[4,this.profileFacade.getOwn()];case 2:return e=s.sent(),[4,this.getOwnProfile()];case 3:return t=s.sent(),n=this.profileService.extractUpdatedProps(e,t),this.modified=!1,this.expireAt=0,Object.keys(n).length?[4,this.profileHttps.updateProfile(n)]:[3,5];case 4:return r=s.sent(),i=JSON.parse(JSON.stringify(r)),this.setOwnProfile(i),this.localStorage.setOwnProfile(i),delete r.interests,[2,r];case 5:return delete(a=JSON.parse(JSON.stringify(this.ownProfile))).interests,[2,a]}}))}))},this.idsRemapper=e,this.localStorage=t,this.profileHttps=n,this.errorHandlingMode=v,this.profileService=new l.default,this.profileFacade=new u.default(t,n,m)}},642:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(7232);t.default=function(e,t,n,a){var o=this;this.idsRemapper=null,this.profileHttps=null,this.activityHttps=null,this.profileFacade=null,this.profileId="",this.setId=function(e){return o.profileId=e,o},this.getProfile=function(){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getById(this.profileId)];case 1:return[2,e.sent()]}}))}))},this.getInfo=function(){return r(o,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.getProfile()];case 1:return delete(e=t.sent()).interests,[2,e]}}))}))},this.showInterests=function(){return r(o,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return[4,this.getProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[4,this.idsRemapper.remapInterests(t.interests)];case 2:return[2,n.sent()]}}))}))},this.showFullInterests=function(){return r(o,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return[4,this.getProfile()];case 1:return e=n.sent(),t=JSON.parse(JSON.stringify(e)),[4,this.idsRemapper.showFullInterests(t.interests)];case 2:return[2,n.sent()]}}))}))},this.getFollowers=function(e){return r(o,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getFollowers(e,this.profileId)];case 1:return[2,t.sent()]}}))}))},this.getFollowing=function(e){return r(o,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getFollowing(e,this.profileId)];case 1:return[2,t.sent()]}}))}))},this.showFullnessProfile=function(){return r(o,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.getProfile()];case 1:return e=t.sent(),[2,this.profileFacade.showFullnessProfile(e)]}}))}))},this.getStats=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.activityHttps.getStats(this.profileId,e)];case 1:return t=n.sent(),[4,this.idsRemapper.remapSuccessRatesEntities(t)];case 2:return[2,n.sent()]}}))}))},this.getBadges=function(){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.profileHttps.getBadges(this.profileId)];case 1:return[2,e.sent()]}}))}))},this.idsRemapper=e,this.profileHttps=n,this.activityHttps=a,this.profileFacade=new s.default(t,n,a)}},7232:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(9037),a=n(9523);t.default=function(e,t,n){var o=this;this.isBrowser=!1,this.localStorage={},this.profileHttps=null,this.activityHttps=null,this.getOwn=function(){return r(o,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?(e=this.getLocalStorageData("profile"))?[2,JSON.parse(JSON.stringify(e))]:[3,1]:[3,5];case 1:return i.trys.push([1,3,,4]),[4,this.profileHttps.getProfile()];case 2:return n=i.sent(),this.localStorage.setOwnProfile(n),[2,n];case 3:throw t=i.sent(),console.warn("There was a problem retrieving your profile: ",t),t;case 4:return[3,8];case 5:return i.trys.push([5,7,,8]),[4,this.profileHttps.getProfile()];case 6:return[2,n=i.sent()];case 7:throw r=i.sent(),console.warn("There was a problem retrieving your profile: ",r),r;case 8:return[2]}}))}))},this.updateOwnProfile=function(){return r(o,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.getProfile()];case 1:return e=n.sent(),this.localStorage.setOwnProfile(e),[2,e];case 2:throw t=n.sent(),console.warn("There was a problem retrieving your profile: ",t),t;case 3:return[2]}}))}))},this.getByIds=function(e,t){return r(o,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=t||!1,[4,this.profileHttps.getProfiles(e,t)];case 1:return[2,r.sent()];case 2:throw n=r.sent(),console.warn("There was a problem retrieving the selected profiles: "+e.join(",")+" ",n),n;case 3:return[2]}}))}))},this.getById=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.getProfile(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem retrieving the selected profile: "+e+" ",t),t;case 3:return[2]}}))}))},this.getCountries=function(e){return r(o,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=e||!1,this.isBrowser?(t=this.localStorage.getProfileCountries())&&t.length>0?[2,t]:[3,1]:[3,5];case 1:return i.trys.push([1,3,,4]),[4,this.profileHttps.getCountries(e)];case 2:return n=i.sent(),this.localStorage.setProfileCountries(n),[2,n];case 3:throw r=i.sent(),console.warn("There was a problem retrieving profile countries: ",r),r;case 4:return[3,8];case 5:return i.trys.push([5,7,,8]),[4,this.profileHttps.getCountries(e)];case 6:return[2,i.sent()];case 7:throw s=i.sent(),console.warn("There was a problem retrieving profile countries: ",s),s;case 8:return[2]}}))}))},this.getFollowers=function(e,t){return r(o,void 0,void 0,(function(){var n,r,s,o,u;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),e&&(e=new a.default(e)),[4,this.profileHttps.getFollowers(e,t)];case 1:return n=i.sent(),(r=n.data.map((function(e){return e.followerId}))).length?[4,this.getByIds(r)]:[3,3];case 2:return s=i.sent(),o=n.data.map((function(e){return s.forEach((function(t){e.followerId===t.id&&(e.name=t.name,e.nickname=t.nickname,e.avatar=t.avatar)})),e})),n.data=o,[2,n];case 3:return[2,n];case 4:throw u=i.sent(),console.warn("There was a problem retrieving your followers: ",u),u;case 5:return[2]}}))}))},this.getFollowing=function(e,t){return r(o,void 0,void 0,(function(){var n,r,s,o,u;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),e&&(e=new a.default(e)),[4,this.profileHttps.getFollowing(e,t)];case 1:return n=i.sent(),(r=n.data.map((function(e){return e.followingId}))).length?[4,this.getByIds(r)]:[3,3];case 2:return s=i.sent(),o=n.data.map((function(e){return s.forEach((function(t){e.followingId===t.id&&(e.name=t.name,e.nickname=t.nickname,e.avatar=t.avatar)})),e})),n.data=o,[2,n];case 3:return[2,n];case 4:throw u=i.sent(),console.warn("There was a problem retrieving your following profiles: ",u),u;case 5:return[2]}}))}))},this.follow=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.follow(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem following profiles: "+e.join(",")+" ",t),t;case 3:return[2]}}))}))},this.unfollow=function(e){return r(o,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.unfollow(e)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.warn("There was a problem unfollowing profiles: "+e.join(",")+" ",t),t;case 3:return[2]}}))}))},this.showFullnessProfile=function(e){var t=new s.default,n=0;return e.avatar&&(t.breakdown.addedAvatar.completed=!0,n+=t.breakdown.addedAvatar.percentage),e.birthDate&&(t.breakdown.addedBirthdate.completed=!0,n+=t.breakdown.addedBirthdate.percentage),e.country&&(t.breakdown.addedCountry.completed=!0,n+=t.breakdown.addedCountry.percentage),e.gender&&(t.breakdown.addedGender.completed=!0,n+=t.breakdown.addedGender.percentage),e.interests&&e.interests.length>0&&(e.interests.find((function(e){return"team"===e.type&&e.favourite}))&&(t.breakdown.teamFavourite.completed=!0,n+=t.breakdown.teamFavourite.percentage),e.interests.find((function(e){return"team"===e.type}))&&(t.breakdown.teamFollowed.completed=!0,n+=t.breakdown.teamFollowed.percentage),e.interests.find((function(e){return"player"===e.type&&e.favourite}))&&(t.breakdown.playerFavourite.completed=!0,n+=t.breakdown.playerFavourite.percentage),e.interests.find((function(e){return"player"===e.type}))&&(t.breakdown.playerFollowed.completed=!0,n+=t.breakdown.playerFollowed.percentage),e.interests.find((function(e){return"competition"===e.type&&e.favourite}))&&(t.breakdown.competitionFavourite.completed=!0,n+=t.breakdown.competitionFavourite.percentage),e.interests.find((function(e){return"competition"===e.type}))&&(t.breakdown.competitionFollowed.completed=!0,n+=t.breakdown.competitionFollowed.percentage)),t.totalPercentage=n,t},this.getStats=function(){return r(o,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?(e=this.getLocalStorageData("statistics"))&&Object.keys(e).length?[2,JSON.parse(JSON.stringify(e))]:[3,1]:[3,5];case 1:return i.trys.push([1,3,,4]),[4,this.activityHttps.getStats()];case 2:return t=i.sent(),this.localStorage.setProfileStats(t),[2,t];case 3:throw n=i.sent(),console.warn("There was a problem retrieving own profile statistics: ",n),n;case 4:return[3,8];case 5:return i.trys.push([5,7,,8]),[4,this.activityHttps.getStats()];case 6:return[2,i.sent()];case 7:throw r=i.sent(),console.warn("There was a problem retrieving own profile statistics: ",r),r;case 8:return[2]}}))}))},this.getBadges=function(){return r(o,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return this.isBrowser?(e=this.getLocalStorageData("badges"))?[2,e]:[3,1]:[3,5];case 1:return i.trys.push([1,3,,4]),[4,this.profileHttps.getBadges()];case 2:return t=i.sent(),this.localStorage.setProfileBadges(t),[2,t];case 3:throw n=i.sent(),console.warn("There was a problem retrieving own profile badges: ",n),n;case 4:return[3,8];case 5:return i.trys.push([5,7,,8]),[4,this.profileHttps.getBadges()];case 6:return[2,i.sent()];case 7:throw r=i.sent(),console.warn("There was a problem retrieving own profile badges: ",r),r;case 8:return[2]}}))}))},this.getLocalStorageData=function(e){var t=Math.floor(Date.now()/1e3),n=o.localStorage.getExpiration("profile",e);switch(e){case"profile":if(n>t)return o.localStorage.getOwnProfile();case"statistics":if(n>t)return o.localStorage.getProfileStats();case"badges":if(n>t)return o.localStorage.getProfileBadges();default:return null}},this.isBrowser="undefined"!=typeof window,this.localStorage=e,this.profileHttps=t,this.activityHttps=n}},9523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=this;this.limit=0,this.startAfter=null,this.constructFilterUrl=function(){var e="";return t.limit&&(e=(e+="&")+"limit="+t.limit),t.startAfter&&(e=(e+="&")+"start_after="+t.startAfter),e},this.limit=e.limit?e.limit:20,this.startAfter=e.startAfter?e.startAfter:null}},4782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.avatar=null,this.followerId=null,this.name=null,this.nickname=null,this.profileId=null}},1712:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.profile_ids=[]}},3106:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.avatar=null,this.followingId=null,this.name=null,this.nickname=null,this.profileId=null}},5156:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.model=null,t}return i(t,e),t}(n(5867).default);t.default=s},6620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7312);t.default=function(){this.teamFollowed=new r.default(10),this.teamFavourite=new r.default(15),this.playerFollowed=new r.default(10),this.playerFavourite=new r.default(10),this.competitionFollowed=new r.default(10),this.competitionFavourite=new r.default(5),this.addedBirthdate=new r.default(10),this.addedGender=new r.default(10),this.addedCountry=new r.default(10),this.addedAvatar=new r.default(10)}},7312:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.completed=!1,this.percentage=e}},9037:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6620);t.default=function(){this.breakdown=new r.default}},5867:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id="",this.source="",this.type="",this.favourite=!1}},9072:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id=null,this.name=null,this.assets=null}},3546:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.id=null,this.name=null,this.nickname=null,this.avatar=null,this.gender=null,this.country=null,this.birthDate=null,this.interests=[],this.followingCount=0,this.followersCount=0}},6277:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1553),i=n(4782);t.default=function(){var e=this;this.followersFromResponse=function(t){var n=new r.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapResponse(t)})),n},this.remapResponse=function(e){var t=new i.default;return t.avatar=e.avatar,t.followerId=e.follower_id,t.name=e.name,t.profileId=e.profile_id,t}}},8673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1553),i=n(3106);t.default=function(){var e=this;this.followResponse=function(t){return t.map((function(t){return e.remapResponse(t)}))},this.followingFromResponse=function(t){var n=new r.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapResponse(t)})),n},this.remapResponse=function(e){var t=new i.default;return t.avatar=e.avatar,t.followingId=e.following_id,t.name=e.name,t.profileId=e.profile_id,t.nickname=e.nickname,t}}},441:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3546);t.default=function(){var e=this;this.profilesFromResponse=function(t){return t?t.map((function(t){return e.fullProfileFromResponse(t)})):null},this.fullProfileFromResponse=function(e){var t=new r.default;return t.id=e.id,t.name=e.name,t.nickname=e.nickname,t.avatar=e.avatar,t.gender=e.gender,t.country=e.country,t.birthDate=e.birth_date,t.interests=e.interests?e.interests:[],t.followingCount=e.following_count,t.followersCount=e.followers_count,t}}},1316:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5123);t.default=function(){this.successRates=new r.default}},9826:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.model=null}},5123:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}},6409:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4275),a=n(8900),o=n(7232),u=n(5601),l=n(4831),c=n(642),d=n(4289),h=n(595),p=n(1022),f=n(4912);t.default=function(e){var t=this;this.idsRemapper=null,this.profileHttps=null,this.activityHttps=null,this.footballHttps=null,this.footballFacade=null,this.idMapping=null,this.localStorage=null,this.profileFacade=null,this.ownProfileBuilder=null,this.profileBuilder=null,this.getOwn=function(){return t.ownProfileBuilder},this.getById=function(e){return t.profileBuilder.setId(e)},this.getCountries=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getCountries(e)];case 1:return[2,t.sent()]}}))}))},this.getByIds=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getByIds(e,n)];case 1:return[2,t.sent()]}}))}))},this.profileHttps=new s.default(e),this.activityHttps=new p.default(e),this.footballHttps=new h.default(e),this.idMapping=new a.default(e),this.localStorage=new u.default(e),this.footballFacade=new d.default(e,this.localStorage,this.footballHttps,this.idMapping),this.profileFacade=new o.default(this.localStorage,this.profileHttps,this.activityHttps),this.idsRemapper=new f.default(e,this.footballFacade),this.ownProfileBuilder=new l.default(this.idsRemapper,this.localStorage,this.profileHttps,this.activityHttps,e.errorHandlingMode),this.profileBuilder=new c.default(this.idsRemapper,this.localStorage,this.profileHttps,this.activityHttps)}},4268:function(e,t){"use strict";var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=this;this.extractUpdatedProps=function(t,n){var r=["name","nickname","gender","avatar"],i={};return Object.keys(t).forEach((function(s){if(r.includes(s)&&t[s]!==n[s])i[s]=n[s];else if("birthDate"===s)(null===n[s]||null===t[s]&&n[s]||t[s]!==n[s])&&(i.birth_date=n[s]);else if("country"===s)null===n[s]?i.country_id=n[s]:(null===t[s]&&n[s]||t[s].id!==n[s].id)&&(i.country_id=n[s].id);else if("interests"===s){var a=t[s],o=n[s];o.length&&e.isNewInterest(a,o)?i[s]=e.updateInterests(a,o):!o.length&&a.length?i[s]=o:a.length===o.length||e.isNewInterest(a,o)||(i[s]=o)}})),i},this.updateInterests=function(t,r){if(t.length===r.length){var i=e.extractSameAndNewInterests(t,r),s=i[0],a=i[1];return n(n([],a,!0),s,!0)}return r},this.isNewInterest=function(t,n){var r=!1;return e.extractSameAndNewInterests(t,n)[0].length?r=!0:r},this.extractSameAndNewInterests=function(e,t){var n=t.filter((function(t){return e.some((function(e){return t.id===e.id&&t.type===e.type&&t.source===e.source&&t.favourite===e.favourite}))}));return[t.filter((function(t){return!e.some((function(e){return t.id===e.id&&t.type===e.type&&t.source===e.source&&t.favourite===e.favourite}))})),n]},this.isAvatarValidURL=function(e){try{return new URL(e),!0}catch(e){return!1}}}},853:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.GameStatusEnum=void 0,(n=t.GameStatusEnum||(t.GameStatusEnum={})).OPEN="OPEN",n.LIVE="LIVE",n.PENDING="PENDING",n.CANCELED="CANCELED",n.CLOSED="CLOSED",n.SETTLED="SETTLED"},9502:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4946),a=n(2793),o=n(5013),u=n(853),l=n(7299),c=n(1553),d=n(1399),h=n(7782),p=n(7686),f=n(2310),m=n(8097),v=n(4904),y=n(5318),g=n(4021),w=n(2535);t.default=function(e,t){var n=this;this.idMapping=null,this.predictorHttps=null,this.predictorService=null,this.predictorValidator=null,this.clientHttps=null,this.errorHandlingMode=null,this.getConfig=function(){return r(n,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(p.FeatureConfigType.TOP_X)];case 1:return e=t.sent(),this.idMapping.idSchema===s.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(e)];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},this.getGames=function(e,t){return r(n,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return t=t||!1,n=this.predictorService.initGameFilters("TOP_X",e),[4,this.predictorHttps.getGames(n,t)];case 1:return r=i.sent(),[4,this.predictorService.remapMatchIdsFixtures(r)];case 2:return[2,i.sent()]}}))}))},this.getGameById=function(e,t){return r(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return t=t||!1,[4,this.predictorHttps.getGameById(e,t)];case 1:return n=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(n)];case 2:return[2,r.sent()]}}))}))},this.getGamePredictions=function(e,t,s){return r(n,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return s=s||!1,t&&(t.type&&delete t.type,t.status&&delete t.status,t=new h.default(t)),[4,this.predictorHttps.getGamePredictions(e,s,t)];case 1:return[2,n.sent()]}}))}))},this.getGameResults=function(e,t,s){return r(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return s=s||!1,t&&(t=new l.default(t)),[4,this.predictorHttps.getGameResults(e,s,t)];case 1:return n=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(n)];case 2:return[2,r.sent()]}}))}))},this.getCurrentGameResults=function(e){return r(n,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=e||!1,t={status:u.GameStatusEnum.OPEN,type:"TOP_X"},t=new l.default(t),[4,this.predictorHttps.getGames(t,e)];case 1:return n=i.sent(),r=this.predictorService.getCurrentGameId(n),[4,this.getGameResults(r,null,e)];case 2:return[2,i.sent().data[0]]}}))}))},this.play=function(e){return r(n,void 0,void 0,(function(){var t,n,r,a,o=this;return i(this,(function(i){switch(i.label){case 0:return t=new d.default(e),(t=this.predictorValidator.validateBodyFields("TOP_X",t)).fixtures=t.fixtures.map((function(e){return o.predictorValidator.validateFixture(e.matchId,e.market,e.prediction.value)})),this.idMapping.idSchema===s.IdSchemaEnum.NATIVE?[3,2]:(n=[],t.fixtures.forEach((function(e){return n.push(e.matchId)})),[4,this.predictorService.remapMatchIdToNative(n)]);case 1:r=i.sent(),t.fixtures.forEach((function(e){return e.matchId=r.shift()})),i.label=2;case 2:return[4,this.predictorHttps.makeFootballPrediction(t)];case 3:return(a=i.sent()).fixtures.forEach((function(e){e.matchId=e.matchModel.id})),[2,a]}}))}))},this.delete=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getMyGameEditions=function(e,t){return r(n,void 0,void 0,(function(){var n,r,s,a,o;return i(this,(function(i){switch(i.label){case 0:return e&&e.limit&&this.validateLimitFilterOnGames(e.limit),t=t||!1,n=this.predictorService.initGameTypePredictions("TOP_X",e),r=[],[4,this.predictorHttps.getMyPredictionsNoRemap(n)];case 1:return(s=i.sent()).data.length>0?(s.data.forEach((function(e){e.game_instance_id&&r.push(e.game_instance_id)})),a=this.predictorService.initGameFilters("TOP_X",null,r),[4,this.predictorHttps.getUserGameEditions(a,t)]):[3,4];case 2:return o=i.sent(),[4,this.predictorService.addPredictionProp(s,o)];case 3:return[2,i.sent()];case 4:return[2,new c.default]}}))}))},this.getMyGamePrediction=function(e){return r(n,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=this.predictorService.initGameTypePredictions("TOP_X"),[4,this.predictorHttps.getMyPredictions(t)];case 1:return(n=i.sent()).data.length>0?[2,(r=n.data.filter((function(t){return t.gameInstanceId===e}))).length?r[0]:null]:[2,null]}}))}))},this.getUserGameEditions=function(e,t,s){return r(n,void 0,void 0,(function(){var n,r,a,o,u;return i(this,(function(i){switch(i.label){case 0:return t&&t.limit&&this.validateLimitFilterOnGames(t.limit),s=s||!1,n=this.predictorService.initGameTypePredictions("TOP_X",t),r=[],[4,this.predictorHttps.getUserPredictionsNoRemap(e,n)];case 1:return(a=i.sent()).data.length>0?(a.data.forEach((function(e){e.game_instance_id&&r.push(e.game_instance_id)})),o=this.predictorService.initGameFilters("TOP_X",null,r),[4,this.predictorHttps.getUserGameEditions(o,s)]):[3,4];case 2:return u=i.sent(),[4,this.predictorService.addPredictionProp(a,u)];case 3:return[2,i.sent()];case 4:return[2,new c.default]}}))}))},this.getUserGamePrediction=function(e,t,s){return r(n,void 0,void 0,(function(){var n,r,a;return i(this,(function(i){switch(i.label){case 0:return s=s||!1,n=this.predictorService.initGameTypePredictions("TOP_X"),[4,this.predictorHttps.getUserPredictions(e,s,n)];case 1:return(r=i.sent()).data.length>0?[2,(a=r.data.filter((function(e){return e.gameInstanceId===t}))).length?a[0]:null]:[2,null]}}))}))},this.getMarketsResultsForGame=function(e,t){return r(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getMarketResultsForGame(e,t)];case 1:return n=r.sent(),[4,this.predictorService.completeGameMarketResults(n,"TOP_X")];case 2:return[2,r.sent()]}}))}))},this.getGameWinners=function(e){return r(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(e)];case 1:return t=r.sent(),[4,this.getGameById(e)];case 2:return n=r.sent(),t.contestModel=n,[2,this.predictorService.completeContestWinners(t)]}}))}))},this.validateLimitFilterOnGames=function(e){if("default"===n.errorHandlingMode&&e>50)throw new m.default(g.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,y.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED);if("standard"===n.errorHandlingMode&&e>50)throw new w.default(g.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,y.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED).response},this.idMapping=t,this.errorHandlingMode=e.errorHandlingMode,this.predictorValidator=new f.default(e.errorHandlingMode),this.predictorHttps=new a.default(e,t),this.predictorService=new o.default(e,t),this.clientHttps=new p.default(e)}},1180:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.enabled=!1,this.clientId=null,this.minFixtures=null,this.maxFixtures=null,this.competitionsWhitelist=null}},7482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6899);t.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default}},5967:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6899),i=n(3381);t.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default,this.prediction=new i.default}},6247:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.adContent=null,t.labels=null,t.customFields=null,t}return i(t,e),t}(n(3751).default);t.default=s},6890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.userId=null,this.points=null,this.results=[],this.tiebreaker=null}},6160:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.matchId=null,this.matchModel=null,this.outcome=null}},7299:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=n(4800),a=n(853),o=function(e){function t(t){var n=e.call(this,t)||this;return n.status=null,n.type=null,n.gameIds=null,n.sortOrder=null,n.constructFiltersUrl=function(){var t=e.prototype.constructMainFiltersUrl.call(n);return n.status&&Object.values(a.GameStatusEnum).includes(n.status)&&(t+="&",t+="status="+n.status),n.type&&(t+="&",t+="type="+n.type),n.gameIds&&n.gameIds.length>0&&(t+="&",t+="game_ids="+n.gameIds.join(",")),n.sortOrder&&(t+="&",t+="sort_order="+n.sortOrder),t},n.status=t.status?t.status:null,n.type=t.type?t.type:null,n.gameIds=t.gameIds?t.gameIds:null,n.sortOrder=t.sortOrder?t.sortOrder:null,n}return i(t,e),t}(s.default);t.default=o},3751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(439),i=n(4916);t.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.scheduleOpenAt=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new i.default,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.images=new r.default,this.createdAt=null,this.updatedAt=null}},4780:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7482),i=n(8410),s=n(5967),a=n(6890),o=n(6160),u=n(3751),l=n(7243),c=n(8950),d=n(7640),h=n(1553),p=n(670),f=n(7974),m=n(4916),v=n(3483),y=n(1784),g=n(824),w=n(6899),_=n(6247);t.default=function(){var e=this;this.remapPaginatedGames=function(t){var n=new h.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapGamesListResponse(t)})),n},this.remapGamesListResponse=function(t){var n=new u.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.scheduleOpenAt=t.schedule_open_at,n.predictionsCutoff=t.predictions_cutoff,n.fixtures=t.fixtures.map((function(t){return e.remapFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapGameByIdResponse=function(t){var n=new _.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.scheduleOpenAt=t.schedule_open_at,n.predictionsCutoff=t.predictions_cutoff,n.fixtures=t.fixtures.map((function(t){return e.remapFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.adContent=t.ad_content,n.labels=t.labels,n.customFields=t.custom_fields,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapFixturesResponse=function(e){var t=new r.default;return t.matchId=e.match_id,t.matchType=e.match_type,t.market=e.market,t.matchStatus.type=e.match_status.type,t.matchStatus.subType=e.match_status.sub_type,t},this.remapPaginatedUserTopXEditions=function(t){var n=new h.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapUserTopXEditionsResponse(t)})),n},this.remapUserTopXEditionsResponse=function(t){var n=new c.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.predictionsCutoff=t.predictions_cutoff,n.scheduleOpenAt=t.schedule_open_at,n.fixtures=t.fixtures.map((function(t){return e.remapTopXFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapTopXFixturesResponse=function(e){var t=new s.default;return t.matchId=e.match_id,t.matchType=e.match_type,t.market=e.market,t.matchStatus.type=e.match_status.type,t.matchStatus.subType=e.match_status.sub_type,t},this.remapPaginatedUserMathQuizEditions=function(t){var n=new h.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapUserMatchQuizEditionsResponse(t)})),n},this.remapUserMatchQuizEditionsResponse=function(t){var n=new l.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.predictionsCutoff=t.predictions_cutoff,n.scheduleOpenAt=t.schedule_open_at,n.fixtures=t.fixtures.map((function(t){return e.remapMatchQuizFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},this.remapMatchQuizFixturesResponse=function(e){var t=new i.default;return t.matchId=e.match_id,t.matchType=e.match_type,t.market=e.market,t.matchStatus.type=e.match_status.type,t.matchStatus.subType=e.match_status.sub_type,t},this.remapPaginatedGameResults=function(t){var n=new h.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapGameResults(t)})),n},this.remapGameResults=function(t){var n=new a.default;return n.userId=t.user_id,n.points=t.points?t.points:0,n.results=t.results.map((function(t){return e.remapResults(t)})),n.tiebreaker=t.tiebreaker?e.remapTiebreaker(t.tiebreaker):null,n},this.remapGameMarketsResults=function(t){var n=new p.default;return n.gameId=t.game_id,n.results=e.remapMarketsResults(t.results),n.tieBreakers=t.tie_breakers?e.remapTieBreakers(t.tie_breakers):null,n},this.remapContestWinners=function(t){var n=new y.default;return n.contestId=t.contest_id,n.contestType=t.contest_type,n.description=t.description,n.userList=t.user_list.map((function(t){return e.remapUserListWinners(t)})),n},this.remapUserListWinners=function(e){var t=new g.default;return t.position=e.position,t.profileId=e.profile_id,t.note=e.note,t.tags=e.tags,t},this.remapTieBreakers=function(e){var t={goldenGoals:[]};return t.goldenGoals=e.golden_goals.map((function(e){return{minute:e.minute,matchId:e.match_id,matchModel:null,playerId:e.player_id,playerModel:null,goalType:e.goal_type}})),t},this.remapMarketsResults=function(t){var n=[];return t.forEach((function(t){var r={matchId:t.match_id,market:t.market,result:e.remapMarketResult(t.market,t.result),matchModel:null,playerModels:[],matchStatus:e.remapMarketsResultsMatchStatus(t.match_status)};n.push(e.deleteUnusefulField(r))})),n},this.remapMarketsResultsMatchStatus=function(e){var t=new w.default;return t.type=e.type,t.subType=e.sub_type,t},this.remapMarketResult=function(e,t){return f.endMarkMarkets.includes(e)?t[0]:f.playerMarkets.includes(e)?t:"true"===t[0]||"false"!==t[0]&&void 0},this.deleteUnusefulField=function(t){return f.playerMarkets.includes(t.market)&&!e.isPlayerMarketWithNoResult(t.market,t.result)||delete t.playerModels,t},this.isPlayerMarketWithNoResult=function(e,t){return f.playerMarkets.includes(e)&&0===t.length},this.remapResults=function(e){var t=new o.default;return t.matchId=e.match_id,t.outcome=e.outcome,t},this.remapTiebreaker=function(e){var t=new d.default;return t.goldenGoal=e.golden_goal,t},this.remapTimeTiebreaker=function(e){var t=new m.default;return t.timeTiebreaker=e,t},this.remapRelated=function(e){return e.map((function(e){var t=new v.default;return t.entityId=e.entity_id,t.entityType=e.entity_type,t}))}}},8950:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4916),i=n(7640);t.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.outcome=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new r.default,this.predictionId=null,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.points=null,this.createdAt=null,this.updatedAt=null,this.predictionsMadeAt=null,this.scheduleOpenAt=null,this.images=null,this.predictionTiebreaker=new i.default}},7640:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.goldenGoal=null}},4916:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.timeTiebreaker=!1}},1784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.contestId="",this.contestType="GAME",this.contestModel=null,this.description="",this.userList=[]}},824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.position="",this.profileId="",this.profileModel=null,this.note="",this.tags=[]}},3381:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){this.value=null,this.result=null}},1399:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1465);t.default=function(e){var t=this;this.gameInstanceId=null,this.fixtures=[],this.tiebreaker=null,this.gameInstanceId=e.gameInstanceId,e.fixtures.forEach((function(e){return t.fixtures.push(new r.default(e.matchId,e.market,e.prediction.value))})),this.tiebreaker=e.tiebreaker?e.tiebreaker:null}},9596:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8900),a=n(9502);t.default=function(e){var t=this;this.topXFacade=null,this.idMapping=null,this.getConfig=function(){return r(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getConfig()];case 1:return[2,e.sent()]}}))}))},this.getGames=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGames(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGameById=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGameById(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGamePredictions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGamePredictions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getGameResults=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGameResults(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getCurrentGameResults=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getCurrentGameResults(e)];case 1:return[2,t.sent()]}}))}))},this.play=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.play(e)];case 1:return[2,t.sent()]}}))}))},this.delete=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.delete(e)];case 1:return[2,t.sent()]}}))}))},this.getMyGameEditions=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getMyGameEditions(e,n)];case 1:return[2,t.sent()]}}))}))},this.getMyGamePrediction=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getMyGamePrediction(e)];case 1:return[2,t.sent()]}}))}))},this.getUserGameEditions=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getUserGameEditions(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getUserGamePrediction=function(e,n,s){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getUserGamePrediction(e,n,s)];case 1:return[2,t.sent()]}}))}))},this.getMarketsResultsForGame=function(e,n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getMarketsResultsForGame(e,n)];case 1:return[2,t.sent()]}}))}))},this.getGameWinners=function(e){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getGameWinners(e)];case 1:return[2,t.sent()]}}))}))},this.idMapping=new s.default(e),this.topXFacade=new a.default(e,this.idMapping)}},4806:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(4946),o=n(817),u=n(5409),l=n(5156);t.default=function(e,t,n){var c=this;this.idMapping=null,this.idSchema=null,this.native=a.IdSchemaEnum.NATIVE,this.footballFacade=null,this.remapSuccessRatesEntities=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.successRates,n={competition:this.getIdsKeys(t.byFootballCompetition),team:this.getIdsKeys(t.byFootballTeam)},Object.values(n.competition).length?(r=e.successRates.byFootballCompetition,i=e.successRates,[4,this.setModels(r,n.competition,o.EntityTypeEnum.COMPETITION)]):[3,2];case 1:i.byFootballCompetition=s.sent(),s.label=2;case 2:return Object.values(n.team).length?(a=e.successRates.byFootballTeam,u=e.successRates,[4,this.setModels(a,n.team,o.EntityTypeEnum.TEAM)]):[3,4];case 3:u.byFootballTeam=s.sent(),s.label=4;case 4:return[2,e]}}))}))},this.setModels=function(e,t,n){return i(c,void 0,void 0,(function(){var i,a;return s(this,(function(s){switch(s.label){case 0:switch(i=null,n){case"competition":return[3,1];case"team":return[3,3]}return[3,5];case 1:return[4,this.footballFacade.getCompetitionsMapWithNativeIds(t)];case 2:case 4:return i=s.sent(),[3,5];case 3:return[4,this.footballFacade.getTeamsMapWithNativeIds(t)];case 5:return Object.keys(e).forEach((function(t){var n,s=i.get(t);(a=r(r({},a),((n={})[s.id]=e[t],n)))[s.id].model=s})),[2,a]}}))}))},this.getIdsKeys=function(e){var t=JSON.parse(JSON.stringify(e));return Object.keys(t)},this.remapInterestsToIdSchema=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i,a,o,l,c,d,h,p,f;return s(this,(function(s){switch(s.label){case 0:return this.idSchema===this.native?[3,3]:e&&e.length>0?(t={},n={},r=e.filter((function(e){return e.source.toLocaleUpperCase()===u.SportSourceEnum.FOOTBALL})),i=e.filter((function(e){return e.source.toLocaleUpperCase()!==u.SportSourceEnum.FOOTBALL})),r.forEach((function(e){t.hasOwnProperty(e.type)||(t[e.type]=[],n[e.type]=[]),t[e.type].push(e.id),n[e.type].push(e)})),[4,this.remapIdsObj(t,this.native,this.idSchema)]):[3,2];case 1:for(a=s.sent(),o=[],l=function(e,t){t.forEach((function(t,n){t.id=a[e][n],o.push(t)}))},c=0,d=Object.entries(n);c<d.length;c++)h=d[c],p=h[0],f=h[1],l(p,f);return[2,o.concat(i)];case 2:case 3:return[2,e]}}))}))},this.remapInterestToNative=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i;return s(this,(function(s){switch(s.label){case 0:return this.idSchema===this.native||e.source.toLocaleUpperCase()!==u.SportSourceEnum.FOOTBALL?[3,2]:(t={},n=e.id,r=e.type,t[r]=[n],[4,this.remapIdsObj(t,this.idSchema,this.native)]);case 1:return i=s.sent(),e.id=i[r][0],[2,e];case 2:return[2,e]}}))}))},this.inquiryCustomInterests=function(e,t){var n=[];return e&&e.length>0&&(n=e.filter((function(e){return e.source.toLocaleUpperCase()===u.SportSourceEnum.CUSTOM})),t)?n.map((function(e){var t=new l.default;return t.id=e.id,t.type=e.type,t.source=e.source,t.favourite=e.favourite,t})):n},this.remapInterests=function(e){return i(c,void 0,void 0,(function(){var t,n,r;return s(this,(function(i){switch(i.label){case 0:return(t=this.inquiryCustomInterests(e,!1))&&t.length>0?(n=e.filter((function(e){return e.source.toLocaleUpperCase()!==u.SportSourceEnum.CUSTOM})),[4,this.remapInterestsToIdSchema(n)]):[3,2];case 1:return r=i.sent(),t.forEach((function(e){return r.push(e)})),[2,r];case 2:return[4,this.remapInterestsToIdSchema(e)];case 3:return[2,i.sent()]}}))}))},this.showFullInterests=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i,a,l,c,d;return s(this,(function(s){switch(s.label){case 0:return t=[],e&&e.length>0?(n=this.inquiryCustomInterests(e,!0),t.push(n),r=e.filter((function(e){return e.source.toLocaleUpperCase()!==u.SportSourceEnum.CUSTOM})),[4,this.getInterestsEntitiesMap(r)]):[3,2];case 1:return i=s.sent(),a=i.competitionsMap,l=i.teamsMap,c=i.playersMap,d=r.map((function(e){var t=null;return e.source.toLocaleUpperCase()!==u.SportSourceEnum.FOOTBALL?(e.model=t,e):e.type===o.EntityTypeEnum.COMPETITION?((t=a.get(e.id))&&(e.id=t.id),e.model=t,e):e.type===o.EntityTypeEnum.TEAM?((t=l.get(e.id))&&(e.id=t.id),e.model=t,e):e.type===o.EntityTypeEnum.PLAYER?(c?(e.model=c[e.id],e.id=c[e.id].id):e.model=t,e):void 0})),t.push(d),[2,t.flat()];case 2:return[2,t]}}))}))},this.getInterestsEntitiesMap=function(e){return i(c,void 0,void 0,(function(){var t,n,r,i,a,l;return s(this,(function(s){switch(s.label){case 0:return t=[],n=[],r=[],i=new Map,a=new Map,l=null,e.forEach((function(e){e.type===o.EntityTypeEnum.COMPETITION&&e.source.toLocaleUpperCase()===u.SportSourceEnum.FOOTBALL?t.push(e.id):e.type===o.EntityTypeEnum.TEAM&&e.source.toLocaleUpperCase()===u.SportSourceEnum.FOOTBALL?n.push(e.id):e.type===o.EntityTypeEnum.PLAYER&&e.source.toLocaleUpperCase()===u.SportSourceEnum.FOOTBALL&&r.push(e.id)})),t.length?[4,this.footballFacade.getCompetitionsMapWithNativeIds(t)]:[3,2];case 1:i=s.sent(),s.label=2;case 2:return n.length?[4,this.footballFacade.getTeamsMapWithNativeIds(n)]:[3,4];case 3:a=s.sent(),s.label=4;case 4:return r.length?[4,this.footballFacade.getPlayersMapWithNativeIds(r)]:[3,6];case 5:l=s.sent(),s.label=6;case 6:return[2,{competitionsMap:i,teamsMap:a,playersMap:l}]}}))}))},this.remapIdsObj=function(e,t,n){return i(c,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this.idMapping.idMappingFacade.getEntitiesByIds(e,t,n)];case 1:return[2,r.sent()]}}))}))},this.idMapping=n,this.idSchema=e.idSchema,this.footballFacade=t}},4912:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8900),a=n(4806);t.default=function(e,t){var n=this;this.idMapping=null,this.profileOperations=null,this.remapSuccessRatesEntities=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileOperations.remapSuccessRatesEntities(e)];case 1:return[2,t.sent()]}}))}))},this.remapInterestToNative=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileOperations.remapInterestToNative(e)];case 1:return[2,t.sent()]}}))}))},this.remapInterests=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileOperations.remapInterests(e)];case 1:return[2,t.sent()]}}))}))},this.showFullInterests=function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.profileOperations.showFullInterests(e)];case 1:return[2,t.sent()]}}))}))},this.idMapping=new s.default(e),this.profileOperations=new a.default(e,t,this.idMapping)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.FansUnitedSDK=void 0;var t=n(6409),i=n(6595),s=n(8808),a=n(4946),o=n(1259),u=n(2962),l=n(9627),c=n(2671),d=n(9377),h=n(9596),p=n(267),f=n(7302),m=n(2141),v=n(7070),y=n(9580);e.FansUnitedSDK=function(e){var n=(new i.default).validate(e);if(n.idSchema.validation!==l.ValidationResponseEnum.MISSING_VALUE&&n.idSchema.validation!==l.ValidationResponseEnum.INVALID_VALUE||(console.warn(n.idSchema.message.text),e.idSchema=a.IdSchemaEnum.NATIVE),n.environment.validation!==l.ValidationResponseEnum.MISSING_VALUE&&n.environment.validation!==l.ValidationResponseEnum.INVALID_VALUE||(console.warn(n.environment.message.text),e.environment=c.EnvironmentEnum.PROD),n.lang.validation!==l.ValidationResponseEnum.MISSING_VALUE&&n.lang.validation!==l.ValidationResponseEnum.INVALID_VALUE||(console.warn(n.lang.message.text),e.lang=d.LangEnum.EN),n.errorHandlingMode.validation!==l.ValidationResponseEnum.MISSING_VALUE&&n.errorHandlingMode.validation!==l.ValidationResponseEnum.INVALID_VALUE||(console.warn(n.errorHandlingMode.message.text),e.errorHandlingMode=y.ErrorHandlingModeEnum.DEFAULT),n.authProvider.validation===l.ValidationResponseEnum.INVALID_VALUE&&console.warn(n.authProvider.message.text),n.isValid)return{profile:new t.default(e),football:new s.default(e),predictor:new o.default(e),loyalty:new u.default(e),topX:new h.default(e),matchQuiz:new p.default(e),activity:new f.default(e)};g(n)};var g=function(e){var t="authProvider",n="isValid";Object.keys(e).forEach((function(r){var i=e[r];if(r!==n&&r!==t){if(i.message.type===m.LogEnum.ERROR)throw new Error(i.message.text)}else r!==n&&r===t&&Object.keys(new v.default).forEach((function(e){if(i[e].message.type===m.LogEnum.ERROR)throw new Error(i[e].message.text)}))}))}})(),r})()}));
2
2
  //# sourceMappingURL=index.js.map