!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("HypoContainer"),require("HttpTransport"),require("mobx"),require("ElcServiceBus"),require("react"),require("ELCLogger"),require("mobx-react"),require("styled-components")):"function"==typeof define&&define.amd?define(["HypoContainer","HttpTransport","mobx","ElcServiceBus","react","ELCLogger","mobx-react","styled-components"],t):"object"==typeof exports?exports["pg-service-user-profile"]=t(require("HypoContainer"),require("HttpTransport"),require("mobx"),require("ElcServiceBus"),require("react"),require("ELCLogger"),require("mobx-react"),require("styled-components")):e["pg-service-user-profile"]=t(e.ElcRuntime.HypoContainer,e.ElcRuntime.HttpTransport,e.ElcRuntime.mobx,e.ElcServiceBus,e.ElcRuntime.React,e.ElcRuntime.ELCLogger,e.ElcRuntime.mobxReact,e.ElcRuntime.styled5)}(self,((e,t,r,o,n,i,s,a)=>(()=>{"use strict";var c,l,u={"./node_modules/@estee/elc-service/node_modules/@estee/elc-universal-utils/src/index.ts":(e,t,r)=>{r.d(t,{Jz:()=>o});Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;"object"==typeof self&&(self.self,self);const o="undefined"==typeof window?r.g:window;var n;(e=>{function t(e){document.cookie=`${e}=; Max-Age=-99999999;`}function r(e,t,r){let o="";if(r){o=`; expires=${("number"==typeof r?new Date(Date.now()+24*r*60*60*1e3):r).toUTCString()}`}document.cookie=`${e}=${t||""}${o};path=/`}function o(e){const t=`${e}=`,r=document.cookie.split(";");for(let e=0;e{const o=n(e);r!==o&&(r=o,t(o))}),2e3)}})(n||(n={}))},"./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js":(e,t,r)=>{var o=r("./node_modules/react-is/index.js"),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(e){return o.isMemo(e)?s:a[e.$$typeof]||n}a[o.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[o.Memo]=s;var l=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,r,o){if("string"!=typeof r){if(h){var n=d(r);n&&n!==h&&e(t,n,o)}var s=u(r);p&&(s=s.concat(p(r)));for(var a=c(t),y=c(r),g=0;g{var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,m=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function P(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case u:case p:case i:case a:case s:case d:return e;default:switch(e=e&&e.$$typeof){case l:case f:case g:case y:case c:return e;default:return t}}case n:return t}}}function O(e){return P(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=c,t.Element=o,t.ForwardRef=f,t.Fragment=i,t.Lazy=g,t.Memo=y,t.Portal=n,t.Profiler=a,t.StrictMode=s,t.Suspense=d,t.isAsyncMode=function(e){return O(e)||P(e)===u},t.isConcurrentMode=O,t.isContextConsumer=function(e){return P(e)===l},t.isContextProvider=function(e){return P(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return P(e)===f},t.isFragment=function(e){return P(e)===i},t.isLazy=function(e){return P(e)===g},t.isMemo=function(e){return P(e)===y},t.isPortal=function(e){return P(e)===n},t.isProfiler=function(e){return P(e)===a},t.isStrictMode=function(e){return P(e)===s},t.isSuspense=function(e){return P(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===a||e===s||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===y||e.$$typeof===c||e.$$typeof===l||e.$$typeof===f||e.$$typeof===m||e.$$typeof===b||e.$$typeof===w||e.$$typeof===v)},t.typeOf=P},"./node_modules/react-is/index.js":(e,t,r)=>{e.exports=r("./node_modules/react-is/cjs/react-is.production.min.js")},"@estee/elc-service-bus":e=>{e.exports=o},"@estee/elc-logging":e=>{e.exports=i},"@estee/elc-http-transport":e=>{e.exports=t},"hypo-container":t=>{t.exports=e},react:e=>{e.exports=n},mobx:e=>{e.exports=r},"mobx-react":e=>{e.exports=s},"styled-components":e=>{e.exports=a}},p={};function f(e){var t=p[e];if(void 0!==t)return t.exports;var r=p[e]={exports:{}};return u[e](r,r.exports,f),r.exports}f.m=u,f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce(((t,r)=>(f.f[r](e,t),t)),[])),f.u=e=>e+"."+{"pg-service-user-profile-common":"76935a1e0c63abc5dc80",UserProfileWelcome:"84eb74d17f3a1aca46dd",UserProfileCard:"eaed27554f235be4f4a6"}[e]+".bundle.js",f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c={},l="pg-service-user-profile:",f.l=(e,t,r,o)=>{if(c[e])c[e].push(t);else{var n,i;if(void 0!==r)for(var s=document.getElementsByTagName("script"),a=0;a{n.onerror=n.onload=null,clearTimeout(d);var o=c[e];if(delete c[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach((e=>e(r))),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=p.bind(null,n.onerror),n.onload=p.bind(null,n.onload),i&&document.head.appendChild(n)}},f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;f.g.importScripts&&(e=f.g.location+"");var t=f.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f.p=e})(),(()=>{var e={bundle:0};f.f.j=(t,r)=>{var o=f.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var i=f.p+f.u(t),s=new Error;f.l(i,(r=>{if(f.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+n+": "+i+")",s.name="ChunkLoadError",s.type=n,s.request=i,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,[i,s,a]=r,c=0;if(i.some((t=>0!==e[t]))){for(o in s)f.o(s,o)&&(f.m[o]=s[o]);if(a)a(f)}for(t&&t(r);c{f.r(d);var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;"object"==typeof self&&(self.self,self);const o="undefined"==typeof window?f.g:window;var n;(e=>{function t(e){document.cookie=`${e}=; Max-Age=-99999999;`}function r(e,t,r){let o="";if(r){o=`; expires=${("number"==typeof r?new Date(Date.now()+24*r*60*60*1e3):r).toUTCString()}`}document.cookie=`${e}=${t||""}${o};path=/`}function o(e){const t=`${e}=`,r=document.cookie.split(";");for(let e=0;e{const o=n(e);r!==o&&(r=o,t(o))}),2e3)}})(n||(n={}));var i=f("hypo-container"),s=f("@estee/elc-http-transport");class a{constructor(e){this.getAuthToken=()=>this.apiAuthToken,this.getGlobalHeaders=()=>{const e=`Basic ${btoa(this.getAuthToken())}`;return{Authorization:e,AuthorizationCredentials:e}},this.getBaseUrl=()=>`${o.location.protocol}//${o.location.hostname}`,this.getDefaultParams=()=>({brand:this.brand,region:this.region}),this.getUserProfile=()=>{return e=this,t=null,r=function*(){const e=this.getDefaultParams(),t=`${this.getBaseUrl()}/rest/api/v1/ra/user`;try{return(yield this.httpTransport.get({url:t,params:e,options:{credentials:"include"}})).data}catch(e){return e}},new Promise(((o,n)=>{var i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}));var e,t,r},this.httpTransport=e}setConfigs({apiAuthToken:e,brandId:t,regionId:r}){this.brand=t,this.region=r,this.apiAuthToken=e,this.httpTransport.addGlobalHeaders(this.getGlobalHeaders())}}var c=f("mobx"),l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,g=(e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))h.call(t,r)&&g(e,r,t[r]);if(p)for(var r of p(t))y.call(t,r)&&g(e,r,t[r]);return e},m=(e,t,r,o)=>{for(var n,i=o>1?void 0:o?u(t,r):t,s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&l(t,r,i),i};class b{constructor(e){this.updateConfig({appConfig:e,buidConfig:{}})}updateConfig(e){this.config=v(v(v({},this.config),null==e?void 0:e.appConfig),null==e?void 0:e.buidConfig)}get brandId(){var e,t;return null==(t=null==(e=this.config)?void 0:e.brand)?void 0:t.id}get regionId(){var e,t;return null==(t=null==(e=this.config)?void 0:e.region)?void 0:t.id}get languageId(){var e,t;return null==(t=null==(e=this.config)?void 0:e.language)?void 0:t.id}get apiAuthToken(){var e,t;return null==(t=null==(e=this.config)?void 0:e.pgApiTokens)?void 0:t.userProfile}}m([c.observable],b.prototype,"config",2),m([c.action],b.prototype,"updateConfig",1),m([c.computed],b.prototype,"brandId",1),m([c.computed],b.prototype,"regionId",1),m([c.computed],b.prototype,"languageId",1),m([c.computed],b.prototype,"apiAuthToken",1);var w=Object.defineProperty,P=Object.defineProperties,O=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,x=(e,t,r)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const E=e=>1===e||"1"===e||0!==e&&"0"!==e&&e,j=(e,t="")=>{const r=e.replace(t,"");return r.replace(/(_\w)/g,(e=>e.toUpperCase().substr(1)))},I=(e,t="")=>Object.entries(e).reduce(((e,[r,o])=>{return n=((e,t)=>{for(var r in t||(t={}))C.call(t,r)&&x(e,r,t[r]);if(S)for(var r of S(t))R.call(t,r)&&x(e,r,t[r]);return e})({},e),i={[j(r,t)]:E(o)},P(n,O(i));var n,i}),{});var _=Object.defineProperty,D=Object.getOwnPropertyDescriptor,k=(e,t,r,o)=>{for(var n,i=o>1?void 0:o?D(t,r):t,s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&_(t,r,i),i};const A=class{constructor(){this.emailAddress="",this.firstName="",this.fullName="",this.lastName="",this.userId=""}static fromJSON(e){const t=new A,r=I(e);return(0,c.set)(t,r),t}get name(){return this.fullName?this.fullName:[this.firstName,this.lastName].join(" ")}get basicUserDetails(){return{emailAddress:this.emailAddress,firstName:this.firstName,lastName:this.lastName,hasLoyalty:this.loyaltyActiveFlag}}};let T=A;k([c.observable],T.prototype,"acceptedPrivacyPolicy",2),k([c.observable],T.prototype,"emailAddress",2),k([c.observable],T.prototype,"firstName",2),k([c.observable],T.prototype,"fullName",2),k([c.observable],T.prototype,"hasOnthewayOrders",2),k([c.observable],T.prototype,"hasOrders",2),k([c.observable],T.prototype,"hasReplenishmentOrders",2),k([c.observable],T.prototype,"lastName",2),k([c.observable],T.prototype,"loyaltyActiveFlag",2),k([c.observable],T.prototype,"loyaltyInfo",2),k([c.observable],T.prototype,"recognized",2),k([c.observable],T.prototype,"registered",2),k([c.observable],T.prototype,"signedIn",2),k([c.observable],T.prototype,"userId",2),k([c.computed],T.prototype,"name",1),k([c.computed],T.prototype,"basicUserDetails",1);const N=T;var U=Object.defineProperty,$=Object.getOwnPropertyDescriptor;class L{constructor(){this.isLoading=!0,this.setSSRState=e=>{this.dataState=e},this.setId=e=>{this.id=e&&btoa(unescape(encodeURIComponent(e)))}}get data(){return{}}}((e,t,r,o)=>{for(var n,i=o>1?void 0:o?$(t,r):t,s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);o&&i&&U(t,r,i)})([c.observable],L.prototype,"isLoading",2);class q{constructor(){this.userProfileRepository=ft.get(dt.userProfileRepository)}execute(){return e=this,t=null,r=function*(){yield this.userProfileRepository.fetchUserProfile()},new Promise(((o,n)=>{var i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}));var e,t,r}}var z=Object.defineProperty,V=Object.getOwnPropertyDescriptor,F=(e,t,r,o)=>{for(var n,i=o>1?void 0:o?V(t,r):t,s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&z(t,r,i),i};class B extends L{constructor(e){super(),this.loaded=()=>{return e=this,t=null,r=function*(){this.isLoading=!0,yield(new q).execute(),this.isLoading=!1},new Promise(((o,n)=>{var i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}));var e,t,r},this.userProfileRepository=e}get data(){var e,t;return{cardDetails:(null==(t=null==(e=this.userProfileRepository)?void 0:e.userProfile)?void 0:t.basicUserDetails)||{}}}}F([c.observable],B.prototype,"userProfileRepository",2),F([c.action],B.prototype,"loaded",2),F([c.computed],B.prototype,"data",1);const M=B;var H=Object.defineProperty,J=Object.getOwnPropertyDescriptor,G=(e,t,r,o)=>{for(var n,i=o>1?void 0:o?J(t,r):t,s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&H(t,r,i),i};class K extends L{constructor(e){super(),this.loaded=()=>{return e=this,t=null,r=function*(){this.isLoading=!0,yield(new q).execute(),this.isLoading=!1},new Promise(((o,n)=>{var i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}));var e,t,r},this.userProfileRepository=e}get data(){return{userProfile:this.userProfileRepository.userProfile}}}G([c.action],K.prototype,"loaded",2),G([c.computed],K.prototype,"data",1);const W=K;var Q=f("@estee/elc-service-bus");const Y="brand.id",X="language.id",Z="region.id";var ee=Object.defineProperty,te=Object.defineProperties,re=Object.getOwnPropertyDescriptor,oe=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,ae=(e,t,r)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ce=e=>"symbol"==typeof e?e:e+"",le=(e,t,r,o)=>{for(var n,i=o>1?void 0:o?re(t,r):t,s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&ee(t,r,i),i},ue=(e,t,r)=>new Promise(((o,n)=>{var i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}));class pe{constructor(e){this.serviceConfig=e}modifyBuidPathedConfigs(e){var t,r,o;const n=e,{[t=Y]:i,[r=X]:s,[o=Z]:a}=n,c=((e,t)=>{var r={};for(var o in e)ie.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&ne)for(var o of ne(e))t.indexOf(o)<0&&se.call(e,o)&&(r[o]=e[o]);return r})(n,[ce(t),ce(r),ce(o)]),l=(u=((e,t)=>{for(var r in t||(t={}))ie.call(t,r)&&ae(e,r,t[r]);if(ne)for(var r of ne(t))se.call(t,r)&&ae(e,r,t[r]);return e})({},c),te(u,oe({brand:{id:i},language:{id:s},region:{id:a}})));var u;return l}fetchBuidConfigs(e){return ue(this,null,(function*(){return yield(0,Q.query)(Q.serviceQueries.GET_CONFIG,e)}))}fetchConfigs(e){return ue(this,arguments,(function*({appConfig:e,requestedBuidConfigs:t}){const r=yield this.fetchBuidConfigs(t),o=this.modifyBuidPathedConfigs(r);this.serviceConfig.updateConfig({appConfig:e,buidConfig:o})}))}get config(){return this.serviceConfig}}le([c.observable],pe.prototype,"serviceConfig",2),le([c.action],pe.prototype,"fetchConfigs",1),le([c.computed],pe.prototype,"config",1);var fe=Object.defineProperty,de=Object.getOwnPropertyDescriptor,he=(e,t,r,o)=>{for(var n,i=o>1?void 0:o?de(t,r):t,s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&fe(t,r,i),i},ye=(e,t,r)=>new Promise(((o,n)=>{var i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}));const ge="SIGNEDIN",ve="ANONYMOUS";class me{constructor(){this.status="IDLE",this.authState=ve}ensureData(){return this.isUnfullfilled&&(this.initialPromise=this.loadData()),this.initialPromise}loadData(){return ye(this,null,(function*(){try{this.status="LOADING",yield this.fetchUserAuthState(),this.authState===ge&&(yield this.fetchData(),this.status="LOADED")}catch(e){throw this.status="ERROR",new Error(e)}}))}fetchData(){return ye(this,null,(function*(){}))}fetchUserAuthState(){return ye(this,null,(function*(){try{this.authState=yield(0,Q.query)(Q.serviceQueries.GET_USER_AUTH_STATE)}catch(e){throw new Error(e)}}))}get isUnfullfilled(){return["IDLE","ERROR"].includes(this.status)}}he([c.observable],me.prototype,"status",2),he([c.observable],me.prototype,"authState",2),he([c.action],me.prototype,"ensureData",1),he([c.action],me.prototype,"loadData",1),he([c.action],me.prototype,"fetchData",1),he([c.action],me.prototype,"fetchUserAuthState",1),he([c.computed],me.prototype,"isUnfullfilled",1);var be=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Pe=Object.getPrototypeOf,Oe=Reflect.get,Se=(e,t,r,o)=>{for(var n,i=o>1?void 0:o?we(t,r):t,s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&be(t,r,i),i},Ce=(e,t,r)=>new Promise(((o,n)=>{var i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}));const Re=class extends me{constructor(e){super(),this.fetchUserProfile=()=>Ce(this,null,(function*(){return(e=Re.prototype,t=this,r="ensureData",Oe(Pe(e),r,t)).call(this);var e,t,r})),this.fetchData=()=>Ce(this,null,(function*(){const e=yield this.apiSdk.getUserProfile(),t=N.fromJSON(e);this.setUserData(t)})),this.setUserData=e=>{this.userData=e},this.apiSdk=e}get userProfile(){return this.userData}get userProfileId(){var e;return null==(e=this.userData)?void 0:e.userId}get emailAddress(){var e;return null==(e=this.userData)?void 0:e.emailAddress}get basicUserDetails(){var e;return null==(e=this.userData)?void 0:e.basicUserDetails}};let xe=Re;Se([c.observable],xe.prototype,"userData",2),Se([c.action],xe.prototype,"fetchUserProfile",2),Se([c.action],xe.prototype,"fetchData",2),Se([c.action],xe.prototype,"setUserData",2),Se([c.computed],xe.prototype,"userProfile",1),Se([c.computed],xe.prototype,"userProfileId",1),Se([c.computed],xe.prototype,"emailAddress",1),Se([c.computed],xe.prototype,"basicUserDetails",1);var Ee=Object.defineProperty,je=Object.getOwnPropertyDescriptor,Ie=(e,t,r,o)=>{for(var n,i=o>1?void 0:o?je(t,r):t,s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&Ee(t,r,i),i},_e=(e,t,r)=>new Promise(((o,n)=>{var i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}));class De{constructor(e){this.userId=()=>_e(this,null,(function*(){var e;return yield(new q).execute(),null==(e=this.userProfileRepository)?void 0:e.userProfileId})),this.email=()=>_e(this,null,(function*(){var e;return yield(new q).execute(),null==(e=this.userProfileRepository)?void 0:e.emailAddress})),this.basicUserDetails=()=>_e(this,null,(function*(){var e;return yield(new q).execute(),null==(e=this.userProfileRepository)?void 0:e.basicUserDetails})),this.userProfileRepository=e}}Ie([(0,Q.queryProvider)(Q.serviceQueries.GET_USER_ACCOUNT_ID)],De.prototype,"userId",2),Ie([(0,Q.queryProvider)(Q.serviceQueries.EMAIL)],De.prototype,"email",2),Ie([(0,Q.queryProvider)(Q.serviceQueries.BASIC_USER_DETAILS)],De.prototype,"basicUserDetails",2);var ke=f("react"),Ae=f.n(ke);function Te(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o=0||(n[r]=e[r]);return n}function Ne(){return Ne=Object.assign||function(e){for(var t=1;t{rt.Jz.ServiceRegistry=nt(),rt.Jz.ServiceRegistry[this.name]=Object.assign(rt.Jz.ServiceRegistry[this.name]||{},{start:this.start,startPromise:this.startPromise,name:this.name,version:this.version,views:this.views,getView:this.getView,registerView:this.registerView,initializeService:this.initializeService,setViewInCache:this.setViewInCache,getViewFromCache:this.getViewFromCache,serviceInitializer:this.serviceInitializer,componentsRegistry:this.componentsRegistry,cachedComponentsRegistry:this.cachedComponentsRegistry,isStarted:this.isStarted,isLazy:this.isLazy},e||{})},this.getView=e=>this.componentsRegistry[e]||null,this.setViewInCache=(e,t)=>{this.cachedComponentsRegistry[e]=t},this.getViewFromCache=e=>this.cachedComponentsRegistry[e]||null,this.registerView=(e,t,r)=>{this.views.push(e),this.componentsRegistry[e]={componentName:e,component:tt(t),viewController:r}}}initializeService(e){return t=this,r=null,o=function*(){try{yield this.serviceInitializer(e),this.isStarted=!0}catch(e){this.logger.error({message:`Could not start service ${this.name}`,triggerType:ot.TriggerType.render,payload:{error:e,context:{serviceRegistry:rt.Jz.ServiceRegistry}}})}},new Promise(((e,n)=>{var i=e=>{try{a(o.next(e))}catch(e){n(e)}},s=e=>{try{a(o.throw(e))}catch(e){n(e)}},a=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,s);a((o=o.apply(t,r)).next())}));var t,r,o}start(e){return this.startPromise||this.isStarted||(this.logger=new ot.ELCLogger({serviceName:this.name,environment:e.env||rt.Jz.env,buid:e.businessUnitId||rt.Jz.buid,serviceVersion:this.version}),this.startPromise=this.initializeService(e)),this.startPromise}}class st{constructor(e){this.execute=()=>{return e=this,t=null,r=function*(){yield this.configRepository.fetchConfigs(this.configs),this.apiSdk.setConfigs(this.configRepository.config)},new Promise(((o,n)=>{var i=e=>{try{a(r.next(e))}catch(e){n(e)}},s=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);a((r=r.apply(e,t)).next())}));var e,t,r},this.apiSdk=ft.get(dt.userProfileApiSdk),this.configRepository=ft.get(dt.configRepository),this.configs=e}}var at=Object.getPrototypeOf,ct=Reflect.get;const{name:lt,version:ut}={branchName:"release/2.10",commitHash:"4026d5871e9b547f8de7b2c49626c75081de7452",version:"2.10.0",name:"pg-service-user-profile"};class pt extends it{constructor(e){super(lt,ut,e),this.registerView("user-profile-welcome",(()=>Promise.all([f.e("pg-service-user-profile-common"),f.e("UserProfileWelcome")]).then(f.bind(f,"./src/exported/user-profile-welcome/UserProfileWelcome.tsx"))),(()=>ft.get(dt.userProfileWelcomeViewController))),this.registerView("user-profile-card",(()=>Promise.all([f.e("pg-service-user-profile-common"),f.e("UserProfileCard")]).then(f.bind(f,"./src/exported/user-profile-card/UserProfileCard.tsx"))),(()=>ft.get(dt.userProfileCardViewController)))}start(e){return t=this,r=null,o=function*(){const t=yield(r=pt.prototype,o=this,n="start",ct(at(r),n,o)).call(this,e);var r,o,n;const i=new st({appConfig:e,requestedBuidConfigs:["brand.id","language.id","region.id"]});return yield i.execute(),t},new Promise(((e,n)=>{var i=e=>{try{a(o.next(e))}catch(e){n(e)}},s=e=>{try{a(o.throw(e))}catch(e){n(e)}},a=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,s);a((o=o.apply(t,r)).next())}));var t,r,o}}const ft=new i.Container,dt={config:"CONFIG",configRepository:"CONFIG_REPOSITORY",httpTransport:"HTTP_TRANSPORT",serviceBusController:"SERVICE_BUS_CONTROLLER",userProfile:"USER_PROFILE",userProfileApiSdk:"USER_PROFILE_API_SDK",userProfileCardViewController:"USER_PROFILE_CARD_VIEW_CONTROLLER",userProfileRepository:"USER_PROFILE_REPOSITORY",userProfileService:"USER_PROFILE_SERVICE",userProfileWelcomeViewController:"USER_PROFILE_WELCOME_VIEW_CONTROLLER"};ft.register(dt.config,(e=>{const t=e.config;return new b(t)})).register(dt.userProfileService,(e=>new pt((t=>{var r;r=t,ft.config=r;return e.get(dt.serviceBusController)})))).register(dt.httpTransport,(()=>new s.HttpTransport)).register(dt.userProfile,(()=>new N)).register(dt.configRepository,(e=>{const t=e.get(dt.config);return new pe(t)})).register(dt.userProfileRepository,(e=>{const t=e.get(dt.userProfileApiSdk);return new xe(t)})).register(dt.userProfileWelcomeViewController,(e=>{const t=e.get(dt.userProfileRepository);return new W(t)})).register(dt.userProfileCardViewController,(e=>{const t=e.get(dt.userProfileRepository);return new M(t)})).register(dt.serviceBusController,(e=>{const t=e.get(dt.userProfileRepository);return new De(t)})).register(dt.userProfileApiSdk,(e=>{const t=e.get(dt.httpTransport);return new a(t)}));const{lazyInject:ht}=(yt=ft,{lazyInject:e=>(t,r,o)=>{const n=e||r,i=function(){const e=yt.get(n);if(!e)throw new Error(`The requested ${n} does not exists`);return e};let s=o||{};o?s.get=i:(s={get:i},Object.defineProperty(t,r,s))}});var yt;ft.get(dt.userProfileService).register(),(n=>{const i=n,{name:s}=i,a=((o,n)=>{var i={};for(var s in o)t.call(o,s)&&n.indexOf(s)<0&&(i[s]=o[s]);if(null!=o&&e)for(var s of e(o))n.indexOf(s)<0&&r.call(o,s)&&(i[s]=o[s]);return i})(i,["name"]);o.serviceInfo=o.serviceInfo||{},o.serviceInfo[s]=a})({branchName:"release/2.10",commitHash:"4026d5871e9b547f8de7b2c49626c75081de7452",version:"2.10.0",name:"pg-service-user-profile"})})(),d})())); //# sourceMappingURL=bundle.js.map