whatmore-react-assets 1.0.1663 → 1.0.1665
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[933,939],{2209:function(t,e,n){var i=n(4994);e.A=void 0;var o=i(n(9526)),r=n(4414);e.A=(0,o.default)((0,r.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel")},3852:function(t,e,n){n.d(e,{A:function(){return y}});var i=n(3247),o=n(1422),r=n(3731),a=n(211),l=n(9950),s=n(932),d=n(5242),c=n(8781),h=n(8283);const p=h.i7`
|
|
2
|
+
0% {
|
|
3
|
+
transform: scale(1);
|
|
4
|
+
}
|
|
5
|
+
100% {
|
|
6
|
+
transform: scale(1.05);
|
|
7
|
+
}
|
|
8
|
+
`,u=h.i7`
|
|
9
|
+
0% {
|
|
10
|
+
transform: scale(1.05);
|
|
11
|
+
}
|
|
12
|
+
100% {
|
|
13
|
+
transform: scale(1);
|
|
14
|
+
}
|
|
15
|
+
`,m=`\n ${p}; \n infinite;\n animation-duration:0.2s; \n animation-direction: linear ;\n animation-timing-function: ease-in;\n animation-fill-mode: forwards;\n`,x=`\n ${u}; \n infinite;\n animation-duration:0.2s; \n animation-direction: linear ;\n animation-timing-function: ease-in;\n animation-fill-mode: forwards;\n`;var f=n(5830),g=n(7509),v=n(4414);var y=function(t){var e,n,[h,p]=(0,s.A)();const[u]=(0,f.QN)("whatmorePrimaryFont");var y=(0,l.useContext)(g.h);const w=t.event,j=t.onClick,b=null===(e=t.isOnFocus)||void 0===e||e,C=(t.playOnUnfocus,null!==(n=t.animateOnFocus)&&void 0!==n&&n);return(0,v.jsxs)(i.az,{animation:C?b?m:x:"none",marginTop:y.tileTopMargin,marginBottom:y.tileBottomMMargin,marginLeft:y.tileLeftMargin,marginRight:y.tileRightMargin,width:p,height:h,borderRadius:"lg",sx:{boxShadow:"0px 0px 10px 3px #B0B0B0"},overflow:"hidden",onClick:()=>{j(w)},cursor:"pointer",children:[(0,v.jsx)(a._,{width:"full",height:"full",src:w.thumbnail_image,objectFit:"cover",fallback:(0,v.jsx)(c.A,{width:p,height:h}),borderRadius:"lg"}),(0,v.jsx)(i.az,{style:{position:"relative",zIndex:1,bottom:"100%",overflow:"hidden"},width:"full",height:"full",borderRadius:"lg",overflow:"hidden",className:"whatmore-ios-css-relative-fix",children:(0,v.jsxs)(o.B,{direction:"column",height:"full",width:"full",justifyContent:"space-between",children:[(0,v.jsx)(i.az,{w:"100%",borderRadius:"lg",bgGradient:"linear(to-t, transparent, blackAlpha.200, blackAlpha.400, blackAlpha.600)",children:(0,v.jsx)(o.B,{direction:"column",justifyContent:"flex-start",children:(0,v.jsx)(i.az,{width:"100%",marginLeft:"5px",marginRight:"5px",marginTop:"10px",children:(0,v.jsx)(o.B,{direction:"row",justifyContent:"space-between",children:(0,v.jsx)(d.A,{event:w,fontSize:.05*h+"px",maxWidth:.8*p})})})})}),(0,v.jsx)(i.az,{w:"100%",borderRadius:"lg",bgGradient:"linear(to-b, transparent, blackAlpha.300, blackAlpha.400, blackAlpha.500, blackAlpha.600)",children:(0,v.jsx)(o.B,{direction:"column",width:"full",height:"full",justifyContent:"flex-end",alignContent:"center",children:(0,v.jsx)(i.az,{width:"full",borderRadius:"lg",children:(0,v.jsxs)(o.B,{direction:"column",justifyContent:"space-between",alignContent:"flex-start",marginLeft:"5px",marginRight:"5px",marginBottom:"2px",children:[(0,v.jsx)(r.E,{color:"white",fontSize:.08*p+"px",fontWeight:"normal",align:"left",children:" "}),(0,v.jsx)(r.E,{fontSize:.08*p+"px",fontWeight:"normal",align:"left",sx:{fontFamily:u+" !important",color:"white !important"},children:w.title.substring(0,40)}),(0,v.jsx)(r.E,{fontSize:.08*p+"px",fontWeight:"bold",align:"left",sx:{fontFamily:u+" !important",color:"white !important"},children:w.presenter_name.substring(0,15)})]})})})})]})})]})}},4826:function(){},5727:function(t,e,n){var i=n(4994);e.A=void 0;var o=i(n(9526)),r=n(4414);e.A=(0,o.default)((0,r.jsx)("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69L9.54 5.98C8.87 5.55 8 6.03 8 6.82"}),"PlayArrowRounded")},6989:function(t,e,n){n.r(e),n.d(e,{default:function(){return U}});var i=n(9950),o=n(3852),r=n(340),a=n(5089),l=(n(3997),n(9733),n(4365),n(572)),s=n(8603),d=n(6086),c=n(3731),h=n(1941),p=n(5830),u=n(7509),m=n(1348),x=n(5551),f=n(1422),g=n(932),v=n(6649),y=n(4414);function w(t){var e;const[n,i,o]=(0,v.A)({triggerOnce:!1}),r=null!==(e=t.defaultHeight)&&void 0!==e?e:"fit-content";return(0,y.jsx)(f.B,{ref:n,direction:"row",minHeight:r,height:r,width:"100%",justifyContent:"center",alignItems:"center",children:i?t.data.map(((e,n)=>(0,y.jsx)("div",{children:t.renderElement({eventData:e})},"key"+n))):(0,y.jsx)("div",{style:{minHeight:{rowHeight:r},minWidth:"100%"}})})}function j(t){var e;const[n,i,o]=(0,g.A)(),r=null!==(e=t.elementsPerRow)&&void 0!==e?e:Math.floor(Math.min(o,t.dataList.length)),a=function(t,e){var n=[];const i=e;for(let o=0;o<t.length;o+=i){const e=t.slice(o,o+i);n.push(e)}return n}(t.dataList,r);return(0,y.jsx)(f.B,{direction:"column",height:"100%",width:"100%",justifyContent:"flex-start",alignItems:"center",spacing:.2*n,children:a.map(((e,o)=>(0,y.jsx)(w,{renderElement:t.renderElement,data:e,defaultHeight:n,defaultWidth:i},"key-"+o)))})}var b=n(2039),C=(n(4826),n(9879)),k=n(3590),A=n(8538),F=n(6594),P=n(7973),S=n(8149),R=n(7740),M=n(22);var I=function(t){var e,n,o,r,[a,l,s,d,c]=(0,g.A)();const h="portrait"===c[M.dl],[u,x]=(0,i.useState)(0),[f,v]=(0,i.useState)(t.event),[w]=(0,p.QN)("whatmoreShopId"),j=(0,p.QN)("whatmoreUITheme"),[b]=(0,p.QN)("whatmorePrimaryFont"),[C]=(0,p.QN)("whatmoreSecondaryColorShade900"),k=f.products.length,[I,z]=(0,i.useState)(),[N,O]=(0,i.useState)(!1);if(0==k)return(0,y.jsx)(y.Fragment,{});(0,i.useEffect)((()=>{const t=setInterval((()=>{x((t=>(t+1)%k))}),3e3);return()=>{clearInterval(t)}}),[]),(0,i.useEffect)((()=>{(0,m.w4b)(w)?(0,F.fu)(f,(0,m.NCy)(w),w).then((t=>{v(t),O(!0)})):(async()=>{var t;const e=await(0,S.M)(null===f||void 0===f||null===(t=f.products)||void 0===t?void 0:t[0],(0,m.NCy)(w),w);z(e),O(!0)})()}),[]);const T=(h?1.23*l*(0,m.HWj)(w):1.4*l*(0,m.N_4)(w))+"px",B=(h?1.15*l*(0,m.HWj)(w):1.31*l*(0,m.N_4)(w))+"px",L=(+f.products[u].price).toFixed(),_=(+f.products[u].compare_price).toFixed(),E=.25*l,W=(0,m.zAb)(w);return(0,y.jsxs)("div",{style:{background:"9238315068"===w?"transparent":(0,m.ivR)(w),display:"flex",flexDirection:W?"row":"column",padding:"10px 12px",gap:W?"8px":"6px",borderRadius:"round"==j?"0 0 12px 12px":"0",alignItems:W?"center":"stretch"},children:[(0,y.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"6px",flex:W?"1":"none"},children:[(0,y.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color","black","important"),t.style.setProperty("font-size",T),t.style.setProperty("line-height","120%","important"),t.style.setProperty("font-family",b,"important"),t.style.setProperty("-webkit-line-clamp",1),t.style.setProperty("line-clamp",1,"important"),t.style.setProperty("-webkit-box-orient","vertical","important"),t.style.setProperty("display","-webkit-box","important"),t.style.setProperty("overflow","hidden","important"),t.style.setProperty("text-overflow","ellipsis","important"))},style:{textAlign:"left",fontWeight:"bolder"},children:(0,A.v)(f.products[u].title)}),(0,y.jsxs)("div",{style:{display:"flex",gap:"4px"},children:[N&&(0,y.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color","black","important"),t.style.setProperty("font-size",B),t.style.setProperty("font-family",b,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textAlign:"left",fontWeight:"bold"},children:(0,F.Sb)(parseFloat((0,R.U)()?(null===I||void 0===I?void 0:I.price)/100:null===f||void 0===f||null===(e=f.products)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.price)," ",w,f.products[u].currency)}),!isNaN(_)&&_>L&&N&&(0,y.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color","#808191","important"),t.style.setProperty("font-size",B),t.style.setProperty("font-family",b,"important"),t.style.setProperty("overflow","hidden","important"))},style:{fontWeight:"bold",textDecoration:"line-through"},children:(0,F.Sb)(parseFloat((0,R.U)()?(null===I||void 0===I?void 0:I.compare_at_price)/100:null===f||void 0===f||null===(o=f.products)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.compare_price)," ",w,f.products[u].currency)})]})]}),W&&(0,y.jsx)("img",{ref:t=>{t&&t.style.setProperty("object-fit",(0,m.KZe)(w),"important")},src:(0,P.b)(f.products[u].thumbnail_image,"&width=400&height=400"),style:{width:E,height:E,borderRadius:"round"==j?"5px":"0px",backgroundColor:C,flexShrink:0},alt:"product img"})]})},z=n(6613),N=n(6305),O=n(4833),T=n(1351),B=n(6157),L=n(4533),_=n(9664);function E(t){const[e,n]=(0,g.A)(),[i]=(0,p.QN)("whatmoreShowViews"),o=t.event;return(0,y.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",overflow:"hidden",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"transparent"},className:"whatmore-ios-css-relative-fix",children:(0,y.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",width:"100%",height:"100%",justifyContent:"space-between",alignItems:"center"},children:(0,y.jsx)("div",{style:{width:"100%",backgroundImage:"linear-gradient(to top, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0.3))"},children:(0,y.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"flex-start",alignItems:"center"},children:"show"===i?(0,y.jsx)("div",{style:{width:"100%",marginLeft:"5px",marginRight:"5px",marginTop:"10px"},children:(0,y.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",paddingLeft:"5px",width:"fit-content",height:"fit-content",justifyContent:"space-between",alignItems:"center"},children:(0,y.jsx)(k.A,{event:o,fontSize:.07*n+"px"})})}):(0,y.jsx)(y.Fragment,{})})})})})}var W=function(t){var e,n,o,r,a,l,s=(0,i.useContext)(u.h);const d=(0,p.Xd)("whatmoreUITheme"),c=(0,p.Xd)("whatmoreSecondaryColor"),h=(0,p.Xd)("whatmoreShopId"),[f]=(0,p.QN)("whatmorePrimaryFont");var[w,j,b,k,A]=(0,g.A)();const F="portrait"===A[M.dl],P=t.event,S=t.onClick,R=null===(e=t.isOnFocus)||void 0===e||e,W=null!==(n=t.playOnUnfocus)&&void 0!==n&&n,D=null!==(o=t.animateOnFocus&&(0,m.n5O)(h))&&void 0!==o&&o,[U,Q,H]=(0,v.A)({triggerOnce:!0}),[X,K]=(0,i.useState)(!1),{whatmoreWidgetSourceDetails:V,whatmoreUserInfo:G}=(0,i.useContext)(x.B),Y=null!==(r=null===(a=P.products)||void 0===a?void 0:a.find((t=>"active"==t.product_status)))&&void 0!==r?r:null===(l=P.products)||void 0===l?void 0:l[0],$=Y&&Object.keys(Y).length>0,[Z,q,J,tt,et,nt]=(0,N.A)(0,Y,P),it=.07*j+"px",ot=$&&(0,m.Kr7)(h),rt=t=>{if(t.stopPropagation(),!$)return;const e=V.landingLocationType,n=V.templateType,i=(0,O.Wd)(e)+(0,O.gf)(n)+(null!==P&&void 0!==P&&P.isRelatedEvent?"R":"E")+"_"+(null===P||void 0===P?void 0:P.event_id);(0,L.Ch)(P.event_id,P.products,"homepage","carousel",i,null===P||void 0===P?void 0:P.location,null===G||void 0===G?void 0:G.userType),"init"==Z.state?(et(i,!0),(0,T.kz)({userInteractionType:B.O.PRODUCT_TILE_ATC_CLICKED,widgetSourceDetails:V,event:P,productList:[Y],ctaList:P.cta})):"awaitingVariantSelection"==Z.state&&nt(null,i)};return(0,y.jsxs)("div",{style:{display:"flex",flexDirection:"column",margin:"0 auto"},children:[(0,y.jsxs)("div",{ref:t=>{t&&(t.style.setProperty("margin-top",s.tileTopMargin+"px","important"),t.style.setProperty("margin-bottom","9238315068"===h?"0px":s.tileBottomMMargin+"px","important"))},style:{width:j,height:w,borderRadius:"round"==d?"12px":"0px",borderWidth:"9238315068"===h?0:(0,m.MRv)(h),borderColor:"9238315068"===h?"transparent":"white"==(0,m.Fwt)(h)?c:(0,m.Fwt)(h),overflow:"hidden",cursor:"pointer",position:"relative"},className:D?R?"whatmore-event-tile-scale-out-animation":"whatmore-event-tile-scale-in-animation":"none",onClick:()=>{S(P)},onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),children:[(0,y.jsx)(C.A,{height:"100%",width:"100%",url:P.thumbnail_image,isPlaying:R||W||(0,z.At)(),event:P}),"9238315068"===h&&$&&(X||F)&&(0,y.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:X||F?"rgba(0, 0, 0, 0.75)":"rgba(0, 0, 0, 0.6)",padding:"12px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.3s ease",cursor:"pointer",transform:X||F?"translateY(0)":"translateY(100%)",opacity:X||F?1:0,zIndex:10},onClick:rt,onMouseEnter:t=>{t.target.style.background="rgba(0, 0, 0, 0.85)"},onMouseLeave:t=>{t.target.style.background="rgba(0, 0, 0, 0.75)"},children:(0,y.jsx)("span",{style:{color:"white",fontSize:it,fontFamily:f,fontWeight:"500",textAlign:"center",letterSpacing:"0.5px"},children:"ADD TO CART"})}),(0,y.jsxs)("div",{style:{width:j,height:w},ref:U,children:[(0,y.jsx)(E,{event:P,isOnFocus:R}),"9238315068"!==h&&(0,y.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"200%",overflow:"hidden",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"transparent"},className:"whatmore-ios-css-relative-fix",children:(0,y.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",alignItems:"center",height:"100%",width:"100%"},children:[(0,y.jsx)("div",{className:"whatmore-event-tile-component-fade-in-animation",children:(0,y.jsx)("p",{children:" "})}),(0,y.jsx)("div",{style:{width:"100%"},children:Q&&(0,m.imx)(h)?(0,y.jsx)("div",{className:"whatmore-event-tile-component-fade-in-animation",style:"40273707171"===h?{backgroundColor:"white",borderRadius:"2px",margin:"5px"}:{},children:"40273707171"===h?(0,y.jsx)(_.Ay,{event:P}):(0,y.jsx)(I,{event:P})}):(0,y.jsx)("div",{height:"20px"})})]})})]})]}),"9238315068"===h&&Q&&(0,m.imx)(h)&&(0,y.jsx)("div",{style:{width:j,marginBottom:s.tileBottomMMargin+"px"},className:"whatmore-event-tile-component-fade-in-animation",children:(0,y.jsx)(I,{event:P})}),ot&&(0,y.jsx)("div",{style:{width:j,padding:"15px 0"},children:(0,y.jsx)("button",{style:{backgroundColor:c,color:"white",border:"none",borderRadius:"12px",padding:"8px 8px",fontSize:it,fontFamily:f,fontWeight:"500",cursor:"pointer",textAlign:"center",letterSpacing:"0.5px",transition:"opacity 0.2s ease",width:"100%"},onClick:rt,onMouseEnter:t=>{t.target.style.opacity="0.8"},onMouseLeave:t=>{t.target.style.opacity="1"},children:"ADD TO CART"})})]})};const D=(0,s.A)({key:"whatmore-css-hv"});var U=function(t){var e;const[n,s,f]=(0,h.A)(),[v,w,C]=(0,g.A)(),[k]=(0,p.QN)("whatmoreShopId"),[A]=(0,p.QN)("whatmorePrimaryColor"),[F]=(0,p.QN)("whatmoreTitleFont"),P="portrait"==n?(0,p.Xd)("whatmoreTitleFontSizePortrait"):(0,p.Xd)("whatmoreTitleFontSize"),{whatmoreRootId:S}=(0,i.useContext)(x.B),R=t.events,M=t.onClick,I=null!==(e=(0,m.sa6)(k))&&void 0!==e?e:F;function z(t){M(t)}const N=parseInt(Math.floor(C));return delete a.Ay.styles.global,(0,y.jsx)(l.C,{value:D,children:(0,y.jsx)("div",{className:"whatmore-carousel-events-feed",children:(0,y.jsx)(r.s,{theme:a.Ay,cssVarsRoot:S,resetCSS:!1,children:(0,y.jsxs)(u.h.Provider,{value:{tileTopMargin:3,tileBottomMMargin:3,tileLeftMargin:3,tileRightMargin:3,showPlayButton:!1},children:[t.heading.trim().length>0?(0,y.jsx)(d.o,{paddingBottom:"28px",children:(0,y.jsx)(c.E,{bgColor:A,bgClip:"text",fontSize:P,sx:{fontFamily:I+" !important"},align:"center",children:t.heading})}):(0,y.jsx)(y.Fragment,{}),"landscape"===n?(0,y.jsx)(j,{renderElement:t=>{const e=t.eventData;return(0,y.jsx)("div",{style:{margin:"10px"},children:(0,b.ij)(e)||(0,b.Il)(e)?(0,y.jsx)(W,{isOnFocus:!0,playOnUnfocus:!1,animateOnFocus:!0,event:e,onClick:()=>{z(e)}}):(0,y.jsx)(o.A,{isOnFocus:!0,playOnUnfocus:!1,animateOnFocus:!0,event:e,onClick:()=>{z(e)}})})},dataList:R,elementsPerRow:N}):(0,y.jsx)(j,{renderElement:t=>{const e=t.eventData;return(0,y.jsx)("div",{style:{margin:"10px"},children:(0,y.jsx)(W,{isOnFocus:!0,playOnUnfocus:!1,animateOnFocus:!0,event:e,onClick:()=>{z(e)}})})},dataList:R,elementsPerRow:N})]})})})})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[199],{1351:function(e,t,n){n.d(t,{PG:function(){return s},kz:function(){return c},UM:function(){return u},yP:function(){return v},DG:function(){return d}});var i=n(1348),o=n(3330),l=n(6157);function a(e,t){var n;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;const a=s[e];if(!a)return;const r=a.isActionEnabled(),c=null===o||void 0===o||null===(n=o.meta_actions)||void 0===n?void 0:n[a.customAction];(r||c)&&"function"==typeof fbq&&(async()=>{const n={id:null===t||void 0===t?void 0:t.client_product_id,product_url:null===t||void 0===t?void 0:t.product_link,...e===l.O.VIDEO_PLAYBACK&&{watch_time:i.watch_time,video_duration:i.video_duration}};fbq("trackCustom",a.action,n),c&&setTimeout((()=>{null===c||void 0===c||c.forEach((e=>{fbq("trackCustom",e,n)}))}),500)})()}var r=n(7145);const s={[l.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[l.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[l.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[l.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[l.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[l.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[l.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[l.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function c(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:c,ctaList:d}=e;var u,v,p,m;((0,r.B)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:c,ctaList:d}),t in s)&&(a(t,null!==(u=null===c||void 0===c?void 0:c[1])&&void 0!==u?u:null===c||void 0===c?void 0:c[0],n,l),(0,o.n)({page_type:i.landingLocationType,selection_type:t,video_name:l.event_id,video_percentage:"NA",product_name:null!==(v=null===c||void 0===c||null===(p=c[1])||void 0===p?void 0:p.title)&&void 0!==v?v:null===c||void 0===c||null===(m=c[0])||void 0===m?void 0:m.title}))}function d(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:c,ctaList:d}=e;var u,v,p,m;((0,r.B)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:c,ctaList:d}),t in s)&&(a(t,null!==(u=null===c||void 0===c?void 0:c[1])&&void 0!==u?u:null===c||void 0===c?void 0:c[0],n,l),(0,o.n)({page_type:i.landingLocationType,selection_type:t,video_name:l.event_id,video_percentage:n.video_duration>0?Math.ceil(n.watch_time/n.video_duration*100):"NA",product_name:null!==(v=null===c||void 0===c||null===(p=c[1])||void 0===p?void 0:p.title)&&void 0!==v?v:null===c||void 0===c||null===(m=c[0])||void 0===m?void 0:m.title}))}function u(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:a,ctaList:c}=e;var d,u,v;((0,r.B)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:a,ctaList:c}),t in s)&&(0,o.n)({page_type:i.landingLocationType,selection_type:t,video_name:l.event_id,video_percentage:"NA",product_name:null!==(d=null===a||void 0===a||null===(u=a[1])||void 0===u?void 0:u.title)&&void 0!==d?d:null===a||void 0===a||null===(v=a[0])||void 0===v?void 0:v.title})}function v(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:o,productList:l,ctaList:a}=e;(0,r.B)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:o,productList:l,ctaList:a})}},3350:function(e,t,n){n.r(t),n.d(t,{default:function(){return B}});var i=n(9950),o=n(964),l=n(140),a=n(5830),r=n(1348),s=n(4533),c=n(6613),d=n(1085),u=n(5551),v=n(2039),p=n(4833),m=n(2979),h=n(6157),_=n(8945),g=n(9821),y=n(4414);const S=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(375),n.e(571),n.e(987),n.e(210),n.e(588),n.e(665)]).then(n.bind(n,5213)))),w=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(437),n.e(375),n.e(571),n.e(620),n.e(116)]).then(n.bind(n,7144)))),I=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(879),n.e(571),n.e(987),n.e(180),n.e(423)]).then(n.bind(n,517)))),f=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(879),n.e(571),n.e(987),n.e(180),n.e(412)]).then(n.bind(n,7646)))),E=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(879),n.e(571),n.e(987),n.e(180),n.e(221)]).then(n.bind(n,5451)))),x=i.lazy((()=>Promise.all([n.e(59),n.e(571),n.e(491)]).then(n.bind(n,4295)))),T=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(375),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(544),n.e(620),n.e(474)]).then(n.bind(n,6945)))),O=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(310),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(485)]).then(n.bind(n,9418)))),C=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(131),n.e(571),n.e(987),n.e(676)]).then(n.bind(n,3369)))),b=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(72),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(544),n.e(891)]).then(n.bind(n,7178)))),D=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(691),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(544),n.e(306)]).then(n.bind(n,9406)))),j=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(375),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(588),n.e(933)]).then(n.bind(n,6989)))),L=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(438),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(806)]).then(n.bind(n,3278)))),A=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(879),n.e(571),n.e(987),n.e(1)]).then(n.bind(n,4596)))),P=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(906)]).then(n.bind(n,5647)))),q=i.lazy((()=>n.e(374).then(n.bind(n,5100))));var k=function(e){var t,k;const[W]=(0,a.QN)("isInDesignMode"),[N]=(0,a.QN)("isDemoBrand"),[$]=(0,a.QN)("whatmoreTopBottomPadding"),[G]=(0,a.QN)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:V}=(0,i.useContext)(u.B),[B]=(0,a.QN)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:F}=(0,i.useContext)(u.B),M=(0,a.Xd)("isLandingSharedLink"),z=(0,a.Xd)("whatmoreShareTemplateId"),R=(0,a.Xd)("whatmoreShareStoryId"),H=(0,a.Xd)("whatmoreShareEventId"),{whatmoreWidgetSourceDetails:K,whatmoreUserInfo:J}=(0,i.useContext)(u.B),U=M&&F===(0,p.Mm)(z),[Q,X]=(0,i.useState)(U),[Y,Z]=(0,i.useState)(-1),[ee,te]=(0,i.useState)(null);let ne=e.events;const ie=e.allEvents;var oe=null;V&&!oe&&(oe=function(e){var t=e.reduce(((e,t,n)=>{var i,o=t.storyset_id;return o in e?(e[o].total_events=e[o].total_events+1,e[o].events.push(t)):e[o]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,storyset_dynamic_thumbnail:null!==(i=null===t||void 0===t?void 0:t.storyset_dynamic_thumbnail)&&void 0!==i&&i,events:[t]},e}),{}),n=Object.values(t);return n.sort(((e,t)=>e.start_event_index-t.start_event_index)),n}(ne));const le=K.landingLocationType,ae=K.templateType;function re(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,c.MN)()&&(0,g._)()&&!t&&(0,d.bo)(),W||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const a=oe[e].events[0],r=(0,p.Wd)(le)+(0,p.gf)(ae)+(null!==a&&void 0!==a&&a.isRelatedEvent?"R":"E")+"_"+(null===a||void 0===a?void 0:a.event_id);(0,l.lB)(a),i(B,o.TB,o.OL),(0,s.Ch)(a.event_id,a.products,"homepage","stories",r,null===a||void 0===a?void 0:a.location,null===J||void 0===J?void 0:J.userType)})();var a=0;null!=i&&oe[e].events.map(((e,t)=>{e.event_id==i&&(a=t)})),Z(a),te(e)}async function se(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,c.MN)()&&(0,g._)()&&!t&&await(0,d.bo)(),Z(e.index),((0,v.ij)(e)||(0,v.Il)(e))&&(W||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const a=(0,p.Wd)(le)+(0,p.gf)(ae)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,l.lB)(e),i(B,o.TB,o.Dk),(0,s.Ch)(e.event_id,e.products,"homepage","carousel",a)})())}function ce(e){return(0,y.jsx)(y.Fragment,{})}return(0,i.useEffect)((()=>{if(U)if((0,_.H)("whatmore-video-player",(()=>{X(!1)})),null!=R&&V){const e=oe.find((e=>R==e.id));if(e)return void re(oe.indexOf(e),!0,H)}else if(null!=H){const e=ne.find((e=>H==e.event_id));if(e)return void se(e,!0)}}),[]),(0,y.jsxs)(y.Fragment,{children:[Q&&(0,y.jsx)(q,{}),-1==Y||-2==Y?(0,y.jsx)(ce,{}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.EVENT_VIEW,event:ne[Y],productList:null===(t=ne[Y])||void 0===t?void 0:t.products,cta:null===(k=ne[Y])||void 0===k?void 0:k.cta,triggerFlag:!W&&!N,children:(0,y.jsx)(P,{events:ie,index:Y,onBack:async function(){Z(-1),X(!1)},slideDirection:V||"horizontal"===(0,r.br0)(B)?"horizontal":"vertical",eventsStories:oe,initialStoryIndex:ee,template:F})})}),(0,y.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(V?G:$)+"px",marginBottom:(V?G:$)+"px"},children:"template-b"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(S,{events:ne,onClick:se,heading:e.heading})})}):"template-a-1"===F||"template-collections-a-1"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(w,{events:ne,onClick:se,heading:e.heading})}):"template-feed-a"===F||"template-collections-feed-a"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(j,{events:ne,onClick:se,heading:e.heading})}):"template-collections-a"===F||"template-c"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(I,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-b"===F||"template-d"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(f,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-c"===F||"template-e"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(E,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-d"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(S,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-e"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(T,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-stories"===F||"template-stories"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(A,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-f"===F||"template-collections-f"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(O,{events:ne,onClick:se,heading:e.heading})})}):"template-g"===F||"template-collections-g"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(C,{events:ne,onClick:se,heading:e.heading})})}):"template-h"===F||"template-collections-h"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(b,{events:ne,onClick:se,heading:e.heading})})}):"template-i"===F||"template-collections-i"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(D,{index:Y,events:ne,onClick:se,heading:e.heading})})}):"template-banner-a"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.BANNER_WIDGET_VIEW,event:ne[0],triggerFlag:!W&&!N,children:(0,y.jsx)(L,{events:ne})})}):V?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.STORIES_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(x,{eventsStories:oe,onClick:re,template:F})})}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(T,{events:ne,onClick:se,heading:e.heading})})})})]})},W=n(7802),N=n(6641),$=n(1351),G=n(5873);function V(e){return e.split(/[?#]/)[0]}var B=function(e){const[t,l]=(0,i.useState)(),[v,m]=(0,i.useState)(),[_,S]=(0,i.useState)(),{whatmoreIsStoriesTemplate:w}=(0,i.useContext)(u.B),{whatmoreIsCollectionsTemplate:I}=(0,i.useContext)(u.B),{whatmoreIsBannerTemplate:f}=(0,i.useContext)(u.B),[E]=(0,a.QN)("whatmoreShopId"),[x]=(0,a.QN)("whatmoreCollectionId"),T=(0,a.Xd)("whatmoreLandingLocationType"),O=(0,a.Xd)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:C}=(0,i.useContext)(u.B),{whatmoreUserInfo:b,whatmoreIsPreviewMode:D}=(0,i.useContext)(u.B),j=(0,a.Xd)("whatmoreCollectionUrl"),[L]=(0,a.QN)("isInDesignMode"),[A]=(0,a.QN)("isDemoBrand"),P=(0,r.mJ$)(E)?(0,r.jLA)(E)?j:window.location.href.split(/[?#]/)[0]:x,[q,B]=(0,a.QN)("productRatings"),[F,M]=(0,i.useState)(!1);var z=(0,r.SOt)(E)?o.aD+"/v2/events/":o.$$+"/v2/events/",R=(0,r.SOt)(E)?o.aD+"/v3/events/":o.$$+"/v3/events/",H=(0,r.SOt)(E)?o.aD+"/v4/events/":o.$$+"/v4/events/",K=(0,r.SOt)(E)?o.aD+"/v5/events/":o.$$+"/v5/events/",J=((0,r.SOt)(E)?o.aD:o.$$,(0,r.SOt)(E)?o.aD+"/get_eventset/":o.$$+"/get_eventset/"),U=(0,r.SOt)(E)?o.aD+"/v2/collection":o.$$+"/v2/collection",Q=(0,r.SOt)(E)?o.aD+"/v3/collection":o.$$+"/v3/collection",X=(0,r.SOt)(E)?o.aD+"/v4/collection":o.$$+"/v4/collection",Y=(0,r.SOt)(E)?o.aD+"/v2/brand/"+E+"/product-events":o.$$+"/v2/brand/"+E+"/product-events",Z=e.shopId,ee="live,upcoming",te="true";return(0,i.useEffect)((()=>{null!=t&&0!=t.length&&!_&&(0,c.MN)()&&!(0,a.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,g._)()&&(0,d.Pc)(d.F5)}),[t]),(0,i.useEffect)((()=>{var e,t,i,c;if((0,s.wm)(),T.startsWith("product")){var d=(0,a.Xd)("whatmoreProductId");if(d=(0,r.BcY)(E)?function(e){return"STRQMPNF7QK"==e?encodeURIComponent(window.location.href):"STR6HARJ3QY"==e||"STRI4V3OYCH"==e?V(window.location.href).split("/").pop():V(window.location.href)}(E):d,(0,r.vvU)(E))c=z.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString()+(w?"&template_type=stories":"");else if((0,r.WH1)(E)){c=`${c=`${o.$$}/v2/brand/${E}/product-events/recommendation`}?client_product_id=${d}&limit=10&recommended=${!(0,r.buK)(E)}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`}else c=Y.toString()+"?client_product_id="+d.toString()+"&status="+ee.toString()+"&event_type=video"}else if(I||"invalid-url"!==j)c=(0,r.JwJ)(E)?`${Q.toString()}?store_id=${Z.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`:"78232846646"==E?`${X.toString()}?store_id=${Z.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`:`${U.toString()}?store_id=${Z.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`;else if(f){const e=p.Jh,t=(0,p.t6)(T);c=J.toString()+Z.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+E}else{var u,v,h,_;if(("72201044272"==E||"2665447536"==E&&D)&&!w)c=R.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString()+"&latitude="+(null!==(u=null===(v=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===v?void 0:v.latitude)&&void 0!==u?u:"")+"&longitude="+(null!==(h=null===(_=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===_?void 0:_.longitude)&&void 0!==h?h:"")+"&user_type="+(null!==b&&void 0!==b&&b.userType?"olduser":"newuser");else c=(0,r.JwJ)(E)&&!w?H.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString():"78232846646"!=E||w?z.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString()+(w?"&template_type=stories":""):K.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString()}const g=null===(e=window)||void 0===e||null===(t=e.whatmore)||void 0===t||null===(i=t.storyEvents)||void 0===i?void 0:i.events;w&&T.startsWith("index")&&"object"==typeof g&&(null===g||void 0===g?void 0:g.length)>0?(l(g),m(g),M(!0)):fetch(c).then((e=>e.json())).then((e=>{var t;if(f){const t=p.Jh;return(0,W.Po)(e,t)}return(0,r.JwJ)(E)&&(null===e||void 0===e||null===(t=e.questions)||void 0===t?void 0:t.length)>0&&(null==localStorage.getItem("_whatmore_qview_index")&&localStorage.setItem("_whatmore_qview_index",0),(0,s.d3)(null===e||void 0===e?void 0:e.questions)),(0,W.Np)(e,I||"invalid-url"!==j)})).then((e=>{var t,n;O&&console.debug("initial received events size : "+e.length);let i=[...null===e||void 0===e?void 0:e.events,...null===e||void 0===e?void 0:e.all_events];i=(0,r.xku)(E)?(0,W.d8)(i):(0,W.Zf)(i),m(i);const o=null!==(t=null===e||void 0===e||null===(n=e.events)||void 0===n?void 0:n.length)&&void 0!==t?t:0;return i.slice(0,o)})).then((e=>{if((A||L)&&(null==e||e&&0==(null===e||void 0===e?void 0:e.length))){const e=async()=>{const{eventsData:e,storiesData:t,bannerData:i}=await n.e(365).then(n.bind(n,6018));l(w?t:f?i:e)};e()}else l(e);M(!0)})).catch((e=>{S(e.message),M(!0)}))}),[]),(0,i.useEffect)((()=>{"index"===T?t&&t.length>0&&(0,$.yP)({userInteractionType:h.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===T?(t&&t.length>0||"Scale"==(0,r.yt9)(E)||"Enterprise"==(0,r.yt9)(E)||"Premium"==(0,r.yt9)(E))&&(0,$.yP)({userInteractionType:h.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===T&&(t&&t.length>0||"Scale"==(0,r.yt9)(E)||"Enterprise"==(0,r.yt9)(E)||"Premium"==(0,r.yt9)(E))&&(0,$.yP)({userInteractionType:h.O.PDP_VISITED,widgetSourceDetails:C})}),[t]),F&&(null==t||0==t.length||_)&&G.Sn.forEach((e=>{var t,n,i,o;const l=null!==(t=e.querySelector('.whatmore-template-type[data-wh="template-stories-a"]'))&&void 0!==t?t:e.querySelector('.whatmore-template-type[data="template-stories-a"]'),a=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-feed-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-a-1"]')||e.querySelector('.whatmore-template-type[data-wh="template-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-h"]'))&&void 0!==n?n:e.querySelector('.whatmore-template-type[data="template-a"]')||e.querySelector('.whatmore-template-type[data="template-b"]')||e.querySelector('.whatmore-template-type[data="template-f"]')||e.querySelector('.whatmore-template-type[data="template-stories"]')||e.querySelector('.whatmore-template-type[data="template-e"]')||e.querySelector('.whatmore-template-type[data="template-a-1"]')||e.querySelector('.whatmore-template-type[data="template-g"]')||e.querySelector('.whatmore-template-type[data="template-h"]'),r=null!==(i=e.querySelector('.whatmore-template-type[data-wh="template-collections-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-c"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-d"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-h"]'))&&void 0!==i?i:e.querySelector('.whatmore-template-type[data="template-collections-a"]')||e.querySelector('.whatmore-template-type[data="template-collections-b"]')||e.querySelector('.whatmore-template-type[data="template-collections-c"]')||e.querySelector('.whatmore-template-type[data="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data="template-collections-e"]')||e.querySelector('.whatmore-template-type[data="template-collections-d"]')||e.querySelector('.whatmore-template-type[data="template-collections-f"]')||e.querySelector('.whatmore-template-type[data="template-collections-g"]')||e.querySelector('.whatmore-template-type[data="template-collections-h"]'),s=null!==(o=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==o?o:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),c=e;if(w){const t=e.querySelector(".whatmore-shimmer-stories");t&&(t.style.display="none")}else if(!I){const t=e.querySelector(".loading-skeleton-wrapper");t&&(t.style.display="none")}(s||r||a||l)&&(a&&c||l&&c||s&&c||r&&c)&&(c.style.minHeight="0px")})),null==t||0==t.length||_?(0,y.jsx)("div",{}):(O&&(0,N.xv)(t),O&&console.debug("final transformed events data : "+JSON.stringify(t)),O&&console.debug("valid events size : "+t.length),(0,y.jsx)(k,{heading:e.heading,events:t,allEvents:v}))}},7802:function(e,t,n){n.d(t,{Hl:function(){return o},Np:function(){return a},Po:function(){return r},Z_:function(){return i},Zf:function(){return c},d8:function(){return s},zJ:function(){return l}});const i=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},o=function(e,t){return!(void 0==e.products||0==e.products.length)},l=function(e){if(null!=e)return e.filter((e=>{var t;return null===(t=null===e||void 0===e?void 0:e.in_stock)||void 0===t||t}))},a=function(e){var t;var n;if(null!=e)return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{events:e.events[0].events,all_events:null!==(n=null===e||void 0===e?void 0:e.all_events)&&void 0!==n?n:[]}:{events:null===e||void 0===e?void 0:e.events,all_events:null!==(t=null===e||void 0===e?void 0:e.all_events)&&void 0!==t?t:[]}};const r=function(e,t){var n,i;let o=[];if(null==e)return[];if("eventsets"in e&&e.eventsets[t]){const n=function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach((e=>{t=t.concat(e.events)})),t}(e.eventsets[t]);o=[...n]}return{events:o,all_events:null!==(n=null===(i=o)||void 0===i?void 0:i.all_events)&&void 0!==n?n:[]}};function s(e){if(null!=e){var t=0;return e.forEach((e=>{e.index=t++})),e}}function c(e){if(null==e)return;let t=0;return e.reduce(((e,n)=>{var i;return(null===(i=null===n||void 0===n?void 0:n.in_stock)||void 0===i||i)&&(n.index=t++,e.push(n)),e}),[])}},8945:function(e,t,n){function i(e,t){let n=0;let i=new MutationObserver((function(){document.querySelector("."+e)?(t(),i.disconnect()):0==n&&(n=1,setTimeout((()=>{t(),i.disconnect()}),8e3))}));i.observe(document.body,{childList:!0,subtree:!0})}n.d(t,{H:function(){return i}})}}]);
|
|
1
|
+
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[199],{1351:function(e,t,n){n.d(t,{PG:function(){return s},kz:function(){return c},UM:function(){return u},yP:function(){return v},DG:function(){return d}});var i=n(1348),o=n(3330),l=n(6157);function a(e,t){var n;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;const a=s[e];if(!a)return;const r=a.isActionEnabled(),c=null===o||void 0===o||null===(n=o.meta_actions)||void 0===n?void 0:n[a.customAction];(r||c)&&"function"==typeof fbq&&(async()=>{const n={id:null===t||void 0===t?void 0:t.client_product_id,product_url:null===t||void 0===t?void 0:t.product_link,...e===l.O.VIDEO_PLAYBACK&&{watch_time:i.watch_time,video_duration:i.video_duration}};fbq("trackCustom",a.action,n),c&&setTimeout((()=>{null===c||void 0===c||c.forEach((e=>{fbq("trackCustom",e,n)}))}),500)})()}var r=n(7145);const s={[l.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[l.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[l.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[l.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[l.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[l.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[l.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[l.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function c(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:c,ctaList:d}=e;var u,v,p,m;((0,r.B)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:c,ctaList:d}),t in s)&&(a(t,null!==(u=null===c||void 0===c?void 0:c[1])&&void 0!==u?u:null===c||void 0===c?void 0:c[0],n,l),(0,o.n)({page_type:i.landingLocationType,selection_type:t,video_name:l.event_id,video_percentage:"NA",product_name:null!==(v=null===c||void 0===c||null===(p=c[1])||void 0===p?void 0:p.title)&&void 0!==v?v:null===c||void 0===c||null===(m=c[0])||void 0===m?void 0:m.title}))}function d(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:c,ctaList:d}=e;var u,v,p,m;((0,r.B)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:c,ctaList:d}),t in s)&&(a(t,null!==(u=null===c||void 0===c?void 0:c[1])&&void 0!==u?u:null===c||void 0===c?void 0:c[0],n,l),(0,o.n)({page_type:i.landingLocationType,selection_type:t,video_name:l.event_id,video_percentage:n.video_duration>0?Math.ceil(n.watch_time/n.video_duration*100):"NA",product_name:null!==(v=null===c||void 0===c||null===(p=c[1])||void 0===p?void 0:p.title)&&void 0!==v?v:null===c||void 0===c||null===(m=c[0])||void 0===m?void 0:m.title}))}function u(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:a,ctaList:c}=e;var d,u,v;((0,r.B)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:l,productList:a,ctaList:c}),t in s)&&(0,o.n)({page_type:i.landingLocationType,selection_type:t,video_name:l.event_id,video_percentage:"NA",product_name:null!==(d=null===a||void 0===a||null===(u=a[1])||void 0===u?void 0:u.title)&&void 0!==d?d:null===a||void 0===a||null===(v=a[0])||void 0===v?void 0:v.title})}function v(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:o,productList:l,ctaList:a}=e;(0,r.B)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:i,event:o,productList:l,ctaList:a})}},3350:function(e,t,n){n.r(t),n.d(t,{default:function(){return B}});var i=n(9950),o=n(964),l=n(140),a=n(5830),r=n(1348),s=n(4533),c=n(6613),d=n(1085),u=n(5551),v=n(2039),p=n(4833),m=n(2979),h=n(6157),_=n(8945),g=n(9821),y=n(4414);const S=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(375),n.e(571),n.e(987),n.e(210),n.e(588),n.e(665)]).then(n.bind(n,5213)))),w=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(437),n.e(375),n.e(571),n.e(620),n.e(116)]).then(n.bind(n,7144)))),I=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(879),n.e(571),n.e(987),n.e(180),n.e(423)]).then(n.bind(n,517)))),f=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(879),n.e(571),n.e(987),n.e(180),n.e(412)]).then(n.bind(n,7646)))),E=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(879),n.e(571),n.e(987),n.e(180),n.e(221)]).then(n.bind(n,5451)))),x=i.lazy((()=>Promise.all([n.e(59),n.e(571),n.e(491)]).then(n.bind(n,4295)))),T=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(375),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(544),n.e(620),n.e(474)]).then(n.bind(n,6945)))),O=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(310),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(485)]).then(n.bind(n,9418)))),C=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(131),n.e(571),n.e(987),n.e(676)]).then(n.bind(n,3369)))),b=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(691),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(544),n.e(891)]).then(n.bind(n,7178)))),D=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(72),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(544),n.e(306)]).then(n.bind(n,9406)))),j=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(375),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(588),n.e(933)]).then(n.bind(n,6989)))),L=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(438),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(806)]).then(n.bind(n,3278)))),A=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(879),n.e(571),n.e(987),n.e(1)]).then(n.bind(n,4596)))),P=i.lazy((()=>Promise.all([n.e(59),n.e(304),n.e(946),n.e(437),n.e(498),n.e(571),n.e(987),n.e(262),n.e(647),n.e(210),n.e(906)]).then(n.bind(n,5647)))),q=i.lazy((()=>n.e(374).then(n.bind(n,5100))));var k=function(e){var t,k;const[W]=(0,a.QN)("isInDesignMode"),[N]=(0,a.QN)("isDemoBrand"),[$]=(0,a.QN)("whatmoreTopBottomPadding"),[G]=(0,a.QN)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:V}=(0,i.useContext)(u.B),[B]=(0,a.QN)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:F}=(0,i.useContext)(u.B),M=(0,a.Xd)("isLandingSharedLink"),z=(0,a.Xd)("whatmoreShareTemplateId"),R=(0,a.Xd)("whatmoreShareStoryId"),H=(0,a.Xd)("whatmoreShareEventId"),{whatmoreWidgetSourceDetails:K,whatmoreUserInfo:J}=(0,i.useContext)(u.B),U=M&&F===(0,p.Mm)(z),[Q,X]=(0,i.useState)(U),[Y,Z]=(0,i.useState)(-1),[ee,te]=(0,i.useState)(null);let ne=e.events;const ie=e.allEvents;var oe=null;V&&!oe&&(oe=function(e){var t=e.reduce(((e,t,n)=>{var i,o=t.storyset_id;return o in e?(e[o].total_events=e[o].total_events+1,e[o].events.push(t)):e[o]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,storyset_dynamic_thumbnail:null!==(i=null===t||void 0===t?void 0:t.storyset_dynamic_thumbnail)&&void 0!==i&&i,events:[t]},e}),{}),n=Object.values(t);return n.sort(((e,t)=>e.start_event_index-t.start_event_index)),n}(ne));const le=K.landingLocationType,ae=K.templateType;function re(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,c.MN)()&&(0,g._)()&&!t&&(0,d.bo)(),W||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const a=oe[e].events[0],r=(0,p.Wd)(le)+(0,p.gf)(ae)+(null!==a&&void 0!==a&&a.isRelatedEvent?"R":"E")+"_"+(null===a||void 0===a?void 0:a.event_id);(0,l.lB)(a),i(B,o.TB,o.OL),(0,s.Ch)(a.event_id,a.products,"homepage","stories",r,null===a||void 0===a?void 0:a.location,null===J||void 0===J?void 0:J.userType)})();var a=0;null!=i&&oe[e].events.map(((e,t)=>{e.event_id==i&&(a=t)})),Z(a),te(e)}async function se(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,c.MN)()&&(0,g._)()&&!t&&await(0,d.bo)(),Z(e.index),((0,v.ij)(e)||(0,v.Il)(e))&&(W||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const a=(0,p.Wd)(le)+(0,p.gf)(ae)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,l.lB)(e),i(B,o.TB,o.Dk),(0,s.Ch)(e.event_id,e.products,"homepage","carousel",a)})())}function ce(e){return(0,y.jsx)(y.Fragment,{})}return(0,i.useEffect)((()=>{if(U)if((0,_.H)("whatmore-video-player",(()=>{X(!1)})),null!=R&&V){const e=oe.find((e=>R==e.id));if(e)return void re(oe.indexOf(e),!0,H)}else if(null!=H){const e=ne.find((e=>H==e.event_id));if(e)return void se(e,!0)}}),[]),(0,y.jsxs)(y.Fragment,{children:[Q&&(0,y.jsx)(q,{}),-1==Y||-2==Y?(0,y.jsx)(ce,{}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.EVENT_VIEW,event:ne[Y],productList:null===(t=ne[Y])||void 0===t?void 0:t.products,cta:null===(k=ne[Y])||void 0===k?void 0:k.cta,triggerFlag:!W&&!N,children:(0,y.jsx)(P,{events:ie,index:Y,onBack:async function(){Z(-1),X(!1)},slideDirection:V||"horizontal"===(0,r.br0)(B)?"horizontal":"vertical",eventsStories:oe,initialStoryIndex:ee,template:F})})}),(0,y.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(V?G:$)+"px",marginBottom:(V?G:$)+"px"},children:"template-b"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(S,{events:ne,onClick:se,heading:e.heading})})}):"template-a-1"===F||"template-collections-a-1"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(w,{events:ne,onClick:se,heading:e.heading})}):"template-feed-a"===F||"template-collections-feed-a"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(j,{events:ne,onClick:se,heading:e.heading})}):"template-collections-a"===F||"template-c"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(I,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-b"===F||"template-d"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(f,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-c"===F||"template-e"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(E,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-d"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(S,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-e"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(T,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-stories"===F||"template-stories"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(A,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-f"===F||"template-collections-f"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(O,{events:ne,onClick:se,heading:e.heading})})}):"template-g"===F||"template-collections-g"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(C,{events:ne,onClick:se,heading:e.heading})})}):"template-h"===F||"template-collections-h"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(b,{events:ne,onClick:se,heading:e.heading})})}):"template-i"===F||"template-collections-i"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(D,{index:Y,events:ne,onClick:se,heading:e.heading})})}):"template-banner-a"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.BANNER_WIDGET_VIEW,event:ne[0],triggerFlag:!W&&!N,children:(0,y.jsx)(L,{events:ne})})}):V?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.STORIES_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(x,{eventsStories:oe,onClick:re,template:F})})}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!W&&!N,children:(0,y.jsx)(T,{events:ne,onClick:se,heading:e.heading})})})})]})},W=n(7802),N=n(6641),$=n(1351),G=n(5873);function V(e){return e.split(/[?#]/)[0]}var B=function(e){const[t,l]=(0,i.useState)(),[v,m]=(0,i.useState)(),[_,S]=(0,i.useState)(),{whatmoreIsStoriesTemplate:w}=(0,i.useContext)(u.B),{whatmoreIsCollectionsTemplate:I}=(0,i.useContext)(u.B),{whatmoreIsBannerTemplate:f}=(0,i.useContext)(u.B),[E]=(0,a.QN)("whatmoreShopId"),[x]=(0,a.QN)("whatmoreCollectionId"),T=(0,a.Xd)("whatmoreLandingLocationType"),O=(0,a.Xd)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:C}=(0,i.useContext)(u.B),{whatmoreUserInfo:b,whatmoreIsPreviewMode:D}=(0,i.useContext)(u.B),j=(0,a.Xd)("whatmoreCollectionUrl"),[L]=(0,a.QN)("isInDesignMode"),[A]=(0,a.QN)("isDemoBrand"),P=(0,r.mJ$)(E)?(0,r.jLA)(E)?j:window.location.href.split(/[?#]/)[0]:x,[q,B]=(0,a.QN)("productRatings"),[F,M]=(0,i.useState)(!1);var z=(0,r.SOt)(E)?o.aD+"/v2/events/":o.$$+"/v2/events/",R=(0,r.SOt)(E)?o.aD+"/v3/events/":o.$$+"/v3/events/",H=(0,r.SOt)(E)?o.aD+"/v4/events/":o.$$+"/v4/events/",K=(0,r.SOt)(E)?o.aD+"/v5/events/":o.$$+"/v5/events/",J=((0,r.SOt)(E)?o.aD:o.$$,(0,r.SOt)(E)?o.aD+"/get_eventset/":o.$$+"/get_eventset/"),U=(0,r.SOt)(E)?o.aD+"/v2/collection":o.$$+"/v2/collection",Q=(0,r.SOt)(E)?o.aD+"/v3/collection":o.$$+"/v3/collection",X=(0,r.SOt)(E)?o.aD+"/v4/collection":o.$$+"/v4/collection",Y=(0,r.SOt)(E)?o.aD+"/v2/brand/"+E+"/product-events":o.$$+"/v2/brand/"+E+"/product-events",Z=e.shopId,ee="live,upcoming",te="true";return(0,i.useEffect)((()=>{null!=t&&0!=t.length&&!_&&(0,c.MN)()&&!(0,a.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,g._)()&&(0,d.Pc)(d.F5)}),[t]),(0,i.useEffect)((()=>{var e,t,i,c;if((0,s.wm)(),T.startsWith("product")){var d=(0,a.Xd)("whatmoreProductId");if(d=(0,r.BcY)(E)?function(e){return"STRQMPNF7QK"==e?encodeURIComponent(window.location.href):"STR6HARJ3QY"==e||"STRI4V3OYCH"==e?V(window.location.href).split("/").pop():V(window.location.href)}(E):d,(0,r.vvU)(E))c=z.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString()+(w?"&template_type=stories":"");else if((0,r.WH1)(E)){c=`${c=`${o.$$}/v2/brand/${E}/product-events/recommendation`}?client_product_id=${d}&limit=10&recommended=${!(0,r.buK)(E)}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`}else c=Y.toString()+"?client_product_id="+d.toString()+"&status="+ee.toString()+"&event_type=video"}else if(I||"invalid-url"!==j)c=(0,r.JwJ)(E)?`${Q.toString()}?store_id=${Z.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`:"78232846646"==E?`${X.toString()}?store_id=${Z.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`:`${U.toString()}?store_id=${Z.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`;else if(f){const e=p.Jh,t=(0,p.t6)(T);c=J.toString()+Z.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+E}else{var u,v,h,_;if(("72201044272"==E||"2665447536"==E&&D)&&!w)c=R.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString()+"&latitude="+(null!==(u=null===(v=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===v?void 0:v.latitude)&&void 0!==u?u:"")+"&longitude="+(null!==(h=null===(_=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===_?void 0:_.longitude)&&void 0!==h?h:"")+"&user_type="+(null!==b&&void 0!==b&&b.userType?"olduser":"newuser");else c=(0,r.JwJ)(E)&&!w?H.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString():"78232846646"!=E||w?z.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString()+(w?"&template_type=stories":""):K.toString()+Z.toString()+"?status="+ee.toString()+"&is_active="+te.toString()}const g=null===(e=window)||void 0===e||null===(t=e.whatmore)||void 0===t||null===(i=t.storyEvents)||void 0===i?void 0:i.events;w&&T.startsWith("index")&&"object"==typeof g&&(null===g||void 0===g?void 0:g.length)>0?(l(g),m(g),M(!0)):fetch(c).then((e=>e.json())).then((e=>{var t;if(f){const t=p.Jh;return(0,W.Po)(e,t)}return(0,r.JwJ)(E)&&(null===e||void 0===e||null===(t=e.questions)||void 0===t?void 0:t.length)>0&&(null==localStorage.getItem("_whatmore_qview_index")&&localStorage.setItem("_whatmore_qview_index",0),(0,s.d3)(null===e||void 0===e?void 0:e.questions)),(0,W.Np)(e,I||"invalid-url"!==j)})).then((e=>{var t,n;O&&console.debug("initial received events size : "+e.length);let i=[...null===e||void 0===e?void 0:e.events,...null===e||void 0===e?void 0:e.all_events];i=(0,r.xku)(E)?(0,W.d8)(i):(0,W.Zf)(i),m(i);const o=null!==(t=null===e||void 0===e||null===(n=e.events)||void 0===n?void 0:n.length)&&void 0!==t?t:0;return i.slice(0,o)})).then((e=>{if((A||L)&&(null==e||e&&0==(null===e||void 0===e?void 0:e.length))){const e=async()=>{const{eventsData:e,storiesData:t,bannerData:i}=await n.e(365).then(n.bind(n,6018));l(w?t:f?i:e)};e()}else l(e);M(!0)})).catch((e=>{S(e.message),M(!0)}))}),[]),(0,i.useEffect)((()=>{"index"===T?t&&t.length>0&&(0,$.yP)({userInteractionType:h.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===T?(t&&t.length>0||"Scale"==(0,r.yt9)(E)||"Enterprise"==(0,r.yt9)(E)||"Premium"==(0,r.yt9)(E))&&(0,$.yP)({userInteractionType:h.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===T&&(t&&t.length>0||"Scale"==(0,r.yt9)(E)||"Enterprise"==(0,r.yt9)(E)||"Premium"==(0,r.yt9)(E))&&(0,$.yP)({userInteractionType:h.O.PDP_VISITED,widgetSourceDetails:C})}),[t]),F&&(null==t||0==t.length||_)&&G.Sn.forEach((e=>{var t,n,i,o;const l=null!==(t=e.querySelector('.whatmore-template-type[data-wh="template-stories-a"]'))&&void 0!==t?t:e.querySelector('.whatmore-template-type[data="template-stories-a"]'),a=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-feed-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-a-1"]')||e.querySelector('.whatmore-template-type[data-wh="template-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-h"]'))&&void 0!==n?n:e.querySelector('.whatmore-template-type[data="template-a"]')||e.querySelector('.whatmore-template-type[data="template-b"]')||e.querySelector('.whatmore-template-type[data="template-f"]')||e.querySelector('.whatmore-template-type[data="template-stories"]')||e.querySelector('.whatmore-template-type[data="template-e"]')||e.querySelector('.whatmore-template-type[data="template-a-1"]')||e.querySelector('.whatmore-template-type[data="template-g"]')||e.querySelector('.whatmore-template-type[data="template-h"]'),r=null!==(i=e.querySelector('.whatmore-template-type[data-wh="template-collections-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-c"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-d"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-h"]'))&&void 0!==i?i:e.querySelector('.whatmore-template-type[data="template-collections-a"]')||e.querySelector('.whatmore-template-type[data="template-collections-b"]')||e.querySelector('.whatmore-template-type[data="template-collections-c"]')||e.querySelector('.whatmore-template-type[data="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data="template-collections-e"]')||e.querySelector('.whatmore-template-type[data="template-collections-d"]')||e.querySelector('.whatmore-template-type[data="template-collections-f"]')||e.querySelector('.whatmore-template-type[data="template-collections-g"]')||e.querySelector('.whatmore-template-type[data="template-collections-h"]'),s=null!==(o=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==o?o:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),c=e;if(w){const t=e.querySelector(".whatmore-shimmer-stories");t&&(t.style.display="none")}else if(!I){const t=e.querySelector(".loading-skeleton-wrapper");t&&(t.style.display="none")}(s||r||a||l)&&(a&&c||l&&c||s&&c||r&&c)&&(c.style.minHeight="0px")})),null==t||0==t.length||_?(0,y.jsx)("div",{}):(O&&(0,N.xv)(t),O&&console.debug("final transformed events data : "+JSON.stringify(t)),O&&console.debug("valid events size : "+t.length),(0,y.jsx)(k,{heading:e.heading,events:t,allEvents:v}))}},7802:function(e,t,n){n.d(t,{Hl:function(){return o},Np:function(){return a},Po:function(){return r},Z_:function(){return i},Zf:function(){return c},d8:function(){return s},zJ:function(){return l}});const i=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},o=function(e,t){return!(void 0==e.products||0==e.products.length)},l=function(e){if(null!=e)return e.filter((e=>{var t;return null===(t=null===e||void 0===e?void 0:e.in_stock)||void 0===t||t}))},a=function(e){var t;var n;if(null!=e)return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{events:e.events[0].events,all_events:null!==(n=null===e||void 0===e?void 0:e.all_events)&&void 0!==n?n:[]}:{events:null===e||void 0===e?void 0:e.events,all_events:null!==(t=null===e||void 0===e?void 0:e.all_events)&&void 0!==t?t:[]}};const r=function(e,t){var n,i;let o=[];if(null==e)return[];if("eventsets"in e&&e.eventsets[t]){const n=function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach((e=>{t=t.concat(e.events)})),t}(e.eventsets[t]);o=[...n]}return{events:o,all_events:null!==(n=null===(i=o)||void 0===i?void 0:i.all_events)&&void 0!==n?n:[]}};function s(e){if(null!=e){var t=0;return e.forEach((e=>{e.index=t++})),e}}function c(e){if(null==e)return;let t=0;return e.reduce(((e,n)=>{var i;return(null===(i=null===n||void 0===n?void 0:n.in_stock)||void 0===i||i)&&(n.index=t++,e.push(n)),e}),[])}},8945:function(e,t,n){function i(e,t){let n=0;let i=new MutationObserver((function(){document.querySelector("."+e)?(t(),i.disconnect()):0==n&&(n=1,setTimeout((()=>{t(),i.disconnect()}),8e3))}));i.observe(document.body,{childList:!0,subtree:!0})}n.d(t,{H:function(){return i}})}}]);
|