>>0))>>>0)>>>0,e[0]=b,e[1]=w,n(m[0],m[1],m[2],m[3],m);var k=S>>>18,O=(g>>>18|S<<14)>>>0,x=((O=(O^g)>>>0)>>>27|(k=(k^S)>>>0)<<5)>>>0,E=S>>>27;return(x>>>E|x<<((-E>>>0&31)>>>0))>>>0},e.prototype.integer=function(e){if(!e)return this.next32();var t=t>>>0;if(!(t&t-1))return this.next32()&t-1;var r=0,n=(-t>>>0)%t>>>0;for(r=this.next32();r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CookieService=void 0;t.CookieService=class{constructor(e,t,r,n){this.prefix=e,this.defaultDomain=t,this.defaultPath=r,this.defaultExpires=n,this.cookies=document.cookie.split(";").map((e=>e.trim()))}get(e){const t=this.cookies.find((t=>t.startsWith(`${e}=`)));return t?decodeURI(t.split("=")[1]):null}has(e){return null!==this.get(e)}set(e,t,r=null,n=null,o=null,i=!1){r=null!=r?r:this.defaultExpires,n=null!=n?n:this.defaultPath,o=null!=o?o:this.defaultDomain,document.cookie=`${e}=${encodeURI(t)}; expires=${r}; path=${n}; domain=${o}; secure=${i}`}}},340:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExperimentService=void 0;const rule_evaluator_1=__webpack_require__(620),defaultCallback={callback:()=>new Promise((e=>e(!0))),hidden:!1};class ExperimentService{constructor(e,t,r,n){this.data=e,this.cookie=t,this.randomizer=r,this.logging=n,this.isAllowed=()=>{const e=this.cookie.get(this.data.name);if(e&&"na"!==e)return!0;if("na"===e)return!1;return!(this.randomizer.integer%100>parseInt(this.data.trafficAllocation))||(this.cookie.set(this.data.name,"na"),this.logging.logDatalayer(this.data.name,"na"),!1)},this.canRun=()=>new rule_evaluator_1.RuleEvaluator(this.data.rules,this.cookie).evaluate()}run(){if(this.isAllowed()&&this.canRun()){const e=this.split();try{return{callback:()=>new Promise((t=>{e.call(this),t(!0)})),hidden:!1}}catch(e){console.error(`Error in experiment ${this.data.name}`,e)}}return defaultCallback}split(){var _a,_b,_c;const cookieName=this.data.name;let callback="null";if(this.cookie.has(cookieName))callback=null!==(_b=null===(_a=this.data.variations.find((e=>e.letter===this.cookie.get(cookieName))))||void 0===_a?void 0:_a.callback)&&void 0!==_b?_b:callback;else{const e=this.data.variations[this.randomizer.integer%this.data.variations.length];callback=null!==(_c=null==e?void 0:e.callback)&&void 0!==_c?_c:callback,this.cookie.set(this.data.name,e.letter),this.logging.logDatalayer(this.data.name,e.letter),this.logging.log({[this.data.name]:e.letter})}return()=>{try{return eval(callback)}catch(e){}}}}exports.ExperimentService=ExperimentService},808:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingService=void 0;t.LoggingService=class{constructor(e,t,r=null){this.url=e,this.datalayerService=t,this.datalayerSlot=r}logDatalayer(e,t){this.datalayerService.push({event:"AB_testing_platform_allocation",ec:"AB_TEST",ea:e,el:t,CD_SLOT_VALUE:`${e}: ${t}`,CD_SLOT_INDEX:this.datalayerSlot||0})}log(e){try{const t=new URLSearchParams(this.abLoggerFormat(e)),r=`${this.url}?${t}`;fetch(r,{keepalive:!0})}catch{}}abLoggerFormat(e){let t={};for(let r in e)t[`tests[${r}]`]=e[r];return t}}},427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RandomizerService=void 0;const n=r(635).__importDefault(r(585));t.RandomizerService=class{constructor(){this.generator=new n.default(null)}get integer(){return this.generator.integer()}}},620:(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RuleEvaluator=void 0;class RuleEvaluator{constructor(e,t){this.rules=e,this.cookie=t}evaluate(){return this.rules.reduce(((e,t)=>e&&this.evalSet(t.ruleSet,t.type)),!0)}evalSet(e,t){const r=this.evalNodes(e.nodes,e.operator,t),n=e.sets.reduce(((e,r)=>"and"===r.operator?e&&this.evalNodes(r.nodes,r.operator,t)&&this.evalSet(r,t):e||this.evalNodes(r.nodes,r.operator,t)||this.evalSet(r,t)),"and"===e.operator);return"and"===e.operator?r&&n:r||n}evalNodes(e,t,r){return!!e.reduce(((e,n)=>"and"===t?e&&this.evalNode(n,r):e||this.evalNode(n,r)),"and"===t)}evalNode(e,t){let r;try{r=this.getModifier(e,t)}catch{return!1}switch(e.test){case"is":case"eq":return r===e.value;case"contains":return r.includes(e.value);case"starts_with":return r.startsWith(e.value);case"ends_with":return r.endsWith(e.value);case"matches":return new RegExp(e.value).test(r);default:return!1}}getModifier(e,t){switch(t){case"device":return String(this.cookie.get("site_version_11"));case"country":return String(window.location.host.split(".").pop());default:return this.getNodeModifier(e)}}getNodeModifier(node){switch(node.target){case"url":const urlModifiers={location:window.location.href,path:window.location.pathname,query:window.location.search,hash:window.location.hash},modifier=urlModifiers[node.modifier];if(void 0===modifier)throw new Error("Invalid URL target");return null!=modifier?modifier:"";case"header":throw new Error("Header target not implemented yet");case"custom":try{return String(eval(node.modifier))}catch{throw new Error("Invalid custom rule modifier")}default:throw new Error("Invalid target")}}}exports.RuleEvaluator=RuleEvaluator},617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RunnerService=void 0;const n=r(340);t.RunnerService=class{constructor(e,t,r){this.randomizerService=e,this.cookieService=t,this.loggingService=r,this.curtain=null}runAll(e){const t=e.map((e=>new n.ExperimentService(e,this.cookieService,this.randomizerService,this.loggingService).run()));document.addEventListener("DOMContentLoaded",(()=>{t.forEach((async e=>{e.hidden&&this.addCurtain(),await e.callback(),e.hidden&&this.removeCurtain()}))}))}addCurtain(){if(this.curtain||!document.body)return;const e=document.createElement("div");e.style.cssText="position:absolute;inset:0;background:#fff;z-index:999999;",document.body.appendChild(e),this.curtain=e}removeCurtain(){const e=this.curtain;(null==e?void 0:e.parentNode)&&(e.parentNode.removeChild(e),this.curtain=null)}}},635:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__addDisposableResource:()=>N,__assign:()=>i,__asyncDelegator:()=>x,__asyncGenerator:()=>O,__asyncValues:()=>E,__await:()=>k,__awaiter:()=>p,__classPrivateFieldGet:()=>I,__classPrivateFieldIn:()=>A,__classPrivateFieldSet:()=>R,__createBinding:()=>v,__decorate:()=>s,__disposeResources:()=>M,__esDecorate:()=>l,__exportStar:()=>y,__extends:()=>o,__generator:()=>h,__importDefault:()=>T,__importStar:()=>D,__makeTemplateObject:()=>j,__metadata:()=>_,__param:()=>c,__propKey:()=>f,__read:()=>w,__rest:()=>a,__runInitializers:()=>u,__setFunctionName:()=>d,__spread:()=>m,__spreadArray:()=>S,__spreadArrays:()=>g,__values:()=>b,default:()=>L});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(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)}var i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t,r,n,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=n.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?n.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),d=!1,_=r.length-1;_>=0;_--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var v=(0,r[_])("accessor"===c?{get:f.get,set:f.set}:f[l],p);if("accessor"===c){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=a(v.get))&&(f.get=s),(s=a(v.set))&&(f.set=s),(s=a(v.init))&&o.unshift(s)}else(s=a(v))&&("field"===c?o.unshift(s):f[l]=s)}u&&Object.defineProperty(u,n.name,f),d=!0}function u(e,t,r){for(var n=arguments.length>2,o=0;o0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function m(){for(var e=[],t=0;t1||s(e,t)}))},t&&(n[e]=t(n[e])))}function s(e,t){try{(r=o[e](t)).value instanceof k?Promise.resolve(r.value.v).then(c,l):u(i[0][2],r)}catch(e){u(i[0][3],e)}var r}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function x(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:k(e[n](t)),done:!1}:o?o(t):t}:o}}function E(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=b(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function j(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function D(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&v(t,e,r);return P(t,e),t}function T(e){return e&&e.__esModule?e:{default:e}}function I(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function R(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function A(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function N(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var C="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function M(e){function t(t){e.error=e.hasError?new C(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function o(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,(function(e){return t(e),o()}))}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}const L={__extends:o,__assign:i,__rest:a,__decorate:s,__param:c,__metadata:_,__awaiter:p,__generator:h,__createBinding:v,__exportStar:y,__values:b,__read:w,__spread:m,__spreadArrays:g,__spreadArray:S,__await:k,__asyncGenerator:O,__asyncDelegator:x,__asyncValues:E,__makeTemplateObject:j,__importStar:D,__importDefault:T,__classPrivateFieldGet:I,__classPrivateFieldSet:R,__classPrivateFieldIn:A,__addDisposableResource:N,__disposeResources:M}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";var e;const t=__webpack_require__(808),r=__webpack_require__(717),n=__webpack_require__(427),o=__webpack_require__(617),i=new Date;i.setDate(i.getDate()+180);const a=(null!==(e=window.location.host.match(/(\.emag\.(ro|bg|hu)$)|(\.eos-.*\.emag\.network$)/))&&void 0!==e?e:[window.location.host])[0],s=new t.LoggingService("/ab-logger",window.dataLayer,0),c=new r.CookieService("eab",a,"/",i.toUTCString()),l=new n.RandomizerService;new o.RunnerService(l,c,s).runAll(window.experiments.filter((e=>new Date(e.startsAt)<=new Date&&(null===e.endsAt||new Date(e.endsAt)>=new Date))))})()})();