var elc_service_session_mgmt;(()=>{"use strict";var e,r,t={"./node_modules/@estee/elc-service/src/Service/ServiceManager/ServiceManager.ts":(e,r,t)=>{t.d(r,{W:()=>l});var s=t("@estee/elc-service-bus"),i=t("@estee/elc-logging"),o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=(e,r,t)=>new Promise(((s,i)=>{var o=e=>{try{a(t.next(e))}catch(r){i(r)}},n=e=>{try{a(t.throw(e))}catch(r){i(r)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(o,n);a((t=t.apply(e,r)).next())}));class c{constructor(){this.ecommStarted=!1,this.getContainer=()=>a(this,null,(function*(){return this.diContainer||(this.diContainer=(yield this.containerImport()).diContainer),this.diContainer})),this.handleServiceBusError=()=>{throw new Error(`\n ServiceBus hasn't been provided to ServiceManager at setServiceStartParams method.\n ServiceBus: ${this.serviceBusBaseClass?"ServiceBus found":this.serviceBusBaseClass}.\n ServiceBusKey: (${this.serviceBusControllerKey})\n `)},this.getServiceBusController=()=>a(this,null,(function*(){let e;try{yield this.startService();if(e=(yield this.getContainer()).get(this.serviceBusControllerKey),!e)throw new Error("ServiceBusController not found inside diContainer")}catch(r){this.logger.error({triggerType:i.TriggerType.render,message:r.message,payload:{error:r}})}return e})),this.setServiceStartParams=({serviceName:e,diContainerImport:r,serviceKey:t,serviceBusControllerKey:s,serviceBus:o})=>{var n;this.serviceName=e,this.containerImport=r,this.serviceKey=t,this.serviceBusControllerKey=s,this.logger=new i.ELCLogger({serviceName:e}),this.serviceBusBaseClass=null==o?void 0:o.serviceBusBaseClass,null==(n=null==o?void 0:o.createServiceBusMethod)||n.call(o)},this.getServiceBusControllerMethod=e=>(...r)=>a(this,null,(function*(){return(yield this.getServiceBusController())[e].call(null,...r)})),this.setDecoratorOnFunction=e=>([r,t])=>{this.serviceBusBaseClass&&this.serviceBusControllerKey?(e(r)(this.serviceBusBaseClass.__proto__,t),this.serviceBusBaseClass[t]=this.getServiceBusControllerMethod(t)):this.handleServiceBusError()},this.setDecoratorOnProperty=e=>([r,t])=>{this.serviceBusBaseClass&&this.serviceBusControllerKey?(e(t)(this.serviceBusBaseClass.__proto__,r),Object.defineProperty(this.serviceBusBaseClass.__proto__,r,{configurable:!0,enumerable:!0,set(e){return this.getServiceBusController().then((t=>{t[r]=e}))}})):this.handleServiceBusError()},this.setEcommHasStarted=()=>{this.ecommStarted=!0},this.onStart=(e,r)=>()=>a(this,null,(function*(){let t;try{if(this.serviceHasStarted)return void e();if(!r&&!this.ecommStarted)return;yield this.getContainer(),this.service=this.diContainer.get(this.serviceKey);let t=r;if(!t){const e=yield(0,s.query)(s.serviceQueries.GET_CONFIG,["ecommConfig"]);if(!e||!e.ecommConfig)throw new Error("EcommConfig not found");t=e.ecommConfig}yield this.service.start(t),(0,s.emit)(s.events.SERVICE_STARTED,{serviceName:this.serviceName})}catch(o){t=o,this.logger.error({triggerType:i.TriggerType.render,message:o.message,payload:{error:o}})}finally{e(t)}})),this.startService=e=>(this.startPromise||(this.startPromise=new Promise(((r,t)=>{let s=null;s=setInterval(this.onStart((e=>{s&&clearInterval(s),e?t(e):r()}),e),200)}))),this.startPromise),this.getController=e=>{if(!this.diContainer){const e="Can't request controller without starting the service first";throw this.logger.error({triggerType:i.TriggerType.render,message:e,payload:{serviceName:this.serviceName,context:{method:"getController method on ServiceManager"}}}),new Error(e)}return e?this.diContainer.get(e):void 0}}get serviceHasStarted(){return Boolean(this.service&&this.service.isStarted)}}((e,r,t,s)=>{for(var i,a=s>1?void 0:s?n(r,t):r,c=e.length-1;c>=0;c--)(i=e[c])&&(a=(s?i(r,t,a):i(a))||a);s&&a&&o(r,t,a)})([(0,s.on)(s.events.ECOMM_STARTED,{replay:!0})],c.prototype,"setEcommHasStarted",2);const l=new c},"./node_modules/@estee/elc-universal-utils/src/index.ts":(e,r,t)=>{t.d(r,{BN:()=>l,$W:()=>c,Jz:()=>n,q8:()=>a});var s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;"object"==typeof self&&(self.self,self);const n="undefined"==typeof window?t.g:window,a=e=>{const r=e,{name:t}=r,a=((e,r)=>{var t={};for(var n in e)i.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&s)for(var n of s(e))r.indexOf(n)<0&&o.call(e,n)&&(t[n]=e[n]);return t})(r,["name"]);n.serviceInfo=n.serviceInfo||{},n.serviceInfo[t]=a};function c(e){return e.replace(/-/g,"_")}var l;(e=>{function r(e){document.cookie=`${e}=; Max-Age=-99999999;`}function t(e,r,t){let s="";if(t){s=`; expires=${("number"==typeof t?new Date(Date.now()+24*t*60*60*1e3):t).toUTCString()}`}document.cookie=`${e}=${r||""}${s};path=/`}function s(e){const r=`${e}=`,t=document.cookie.split(";");for(let s=0;s{const s=i(e);t!==s&&(t=s,r(s))}),2e3)}})(l||(l={}))},"./src/service-setup/SessionManagementService.ts":(e,r,t)=>{t.d(r,{e:()=>u,Z:()=>v});var s=t("./node_modules/@estee/elc-universal-utils/src/index.ts"),i=t("@estee/elc-logging"),o=(e,r,t)=>new Promise(((s,i)=>{var o=e=>{try{a(t.next(e))}catch(r){i(r)}},n=e=>{try{a(t.throw(e))}catch(r){i(r)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(o,n);a((t=t.apply(e,r)).next())}));s.Jz.ServiceRegistry=s.Jz.ServiceRegistry||{};const n=()=>o(void 0,null,(function*(){}));class a{constructor(e,r,t=null){this.name=e,this.version=r,this.serviceInitializer=t,this.isStarted=!1}static setViews(e,r,t,i){s.Jz.ServiceRegistry[e]={name:r,version:t,views:i,isStarted:!0}}initializeService(e){return o(this,null,(function*(){try{const r=this.serviceInitializer||n;yield r(e),this.isStarted=!0}catch(r){this.logger.error({message:`Could not start service ${this.name}`,triggerType:i.TriggerType.render,payload:{error:r,context:{serviceRegistry:s.Jz.ServiceRegistry}}})}finally{this.isStarted=!0}}))}start(e){return this.startPromise||this.isStarted||(this.logger=this.logger||new i.ELCLogger({serviceName:this.name,environment:e.env||s.Jz.env,buid:e.businessUnitId||s.Jz.buid,serviceVersion:this.version}),this.startPromise=this.initializeService(e)),this.startPromise}}const{name:c,version:l}={branchName:"release/3.0",commitHash:"9fc75509596a5c2d8aa2ea26b43da01f8f4038c9",version:"3.0.0",name:"elc-service-session-mgmt"};class u extends a{constructor(e){super(c,l,e)}}const v={signInApiSdk:"SIGN_IN_API_SDK",configStore:"CONFIG_STORE",httpTransport:"HTTP_TRANSPORT",serviceBusController:"SERVICE_BUS_CONTROLLER",sessionManagementService:"SESSION_MANAGEMENT_SERVICE",authSession:"AUTH_SESSION",careAuthSession:"CARE_AUTH_SESSION",authSessionRepository:"AUTH_SESSION_REPOSITORY",guestRepository:"GUEST_REPOSITORY",guestUser:"GUEST_USER"}},"@estee/elc-service-bus":e=>{e.exports=ElcServiceBus},"@estee/elc-logging":e=>{e.exports=ElcRuntime.ELCLogger},"hypo-container":e=>{e.exports=ElcRuntime.HypoContainer},mobx:e=>{e.exports=ElcRuntime.mobx}},s={};function i(e){var r=s[e];if(void 0!==r)return r.exports;var o=s[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=t,i.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return i.d(r,{a:r}),r},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((r,t)=>(i.f[t](e,r),r)),[])),i.u=e=>e+".79c9b39adac2728ad028.bundle.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="elc-service-session-mgmt:",i.l=(t,s,o,n)=>{if(e[t])e[t].push(s);else{var a,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u{a.onerror=a.onload=null,clearTimeout(h);var i=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((e=>e(s))),r)return r(s)},h=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),c&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var r=i.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={elc_service_session_mgmt:0};i.f.j=(r,t)=>{var s=i.o(e,r)?e[r]:void 0;if(0!==s)if(s)t.push(s[2]);else{var o=new Promise(((t,i)=>s=e[r]=[t,i]));t.push(s[2]=o);var n=i.p+i.u(r),a=new Error;i.l(n,(t=>{if(i.o(e,r)&&(0!==(s=e[r])&&(e[r]=void 0),s)){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+r+" failed.\n("+o+": "+n+")",a.name="ChunkLoadError",a.type=o,a.request=n,s[1](a)}}),"chunk-"+r,r)}};var r=(r,t)=>{var s,o,[n,a,c]=t,l=0;if(n.some((r=>0!==e[r]))){for(s in a)i.o(a,s)&&(i.m[s]=a[s]);if(c)c(i)}for(r&&r(t);l{var e=i("./node_modules/@estee/elc-universal-utils/src/index.ts"),r=i("./node_modules/@estee/elc-service/src/Service/ServiceManager/ServiceManager.ts"),t=i("./src/service-setup/SessionManagementService.ts");class s{constructor(){this.registerWatchers=void 0}}var o=i("@estee/elc-service-bus"),n=Object.defineProperty,a=Object.getOwnPropertyDescriptor;const c=[[o.serviceQueries.IS_AUTHENTICATED,"isAuthenticated"],[o.serviceQueries.GUEST_EMAIL,"guestEmail"],[o.serviceQueries.GET_LEGACY_GUEST_AUTH_TOKEN,"getLegacyGuestAuthToken"],[o.serviceQueries.GET_GUEST_AUTH_TOKEN,"getGuestAuthToken"],[o.serviceQueries.GET_ACCESS_TOKEN,"getAccessToken"],[o.serviceQueries.USER_ID,"getUserId"]],l=[[o.serviceCommands.AUTH_UPDATE_DATA,"updateAccessToken"]],u=[[o.events.SIGNED_OUT,"signedOut"]];class v extends s{constructor(){super(...arguments),this.onEcommStarted=()=>{const e=setInterval((()=>{d&&(clearInterval(e),c.forEach(r.W.setDecoratorOnFunction(o.queryProvider)),u.forEach(r.W.setDecoratorOnFunction(o.on)),l.forEach(r.W.setDecoratorOnFunction(o.commandProvider)))}),50)}}}((e,r,t,s)=>{for(var i,o=s>1?void 0:s?a(r,t):r,c=e.length-1;c>=0;c--)(i=e[c])&&(o=(s?i(r,t,o):i(o))||o);s&&o&&n(r,t,o)})([(0,o.on)(o.events.ECOMM_STARTED,{replay:!0})],v.prototype,"onEcommStarted",2);const d=new v;(0,e.q8)({branchName:"release/3.0",commitHash:"9fc75509596a5c2d8aa2ea26b43da01f8f4038c9",version:"3.0.0",name:"elc-service-session-mgmt"});const{name:h,version:m}={branchName:"release/3.0",commitHash:"9fc75509596a5c2d8aa2ea26b43da01f8f4038c9",version:"3.0.0",name:"elc-service-session-mgmt"};t.e.setViews(h,(0,e.$W)(h),m,[]),r.W.setServiceStartParams({serviceName:h,diContainerImport:()=>i.e("diContainer").then(i.bind(i,"./src/service-setup/diContainer.ts")),serviceKey:t.Z.sessionManagementService,serviceBusControllerKey:t.Z.serviceBusController,serviceBus:{serviceBusBaseClass:d}})})(),o=l,n={"./diContainer":()=>i.e("diContainer").then((()=>()=>i("./src/service-setup/diContainer.ts")))},a=(e,r)=>(i.R=r,r=i.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),i.R=void 0,r),c=(e,r)=>{if(i.S){var t="default",s=i.S[t];if(s&&s!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return i.S[t]=e,i.I(t,r)}},i.d(o,{get:()=>a,init:()=>c}),elc_service_session_mgmt=l})(); //# sourceMappingURL=bundle.js.map