whatmore-react-assets 1.0.547 → 1.0.549

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.547",
3
+ "version": "1.0.549",
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([[708],{1291:function(e,t,n){n.r(t);var o=n(7313),i=n(6090),r=n(7616),l=(n(6143),n(7850),n(4444),n(7244),n(123),n(5892),n(1811),n(9302)),a=n(2575),s=n(8866),d=n(7753),c=n(7129),h=n(9039),u=n(8631),p=n(9821),x=n(8782),m=n(7381),f=n(9854),v=n(6417);const g=(0,a.Z)({key:"whatmore-css-cv"});t.default=function(e){var t;const[n,a,w]=(0,s.Z)(),[y,j,E,C,L]=(0,p.Z)(),M=(0,d.MO)("whatmoreCollectionsTileSize"),S="portrait"==n?0:(0,d.MO)("whatmoreLandscapePadding"),k=(0,d.MO)("whatmoreCollectionsTilesSpacing"),R=(0,d.MO)("whatmoreShopId"),[b]=(0,d.MO)("whatmorePrimaryColor"),{whatmoreRootId:P}=(0,o.useContext)(h.I),O=e.events,F=e.onClick,T=(0,d.MO)("whatmoreTitleFont"),Z="portrait"==n?(0,d.MO)("whatmoreTitleFontSizePortrait"):(0,d.MO)("whatmoreTitleFontSize"),A=null!==(t=(0,f.aRS)(R))&&void 0!==t?t:T;delete r.ZP.styles.global;var z=[];for(let o=0;o<O.length;)z.push((0,v.jsx)(u.Z,{event:O[o],onClick:()=>{var e;e=O[o-1],F(e)},removeBorders:!0,borderRadius:"5%"},"collections-tile-"+o)),o+=1;return(0,o.useEffect)((()=>{(0,m.Oo)("Video shopping powered by Whatmore!")}),[]),(0,v.jsx)(l.C,{value:g,children:(0,v.jsx)("div",{children:(0,v.jsx)(i.x,{theme:r.ZP,cssVarsRoot:P,resetCSS:!1,children:(0,v.jsxs)(c.V.Provider,{value:{tileTopMargin:0,tileBottomMMargin:0,tileLeftMargin:0,tileRightMargin:0,showPlayButton:!1},children:[e.heading.trim().length>0?(0,v.jsx)("div",{className:"whatmore-events-carousel",style:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,v.jsx)("p",{ref:e=>{e&&(e.style.setProperty("font-family",A,"important"),e.style.setProperty("font-size",Z+"px","important"))},style:{color:b,backgroundClip:"text",textAlign:"center",fontWeight:(0,f.wOV)(R),lineHeight:(0,f.vY4)(R),letterSpacing:(0,f.X2K)(R)},children:e.heading})}):(0,v.jsx)(v.Fragment,{}),(0,v.jsx)("div",{style:{marginLeft:S+"px",marginRight:S+"px"},children:(0,v.jsx)(x.P,{renderElement:e=>(0,v.jsx)(v.Fragment,{children:e.eventData}),dataList:z,spacing:k,defaultHeight:y*M*.01+"px",defaultWidth:j*M*.01+"px",retainAlreadyRenderedElements:!0})})]})})})})}},7129:function(e,t,n){n.d(t,{V:function(){return o}});const o=(0,n(7313).createContext)({tileTopMargin:10,tileBottomMMargin:10,tileLeftMargin:10,tileRightMargin:10,showPlayButton:!0})},8631:function(e,t,n){var o=n(7313),i=n(9854),r=n(7753),l=(n(9111),n(123),n(9778),n(4892)),a=n(7129),s=n(9821),d=n(6417);t.Z=function(e){var t;const[n,c,h,u,p]=(0,s.Z)(),[x]=(0,r.j1)("whatmoreSecondaryColor"),[m]=(0,r.j1)("whatmoreShopId"),[f]=(0,r.j1)("whatmoreCollectionsTileSize"),[v,g]=(0,o.useState)(!1),w=(0,i.f63)(m);(0,o.useContext)(a.V);const y=e.event,j=e.onClick,E=e.removeBorders,C=n*f*.01,L=c*f*.01,M=null!==(t=e.borderRadius)&&void 0!==t?t:"0%";return(0,d.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:L+"px",marginLeft:E?"2px":"5px",marginRight:E?"2px":"5px",marginTop:E?"2px":"5px",marginBottom:E?"2px":"5px",cursor:"pointer"},onClick:()=>{g(!0),j(y)},className:[v?"whatmore-scale-on-tap":""].join(" "),children:(0,d.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:"fit-content",borderRadius:M,overflow:"hidden",boxShadow:E?"":"0px 1px 1px 0px "+x+"50, 0px -1px 1px 0px "+w+"50, 1px 0px 1px 0px "+x+"50, -1px 0px 1px 0px "+w+"80, 1px -1px 1px 0px "+x+"80, -1px 1px 1px 0px "+w+"DA, 1px 1px 1px 0px "+x+"DA, -1px -1px 1px 0px "+w+"DA"},children:(0,d.jsx)("div",{style:{flexShrink:0,objectFit:"cover",height:C+"px",width:L+"px",borderRadius:M,backgroundColor:"gray",overflow:"hidden"},children:(0,d.jsx)(l.Z,{height:"100%",width:"100%",url:y.thumbnail_image,isPlaying:!0,event:y})})})})}},8782:function(e,t,n){n.d(t,{P:function(){return a}});var o=n(3933),i=n(7313),r=(n(123),n(6417));function l(e){const{ref:t,inView:n,entry:i}=(0,o.YD)({triggerOnce:e.retainAlreadyRenderedElements});return(0,r.jsx)("div",{ref:t,children:n?e.renderElement({eventData:e.data}):(0,r.jsx)("div",{style:{minWidth:e.defaultHeight,minHeight:e.defaultWidth}})})}function a(e){var t;return(0,i.useEffect)((()=>{const e=document.querySelector(".whatmore-carousel-horizontal-flex");let t,n=!1;function o(e){e.touches&&(null===e||void 0===e?void 0:e.touches.length)>0?(n=!0,t=e.touches[0].clientX):(n=!0,t=e.clientX)}function i(o){if(!n)return;const i=o.touches?o.touches[0].clientX:o.clientX;e.style.pointerEvents="none";const r=2*(t-i);e.scrollLeft+=r,t=i}function r(t){e.style.pointerEvents="auto",n=!1}return e&&("ontouchstart"in window&&(e.addEventListener("touchstart",o),e.addEventListener("touchmove",i),e.addEventListener("touchend",r)),e.addEventListener("mousedown",o),document.addEventListener("mousemove",i),document.addEventListener("mouseup",r)),()=>{e&&("ontouchstart"in window&&(e.removeEventListener("touchstart",o),e.removeEventListener("touchmove",i),e.removeEventListener("touchend",r)),e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",r))}}),[]),(0,r.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",height:"fit-content",width:"100%",gap:null!==(t=e.spacing)&&void 0!==t?t:3},className:"whatmore-carousel-horizontal-flex",children:e.dataList.map(((t,n)=>(0,r.jsx)(l,{renderElement:e.renderElement,data:t,defaultHeight:e.defaultHeight,defaultWidth:e.defaultWidth,retainAlreadyRenderedElements:e.retainAlreadyRenderedElements},"key-"+n)))})}},9111:function(){},5892:function(){},4444:function(){},1811:function(){},6143:function(){},7850:function(){},9778:function(){}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[74],{5380:function(e,t,n){n.d(t,{Z:function(){return v}});var i=n(4959),o=n(7313),a=n(4892),r=n(6805),s=n(7753),d=n(9821);var l=function(e){const[t,n,i,o,a]=(0,d.Z)(),[l]=(0,s.j1)("whatmoreEmbedAppVideoPlayerSizePortrait"),[c]=(0,s.j1)("whatmoreEmbedAppVideoPlayerSizeLandscape"),p=a[r.YP]===r.$w?c/100:l/100*1.2;return[t*p,n*p,a]},c=n(9723),p=n(9461),u=n.n(p),h=n(1195),w=n(7108),f=(n(7244),n(123),n(9854)),x=n(9039),g=n(6417);var v=function(e){var t;const n=o.useRef(null);var[d,p,v]=l();const{whatmoreUITheme:m}=(0,o.useContext)(x.I),[y]=(0,s.j1)("whatmoreEmbedAppVideoTitle"),[b]=(0,s.j1)("whatmoreEmbedAppPositionPortrait"),[j]=(0,s.j1)("whatmoreEmbedAppHorizontalPaddingPortrait"),[I]=(0,s.j1)("whatmoreEmbedAppVerticalPaddingPortrait"),[S]=(0,s.j1)("whatmoreEmbedAppPositionLandscape"),[E]=(0,s.j1)("whatmoreEmbedAppHorizontalPaddingLandscape"),[L]=(0,s.j1)("whatmoreEmbedAppVerticalPaddingLandscape"),P=(0,s.MO)("whatmoreShopId");var z=b,_=j,k=I;v[r.YP]===r.$w&&(z=S,_=E,k=L);const[T,C]=(0,o.useState)(["initial",window.pageYOffset]),[D,M]=(0,o.useState)(!1),A=null!==(t=e.isSpotlight)&&void 0!==t&&t,V=v[r.YP]===r.$w?.7*(0,f.zGA)(P):(0,f.zGA)(P),O=A?V:1;d*=O,p*=O;const B=A?(0,f.G0o)(P):z,F=A?(0,f.X8j)(P):(0,f.lVn)(P),[Z,R]=(0,o.useState)(!A&&(0,f.eXi)(P));function N(e,t){C(e),e[1]<=100?M(!1):t!=D&&(M(t),R(!1))}(0,o.useEffect)((()=>{let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;Math.abs(n-e)<100||(N([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.O3)({ref:n,handler:()=>{N(["scrolled-up",T[1]],!0)}});const G=e.event,W=e.inVideoClick,Y=e.closeClick,K=.3*p,U=.6*p,$=.1*p,H=.1*(.5*p),J="round"==m?"10px":"0px",X=(0,f.Z$A)(P);var q=!1,Q=0,ee=0;function te(e){q=e}return(0,g.jsx)("div",{children:Z&&!F?(0,g.jsx)(g.Fragment,{}):D&&F?(0,g.jsx)("div",{style:"left"===B?{left:"1px",bottom:A?(0,f.vnu)(P)+"px":k+"px",position:"fixed",zIndex:X}:{right:"5px",bottom:A?(0,f.vnu)(P)+"px":k+"px",position:"fixed",zIndex:X},children:(0,g.jsxs)("div",{onClick:()=>{N(["initial",T[1]],!1)},style:{margin:"1px",width:p+"px",height:d+"px"},className:"left"===B?"whatmore-ultraminimized-video-view-left":"whatmore-ultraminimized-video-view-right",children:[(0,g.jsx)("div",{style:{boxShadow:"0px 0px 10px 3px #B0B0B0",borderRadius:J,overflow:"hidden"},children:(0,g.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,g.jsx)(a.Z,{url:G.thumbnail_image,isPlaying:!1,event:G})})}),(0,g.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,g.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",height:"100%"},children:[(0,g.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,g.jsx)("div",{className:"whatmore-ultraminimized-content-scale-out",children:(0,g.jsx)(h.Z,{sx:{filter:"drop-shadow(0 0 15px black);",color:"white",fontSize:K+"px"},style:{position:"relative",zIndex:1,left:H+"px",bottom:H+"px"},onClick:Y})})}),(0,g.jsx)("div",{style:{height:"100%",display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"center"},children:(0,g.jsx)(w.Z,{sx:{color:"white",fontSize:2*K+"px",filter:"drop-shadow(0 0 15px black);"}})})]})})]})}):(0,g.jsx)(u(),{nodeRef:n,cancel:".activate-button,.close-btn",defaultClassName:"whatmore-react-draggable",defaultClassNameDragging:"whatmore-react-draggable-dragging",defaultClassNameDragged:"whatmore-react-draggable-dragged",bounds:"html",onStart:(e,t)=>{var n,i;n=t.x,i=t.y,Q=n,ee=i},onDrag:(e,t)=>{te(!0)},onStop:(e,t)=>{q&&(Math.abs(t.x-Q)>5||Math.abs(t.y-ee)>5)?te(!1):W(G)},children:(0,g.jsx)("div",{ref:n,style:"left"===B?{left:A?(0,f.$II)(P)+"px":_+"px",bottom:A?(0,f.vnu)(P)+"px":k+"px",position:"fixed",zIndex:X}:{right:A?(0,f.$II)(P)+"px":_+"px",bottom:A?(0,f.vnu)(P)+"px":k+"px",position:"fixed",zIndex:X},children:(0,g.jsxs)("div",{style:Object.assign({},{boxSizing:"border-box",margin:"1px",width:p+"px",height:d+"px"}),className:"left"===B?"whatmore-minimized-video-view-left":"whatmore-minimized-video-view-right",children:[(0,g.jsx)("div",{style:{boxShadow:"0px 0px 10px 3px #B0B0B0",borderRadius:J,overflow:"hidden",position:"relative"},children:(0,g.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,g.jsx)(a.Z,{url:G.thumbnail_image,isMuted:!0,isPlaying:!0,event:G})})}),(0,g.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,g.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",height:"100%"},children:[(0,g.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,g.jsx)(h.Z,{className:"close-btn",sx:{filter:"drop-shadow(0 0 15px black);",color:"white",fontSize:K+"px"},onClick:Y,style:{position:"relative",zIndex:1,left:$+"px",bottom:$+"px"}})}),(0,g.jsx)("div",{style:{marginLeft:"auto",marginRight:"auto"},children:(0,g.jsx)(c.Z,{sx:{color:(0,f.Ya_)(P),fontSize:U+"px",filter:"drop-shadow(0 0 15px black);"}})}),(0,g.jsx)("div",{style:{paddingLeft:"2px",paddingRight:"2px",borderBottomLeftRadius:J,borderBottomRightRadius:J,backgroundImage:y?"linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.2), rgba(0,0,0,0.6))":""},children:(0,g.jsxs)("p",{style:{textAlign:"center",color:"white",fontFamily:"Sans-serif",fontWeight:"semi-bold",fontSize:.4*K+"px",margin:0,padding:0,lineHeight:"110%"},children:["\xa0",y]})})]})})]})})})})}},4284:function(e,t,n){n.r(t);var i=n(7313),o=n(9854),a=n(2860),r=n(7753),s=n(5160),d=n(6967),l=n(5380),c=n(58),p=n(8984),u=n(4669),h=n(941),w=n(9302),f=n(2575),x=n(7300),g=n(6524),v=n(9039),m=n(7376),y=n(778),b=n(7643),j=n(7008),I=n(7381),S=n(6417);const E=(0,f.Z)({key:"whatmore-css-ppv"}),L=i.lazy((()=>Promise.all([n.e(819),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(903)]).then(n.bind(n,4209))));function P(e){return e.split(/[?#]/)[0]}t.default=function(e){const[t,n]=(0,i.useState)(),[f,z]=(0,i.useState)(),[_]=(0,r.j1)("isInDesignMode"),[k]=(0,r.j1)("isDemoBrand"),[T]=(0,r.j1)("whatmoreEmbedAppUseVariant"),[C,D]=(0,i.useState)(-2),[M]=(0,r.j1)("whatmoreVariantId"),[A]=(0,r.j1)("whatmoreShopId");var[V]=(0,r.j1)("whatmoreProductId");const O=(0,r.MO)("isLandingSharedLink"),B=(0,r.MO)("whatmoreShareTemplateId"),F=(0,r.MO)("whatmoreShareEventId");V=(0,o.iXA)(A)?P(window.location.href):V;const[Z,R]=(0,i.useState)((()=>"true"===T?M:V));var N=a.Gc+"/v2/brand/"+A+"/product-events";const{whatmoreWidgetSourceDetails:G}=(0,i.useContext)(v.I);(0,i.useEffect)((()=>{(0,I.Oo)("Video shopping powered by Whatmore!"),(0,d.hb)();const e=()=>{const e="_whatmore_bulk_events",t=JSON.parse(localStorage.getItem(e))||[];t&&t.length>0&&((0,j.K)(t),localStorage.removeItem(e))};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),[]),(0,i.useEffect)((()=>{(0,u.ll)(A)}),[]),(0,i.useEffect)((()=>{null==t||0==t.length||f||!(0,p.KE)()||(0,r.MO)("whatmoreVideoPlayerPoolInitiated")||(0,c.b5)(c.UD)}),[t]),(0,i.useEffect)((()=>{D(-1),fetch(N.toString()+"?client_product_id="+Z.toString()+"&status="+"upcoming".toString()+"&event_type=video").then((e=>e.json())).then((e=>e.events)).then((e=>(n(e),e))).then((e=>((0,o.yoE)(A)&&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==P(window.location.href))return;const i={product_id:n.product_id,product_link:P(window.location.href)};fetch(a.Gc+"/product",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)})}),500)}(e,Z),e))).catch((e=>{z(e.message)}))}),[Z]),(0,i.useEffect)((()=>{D(-2),t&&t.length>0&&(0,m.PB)({userInteractionType:y.K.PDP_VISITED,widgetSourceDetails:G,event:t[0],productList:t[0].products,ctaList:t[0].cta})}),[t]),(0,i.useEffect)((()=>{let e=history.pushState;history.pushState=function(){let t=e.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),t};let t=history.replaceState;history.replaceState=function(){let e=t.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("true"===T){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&&R(e)}}))}),[]),(0,i.useEffect)((()=>{null==t||0==t.length||f||O&&"template-embed"==(0,g.zv)(B)&&null!=F&&t.forEach(((e,t)=>{F==e.event_id&&W(e,!0,t)}))}),[t]);const W=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((0,p.KE)()&&!t&&(0,c.QV)(),(0,x.B6)(e)||(0,x.WJ)(e))return _||k||(async()=>{(0,s.wh)(e),(0,u.Tc)(A,a.h7,a.dU),(0,d.H4)(e.event_id,e.products,"product_page","video_popup")})(),void D(n)};function Y(){return(0,S.jsx)(S.Fragment,{})}return null==t||0==t.length||f?(0,S.jsx)("div",{}):(0,S.jsx)(w.C,{value:E,children:"no-product"===Z||-1===C||0===t.length?(0,S.jsx)(Y,{}):-2===C&&t.length>0?(0,S.jsx)("div",{children:(0,S.jsx)(b.u,{userInteractionType:y.K.PDP_POPUP_WIDGET_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!_&&!k,children:(0,S.jsx)(l.Z,{event:t[0],inVideoClick:W,closeClick:e=>{e.stopPropagation(),D(-1)}})})}):(0,S.jsx)("div",{children:(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(b.u,{userInteractionType:y.K.EVENT_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!_&&!k,children:(0,S.jsx)(L,{events:t,index:C,onBack:function(){(0,o.n2L)(A)&&(0,r.MO)("whatmoreAddedToCart")&&(0,h.D)(A,(()=>{}),100,window.location.hostname),D(-2)},template:"template-product-page"})})})})})}},7376:function(e,t,n){n.d(t,{GF:function(){return o},PB:function(){return s},Z2:function(){return a},y4:function(){return r}});var i=n(733);function o(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}function a(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}function r(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}function s(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}}}]);
1
+ "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[74],{5380:function(e,t,n){n.d(t,{Z:function(){return v}});var i=n(4959),o=n(7313),a=n(4892),r=n(6805),s=n(7753),d=n(9821);var l=function(e){const[t,n,i,o,a]=(0,d.Z)(),[l]=(0,s.j1)("whatmoreEmbedAppVideoPlayerSizePortrait"),[c]=(0,s.j1)("whatmoreEmbedAppVideoPlayerSizeLandscape"),p=a[r.YP]===r.$w?c/100:l/100*1.2;return[t*p,n*p,a]},c=n(9723),p=n(9461),u=n.n(p),h=n(1195),w=n(7108),f=(n(7244),n(123),n(9854)),x=n(9039),g=n(6417);var v=function(e){var t;const n=o.useRef(null);var[d,p,v]=l();const{whatmoreUITheme:m}=(0,o.useContext)(x.I),[y]=(0,s.j1)("whatmoreEmbedAppVideoTitle"),[b]=(0,s.j1)("whatmoreEmbedAppPositionPortrait"),[j]=(0,s.j1)("whatmoreEmbedAppHorizontalPaddingPortrait"),[I]=(0,s.j1)("whatmoreEmbedAppVerticalPaddingPortrait"),[S]=(0,s.j1)("whatmoreEmbedAppPositionLandscape"),[E]=(0,s.j1)("whatmoreEmbedAppHorizontalPaddingLandscape"),[L]=(0,s.j1)("whatmoreEmbedAppVerticalPaddingLandscape"),P=(0,s.MO)("whatmoreShopId");var z=b,_=j,k=I;v[r.YP]===r.$w&&(z=S,_=E,k=L);const[T,C]=(0,o.useState)(["initial",window.pageYOffset]),[D,M]=(0,o.useState)(!1),A=null!==(t=e.isSpotlight)&&void 0!==t&&t,V=v[r.YP]===r.$w?.7*(0,f.zGA)(P):(0,f.zGA)(P),O=A?V:1;d*=O,p*=O;const B=A?(0,f.G0o)(P):z,F=A?(0,f.X8j)(P):(0,f.lVn)(P),[Z,R]=(0,o.useState)(!A&&(0,f.eXi)(P));function N(e,t){C(e),e[1]<=100?M(!1):t!=D&&(M(t),R(!1))}(0,o.useEffect)((()=>{let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;Math.abs(n-e)<100||(N([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.O3)({ref:n,handler:()=>{N(["scrolled-up",T[1]],!0)}});const G=e.event,W=e.inVideoClick,Y=e.closeClick,K=.3*p,U=.6*p,$=.1*p,H=.1*(.5*p),J="round"==m?"10px":"0px",X=(0,f.Z$A)(P);var q=!1,Q=0,ee=0;function te(e){q=e}return(0,g.jsx)("div",{children:Z&&!F?(0,g.jsx)(g.Fragment,{}):D&&F?(0,g.jsx)("div",{style:"left"===B?{left:"1px",bottom:A?(0,f.vnu)(P)+"px":k+"px",position:"fixed",zIndex:X}:{right:"5px",bottom:A?(0,f.vnu)(P)+"px":k+"px",position:"fixed",zIndex:X},children:(0,g.jsxs)("div",{onClick:()=>{N(["initial",T[1]],!1)},style:{margin:"1px",width:p+"px",height:d+"px"},className:"left"===B?"whatmore-ultraminimized-video-view-left":"whatmore-ultraminimized-video-view-right",children:[(0,g.jsx)("div",{style:{boxShadow:"0px 0px 10px 3px #B0B0B0",borderRadius:J,overflow:"hidden"},children:(0,g.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,g.jsx)(a.Z,{url:G.thumbnail_image,isPlaying:!1,event:G})})}),(0,g.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,g.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",height:"100%"},children:[(0,g.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,g.jsx)("div",{className:"whatmore-ultraminimized-content-scale-out",children:(0,g.jsx)(h.Z,{sx:{filter:"drop-shadow(0 0 15px black);",color:"white",fontSize:K+"px"},style:{position:"relative",zIndex:1,left:H+"px",bottom:H+"px"},onClick:Y})})}),(0,g.jsx)("div",{style:{height:"100%",display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"center"},children:(0,g.jsx)(w.Z,{sx:{color:"white",fontSize:2*K+"px",filter:"drop-shadow(0 0 15px black);"}})})]})})]})}):(0,g.jsx)(u(),{nodeRef:n,cancel:".activate-button,.close-btn",defaultClassName:"whatmore-react-draggable",defaultClassNameDragging:"whatmore-react-draggable-dragging",defaultClassNameDragged:"whatmore-react-draggable-dragged",bounds:"html",onStart:(e,t)=>{var n,i;n=t.x,i=t.y,Q=n,ee=i},onDrag:(e,t)=>{te(!0)},onStop:(e,t)=>{q&&(Math.abs(t.x-Q)>5||Math.abs(t.y-ee)>5)?te(!1):W(G)},children:(0,g.jsx)("div",{ref:n,style:"left"===B?{left:A?(0,f.$II)(P)+"px":_+"px",bottom:A?(0,f.vnu)(P)+"px":k+"px",position:"fixed",zIndex:X}:{right:A?(0,f.$II)(P)+"px":_+"px",bottom:A?(0,f.vnu)(P)+"px":k+"px",position:"fixed",zIndex:X},children:(0,g.jsxs)("div",{style:Object.assign({},{boxSizing:"border-box",margin:"1px",width:p+"px",height:d+"px"}),className:"left"===B?"whatmore-minimized-video-view-left":"whatmore-minimized-video-view-right",children:[(0,g.jsx)("div",{style:{boxShadow:"0px 0px 10px 3px #B0B0B0",borderRadius:J,overflow:"hidden",position:"relative"},children:(0,g.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,g.jsx)(a.Z,{url:G.thumbnail_image,isMuted:!0,isPlaying:!0,event:G})})}),(0,g.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,g.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",height:"100%"},children:[(0,g.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,g.jsx)(h.Z,{className:"close-btn",sx:{filter:"drop-shadow(0 0 15px black);",color:"white",fontSize:K+"px"},onClick:Y,style:{position:"relative",zIndex:1,left:$+"px",bottom:$+"px"}})}),(0,g.jsx)("div",{style:{marginLeft:"auto",marginRight:"auto"},children:(0,g.jsx)(c.Z,{sx:{color:(0,f.Ya_)(P),fontSize:U+"px",filter:"drop-shadow(0 0 15px black);"}})}),(0,g.jsx)("div",{style:{paddingLeft:"2px",paddingRight:"2px",borderBottomLeftRadius:J,borderBottomRightRadius:J,backgroundImage:y?"linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.2), rgba(0,0,0,0.6))":""},children:(0,g.jsxs)("p",{style:{textAlign:"center",color:"white",fontFamily:"Sans-serif",fontWeight:"semi-bold",fontSize:.4*K+"px",margin:0,padding:0,lineHeight:"110%"},children:["\xa0",y]})})]})})]})})})})}},4284:function(e,t,n){n.r(t);var i=n(7313),o=n(9854),a=n(2860),r=n(7753),s=n(5160),d=n(6967),l=n(5380),c=n(58),p=n(8984),u=n(4669),h=n(941),w=n(9302),f=n(2575),x=n(7300),g=n(6524),v=n(9039),m=n(7376),y=n(778),b=n(7643),j=n(7008),I=n(7381),S=n(6417);const E=(0,f.Z)({key:"whatmore-css-ppv"}),L=i.lazy((()=>Promise.all([n.e(819),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(903)]).then(n.bind(n,4209))));function P(e){return e.split(/[?#]/)[0]}t.default=function(e){const[t,n]=(0,i.useState)(),[f,z]=(0,i.useState)(),[_]=(0,r.j1)("isInDesignMode"),[k]=(0,r.j1)("isDemoBrand"),[T]=(0,r.j1)("whatmoreEmbedAppUseVariant"),[C,D]=(0,i.useState)(-2),[M]=(0,r.j1)("whatmoreVariantId"),[A]=(0,r.j1)("whatmoreShopId");var[V]=(0,r.j1)("whatmoreProductId");const O=(0,r.MO)("isLandingSharedLink"),B=(0,r.MO)("whatmoreShareTemplateId"),F=(0,r.MO)("whatmoreShareEventId");V=(0,o.iXA)(A)?P(window.location.href):V;const[Z,R]=(0,i.useState)((()=>"true"===T?M:V));var N=a.Gc+"/v2/brand/"+A+"/product-events";const{whatmoreWidgetSourceDetails:G}=(0,i.useContext)(v.I);(0,i.useEffect)((()=>{(0,I.Oo)("Video shopping powered by Whatmore!"),(0,d.hb)();const e=()=>{const e="_whatmore_bulk_events",t=JSON.parse(localStorage.getItem(e))||[];t&&t.length>0&&((0,j.K)(t),localStorage.removeItem(e))};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),[]),(0,i.useEffect)((()=>{(0,u.ll)(A)}),[]),(0,i.useEffect)((()=>{null==t||0==t.length||f||!(0,p.KE)()||(0,r.MO)("whatmoreVideoPlayerPoolInitiated")||(0,c.b5)(c.UD)}),[t]),(0,i.useEffect)((()=>{D(-1),fetch(N.toString()+"?client_product_id="+Z.toString()+"&status="+"upcoming".toString()+"&event_type=video").then((e=>e.json())).then((e=>e.events)).then((e=>(n(e),e))).then((e=>((0,o.yoE)(A)&&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==P(window.location.href))return;const i={product_id:n.product_id,product_link:P(window.location.href)};fetch(a.Gc+"/product",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)})}),500)}(e,Z),e))).catch((e=>{z(e.message)}))}),[Z]),(0,i.useEffect)((()=>{D(-2),t&&(t.length>0||(0,o.uO6)(A))&&(0,m.PB)({userInteractionType:y.K.PDP_VISITED,widgetSourceDetails:G,event:t[0],productList:t[0].products,ctaList:t[0].cta})}),[t]),(0,i.useEffect)((()=>{let e=history.pushState;history.pushState=function(){let t=e.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),t};let t=history.replaceState;history.replaceState=function(){let e=t.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("true"===T){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&&R(e)}}))}),[]),(0,i.useEffect)((()=>{null==t||0==t.length||f||O&&"template-embed"==(0,g.zv)(B)&&null!=F&&t.forEach(((e,t)=>{F==e.event_id&&W(e,!0,t)}))}),[t]);const W=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((0,p.KE)()&&!t&&(0,c.QV)(),(0,x.B6)(e)||(0,x.WJ)(e))return _||k||(async()=>{(0,s.wh)(e),(0,u.Tc)(A,a.h7,a.dU),(0,d.H4)(e.event_id,e.products,"product_page","video_popup")})(),void D(n)};function Y(){return(0,S.jsx)(S.Fragment,{})}return null==t||0==t.length||f?(0,S.jsx)("div",{}):(0,S.jsx)(w.C,{value:E,children:"no-product"===Z||-1===C||0===t.length?(0,S.jsx)(Y,{}):-2===C&&t.length>0?(0,S.jsx)("div",{children:(0,S.jsx)(b.u,{userInteractionType:y.K.PDP_POPUP_WIDGET_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!_&&!k,children:(0,S.jsx)(l.Z,{event:t[0],inVideoClick:W,closeClick:e=>{e.stopPropagation(),D(-1)}})})}):(0,S.jsx)("div",{children:(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(b.u,{userInteractionType:y.K.EVENT_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!_&&!k,children:(0,S.jsx)(L,{events:t,index:C,onBack:function(){(0,o.n2L)(A)&&(0,r.MO)("whatmoreAddedToCart")&&(0,h.D)(A,(()=>{}),100,window.location.hostname),D(-2)},template:"template-product-page"})})})})})}},7376:function(e,t,n){n.d(t,{GF:function(){return o},PB:function(){return s},Z2:function(){return a},y4:function(){return r}});var i=n(733);function o(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}function a(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}function r(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}function s(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[972],{3972:function(e,t,n){n.r(t),n.d(t,{default:function(){return R}});var r=n(7753),a=n(7313),i=n(2860),o=n(499),s=n(4897),l=n(5160),c=n(9854),u=n(6967),d=n(8984),h=n(58),m=n(4669),p=n(941),g=n(9039),v=n(7300),I=n(6524),f=n(7643),S=n(778),E=n(6417);const w=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(210),n.e(926),n.e(950),n.e(303),n.e(891)]).then(n.bind(n,4095)))),T=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(576),n.e(950),n.e(364),n.e(530)]).then(n.bind(n,5523)))),y=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(358)]).then(n.bind(n,3827)))),x=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(607)]).then(n.bind(n,6071)))),_=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(708)]).then(n.bind(n,1291)))),j=a.lazy((()=>Promise.all([n.e(302),n.e(580)]).then(n.bind(n,3580)))),M=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(240),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(790)]).then(n.bind(n,4209)))),O=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(210),n.e(926),n.e(950),n.e(959)]).then(n.bind(n,4048)))),L=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(303),n.e(554)]).then(n.bind(n,9085)))),C=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(576),n.e(950),n.e(303),n.e(364),n.e(67)]).then(n.bind(n,4362)))),b=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(240),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(196)]).then(n.bind(n,4658))));var D=function(e){const[t]=(0,r.j1)("isInDesignMode"),[n]=(0,r.j1)("isDemoBrand"),[D]=(0,r.j1)("whatmoreTopBottomPadding"),[P]=(0,r.j1)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:G}=(0,a.useContext)(g.I),[W]=(0,r.j1)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:V}=(0,a.useContext)(g.I),k=(0,r.MO)("isLandingSharedLink"),z=(0,r.MO)("whatmoreShareTemplateId"),N=(0,r.MO)("whatmoreShareStoryId"),R=(0,r.MO)("whatmoreShareEventId"),[U,F]=(0,a.useState)(-1),[A,K]=(0,a.useState)(null);var Z=e.events,q=null;function B(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,d.KE)()&&!r&&(0,h.QV)(),t||n||(async()=>{const t=q[e].events[0];(0,l.wh)(t),(0,m.Tc)(W,i.Xh,i.OW),(0,u.H4)(t.event_id,t.products,"homepage","stories")})();var o=0;null!=a&&q[e].events.map(((e,t)=>{e.event_id==a&&(o=t)})),F(o),K(e)}function H(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,d.KE)()&&!r&&(0,h.QV)(),(0,v.B6)(e)||(0,v.WJ)(e))return t||n||(async()=>{(0,l.wh)(e),(0,m.Tc)(W,i.Xh,i.pR),(0,u.H4)(e.event_id,e.products,"homepage","carousel")})(),void F(e.index);const a=20;var{status:c,bannerText:p,timeToStartInMins:g}=s.Z.getEventStatus(e);g<=a&&c.name!==o.Z.LIVE.name?console.debug(" TODO : show toast on upcoming live event."):F(e.index)}function Y(e){return(0,E.jsx)(E.Fragment,{})}return G&&!q&&(q=function(e){var t=e.reduce(((e,t,n)=>{var r=t.storyset_id;return r in e?(e[r].total_events=e[r].total_events+1,e[r].events.push(t)):e[r]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,events:[t]},e}),{}),n=Object.values(t);return n.sort(((e,t)=>e.start_event_index-t.start_event_index)),n}(Z)),(0,a.useEffect)((()=>{k&&V==(0,I.zv)(z)&&(null!=N&&G?q.forEach(((e,t)=>{N==e.id&&B(t,!0,R)})):null!=R&&Z.forEach(((e,t)=>{R==e.event_id&&H(e,!0)})))}),[]),(0,E.jsxs)("div",{children:[(0,E.jsx)("div",{style:{marginTop:(G?P:D)+"px",marginBottom:(G?P:D)+"px"},children:"template-b"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(w,{events:Z,onClick:H,heading:e.heading})}):"template-a-1"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(T,{events:Z,onClick:H,heading:e.heading})}):"template-feed-a"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(C,{events:Z,onClick:H,heading:e.heading})}):"template-collections-a"===V||"template-c"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(y,{events:Z,onClick:H,heading:e.heading})})}):"template-collections-b"===V||"template-d"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(x,{events:Z,onClick:H,heading:e.heading})})}):"template-collections-c"===V||"template-e"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(_,{events:Z,onClick:H,heading:e.heading})})}):"template-collections-d"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(w,{events:Z,onClick:H,heading:e.heading})})}):"template-collections-e"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(O,{events:Z,onClick:H,heading:e.heading})})}):"template-f"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(L,{events:Z,onClick:H,heading:e.heading})})}):"template-banner-a"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.BANNER_WIDGET_VIEW,event:Z[0],triggerFlag:!t&&!n,children:(0,E.jsx)(b,{events:Z})})}):G?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.STORIES_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(j,{eventsStories:q,onClick:B,template:V})})}):(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(O,{events:Z,onClick:H,heading:e.heading})})})}),-1==U?(0,E.jsx)(Y,{}):(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.EVENT_VIEW,event:Z[U],productList:Z[U].products,cta:Z[U].cta,triggerFlag:!t&&!n,children:(0,E.jsx)(M,{events:Z,index:U,onBack:function(e){(0,c.n2L)(W)&&(0,r.MO)("whatmoreAddedToCart")&&(0,p.D)(W,(()=>{}),100,window.location.hostname),F(-1)},slideDirection:G||"horizontal"===(0,c.e8z)(W)?"horizontal":"vertical",eventsStories:q,initialStoryIndex:A,template:V})})})]})};const P=function(e,t,n){const a=(0,r.MO)("whatmoreShopId");var i=t.reduce(((e,t,n)=>(t.products.map((e=>e.client_product_id)).forEach((t=>{t in e||(e[t]=!0)})),e)),{}),o=Object.keys(i);if("60960964855"==a&&"undefined"!=typeof fera&&"function"===typeof fera.getRatings){var s={};fera.getRatings(o,(e=>{new Promise(((t,n)=>{e.forEach((e=>{s[e.external_product_id]={avgRating:e.average,totalRatings:e.count}})),t(s)})).then((e=>n(e)))}))}if("23114481744"==a){const e="1e6MQXxzYR19mpw9Km6Dcm86";s={};fetch("https://api.juniphq.com/v1/products?filter[remote_ids]="+o.toString(),{headers:{"Junip-Store-Key":e}}).then((e=>e.json())).then((e=>(e.products.forEach((e=>{s[e.remote_id]={avgRating:parseFloat(e.rating_average).toFixed(1),totalRatings:e.rating_count}})),s))).then((e=>n(e))).catch((e=>console.error(e)))}};var G=n(3388),W=n(7381),V=n(7376),k=n(7008);var z=function(e){const[t,n]=(0,a.useState)(),[o,s]=(0,a.useState)(),{whatmoreIsStoriesTemplate:l}=(0,a.useContext)(g.I),{whatmoreIsCollectionsTemplate:m}=(0,a.useContext)(g.I),{whatmoreIsBannerTemplate:p}=(0,a.useContext)(g.I),[v]=(0,r.j1)("whatmoreShopId"),[f]=(0,r.j1)("whatmoreCollectionId"),w=(0,r.MO)("whatmoreLandingLocationType"),T=(0,r.MO)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:y}=(0,a.useContext)(g.I),{whatmoreCollectionUrl:x}=(0,a.useContext)(g.I),_=(0,c.cZT)(v)?(0,c._uv)(v)?x:window.location.href.split(/[?#]/)[0]:f,[j,M]=(0,r.j1)("productRatings");var O=(0,c.efR)(v)?i.Dm+"/v2/events/":i.Gc+"/v2/events/",L=(0,c.efR)(v)?i.Dm+"/get_eventset/":i.Gc+"/get_eventset/",C=(0,c.efR)(v)?i.Dm+"/v2/collection":i.Gc+"/v2/collection",b=(0,c.efR)(v)?i.Dm+"/v2/brand/"+v+"/product-events":i.Gc+"/v2/brand/"+v+"/product-events",z=e.shopId,N="live,upcoming";return(0,a.useEffect)((()=>{(0,u.hb)();const e=()=>{const e="_whatmore_bulk_events",t=JSON.parse(localStorage.getItem(e))||[];t&&t.length>0&&((0,k.K)(t),localStorage.removeItem(e))};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),[]),(0,a.useEffect)((()=>{null==t||0==t.length||o||!(0,d.KE)()||(0,r.MO)("whatmoreVideoPlayerPoolInitiated")||(0,h.b5)(h.UD)}),[t]),(0,a.useEffect)((()=>{var e;if(w.startsWith("product")){var t=(0,r.MO)("whatmoreProductId");t=(0,c.iXA)(v)?function(e){return e.split(/[?#]/)[0]}(window.location.href):t,e=b.toString()+"?client_product_id="+t.toString()+"&status="+N.toString()+"&event_type=video"}else if(m||"invalid-url"!==x)e=C.toString()+"?store_id="+z.toString()+"&client_collection_id="+_;else if(p){const t=I.ls,n=(0,I.H1)(w);e=L.toString()+z.toString()+"?eventset_type="+t+"&source="+n+"&source_id="+v}else e=O.toString()+z.toString()+"?status="+N.toString()+"&is_active="+"true".toString()+(l?"&template_type=stories":"");fetch(e).then((e=>e.json())).then((e=>{if(p){const t=I.ls;return(0,G.OC)(e,t)}return(0,G.kW)(e,m||"invalid-url"!==x)})).then((e=>(T&&console.debug("initial received events size : "+e.length),l||p?e:(0,G.e8)(e,z)))).then((e=>(null!=e&&0!=e.length&&(0,c.LUY)(v)&&function(e,t,n){const a=setInterval((()=>{null===(0,r.MO)("productRatings")&&P(e,t,n)}),1e3);setTimeout((()=>{clearInterval(a)}),1e4)}(v,e,(e=>{M(e)})),e))).then((e=>{e&&0!=e.length||g.$.forEach((e=>{var t,n,r;const a=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"]'),i=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==n?n:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),o=null!==(r=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-b"]'))&&void 0!==r?r:e.querySelector('.whatmore-template-type[data="template-a"]')||e.querySelector('.whatmore-template-type[data="template-f"]')||e.querySelector('.whatmore-template-type[data="template-b"]');if(!a&&!i&&!o)return;const s=e.querySelector(".whatmore-render-root");(a&&s||i&&s||o&&s)&&(s.style.minHeight="0px")})),null==e||0==e.length||l||p||(0,c.NOv)(z,e),n(e)})).catch((e=>{s(e.message)}))}),[]),(0,a.useEffect)((()=>{"index"===w?t&&t.length>0&&(0,V.PB)({userInteractionType:S.K.HOMEPAGE_VISITED,widgetSourceDetails:y}):"collection"===w&&t&&t.length>0&&(0,V.PB)({userInteractionType:S.K.COLLECTION_PAGE_VISITED,widgetSourceDetails:y})}),[t]),null==t||0==t.length||o?(0,E.jsx)("div",{}):(T&&(0,W.EI)(t),function(e){if(null!=e){var t=0;e.forEach((e=>{e.index=t++}))}}(t),T&&console.debug("final transformed events data : "+JSON.stringify(t)),T&&console.debug("valid events size : "+t.length),(0,E.jsx)("div",{children:(0,E.jsx)(D,{heading:e.heading,events:t})},"whatmore-main-coponent"))},N=n(3933);var R=function(e){const[t]=(0,r.j1)("isInDesignMode"),[n]=(0,r.j1)("isDemoBrand"),[o]=(0,r.j1)("whatmoreShopId"),[s]=(0,r.j1)("whatmoreHeading"),[l,u]=(0,a.useState)(["initial",window.pageYOffset]),[d,h]=(0,a.useState)(!1),p=(0,r.MO)("isLandingSharedLink");(0,a.useEffect)((()=>{if((0,m.ll)(o),!(0,c.wc0)(o))return;let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;var r,a;Math.abs(n-e)<100?t=!1:(a=!0,u(r=[n>e?"scrolled-down":"scrolled-up",n]),r[1]>100&&h(a),e=n>0?n:0,t=!1)},r=()=>{t||(window.requestAnimationFrame(n),t=!0)};return window.addEventListener("scroll",r),()=>window.removeEventListener("scroll",r)}),[]);const[g,v,I]=(0,N.YD)({triggerOnce:!0});return(0,E.jsx)("div",{ref:g,children:d||v||p||!(0,c.wc0)(o)?(0,E.jsx)("div",{children:t||n?(0,E.jsx)("div",{children:(0,E.jsx)(z,{heading:s,shopId:i.aA})}):(0,E.jsx)("div",{children:(0,E.jsx)(z,{heading:s,shopId:o})})}):(0,E.jsx)(E.Fragment,{})})}},499:function(e,t){t.Z={LIVE:{name:"LIVE",color:"gray.600"},UPCOMING:{name:"UPCOMING",color:"gray.600"},DEFAULT:{name:"LIVE EVENT",color:"gray.600"},COMPLETED:{name:"ENDED",color:"gray.600"}}},4897:function(e,t,n){var r=n(499);t.Z=class{static getEventStatus(e){e.time_zone="GMT+5:30";var t=e.start_time+":00",n=e.end_time,a=e.scheduled_date,i=e.status,o=e.time_zone;if(i.toUpperCase()==r.Z.LIVE.name)return{status:r.Z.LIVE,bannerText:" "+r.Z.LIVE.name+" ",timeToStartInMins:0};if(i.toUpperCase()==r.Z.UPCOMING.name){var s=new Date(a+" "+t+" "+o),l=(new Date(a+" "+n+" "+o),function(e){var t=new Date,n=(e.getTime()-t.getTime())/1e3,a=n/60,i=a/60,o=i/24;return n<=0?{status:r.Z.COMPLETED,bannerText:" "+r.Z.COMPLETED.name+" ",timeToStartInMins:0}:n>=1&&n<=30?{status:r.Z.UPCOMING,bannerText:"Starts in "+Math.round(n)+" sec ",timeToStartInMins:n/60}:a<60?{status:r.Z.UPCOMING,bannerText:"Starts in "+Math.round(a)+" min ",timeToStartInMins:a}:i<24?{status:r.Z.UPCOMING,bannerText:"Starts in "+Math.round(i)+" hr ",timeToStartInMins:60*i}:o<7?{status:r.Z.UPCOMING,bannerText:" "+["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()]+" ",timeToStartInMins:60*o*24}:{status:r.Z.UPCOMING,bannerText:"Upcoming",timeToStartInMins:2880}}(s));return{status:l.status,bannerText:l.bannerText,timeToStartInMins:l.timeToStartInMins}}return console.error("invalid status for event :: id : "+e.event_id+", status : "+e.status),{status:r.Z.DEFAULT,bannerText:"live event",timeToStartInMins:2880}}}},3388:function(e,t,n){n.d(t,{OC:function(){return s},e8:function(){return i},kT:function(){return r},kW:function(){return o},xg:function(){return a}});const r=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},a=function(e,t){return!(void 0==e.products||0==e.products.length)},i=function(e,t){if(null!=e)return e.filter((e=>1==r(e)))},o=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null!=e)return t?e.events[0].events:e.events};const s=function(e,t){var n;if(null==e)return[];if(!("eventsets"in e))return[];const r=null!==(n=e.eventsets[t])&&void 0!==n?n:null;return r?function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach((e=>{e.events.forEach((e=>{t.push(e)}))})),t}(r):[]}},7376:function(e,t,n){n.d(t,{GF:function(){return a},PB:function(){return s},Z2:function(){return i},y4:function(){return o}});var r=n(733);function a(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s}=e;(0,r.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s})}function i(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s}=e;(0,r.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s})}function o(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s}=e;(0,r.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s})}function s(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s}=e;(0,r.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s})}}}]);
1
+ "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[972],{3972:function(e,t,n){n.r(t),n.d(t,{default:function(){return R}});var r=n(7753),a=n(7313),i=n(2860),o=n(499),s=n(4897),l=n(5160),c=n(9854),u=n(6967),d=n(8984),h=n(58),m=n(4669),p=n(941),g=n(9039),v=n(7300),I=n(6524),f=n(7643),S=n(778),E=n(6417);const w=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(210),n.e(926),n.e(950),n.e(303),n.e(891)]).then(n.bind(n,4095)))),T=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(576),n.e(950),n.e(364),n.e(530)]).then(n.bind(n,5523)))),y=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(358)]).then(n.bind(n,3827)))),x=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(607)]).then(n.bind(n,6071)))),_=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(708)]).then(n.bind(n,1291)))),j=a.lazy((()=>Promise.all([n.e(302),n.e(580)]).then(n.bind(n,3580)))),M=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(240),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(790)]).then(n.bind(n,4209)))),O=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(210),n.e(926),n.e(950),n.e(959)]).then(n.bind(n,4048)))),L=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(303),n.e(554)]).then(n.bind(n,9085)))),C=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(576),n.e(950),n.e(303),n.e(364),n.e(67)]).then(n.bind(n,4362)))),b=a.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(240),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(196)]).then(n.bind(n,4658))));var D=function(e){const[t]=(0,r.j1)("isInDesignMode"),[n]=(0,r.j1)("isDemoBrand"),[D]=(0,r.j1)("whatmoreTopBottomPadding"),[P]=(0,r.j1)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:G}=(0,a.useContext)(g.I),[W]=(0,r.j1)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:V}=(0,a.useContext)(g.I),k=(0,r.MO)("isLandingSharedLink"),z=(0,r.MO)("whatmoreShareTemplateId"),N=(0,r.MO)("whatmoreShareStoryId"),R=(0,r.MO)("whatmoreShareEventId"),[U,F]=(0,a.useState)(-1),[A,K]=(0,a.useState)(null);var Z=e.events,B=null;function q(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,d.KE)()&&!r&&(0,h.QV)(),t||n||(async()=>{const t=B[e].events[0];(0,l.wh)(t),(0,m.Tc)(W,i.Xh,i.OW),(0,u.H4)(t.event_id,t.products,"homepage","stories")})();var o=0;null!=a&&B[e].events.map(((e,t)=>{e.event_id==a&&(o=t)})),F(o),K(e)}function H(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,d.KE)()&&!r&&(0,h.QV)(),(0,v.B6)(e)||(0,v.WJ)(e))return t||n||(async()=>{(0,l.wh)(e),(0,m.Tc)(W,i.Xh,i.pR),(0,u.H4)(e.event_id,e.products,"homepage","carousel")})(),void F(e.index);const a=20;var{status:c,bannerText:p,timeToStartInMins:g}=s.Z.getEventStatus(e);g<=a&&c.name!==o.Z.LIVE.name?console.debug(" TODO : show toast on upcoming live event."):F(e.index)}function Y(e){return(0,E.jsx)(E.Fragment,{})}return G&&!B&&(B=function(e){var t=e.reduce(((e,t,n)=>{var r=t.storyset_id;return r in e?(e[r].total_events=e[r].total_events+1,e[r].events.push(t)):e[r]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,events:[t]},e}),{}),n=Object.values(t);return n.sort(((e,t)=>e.start_event_index-t.start_event_index)),n}(Z)),(0,a.useEffect)((()=>{k&&V==(0,I.zv)(z)&&(null!=N&&G?B.forEach(((e,t)=>{N==e.id&&q(t,!0,R)})):null!=R&&Z.forEach(((e,t)=>{R==e.event_id&&H(e,!0)})))}),[]),(0,E.jsxs)("div",{children:[(0,E.jsx)("div",{style:{marginTop:(G?P:D)+"px",marginBottom:(G?P:D)+"px"},children:"template-b"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(w,{events:Z,onClick:H,heading:e.heading})}):"template-a-1"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(T,{events:Z,onClick:H,heading:e.heading})}):"template-feed-a"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(C,{events:Z,onClick:H,heading:e.heading})}):"template-collections-a"===V||"template-c"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(y,{events:Z,onClick:H,heading:e.heading})})}):"template-collections-b"===V||"template-d"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(x,{events:Z,onClick:H,heading:e.heading})})}):"template-collections-c"===V||"template-e"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(_,{events:Z,onClick:H,heading:e.heading})})}):"template-collections-d"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(w,{events:Z,onClick:H,heading:e.heading})})}):"template-collections-e"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(O,{events:Z,onClick:H,heading:e.heading})})}):"template-f"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(L,{events:Z,onClick:H,heading:e.heading})})}):"template-banner-a"===V?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.BANNER_WIDGET_VIEW,event:Z[0],triggerFlag:!t&&!n,children:(0,E.jsx)(b,{events:Z})})}):G?(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.STORIES_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(j,{eventsStories:B,onClick:q,template:V})})}):(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,E.jsx)(O,{events:Z,onClick:H,heading:e.heading})})})}),-1==U?(0,E.jsx)(Y,{}):(0,E.jsx)(a.Suspense,{children:(0,E.jsx)(f.u,{userInteractionType:S.K.EVENT_VIEW,event:Z[U],productList:Z[U].products,cta:Z[U].cta,triggerFlag:!t&&!n,children:(0,E.jsx)(M,{events:Z,index:U,onBack:function(e){(0,c.n2L)(W)&&(0,r.MO)("whatmoreAddedToCart")&&(0,p.D)(W,(()=>{}),100,window.location.hostname),F(-1)},slideDirection:G||"horizontal"===(0,c.e8z)(W)?"horizontal":"vertical",eventsStories:B,initialStoryIndex:A,template:V})})})]})};const P=function(e,t,n){const a=(0,r.MO)("whatmoreShopId");var i=t.reduce(((e,t,n)=>(t.products.map((e=>e.client_product_id)).forEach((t=>{t in e||(e[t]=!0)})),e)),{}),o=Object.keys(i);if("60960964855"==a&&"undefined"!=typeof fera&&"function"===typeof fera.getRatings){var s={};fera.getRatings(o,(e=>{new Promise(((t,n)=>{e.forEach((e=>{s[e.external_product_id]={avgRating:e.average,totalRatings:e.count}})),t(s)})).then((e=>n(e)))}))}if("23114481744"==a){const e="1e6MQXxzYR19mpw9Km6Dcm86";s={};fetch("https://api.juniphq.com/v1/products?filter[remote_ids]="+o.toString(),{headers:{"Junip-Store-Key":e}}).then((e=>e.json())).then((e=>(e.products.forEach((e=>{s[e.remote_id]={avgRating:parseFloat(e.rating_average).toFixed(1),totalRatings:e.rating_count}})),s))).then((e=>n(e))).catch((e=>console.error(e)))}};var G=n(3388),W=n(7381),V=n(7376),k=n(7008);var z=function(e){const[t,n]=(0,a.useState)(),[o,s]=(0,a.useState)(),{whatmoreIsStoriesTemplate:l}=(0,a.useContext)(g.I),{whatmoreIsCollectionsTemplate:m}=(0,a.useContext)(g.I),{whatmoreIsBannerTemplate:p}=(0,a.useContext)(g.I),[v]=(0,r.j1)("whatmoreShopId"),[f]=(0,r.j1)("whatmoreCollectionId"),w=(0,r.MO)("whatmoreLandingLocationType"),T=(0,r.MO)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:y}=(0,a.useContext)(g.I),{whatmoreCollectionUrl:x}=(0,a.useContext)(g.I),_=(0,c.cZT)(v)?(0,c._uv)(v)?x:window.location.href.split(/[?#]/)[0]:f,[j,M]=(0,r.j1)("productRatings");var O=(0,c.efR)(v)?i.Dm+"/v2/events/":i.Gc+"/v2/events/",L=(0,c.efR)(v)?i.Dm+"/get_eventset/":i.Gc+"/get_eventset/",C=(0,c.efR)(v)?i.Dm+"/v2/collection":i.Gc+"/v2/collection",b=(0,c.efR)(v)?i.Dm+"/v2/brand/"+v+"/product-events":i.Gc+"/v2/brand/"+v+"/product-events",z=e.shopId,N="live,upcoming";return(0,a.useEffect)((()=>{(0,u.hb)();const e=()=>{const e="_whatmore_bulk_events",t=JSON.parse(localStorage.getItem(e))||[];t&&t.length>0&&((0,k.K)(t),localStorage.removeItem(e))};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),[]),(0,a.useEffect)((()=>{null==t||0==t.length||o||!(0,d.KE)()||(0,r.MO)("whatmoreVideoPlayerPoolInitiated")||(0,h.b5)(h.UD)}),[t]),(0,a.useEffect)((()=>{var e;if(w.startsWith("product")){var t=(0,r.MO)("whatmoreProductId");t=(0,c.iXA)(v)?function(e){return e.split(/[?#]/)[0]}(window.location.href):t,e=b.toString()+"?client_product_id="+t.toString()+"&status="+N.toString()+"&event_type=video"}else if(m||"invalid-url"!==x)e=C.toString()+"?store_id="+z.toString()+"&client_collection_id="+_;else if(p){const t=I.ls,n=(0,I.H1)(w);e=L.toString()+z.toString()+"?eventset_type="+t+"&source="+n+"&source_id="+v}else e=O.toString()+z.toString()+"?status="+N.toString()+"&is_active="+"true".toString()+(l?"&template_type=stories":"");fetch(e).then((e=>e.json())).then((e=>{if(p){const t=I.ls;return(0,G.OC)(e,t)}return(0,G.kW)(e,m||"invalid-url"!==x)})).then((e=>(T&&console.debug("initial received events size : "+e.length),l||p?e:(0,G.e8)(e,z)))).then((e=>(null!=e&&0!=e.length&&(0,c.LUY)(v)&&function(e,t,n){const a=setInterval((()=>{null===(0,r.MO)("productRatings")&&P(e,t,n)}),1e3);setTimeout((()=>{clearInterval(a)}),1e4)}(v,e,(e=>{M(e)})),e))).then((e=>{e&&0!=e.length||g.$.forEach((e=>{var t,n,r;const a=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"]'),i=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==n?n:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),o=null!==(r=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-b"]'))&&void 0!==r?r:e.querySelector('.whatmore-template-type[data="template-a"]')||e.querySelector('.whatmore-template-type[data="template-f"]')||e.querySelector('.whatmore-template-type[data="template-b"]');if(!a&&!i&&!o)return;const s=e.querySelector(".whatmore-render-root");(a&&s||i&&s||o&&s)&&(s.style.minHeight="0px")})),null==e||0==e.length||l||p||(0,c.NOv)(z,e),n(e)})).catch((e=>{s(e.message)}))}),[]),(0,a.useEffect)((()=>{"index"===w?t&&t.length>0&&(0,V.PB)({userInteractionType:S.K.HOMEPAGE_VISITED,widgetSourceDetails:y}):"collection"===w&&t&&(t.length>0||(0,c.miB)(v))&&(0,V.PB)({userInteractionType:S.K.COLLECTION_PAGE_VISITED,widgetSourceDetails:y})}),[t]),null==t||0==t.length||o?(0,E.jsx)("div",{}):(T&&(0,W.EI)(t),function(e){if(null!=e){var t=0;e.forEach((e=>{e.index=t++}))}}(t),T&&console.debug("final transformed events data : "+JSON.stringify(t)),T&&console.debug("valid events size : "+t.length),(0,E.jsx)("div",{children:(0,E.jsx)(D,{heading:e.heading,events:t})},"whatmore-main-coponent"))},N=n(3933);var R=function(e){const[t]=(0,r.j1)("isInDesignMode"),[n]=(0,r.j1)("isDemoBrand"),[o]=(0,r.j1)("whatmoreShopId"),[s]=(0,r.j1)("whatmoreHeading"),[l,u]=(0,a.useState)(["initial",window.pageYOffset]),[d,h]=(0,a.useState)(!1),p=(0,r.MO)("isLandingSharedLink");(0,a.useEffect)((()=>{if((0,m.ll)(o),!(0,c.wc0)(o))return;let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;var r,a;Math.abs(n-e)<100?t=!1:(a=!0,u(r=[n>e?"scrolled-down":"scrolled-up",n]),r[1]>100&&h(a),e=n>0?n:0,t=!1)},r=()=>{t||(window.requestAnimationFrame(n),t=!0)};return window.addEventListener("scroll",r),()=>window.removeEventListener("scroll",r)}),[]);const[g,v,I]=(0,N.YD)({triggerOnce:!0});return(0,E.jsx)("div",{ref:g,children:d||v||p||!(0,c.wc0)(o)?(0,E.jsx)("div",{children:t||n?(0,E.jsx)("div",{children:(0,E.jsx)(z,{heading:s,shopId:i.aA})}):(0,E.jsx)("div",{children:(0,E.jsx)(z,{heading:s,shopId:o})})}):(0,E.jsx)(E.Fragment,{})})}},499:function(e,t){t.Z={LIVE:{name:"LIVE",color:"gray.600"},UPCOMING:{name:"UPCOMING",color:"gray.600"},DEFAULT:{name:"LIVE EVENT",color:"gray.600"},COMPLETED:{name:"ENDED",color:"gray.600"}}},4897:function(e,t,n){var r=n(499);t.Z=class{static getEventStatus(e){e.time_zone="GMT+5:30";var t=e.start_time+":00",n=e.end_time,a=e.scheduled_date,i=e.status,o=e.time_zone;if(i.toUpperCase()==r.Z.LIVE.name)return{status:r.Z.LIVE,bannerText:" "+r.Z.LIVE.name+" ",timeToStartInMins:0};if(i.toUpperCase()==r.Z.UPCOMING.name){var s=new Date(a+" "+t+" "+o),l=(new Date(a+" "+n+" "+o),function(e){var t=new Date,n=(e.getTime()-t.getTime())/1e3,a=n/60,i=a/60,o=i/24;return n<=0?{status:r.Z.COMPLETED,bannerText:" "+r.Z.COMPLETED.name+" ",timeToStartInMins:0}:n>=1&&n<=30?{status:r.Z.UPCOMING,bannerText:"Starts in "+Math.round(n)+" sec ",timeToStartInMins:n/60}:a<60?{status:r.Z.UPCOMING,bannerText:"Starts in "+Math.round(a)+" min ",timeToStartInMins:a}:i<24?{status:r.Z.UPCOMING,bannerText:"Starts in "+Math.round(i)+" hr ",timeToStartInMins:60*i}:o<7?{status:r.Z.UPCOMING,bannerText:" "+["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()]+" ",timeToStartInMins:60*o*24}:{status:r.Z.UPCOMING,bannerText:"Upcoming",timeToStartInMins:2880}}(s));return{status:l.status,bannerText:l.bannerText,timeToStartInMins:l.timeToStartInMins}}return console.error("invalid status for event :: id : "+e.event_id+", status : "+e.status),{status:r.Z.DEFAULT,bannerText:"live event",timeToStartInMins:2880}}}},3388:function(e,t,n){n.d(t,{OC:function(){return s},e8:function(){return i},kT:function(){return r},kW:function(){return o},xg:function(){return a}});const r=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},a=function(e,t){return!(void 0==e.products||0==e.products.length)},i=function(e,t){if(null!=e)return e.filter((e=>1==r(e)))},o=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null!=e)return t?e.events[0].events:e.events};const s=function(e,t){var n;if(null==e)return[];if(!("eventsets"in e))return[];const r=null!==(n=e.eventsets[t])&&void 0!==n?n:null;return r?function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach((e=>{e.events.forEach((e=>{t.push(e)}))})),t}(r):[]}},7376:function(e,t,n){n.d(t,{GF:function(){return a},PB:function(){return s},Z2:function(){return i},y4:function(){return o}});var r=n(733);function a(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s}=e;(0,r.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s})}function i(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s}=e;(0,r.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s})}function o(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s}=e;(0,r.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s})}function s(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s}=e;(0,r.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:a,event:i,productList:o,ctaList:s})}}}]);