(this["webpackJsonp6th-street"]=this["webpackJsonp6th-street"]||[]).push([[47,21],{1376:function(e,n,t){"use strict";(function(e,a){var o=t(5),i=t.n(o),r=t(12),c=t(10),l=t(0),u=(t(1515),t(258)),s=t.n(u),d=t(99),f=t(15).checkBEMProps;n.a=function(n){var t=n.handleUpload,o=n.onClose,u=Object(l.useRef)(null),v=Object(l.useRef)(null),b=Object(l.useRef)(null),m=Object(l.useState)(""),p=Object(c.a)(m,2),g=p[0],h=p[1],k=Object(l.useState)(!1),C=Object(c.a)(k,2),O=C[0],j=C[1],y=Object(l.useState)(null),w=Object(c.a)(y,2),S=w[0],B=w[1],_=Object(l.useCallback)((function(){var e;null===(e=b.current)||void 0===e||e.getTracks().forEach((function(e){return e.stop()})),b.current=null,u.current&&(u.current.srcObject=null),j(!1)}),[]),x=Object(l.useCallback)(Object(r.a)(i.a.mark((function n(){var t,a,o,r;return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t={NotAllowedError:e("Camera access was denied. Please allow permission in your browser settings."),PermissionDeniedError:e("Camera access was denied. Please allow permission in your browser settings."),NotFoundError:e("No camera device found."),DevicesNotFoundError:e("No camera device found."),NotReadableError:e("Camera is already in use by another application.")},n.prev=1,n.next=4,navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1}).catch((function(){return navigator.mediaDevices.getUserMedia({video:!0,audio:!1})}));case 4:if(a=n.sent,o=u.current){n.next=8;break}return n.abrupt("return");case 8:return Object.assign(o,{muted:!0,autoplay:!0,srcObject:a}),o.setAttribute("playsinline","true"),n.next=12,o.play();case 12:b.current=a,j(!0),n.next=19;break;case 16:n.prev=16,n.t0=n.catch(1),h(null!==(r=t[null===n.t0||void 0===n.t0?void 0:n.t0.name])&&void 0!==r?r:e("Unable to open camera."));case 19:case"end":return n.stop()}}),n,null,[[1,16]])}))),[]),M=Object(l.useCallback)((function(){var n=u.current,t=v.current;if(!(null===n||void 0===n?void 0:n.videoWidth)||!t)return h(e("Camera not ready."));t.width=n.videoWidth,t.height=n.videoHeight,t.getContext("2d").drawImage(n,0,0),_(),B(t.toDataURL("image/png"))}),[_]),N=Object(l.useCallback)((function(){B(null),x()}),[x]),P=Object(l.useCallback)((function(){null===t||void 0===t||t(S,"camera-capture.png")}),[t,S]),E=Object(l.useCallback)((function(){_(),null===o||void 0===o||o()}),[_,o]);return Object(l.useEffect)((function(){return x(),_}),[x,_]),S?f(a,"div",{block:"Camera",elem:"ProfileContainer"},f(a,"img",{src:S,block:"Camera",elem:"ProfilePreview",alt:"captured"}),f(a,"div",{block:"Camera",elem:"ProfileActions"},f(a,d.a,{variant:"ghost",onClick:N},e("Retake")),f(a,d.a,{variant:"ghost",onClick:P},e("Use Photo"))),f(a,"canvas",{ref:v,style:{display:"none"}})):f(a,"div",{block:"Camera",elem:"ProfileContainer"},g&&f(a,"p",{block:"Camera",elem:"ProfileError"},g),f(a,"button",{type:"button",block:"Camera",elem:"ProfileClose",onClick:E,"aria-label":e("Close")},f(a,"img",{src:s.a,alt:"close"})),f(a,"video",{ref:u,block:"Camera",elem:"ProfileVideo",playsInline:!0,muted:!0,autoPlay:!0}),f(a,"div",{block:"Camera",elem:"ProfileCaptureBar"},O&&f(a,"button",{type:"button",block:"Camera",elem:"ProfileCaptureBtn",onClick:M,"aria-label":e("Take Photo")})),f(a,"canvas",{ref:v,style:{display:"none"}}))}}).call(this,t(28),t(0))},1419:function(e,n,t){e.exports=t.p+"static/media/arrow-black.f9f103ad.svg"},1422:function(e,n,t){"use strict";(function(e){t.d(n,"a",(function(){return c}));t(1423);var a=t(1419),o=t.n(a),i=t(40),r=t(15).checkBEMProps;function c(n){var t=n.title;return r(e,"div",{block:"ScreenHeader",elem:"Wrapper"},r(e,"button",{block:"ScreenHeader",elem:"back",onClick:function(){i.a.goBack()}},r(e,"img",{src:o.a,alt:"Go Back"})),t?r(e,"span",{block:"ScreenHeader",elem:"name"},t):null,r(e,"span",null))}}).call(this,t(0))},1423:function(e,n,t){},1515:function(e,n,t){},2130:function(e,n,t){"use strict";(function(e){var a=t(5),o=t.n(a),i=t(12),r=t(10),c=t(0),l=t.n(c),u=t(2520),s=t(16),d=t(69),f=t(13),v=t(187),b=t(1),m=t(49),p=t(204),g=t(190),h=t(17),k=t(15).checkBEMProps;n.a=Object(s.b)((function(e){return{config:e.AppConfig.config,language:e.AppState.language,country:e.AppState.country}}),(function(e){return{setCountry:function(n){return e(Object(d.k)(n))},setAppConfig:function(e){function n(n){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(n){return e(setAppConfig(n))})),setCountryForWelcome:function(n){return e(Object(d.l)(n))},setLanguage:function(n){return e(Object(d.o)(n))},updateStoreCredits:function(){return StoreCreditDispatcher.getStoreCredit(e)},setLanguageForWelcome:function(n){return e(Object(d.p)(n))},setMeta:function(n){return e(Object(v.b)(n))}}}))((function(n){var t=n.country,a=n.language,s=n.setLanguageForWelcome,d=n.setCountryForWelcome,v=n.setMeta,C=n.handleSkip,O="".concat(a,"-").concat(t.toLowerCase()),j=Object(c.useState)(t||"AE"),y=Object(r.a)(j,2),w=y[0],S=y[1],B=Object(c.useState)(a||"en"),_=Object(r.a)(B,2),x=_[0],M=_[1],N=(h.a.any(),function(){var e=Object(i.a)(o.a.mark((function e(){var n,t;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(p.j)(O);case 3:(null===(n=e.sent)||void 0===n?void 0:n.error)||(t=document.createElement("script"))&&(t.type="application/ld+json",t.innerHTML=JSON.stringify(n),document.querySelectorAll("script[type='application/ld+json']").forEach((function(e){return e.remove()})),document.head.appendChild(t)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}());return Object(c.useEffect)((function(){v({title:e("Shop Online @ ".concat(g.a.url," for Men, Women & Kids across GCC"))}),window.pageType="welcome",N()}),[]),Object(c.useEffect)((function(){s(x),d(w)}),[x,w]),k(l.a,u.a,Object.assign({},n,{onCountrySelect:function(e){localStorage.removeItem("EddAddressReq"),localStorage.removeItem("EddAddressRes"),localStorage.removeItem("currentSelectedAddress"),f.a.deleteItem("cityAreaFromSelectionPopUp"),S(e)},onLanguageSelect:function(e){Object(b.Ni)(b.Wf,{country:Object(m.g)().toUpperCase(),language:e.toUpperCase()||"",app6thstreet_platform:"Web"});var n={name:b.be,value:e.toUpperCase()};b.nj.dispatch(b.Cd,n);var t=new URL(window.location.href);if(window.location.href.includes("en-")||window.location.href.includes("ar-"))if("/influencer.html/Collection"===t.pathname||"/influencer.html/Store"===t.pathname){var o=t.origin+t.pathname+t.search;setTimeout((function(){window.location.href=o.replace(a.toLowerCase(),e,o)}),1e3)}else if(location.pathname.match(/my-account/))setTimeout((function(){window.location.href=location.href.replace(a.toLowerCase(),e,location.href).split("/my-account")[0]}),1e3);else if(location.pathname.match(/viewall/))setTimeout((function(){window.location.href=location.href.replace(a.toLowerCase(),e,location.href).split("/viewall")[0]}),1e3);else if("/catalogsearch/result/"==t.pathname){var i=t.origin;setTimeout((function(){window.location.href=i.replace(a.toLowerCase(),e,i)}),1e3)}else if("PRODUCT"===window.pageType){var r=t.origin+t.pathname+t.search;setTimeout((function(){window.location.href=r.replace(a.toLowerCase(),e,r)}),1e3)}else if(t.search&&t.search.length>0&&"/catalogsearch/result/"!==t.pathname){var c=t.origin+t.pathname;setTimeout((function(){window.location.href=c.replace(a.toLowerCase(),e,c)}),1e3)}else setTimeout((function(){window.location.href=location.href.replace(a.toLowerCase(),e,location.href)}),1e3);else M(e)},handleLanCountrySubmit:function(){s(x),d(w),C()}}))}))}).call(this,t(28))},2131:function(e,n,t){"use strict";(function(e){var a=t(9),o=t(2),i=t(5),r=t.n(i),c=t(12),l=t(10),u=t(0),s=t.n(u),d=t(16),f=t(2522),v=t(49),b=t(55),m=t(27),p=t(98),g=Promise.resolve().then(t.bind(null,36)),h=t(15).checkBEMProps;n.a=Object(d.b)((function(e){return{config:e.AppConfig.config,language:e.AppState.language,country:e.AppState.country}}),(function(e){return{setCaPopUpState:function(n){return g.then((function(t){return t.default.setCaPopUpState(e,n)}))},signIn:function(n){return g.then((function(t){return t.default.signIn(n,e)}))},signInOTP:function(n){return g.then((function(t){return t.default.signInOTP(n,e)}))},showNotification:function(n,t){return e(Object(m.d)(n,t))}}}))((function(n){var t=n.handleLoading,i=n.setCaPopUpState,d=n.showNotification,m=Object(u.useState)(!1),g=Object(l.a)(m,2),k=g[0],C=g[1],O=Object(v.j)(),j=function(){var n=Object(c.a)(r.a.mark((function n(a){var o,i,c;return r.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t(!0),n.prev=1,n.next=4,Object(b.o)({phone:a,flag:"login"});case 4:if(!(null===(o=n.sent)||void 0===o?void 0:o.success)){n.next=10;break}return d("success",e("OTP sent successfully")),n.abrupt("return",!0);case 10:i=(null===o||void 0===o?void 0:o.message)||(null===o||void 0===o?void 0:o.error)||e("Failed to send OTP"),d("error",i);case 12:n.next=18;break;case 14:n.prev=14,n.t0=n.catch(1),c=(null===n.t0||void 0===n.t0?void 0:n.t0.message)||(null===n.t0||void 0===n.t0?void 0:n.t0.error)||e("Failed to send OTP"),d("error",c);case 18:return n.prev=18,t(!1),n.finish(18);case 21:case"end":return n.stop()}}),n,null,[[1,14,18,21]])})));return function(e){return n.apply(this,arguments)}}(),y=function(){var n=Object(c.a)(r.a.mark((function n(c,l){var u,s,f,v,m,p,g,h,k,y,w,S,B,_,x,M,N;return r.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t(!0),s="email"===l,f=(u="mobile"===l)?"".concat(c.code).concat(c.mobile):c,n.prev=4,n.next=7,Object(b.a)(f,O);case 7:if(p=n.sent,g=null!==(v=null===p||void 0===p?void 0:p.data)&&void 0!==v?v:{},h=null===g||void 0===g?void 0:g.has_account,k=null===g||void 0===g?void 0:g.error,y=null===g||void 0===g?void 0:g.data,"boolean"===typeof h){n.next=15;break}return d("error",e("Unable to verify account right now. Please try again.")),n.abrupt("return");case 15:if(!h&&k&&d("error",k),!h){n.next=30;break}if(w=!0,!u){n.next=24;break}return n.next=21,j(f);case 21:w=n.sent,n.next=28;break;case 24:if(!s){n.next=28;break}return n.next=27,Object(b.p)({email:c,flag:"login",unified:!0});case 27:w=n.sent;case 28:if(w){n.next=30;break}return n.abrupt("return");case 30:C(!0),S=h?"otp":"signUp",i(Object(o.a)((m={redirectTo:S},Object(a.a)(m,l,c),Object(a.a)(m,"flag","login"),Object(a.a)(m,"prevScreen","onBoarding"),m),!h&&y?{data:y}:{})),n.next=40;break;case 35:n.prev=35,n.t0=n.catch(4),N=(null===n.t0||void 0===n.t0||null===(B=n.t0.response)||void 0===B||null===(_=B.data)||void 0===_?void 0:_.message)||(null===n.t0||void 0===n.t0||null===(x=n.t0.response)||void 0===x||null===(M=x.data)||void 0===M?void 0:M.error)||(null===n.t0||void 0===n.t0?void 0:n.t0.message)||e("Failed while checking valid user"),d("error",N),console.error(n.t0,"while checking valid user");case 40:return n.prev=40,t(!1),n.finish(40);case 43:case"end":return n.stop()}}),n,null,[[4,35,40,43]])})));return function(e,t){return n.apply(this,arguments)}}();return h(s.a,s.a.Fragment,null,k?h(s.a,p.a,{closePopup:function(){return C(!1)},onSignIn:function(){return C(!1)},isPopup:k}):h(s.a,f.a,Object.assign({},n,{submitHandler:y})),";")}))}).call(this,t(28))},2132:function(e,n,t){"use strict";(function(e){var a=t(0),o=t(16),i=t(85),r=t(2526),c=Promise.resolve().then(t.bind(null,36)),l=t(15).checkBEMProps;n.a=Object(o.b)((function(e){return{language:e.AppState.language,country:e.AppState.country,config:e.AppConfig.config}}),(function(e){return{setCaPopUpState:function(n){return c.then((function(t){return t.default.setCaPopUpState(e,n)}))}}}))((function(n){var t=n.language,o=n.country,c=n.config,u=Object(a.useMemo)((function(){var e,n,a,i,r=null!==(e=null===o||void 0===o?void 0:o.toUpperCase())&&void 0!==e?e:"AE",l=(null===c||void 0===c||null===(n=c.countries)||void 0===n||null===(a=n[r])||void 0===a||null===(i=a.aivi_onboarding_data)||void 0===i?void 0:i[t])||{};return{logo:null===l||void 0===l?void 0:l.aiviLogo,onBoardingInfo:null===l||void 0===l?void 0:l.onboarding}}),[c,o,t]),s=!c||!o||!t;return l(e,e.Fragment,null,s?l(e,i.a,{isLoading:s}):l(e,r.a,Object.assign({},n,{imgConfig:u})))}))}).call(this,t(0))},2133:function(e,n,t){"use strict";(function(e){t.d(n,"a",(function(){return i}));var a=t(2530),o=(t(2541),t(15).checkBEMProps);function i(){return o(e,a.a,null)}}).call(this,t(0))},2134:function(e,n,t){"use strict";(function(e){var a=t(2532),o=t(16),i=t(27),r=Promise.resolve().then(t.bind(null,36)),c=t(15).checkBEMProps;n.a=Object(o.b)((function(e){return{}}),(function(e){return{showNotification:function(n,t){return e(Object(i.d)(n,t))},setCaPopUpState:function(n){return r.then((function(t){return t.default.setCaPopUpState(e,n)}))}}}))((function(n){return c(e,a.a,n)}))}).call(this,t(0))},2135:function(e,n,t){e.exports=t.p+"static/media/trash-icon.b75650a8.svg"},2136:function(e,n,t){"use strict";(function(e){t.d(n,"a",(function(){return i}));var a=t(2535),o=t(15).checkBEMProps;function i(n){return o(e,a.a,n)}}).call(this,t(0))},2518:function(e,n,t){"use strict";(function(e){t.d(n,"a",(function(){return d}));var a=t(10),o=t(0),i=(t(2519),t(143)),r=t(13),c=t(17),l=t(37),u=t(40),s=t(15).checkBEMProps;function d(n){var t=n.screen,d=n.current,f=n.language,v=n.country,b=n.imgConfig,m=Object(l.h)().pathname,p=Object(o.useMemo)((function(){return r.a.getItem("PREVIOUS_USER")}),[]),g=Object(o.useState)(!1),h=Object(a.a)(g,2),k=h[0],C=h[1],O=t[d],j=O.name,y=O.Component,w=c.a.any(),S=Object(o.useState)("selectCountry"!==d||!w),B=Object(a.a)(S,2),_=B[0],x=B[1],M=function(){var e="".concat(f,"-").concat(v.toLowerCase());if(p||function(e,n){if(r.a.setItem({locale:e},"PREVIOUS_USER"),e&&n){document.cookie="locale=".concat(e,"; max-age=").concat(7776e3,"; path=/"),document.cookie="all"===n?"gender=; max-age=".concat(7776e3,"; path=/"):"gender=".concat(n,".html; max-age=").concat(7776e3,"; path=/")}}(e,"all"),"/club-apparel/onboarding"===m)u.a.push("/");else{var n="".concat(i.b[e]);window.location.href=c.a.any()&&p?"".concat(n):c.a.any()&&!p?"".concat(n,"/club-apparel/onboarding"):"".concat(n)}};return Object(o.useLayoutEffect)((function(){p&&M()}),[p]),Object(o.useEffect)((function(){if(w){var e=setTimeout((function(){return x(!0)}),3e3);return function(){return clearTimeout(e)}}}),[w]),p?null:s(e,"div",{block:"Onboarding",mods:{isArabic:"ar"===f}},s(e,"div",{block:"Onboarding",elem:"Container",className:"".concat(k?"is-blurred":""," ").concat("BrandsInfo"===d?"BrandsInfo":_?"has-image-bg":"has-no-image-bg"),style:{"--onboarding-bg":"BrandsInfo"===d?"none":_?"url(".concat(b.background,")"):"none"}},w?s(e,e.Fragment,null,!_&&s(e,"div",{block:"Onboarding",elem:"LogoSection",className:"".concat(k?"is-blurred":"")},s(e,"img",{src:null===b||void 0===b?void 0:b.logo,alt:"Onboarding Logo",className:"LogoBg"})),s(e,"div",{className:"OnboardingMobileReveal ".concat(_?"is-visible":"")},s(e,y,Object.assign({screen:j,current:d,setFocus:C,focus:k,handleSkip:M},n)))):s(e,e.Fragment,null,s(e,"div",{className:"OnboardingDesktop"},s(e,"div",{block:"Onboarding",elem:"LogoSection",className:"".concat(k?"is-blurred":"")}),s(e,y,Object.assign({screen:j,current:d,setFocus:C,handleSkip:M,focus:k},n))))))}}).call(this,t(0))},2519:function(e,n,t){},2520:function(e,n,t){"use strict";(function(e){t.d(n,"a",(function(){return l}));var a=t(10),o=t(0),i=t(505),r=t(203),c=(t(2521),t(15).checkBEMProps);function l(n){var t=n.language,l=n.onLanguageSelect,u=n.handleLanCountrySubmit,s=n.imgConfig,d=Object(o.useState)(t||"en"),f=Object(a.a)(d,2),v=f[0],b=f[1],m=function(e){b(e),l(e)};return c(e,e.Fragment,null,c(e,"div",{block:"SelectLanCountry",elem:"Container",mods:{isArabic:"ar"===t}},c(e,"div",{block:"SelectLanCountry",elem:"TopLayer"},c(e,"div",{className:"Logo"},c(e,"img",{src:null===s||void 0===s?void 0:s.logo,alt:"Country Logo"})),c(e,"h4",{className:"LogoContent"},"en"===t?"Welcome to AIVI, select your preferred country and language":"\u0645\u0631\u062d\u0628\u0627\u064b \u0628\u0643 \u0641\u064a \u0622\u064a\u0641\u064a\u060c \u0627\u062e\u062a\u0631 \u062f\u0648\u0644\u062a\u0643 \u0648\u0644\u063a\u062a\u0643")),c(e,"div",{block:"SelectLanCountry",elem:"BottomLayer"},c(e,i.b,Object.assign({label:"en"===t?"Select Your Country":"\u0627\u062e\u062a\u0631 \u0627\u0644\u0628\u0644\u062f",isCountry:!0},n)),c(e,"div",{block:"SelectLanCountry",elem:"SelectionBlock"},c(e,r.a,{classFor:"CountrySelectEng ".concat("en"===v?"isSelected":"isNotSelected"),text:"en"===t?"English":"\u0627\u0644\u0625\u0646\u062c\u0644\u064a\u0632\u064a\u0629",parentStyle:{width:"100%",marginTop:"unset"},onClick:function(){return m("en")},type:"button"}),c(e,r.a,{classFor:"CountrySelectArb ".concat("ar"===v?"isSelected":"isNotSelected"),text:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",parentStyle:{width:"100%",marginTop:"unset"},onClick:function(){return m("ar")},type:"button"})),c(e,r.a,{classFor:"GetStartedButton GetStartedButtonWhite",text:"en"===t?"Get Started":"\u0627\u0628\u062f\u0623 \u0627\u0644\u0622\u0646",parentStyle:{width:"100%",marginTop:"unset"},onClick:u,type:"button"}))))}}).call(this,t(0))},2521:function(e,n,t){},2522:function(e,n,t){"use strict";(function(e,a){t.d(n,"a",(function(){return m}));var o=t(83),i=t(10),r=t(0),c=t(2523),l=t(203),u=t(241),s=(t(2525),t(205)),d=t(24),f=t(113),v=t(29),b=t(15).checkBEMProps;function m(n){var t,m,p,g,h,k,C=n.setFocus,O=n.focus,j=n.submitHandler,y=n.isLoading,w={code:{value:{code:n.country.toLowerCase(),dial:""}},mobile:{},email:{}},S=Object(s.a)(w),B=Object(r.useState)("mobile"),_=Object(i.a)(B,2),x=_[0],M=_[1],N=S.values,P=S.handleChange,E=(S.handleInput,S.setError),T=Object(r.useState)(!1),D=Object(i.a)(T,2),I=D[0],L=D[1],A=Object(r.useState)(!1),U=Object(i.a)(A,2),R=U[0],F=U[1],V=Object(r.useMemo)((function(){return[{id:"mobile",text:e("Phone Number")},{id:"email",text:e("Email")}]}),[]);return Object(r.useEffect)((function(){var e,n;if((null===N||void 0===N||null===(e=N.mobile)||void 0===e||null===(n=e.value)||void 0===n?void 0:n.length)>0){var t,a=/[^\d\s]/.test(null===N||void 0===N||null===(t=N.mobile)||void 0===t?void 0:t.value);M(a?"email":"mobile")}}),[null===N||void 0===N||null===(t=N.mobile)||void 0===t?void 0:t.value]),b(a,"div",{block:"OnboardingLoginSignUp",elem:"Container"},!1===O?b(a,c.a,{tabsList:V,activeTab:x,onClickHandler:function(e){M(e)}}):null,b(a,"form",{onSubmit:function(n){var t,a,i,r,c,l,u,s,v,b,m;n.preventDefault();var p=null!==(t=null===(a=N.mobile)||void 0===a?void 0:a.value)&&void 0!==t?t:"",g=/\D/.test(p);for(var h in N)E(h,void 0);var k,C=!1,O="email"===x?p:null!==(i=null===(r=N.mobile)||void 0===r?void 0:r.value)&&void 0!==i?i:"",y=Object(d.bb)(O),w={email:["notEmpty","email"]}[x]||[],S=Object(o.a)(w);try{for(S.s();!(k=S.n()).done;){var B=k.value,_=f.a[B];if(_&&!_.validate({value:y})){var M,P=(null===(M=_.message)||void 0===M?void 0:M.trim())||"",T="dob"===x?"Date of Birth":x.charAt(0).toUpperCase()+x.slice(1);P=P.replace(/^This field/i,T).replace(/^This/i,T),E("mobile",{message:P}),C=!0;break}}}catch(I){S.e(I)}finally{S.f()}if(f.a.notEmpty.validate({value:(null===N||void 0===N||null===(c=N.mobile)||void 0===c||null===(l=c.value)||void 0===l||null===(u=l.toString)||void 0===u?void 0:u.call(l))||""})?R||(E("mobile",{message:e("Please enter a valid phone number")}),C=!0):(E("mobile",{message:f.a.notEmpty.message}),C=!0),!C){var D=g?p:{code:"+"+(null===(s=N.code)||void 0===s?void 0:s.value.dial),mobile:null===(v=(null===(b=N.mobile)||void 0===b?void 0:b.value)||"")||void 0===v?void 0:v.replace(/^0+/,""),countryCode:null===(m=N.code)||void 0===m?void 0:m.value.code};j(D,x)}},className:"".concat(O?"is-blurred":"")},b(a,u.a,{defaultInput:(null===N||void 0===N||null===(m=N.mobile)||void 0===m||null===(p=m.value)||void 0===p?void 0:p.length)>0?void 0:x,bottomLogin:!0,value:null===N||void 0===N||null===(g=N.mobile)||void 0===g?void 0:g.value,code:null===N||void 0===N||null===(h=N.code)||void 0===h?void 0:h.value,error:null===N||void 0===N||null===(k=N.mobile)||void 0===k?void 0:k.error,onChange:function(e){var n=e.code,t=e.iso2,a=e.number,o=e.isValid;P("mobile",a),P("code",{code:t,dial:n}),F(o)},placeHolder:e("email"===x?"Enter your email":"5X XXX XX XX"),handleFocus:function(){C(!0)},handleBlur:function(){C(!1)},v2:!0}),!O&&b(a,a.Fragment,null," ",b(a,"div",{className:"TermsRow"},b(a,"input",{id:"onboardingTerms",type:"checkbox",className:"TermsRow__Input",checked:I,onChange:function(e){return L(e.target.checked)}}),b(a,"label",{htmlFor:"onboardingTerms",className:"TermsRow__Box"}),b(a,"span",{className:"termsText"},e("By continuing, I agree to the")," ",b(a,v.a,{to:"/terms-and-conditions",className:"boldText"},e("Terms & Conditions"))," ","&"," ",b(a,v.a,{to:"/privacy-policy",className:"boldText"},e("Privacy Policy")))),b(a,l.a,{text:e("Log in or sign up"),type:"submit",isLoading:y,disabled:!I}))))}}).call(this,t(28),t(0))},2523:function(e,n,t){"use strict";(function(e){t(2524);var a=t(15).checkBEMProps;n.a=function(n){var t=n.tabsList,o=void 0===t?[]:t,i=n.onClickHandler,r=n.activeTab;return a(e,"div",{block:"TabsContainer"},a(e,"ul",{block:"TabsContainer",elem:"list"},o.map((function(n){return a(e,"li",{key:n.id,className:"TabsContainer-listItem ".concat(n.id===r?"TabsContainer-listItem--active":""),onClick:function(){return i(n.id)}},a(e,"div",{block:"TabsContainer",elem:"listItemText"},n.text))}))))}}).call(this,t(0))},2524:function(e,n,t){},2525:function(e,n,t){},2526:function(e,n,t){"use strict";(function(e,a){t.d(n,"a",(function(){return b}));var o=t(5),i=t.n(o),r=t(12),c=t(10),l=t(0),u=(t(2527),t(203)),s=t(40),d=function(e){return e.reduce((function(e,n){return e+(Number(n)||0)}),0)},f=t(15).checkBEMProps;function v(n){var t=n.refEl,a=n.isFront,o=n.slide,i=n.onEnded;return o?"image"===o.type?f(e,"img",{className:"BrandsInfoVideoCarousel-Video ".concat(a?"is-front":"is-back"),src:o.src,alt:"","aria-hidden":"true"}):f(e,"video",{ref:t,className:"BrandsInfoVideoCarousel-Video ".concat(a?"is-front":"is-back"),src:o.src,muted:!0,playsInline:!0,autoPlay:!0,preload:"auto",onEnded:i}):null}function b(n){var t,o,b=n.handleModal,m=n.handleRedirect,p=n.handlePageChange,g=n.imgConfig||{},h=g.onBoardingInfo,k=void 0===h?[]:h,C=g.logo,O=Object(l.useMemo)((function(){return(null===k||void 0===k?void 0:k.length)?k.map((function(e){var n,t;return{type:"image"===(null===e||void 0===e||null===(n=e.media)||void 0===n?void 0:n.type)?"image":"video",src:(null===e||void 0===e||null===(t=e.media)||void 0===t?void 0:t.source)||"",title:(null===e||void 0===e?void 0:e.title)||"",subtitle:Array.isArray(null===e||void 0===e?void 0:e.text)?e.text.join("\n"):(null===e||void 0===e?void 0:e.text)||"",brandUrl:null===e||void 0===e?void 0:e.brandUrl}})):[]}),[k]),j=Object(l.useState)(0),y=Object(c.a)(j,2),w=y[0],S=y[1],B=Object(l.useState)(!0),_=Object(c.a)(B,2),x=_[0],M=_[1],N=Object(l.useRef)(null),P=Object(l.useRef)(null),E=Object(l.useRef)(0),T=Object(l.useState)([]),D=Object(c.a)(T,2),I=D[0],L=D[1],A=Object(l.useState)(0),U=Object(c.a)(A,2),R=U[0],F=U[1],V=Object(l.useState)(!1),z=Object(c.a)(V,1)[0],W=Object(l.useMemo)((function(){return O.length?(w+1)%O.length:0}),[w,O.length]),H=Object(l.useMemo)((function(){return Math.max(1,d(I))}),[I]),G=function(){return x?N.current:P.current},q=function(){O.length&&(M((function(e){return!e})),S((function(e){var n=(e+1)%O.length;return 0===n&&F(0),n})))};Object(l.useEffect)((function(){if(O.length){var e=!1,n=function(e){return new Promise((function(n){if("image"===e.type)return n(5e3);var t=document.createElement("video");t.preload="metadata",t.muted=!0,t.playsInline=!0,t.src=e.src;var a=function(){var e=Number(t.duration);n(Number.isFinite(e)&&e>0?Math.round(1e3*e):0)};t.addEventListener("loadedmetadata",a,{once:!0}),t.addEventListener("durationchange",a,{once:!0}),t.addEventListener("error",(function(){return n(0)}),{once:!0})}))};return Object(r.a)(i.a.mark((function t(){var a;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(O.map(n));case 2:a=t.sent,e||L(a);case 4:case"end":return t.stop()}}),t)})))(),function(){e=!0}}}),[O]),Object(l.useEffect)((function(){if(O.length){var e=O[w];"image"===(null===e||void 0===e?void 0:e.type)&&(E.current=performance.now());var n=G(),t=x?P.current:N.current;if("video"===(null===e||void 0===e?void 0:e.type)&&n){n.currentTime=0;var a=n.play();a&&"function"===typeof a.catch&&a.catch((function(){}))}else n&&(n.pause(),n.currentTime=0);t&&(t.pause(),t.currentTime=0)}}),[w,x,W,O]),Object(l.useEffect)((function(){var e=O[w];if(e&&!z&&"image"===e.type){var n=window.setTimeout((function(){q()}),5e3);return function(){return window.clearTimeout(n)}}}),[w,z,O]),Object(l.useEffect)((function(){var e=O[w];if(e&&!z){var n=0,t=d(I.slice(0,w));return n=requestAnimationFrame((function a(){var o=0;if("video"===e.type){var i=G();o=Math.max(0,1e3*Number((null===i||void 0===i?void 0:i.currentTime)||0))}else{var r=performance.now()-(E.current||performance.now());o=Math.max(0,Math.min(5e3,r))}var c=Math.min(t+o,H);F(c/H),n=requestAnimationFrame(a)})),function(){return cancelAnimationFrame(n)}}}),[w,x,I,H,z,O]);var J=O[w]||{},K=C;return O.length?f(e,"div",{block:"BrandsInfo",elem:"Container"},f(e,"div",{className:"BrandsInfoVideoCarousel","aria-hidden":"true"},f(e,v,{refEl:N,isFront:x,slide:x?O[w]:O[W],onEnded:x&&"video"===(null===(t=O[w])||void 0===t?void 0:t.type)?q:void 0}),f(e,v,{refEl:P,isFront:!x,slide:x?O[W]:O[w],onEnded:x||"video"!==(null===(o=O[w])||void 0===o?void 0:o.type)?void 0:q}),f(e,"div",{className:"BrandsInfoVideoCarousel-Overlay"})),f(e,"div",{block:"BrandsInfo",elem:"TopLayer"},f(e,"div",{className:"Logo"},f(e,"img",{src:K,alt:"logo"}))),f(e,"div",{block:"BrandsInfo",elem:"MiddleLayer"},f(e,"h4",{className:"BrandsTitle"},J.title),f(e,"p",{className:"BrandsSubTitle"},J.subtitle),f(e,"div",{className:"BrandsInfoStatusLine","aria-hidden":"true"},f(e,"span",{className:"BrandsInfoStatusLine-Fill",style:{width:"".concat(Math.min(100,Math.max(0,100*R)),"%")}}))),f(e,"div",{block:"BrandsInfo",elem:"BottomLayer"},f(e,u.a,{classFor:"GradientButtonV2",text:a("Sign In"),parentStyle:{width:"100%",marginTop:"unset"},onClick:function(){return m("loginSignup",(function(){b(!1),p("BrandsInfo")}))},type:"button"}),f(e,u.a,{classFor:"OutlineButtonV2",text:a("Start Exploring"),parentStyle:{width:"100%",marginTop:"unset"},onClick:function(){return s.a.push("/")},type:"button"}),f(e,"p",{className:"JoinTxt"},a("Join our community of")," ",f(e,"span",{className:"JoinTxtBold"},a("15 million"))," ",a("members"),"."))):null}}).call(this,t(0),t(28))},2527:function(e,n,t){},2528:function(e,n,t){"use strict";(function(e){var a=t(9),o=t(2),i=t(10),r=t(0),c=t.n(r),l=t(29),u=(t(2529),t(15).checkBEMProps);n.a=function(n){var t=n.onAccept,s=n.onPopupViewed,d=n.onPreferencesOpened,f=n.onSavePreferences,v=Object(r.useState)(!1),b=Object(i.a)(v,2),m=b[0],p=b[1],g=Object(r.useState)({analytics:!0,personalisation:!0,marketing:!0,functional:!0}),h=Object(i.a)(g,2),k=h[0],C=h[1],O=function(e){C((function(n){return Object(o.a)(Object(o.a)({},n),{},Object(a.a)({},e,!n[e]))}))};return Object(r.useEffect)((function(){s()}),[s]),u(c.a,c.a.Fragment,null,u(c.a,"div",{className:"CookieConsent"},u(c.a,"div",{className:"CookieConsent-Content"},u(c.a,"p",{className:"CookieConsent-Text"},e("Allow cookies to enhance your shopping experience on AIVI."),u(c.a,"br",null),u(c.a,l.a,{className:"CookieConsent-Link",to:"/cookies-policy"},e("Read our Cookies Policy")))),u(c.a,"div",{className:"CookieConsent-Actions"},u(c.a,"button",{type:"button",className:"CookieConsent-Button CookieConsent-Button--primary",onClick:t},e("Accept all")),u(c.a,"button",{type:"button",className:"CookieConsent-Button CookieConsent-Button--secondary",onClick:function(){d(),p(!0)}},e("Manage preferences")))),m&&u(c.a,"div",{className:"CookieCustomizeModal"},u(c.a,"div",{className:"CookieCustomizeModal-Overlay",onClick:function(){return p(!1)}}),u(c.a,"div",{className:"CookieCustomizeModal-Content"},u(c.a,"button",{type:"button",className:"CookieCustomizeModal-Close",onClick:function(){return p(!1)}},"\xd7"),u(c.a,"h2",{className:"CookieCustomizeModal-Title"},e("Customize your cookie preferences")),u(c.a,"div",{className:"CookieCustomizeModal-Section"},u(c.a,"h3",{className:"CookieCustomizeModal-Heading"},e("Essential")),u(c.a,"label",{className:"CookieCustomizeModal-Option CookieCustomizeModal-Option--disabled"},u(c.a,"input",{type:"checkbox",checked:!0,disabled:!0}),u(c.a,"div",null,u(c.a,"div",{className:"CookieCustomizeModal-OptionTitle"},e("Strictly Necessary Cookies")),u(c.a,"div",{className:"CookieCustomizeModal-OptionText"},e("Required for core website functionality."))))),u(c.a,"div",{className:"CookieCustomizeModal-Section"},u(c.a,"h3",{className:"CookieCustomizeModal-Heading"},e("Optional")),u(c.a,"label",{className:"CookieCustomizeModal-Option"},u(c.a,"input",{type:"checkbox",checked:k.analytics,onChange:function(){return O("analytics")}}),u(c.a,"div",null,u(c.a,"div",{className:"CookieCustomizeModal-OptionTitle"},e("Performance & Analytics Cookies")),u(c.a,"div",{className:"CookieCustomizeModal-OptionText"},e("Help us measure and improve website performance.")))),u(c.a,"label",{className:"CookieCustomizeModal-Option"},u(c.a,"input",{type:"checkbox",checked:k.marketing,onChange:function(){return O("marketing")}}),u(c.a,"div",null,u(c.a,"div",{className:"CookieCustomizeModal-OptionTitle"},e("Marketing & Advertising")),u(c.a,"div",{className:"CookieCustomizeModal-OptionText"},e("Retargeting and audience creation.")))),u(c.a,"label",{className:"CookieCustomizeModal-Option"},u(c.a,"input",{type:"checkbox",checked:k.functional,onChange:function(){return O("functional")}}),u(c.a,"div",null,u(c.a,"div",{className:"CookieCustomizeModal-OptionTitle"},e("Functionality Cookies")),u(c.a,"div",{className:"CookieCustomizeModal-OptionText"},e("Remember your preferences and settings."))))),u(c.a,"div",{className:"CookieCustomizeModal-Footer"},u(c.a,"p",{className:"CookieConsent-Text"},e("Allow cookies to enhance your shopping experience"),u(c.a,"br",null),u(c.a,l.a,{className:"CookieConsent-Link",to:"/cookies-policy",onClick:function(){return p(!1)}},e("Read our Cookies Policy"))),u(c.a,"button",{type:"button",className:"CookieCustomizeModal-Save",onClick:function(){f(k),p(!1)}},e("Save preferences"))))))}}).call(this,t(28))},2529:function(e,n,t){},2530:function(e,n,t){"use strict";(function(e,a){t.d(n,"a",(function(){return f}));var o=t(10),i=t(0),r=t(16),c=t(2531),l=t(1422),u=t(2538),s=t(11),d=t(15).checkBEMProps;function f(){var n=Object(r.d)((function(e){var n;return null===(n=e.MyAccountReducer)||void 0===n?void 0:n.customer})),t=Object(i.useState)(null),f=Object(o.a)(t,2),v=f[0],b=f[1];return d(e,"div",{block:"ADDTransaction",mods:{isArabic:Object(s.h)()}},d(e,l.a,{title:a("Add Transaction")}),d(e,"hr",{className:"points-card__headerDivider botton_divider"}),d(e,"div",{block:"ADDTransaction",elem:"Container"},v?d(e,c.a,{transactionNumber:v,customer:n}):d(e,u.a,{onScan:function(e){return b(e)},onError:function(e){return console.log("Scanner fatal error:",e)},onPermissionChange:function(e){return setCamPermission(e)},fps:12,qrbox:{width:280,height:280}})))}}).call(this,t(0),t(28))},2531:function(e,n,t){"use strict";var a=t(2134);t.d(n,"a",(function(){return a.a}))},2532:function(e,n,t){"use strict";(function(e,a){t.d(n,"a",(function(){return S}));var o=t(2),i=t(20),r=t(10),c=t(5),l=t.n(c),u=t(83),s=t(12),d=t(0),f=t(40),v=t(214),b=t(2533),m=t.n(b),p=(t(2135),t(2534)),g=(t(2536),t(203)),h=t(147),k=t(85),C=t(2537),O=t(1),j=t(115),y=function(){var e=Object(s.a)(l.a.mark((function e(){var n,t,a,o,i,r,c,s,d,f,b,m,p,g;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((window.isSecureContext||["localhost","127.0.0.1"].includes(window.location.hostname))&&(null===(n=navigator.mediaDevices)||void 0===n?void 0:n.getUserMedia)){e.next=3;break}return e.abrupt("return",!0);case 3:return e.prev=3,e.next=6,navigator.mediaDevices.enumerateDevices();case 6:a=e.sent,o=a.filter((function(e){return"videoinput"===e.kind})),i=Object(u.a)(o),e.prev=9,i.s();case 11:if((r=i.n()).done){e.next=19;break}if(c=r.value.label,s=void 0===c?"":c,!v.a.test(s)){e.next=15;break}return e.abrupt("return",!0);case 15:if(!v.b.test(s)){e.next=17;break}return e.abrupt("return",!1);case 17:e.next=11;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(9),i.e(e.t0);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.next=29,navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1});case 29:if(d=e.sent,f=d.getVideoTracks()[0],b=(null===(t=f.getCapabilities)||void 0===t?void 0:t.call(f))||{},m=b.facingMode,p=void 0===m?[]:m,g=f.label||"",d.getTracks().forEach((function(e){return e.stop()})),!v.b.test(g)){e.next=36;break}return e.abrupt("return",!1);case 36:if(!v.a.test(g)){e.next=38;break}return e.abrupt("return",!0);case 38:return e.abrupt("return",p.includes("environment")&&p.includes("user"));case 41:return e.prev=41,e.t1=e.catch(3),console.error("shouldUseNativeCamera failed:",e.t1),e.abrupt("return",!1);case 45:case"end":return e.stop()}}),e,null,[[3,41],[9,21,24,27]])})));return function(){return e.apply(this,arguments)}}(),w=t(15).checkBEMProps;function S(n){var t=n.transactionNumber,c=n.showNotification,b=n.setCaPopUpState,S=n.customer,B=Object(d.useState)([]),_=Object(r.a)(B,2),x=_[0],M=_[1],N=Object(d.useState)(!1),P=Object(r.a)(N,2),E=P[0],T=P[1],D=Object(d.useState)(!1),I=Object(r.a)(D,2),L=I[0],A=I[1],U=Object(d.useRef)(null),R=Object(d.useMemo)((function(){return Math.max(0,6-x.length)}),[x.length]),F=Object(d.useCallback)((function(e,n){M((function(t){if(t.length>=6)return t;var a=n||"assurance_".concat(t.length+1,".jpg");return[].concat(Object(i.a)(t),[{add_transaction_url_file:e,add_transaction_url_file_name:a}])})),T(!1)}),[]),V=Object(d.useCallback)(Object(s.a)(l.a.mark((function e(){var n,t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(x.length>=6)){e.next=2;break}return e.abrupt("return");case 2:if(!Object(v.i)()){e.next=5;break}return null===(n=U.current)||void 0===n||n.click(),e.abrupt("return");case 5:return e.next=7,y();case 7:if(!e.sent){e.next=10;break}return null===(t=U.current)||void 0===t||t.click(),e.abrupt("return");case 10:T(!0);case 11:case"end":return e.stop()}}),e)}))),[x.length]),z=Object(d.useCallback)((function(e){M((function(n){return n.filter((function(n,t){return t!==e}))}))}),[]),W=Object(d.useCallback)(Object(s.a)(l.a.mark((function n(){var a,i,r,s,d,m,p,g,k,C,y,w,B,_,M,N,P,E;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(x.length&&!L){n.next=2;break}return n.abrupt("return");case 2:A(!0),n.prev=3,i=[],r=Object(u.a)(x),n.prev=6,r.s();case 8:if((s=r.n()).done){n.next=27;break}if(d=s.value,m=d.add_transaction_url_file,p=d.add_transaction_url_file_name,m&&p){n.next=13;break}return n.abrupt("continue",25);case 13:return n.next=15,Object(h.f)(p);case 15:if(g=n.sent,k=(null===g||void 0===g?void 0:g.data)||{},C=k.image_url,(y=k.upload_url)&&C){n.next=19;break}throw new Error(e("Presigned URL response missing upload_url/image_url"));case 19:return n.next=21,fetch(y,{method:"PUT",headers:{"Content-Type":""},body:Object(v.c)(m)});case 21:if((w=n.sent).ok){n.next=24;break}throw new Error(e("Image upload failed (%s)",w.status));case 24:i.push(Object(o.a)(Object(o.a)({},d),{},{add_transaction_url:C}));case 25:n.next=8;break;case 27:n.next=32;break;case 29:n.prev=29,n.t0=n.catch(6),r.e(n.t0);case 32:return n.prev=32,r.f(),n.finish(32);case 35:return B={transaction_data:Object(o.a)({TransactionNumber:t,ReceiptURL:(null===i||void 0===i||null===(a=i[0])||void 0===a?void 0:a.add_transaction_url)||""},Object.fromEntries(i.slice(1,6).map((function(e,n){return["TRANS_RECEIPT".concat(n+1),(null===e||void 0===e?void 0:e.add_transaction_url)||""]}))))},n.next=38,Object(h.C)(B);case 38:if(null===(_=n.sent)||void 0===_?void 0:_.success){n.next=43;break}return M="string"===typeof _?_:(null===_||void 0===_?void 0:_.message)||(null===_||void 0===_?void 0:_.error)||e("Failed to upload the image. Please try again."),c("error",M),n.abrupt("return");case 43:O.nj.dispatch(O.Tb,{super_section_type:"CA",transaction_number:t}),N=Object(j.d)({customer:S}),Object(O.Ni)(O.Fe,Object(o.a)({transaction_number:t},N)),b({transactionSuccess:!0}),setTimeout((function(){return b({})}),5e3),f.a.push({pathname:"/club-apparel/my-rewards"}),n.next=55;break;case 51:n.prev=51,n.t1=n.catch(3),console.error("Submit failed:",n.t1),c("error",(null===n.t1||void 0===n.t1||null===(P=n.t1.response)||void 0===P||null===(E=P.data)||void 0===E?void 0:E.message)||(null===n.t1||void 0===n.t1?void 0:n.t1.message)||e("Failed to upload the image. Please try again."));case 55:return n.prev=55,A(!1),n.finish(55);case 58:case"end":return n.stop()}}),n,null,[[3,51,55,58],[6,29,32,35]])}))),[x,L,t,c,b]);return E?w(a,p.a,{handleUpload:F,onClose:function(){return T(!1)}}):w(a,a.Fragment,null,w(a,"input",{ref:U,type:"file",accept:"image/*",capture:"environment",onChange:function(e){var n,t=null===(n=e.target.files)||void 0===n?void 0:n[0];if(t){var a=new FileReader;a.onload=function(){return F(a.result,t.name)},a.readAsDataURL(t)}},style:{display:"none"}}),w(a,"p",{block:"ImageUpload",elem:"Subtitle"},e("Upload additional photos if required (Maximum of 6)")),w(a,k.a,{isLoading:L}),w(a,"div",{block:"ImageUpload",elem:"Container"},x.map((function(e,n){return w(a,C.a,{key:"img-".concat(n),img:e,index:n,onRemove:z})})),Array.from({length:R}).map((function(e,n){return w(a,"div",{key:"empty-".concat(n),block:"ImageUpload",elem:"Box",mods:{filled:!1},onClick:V,role:"button",tabIndex:0,onKeyDown:function(e){return("Enter"===e.key||" "===e.key)&&V()}},w(a,"img",{src:m.a,className:"CameraIcon",alt:"camera"}))}))),w(a,"div",{block:"ImageUpload",elem:"BottomLayer"},w(a,g.a,{classFor:"GradientButtonV2",text:e("Submit"),parentStyle:{width:"100%",marginTop:"unset",marginBottom:0},onClick:W,type:"button",disabled:0===x.length||L})))}}).call(this,t(28),t(0))},2533:function(e,n,t){e.exports=t.p+"static/media/camera-icon.0695b857.svg"},2534:function(e,n,t){"use strict";var a=t(2136);t.d(n,"a",(function(){return a.a}))},2535:function(e,n,t){"use strict";(function(e){var a=t(1376),o=t(15).checkBEMProps;n.a=function(n){var t=n.handleUpload,i=n.onClose;return o(e,a.a,{handleUpload:t,onClose:i})}}).call(this,t(0))},2536:function(e,n,t){},2537:function(e,n,t){"use strict";(function(e){t.d(n,"a",(function(){return r}));var a=t(2135),o=t.n(a),i=t(15).checkBEMProps;function r(n){var t=n.img,a=n.index,r=n.onRemove;return i(e,"div",{block:"ImageUpload",elem:"Box",mods:{filled:!0}},i(e,"img",{src:null===t||void 0===t?void 0:t.add_transaction_url_file,alt:(null===t||void 0===t?void 0:t.add_transaction_url_file_name)||"upload-".concat(a),className:"ImageUpload-Preview"}),i(e,"button",{type:"button",className:"ImageUpload-Trash",onClick:function(){return r(a)},"aria-label":"Remove image"},i(e,"img",{src:o.a,alt:"remove"})))}}).call(this,t(0))},2538:function(e,n,t){"use strict";(function(e){t.d(n,"a",(function(){return p}));var a=t(5),o=t.n(a),i=t(12),r=t(10),c=t(0),l=t.n(c),u=t(2913),s=t(1377),d=t(214),f=t(203),v=(t(2540),t(11)),b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^[\x00-\x7F]+$/.test(e)&&e.length>=4&&e.length<=60},m=t(15).checkBEMProps;function p(n){var t=n.onScan,a=n.onError,p=Object(c.useRef)(null),g=Object(c.useRef)(null),h=Object(c.useRef)(null),k=Object(c.useRef)(!1),C=Object(c.useRef)(!1),O=Object(c.useRef)(!1),j=Object(c.useRef)(!1),y=Object(c.useState)(""),w=Object(r.a)(y,2),S=w[0],B=w[1],_=Object(c.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";k.current&&B(e)}),[]),x=Object(c.useCallback)((function(){try{var e,n;null===(e=h.current)||void 0===e||null===(n=e.stop)||void 0===n||n.call(e)}catch(t){console.error("Error while stopping barcode scanner:",t)}finally{h.current=null}}),[]),M=Object(c.useCallback)((function(){if(g.current)return g.current;var e=new Map;return e.set(s.DecodeHintType.POSSIBLE_FORMATS,[s.BarcodeFormat.CODE_128]),e.set(s.DecodeHintType.TRY_HARDER,!0),g.current=new u.a(e),g.current}),[]),N=Object(c.useCallback)(Object(i.a)(o.a.mark((function n(){var i,r,c,l,s,f,v;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(Object(d.j)()){n.next=5;break}return _(i="Camera needs HTTPS (or localhost) to work."),null===a||void 0===a||a(new Error(i)),n.abrupt("return");case 5:if(p.current){n.next=7;break}return n.abrupt("return");case 7:return x(),_(""),C.current=!1,n.prev=10,n.prev=11,n.next=14,navigator.mediaDevices.getUserMedia({video:!0});case 14:r=n.sent,n.next=25;break;case 17:return n.prev=17,n.t0=n.catch(11),n.next=21,navigator.permissions.query({name:"camera"}).catch((function(){return null}));case 21:return c=n.sent,("NotAllowedError"===(null===n.t0||void 0===n.t0?void 0:n.t0.name)||"PermissionDeniedError"===(null===n.t0||void 0===n.t0?void 0:n.t0.name))&&"denied"===(null===c||void 0===c?void 0:c.state)?(_("PERMANENT_BLOCK"),j.current&&!O.current&&(O.current=!0,alert([e("Camera access is blocked. To enable it:"),"",e("1. Click the lock icon in your browser address bar"),e('2. Find "Camera" and set it to "Allow"'),e("3. Refresh the page and try again")].join("\n")))):_((null===n.t0||void 0===n.t0?void 0:n.t0.message)||String(n.t0)),n.abrupt("return");case 25:return n.prev=25,null===(l=r)||void 0===l||l.getTracks().forEach((function(e){return e.stop()})),j.current=!1,n.finish(25);case 29:return n.next=31,u.a.listVideoInputDevices();case 31:if((s=n.sent).length){n.next=35;break}return _("No camera found on this device."),n.abrupt("return");case 35:return f=s.find((function(e){return/back|rear|environment/i.test(e.label)}))||s[s.length-1],n.next=38,M().decodeFromVideoDevice(f.deviceId,p.current,(function(e,n,a){var o,i;if(h.current=a,e&&!C.current){var r=(null===(o=e.getText)||void 0===o?void 0:o.call(e))||String(e.text||"");b(r)?(C.current=!0,_(""),null===t||void 0===t||t(r),null===a||void 0===a||null===(i=a.stop)||void 0===i||i.call(a)):_("Invalid barcode value")}}));case 38:v=n.sent,h.current=v,n.next=46;break;case 42:n.prev=42,n.t1=n.catch(10),console.error("Scanner error:",n.t1),_((null===n.t1||void 0===n.t1?void 0:n.t1.message)||String(n.t1));case 46:case"end":return n.stop()}}),n,null,[[10,42],[11,17,25,29]])}))),[M,a,t,_,x]),P=Object(c.useCallback)((function(){O.current=!1,j.current=!0,N()}),[N]);Object(c.useEffect)((function(){return k.current=!0,N(),function(){k.current=!1,x(),g.current=null}}),[N,x]);var E="PERMANENT_BLOCK"===S||Object(d.g)(S);return m(l.a,l.a.Fragment,null,m(l.a,"p",{block:"BarcodeScanner",elem:"Subtitle",mods:{isArabic:Object(v.h)()}},e("Please wait 24 hours from the time of purchase to scan your receipt")),m(l.a,"div",{block:"BarcodeScanner",elem:"BarcodeContainer",mods:{isArabic:Object(v.h)()}},m(l.a,"div",{className:"BarcodeUI"},m(l.a,"div",{className:"BarcodeUI__Card"},m(l.a,"div",{className:"BarcodeUI__Corners","aria-hidden":"true"},m(l.a,"span",{className:"BarcodeUI__Corner BarcodeUI__Corner--tl"}),m(l.a,"span",{className:"BarcodeUI__Corner BarcodeUI__Corner--tr"}),m(l.a,"span",{className:"BarcodeUI__Corner BarcodeUI__Corner--bl"}),m(l.a,"span",{className:"BarcodeUI__Corner BarcodeUI__Corner--br"})),m(l.a,"div",{className:"BarcodeUI__Reader"},m(l.a,"video",{ref:p,muted:!0,playsInline:!0,autoPlay:!0}))),S&&!E?m(l.a,"div",{className:"BarcodeUI__Error"},S):null)),m(l.a,"p",{block:"BarcodeScanner",elem:"BarcodeText",mods:{isArabic:Object(v.h)()}},e("Scan your barcode")),E?m(l.a,"div",{block:"BarcodeUI",elem:"Permission_block",mods:{isArabic:Object(v.h)()}},m(l.a,"h4",null,e("Enable Camera Permission")),m(l.a,"div",{block:"BarcodeUI",elem:"Permission_content"},m(l.a,"p",null,e("We need access to your camera to scan codes, upload images, and complete actions smoothly within the app")),m(l.a,f.a,{classFor:"OutlineButtonV2 ResendCode",text:e("Allow Camera"),parentStyle:{width:"90%",marginTop:"unset"},type:"button",onClick:P}))):null)}}).call(this,t(28))},2540:function(e,n,t){},2541:function(e,n,t){},2542:function(e,n,t){"use strict";(function(e){var a=t(2),o=t(10),i=t(0),r=t.n(i),c=(t(2543),t(38)),l=t(30),u=t(85),s=t(316),d=t.n(s),f=t(1),v=t(115),b=t(11),m=t(104),p=t(73),g=t(29),h=t(15).checkBEMProps;n.a=function(n){var t,s=n.title,k=void 0===s?"":s,C=n.bannerImage,O=void 0===C?[]:C,j=(n.logo,n.description),y=void 0===j?"":j,w=n.allowLocation,S=n.stores,B=void 0===S?[]:S,_=n.onAllowLocation,x=void 0===_?function(){}:_,M=n.handleViewMap,N=void 0===M?function(){}:M,P=n.onBack,E=n.loading,T=n.customer,D=n.videoUrl,I=void 0===D?"":D,L=n.gender,A=n.channelType,U=void 0===A?"":A,R=Object(i.useState)(0),F=Object(o.a)(R,2),V=F[0],z=F[1],W=function(e){if(!e)return null;var n=e.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&\n?#]+)/);return n?n[1]:null}(I);return Object(i.useEffect)((function(){if(O&&0!==(null===O||void 0===O?void 0:O.length)){var e=setInterval((function(){z((function(e){return e===(null===O||void 0===O?void 0:O.length)-1?0:e+1}))}),3e3);return function(){return clearInterval(e)}}}),[O]),E?h(r.a,u.a,{isLoading:!0}):h(r.a,"div",{block:"BrandDetails"},h(r.a,"div",{block:"BrandDetails",elem:"Header"},h(r.a,"button",{block:"BrandDetails",elem:"BackButton",mods:{isArabic:Object(b.h)()},onClick:P},Object(b.h)()?h(r.a,c.f,null):h(r.a,c.e,null)),h(r.a,"h2",{block:"BrandDetails",elem:"Title"},k)),h(r.a,"div",{block:"BrandDetails",elem:"Body"},h(r.a,"div",{block:"BrandDetails",elem:"BannerWrapper"},h(r.a,l.a,{block:"BrandDetails",elem:"Banner",src:null!==(t=O[V])&&void 0!==t?t:d.a,alt:"Brand Banner"}),h(r.a,"div",{block:"BrandDetails",elem:"SliderBar"},h(r.a,"div",{block:"BrandDetails",elem:"SliderFill",style:{width:"".concat((V+1)/O.length*100,"%")}}))),h(r.a,"p",{block:"BrandDetails",elem:"Description"},y),W&&h(r.a,"div",{block:"BrandDetails",elem:"VideoWrapper",onClick:function(){return window.open(I,"_blank")}},h(r.a,"img",{block:"BrandDetails",elem:"VideoThumbnail",src:"https://img.youtube.com/vi/".concat(W,"/hqdefault.jpg"),alt:e("Watch video")}),h(r.a,"div",{block:"BrandDetails",elem:"PlayButton"},h(r.a,"svg",{viewBox:"0 0 68 48",width:"48",height:"34"},h(r.a,"path",{d:"M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z",fill:"#f00"}),h(r.a,"path",{d:"M45 24 27 14v20",fill:"#fff"}))))),"Online Shopping"===U?h(r.a,r.a.Fragment,null,h(r.a,"hr",{block:"BrandDetails",elem:"Divider"}),h(r.a,"div",{block:"BrandDetails",elem:"SeeProducts"},h(r.a,"h4",{className:"Heading"},e("Or prefer to shop online?")),h(r.a,"div",{className:"Content"},h(r.a,"p",{className:"ContentLeft"},e("Explore our latest styles and order anytime. View Products")),h(r.a,"div",{className:"ContentRight"},h(r.a,g.a,{to:"/".concat(Object(m.c)(k),".html?q=").concat(encodeURIComponent(k),"&p=0&dFR[brand_name][0]=").concat(encodeURIComponent(k),"&dFR[gender][0]=").concat(Object(m.a)(Object(m.f)(Object(b.h)()?Object(p.c)(L):L)),"&dFR[in_stock][0]=",1,"&prevPage=brands-menu"),block:"BrandLink",className:"BrandLink",onClick:function(){var e=Object(v.d)({customer:T});Object(f.Ni)(f.Oe,Object(a.a)({brand_name:k,page:"brand"},e)),f.nj.dispatch(f.Rb,{super_section_type:"CA"})}},e("See Products")))))):null,h(r.a,"hr",{block:"BrandDetails",elem:"Divider"}),h(r.a,"div",{block:"BrandDetails",elem:"LocationDetails"},h(r.a,"h4",{block:"BrandDetails",elem:"Title"},e("Nearest store locations")),w?h(r.a,"div",{block:"BrandDetails",elem:"StoreList"},null===B||void 0===B?void 0:B.map((function(n,t){return h(r.a,"div",{block:"BrandDetails",elem:"StoreItem",key:t},h(r.a,"div",{block:"BrandDetails",elem:"StoreLeft"},h(r.a,"span",{block:"BrandDetails",elem:"LocationIcon"},h(r.a,c.A,null)),h(r.a,"span",{block:"BrandDetails",elem:"StoreName"},null===n||void 0===n?void 0:n.mall_name),h(r.a,"span",{block:"BrandDetails",elem:"Distance"},"\u2022 ",null===n||void 0===n?void 0:n.distance)),h(r.a,"a",{block:"BrandDetails",elem:"ViewMap",onClick:function(){f.nj.dispatch(f.dc,{super_section_type:"CA",accessed_from:"brand"});var e=Object(v.d)({customer:T});Object(f.Ni)(f.Ke,Object(a.a)({mall_name:null===n||void 0===n?void 0:n.mall_name,brand_name:k,page:"brand"},e)),N(n)}},e("View map")))}))):h(r.a,"div",{block:"BrandDetails",elem:"LocationPrompt"},h(r.a,"p",{block:"BrandDetails",elem:"LocationText"},e("We need to know your location in order to suggest nearby stores")),h(r.a,"button",{block:"BrandDetails",elem:"AllowButton",onClick:x},e("Allow Location")))))}}).call(this,t(28))},2543:function(e,n,t){},2544:function(e,n,t){"use strict";(function(e){var a=t(2),o=t(0),i=t.n(o),r=(t(2545),t(38)),c=t(11),l=t(85),u=t(1),s=t(115),d=t(30),f=(t(316),t(15).checkBEMProps);n.a=function(n){var t=n.mallName,o=n.bannerImage,v=n.address,b=void 0===v?"":v,m=n.brands,p=void 0===m?[]:m,g=n.handleGetDirections,h=void 0===g?function(){}:g,k=n.onBack,C=n.loading,O=n.onBrandClick,j=void 0===O?function(){}:O,y=n.customer,w=(p||[]).flatMap((function(e){return e.brand_list||[]})).sort((function(e,n){var t;return null===e||void 0===e||null===(t=e.brand_name)||void 0===t?void 0:t.localeCompare(null===n||void 0===n?void 0:n.brand_name)})).reduce((function(e,n){var t,a=null===n||void 0===n||null===(t=n.brand_name)||void 0===t?void 0:t.charAt(0).toUpperCase(),o=/^[A-Z]$/.test(a)?a:"#";return e[o]||(e[o]=[]),e[o].push(n),e}),{});return C?f(i.a,l.a,{isLoading:!0}):f(i.a,"div",{block:"MallDetails"},f(i.a,"div",{block:"MallDetails",elem:"Header"},f(i.a,"button",{block:"MallDetails",elem:"BackButton",mods:{isArabic:Object(c.h)()},onClick:k},Object(c.h)()?f(i.a,r.f,null):f(i.a,r.e,null)),f(i.a,"h2",{block:"MallDetails",elem:"Title"},t)),f(i.a,"div",{block:"MallDetails",elem:"Mall"},f(i.a,d.a,{block:"MallDetails",elem:"MallImage",src:o,alt:t}),f(i.a,"h3",{block:"MallDetails",elem:"MallTitle"},t)),f(i.a,"div",{block:"MallDetails",elem:"LocationRow"},f(i.a,"span",{block:"MallDetails",elem:"LocationIcon"},f(i.a,r.A,null)),f(i.a,"span",{block:"MallDetails",elem:"Address"},b)),f(i.a,"button",{block:"MallDetails",elem:"DirectionsButton",onClick:function(e){u.nj.dispatch(u.dc,{super_section_type:"CA",accessed_from:"mall"});var n=Object(s.d)({customer:y});Object(u.Ni)(u.Ke,Object(a.a)({mall_name:t,page:"mall"},n)),h(e)}},e("Get Directions")),f(i.a,"hr",{block:"MallDetails",elem:"Divider"}),f(i.a,"div",{block:"MallDetails",elem:"BrandSection"},Object.keys(w).sort((function(e,n){return"#"===e?1:"#"===n?-1:e.localeCompare(n)})).map((function(e){return f(i.a,"div",{key:e},f(i.a,"h4",{block:"MallDetails",elem:"AlphabetTitle"},e),w[e].map((function(e,n){return f(i.a,"button",{block:"MallDetails",elem:"BrandItem",key:n,onClick:function(){var n=Object(s.d)({customer:y});Object(u.Ni)(u.He,Object(a.a)({brand_name:null===e||void 0===e?void 0:e.brand_name},n)),j(e)}},f(i.a,"div",{block:"MallDetails",elem:"BrandLogoBoxWrapper"},f(i.a,d.a,{block:"MallDetails",elem:"BrandLogoBox",src:null===e||void 0===e?void 0:e.brand_logo,alt:null===e||void 0===e?void 0:e.brand_name})),f(i.a,"span",{block:"MallDetails",elem:"BrandName"},null===e||void 0===e?void 0:e.brand_name))})))}))))}}).call(this,t(28))},2545:function(e,n,t){},2949:function(e,n,t){"use strict";t.r(n);var a=t(2133);t.d(n,"default",(function(){return a.a}))},2950:function(e,n,t){"use strict";t.r(n),function(e){var a=t(5),o=t.n(a),i=t(12),r=t(10),c=t(0),l=t.n(c),u=t(2542),s=t(16),d=(t(23),t(37)),f=t(40),v=t(147),b=t(44),m=t(15).checkBEMProps;n.default=function(){var n,t,a,p,g,h,k,C,O=Object(s.d)((function(e){var n;return null===(n=e.MyAccountReducer)||void 0===n?void 0:n.customer})),j=Object(c.useState)(!1),y=Object(r.a)(j,2),w=y[0],S=y[1],B=Object(c.useState)([]),_=Object(r.a)(B,2),x=_[0],M=_[1],N=Object(c.useState)(""),P=Object(r.a)(N,2),E=P[0],T=P[1],D=Object(c.useState)({}),I=Object(r.a)(D,2),L=I[0],A=I[1],U=Object(c.useState)(!0),R=Object(r.a)(U,2),F=R[0],V=R[1],z=Object(d.i)().id;Object(c.useEffect)((function(){(function(){var e=Object(i.a)(o.a.mark((function e(){var n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(v.j)({id:z});case 3:n=e.sent,A(null===n||void 0===n?void 0:n.data),V(!1),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),b.a.error("Error fetching brand details:",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}})()()}),[z]);var W=function(){var e;(null===(e=navigator)||void 0===e?void 0:e.geolocation)?(T(""),navigator.geolocation.getCurrentPosition(function(){var e=Object(i.a)(o.a.mark((function e(n){var t,a,i,r,c;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.coords,i=a.latitude,r=a.longitude,S(!0),T(""),e.next=5,Object(v.j)({id:z,latitude:i,longitude:r});case 5:c=e.sent,M(null===c||void 0===c||null===(t=c.data)||void 0===t?void 0:t.mall);case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),(function(e){1===e.code?T("location_blocked"):T("location_error"),b.a.error(e)}))):T("Geolocation is not supported by your browser.")};Object(c.useEffect)((function(){W()}),[z]);return m(l.a,l.a.Fragment,null,m(l.a,u.a,{title:null===L||void 0===L||null===(n=L.brand)||void 0===n?void 0:n.name,bannerImage:(null===L||void 0===L||null===(t=L.brand)||void 0===t?void 0:t.banners)||[],logo:null===L||void 0===L||null===(a=L.brand)||void 0===a?void 0:a.logo,description:null===L||void 0===L||null===(p=L.brand)||void 0===p?void 0:p.description,allowLocation:w,stores:x||[],onAllowLocation:W,handleViewMap:function(e){var n=null===e||void 0===e?void 0:e.latitude,t=null===e||void 0===e?void 0:e.longitude,a="https://www.google.com/maps/dir/?api=1&destination=".concat(n,",").concat(t);window.open(a,"_blank")},onBack:function(){return f.a.goBack()},loading:F,customer:O,videoUrl:(null===L||void 0===L||null===(g=L.brand)||void 0===g||null===(h=g.newbanners)||void 0===h||null===(k=h.find((function(e){return"video"===e.type})))||void 0===k?void 0:k.url)||"",channelType:null===L||void 0===L||null===(C=L.brand)||void 0===C?void 0:C.channel_type}),E&&m(l.a,"p",{style:{color:"red",textAlign:"center",marginTop:"12px",fontSize:"13px"}},e("location_blocked"===E?"Location access is disabled. Please enable it in your browser settings.":"Unable to fetch location.")))}}.call(this,t(28))},2951:function(e,n,t){"use strict";t.r(n);var a=t(5),o=t.n(a),i=t(12),r=t(10),c=t(0),l=t.n(c),u=t(2544),s=t(16),d=t(37),f=t(40),v=t(147),b=t(44),m=t(15).checkBEMProps;n.default=function(){var e,n,t,a,p,g=Object(s.d)((function(e){var n;return null===(n=e.MyAccountReducer)||void 0===n?void 0:n.customer})),h=Object(c.useState)({}),k=Object(r.a)(h,2),C=k[0],O=k[1],j=Object(c.useState)(!0),y=Object(r.a)(j,2),w=y[0],S=y[1],B=Object(d.i)().id;Object(c.useEffect)((function(){(function(){var e=Object(i.a)(o.a.mark((function e(){var n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(v.q)({id:B});case 3:n=e.sent,O(null===n||void 0===n?void 0:n.data),S(!1),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),b.a.error("Error fetching mall details:",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}})()()}),[B]);var _=[(null===C||void 0===C||null===(e=C.mallDetails)||void 0===e?void 0:e.city)||"",(null===C||void 0===C||null===(n=C.mallDetails)||void 0===n?void 0:n.country)||""].filter(Boolean).join(", ")||(null===C||void 0===C||null===(t=C.mallDetails)||void 0===t?void 0:t.address)||"";return m(l.a,"div",null,m(l.a,u.a,{mallName:null===C||void 0===C||null===(a=C.mallDetails)||void 0===a?void 0:a.name,bannerImage:null===C||void 0===C||null===(p=C.mallDetails)||void 0===p?void 0:p.banner,address:_,brands:null===C||void 0===C?void 0:C.brands,handleGetDirections:function(){var e,n,t=null===C||void 0===C||null===(e=C.mallDetails)||void 0===e?void 0:e.latitude,a=null===C||void 0===C||null===(n=C.mallDetails)||void 0===n?void 0:n.longitude,o="https://www.google.com/maps/dir/?api=1&destination=".concat(t,",").concat(a);window.open(o,"_blank")},onBack:function(){return f.a.goBack()},loading:w,onBrandClick:function(e){var n,t=(null===e||void 0===e?void 0:e.store_id)||(null===e||void 0===e?void 0:e.id),a=null===C||void 0===C||null===(n=C.mallDetails)||void 0===n?void 0:n.id;t&&f.a.push("/mall/store/".concat(t,"/details?mallId=").concat(a))},customer:g}))}},2955:function(e,n,t){"use strict";t.r(n),t.d(n,"default",(function(){return b}));var a=t(10),o=t(0),i=t.n(o),r=t(16),c=t(2518),l=t(98),u=t(2130),s=t(2131),d=t(2132),f=Promise.resolve().then(t.bind(null,36)),v=t(15).checkBEMProps;var b=Object(r.b)((function(e){return{config:e.AppConfig.config,language:e.AppState.language,country:e.AppState.country}}),(function(e){return{setCaPopUpState:function(n){return f.then((function(t){return t.default.setCaPopUpState(e,n)}))}}}))((function(e){var n=e.country,t=e.setCaPopUpState,r=e.language,f=e.config,b={selectCountry:{name:"selectCountry",Component:u.a},onBoardingSignIn:{name:"onBoardingSignIn",Component:s.a},BrandsInfo:{name:"BrandsInfo",Component:d.a}},m=e.redirectTo,p=void 0===m?"onBoardingSignIn":m,g=Object(o.useState)(p),h=Object(a.a)(g,2),k=h[0],C=h[1],O=Object(o.useState)(!1),j=Object(a.a)(O,2),y=j[0],w=j[1],S=Object(o.useMemo)((function(){var e,t,a,o=null!==(e=null===n||void 0===n?void 0:n.toUpperCase())&&void 0!==e?e:"AE",i=null===f||void 0===f||null===(t=f.countries)||void 0===t?void 0:t[o],c=(null===i||void 0===i||null===(a=i.aivi_onboarding_data)||void 0===a?void 0:a[r])||{};return{background:(null===c||void 0===c?void 0:c.aiviWelcome)||"",logo:(null===c||void 0===c?void 0:c.aiviLogo)||""}}),[n,f,r]),B=Object(o.useState)(!1),_=Object(a.a)(B,2),x=_[0],M=_[1],N=Object(o.useState)(null),P=Object(a.a)(N,2),E=P[0],T=P[1],D=function(e){C(e)},I=function(e){M(e)},L=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;T((function(){return n}));var a="onBoarding";t({redirectTo:e,prevScreen:a}),I(!0)};return v(i.a,i.a.Fragment,null,x?v(i.a,l.a,{closePopup:function(){if("function"===typeof E)return E(),void T(null);M(!1)},isPopup:!0,handleRedirect:L,handlePageChange:D}):v(i.a,c.a,Object.assign({},e,{isLoading:y,handleLoading:function(e){w(e)},imgConfig:S,handleModal:I,handleRedirect:L,screen:b,current:k,handlePageChange:D})))}))},2957:function(e,n,t){"use strict";t.r(n),t.d(n,"default",(function(){return b}));var a=t(2),o=t(10),i=t(0),r=t.n(i),c=t(16),l=t(24),u=t(1),s=t(2528),d={essential:!0,analytics:!0,personalisation:!0,marketing:!0,functional:!0},f={analytics:["CLID","JSESSIONID","_clck","_clsk","_ga*","_hjSession*","moe_*","xxx111otrckid"],personalisation:[],marketing:["ANONCHK","DV","MR","MUID","NID","SM","SRM_B","UULE","__rtbh.lid","_gcl_au","_pin_unauth","_pinterest_ct_ua","_scid","_scid_r","_tt_enable_cookie","_ttp","audit","audit_p","c","dt","khaos*","receive-cookie-deprecation","rtbh","t_gid","t_pt_gid","th_capi*","ts","ttcsid*","udmts"],functional:["__Secure-STRP","shmail","shphone","terms_shown*"]},v=t(15).checkBEMProps,b=Object(c.b)((function(e){return{useCookiesConsent:e.AppConfig.useCookiesConsent}}))((function(e){var n=e.useCookiesConsent,t=Object(i.useState)(null),c=Object(o.a)(t,2),b=c[0],m=c[1],p=n,g=Object(i.useCallback)((function(e){u.nj.dispatch(e)}),[]),h=Object(i.useCallback)((function(e){if("undefined"!==typeof document&&"undefined"!==typeof window){var n=e.endsWith("*")?document.cookie.split(";").map((function(e){return e.trim().split("=")[0]})).filter((function(n){return n.startsWith(e.slice(0,-1))})):[e],t=window.location.hostname.split("."),a=new Set(["",window.location.hostname]);t.slice(0,-1).forEach((function(e,n){a.add(".".concat(t.slice(n).join(".")))})),n.forEach((function(e){a.forEach((function(n){document.cookie="".concat(e,"=; Max-Age=0; path=/").concat(n?"; domain=".concat(n):"")}))}))}}),[]),k=Object(i.useCallback)((function(e){"undefined"===typeof window||"function"!==typeof window.scheduleDisabledCookieCleanup?Object.keys(f).forEach((function(n){e[n]||f[n].forEach(h)})):window.scheduleDisabledCookieCleanup(e)}),[h]),C=Object(i.useCallback)((function(e){"undefined"!==typeof window&&"function"===typeof window.setCookiePreferences&&window.setCookiePreferences(e),"undefined"!==typeof window&&"function"===typeof window.updateGTMConsent&&window.updateGTMConsent(e),"undefined"!==typeof window&&"function"===typeof window.loadGTM&&window.loadGTM(),"undefined"!==typeof window&&e.analytics&&"function"===typeof window.loadVWO&&window.loadVWO(),"undefined"!==typeof window&&e.analytics&&"function"===typeof window.loadClarity&&window.loadClarity(),"undefined"!==typeof window&&e.marketing&&"function"===typeof window.loadFacebookSDK&&window.loadFacebookSDK()}),[]),O=Object(i.useCallback)((function(){Object(l.jb)("acceptCookies","true"),Object(l.jb)("cookiePreferences",JSON.stringify(d)),m("true"),C(d),g(u.oc)}),[g,C]),j=Object(i.useCallback)((function(){g(u.pc)}),[g]),y=Object(i.useCallback)((function(){g(u.qc)}),[g]),w=Object(i.useCallback)((function(e){var n=Object(a.a)({essential:!0},e);Object(l.jb)("acceptCookies","true"),Object(l.jb)("cookiePreferences",JSON.stringify(n)),m("true"),k(n),C(n)}),[k,C]);return Object(i.useEffect)((function(){"undefined"!==typeof window&&(window.useCookiesConsent=p),p?m(Object(l.S)("acceptCookies")):C(d)}),[p,C]),p&&!b?v(r.a,s.a,{onAccept:O,onPopupViewed:j,onPreferencesOpened:y,onSavePreferences:w}):null}))}}]);