whatmore-react-assets 1.0.943 → 1.0.945
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.
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[436],{1492:function(e,t,o){o.r(t),o.d(t,{default:function(){return _}});var i=o(7313),n=o(6090),r=o(7616),l=o(5572),s=(o(6143),o(7850),o(4444),o(7244),o(123),o(5892),o(1811),o(9302)),a=o(2575),d=o(2210),p=o(8486),c=o(9821),u=o(8866),h=o(2279),m=o.n(h),y=o(7753),v=o(7129),x=o(1855),f=o(9854),g=o(4920),w=o(4522),P=o(778),j=o(7381),C=(o(3439),o(4892)),S=o(6805),I=o(9219),O=o(5945),M=o(7053),b=o(6417);var k=function(e){var t,o,n,r,s,a,d,p,u,h,m,x,g,w,P,j,k;const[E,F,Z,_,W]=(0,c.Z)();var N=(0,i.useContext)(v.V);const{whatmoreUITheme:U}=(0,i.useContext)(l.I),z=(0,y.MO)("whatmoreShopId"),D=(0,y.MO)("whatmorePrimaryFont"),R=(0,y.MO)("whatmoreSecondaryColor"),T=e.onClick,V=null===(t=e.isOnFocus)||void 0===t||t,H=null!==(o=e.playOnUnfocus)&&void 0!==o&&o,A=null!==(n=e.animateOnFocus&&(0,f.iWI)(z))&&void 0!==n&&n,$="portrait"===W[S.YP],G=($?1.076*F*(0,f.pEd)(z):F*(0,f.H4g)(z))+"px",q=($?1.076*F*(0,f.pEd)(z):F*(0,f.H4g)(z))+"px",B=($?.965*F*(0,f.pEd)(z):.859*F*(0,f.H4g)(z))+"px",L=(0,f.nzC)(z),{whatmoreIsPreviewMode:Y}=(0,i.useContext)(l.I),K=.25*F,X=K+"px",J=1.1*K+"px",[Q,ee]=(0,i.useState)(e.event),[te,oe]=(0,i.useState)(),ie=Math.round(+(null===(r=Q.products)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.price)),ne=Math.round(+(null===Q||void 0===Q||null===(a=Q.products[0])||void 0===a?void 0:a.compare_price)),re=ne&&0!=ne&&ne>ie?Math.round((ne-ie)/ne*100):NaN,[le,se]=(0,i.useState)(re);return(0,i.useEffect)((()=>{(0,f.N8M)(z)&&(0,I.p_)(Q,(0,f.Ipo)(z),z).then((e=>{var t,o,i,n;ee(e),(null===e||void 0===e||null===(t=e.products)||void 0===t||null===(o=t[0])||void 0===o?void 0:o.discount)&&se(null===e||void 0===e||null===(i=e.products)||void 0===i||null===(n=i[0])||void 0===n?void 0:n.discount)}));(async()=>{var e;const t=await(0,M.p)(null===Q||void 0===Q||null===(e=Q.products)||void 0===e?void 0:e[0],(0,f.Ipo)(z),z);oe(t)})()}),[]),(0,b.jsxs)("div",{ref:e=>{e&&(e.style.setProperty("margin-top",N.tileTopMargin+"px","important"),e.style.setProperty("margin-bottom",N.tileBottomMMargin+"px","important"))},children:[(0,b.jsx)("div",{style:{margin:"0 auto",width:F,height:$&&V?"STR2FOC6KG9"==z?E:1.1*E:E,borderRadius:"round"==U?"5px":"0px",boxShadow:"round"==U?L:null,borderWidth:(0,f.alU)(z),borderColor:(0,f.qPe)(z),overflow:"hidden",cursor:"pointer"},className:A?V?"whatmore-event-tile-scale-out-animation":"whatmore-event-tile-scale-in-animation":"none",onClick:()=>{T(Q)},children:(0,b.jsx)(C.Z,{height:"100%",width:"100%",url:Q.thumbnail_image,isPlaying:V||H,event:Q})}),(0,b.jsxs)("div",{onClick:()=>{T(Q)},style:{cursor:"pointer",display:"flex",gap:"6px",padding:"14px 8px"},children:[(Y?(0,f.uU$)(z):(0,f.EIj)(z))&&(0,b.jsx)("div",{ref:e=>{e&&e.style.setProperty("height",J,"important")},style:{maxWidth:X,borderRadius:"round"==U?"5px":"0px",overflow:"hidden",backgroundColor:"rgb(220, 220, 220, 1)"},children:(0,b.jsx)("img",{ref:e=>{e&&e.style.setProperty("object-fit",(0,f.yOX)(z),"important")},src:null===(d=Q.products)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.thumbnail_image})}),(0,b.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:[(0,b.jsx)("p",{ref:e=>{e&&(e.style.setProperty("font-size",G,"important"),e.style.setProperty("line-height","120%","important"),e.style.setProperty("font-family",D,"important"),e.style.setProperty("-webkit-line-clamp",1,"important"),e.style.setProperty("line-clamp",1,"important"),e.style.setProperty("-webkit-box-orient","vertical","important"),e.style.setProperty("display","-webkit-box","important"),e.style.setProperty("overflow","hidden","important"),e.style.setProperty("text-overflow","ellipsis","important"))},children:(0,O.s)(null===(u=Q.products[0])||void 0===u?void 0:u.title)}),(0,f.QaY)(z)&&(0,b.jsxs)("div",{style:{display:"flex",gap:"12px",flexDirection:(0,f.$zZ)(z)?"row":"row-reverse",justifyContent:(0,f.$zZ)(z)?"flex-start":"flex-end"},children:[(0,b.jsx)("p",{ref:e=>{e&&(e.style.setProperty("color",(0,f.Uyp)(z),"important"),e.style.setProperty("font-size",q,"important"),e.style.setProperty("font-family",D,"important"),e.style.setProperty("overflow","hidden","important"))},style:{textAlign:"left",fontWeight:"normal"==(0,f.rPP)(z)?"normal":"bold"},children:(0,I.jx)(parseFloat(null!==(h=null===te||void 0===te?void 0:te.price)&&void 0!==h?h:null===Q||void 0===Q||null===(m=Q.products)||void 0===m||null===(x=m[0])||void 0===x?void 0:x.price)," ",z,null===(g=Q.products[0])||void 0===g?void 0:g.currency)}),!isNaN(ne)&&ne>ie&&(0,b.jsx)("p",{ref:e=>{e&&(e.style.setProperty("color",(0,f.kPs)(z),"important"),e.style.setProperty("font-size",q,"important"),e.style.setProperty("font-family",D,"important"),e.style.setProperty("overflow","hidden","important"))},style:{textDecoration:"line-through"},children:(0,I.jx)(parseFloat(null!==(w=null===te||void 0===te?void 0:te.compare_at_price)&&void 0!==w?w:null===Q||void 0===Q||null===(P=Q.products)||void 0===P||null===(j=P[0])||void 0===j?void 0:j.compare_price)," ",z,null===(k=Q.products[0])||void 0===k?void 0:k.currency)})]}),(0,f.QaY)(z)&&!isNaN(le)&&0!=le&&(0,b.jsx)("div",{style:{display:"flex",backgroundColor:"green"==(0,f.ZJm)(z)?"#343434"==R?(0,f.ZJm)(z):R:(0,f.ZJm)(z),alignItems:"center",borderRadius:(0,f.CF_)(z)+"px",width:"fit-content",padding:(0,f.Spx)(z)?"3px 6px":"0px"},children:(0,f.Spx)(z)?(0,b.jsx)("p",{ref:e=>{e&&(e.style.setProperty("color",(0,f.mso)(z),"important"),e.style.setProperty("font-size",B,"important"),e.style.setProperty("font-family",D,"important"))},children:"".concat(le,"% Off")}):(0,b.jsx)("p",{ref:e=>{e&&(e.style.setProperty("color",(0,f.aUT)(z),"important"),e.style.setProperty("font-size",B,"important"),e.style.setProperty("font-family",(0,f.V3Y)(z),"important"))},children:(0,f.sG7)(z)})})]})]})]})};const E=(0,a.Z)({key:"whatmore-css-hv"});function F(e){const[t,o,n]=(0,c.Z)(),r=(0,y.MO)("whatmoreShopId"),s=e.events,a=e.onClick,u=n*(0,f.u6l)(r),h="32365904011"==r,[m,v]=(0,i.useState)(h?s.length:u),{whatmoreWidgetSourceDetails:j}=(0,i.useContext)(l.I);return(0,i.useEffect)((()=>{m<=u&&v((e=>e+u))}),[u]),(0,b.jsx)("div",{className:"whatmore-events-carousel-portrait",style:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,b.jsx)("div",{style:{width:window.innerWidth,height:"fit-content"},children:(0,b.jsx)(d.tq,{slidesPerView:s.length>1?u:1,initialSlide:s.length>1?1:0,centeredSlides:!0,centeredSlidesBounds:!1,watchSlidesProgress:!0,touchRatio:.5,onSlideChange:e=>{(0,w.y4)({userInteractionType:P.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:j}),e.realIndex>e.previousIndex&&v((e=>e+u))},loop:h,navigation:h,modules:[p.W_],children:s.map(((e,t)=>t<=m&&(0,b.jsx)(d.o5,{children:t=>{let{isActive:o,isPrev:i,isNext:n,isVisible:l}=t;return i||n||o?(0,f.$X$)(r)?(0,b.jsx)(k,{isOnFocus:o&&l,playOnUnfocus:!1,animateOnFocus:!0,event:e,onClick:()=>{a(e)}}):(0,b.jsx)(g.Z,{isOnFocus:o&&l,playOnUnfocus:!1,animateOnFocus:!0,event:e,onClick:()=>{a(e)}}):(0,b.jsx)(x.Z,{})}},"whatmore-event-tile-portrait-"+e.index)))})})})}function Z(e){const[t,o,n,r]=(0,c.Z)(),[s,a]=(0,i.useState)(-1),u=(0,y.MO)("whatmoreShopId"),h=e.onClick,v=e.events,j="32365904011"==u,[C,S]=(0,i.useState)(j?v.length:n),I=Math.min(n,v.length),{whatmoreWidgetSourceDetails:O}=(0,i.useContext)(l.I);return(0,i.useEffect)((()=>{C<=n&&S((e=>e+n))}),[n]),(0,b.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:r+"px",paddingRight:r+"px"},className:"whatmore-events-carousel-landscape",children:(0,b.jsx)("div",{style:{width:o*I*(0,f.Su5)(u)+"px"},children:(0,b.jsx)(d.tq,{slidesPerView:I,watchSlidesProgress:!0,modules:[p.W_],navigation:!0,slidesPerGroup:parseInt(I),onSlideChange:e=>{(0,w.y4)({userInteractionType:P.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:O}),e.realIndex>e.previousIndex&&S((e=>e+n))},spaceBetween:(0,f.WGf)(u),loop:j,children:v.map(((e,t)=>{const o=m()((()=>a(t)),300);return t<=C&&(0,b.jsx)(d.o5,{onMouseEnter:()=>{o()},onMouseLeave:()=>{o.cancel(),a(-1)},children:o=>{let{isActive:i,isPrev:n,isNext:r,isVisible:l}=o;return l?(0,f.$X$)(u)?(0,b.jsx)(k,{isOnFocus:t==s,playOnUnfocus:!0,animateOnFocus:!0,event:e,onClick:()=>{h(e)}}):(0,b.jsx)(g.Z,{isOnFocus:t==s,playOnUnfocus:!(0,f.dHy)(u)||t==parseInt(I/2)&&-1==s,animateOnFocus:!0,event:e,onClick:()=>{h(e)}}):(0,b.jsx)(x.Z,{})}},"whatmore-event-tile-landscape-"+e.index)}))})})})}var _=function(e){const[t,o,a]=(0,u.Z)(),[d]=(0,y.j1)("whatmoreShopId"),[p]=(0,y.j1)("whatmorePrimaryColor"),[c]=(0,y.j1)("whatmoreTitleFont"),h="portrait"==t?(0,y.MO)("whatmoreTitleFontSizePortrait"):(0,y.MO)("whatmoreTitleFontSize"),{whatmoreRootId:m}=(0,i.useContext)(l.I),x=((0,y.MO)("isInDesignMode"),(0,y.MO)("whatmoreCollectionHeading")),{whatmoreIsCollectionsTemplate:g}=(0,i.useContext)(l.I),w=e.events,P=e.onClick,C=c;function S(e){P(e)}return(0,i.useEffect)((()=>{(0,j.Oo)("Video shopping powered by Whatmore!")}),[]),(0,i.useEffect)((()=>{l.$.forEach((e=>{var t;const o=null!==(t=e.querySelector('.whatmore-template-type[data-wh="template-a"]'))&&void 0!==t?t:e.querySelector('.whatmore-template-type[data="template-a"]');if(!o)return;o&&e&&(e.style.minHeight="0px")}))}),[]),delete r.ZP.styles.global,(0,b.jsx)(s.C,{value:E,children:(0,b.jsx)("div",{className:"whatmore-carousel-events",children:(0,b.jsx)(n.x,{theme:r.ZP,cssVarsRoot:m,resetCSS:!1,children:(0,b.jsxs)(v.V.Provider,{value:{tileTopMargin:25,tileBottomMMargin:25,tileLeftMargin:4,tileRightMargin:4,showPlayButton:!0},children:[e.heading.trim().length>0||g?(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,b.jsx)("p",{ref:e=>{e&&(e.style.setProperty("font-family",C,"important"),e.style.setProperty("font-size",h+"px","important"))},style:{color:p,backgroundClip:"text",textAlign:"center",fontWeight:(0,f.wOV)(d),lineHeight:(0,f.vY4)(d),letterSpacing:(0,f.X2K)(d)},children:g?"W"!==x?x:"":e.heading})}):(0,b.jsx)(b.Fragment,{}),"landscape"===t?(0,b.jsx)(Z,{events:w,onClick:S}):(0,b.jsx)(F,{events:w,onClick:S})]})})})})}},1855:function(e,t,o){var i=o(7313),n=o(9821),r=o(7129),l=o(6417);t.Z=function(e){var[t,o]=(0,n.Z)();return(0,i.useContext)(r.V),e.event,(0,l.jsx)("div",{style:{margin:"0 auto",width:o,height:t,overflow:"hidden"}})}},5892:function(){},4444:function(){},1811:function(){},7850:function(){}}]);
|