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