whatmore-react-assets 1.0.1643 → 1.0.1644

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatmore-react-assets",
3
- "version": "1.0.1643",
3
+ "version": "1.0.1644",
4
4
  "description": "public repo for all whatmore js and css assets",
5
5
  "main": "whatmore.js",
6
6
  "scripts": {
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[774,907],{22:function(e,t,n){n.d(t,{$S:function(){return d},_:function(){return i},b4:function(){return r},dl:function(){return o},nN:function(){return s},tn:function(){return c},vF:function(){return a}});const i="device_type",o="device_mode",r="mobile",a="tablet",d="desktop",c="portrait",s="landscape"},69:function(e,t,n){n.d(t,{Ij:function(){return r},bi:function(){return a}});let i,o=!1;function r(){return i?i.play().then((()=>{o=!0,console.debug("iOS autoplay restrictions bypassed."),i.pause()})).catch((e=>{console.error("Failed to bless videos:",e.message)})):Promise.reject(new Error("Blessing video not initialized."))}function a(){i||(i=document.createElement("video"),i.src="https://whatmore-other-assets.b-cdn.net/whatmore/dummy_for_video_pool_3s_muted_11kb.mp4",i.muted=!0,i.playsInline=!0,i.style.display="none",document.body.appendChild(i));const e=()=>{o||r()};document.addEventListener("click",e,{once:!0}),document.addEventListener("touchstart",e,{once:!0})}},932:function(e,t,n){var i=n(5830),o=n(1941),r=n(22),a=n(1348);t.A=function(e){const[t,n,d]=(0,o.A)(),[c]=(0,i.QN)("whatmoreLandscapePadding"),[s]=(0,i.QN)("whatmoreShopId"),[l]=(0,i.QN)("whatmoreVideoTileSize"),[u]=(0,i.QN)("whatmoreVideoTileSizePortrait"),p=d>=1025,v="portrait"==t?u:l,h=!("portrait"!=t||!(d>=481)),m=v/100*1.3*.5,f=v/100;var w=Math.min(d,n),[g,_,x,b]=[.6*w*(16/9),.6*w,1.4,0];function y(e){return Math.round(10*e)/10}var E={DEVICE_TYPE:r.b4,DEVICE_MODE:r.tn};if(p){const e=_*m,t=g*m;[g,_,x,b]=[t,e,(d-2*c-2*(0,a.$du)(s))/(1.1*e),c],E[r._]=r.$S,E[r.dl]=r.nN}else if(h){var S=.8*_,I=.8*g;"portrait"==t?(S*=f,I*=f,[g,_,x,b]=[I,S,y(d/(1.2*S)),0],E[r._]=r.vF,E[r.dl]=r.tn):([g,_,x,b]=[I,S,(d-2*c)/(1.1*S),c],E[r._]=r.vF,E[r.dl]=r.nN)}else{S=_,I=g;"portrait"==t?(S=S*f*.9,I=I*f*.9,[g,_,x,b]=[I,S,y(d/(1.15*S)),0],E[r._]=r.b4,E[r.dl]=r.tn):(S=.7*_,I=.7*g,[g,_,x,b]=[I,S,(d-2*c)/(1.1*S),c],E[r._]=r.b4,E[r.dl]=r.nN)}return[g,_,x,b,E]}},1351:function(e,t,n){n.d(t,{PG:function(){return d},kz:function(){return c},UM:function(){return l},yP:function(){return u},DG:function(){return s}});var i=n(1348),o=n(6157);function r(e,t,n={},i){var r;const a=d[e];if(!a)return;const c=a.isActionEnabled(),s=null===i||void 0===i||null===(r=i.meta_actions)||void 0===r?void 0:r[a.customAction];(c||s)&&"function"==typeof fbq&&(async()=>{const i={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===o.O.VIDEO_PLAYBACK&&{watch_time:n.watch_time,video_duration:n.video_duration}};fbq("trackCustom",a.action,i),s&&setTimeout((()=>{null===s||void 0===s||s.forEach((e=>{fbq("trackCustom",e,i)}))}),500)})()}var a=n(7145);const d={[o.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[o.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[o.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[o.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[o.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[o.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[o.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[o.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function c({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:c}){var s;(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:c}),e in d&&r(e,null!==(s=null===o||void 0===o?void 0:o[1])&&void 0!==s?s:null===o||void 0===o?void 0:o[0],t,i)}function s({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:c}){var s;(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:c}),e in d&&r(e,null!==(s=null===o||void 0===o?void 0:o[1])&&void 0!==s?s:null===o||void 0===o?void 0:o[0],t,i)}function l({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:r}){(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:r})}function u({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:r}){(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:r})}},3330:function(e,t,n){n.d(t,{initializeGA:function(){return p},sendVideoViewEventToGA:function(){return v}});var i,o=n(2595),r=n(7732),a=n(1348);const d="Whatmore Video Shopping",c=null!==(i="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==i&&i,s={video_view:"Video View",add_to_cart:"Add to Cart",buy_now:"Buy Now"},l={carousel:"Carousel",stories:"Stories",video_popup:"Video Popup"},u={homepage:"Home Page",product_page:"Product Page"};async function p(e){if((0,a.M$H)(e)&&null!==(0,a.xIo)(e)&&(r.Ay.initialize((0,a.xIo)(e)),c&&console.debug("Whatmore: initialized GA4")),(0,a.B6P)(e)&&null!==(0,a.jWS)(e)){const t=(0,a.Gc6)(e);o.Ay.initialize((0,a.jWS)(e),{useExistingGa:t}),c&&console.debug("Whatmore: initialized GA3")}}async function v(e,t,n){(0,a.B6P)(e)&&null!==(0,a.jWS)(e)&&(o.Ay.event({category:d,action:s.video_view,label:u[t]+":"+l[n]}),c&&console.debug("Whatmore: pushed view event to GA3")),(0,a.M$H)(e)&&null!==(0,a.xIo)(e)&&(r.Ay.event({category:d,action:s.video_view+":"+u[t]+":"+l[n],value:1,nonInteraction:!1}),c&&console.debug("Whatmore: pushed view event to GA4"))}},3389:function(e,t,n){n.r(t);var i=n(9950),o=n(1348),r=n(964),a=n(5830),d=n(140),c=n(4533),s=n(5901),l=n(1085),u=n(6613),p=n(3330),v=(n(3262),n(572)),h=n(8603),m=n(2039),f=n(4833),w=n(5551),g=n(1351),_=n(6157),x=n(2979),b=n(6641),y=n(8945),E=n(9821),S=n(69),I=n(4414);const A=(0,h.A)({key:"whatmore-css-ppv"}),j=i.lazy((()=>Promise.all([n.e(304),n.e(946),n.e(437),n.e(451),n.e(987),n.e(669),n.e(413),n.e(592)]).then(n.bind(n,6413)))),P=i.lazy((()=>n.e(374).then(n.bind(n,5100))));function L(e){return e.split(/[?#]/)[0]}t.default=function(e){const[t,n]=(0,i.useState)(),[h,C]=(0,i.useState)(),[T]=(0,a.QN)("isInDesignMode"),[N]=(0,a.QN)("isDemoBrand"),[O]=(0,a.QN)("whatmoreEmbedAppUseVariant"),[D,k]=(0,i.useState)(-2),[z]=(0,a.QN)("whatmoreVariantId"),[V]=(0,a.QN)("whatmoreShopId");var[M]=(0,a.QN)("whatmoreProductId");const Q=(0,a.Xd)("isLandingSharedLink"),R=(0,a.Xd)("whatmoreShareTemplateId"),W=(0,a.Xd)("whatmoreShareEventId"),F=Q&&"template-embed"===(0,f.Mm)(R),[B,$]=(0,i.useState)(F);M=(0,o.BcY)(V)?function(e){if("STRR72TX6AT"==e){var t;const e=null===(t=window.location.pathname)||void 0===t?void 0:t.split("/");return e[e.length-1]}return"STR6HARJ3QY"==e||"STRI4V3OYCH"==e?L(window.location.href).split("/").pop():L(window.location.href)}(V):M;const[G,H]=(0,i.useState)((()=>"true"===O?z:M));var K=r.$$+"/v2/brand/"+V+"/product-events";const{whatmoreWidgetSourceDetails:U}=(0,i.useContext)(w.B);(0,i.useEffect)((()=>{(0,p.initializeGA)(V),(0,b.Fk)("Video shopping powered by Whatmore!"),(0,c.wm)()}),[]),(0,i.useEffect)((()=>{null==t||0==t.length||h||!(0,u.MN)()||(0,a.Xd)("whatmoreVideoPlayerPoolInitiated")||((0,E._)()?(0,l.Pc)(l.F5):(0,S.bi)())}),[t]),(0,i.useEffect)((()=>{if(k(-1),(0,o.WH1)(V)){const e=`${r.$$}/v2/brand/${V}/product-events/recommendation`,t=(0,o.buK)(V);fetch(`${e}?client_product_id=${G}&limit=10&recommended=${!t}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`).then((e=>e.json())).then((e=>{const i=null===e||void 0===e?void 0:e.events;if((null===i||void 0===i?void 0:i.length)>0){var o;const r=t?null===e||void 0===e?void 0:e.all_events:null===e||void 0===e||null===(o=e.related_events)||void 0===o?void 0:o.map((e=>({...e,isRelatedEvent:!0})));n([...i,...r])}else n([])})).catch((e=>C(e.message)))}else fetch(K.toString()+"?client_product_id="+G.toString()+"&status="+"upcoming".toString()+"&event_type=video").then((e=>e.json())).then((e=>e.events)).then((e=>(null!=e&&0!=e.length&&(0,o.vfi)(V)&&(0,o.YOR)(e),n(e),e))).then((e=>((0,o.Uht)(V)&&function(e,t){setTimeout((async()=>{const n=e.reduce(((e,t)=>[...e,...t.products]),[]).filter((e=>e.client_product_id==t))[0];if(!n||n.product_link==L(window.location.href))return;const i={product_id:n.product_id,product_link:L(window.location.href)};fetch(r.$$+"/product",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)})}),500)}(e,G),e))).catch((e=>{C(e.message)}))}),[G]),(0,i.useEffect)((()=>{var e,n;k(-2),(t&&t.length>0||(0,o.WKl)(V))&&(0,g.yP)({userInteractionType:_.O.PDP_VISITED,widgetSourceDetails:U,event:null===t||void 0===t?void 0:t[0],productList:null===t||void 0===t||null===(e=t[0])||void 0===e?void 0:e.products,ctaList:null===t||void 0===t||null===(n=t[0])||void 0===n?void 0:n.cta})}),[t]),(0,i.useEffect)((()=>{const e=L(window.location.href);let t=history.pushState;history.pushState=function(){let e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};let n=history.replaceState;history.replaceState=function(){let e=n.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),e},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))})),window.addEventListener("locationchange",(function(){if("24950997070"==V&&window.location.origin+window.location.pathname!=e&&fetch(window.location.origin+window.location.pathname+".json").then((e=>e.json())).then((e=>{var t;return H(null===e||void 0===e||null===(t=e.product)||void 0===t?void 0:t.id)})),"true"===O){const e=function(e){for(var t=window.location.search.substring(1).split("&"),n=0;n<t.length;n++){var i=t[n].split("=");if(i[0]==e)return i[1]}return!1}("variant");e&&""!==e&&H(e)}}))}),[]),(0,i.useEffect)((()=>{if(null!=t&&0!==t.length&&!h&&F&&((0,y.H)("whatmore-video-player",(()=>{$(!1)})),null!=W)){const e=t.find((e=>W==e.event_id));if(e)return void q(e,!0,t.indexOf(e))}}),[t]);const Y=U.landingLocationType,X=U.templateType,q=async(e,t=!1,n=0)=>{if((0,u.MN)()&&!t&&await((0,E._)()?(0,l.bo)():(0,S.bi)()),(0,m.ij)(e)||(0,m.Il)(e))return T||N||(async()=>{const t=(0,f.Wd)(Y)+(0,f.gf)(X)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,d.lB)(e),(0,p.sendVideoViewEventToGA)(V,r.DK,r.K1),(0,c.Ch)(e.event_id,e.products,"product_page","video_popup",t)})(),void k(n)};function J(){return(0,I.jsx)(I.Fragment,{})}return null==t||0==t.length||h||(0,f.Ig)(U.templateType)?(0,I.jsx)("div",{}):(0,I.jsxs)(v.C,{value:A,children:[B&&(0,I.jsx)(P,{}),"no-product"===G||-1===D||0===t.length?(0,I.jsx)(J,{}):-2===D&&t.length>0?(0,I.jsx)("div",{children:(0,I.jsx)(x.S,{userInteractionType:_.O.PDP_POPUP_WIDGET_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!T&&!N,children:(0,I.jsx)(s.A,{event:t[0],inVideoClick:q,closeClick:e=>{var n;e.stopPropagation(),k(-1),(0,g.kz)({userInteractionType:_.O.PDP_POPUP_CLOSED,widgetSourceDetails:U,event:null===t||void 0===t?void 0:t[0],productList:null===t||void 0===t||null===(n=t[0])||void 0===n?void 0:n.products})}})})}):(0,I.jsx)("div",{children:(0,I.jsx)(i.Suspense,{children:(0,I.jsx)(x.S,{userInteractionType:_.O.EVENT_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!T&&!N,children:(0,I.jsx)(j,{events:t,index:D,onBack:function(){k(-2),$(!1)},template:"template-product-page"})})})})]})}},5901:function(e,t,n){n.d(t,{A:function(){return w}});var i=n(1005),o=n(9950),r=n(9879),a=n(22),d=n(5830),c=n(932);var s=function(e){const[t,n,i,o,r]=(0,c.A)(),[s]=(0,d.QN)("whatmoreEmbedAppVideoPlayerSizePortrait"),[l]=(0,d.QN)("whatmoreEmbedAppVideoPlayerSizeLandscape"),u=r[a.dl]===a.nN?l/100:s/100*1.2;return[t*u,n*u,r]},l=n(5727),u=n(1628),p=n.n(u),v=n(2209),h=n(6702),m=(n(9733),n(4365),n(1348)),f=n(4414);var w=function(e){var t;const n=o.useRef(null);var[c,u,w]=s();const g=(0,d.Xd)("whatmoreUITheme"),[_]=(0,d.QN)("whatmoreEmbedAppVideoTitle"),[x]=(0,d.QN)("whatmoreEmbedAppPositionPortrait"),[b]=(0,d.QN)("whatmoreEmbedAppHorizontalPaddingPortrait"),[y]=(0,d.QN)("whatmoreEmbedAppVerticalPaddingPortrait"),[E]=(0,d.QN)("whatmoreEmbedAppPositionLandscape"),[S]=(0,d.QN)("whatmoreEmbedAppHorizontalPaddingLandscape"),[I]=(0,d.QN)("whatmoreEmbedAppVerticalPaddingLandscape"),A=(0,d.Xd)("whatmoreShopId"),j=(0,d.Xd)("isWhatmorePreviewMode");var P=x,L=b,C=y;w[a.dl]===a.nN&&(P=E,L=S,C=I);const[T,N]=(0,o.useState)(["initial",window.pageYOffset]),[O,D]=(0,o.useState)(!1),k=null!==(t=e.isSpotlight)&&void 0!==t&&t,z=w[a.dl]===a.nN?.7*(0,m.O86)(A):(0,m.O86)(A),V=k?z:1;c*=V,u*=V;const M=k?(0,m.LrK)(A):P,Q=k?(0,m._2D)(A):(0,m.GSq)(A),[R,W]=(0,o.useState)(!k&&(0,m.n8Q)(A));function F(e,t){N(e),e[1]<=100?D(!1):t!=O&&(D(t),W(!1))}(0,o.useEffect)((()=>{let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;Math.abs(n-e)<100||(F([n>e?"scrolled-down":"scrolled-up",n],!0),e=n>0?n:0),t=!1},i=()=>{t||(window.requestAnimationFrame(n),t=!0)};return window.addEventListener("scroll",i),()=>window.removeEventListener("scroll",i)}),[T]),(0,i.j)({ref:n,handler:()=>{F(["scrolled-up",T[1]],!0)}});const B=e.event,$=e.inVideoClick,G=e.closeClick,H=.3*u,K=.6*u,U=.1*u,Y=.1*(.5*u),X="round"==g?"10px":"0px",q=(0,m.GvQ)(A);var J=!1,Z=0,ee=0;function te(e){J=e}return(0,f.jsx)("div",{className:"wht-popup",children:R&&!Q?(0,f.jsx)(f.Fragment,{}):O&&Q?(0,f.jsx)("div",{style:"left"===M?{left:"1px",bottom:k?(0,m.pUQ)(A)+"px":C+"px",position:"fixed",zIndex:q}:{right:"5px",bottom:k?(0,m.pUQ)(A)+"px":C+"px",position:"fixed",zIndex:q},children:(0,f.jsxs)("div",{onClick:()=>{F(["initial",T[1]],!1)},style:{margin:"1px",width:u+"px",height:c+"px"},className:"left"===M?"whatmore-ultraminimized-video-view-left":"whatmore-ultraminimized-video-view-right",children:[(0,f.jsx)("div",{style:{overflow:"hidden"},children:(0,f.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,f.jsx)(r.A,{url:B.thumbnail_image,isPlaying:!1,event:B})})}),(0,f.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,f.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",height:"100%"},children:[(0,f.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,f.jsx)("div",{className:"whatmore-ultraminimized-content-scale-out",children:(0,f.jsx)(v.A,{sx:{filter:"drop-shadow(0 0 2px black);",color:"white",fontSize:H+"px"},style:{position:"relative",zIndex:1,left:Y+"px",bottom:Y+"px"},onClick:G})})}),(0,f.jsx)("div",{style:{height:"100%",display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(h.A,{sx:{color:"white",fontSize:2*H+"px",filter:"drop-shadow(0 0 2px black);"}})})]})})]})}):(0,f.jsx)(p(),{nodeRef:n,cancel:".activate-button,.close-btn",bounds:j?"parent":"html",defaultClassName:"whatmore-react-draggable",defaultClassNameDragging:"whatmore-react-draggable-dragging",defaultClassNameDragged:"whatmore-react-draggable-dragged",onStart:(e,t)=>{var n,i;n=t.x,i=t.y,Z=n,ee=i},onDrag:(e,t)=>{te(!0)},onStop:(e,t)=>{J&&(Math.abs(t.x-Z)>5||Math.abs(t.y-ee)>5)?te(!1):$(B)},children:(0,f.jsx)("div",{ref:n,style:"left"===M?{left:k?(0,m.D2A)(A)+"px":L+"px",bottom:k?(0,m.pUQ)(A)+"px":C+"px",position:"fixed",zIndex:q}:{right:k?(0,m.D2A)(A)+"px":L+"px",bottom:k?(0,m.pUQ)(A)+"px":C+"px",position:"fixed",zIndex:q},children:(0,f.jsxs)("div",{style:Object.assign({},{boxSizing:"border-box",margin:"1px",width:e.isSpotlight&&"60122562760"==A?c+"px":u+"px",height:e.isSpotlight&&"60122562760"==A?u+"px":c+"px"}),className:"left"===M?"whatmore-minimized-video-view-left":"whatmore-minimized-video-view-right",children:[(0,f.jsx)("div",{style:{overflow:"hidden",position:"relative"},children:(0,f.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:e.isSpotlight&&"60122562760"==A?16/9:9/16},children:(0,f.jsx)(r.A,{url:B.thumbnail_image,isMuted:!0,isPlaying:!0,event:B})})}),(0,f.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,f.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",height:"100%"},children:[(0,f.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,f.jsx)(v.A,{className:"close-btn",sx:{filter:"drop-shadow(0 0 2px black);",color:"white",fontSize:H+"px"},onClick:G,style:{position:"relative",zIndex:1,left:U+"px",bottom:U+"px"}})}),(0,f.jsx)("div",{style:{marginLeft:"auto",marginRight:"auto"},children:(0,f.jsx)(l.A,{sx:{color:(0,m.KFN)(A),fontSize:K+"px",filter:"drop-shadow(0 0 2px black);"}})}),(0,f.jsx)("div",{style:{paddingLeft:"2px",paddingRight:"2px",borderBottomLeftRadius:X,borderBottomRightRadius:X,backgroundImage:_?"linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.2), rgba(0,0,0,0.6))":""},children:(0,f.jsxs)("p",{style:{textAlign:"center",color:"white",fontFamily:"Sans-serif",fontWeight:"semi-bold",fontSize:.4*H+"px",margin:0,padding:0,lineHeight:"110%"},children:["\xa0",_]})})]})})]})})})})}},6649:function(e,t,n){var i=n(9950);t.A=({triggerOnce:e=!1,root:t=null,rootMargin:n="0px",threshold:o=0}={})=>{const[r,a]=(0,i.useState)(!1),[d,c]=(0,i.useState)(null),s=(0,i.useRef)(null);return(0,i.useEffect)((()=>{const i=new IntersectionObserver(((t,n)=>{t.forEach((t=>{c(t),t.isIntersecting?(a(!0),e&&n.disconnect()):e||a(!1)}))}),{root:t,rootMargin:n,threshold:o});return s.current&&i.observe(s.current),()=>{i.disconnect()}}),[e,t,n,o]),[s,r,d]}},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}})},9733:function(){}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[199],{1351:function(e,t,n){n.d(t,{PG:function(){return r},kz:function(){return s},UM:function(){return d},yP:function(){return u},DG:function(){return c}});var i=n(1348),o=n(6157);function l(e,t,n={},i){var l;const a=r[e];if(!a)return;const s=a.isActionEnabled(),c=null===i||void 0===i||null===(l=i.meta_actions)||void 0===l?void 0:l[a.customAction];(s||c)&&"function"==typeof fbq&&(async()=>{const i={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===o.O.VIDEO_PLAYBACK&&{watch_time:n.watch_time,video_duration:n.video_duration}};fbq("trackCustom",a.action,i),c&&setTimeout((()=>{null===c||void 0===c||c.forEach((e=>{fbq("trackCustom",e,i)}))}),500)})()}var a=n(7145);const r={[o.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[o.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[o.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[o.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[o.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[o.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[o.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[o.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function s({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:s}){var c;(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:s}),e in r&&l(e,null!==(c=null===o||void 0===o?void 0:o[1])&&void 0!==c?c:null===o||void 0===o?void 0:o[0],t,i)}function c({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:s}){var c;(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:s}),e in r&&l(e,null!==(c=null===o||void 0===o?void 0:o[1])&&void 0!==c?c:null===o||void 0===o?void 0:o[0],t,i)}function d({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l}){(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l})}function u({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l}){(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l})}},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),g=n(8945),_=n(9821),S=n(4414);const y=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(340),n.e(571),n.e(987),n.e(669),n.e(665)]).then(n.bind(n,7206)))),w=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(437),n.e(571),n.e(516),n.e(620),n.e(116)]).then(n.bind(n,7144)))),f=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(879),n.e(571),n.e(987),n.e(703),n.e(423)]).then(n.bind(n,517)))),I=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(879),n.e(571),n.e(987),n.e(703),n.e(412)]).then(n.bind(n,7646)))),E=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(879),n.e(571),n.e(987),n.e(703),n.e(221)]).then(n.bind(n,5451)))),x=i.lazy((()=>Promise.all([n.e(317),n.e(59),n.e(571),n.e(491)]).then(n.bind(n,4295)))),O=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(57),n.e(571),n.e(987),n.e(669),n.e(988),n.e(620),n.e(474)]).then(n.bind(n,6945)))),T=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(475),n.e(571),n.e(669),n.e(485)]).then(n.bind(n,9418)))),C=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(571),n.e(987),n.e(676)]).then(n.bind(n,3369)))),b=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(57),n.e(571),n.e(987),n.e(669),n.e(988),n.e(891)]).then(n.bind(n,7178)))),D=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(437),n.e(286),n.e(451),n.e(57),n.e(571),n.e(987),n.e(669),n.e(262),n.e(413),n.e(988),n.e(306)]).then(n.bind(n,9406)))),j=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(437),n.e(571),n.e(669),n.e(516),n.e(933)]).then(n.bind(n,6989)))),L=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(437),n.e(286),n.e(451),n.e(438),n.e(571),n.e(987),n.e(669),n.e(262),n.e(413),n.e(806)]).then(n.bind(n,3278)))),q=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(879),n.e(571),n.e(987),n.e(1)]).then(n.bind(n,4596)))),P=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(437),n.e(286),n.e(451),n.e(571),n.e(987),n.e(669),n.e(262),n.e(413),n.e(906)]).then(n.bind(n,6413)))),A=i.lazy((()=>n.e(374).then(n.bind(n,5100))));var W=function(e){var t,W;const[k]=(0,a.QN)("isInDesignMode"),[$]=(0,a.QN)("isDemoBrand"),[N]=(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),[Z,Y]=(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,t=!1,i=null){(0,c.MN)()&&(0,_._)()&&!t&&(0,d.bo)(),k||$||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.all([n.e(286),n.e(907)]).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)})),Y(a),te(e)}async function se(e,t=!1){(0,c.MN)()&&(0,_._)()&&!t&&await(0,d.bo)(),Y(e.index),((0,v.ij)(e)||(0,v.Il)(e))&&(k||$||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.all([n.e(286),n.e(907)]).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,S.jsx)(S.Fragment,{})}return(0,i.useEffect)((()=>{if(U)if((0,g.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,S.jsxs)(S.Fragment,{children:[Q&&(0,S.jsx)(A,{}),-1==Z||-2==Z?(0,S.jsx)(ce,{}):(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.EVENT_VIEW,event:ne[Z],productList:null===(t=ne[Z])||void 0===t?void 0:t.products,cta:null===(W=ne[Z])||void 0===W?void 0:W.cta,triggerFlag:!k&&!$,children:(0,S.jsx)(P,{events:ie,index:Z,onBack:async function(){Y(-1),X(!1)},slideDirection:V||"horizontal"===(0,r.br0)(B)?"horizontal":"vertical",eventsStories:oe,initialStoryIndex:ee,template:F})})}),(0,S.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(V?G:N)+"px",marginBottom:(V?G:N)+"px"},children:"template-b"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(y,{events:ne,onClick:se,heading:e.heading})})}):"template-a-1"===F||"template-collections-a-1"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(w,{events:ne,onClick:se,heading:e.heading})}):"template-feed-a"===F||"template-collections-feed-a"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(j,{events:ne,onClick:se,heading:e.heading})}):"template-collections-a"===F||"template-c"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(f,{events:ne,index:Z,setScreen:Y,onClick:se,heading:e.heading})})}):"template-collections-b"===F||"template-d"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(I,{events:ne,index:Z,setScreen:Y,onClick:se,heading:e.heading})})}):"template-collections-c"===F||"template-e"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(E,{events:ne,index:Z,setScreen:Y,onClick:se,heading:e.heading})})}):"template-collections-d"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(y,{events:ne,index:Z,setScreen:Y,onClick:se,heading:e.heading})})}):"template-collections-e"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(O,{events:ne,index:Z,setScreen:Y,onClick:se,heading:e.heading})})}):"template-collections-stories"===F||"template-stories"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(q,{events:ne,index:Z,setScreen:Y,onClick:se,heading:e.heading})})}):"template-f"===F||"template-collections-f"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(T,{events:ne,onClick:se,heading:e.heading})})}):"template-g"===F||"template-collections-g"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(C,{events:ne,onClick:se,heading:e.heading})})}):"template-h"===F||"template-collections-h"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(b,{events:ne,onClick:se,heading:e.heading})})}):"template-i"===F||"template-collections-i"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(D,{index:Z,events:ne,onClick:se,heading:e.heading})})}):"template-banner-a"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.BANNER_WIDGET_VIEW,event:ne[0],triggerFlag:!k&&!$,children:(0,S.jsx)(L,{events:ne})})}):V?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.STORIES_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(x,{eventsStories:oe,onClick:re,template:F})})}):(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(O,{events:ne,onClick:se,heading:e.heading})})})})]})},k=n(7802),$=n(6641),N=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)(),[g,y]=(0,i.useState)(),{whatmoreIsStoriesTemplate:w}=(0,i.useContext)(u.B),{whatmoreIsCollectionsTemplate:f}=(0,i.useContext)(u.B),{whatmoreIsBannerTemplate:I}=(0,i.useContext)(u.B),[E]=(0,a.QN)("whatmoreShopId"),[x]=(0,a.QN)("whatmoreCollectionId"),O=(0,a.Xd)("whatmoreLandingLocationType"),T=(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"),[q]=(0,a.QN)("isDemoBrand"),P=(0,r.mJ$)(E)?(0,r.jLA)(E)?j:window.location.href.split(/[?#]/)[0]:x,[A,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",Z=(0,r.SOt)(E)?o.aD+"/v2/brand/"+E+"/product-events":o.$$+"/v2/brand/"+E+"/product-events",Y=e.shopId,ee="live,upcoming",te="true";return(0,i.useEffect)((()=>{null!=t&&0!=t.length&&!g&&(0,c.MN)()&&!(0,a.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,_._)()&&(0,d.Pc)(d.F5)}),[t]),(0,i.useEffect)((()=>{var e,t,i,c;if((0,s.wm)(),O.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?V(window.location.href).split("/").pop():V(window.location.href)}(E):d,(0,r.vvU)(E))c=z.toString()+Y.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=Z.toString()+"?client_product_id="+d.toString()+"&status="+ee.toString()+"&event_type=video"}else if(f||"invalid-url"!==j)c=(0,r.JwJ)(E)?`${Q.toString()}?store_id=${Y.toString()}&client_collection_id=${"index"==O&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`:"78232846646"==E?`${X.toString()}?store_id=${Y.toString()}&client_collection_id=${"index"==O&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`:`${U.toString()}?store_id=${Y.toString()}&client_collection_id=${"index"==O&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`;else if(I){const e=p.Jh,t=(0,p.t6)(O);c=J.toString()+Y.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+E}else{var u,v,h,g;if(("72201044272"==E||"2665447536"==E&&D)&&!w)c=R.toString()+Y.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===(g=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===g?void 0:g.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()+Y.toString()+"?status="+ee.toString()+"&is_active="+te.toString():"78232846646"!=E||w?z.toString()+Y.toString()+"?status="+ee.toString()+"&is_active="+te.toString()+(w?"&template_type=stories":""):K.toString()+Y.toString()+"?status="+ee.toString()+"&is_active="+te.toString()}const _=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&&O.startsWith("index")&&"object"==typeof _&&(null===_||void 0===_?void 0:_.length)>0?(l(_),m(_),M(!0)):fetch(c).then((e=>e.json())).then((e=>{var t;if(I){const t=p.Jh;return(0,k.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,k.Np)(e,f||"invalid-url"!==j)})).then((e=>{var t,n;T&&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,k.d8)(i):(0,k.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((q||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:I?i:e)};e()}else l(e);M(!0)})).catch((e=>{y(e.message),M(!0)}))}),[]),(0,i.useEffect)((()=>{"index"===O?t&&t.length>0&&(0,N.yP)({userInteractionType:h.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===O?(t&&t.length>0||(0,r.BZ$)(E))&&(0,N.yP)({userInteractionType:h.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===O&&(t&&t.length>0||(0,r.WKl)(E))&&(0,N.yP)({userInteractionType:h.O.PDP_VISITED,widgetSourceDetails:C})}),[t]),F&&(null==t||0==t.length||g)&&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(!f){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||g?(0,S.jsx)("div",{}):(T&&(0,$.xv)(t),T&&console.debug("final transformed events data : "+JSON.stringify(t)),T&&console.debug("valid events size : "+t.length),(0,S.jsx)(W,{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,t=!1){var n,i;if(null!=e)return t?{events:e.events[0].events,all_events:null!==(i=null===e||void 0===e?void 0:e.all_events)&&void 0!==i?i:[]}:{events:null===e||void 0===e?void 0:e.events,all_events:null!==(n=null===e||void 0===e?void 0:e.all_events)&&void 0!==n?n:[]}};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 r},kz:function(){return s},UM:function(){return d},yP:function(){return u},DG:function(){return c}});var i=n(1348),o=n(6157);function l(e,t,n={},i){var l;const a=r[e];if(!a)return;const s=a.isActionEnabled(),c=null===i||void 0===i||null===(l=i.meta_actions)||void 0===l?void 0:l[a.customAction];(s||c)&&"function"==typeof fbq&&(async()=>{const i={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===o.O.VIDEO_PLAYBACK&&{watch_time:n.watch_time,video_duration:n.video_duration}};fbq("trackCustom",a.action,i),c&&setTimeout((()=>{null===c||void 0===c||c.forEach((e=>{fbq("trackCustom",e,i)}))}),500)})()}var a=n(7145);const r={[o.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[o.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[o.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[o.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[o.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[o.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[o.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[o.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function s({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:s}){var c;(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:s}),e in r&&l(e,null!==(c=null===o||void 0===o?void 0:o[1])&&void 0!==c?c:null===o||void 0===o?void 0:o[0],t,i)}function c({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:s}){var c;(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:s}),e in r&&l(e,null!==(c=null===o||void 0===o?void 0:o[1])&&void 0!==c?c:null===o||void 0===o?void 0:o[0],t,i)}function d({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l}){(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l})}function u({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l}){(0,a.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l})}},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),g=n(8945),_=n(9821),S=n(4414);const y=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(340),n.e(571),n.e(987),n.e(669),n.e(665)]).then(n.bind(n,7206)))),w=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(437),n.e(571),n.e(516),n.e(620),n.e(116)]).then(n.bind(n,7144)))),I=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(879),n.e(571),n.e(987),n.e(703),n.e(423)]).then(n.bind(n,517)))),f=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(879),n.e(571),n.e(987),n.e(703),n.e(412)]).then(n.bind(n,7646)))),E=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(879),n.e(571),n.e(987),n.e(703),n.e(221)]).then(n.bind(n,5451)))),x=i.lazy((()=>Promise.all([n.e(317),n.e(59),n.e(571),n.e(491)]).then(n.bind(n,4295)))),O=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(57),n.e(571),n.e(987),n.e(669),n.e(988),n.e(620),n.e(474)]).then(n.bind(n,6945)))),T=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(475),n.e(571),n.e(669),n.e(485)]).then(n.bind(n,9418)))),C=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(571),n.e(987),n.e(676)]).then(n.bind(n,3369)))),b=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(57),n.e(571),n.e(987),n.e(669),n.e(988),n.e(891)]).then(n.bind(n,7178)))),D=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(437),n.e(286),n.e(451),n.e(57),n.e(571),n.e(987),n.e(669),n.e(262),n.e(413),n.e(988),n.e(306)]).then(n.bind(n,9406)))),j=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(437),n.e(571),n.e(669),n.e(516),n.e(933)]).then(n.bind(n,6989)))),L=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(437),n.e(286),n.e(451),n.e(438),n.e(571),n.e(987),n.e(669),n.e(262),n.e(413),n.e(806)]).then(n.bind(n,3278)))),q=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(879),n.e(571),n.e(987),n.e(1)]).then(n.bind(n,4596)))),P=i.lazy((()=>Promise.all([n.e(317),n.e(304),n.e(59),n.e(946),n.e(437),n.e(286),n.e(451),n.e(571),n.e(987),n.e(669),n.e(262),n.e(413),n.e(906)]).then(n.bind(n,6413)))),A=i.lazy((()=>n.e(374).then(n.bind(n,5100))));var W=function(e){var t,W;const[k]=(0,a.QN)("isInDesignMode"),[$]=(0,a.QN)("isDemoBrand"),[N]=(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,t=!1,i=null){(0,c.MN)()&&(0,_._)()&&!t&&(0,d.bo)(),k||$||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.all([n.e(286),n.e(907)]).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,t=!1){(0,c.MN)()&&(0,_._)()&&!t&&await(0,d.bo)(),Z(e.index),((0,v.ij)(e)||(0,v.Il)(e))&&(k||$||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.all([n.e(286),n.e(907)]).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,S.jsx)(S.Fragment,{})}return(0,i.useEffect)((()=>{if(U)if((0,g.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,S.jsxs)(S.Fragment,{children:[Q&&(0,S.jsx)(A,{}),-1==Y||-2==Y?(0,S.jsx)(ce,{}):(0,S.jsx)(i.Suspense,{children:(0,S.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===(W=ne[Y])||void 0===W?void 0:W.cta,triggerFlag:!k&&!$,children:(0,S.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,S.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(V?G:N)+"px",marginBottom:(V?G:N)+"px"},children:"template-b"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(y,{events:ne,onClick:se,heading:e.heading})})}):"template-a-1"===F||"template-collections-a-1"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(w,{events:ne,onClick:se,heading:e.heading})}):"template-feed-a"===F||"template-collections-feed-a"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(j,{events:ne,onClick:se,heading:e.heading})}):"template-collections-a"===F||"template-c"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(I,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-b"===F||"template-d"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(f,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-c"===F||"template-e"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(E,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-d"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(y,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-e"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(O,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-collections-stories"===F||"template-stories"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(q,{events:ne,index:Y,setScreen:Z,onClick:se,heading:e.heading})})}):"template-f"===F||"template-collections-f"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(T,{events:ne,onClick:se,heading:e.heading})})}):"template-g"===F||"template-collections-g"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(C,{events:ne,onClick:se,heading:e.heading})})}):"template-h"===F||"template-collections-h"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(b,{events:ne,onClick:se,heading:e.heading})})}):"template-i"===F||"template-collections-i"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(D,{index:Y,events:ne,onClick:se,heading:e.heading})})}):"template-banner-a"===F?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.BANNER_WIDGET_VIEW,event:ne[0],triggerFlag:!k&&!$,children:(0,S.jsx)(L,{events:ne})})}):V?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.STORIES_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(x,{eventsStories:oe,onClick:re,template:F})})}):(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!k&&!$,children:(0,S.jsx)(O,{events:ne,onClick:se,heading:e.heading})})})})]})},k=n(7802),$=n(6641),N=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)(),[g,y]=(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"),O=(0,a.Xd)("whatmoreLandingLocationType"),T=(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"),[q]=(0,a.QN)("isDemoBrand"),P=(0,r.mJ$)(E)?(0,r.jLA)(E)?j:window.location.href.split(/[?#]/)[0]:x,[A,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&&!g&&(0,c.MN)()&&!(0,a.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,_._)()&&(0,d.Pc)(d.F5)}),[t]),(0,i.useEffect)((()=>{var e,t,i,c;if((0,s.wm)(),O.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"==O&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`:"78232846646"==E?`${X.toString()}?store_id=${Z.toString()}&client_collection_id=${"index"==O&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`:`${U.toString()}?store_id=${Z.toString()}&client_collection_id=${"index"==O&&(0,r.FKG)(E).length>0?(0,r.FKG)(E)[0]:P}`;else if(f){const e=p.Jh,t=(0,p.t6)(O);c=J.toString()+Z.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+E}else{var u,v,h,g;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===(g=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===g?void 0:g.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 _=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&&O.startsWith("index")&&"object"==typeof _&&(null===_||void 0===_?void 0:_.length)>0?(l(_),m(_),M(!0)):fetch(c).then((e=>e.json())).then((e=>{var t;if(f){const t=p.Jh;return(0,k.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,k.Np)(e,I||"invalid-url"!==j)})).then((e=>{var t,n;T&&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,k.d8)(i):(0,k.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((q||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=>{y(e.message),M(!0)}))}),[]),(0,i.useEffect)((()=>{"index"===O?t&&t.length>0&&(0,N.yP)({userInteractionType:h.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===O?(t&&t.length>0||(0,r.BZ$)(E))&&(0,N.yP)({userInteractionType:h.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===O&&(t&&t.length>0||(0,r.WKl)(E))&&(0,N.yP)({userInteractionType:h.O.PDP_VISITED,widgetSourceDetails:C})}),[t]),F&&(null==t||0==t.length||g)&&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||g?(0,S.jsx)("div",{}):(T&&(0,$.xv)(t),T&&console.debug("final transformed events data : "+JSON.stringify(t)),T&&console.debug("valid events size : "+t.length),(0,S.jsx)(W,{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,t=!1){var n,i;if(null!=e)return t?{events:e.events[0].events,all_events:null!==(i=null===e||void 0===e?void 0:e.all_events)&&void 0!==i?i:[]}:{events:null===e||void 0===e?void 0:e.events,all_events:null!==(n=null===e||void 0===e?void 0:e.all_events)&&void 0!==n?n:[]}};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}})}}]);