whatmore-react-assets 1.0.288 → 1.0.289

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.288",
3
+ "version": "1.0.289",
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([[55],{51:function(e,t,n){n.d(t,{Z:function(){return i}});n(7313);var o=n(6417);var i=function(e){return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("span",{className:"whatmore-loading-indicator"})})}},3175:function(e,t,n){var o=n(208),i=n(51),r=n(6417);t.Z=function(e){var t,n;const a=null!==(t=e.height)&&void 0!==t?t:"100%",c=null!==(n=e.width)&&void 0!==n?n:"100%";return(0,r.jsxs)("div",{style:{width:c,height:a,overflow:"hidden"},children:[(0,r.jsx)(o.Od,{height:"100%",width:"100%",speed:0,startColor:"#202020",endColor:"#606060"}),(0,r.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",alignContent:"center",width:"100%",height:"100%",position:"relative",zIndex:1,bottom:"100%",className:"whatmore-ios-css-relative-fix"},children:(0,r.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"center",width:"100%",height:"fit-content"},children:(0,r.jsx)(i.Z,{})})})]})}},941:function(e,t,n){n.d(t,{D:function(){return o}});const o=async function(e,t,n,o){if("STRNV8MHJTF"!=e&&"STR6HU283UZ"!=e&&"STR9T3LLEJB"!=e&&"STRWJMIOJNX"!=e&&"STRUDQ36YAC"!=e&&"STR1D5ONOZX"!=e){var i=await fetch("https://"+window.location.hostname+"/cart.js",{cache:"reload"}).then((e=>e.json()));if("27358003275"==e||"63748341981"==e||"68237558034"==e)document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{cart:i,openMiniCart:!0}}));else if("19506115"==e)window.PXUTheme.jsAjaxCart.showDrawer(),window.PXUTheme.jsAjaxCart.updateView();else if("54465429691"==e)refreshCart(i),window.setTimeout((function(){$.fancybox.close(),$(".cart-button").click()}),500);else if("25427564"==e||"4243849314"==e){(new theme.CartDrawer).open()}else"62602182872"==e||"57362710572"==e?(CartJS.getCart(),$(".block-cart").addClass("active")):"60492578980"==e||"12183765088"==e||"58546946211"==e||"42070737058"==e||"71321583919"==e||"68492624171"==e||"74541891876"==e?(document.documentElement.dispatchEvent(new CustomEvent("ajaxProduct:added",{bubbles:!0,detail:{}})),document.documentElement.dispatchEvent(new CustomEvent("cart:open",{bubbles:!0,detail:{}}))):"36300750986"==e||"2665447536"==e?fetch("/?section_id=cart-drawer").then((e=>e.text())).then((e=>{const t=(new DOMParser).parseFromString(e,"text/html").getElementById("cart-drawer").innerHTML;$("#cart-drawer").html(t),$('[aria-controls="cart-drawer"]')[0].click(),$(".header__cart-count .count-bubble ").html(cart.item_count).css("opacity",1)})):"57824805033"==e?fetch("/cart.json").then((e=>e.json())).then((e=>{fetch("/cart?view=item").then((e=>e.text())).then((t=>{const n=(new DOMParser).parseFromString(t,"text/html"),o=n.getElementById("CartDrawer"),i=document.getElementById("CartDrawer");o&&i&&(i.innerHTML=o.innerHTML),n.querySelector("#CartDrawer .totals__subtotal-value");const r=document.querySelector("cart-drawer");r&&r.classList.remove("is-empty");const a=document.querySelector("cart-drawer-items");a&&a.classList.remove("is-empty");const c=document.getElementById("cart-icon-bubble");if(c.querySelector(".cart-count-bubble"))c.querySelectorAll('.cart-count-bubble span[aria-hidden="true"]').forEach((t=>{t.textContent=e.item_count}));else{const t=document.createElement("div");t.className="cart-count-bubble",t.innerHTML='\n <span aria-hidden="true">'.concat(e.item_count,'</span>\n <span class="visually-hidden">').concat(e.item_count," items</span>\n "),c.appendChild(t)}c.click(),document.getElementById("CartDrawer-Overlay").addEventListener("click",(()=>{const e=document.querySelector("cart-drawer");e&&e.classList.remove("active"),document.body.classList.remove("overflow-hidden")}))}))})):document.documentElement.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{}}));setTimeout(t,n)}else{console.log("Executing cart refresh script..");document.getElementById("whatsmorecart").value=Math.random()}}},2887:function(e,t,n){var o=n(7313),i=(n(6422),n(3175)),r=n(6417);t.Z=function(e){var t,n,a;const[c,s]=(0,o.useState)(!1),d=o.useRef(0),l=(0,o.useRef)(null),u=null!==(t=e.timeUpdateCallback)&&void 0!==t?t:()=>{},p=null!==(n=e.height)&&void 0!==n?n:"100%",h=null!==(a=e.width)&&void 0!==a?a:"100%";return(0,o.useEffect)((()=>{d.current=0;const e=setInterval((()=>{d.current=d.current+.03,l.current&&u(d.current,5),d.current>=5&&(d.current=0)}),30);return()=>{clearInterval(e)}}),[e.isPlaying]),(0,r.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",width:h,height:p,overflow:"hidden"},children:[(0,r.jsx)("div",{style:{width:c?"100%":"0px",height:c?"100%":"0px"},children:(0,r.jsx)("img",{ref:l,src:e.url,style:{objectFit:"cover",height:p,width:h,backgroundColor:"white"},alt:"image player",onLoad:()=>{s(!0)}})}),c?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(i.Z,{width:"100%",height:"100%"})]})}},4892:function(e,t,n){n.d(t,{Z:function(){return u}});var o=n(7313),i=n(3933),r=n(868),a=n(8984),c=n(7300),s=(n(6422),n(2887)),d=n(6417);var l=function(e){var t,n;const r=(0,o.useRef)(null),[a,c,s]=(0,i.YD)({triggerOnce:!0}),l=null!==(t=e.height)&&void 0!==t?t:"100%",u=null!==(n=e.width)&&void 0!==n?n:"100%";return(0,o.useEffect)((()=>{r.current&&(e.isPlaying?r.current.play():r.current.pause())}),[e.isPlaying,c]),(0,d.jsx)("div",{ref:a,style:{width:l,height:u,overflow:"hidden"},children:c?(0,d.jsx)("video",{ref:r,className:"whatmore-video-player",width:u,height:l,preload:"auto",loop:!0,playsInline:!0,muted:!0,autoPlay:!0,src:e.url,style:{backgroundColor:"white"}}):(0,d.jsx)("div",{width:u,height:l,ref:e=>{e&&e.style.setProperty("display","block","important")}})})};var u=function(e){var t,n,u;const[p,h,f]=(0,i.YD)({triggerOnce:!0});if((0,c.WJ)(e.event))return(0,d.jsx)(s.Z,{height:e.height,width:e.width,url:e.url,isPlaying:e.isPlaying,timeUpdateCallback:e.timeUpdateCallback});const m=null!==(t=e.pauseFromPlayTimeInMs)&&void 0!==t?t:200;if((0,a.KE)())return(0,d.jsx)(l,{height:"100%",width:"100%",url:(0,r.V)(e.url),isPlaying:e.isPlaying,pauseFromPlayTimeInMs:m});const v=(0,o.useRef)(null),g=null!==(n=e.height)&&void 0!==n?n:"100%",w=null!==(u=e.width)&&void 0!==u?u:"100%";return(0,o.useEffect)((()=>{v.current&&(e.isPlaying?v.current.play():v.current.pause())}),[e.isPlaying,h]),(0,d.jsx)("div",{ref:p,style:{width:g,height:w,overflow:"hidden"},children:h?(0,d.jsx)("video",{ref:v,className:"whatmore-video-player",width:w,height:g,preload:"auto",loop:!0,playsInline:!0,muted:!0,src:(0,r.V)(e.url),style:{backgroundColor:"white"}}):(0,d.jsx)("div",{width:w,height:g,ref:e=>{e&&e.style.setProperty("display","block","important")}})})}},6055:function(e,t,n){n.r(t),n.d(t,{default:function(){return O}});var o=n(7313),i=n(9854),r=n(2860),a=n(7753),c=n(5160),s=(n(4844),n(6967)),d=n(4959),l=n(4892),u=n(6805),p=n(9821);var h=function(e){const[t,n,o,i,r]=(0,p.Z)(),[c]=(0,a.j1)("whatmoreEmbedAppVideoPlayerSizePortrait"),[s]=(0,a.j1)("whatmoreEmbedAppVideoPlayerSizeLandscape"),d=r[u.YP]===u.$w?s/100:c/100*1.2;return[t*d,n*d,r]},f=n(9723),m=n(9461),v=n.n(m),g=n(1195),w=n(7108),b=(n(7244),n(123),n(6417));var y=function(e){const t=o.useRef(null);var[n,r,c]=h();const[s]=(0,a.j1)("whatmoreEmbedAppVideoTitle"),[p]=(0,a.j1)("whatmoreEmbedAppPositionPortrait"),[m]=(0,a.j1)("whatmoreEmbedAppHorizontalPaddingPortrait"),[y]=(0,a.j1)("whatmoreEmbedAppVerticalPaddingPortrait"),[x]=(0,a.j1)("whatmoreEmbedAppPositionLandscape"),[j]=(0,a.j1)("whatmoreEmbedAppHorizontalPaddingLandscape"),[E]=(0,a.j1)("whatmoreEmbedAppVerticalPaddingLandscape"),_=(0,a.MO)("whatmoreShopId");var S=p,P=m,C=y;c[u.YP]===u.$w&&(S=x,P=j,C=E);const[T,k]=(0,o.useState)(["initial",window.pageYOffset]),[I,z]=(0,o.useState)(!1);function O(e,t){k(e),e[1]<=100?z(!1):t!=I&&z(t)}(0,o.useEffect)((()=>{let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;Math.abs(n-e)<100||(O([n>e?"scrolled-down":"scrolled-up",n],!0),e=n>0?n:0),t=!1},o=()=>{t||(window.requestAnimationFrame(n),t=!0)};return window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)}),[T]),(0,d.O3)({ref:t,handler:()=>{O(["scrolled-up",T[1]],!0)}});const A=e.event,L=e.inVideoClick,N=e.closeClick,M=.3*r,D=.6*r,Z=.1*r,V=.1*(.5*r),B="10px",J=(0,i.Z$)(_);var H=!1,R=0,F=0;function q(e){H=e}return(0,b.jsx)("div",{children:I&&(0,i.lV)(_)?(0,b.jsx)("div",{style:"left"===S?{left:"1px",bottom:C+"px",position:"fixed",zIndex:J}:{right:"5px",bottom:C+"px",position:"fixed",zIndex:J},children:(0,b.jsxs)("div",{onClick:()=>{O(["initial",T[1]],!1)},style:{margin:"1px",width:r+"px",height:n+"px"},className:"left"===S?"whatmore-ultraminimized-video-view-left":"whatmore-ultraminimized-video-view-right",children:[(0,b.jsx)("div",{style:{boxShadow:"0px 0px 10px 3px #B0B0B0",borderRadius:B,overflow:"hidden"},children:(0,b.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,b.jsx)(l.Z,{url:A.thumbnail_image,isPlaying:!1,event:A})})}),(0,b.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,b.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",height:"100%"},children:[(0,b.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,b.jsx)("div",{className:"whatmore-ultraminimized-content-scale-out",children:(0,b.jsx)(g.Z,{sx:{filter:"drop-shadow(0 0 15px black);",color:"white",fontSize:M+"px"},style:{position:"relative",zIndex:1,left:V+"px",bottom:V+"px"},onClick:N})})}),(0,b.jsx)("div",{style:{height:"100%",display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"center"},children:(0,b.jsx)(w.Z,{sx:{color:"white",fontSize:2*M+"px",filter:"drop-shadow(0 0 15px black);"}})})]})})]})}):(0,b.jsx)(v(),{nodeRef:t,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,o;n=t.x,o=t.y,R=n,F=o},onDrag:(e,t)=>{q(!0)},onStop:(e,t)=>{H&&(Math.abs(t.x-R)>5||Math.abs(t.y-F)>5)?q(!1):L(A)},children:(0,b.jsx)("div",{ref:t,style:"left"===S?{left:P+"px",bottom:C+"px",position:"fixed",zIndex:J}:{right:P+"px",bottom:C+"px",position:"fixed",zIndex:J},children:(0,b.jsxs)("div",{style:Object.assign({},{boxSizing:"border-box",margin:"1px",width:r+"px",height:n+"px"}),className:"left"===S?"whatmore-minimized-video-view-left":"whatmore-minimized-video-view-right",children:[(0,b.jsx)("div",{style:{boxShadow:"0px 0px 10px 3px #B0B0B0",borderRadius:B,overflow:"hidden",position:"relative"},children:(0,b.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,b.jsx)(l.Z,{url:A.thumbnail_image,isMuted:!0,isPlaying:!0,event:A})})}),(0,b.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,b.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",height:"100%"},children:[(0,b.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,b.jsx)(g.Z,{className:"close-btn",sx:{filter:"drop-shadow(0 0 15px black);",color:"white",fontSize:M+"px"},onClick:N,style:{position:"relative",zIndex:1,left:Z+"px",bottom:Z+"px"}})}),(0,b.jsx)("div",{style:{marginLeft:"auto",marginRight:"auto"},children:(0,b.jsx)(f.Z,{sx:{color:"white",fontSize:D+"px",filter:"drop-shadow(0 0 15px black);"}})}),(0,b.jsx)("div",{style:{paddingLeft:"2px",paddingRight:"2px",borderBottomLeftRadius:B,borderBottomRightRadius:B,backgroundImage:s?"linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.2), rgba(0,0,0,0.6))":""},children:(0,b.jsxs)("p",{style:{textAlign:"center",color:"white",fontFamily:"Sans-serif",fontWeight:"semi-bold",fontSize:.4*M+"px",margin:0,padding:0,lineHeight:"110%"},children:["\xa0",s]})})]})})]})})})})},x=n(58),j=n(8984),E=(n(7247),n(1824),n(4669)),_=n(941),S=n(9302),P=n(2575),C=n(7300),T=n(6524);const k=(0,P.Z)({key:"whatmore-css-ppv"}),I=o.lazy((()=>Promise.all([n.e(648),n.e(576),n.e(853),n.e(843),n.e(926),n.e(921),n.e(282),n.e(204)]).then(n.bind(n,7490))));function z(e){return e.split(/[?#]/)[0]}var O=function(e){const[t,n]=(0,o.useState)(),[d,l]=(0,o.useState)(),[u]=(0,a.j1)("isInDesignMode"),[p]=(0,a.j1)("isDemoBrand"),[h]=(0,a.j1)("whatmoreEmbedAppUseVariant"),[f,m]=(0,o.useState)(-2),[v]=(0,a.j1)("whatmoreVariantId"),[g]=(0,a.j1)("whatmoreShopId");var[w]=(0,a.j1)("whatmoreProductId");const P=(0,a.MO)("isLandingSharedLink"),O=(0,a.MO)("whatmoreShareTemplateId"),A=((0,a.MO)("whatmoreShareStoryId"),(0,a.MO)("whatmoreShareEventId"));w=(0,i.iX)(g)?z(window.location.href):w;const[L,N]=(0,o.useState)((()=>"true"===h?v:w));var M=r.Gc+"/v1/brand/"+g+"/product-events";(0,o.useEffect)((()=>{(0,s.hb)()}),[]),(0,o.useEffect)((()=>{(0,E.ll)(g)}),[]),(0,o.useEffect)((()=>{null==t||0==t.length||d||!(0,j.KE)()||(0,a.MO)("whatmoreVideoPlayerPoolInitiated")||(0,x.b5)(x.UD)}),[t]),(0,o.useEffect)((()=>{m(-1),fetch(M.toString()+"?client_product_id="+L.toString()+"&status="+"upcoming".toString()+"&event_type=video").then((e=>e.json())).then((e=>(n(e),e))).then((e=>((0,i.yo)(g)&&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==z(window.location.href))return;const o={product_id:n.product_id,product_link:z(window.location.href)};fetch(r.Gc+"/product",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)})}),500)}(e,L),e))).catch((e=>{l(e.message)}))}),[L]),(0,o.useEffect)((()=>{m(-2)}),[t]),(0,o.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"===h){const e=function(e){for(var t=window.location.search.substring(1).split("&"),n=0;n<t.length;n++){var o=t[n].split("=");if(o[0]==e)return o[1]}return!1}("variant");e&&""!==e&&N(e)}}))}),[]),(0,o.useEffect)((()=>{null==t||0==t.length||d||P&&"template-embed"==(0,T.z)(O)&&null!=A&&t.forEach(((e,t)=>{A==e.event_id&&D(e,!0,t)}))}),[t]);const D=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,j.KE)()&&!t&&(0,x.QV)(),(0,C.B6)(e)||(0,C.WJ)(e))return u||p||(async()=>{(0,c.wh)(e),(0,E.Tc)(g,r.h7,r.dU),(0,s.H4)(e.event_id,e.products,"product_page","video_popup")})(),void m(n)};function Z(){return(0,b.jsx)(b.Fragment,{})}return null==t||0==t.length||d?(0,b.jsx)("div",{}):(0,b.jsx)(S.C,{value:k,children:"no-product"===L||-1===f||0===t.length?(0,b.jsx)(Z,{}):-2===f&&t.length>0?(0,b.jsx)("div",{children:(0,b.jsx)(y,{event:t[0],inVideoClick:D,closeClick:e=>{e.stopPropagation(),m(-1)}})}):(0,b.jsx)("div",{children:(0,b.jsx)(o.Suspense,{children:(0,b.jsx)(I,{events:t,index:f,onBack:function(){(0,i.n2)(g)&&(0,a.MO)("whatmoreAddedToCart")&&(0,_.D)(g,(()=>{}),100,window.location.hostname),m(-2)},template:"template-product-page"})})})})}},868:function(e,t,n){n.d(t,{V:function(){return c}});var o=n(9854),i=n(7753);const r={"https://d3syezql093hs1.cloudfront.net":"https://whatmore-brand-video-assets.azureedge.net","https://d2r0bijhs9mx1s.cloudfront.net":"https://whatmore-brand-thumbnail-video-assets.azureedge.net","https://d2oouab8j9eigo.cloudfront.net":"https://whatmore-brand-story-assets.azureedge.net","https://d28nus7q7qajdn.cloudfront.net":"https://whatmore-video-assets.azureedge.net","https://d1zl4k1t5o4s75.cloudfront.net":"https://whatmore-brand-video-assets-720p.azureedge.net"},a={"https://d3syezql093hs1.cloudfront.net":"https://whatmore-brand-video-assets.b-cdn.net","https://d2r0bijhs9mx1s.cloudfront.net":"https://whatmore-brand-thumbnail-video-assets.b-cdn.net","https://d2oouab8j9eigo.cloudfront.net":"https://whatmore-brand-story-assets.b-cdn.net","https://d28nus7q7qajdn.cloudfront.net":"https://whatmore-video-assets-old.b-cdn.net","https://d1zl4k1t5o4s75.cloudfront.net":"https://whatmore-brand-video-assets-720p.b-cdn.net"},c=function(e){const t=(0,i.MO)("whatmoreShopId");if(e.startsWith("https://cdn.shopify.com"))return e;if("AWSCDN"==(0,o.zp)(t))return e;if("AZURECDN"==(0,o.zp)(t)){if(e.includes(".azureedge.net"))return e;if(e.includes(".cloudfront.net")){for(const t of Object.keys(r))if(e.includes(t))return e.replace(t,r[t]);return e}}if("BUNNYCDN"==(0,o.zp)(t)){if(e.includes(".b-cdn.net"))return e;if(e.includes(".cloudfront.net")){for(const t of Object.keys(a))if(e.includes(t))return e.replace(t,a[t]);return e}}return e}},7300:function(e,t,n){n.d(t,{B6:function(){return o},WJ:function(){return i},yC:function(){return r}});const o=function(e){return"video"===e.event_type},i=function(e){return"image"===e.event_type},r=function(e){return"livestream"===e.event_type}},6524:function(e,t,n){n.d(t,{Q:function(){return a},z:function(){return r}});const o={ta:"template-a",ta1:"template-a-1",tb:"template-b",tc:"template-c",td:"template-d",te:"template-e",te:"template-embed",tsa:"template-stories-a",tsb:"template-stories-b",tfa:"template-feed-a",tca:"template-collections-a",tcb:"template-collections-b",tcc:"template-collections-c",tcd:"template-collections-d",tce:"template-collections-e"},i={"template-a":"ta","template-a-1":"ta1","template-c":"tc","template-d":"td","template-e":"te","template-b":"tb","template-embed":"te","template-stories-a":"tsa","template-stories-b":"tsb","template-feed-a":"tfa","template-collections-a":"tca","template-collections-b":"tcb","template-collections-c":"tcc","template-collections-d":"tcd","template-collections-e":"tce"},r=function(e){return o[e]},a=function(e){return i[e]}},6805:function(e,t,n){n.d(t,{$I:function(){return c},$w:function(){return d},AK:function(){return r},AL:function(){return a},YP:function(){return i},me:function(){return o},rE:function(){return s}});const o="device_type",i="device_mode",r="mobile",a="tablet",c="desktop",s="portrait",d="landscape"},6422:function(e,t,n){var o=n(7313),i=n(7753);t.Z=function(e){const[t,n]=(0,i.j1)("muted");return(0,o.useEffect)((()=>{}),[]),[t,n]}},8866:function(e,t,n){var o=n(7313);function i(){return[window.innerHeight,window.innerWidth]}t.Z=function(e){var[t,n]=i();const[r,a]=(0,o.useState)(["portrait",t,n]);return(0,o.useLayoutEffect)((()=>{function e(){var[e,t]=i();a(e>t?["portrait",e,t]:["landscape",e,t])}return window.addEventListener("resize",e),window.addEventListener("orientationchange",e),screen.orientation&&screen.orientation.addEventListener("change",e),e(),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e),screen.orientation&&screen.orientation.removeEventListener("change",e)}}),[]),r}},9821:function(e,t,n){var o=n(6367),i=n(7753),r=n(8866),a=n(6805);t.Z=function(e){const[t,n,c]=(0,r.Z)(),[s]=(0,i.j1)("whatmoreLandscapePadding"),[d]=(0,i.j1)("whatmoreVideoTileSize"),l=(0,o.useMediaQuery)({query:"(min-width: 1025px)"}),u=(0,o.useMediaQuery)({query:"(min-width: 481px)"}),p=!("portrait"!=t||!u),h=d/100*1.3*.5,f=d/100;var m=Math.min(c,n),[v,g,w,b]=[.6*m*(16/9),.6*m,1.4,0];function y(e){return Math.round(10*e)/10}var x={DEVICE_TYPE:a.AK,DEVICE_MODE:a.rE};if(l){const e=g*h,t=v*h;[v,g,w,b]=[t,e,(c-2*s)/(1.1*e),s],x[a.me]=a.$I,x[a.YP]=a.$w}else if(p){var j=.8*g,E=.8*v;"portrait"==t?(j*=f,E*=f,[v,g,w,b]=[E,j,y(c/(1.2*j)),0],x[a.me]=a.AL,x[a.YP]=a.rE):([v,g,w,b]=[E,j,(c-2*s)/(1.1*j),s],x[a.me]=a.AL,x[a.YP]=a.$w)}else{j=g,E=v;"portrait"==t?(j*=f,E*=f,[v,g,w,b]=[E,j,y(c/(1.2*j)),0],x[a.me]=a.AK,x[a.YP]=a.rE):(j=.7*g,E=.7*v,[v,g,w,b]=[E,j,(c-2*s)/(1.1*j),s],x[a.me]=a.AK,x[a.YP]=a.$w)}return[v,g,w,b,x]}},5160:function(e,t,n){n.d(t,{$L:function(){return d},JX:function(){return s},Z6:function(){return r},rp:function(){return l},wh:function(){return i},wz:function(){return c},x0:function(){return a}});var o=n(2860);n(7753);function i(e){console.debug("updating user view count for event.");const t={event_id:e.event_id,increase_by:1};fetch(o.Gc+"/event/metrics/views",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(console.debug("updating user view count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user view count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating user view count user for event : ",e)}))}function r(e,t){console.debug("updating like count for event.");const n={event_id:e.event_id,increase_by:t};fetch(o.Gc+"/event/metrics/like",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating like count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating like count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating like count user for event : ",e)}))}function a(e){console.debug("updating share count for event.");const t={event_id:e.event_id,increase_by:1};fetch(o.Gc+"/event/metrics/share",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(console.debug("updating share count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating share count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating share count user for event : ",e)}))}function c(e,t){console.debug("updating event-product click count for event {} and product {}.",e.event_id,t.product_id);const n={event_id:e.event_id,product_id:t.product_id,increase_by:1};fetch(o.Gc+"/event/metrics/clicks",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating user event-product click count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user event-product click count response : "+JSON.stringify(e))})).catch((t=>{console.error("error updating user event-product click count for event {} : ",e.event_id,t)}))}function s(e,t,n){console.debug("updating event-product add to cart count for event {} and product {}.",e.event_id,t.product_id);const i={event_id:e.event_id,product_id:t.product_id,increase_by:n};fetch(o.Gc+"/event/metrics/add_to_cart",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)}).then((e=>(console.debug("updating user event-product add to cart count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user event-product add to cart count response : "+JSON.stringify(e))})).catch((t=>{console.error("error updating user event-product add to cart count for event {} : ",e.event_id,t)}))}function d(e,t){console.debug("updating event-product buy now count for event {} and product {}.",e.event_id,t.product_id);const n={event_id:e.event_id,product_id:t.product_id,increase_by:1};fetch(o.Gc+"/event/metrics/buy_now",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating user event-product buy now count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user event-product buy now count response : "+JSON.stringify(e))})).catch((t=>{console.error("error updating user event-product buy now count for event {} : ",e.event_id,t)}))}async function l(){let{storeId:e="",eventId:t=0,productId:n="",variantId:i="",cartToken:r="",checkoutToken:a="",quantity:c=0,price:s="",actionType:d="",trackingId:l=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u={event_id:t,product_id:n,cart_token:r,checkout_token:a,quantity:c,price:s,variant_id:i,action_type:d,tracking_id:l};console.debug("initiating ATC metadata event for eventId {}, productId {}, variantId {} ",t,n,i);const p=await fetch(o.Gc+"/cart-metadata/"+e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(u)}).then((e=>(console.debug("initiating ATC metadata event for eventId {}, productId {}, variantId {} : HTTP "+e.status),e.json()))).catch((e=>{console.error("error initiating ATC metadata event for eventId {}, productId {}, variantId {} : ",t,n,i)}));return p}},4669:function(e,t,n){n.d(t,{Tc:function(){return u},ll:function(){return l}});var o=n(1824),i=n(7786),r=n(9854);n(7753);const a="Whatmore Video Shopping",c="Video View",s={carousel:"Carousel",stories:"Stories",video_popup:"Video Popup"},d={homepage:"Home Page",product_page:"Product Page"};async function l(e){if((0,r.Dv)(e)&&null!==(0,r.hf)(e)&&(i.ZP.initialize((0,r.hf)(e)),console.debug("Whatmore: initialized GA4")),(0,r.hv)(e)&&null!==(0,r.BH)(e)){const t=(0,r.OQ)(e);o.ZP.initialize((0,r.BH)(e),{useExistingGa:t}),console.debug("Whatmore: initialized GA3")}}async function u(e,t,n){(0,r.hv)(e)&&null!==(0,r.BH)(e)&&(o.ZP.event({category:a,action:c,label:d[t]+":"+s[n]}),console.debug("Whatmore: pushed view event to GA3")),(0,r.Dv)(e)&&null!==(0,r.hf)(e)&&(i.ZP.event({category:a,action:c+":"+d[t]+":"+s[n],value:1,nonInteraction:!1}),console.debug("Whatmore: pushed view event to GA4"))}},123:function(){},7244:function(){}}]);
@@ -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 k}});var o=n(7753),a=n(7313),r=n(2860),i=n(499),c=n(4897),s=n(5160),d=n(9854),u=n(6967),l=n(8984),p=n(58),h=n(4669),m=n(941),v=n(6966),g=n(7300),f=n(6524),b=n(6417);const y=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(853),n.e(926),n.e(282),n.e(95)]).then(n.bind(n,4095)))),T=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(576),n.e(664),n.e(517)]).then(n.bind(n,5523)))),_=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(926),n.e(642),n.e(136)]).then(n.bind(n,3827)))),S=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(926),n.e(642),n.e(92)]).then(n.bind(n,6071)))),w=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(926),n.e(642),n.e(245)]).then(n.bind(n,1291)))),j=a.lazy((()=>Promise.all([n.e(302),n.e(580)]).then(n.bind(n,3580)))),x=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(240),n.e(576),n.e(853),n.e(843),n.e(926),n.e(921),n.e(282),n.e(166)]).then(n.bind(n,7490)))),I=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(853),n.e(926),n.e(664),n.e(850)]).then(n.bind(n,4048)))),C=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(576),n.e(664),n.e(602)]).then(n.bind(n,8091))));var E=function(e){const[t]=(0,o.j1)("isInDesignMode"),[n]=(0,o.j1)("isDemoBrand"),[E]=(0,o.j1)("whatmoreTopBottomPadding"),[P]=(0,o.j1)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:O}=(0,a.useContext)(v.I),[M]=(0,o.j1)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:k}=(0,a.useContext)(v.I),D=(0,o.MO)("isLandingSharedLink"),N=(0,o.MO)("whatmoreShareTemplateId"),L=(0,o.MO)("whatmoreShareStoryId"),Z=(0,o.MO)("whatmoreShareEventId"),[G,A]=(0,a.useState)(-1),[J,z]=(0,a.useState)(null);var H=e.events,U=null;function B(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,l.KE)()&&!o&&(0,p.QV)(),t||n||(async()=>{const t=U[e].events[0];(0,s.wh)(t),(0,h.Tc)(M,r.Xh,r.OW),(0,u.H4)(t.event_id,t.products,"homepage","stories")})();var i=0;null!=a&&U[e].events.map(((e,t)=>{e.event_id==a&&(i=t)})),A(i),z(e)}function V(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,l.KE)()&&!o&&(0,p.QV)(),(0,g.B6)(e)||(0,g.WJ)(e))return t||n||(async()=>{(0,s.wh)(e),(0,h.Tc)(M,r.Xh,r.pR),(0,u.H4)(e.event_id,e.products,"homepage","carousel")})(),void A(e.index);const a=20;var{status:d,bannerText:m,timeToStartInMins:v}=c.Z.getEventStatus(e);v<=a&&d.name!==i.Z.LIVE.name?console.debug(" TODO : show toast on upcoming live event."):A(e.index)}function R(e){return(0,b.jsx)(b.Fragment,{})}return O&&!U&&(U=function(e){var t=e.reduce(((e,t,n)=>{var 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,events:[t]},e}),{}),n=Object.values(t);return n.sort(((e,t)=>e.start_event_index-t.start_event_index)),n}(H)),(0,a.useEffect)((()=>{D&&k==(0,f.z)(N)&&(null!=L&&O?U.forEach(((e,t)=>{L==e.id&&B(t,!0,Z)})):null!=Z&&H.forEach(((e,t)=>{Z==e.event_id&&V(e,!0)})))}),[]),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{marginTop:(O?P:E)+"px",marginBottom:(O?P:E)+"px"},children:"template-b"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(y,{events:H,onClick:V,heading:e.heading})}):"template-a-1"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(T,{events:H,onClick:V,heading:e.heading})}):"template-feed-a"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(C,{events:H,onClick:V,heading:e.heading})}):"template-collections-a"===k||"template-c"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(_,{events:H,onClick:V,heading:e.heading})}):"template-collections-b"===k||"template-d"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(S,{events:H,onClick:V,heading:e.heading})}):"template-collections-c"===k||"template-e"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(w,{events:H,onClick:V,heading:e.heading})}):"template-collections-d"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(y,{events:H,onClick:V,heading:e.heading})}):"template-collections-e"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(I,{events:H,onClick:V,heading:e.heading})}):O?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(j,{eventsStories:U,onClick:B,template:k})}):(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(I,{events:H,onClick:V,heading:e.heading})})}),-1==G?(0,b.jsx)(R,{}):(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(x,{events:H,index:G,onBack:function(e){(0,d.n2)(M)&&(0,o.MO)("whatmoreAddedToCart")&&(0,m.D)(M,(()=>{}),100,window.location.hostname),A(-1)},slideDirection:O||"horizontal"===(0,d.e8)(M)?"horizontal":"vertical",eventsStories:U,initialStoryIndex:J,template:k})})]})};const P=function(e,t,n){const a=(0,o.MO)("whatmoreShopId");var r=t.reduce(((e,t,n)=>(t.products.map((e=>e.client_product_id)).forEach((t=>{t in e||(e[t]=!0)})),e)),{}),i=Object.keys(r);if("60960964855"==a&&"undefined"!=typeof fera&&"function"===typeof fera.getRatings){var c={};fera.getRatings(i,(e=>{new Promise(((t,n)=>{e.forEach((e=>{c[e.external_product_id]={avgRating:e.average,totalRatings:e.count}})),t(c)})).then((e=>n(e)))}))}if("23114481744"==a){const e="1e6MQXxzYR19mpw9Km6Dcm86";c={};fetch("https://api.juniphq.com/v1/products?filter[remote_ids]="+i.toString(),{headers:{"Junip-Store-Key":e}}).then((e=>e.json())).then((e=>(e.products.forEach((e=>{c[e.remote_id]={avgRating:parseFloat(e.rating_average).toFixed(1),totalRatings:e.rating_count}})),c))).then((e=>n(e))).catch((e=>console.error(e)))}};var O=n(3388);var M=function(e){const[t,n]=(0,a.useState)(),[i,c]=(0,a.useState)(),{whatmoreIsStoriesTemplate:s}=(0,a.useContext)(v.I),{whatmoreIsCollectionsTemplate:h}=(0,a.useContext)(v.I),[m]=(0,o.j1)("whatmoreShopId"),[g]=(0,o.j1)("whatmoreCollectionId"),f=(0,d.cZ)(m)?window.location.href.split(/[?#]/)[0]:g,[y,T]=(0,o.j1)("productRatings");var _=(0,d.ef)(m)?r.Dm+"/v1/events/":r.Gc+"/v1/events/",S=(0,d.ef)(m)?r.Dm+"/collection/":r.Gc+"/collection/",w=e.shopId;return(0,a.useEffect)((()=>{(0,u.hb)()}),[]),(0,a.useEffect)((()=>{null==t||0==t.length||i||!(0,l.KE)()||(0,o.MO)("whatmoreVideoPlayerPoolInitiated")||(0,p.b5)(p.UD)}),[t]),(0,a.useEffect)((()=>{var e;e=h?S.toString()+"?store_id="+w.toString()+"&client_collection_id="+f:_.toString()+w.toString()+"?status="+"live,upcoming".toString()+"&is_active="+"true".toString()+(s?"&template_type=stories":""),fetch(e).then((e=>e.json())).then((e=>(0,O.kW)(e,h))).then((e=>s?e:(0,O.e8)(e,w))).then((e=>(null!=e&&0!=e.length&&(0,d.LU)(m)&&function(e,t,n){const a=setInterval((()=>{null===(0,o.MO)("productRatings")&&P(e,t,n)}),1e3);setTimeout((()=>{clearInterval(a)}),1e4)}(m,e,(e=>{T(e)})),e))).then((e=>{null==e||0==e.length||s||(0,d.NO)(w,e),n(e)})).catch((e=>{c(e.message)}))}),[]),null==t||0==t.length||i?(0,b.jsx)("div",{}):(function(e,t){if(null!=e){var n=0;e.forEach((e=>{e.index=n++}))}}(t),(0,b.jsx)("div",{children:(0,b.jsx)(E,{heading:e.heading,events:t})},"whatmore-main-coponent"))};var k=function(e){const[t]=(0,o.j1)("isInDesignMode"),[n]=(0,o.j1)("isDemoBrand"),[i]=(0,o.j1)("whatmoreShopId"),[c]=(0,o.j1)("whatmoreHeading"),[s]=(0,o.j1)("whatmorePrimaryColor"),[d]=(0,o.j1)("whatmoreSecondaryColor");return(0,a.useEffect)((()=>{(0,h.ll)(i)}),[]),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("div",{children:t||n?(0,b.jsx)("div",{children:(0,b.jsx)(M,{heading:c,shopId:r.aA})}):(0,b.jsx)("div",{children:(0,b.jsx)(M,{heading:c,shopId:i})})})})}},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 o=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,r=e.status,i=e.time_zone;if(r.toUpperCase()==o.Z.LIVE.name)return{status:o.Z.LIVE,bannerText:" "+o.Z.LIVE.name+" ",timeToStartInMins:0};if(r.toUpperCase()==o.Z.UPCOMING.name){var c=new Date(a+" "+t+" "+i),s=(new Date(a+" "+n+" "+i),function(e){var t=new Date,n=(e.getTime()-t.getTime())/1e3,a=n/60,r=a/60,i=r/24;return n<=0?{status:o.Z.COMPLETED,bannerText:" "+o.Z.COMPLETED.name+" ",timeToStartInMins:0}:n>=1&&n<=30?{status:o.Z.UPCOMING,bannerText:"Starts in "+Math.round(n)+" sec ",timeToStartInMins:n/60}:a<60?{status:o.Z.UPCOMING,bannerText:"Starts in "+Math.round(a)+" min ",timeToStartInMins:a}:r<24?{status:o.Z.UPCOMING,bannerText:"Starts in "+Math.round(r)+" hr ",timeToStartInMins:60*r}:i<7?{status:o.Z.UPCOMING,bannerText:" "+["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()]+" ",timeToStartInMins:60*i*24}:{status:o.Z.UPCOMING,bannerText:"Upcoming",timeToStartInMins:2880}}(c));return{status:s.status,bannerText:s.bannerText,timeToStartInMins:s.timeToStartInMins}}return console.error("invalid status for event :: id : "+e.event_id+", status : "+e.status),{status:o.Z.DEFAULT,bannerText:"live event",timeToStartInMins:2880}}}},941:function(e,t,n){n.d(t,{D:function(){return o}});const o=async function(e,t,n,o){if("STRNV8MHJTF"!=e&&"STR6HU283UZ"!=e&&"STR9T3LLEJB"!=e&&"STRWJMIOJNX"!=e&&"STRUDQ36YAC"!=e&&"STR1D5ONOZX"!=e){var a=await fetch("https://"+window.location.hostname+"/cart.js",{cache:"reload"}).then((e=>e.json()));if("27358003275"==e||"63748341981"==e||"68237558034"==e)document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{cart:a,openMiniCart:!0}}));else if("19506115"==e)window.PXUTheme.jsAjaxCart.showDrawer(),window.PXUTheme.jsAjaxCart.updateView();else if("54465429691"==e)refreshCart(a),window.setTimeout((function(){$.fancybox.close(),$(".cart-button").click()}),500);else if("25427564"==e||"4243849314"==e){(new theme.CartDrawer).open()}else"62602182872"==e||"57362710572"==e?(CartJS.getCart(),$(".block-cart").addClass("active")):"60492578980"==e||"12183765088"==e||"58546946211"==e||"42070737058"==e||"71321583919"==e||"68492624171"==e?(document.documentElement.dispatchEvent(new CustomEvent("ajaxProduct:added",{bubbles:!0,detail:{}})),document.documentElement.dispatchEvent(new CustomEvent("cart:open",{bubbles:!0,detail:{}}))):"36300750986"==e||"2665447536"==e?fetch("/?section_id=cart-drawer").then((e=>e.text())).then((e=>{const t=(new DOMParser).parseFromString(e,"text/html").getElementById("cart-drawer").innerHTML;$("#cart-drawer").html(t),$('[aria-controls="cart-drawer"]')[0].click(),$(".header__cart-count .count-bubble ").html(cart.item_count).css("opacity",1)})):"57824805033"==e?fetch("/cart.json").then((e=>e.json())).then((e=>{fetch("/cart?view=item").then((e=>e.text())).then((t=>{const n=(new DOMParser).parseFromString(t,"text/html"),o=n.getElementById("CartDrawer"),a=document.getElementById("CartDrawer");o&&a&&(a.innerHTML=o.innerHTML),n.querySelector("#CartDrawer .totals__subtotal-value");const r=document.querySelector("cart-drawer");r&&r.classList.remove("is-empty");const i=document.querySelector("cart-drawer-items");i&&i.classList.remove("is-empty");const c=document.getElementById("cart-icon-bubble");if(c.querySelector(".cart-count-bubble"))c.querySelectorAll('.cart-count-bubble span[aria-hidden="true"]').forEach((t=>{t.textContent=e.item_count}));else{const t=document.createElement("div");t.className="cart-count-bubble",t.innerHTML='\n <span aria-hidden="true">'.concat(e.item_count,'</span>\n <span class="visually-hidden">').concat(e.item_count," items</span>\n "),c.appendChild(t)}c.click(),document.getElementById("CartDrawer-Overlay").addEventListener("click",(()=>{const e=document.querySelector("cart-drawer");e&&e.classList.remove("active"),document.body.classList.remove("overflow-hidden")}))}))})):document.documentElement.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{}}));setTimeout(t,n)}else{console.log("Executing cart refresh script..");document.getElementById("whatsmorecart").value=Math.random()}}},3388:function(e,t,n){n.d(t,{e8:function(){return r},kT:function(){return o},kW:function(){return i},xg:function(){return a}});const o=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)},r=function(e,t){if(null!=e)return e.filter((e=>1==o(e)))},i=function(e,t){if(null!=e)return t?e[0].events:e}},7300:function(e,t,n){n.d(t,{B6:function(){return o},WJ:function(){return a},yC:function(){return r}});const o=function(e){return"video"===e.event_type},a=function(e){return"image"===e.event_type},r=function(e){return"livestream"===e.event_type}},6524:function(e,t,n){n.d(t,{Q:function(){return i},z:function(){return r}});const o={ta:"template-a",ta1:"template-a-1",tb:"template-b",tc:"template-c",td:"template-d",te:"template-e",te:"template-embed",tsa:"template-stories-a",tsb:"template-stories-b",tfa:"template-feed-a",tca:"template-collections-a",tcb:"template-collections-b",tcc:"template-collections-c",tcd:"template-collections-d",tce:"template-collections-e"},a={"template-a":"ta","template-a-1":"ta1","template-c":"tc","template-d":"td","template-e":"te","template-b":"tb","template-embed":"te","template-stories-a":"tsa","template-stories-b":"tsb","template-feed-a":"tfa","template-collections-a":"tca","template-collections-b":"tcb","template-collections-c":"tcc","template-collections-d":"tcd","template-collections-e":"tce"},r=function(e){return o[e]},i=function(e){return a[e]}},5160:function(e,t,n){n.d(t,{$L:function(){return d},JX:function(){return s},Z6:function(){return r},rp:function(){return u},wh:function(){return a},wz:function(){return c},x0:function(){return i}});var o=n(2860);n(7753);function a(e){console.debug("updating user view count for event.");const t={event_id:e.event_id,increase_by:1};fetch(o.Gc+"/event/metrics/views",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(console.debug("updating user view count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user view count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating user view count user for event : ",e)}))}function r(e,t){console.debug("updating like count for event.");const n={event_id:e.event_id,increase_by:t};fetch(o.Gc+"/event/metrics/like",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating like count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating like count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating like count user for event : ",e)}))}function i(e){console.debug("updating share count for event.");const t={event_id:e.event_id,increase_by:1};fetch(o.Gc+"/event/metrics/share",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(console.debug("updating share count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating share count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating share count user for event : ",e)}))}function c(e,t){console.debug("updating event-product click count for event {} and product {}.",e.event_id,t.product_id);const n={event_id:e.event_id,product_id:t.product_id,increase_by:1};fetch(o.Gc+"/event/metrics/clicks",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating user event-product click count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user event-product click count response : "+JSON.stringify(e))})).catch((t=>{console.error("error updating user event-product click count for event {} : ",e.event_id,t)}))}function s(e,t,n){console.debug("updating event-product add to cart count for event {} and product {}.",e.event_id,t.product_id);const a={event_id:e.event_id,product_id:t.product_id,increase_by:n};fetch(o.Gc+"/event/metrics/add_to_cart",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>(console.debug("updating user event-product add to cart count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user event-product add to cart count response : "+JSON.stringify(e))})).catch((t=>{console.error("error updating user event-product add to cart count for event {} : ",e.event_id,t)}))}function d(e,t){console.debug("updating event-product buy now count for event {} and product {}.",e.event_id,t.product_id);const n={event_id:e.event_id,product_id:t.product_id,increase_by:1};fetch(o.Gc+"/event/metrics/buy_now",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating user event-product buy now count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user event-product buy now count response : "+JSON.stringify(e))})).catch((t=>{console.error("error updating user event-product buy now count for event {} : ",e.event_id,t)}))}async function u(){let{storeId:e="",eventId:t=0,productId:n="",variantId:a="",cartToken:r="",checkoutToken:i="",quantity:c=0,price:s="",actionType:d="",trackingId:u=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l={event_id:t,product_id:n,cart_token:r,checkout_token:i,quantity:c,price:s,variant_id:a,action_type:d,tracking_id:u};console.debug("initiating ATC metadata event for eventId {}, productId {}, variantId {} ",t,n,a);const p=await fetch(o.Gc+"/cart-metadata/"+e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(l)}).then((e=>(console.debug("initiating ATC metadata event for eventId {}, productId {}, variantId {} : HTTP "+e.status),e.json()))).catch((e=>{console.error("error initiating ATC metadata event for eventId {}, productId {}, variantId {} : ",t,n,a)}));return p}},4669:function(e,t,n){n.d(t,{Tc:function(){return l},ll:function(){return u}});var o=n(1824),a=n(7786),r=n(9854);n(7753);const i="Whatmore Video Shopping",c="Video View",s={carousel:"Carousel",stories:"Stories",video_popup:"Video Popup"},d={homepage:"Home Page",product_page:"Product Page"};async function u(e){if((0,r.Dv)(e)&&null!==(0,r.hf)(e)&&(a.ZP.initialize((0,r.hf)(e)),console.debug("Whatmore: initialized GA4")),(0,r.hv)(e)&&null!==(0,r.BH)(e)){const t=(0,r.OQ)(e);o.ZP.initialize((0,r.BH)(e),{useExistingGa:t}),console.debug("Whatmore: initialized GA3")}}async function l(e,t,n){(0,r.hv)(e)&&null!==(0,r.BH)(e)&&(o.ZP.event({category:i,action:c,label:d[t]+":"+s[n]}),console.debug("Whatmore: pushed view event to GA3")),(0,r.Dv)(e)&&null!==(0,r.hf)(e)&&(a.ZP.event({category:i,action:c+":"+d[t]+":"+s[n],value:1,nonInteraction:!1}),console.debug("Whatmore: pushed view event to GA4"))}}}]);
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 k}});var o=n(7753),a=n(7313),r=n(2860),i=n(499),c=n(4897),s=n(5160),d=n(9854),u=n(6967),l=n(8984),p=n(58),h=n(4669),m=n(941),v=n(6966),g=n(7300),f=n(6524),b=n(6417);const y=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(853),n.e(926),n.e(282),n.e(95)]).then(n.bind(n,4095)))),T=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(576),n.e(664),n.e(517)]).then(n.bind(n,5523)))),_=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(926),n.e(642),n.e(136)]).then(n.bind(n,3827)))),S=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(926),n.e(642),n.e(92)]).then(n.bind(n,6071)))),w=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(926),n.e(642),n.e(245)]).then(n.bind(n,1291)))),j=a.lazy((()=>Promise.all([n.e(302),n.e(580)]).then(n.bind(n,3580)))),x=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(240),n.e(576),n.e(853),n.e(843),n.e(926),n.e(921),n.e(282),n.e(166)]).then(n.bind(n,7490)))),I=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(853),n.e(926),n.e(664),n.e(850)]).then(n.bind(n,4048)))),C=a.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(576),n.e(664),n.e(602)]).then(n.bind(n,8091))));var E=function(e){const[t]=(0,o.j1)("isInDesignMode"),[n]=(0,o.j1)("isDemoBrand"),[E]=(0,o.j1)("whatmoreTopBottomPadding"),[P]=(0,o.j1)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:O}=(0,a.useContext)(v.I),[M]=(0,o.j1)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:k}=(0,a.useContext)(v.I),D=(0,o.MO)("isLandingSharedLink"),N=(0,o.MO)("whatmoreShareTemplateId"),L=(0,o.MO)("whatmoreShareStoryId"),Z=(0,o.MO)("whatmoreShareEventId"),[G,A]=(0,a.useState)(-1),[J,z]=(0,a.useState)(null);var H=e.events,U=null;function B(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,l.KE)()&&!o&&(0,p.QV)(),t||n||(async()=>{const t=U[e].events[0];(0,s.wh)(t),(0,h.Tc)(M,r.Xh,r.OW),(0,u.H4)(t.event_id,t.products,"homepage","stories")})();var i=0;null!=a&&U[e].events.map(((e,t)=>{e.event_id==a&&(i=t)})),A(i),z(e)}function V(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,l.KE)()&&!o&&(0,p.QV)(),(0,g.B6)(e)||(0,g.WJ)(e))return t||n||(async()=>{(0,s.wh)(e),(0,h.Tc)(M,r.Xh,r.pR),(0,u.H4)(e.event_id,e.products,"homepage","carousel")})(),void A(e.index);const a=20;var{status:d,bannerText:m,timeToStartInMins:v}=c.Z.getEventStatus(e);v<=a&&d.name!==i.Z.LIVE.name?console.debug(" TODO : show toast on upcoming live event."):A(e.index)}function R(e){return(0,b.jsx)(b.Fragment,{})}return O&&!U&&(U=function(e){var t=e.reduce(((e,t,n)=>{var 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,events:[t]},e}),{}),n=Object.values(t);return n.sort(((e,t)=>e.start_event_index-t.start_event_index)),n}(H)),(0,a.useEffect)((()=>{D&&k==(0,f.z)(N)&&(null!=L&&O?U.forEach(((e,t)=>{L==e.id&&B(t,!0,Z)})):null!=Z&&H.forEach(((e,t)=>{Z==e.event_id&&V(e,!0)})))}),[]),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{marginTop:(O?P:E)+"px",marginBottom:(O?P:E)+"px"},children:"template-b"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(y,{events:H,onClick:V,heading:e.heading})}):"template-a-1"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(T,{events:H,onClick:V,heading:e.heading})}):"template-feed-a"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(C,{events:H,onClick:V,heading:e.heading})}):"template-collections-a"===k||"template-c"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(_,{events:H,onClick:V,heading:e.heading})}):"template-collections-b"===k||"template-d"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(S,{events:H,onClick:V,heading:e.heading})}):"template-collections-c"===k||"template-e"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(w,{events:H,onClick:V,heading:e.heading})}):"template-collections-d"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(y,{events:H,onClick:V,heading:e.heading})}):"template-collections-e"===k?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(I,{events:H,onClick:V,heading:e.heading})}):O?(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(j,{eventsStories:U,onClick:B,template:k})}):(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(I,{events:H,onClick:V,heading:e.heading})})}),-1==G?(0,b.jsx)(R,{}):(0,b.jsx)(a.Suspense,{children:(0,b.jsx)(x,{events:H,index:G,onBack:function(e){(0,d.n2)(M)&&(0,o.MO)("whatmoreAddedToCart")&&(0,m.D)(M,(()=>{}),100,window.location.hostname),A(-1)},slideDirection:O||"horizontal"===(0,d.e8)(M)?"horizontal":"vertical",eventsStories:U,initialStoryIndex:J,template:k})})]})};const P=function(e,t,n){const a=(0,o.MO)("whatmoreShopId");var r=t.reduce(((e,t,n)=>(t.products.map((e=>e.client_product_id)).forEach((t=>{t in e||(e[t]=!0)})),e)),{}),i=Object.keys(r);if("60960964855"==a&&"undefined"!=typeof fera&&"function"===typeof fera.getRatings){var c={};fera.getRatings(i,(e=>{new Promise(((t,n)=>{e.forEach((e=>{c[e.external_product_id]={avgRating:e.average,totalRatings:e.count}})),t(c)})).then((e=>n(e)))}))}if("23114481744"==a){const e="1e6MQXxzYR19mpw9Km6Dcm86";c={};fetch("https://api.juniphq.com/v1/products?filter[remote_ids]="+i.toString(),{headers:{"Junip-Store-Key":e}}).then((e=>e.json())).then((e=>(e.products.forEach((e=>{c[e.remote_id]={avgRating:parseFloat(e.rating_average).toFixed(1),totalRatings:e.rating_count}})),c))).then((e=>n(e))).catch((e=>console.error(e)))}};var O=n(3388);var M=function(e){const[t,n]=(0,a.useState)(),[i,c]=(0,a.useState)(),{whatmoreIsStoriesTemplate:s}=(0,a.useContext)(v.I),{whatmoreIsCollectionsTemplate:h}=(0,a.useContext)(v.I),[m]=(0,o.j1)("whatmoreShopId"),[g]=(0,o.j1)("whatmoreCollectionId"),f=(0,d.cZ)(m)?window.location.href.split(/[?#]/)[0]:g,[y,T]=(0,o.j1)("productRatings");var _=(0,d.ef)(m)?r.Dm+"/v1/events/":r.Gc+"/v1/events/",S=(0,d.ef)(m)?r.Dm+"/collection/":r.Gc+"/collection/",w=e.shopId;return(0,a.useEffect)((()=>{(0,u.hb)()}),[]),(0,a.useEffect)((()=>{null==t||0==t.length||i||!(0,l.KE)()||(0,o.MO)("whatmoreVideoPlayerPoolInitiated")||(0,p.b5)(p.UD)}),[t]),(0,a.useEffect)((()=>{var e;e=h?S.toString()+"?store_id="+w.toString()+"&client_collection_id="+f:_.toString()+w.toString()+"?status="+"live,upcoming".toString()+"&is_active="+"true".toString()+(s?"&template_type=stories":""),fetch(e).then((e=>e.json())).then((e=>(0,O.kW)(e,h))).then((e=>s?e:(0,O.e8)(e,w))).then((e=>(null!=e&&0!=e.length&&(0,d.LU)(m)&&function(e,t,n){const a=setInterval((()=>{null===(0,o.MO)("productRatings")&&P(e,t,n)}),1e3);setTimeout((()=>{clearInterval(a)}),1e4)}(m,e,(e=>{T(e)})),e))).then((e=>{null==e||0==e.length||s||(0,d.NO)(w,e),n(e)})).catch((e=>{c(e.message)}))}),[]),null==t||0==t.length||i?(0,b.jsx)("div",{}):(function(e,t){if(null!=e){var n=0;e.forEach((e=>{e.index=n++}))}}(t),(0,b.jsx)("div",{children:(0,b.jsx)(E,{heading:e.heading,events:t})},"whatmore-main-coponent"))};var k=function(e){const[t]=(0,o.j1)("isInDesignMode"),[n]=(0,o.j1)("isDemoBrand"),[i]=(0,o.j1)("whatmoreShopId"),[c]=(0,o.j1)("whatmoreHeading"),[s]=(0,o.j1)("whatmorePrimaryColor"),[d]=(0,o.j1)("whatmoreSecondaryColor");return(0,a.useEffect)((()=>{(0,h.ll)(i)}),[]),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("div",{children:t||n?(0,b.jsx)("div",{children:(0,b.jsx)(M,{heading:c,shopId:r.aA})}):(0,b.jsx)("div",{children:(0,b.jsx)(M,{heading:c,shopId:i})})})})}},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 o=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,r=e.status,i=e.time_zone;if(r.toUpperCase()==o.Z.LIVE.name)return{status:o.Z.LIVE,bannerText:" "+o.Z.LIVE.name+" ",timeToStartInMins:0};if(r.toUpperCase()==o.Z.UPCOMING.name){var c=new Date(a+" "+t+" "+i),s=(new Date(a+" "+n+" "+i),function(e){var t=new Date,n=(e.getTime()-t.getTime())/1e3,a=n/60,r=a/60,i=r/24;return n<=0?{status:o.Z.COMPLETED,bannerText:" "+o.Z.COMPLETED.name+" ",timeToStartInMins:0}:n>=1&&n<=30?{status:o.Z.UPCOMING,bannerText:"Starts in "+Math.round(n)+" sec ",timeToStartInMins:n/60}:a<60?{status:o.Z.UPCOMING,bannerText:"Starts in "+Math.round(a)+" min ",timeToStartInMins:a}:r<24?{status:o.Z.UPCOMING,bannerText:"Starts in "+Math.round(r)+" hr ",timeToStartInMins:60*r}:i<7?{status:o.Z.UPCOMING,bannerText:" "+["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()]+" ",timeToStartInMins:60*i*24}:{status:o.Z.UPCOMING,bannerText:"Upcoming",timeToStartInMins:2880}}(c));return{status:s.status,bannerText:s.bannerText,timeToStartInMins:s.timeToStartInMins}}return console.error("invalid status for event :: id : "+e.event_id+", status : "+e.status),{status:o.Z.DEFAULT,bannerText:"live event",timeToStartInMins:2880}}}},941:function(e,t,n){n.d(t,{D:function(){return o}});const o=async function(e,t,n,o){if("STRNV8MHJTF"!=e&&"STR6HU283UZ"!=e&&"STR9T3LLEJB"!=e&&"STRWJMIOJNX"!=e&&"STRUDQ36YAC"!=e&&"STR1D5ONOZX"!=e){var a=await fetch("https://"+window.location.hostname+"/cart.js",{cache:"reload"}).then((e=>e.json()));if("27358003275"==e||"63748341981"==e||"68237558034"==e)document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{cart:a,openMiniCart:!0}}));else if("19506115"==e)window.PXUTheme.jsAjaxCart.showDrawer(),window.PXUTheme.jsAjaxCart.updateView();else if("54465429691"==e)refreshCart(a),window.setTimeout((function(){$.fancybox.close(),$(".cart-button").click()}),500);else if("25427564"==e||"4243849314"==e){(new theme.CartDrawer).open()}else"62602182872"==e||"57362710572"==e?(CartJS.getCart(),$(".block-cart").addClass("active")):"60492578980"==e||"12183765088"==e||"58546946211"==e||"42070737058"==e||"71321583919"==e||"68492624171"==e||"74541891876"==e?(document.documentElement.dispatchEvent(new CustomEvent("ajaxProduct:added",{bubbles:!0,detail:{}})),document.documentElement.dispatchEvent(new CustomEvent("cart:open",{bubbles:!0,detail:{}}))):"36300750986"==e||"2665447536"==e?fetch("/?section_id=cart-drawer").then((e=>e.text())).then((e=>{const t=(new DOMParser).parseFromString(e,"text/html").getElementById("cart-drawer").innerHTML;$("#cart-drawer").html(t),$('[aria-controls="cart-drawer"]')[0].click(),$(".header__cart-count .count-bubble ").html(cart.item_count).css("opacity",1)})):"57824805033"==e?fetch("/cart.json").then((e=>e.json())).then((e=>{fetch("/cart?view=item").then((e=>e.text())).then((t=>{const n=(new DOMParser).parseFromString(t,"text/html"),o=n.getElementById("CartDrawer"),a=document.getElementById("CartDrawer");o&&a&&(a.innerHTML=o.innerHTML),n.querySelector("#CartDrawer .totals__subtotal-value");const r=document.querySelector("cart-drawer");r&&r.classList.remove("is-empty");const i=document.querySelector("cart-drawer-items");i&&i.classList.remove("is-empty");const c=document.getElementById("cart-icon-bubble");if(c.querySelector(".cart-count-bubble"))c.querySelectorAll('.cart-count-bubble span[aria-hidden="true"]').forEach((t=>{t.textContent=e.item_count}));else{const t=document.createElement("div");t.className="cart-count-bubble",t.innerHTML='\n <span aria-hidden="true">'.concat(e.item_count,'</span>\n <span class="visually-hidden">').concat(e.item_count," items</span>\n "),c.appendChild(t)}c.click(),document.getElementById("CartDrawer-Overlay").addEventListener("click",(()=>{const e=document.querySelector("cart-drawer");e&&e.classList.remove("active"),document.body.classList.remove("overflow-hidden")}))}))})):document.documentElement.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{}}));setTimeout(t,n)}else{console.log("Executing cart refresh script..");document.getElementById("whatsmorecart").value=Math.random()}}},3388:function(e,t,n){n.d(t,{e8:function(){return r},kT:function(){return o},kW:function(){return i},xg:function(){return a}});const o=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)},r=function(e,t){if(null!=e)return e.filter((e=>1==o(e)))},i=function(e,t){if(null!=e)return t?e[0].events:e}},7300:function(e,t,n){n.d(t,{B6:function(){return o},WJ:function(){return a},yC:function(){return r}});const o=function(e){return"video"===e.event_type},a=function(e){return"image"===e.event_type},r=function(e){return"livestream"===e.event_type}},6524:function(e,t,n){n.d(t,{Q:function(){return i},z:function(){return r}});const o={ta:"template-a",ta1:"template-a-1",tb:"template-b",tc:"template-c",td:"template-d",te:"template-e",te:"template-embed",tsa:"template-stories-a",tsb:"template-stories-b",tfa:"template-feed-a",tca:"template-collections-a",tcb:"template-collections-b",tcc:"template-collections-c",tcd:"template-collections-d",tce:"template-collections-e"},a={"template-a":"ta","template-a-1":"ta1","template-c":"tc","template-d":"td","template-e":"te","template-b":"tb","template-embed":"te","template-stories-a":"tsa","template-stories-b":"tsb","template-feed-a":"tfa","template-collections-a":"tca","template-collections-b":"tcb","template-collections-c":"tcc","template-collections-d":"tcd","template-collections-e":"tce"},r=function(e){return o[e]},i=function(e){return a[e]}},5160:function(e,t,n){n.d(t,{$L:function(){return d},JX:function(){return s},Z6:function(){return r},rp:function(){return u},wh:function(){return a},wz:function(){return c},x0:function(){return i}});var o=n(2860);n(7753);function a(e){console.debug("updating user view count for event.");const t={event_id:e.event_id,increase_by:1};fetch(o.Gc+"/event/metrics/views",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(console.debug("updating user view count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user view count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating user view count user for event : ",e)}))}function r(e,t){console.debug("updating like count for event.");const n={event_id:e.event_id,increase_by:t};fetch(o.Gc+"/event/metrics/like",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating like count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating like count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating like count user for event : ",e)}))}function i(e){console.debug("updating share count for event.");const t={event_id:e.event_id,increase_by:1};fetch(o.Gc+"/event/metrics/share",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(console.debug("updating share count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating share count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating share count user for event : ",e)}))}function c(e,t){console.debug("updating event-product click count for event {} and product {}.",e.event_id,t.product_id);const n={event_id:e.event_id,product_id:t.product_id,increase_by:1};fetch(o.Gc+"/event/metrics/clicks",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating user event-product click count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user event-product click count response : "+JSON.stringify(e))})).catch((t=>{console.error("error updating user event-product click count for event {} : ",e.event_id,t)}))}function s(e,t,n){console.debug("updating event-product add to cart count for event {} and product {}.",e.event_id,t.product_id);const a={event_id:e.event_id,product_id:t.product_id,increase_by:n};fetch(o.Gc+"/event/metrics/add_to_cart",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>(console.debug("updating user event-product add to cart count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user event-product add to cart count response : "+JSON.stringify(e))})).catch((t=>{console.error("error updating user event-product add to cart count for event {} : ",e.event_id,t)}))}function d(e,t){console.debug("updating event-product buy now count for event {} and product {}.",e.event_id,t.product_id);const n={event_id:e.event_id,product_id:t.product_id,increase_by:1};fetch(o.Gc+"/event/metrics/buy_now",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating user event-product buy now count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user event-product buy now count response : "+JSON.stringify(e))})).catch((t=>{console.error("error updating user event-product buy now count for event {} : ",e.event_id,t)}))}async function u(){let{storeId:e="",eventId:t=0,productId:n="",variantId:a="",cartToken:r="",checkoutToken:i="",quantity:c=0,price:s="",actionType:d="",trackingId:u=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l={event_id:t,product_id:n,cart_token:r,checkout_token:i,quantity:c,price:s,variant_id:a,action_type:d,tracking_id:u};console.debug("initiating ATC metadata event for eventId {}, productId {}, variantId {} ",t,n,a);const p=await fetch(o.Gc+"/cart-metadata/"+e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(l)}).then((e=>(console.debug("initiating ATC metadata event for eventId {}, productId {}, variantId {} : HTTP "+e.status),e.json()))).catch((e=>{console.error("error initiating ATC metadata event for eventId {}, productId {}, variantId {} : ",t,n,a)}));return p}},4669:function(e,t,n){n.d(t,{Tc:function(){return l},ll:function(){return u}});var o=n(1824),a=n(7786),r=n(9854);n(7753);const i="Whatmore Video Shopping",c="Video View",s={carousel:"Carousel",stories:"Stories",video_popup:"Video Popup"},d={homepage:"Home Page",product_page:"Product Page"};async function u(e){if((0,r.Dv)(e)&&null!==(0,r.hf)(e)&&(a.ZP.initialize((0,r.hf)(e)),console.debug("Whatmore: initialized GA4")),(0,r.hv)(e)&&null!==(0,r.BH)(e)){const t=(0,r.OQ)(e);o.ZP.initialize((0,r.BH)(e),{useExistingGa:t}),console.debug("Whatmore: initialized GA3")}}async function l(e,t,n){(0,r.hv)(e)&&null!==(0,r.BH)(e)&&(o.ZP.event({category:i,action:c,label:d[t]+":"+s[n]}),console.debug("Whatmore: pushed view event to GA3")),(0,r.Dv)(e)&&null!==(0,r.hf)(e)&&(a.ZP.event({category:i,action:c+":"+d[t]+":"+s[n],value:1,nonInteraction:!1}),console.debug("Whatmore: pushed view event to GA4"))}}}]);