whatmore-react-assets 1.0.439 → 1.0.441
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 +1 -1
- package/static/js/554.e7967fa3.chunk.js +1 -0
- package/static/js/565.aa40c110.chunk.js +1 -0
- package/static/js/{950.ee92528a.chunk.js → 950.fa0cfa24.chunk.js} +1 -1
- package/whatmore.js +2 -2
- package/static/js/554.e276c570.chunk.js +0 -1
- package/static/js/565.0e94184d.chunk.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[554],{9085:function(t,e,o){o.r(e),o.d(e,{default:function(){return k}});var n=o(7313),r=(o(3439),o(6090)),i=o(7616),a=(o(6143),o(7850),o(4444),o(7244),o(123),o(5892),o(1811),o(9302)),l=o(2575),s=o(9821),c=o(8866),d=o(2279),p=o.n(d),h=o(7753),u=o(7129),x=o(1855),m=o(9854),y=o(7592),v=o(7376),f=o(778),g=o(4892),w=o(5945),j=o(9219),M=o(6417);var P=function(t){var e,o,r,i,a,l,c,d,p,x;const[v,f,P,C,b,S]=(0,s.Z)(),k=("portrait"==S?.06*f:.055*f)+"px",O=("portrait"==S?.06*f:.055*f)+"px",I=("portrait"==S?.055*f:.045*f)+"px",E=t.event,T=(0,h.MO)("whatmoreShopId"),F=(0,h.MO)("whatmoreSecondaryColor");var N=(0,n.useContext)(u.V);const R=null===(e=t.isOnFocus)||void 0===e||e,W=null!==(o=t.playOnUnfocus)&&void 0!==o&&o,Z=t.onClick,{whatmoreUITheme:z}=(0,n.useContext)(y.I),_=(0,m.nz)(T),D=null!==(r=t.animateOnFocus&&(0,m.iW)(T))&&void 0!==r&&r,L=(0,h.MO)("whatmorePrimaryFont"),A=Math.round(+(null===(i=E.products[0])||void 0===i?void 0:i.price)),G=Math.round(+(null===(a=E.products[0])||void 0===a?void 0:a.compare_price)),U=G&&0!=G&&G>A?Math.ceil((G-A)/G*100):NaN;return(0,M.jsxs)("div",{ref:t=>{t&&(t.style.setProperty("margin-top",N.tileTopMargin+"px","important"),t.style.setProperty("margin-bottom",N.tileBottomMMargin+"px","important"))},className:D?R?"whatmore-event-tile-scale-out-animation":"whatmore-event-tile-scale-in-animation":"none",style:{margin:"0 auto",cursor:"pointer",width:f},onClick:()=>{Z(E)},children:[(0,M.jsx)("div",{style:{borderRadius:"round"==z?"5%":"0px",boxShadow:"round"==z?_:null,height:v,borderWidth:(0,m.al)(T),borderColor:(0,m.qP)(T),overflow:"hidden"},children:(0,M.jsx)(g.Z,{height:"100%",width:"100%",url:E.thumbnail_image,isPlaying:R||W,event:E})}),(0,M.jsxs)("div",{style:{display:"flex",flexDirection:"column",padding:"12px 4px",gap:"4px"},children:[(0,M.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-size",k,"important"),t.style.setProperty("line-height","120%","important"),t.style.setProperty("font-family",L,"important"),t.style.setProperty("-webkit-line-clamp",1,"important"),t.style.setProperty("line-clamp",1,"important"),t.style.setProperty("-webkit-box-orient","vertical","important"),t.style.setProperty("display","-webkit-box","important"),t.style.setProperty("overflow","hidden","important"),t.style.setProperty("text-overflow","ellipsis","important"))},children:(0,w.s)(null===(l=E.products[0])||void 0===l?void 0:l.title)}),(0,M.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,M.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-size",O,"important"),t.style.setProperty("font-family",L,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textAlign:"left",fontWeight:"bold"},children:(0,j.jx)(parseFloat(null===(c=E.products[0])||void 0===c?void 0:c.price)," ",T,null===(d=E.products[0])||void 0===d?void 0:d.currency)}),!isNaN(G)&&G>A&&(0,M.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color","#808191","important"),t.style.setProperty("font-size",O,"important"),t.style.setProperty("font-family",L,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textDecoration:"line-through"},children:(0,j.jx)(parseFloat(null===(p=E.products[0])||void 0===p?void 0:p.compare_price)," ",T,null===(x=E.products[0])||void 0===x?void 0:x.currency)})]}),!isNaN(U)&&0!=U&&(0,M.jsx)("div",{style:{display:"flex",backgroundColor:"#343434"==F?(0,m.ZJ)(T):F,alignItems:"center",borderRadius:"4px",width:"fit-content",padding:"3px 6px"},children:(0,M.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,m.ms)(T),"important"),t.style.setProperty("font-size",I,"important"),t.style.setProperty("font-family",L,"important"))},children:"".concat(U,"% Off")})})]})]})};const C=(0,l.Z)({key:"whatmore-css-hv"});function b(t){const[e,o,r]=(0,s.Z)(),i=(0,h.MO)("whatmoreShopId"),a=t.events,l=t.onClick,{whatmoreWidgetSourceDetails:c}=(0,n.useContext)(y.I),d=Math.ceil(r),p=2*d,[u,g]=(0,n.useState)(p),[w,j]=(0,n.useState)(2*d),C=0===(0,m.WG)(i)?24:(0,m.WG)(i),[b,S]=(0,n.useState)({touchX:0,touchY:0}),k=t=>{if("next"===t){const t=2;j((t=>Math.min(t+Math.floor(r),a.length+d+1))),g((e=>Math.min(e+t,a.length+d+1)))}else j((t=>Math.max(t-Math.floor(r),p)));(0,v.y4)({userInteractionType:f.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:c})};return(0,M.jsx)("div",{className:"whatmore-events-carousel-portrait",style:{display:"flex",justifyContent:"flex-start",paddingLeft:"16px",overflow:"hidden"},onTouchStart:t=>{S({touchX:t.touches[0].clientX,touchY:t.touches[0].clientY})},onTouchEnd:t=>{var e,o,n,r;const i=(null===(e=t.changedTouches)||void 0===e||null===(o=e[0])||void 0===o?void 0:o.clientX)-b.touchX,a=(null===(n=t.changedTouches)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.clientY)-b.touchY;Math.sqrt(i**2+a**2)>10&&Math.abs(i)>Math.abs(a)&&k(i>0?"prev":"next")},children:(0,M.jsx)("div",{style:{display:"flex",gap:C,transform:"translateX(-".concat((w-p)*(o+C),"px)"),transition:"transform 0.4s ease-in-out"},children:a.map(((t,e)=>e<u?(0,M.jsx)("div",{children:(0,M.jsx)(P,{isOnFocus:e<=w-d-1&&e>=Math.max(0,w-p),playOnUnfocus:!1,animateOnFocus:!0,event:t,onClick:()=>l(t)})},"whatmore-carousel-tile-".concat(e)):(0,M.jsx)(x.Z,{})))})})}function S(t){const[e,o,r,i]=(0,s.Z)(),[a,l]=(0,n.useState)(-1),c=(0,h.MO)("whatmoreShopId"),[d,u]=(0,n.useState)("next"),x=t.onClick,g=t.events,{whatmoreWidgetSourceDetails:w}=(0,n.useContext)(y.I),j=Math.min(Math.ceil(r),g.length),[C,b]=(0,n.useState)(0),S=0===(0,m.WG)(c)?24:(0,m.WG)(c),k=()=>(0,M.jsx)("div",{children:(0,M.jsx)("button",{onClick:T,style:{width:"50px",borderRadius:"6px",height:"100px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,M.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-right"})})}),O=()=>(0,M.jsx)("div",{children:(0,M.jsx)("button",{onClick:E,style:{width:"50px",borderRadius:"6px",height:"100px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,M.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-left"})})});(0,n.useEffect)((()=>{C<=j&&b((t=>t+j))}),[j]);const I=()=>{l(-1)},E=()=>{C!==j&&(u("prev"),b((t=>Math.max(Math.ceil(t-r),j))),(0,v.y4)({userInteractionType:f.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},T=()=>{C>g.length+r||(u("next"),b((t=>Math.floor(t+r))),(0,v.y4)({userInteractionType:f.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},F=C>g.length?g.length-j+1:C-j,N=C>=g.length?g.length:F+j,R=g.slice(F,N);return(0,M.jsxs)("div",{className:"whatmore-events-carousel-landscape",style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:"".concat(i,"px"),paddingRight:"".concat(i,"px")},children:[(0,M.jsx)("div",{style:{position:"absolute",left:"0",zIndex:100,top:"50%",transform:"translateX(50%) translateY(-65%)"},children:C!==j&&(0,M.jsx)(O,{})}),(0,M.jsx)("div",{style:{display:"flex",gap:S+"px",width:"".concat(o*r*1.1,"px"),paddingLeft:"8px",overflow:"hidden"},children:R.map(((t,e)=>{const o="whatmore-event-tile-landscape-".concat(t.index).concat(e===j-1?"-last":""),n=e===a;return(0,M.jsx)("div",{className:"whatmore-event-tile-horizontal-swipe-animation-".concat("next"===d?"next":"prev"),onMouseEnter:()=>(t=>{const e=p()((()=>l(t)),300);return e(),e.cancel})(e),onMouseLeave:I,children:(0,M.jsx)(P,{isOnFocus:n,playOnUnfocus:!0,animateOnFocus:!0,event:t,onClick:()=>(t=>{x(t)})(t)})},o)}))}),(0,M.jsx)("div",{style:{position:"absolute",zIndex:100,top:"50%",right:i+"px",transform:"translateY(-65%)"},children:C<=g.length&&(0,M.jsx)(k,{})})]})}var k=function(t){var e;const[o,l,s]=(0,c.Z)(),[d]=(0,h.j1)("whatmoreShopId"),[p]=(0,h.j1)("whatmorePrimaryColor"),[x]=(0,h.j1)("whatmoreSecondaryColor"),[v]=(0,h.j1)("whatmoreTitleFont"),f="portrait"==o?(0,h.MO)("whatmoreTitleFontSizePortrait"):(0,h.MO)("whatmoreTitleFontSize"),{whatmoreRootId:g}=(0,n.useContext)(y.I),w=t.events,j=t.onClick,P=null!==(e=(0,m.aR)(d))&&void 0!==e?e:v;function k(t){j(t)}return delete i.ZP.styles.global,(0,M.jsx)(a.C,{value:C,children:(0,M.jsx)("div",{children:(0,M.jsx)(r.x,{theme:i.ZP,cssVarsRoot:g,resetCSS:!1,children:(0,M.jsxs)(u.V.Provider,{value:{tileTopMargin:25,tileBottomMMargin:25,tileLeftMargin:4,tileRightMargin:4,showPlayButton:!0},children:[t.heading.trim().length>0?(0,M.jsx)("div",{className:"whatmore-events-carousel",style:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,M.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-family",P,"important"),t.style.setProperty("font-size",f+"px","important"))},style:{color:p,backgroundClip:"text",textAlign:"center"},children:t.heading})}):(0,M.jsx)(M.Fragment,{}),"landscape"===o?(0,M.jsx)(S,{events:w,onClick:k}):(0,M.jsx)(b,{events:w,onClick:k})]})})})})}},7129:function(t,e,o){o.d(e,{V:function(){return n}});const n=(0,o(7313).createContext)({tileTopMargin:10,tileBottomMMargin:10,tileLeftMargin:10,tileRightMargin:10,showPlayButton:!0})},1855:function(t,e,o){var n=o(7313),r=o(9821),i=o(7129),a=o(6417);e.Z=function(t){var[e,o]=(0,r.Z)();return(0,n.useContext)(i.V),t.event,(0,a.jsx)("div",{style:{margin:"0 auto",width:o,height:e,overflow:"hidden"}})}},3439:function(){},5892:function(){},4444:function(){},1811:function(){},7850:function(){}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[565],{7381:function(e,t,n){n.d(t,{EI:function(){return c},fs:function(){return i}});function o(e){console.debug("Whatmore : "+e)}function c(e){var t;const n=null!==(t="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==t&&t;n&&(o("total events received : "+(e&&e.length)),o("events data : "+JSON.stringify(e)))}function i(e){var t;null!==(t="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==t&&t&&o(e)}},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 c=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:c,openMiniCart:!0}}));else if("19506115"==e)window.PXUTheme.jsAjaxCart.showDrawer(),window.PXUTheme.jsAjaxCart.updateView();else if("54465429691"==e)refreshCart(c),window.setTimeout((function(){$.fancybox.close(),$(".cart-button").click()}),500);else if("25427564"==e||"4243849314"==e||"57708314789"==e){(new theme.CartDrawer).open()}else if("62602182872"==e||"57362710572"==e)CartJS.getCart(),$(".block-cart").addClass("active");else if("20157815"==e||"60492578980"==e||"12183765088"==e||"58546946211"==e||"42070737058"==e||"71321583919"==e||"68492624171"==e||"74541891876"==e||"21187677"==e)document.documentElement.dispatchEvent(new CustomEvent("ajaxProduct:added",{bubbles:!0,detail:{}})),document.documentElement.dispatchEvent(new CustomEvent("cart:open",{bubbles:!0,detail:{}}));else if("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)}));else if("57824805033"==e||"59504656436"==e||"58112966749"==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"),c=document.getElementById("CartDrawer");o&&c&&(c.innerHTML=o.innerHTML),n.querySelector("#CartDrawer .totals__subtotal-value");const i=document.querySelector("cart-drawer");i&&i.classList.remove("is-empty");const r=document.querySelector("cart-drawer-items");r&&r.classList.remove("is-empty");const a=document.getElementById("cart-icon-bubble");if(a.querySelector(".cart-count-bubble"))a.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 "),a.appendChild(t)}a.click(),document.getElementById("CartDrawer-Overlay").addEventListener("click",(()=>{const e=document.querySelector("cart-drawer");e&&e.classList.remove("active"),document.body.classList.remove("overflow-hidden")}))}))}));else if("61094723750"==e)SLIDECART&&(SLIDECART_UPDATE(),SLIDECART_OPEN());else if("10272035"==e){const e=document.querySelector(".cart-drawer"),t=e.parentNode;t.classList.add("menu-opening"),t.setAttribute("open","open"),e.style.visibility="visible",e.style.transform="translate(0)"}else"1972174947"==e||"55194878152"==e?document.documentElement.dispatchEvent(new CustomEvent("cart:refresh:opend",{bubbles:!0,detail:{}})):"64463667449"==e?(document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})),document.documentElement.dispatchEvent(new CustomEvent("cart:updated",{bubbles:!0,detail:{cart:c}})),document.getElementById("mini-cart").open=!0):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()}}},7300:function(e,t,n){n.d(t,{B6:function(){return o},WJ:function(){return c},yC:function(){return i}});const o=function(e){return"video"===e.event_type},c=function(e){return"image"===e.event_type},i=function(e){return"livestream"===e.event_type}},5160:function(e,t,n){n.d(t,{$L:function(){return p},JX:function(){return l},Z6:function(){return a},lY:function(){return u},rp:function(){return v},uD:function(){return h},wh:function(){return r},wz:function(){return d},x0:function(){return s}});var o,c=n(2860);n(7753);const i=null!==(o="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==o&&o;function r(e){i&&console.debug("updating user view count for event.");const t={event_id:e.event_id,increase_by:1};fetch(c.Gc+"/event/metrics/views",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(i&&console.debug("updating user view count response : HTTP "+e.status),e.json()))).then((e=>{i&&console.debug("updating user view count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating user view count user for event : ",e)}))}function a(e,t){i&&console.debug("updating like count for event.");const n={event_id:e.event_id,increase_by:t};fetch(c.Gc+"/event/metrics/like",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(i&&console.debug("updating like count response : HTTP "+e.status),e.json()))).then((e=>{i&&console.debug("updating like count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating like count user for event : ",e)}))}function s(e){i&&console.debug("updating share count for event.");const t={event_id:e.event_id,increase_by:1};fetch(c.Gc+"/event/metrics/share",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(i&&console.debug("updating share count response : HTTP "+e.status),e.json()))).then((e=>{i&&console.debug("updating share count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating share count user for event : ",e)}))}function u(e,t){i&&console.debug("updating wa click count for event.");const n={event_id:e.event_id,increase_by:t};fetch(c.Gc+"/event/metrics/whatsapp",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(i&&console.debug("updating whatsapp click count response : HTTP "+e.status),e.json()))).then((e=>{i&&console.debug("updating whatsapp click count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating whatsapp click count user for event : ",e)}))}function d(e,t){i&&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(c.Gc+"/event/metrics/clicks",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(i&&console.debug("updating user event-product click count response : HTTP "+e.status),e.json()))).then((e=>{i&&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 l(e,t,n){i&&console.debug("updating event-product add to cart count for event {} and product {}.",e.event_id,t.product_id);const o={event_id:e.event_id,product_id:t.product_id,increase_by:n};fetch(c.Gc+"/event/metrics/add_to_cart",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)}).then((e=>(i&&console.debug("updating user event-product add to cart count response : HTTP "+e.status),e.json()))).then((e=>{i&&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 p(e,t){i&&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(c.Gc+"/event/metrics/buy_now",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(i&&console.debug("updating user event-product buy now count response : HTTP "+e.status),e.json()))).then((e=>{i&&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 v(){let{storeId:e="",eventId:t=0,productId:n="",variantId:o="",cartToken:r="",checkoutToken:a="",quantity:s=0,price:u="",actionType:d="",trackingId:l=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},p={event_id:t,product_id:n,cart_token:r,checkout_token:a,quantity:s,price:u,variant_id:o,action_type:d,tracking_id:l};i&&console.debug("initiating ATC metadata event for eventId {}, productId {}, variantId {} ",t,n,o);const v=await fetch(c.Gc+"/cart-metadata/"+e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(p)}).then((e=>(i&&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,o)}));return v}function h(e){const t={event_id:e.event.event_id,cta_id:e.cta.cta_id,increase_by:1};fetch(c.Gc+"/event/metrics/cta/clicks",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(i&&console.debug("updating user cta click count response : HTTP "+e.status),e.json()))).then((e=>{i&&console.debug("updating user cta click count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating cta click count : ",e)}))}},4669:function(e,t,n){n.d(t,{Tc:function(){return v},ll:function(){return p}});var o,c=n(1824),i=n(7786),r=n(9854);n(7753);const a="Whatmore Video Shopping",s=null!==(o="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==o&&o,u="Video View",d={carousel:"Carousel",stories:"Stories",video_popup:"Video Popup"},l={homepage:"Home Page",product_page:"Product Page"};async function p(e){if((0,r.Dv)(e)&&null!==(0,r.hf)(e)&&(i.ZP.initialize((0,r.hf)(e)),s&&console.debug("Whatmore: initialized GA4")),(0,r.hv)(e)&&null!==(0,r.BH)(e)){const t=(0,r.OQ)(e);c.ZP.initialize((0,r.BH)(e),{useExistingGa:t}),s&&console.debug("Whatmore: initialized GA3")}}async function v(e,t,n){(0,r.hv)(e)&&null!==(0,r.BH)(e)&&(c.ZP.event({category:a,action:u,label:l[t]+":"+d[n]}),s&&console.debug("Whatmore: pushed view event to GA3")),(0,r.Dv)(e)&&null!==(0,r.hf)(e)&&(i.ZP.event({category:a,action:u+":"+l[t]+":"+d[n],value:1,nonInteraction:!1}),s&&console.debug("Whatmore: pushed view event to GA4"))}},795:function(e,t,n){n.d(t,{s:function(){return v}});var o=n(7381),c=n(9854),i=n(7753),r=n(2860);const a=function(e){let t={};t.metric_event_list=[e],(async()=>{!function(e){const t="ingesting analytis-event";(0,o.fs)(t);const n=e;fetch(r.DG+"/event_metrics/bulk",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>e.json())).then((e=>{})).catch((e=>{console.error("error "+t,e)}))}(t)})()},s=function(e,t,n,o){var c;return{landing_location_type:t.landingLocationType,template_type:t.templateType,whatmore_event:{id:e.event_id,eventset_id:null!==(c=e.eventset_id)&&void 0!==c?c:null,cta_list:o.map((e=>e.cta_id)),product_list:n.map((e=>e.product_id))}}};var u=n(778),d=n(2751),l=n(6967);const p=function(){return{user_id:(0,l.hb)(),session_id:(0,l.sQ)(),user_group:"group-a",user_agent:navigator.userAgent,store_id:(0,i.MO)("whatmoreShopId"),hostname:window.location.hostname,page_path:window.location.pathname,event_id:(0,d.x0)(),event_timestamp:Math.round((new Date).getTime()/1e3)}},v=function(){let{userInteractionType:e="",userInteractionMetadata:t={},widgetSourceDetails:n={},event:r="",productList:d=[],ctaList:l=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const v=(0,i.MO)("isInDesignMode"),h=(0,i.MO)("isDemoBrand"),g=(0,i.MO)("whatmoreShopId");if(!(0,c.AA)(g)||h||v)return;const m=p(),f=(0,u.r)(e,t),_=s(r,n,d,l),b=(0,i.MO)("whatmoreLoggingActive"),y={...m,interaction_data:f,data:_};b&&(0,o.EI)(y),(0,c.AA)(g)&&a({...m,interaction_data:f,data:_})}},778:function(e,t,n){n.d(t,{K:function(){return o},r:function(){return c}});const o=Object.freeze({EVENT_VIEW:"event-view",PRODUCT_CTA_VIEW:"product-cta-view",SHOPNOW_ATC_CLICKED:"shop-now-atc-clicked",SHOPNOW_BUYNOW_CLICKED:"shop-now-buy-now-clicked",PRODUCT_TILE_ATC_CLICKED:"product-tile-atc-clicked",PRODUCT_TILE_SHOPNOW_CLICKED:"product-tile-shopnow-clicked",VIDEO_LIKED:"video-liked",VIDEO_UNLIKED:"video-unliked",VIDEO_SHARE_CTA_CLICKED:"video-share-cta-clicked",VIDEO_MUTED:"video-muted",HOMEPAGE_CAROUSEL_SWIPED:"homepage-carousel-swiped",HOMEPAGE_VISITED:"homepage-visited",COLLECTION_PAGE_VISITED:"collection-page-visited",PDP_VISITED:"product-page-visited",HOMEPAGE_CAROUSEL_WIDGET_VIEW:"homepage-carousel-widget-view",BANNER_WIDGET_VIEW:"banner-widget-view",STORIES_WIDGET_VIEW:"stories-widget-view",COLLECTION_WIDGET_VIEW:"collection-widget-view",SPOTLIGHT_WIDGET_VIEW:"spotlight-widget-view",PDP_POPUP_WIDGET_VIEW:"pdp-popup-widget-view",VIDEO_PLAYBACK:"video-playback",SHOPNOW_CLICKED:"shopnow-clicked",WHATSAPP_ICON_CLICKED:"whatsapp-icon-clicked",BANNER_WIDGET_CLICKED:"banner-widget-clicked"}),c=function(e,t){return{name:e,metadata:JSON.stringify(t)}}},7643:function(e,t,n){n.d(t,{u:function(){return s}});var o=n(3933),c=n(7592),i=n(7313),r=n(795),a=(n(778),n(6417));const s=function(e){var t;const{ref:n,inView:s,entry:u}=(0,o.YD)({triggerOnce:!1,threshold:null!==(t=e.threshold)&&void 0!==t?t:1}),{whatmoreWidgetSourceDetails:d}=(0,i.useContext)(c.I);return(0,i.useEffect)((()=>{var t,n,o,c;s&&null!==(t=e.triggerFlag)&&void 0!==t&&t&&(0,r.s)({userInteractionType:e.userInteractionType,userInteractionMetadata:null!==(n=e.userInteractionMetadata)&&void 0!==n?n:{},widgetSourceDetails:d,event:e.event,productList:null!==(o=e.productList)&&void 0!==o?o:[],ctaList:null!==(c=e.ctaList)&&void 0!==c?c:[]})}),[s]),(0,a.jsx)("div",{ref:n,children:e.children})}}}]);
|