whatmore-react-assets 1.0.1286 → 1.0.1288

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[116],{9085:function(t,e,o){o.r(e),o.d(e,{default:function(){return T}});var n=o(7313),r=(o(3439),o(6090)),i=o(32),l=o(7616),a=(o(6143),o(4444),o(7244),o(123),o(5892),o(9302)),s=o(2575),c=o(9821),d=o(8866),p=o(2279),h=o.n(p),u=o(7753),m=o(7129),x=o(1855),f=o(9854),y=o(364),v=o(4522),g=o(778),w=o(4892),j=o(5945),P=o(9219),M=o(6805),C=o(8984),S=o(7053),b=o(5416),I=o(6417);var E=function(t){var e,o,r,i,l,a,s,d,p,h,x,y;const[v,g,E,O,k]=(0,c.Z)(),Y=(0,u.MO)("whatmoreShopId"),N="portrait"===k[M.YP],T=(N?1.076*g*(0,f.pEd)(Y):g*(0,f.H4g)(Y))+"px",Z=(N?1.076*g*(0,f.pEd)(Y):g*(0,f.H4g)(Y))+"px",_=(N?.965*g*(0,f.pEd)(Y):.859*g*(0,f.H4g)(Y))+"px",[z,A]=(0,n.useState)(t.event),D=(0,u.MO)("whatmoreSecondaryColor");var R=(0,n.useContext)(m.V);const W=null===(e=t.isOnFocus)||void 0===e||e,F=null!==(o=t.playOnUnfocus)&&void 0!==o&&o,L=t.onClick,U=(0,u.MO)("whatmoreUITheme"),V=null!==(r=t.animateOnFocus&&(0,f.iWI)(Y))&&void 0!==r&&r,[G,B]=(0,n.useState)(!1),H=(0,u.MO)("whatmorePrimaryFont"),K=Math.round(+(null===(i=z.products[0])||void 0===i?void 0:i.price)),X=Math.round(+(null===(l=z.products[0])||void 0===l?void 0:l.compare_price)),$=X&&0!=X&&X>K?Math.round((X-K)/X*100):NaN,[q,J]=(0,n.useState)($),[Q,tt]=(0,n.useState)(),et="55143268394"===Y;return(0,n.useEffect)((()=>{(0,f.N8M)(Y)&&(0,P.p_)(z,(0,f.Ipo)(Y),Y).then((t=>{var e,o,n;A(t),(null===t||void 0===t||null===(e=t.products)||void 0===e||null===(o=e[0])||void 0===o?void 0:o.discount)&&J(null===t||void 0===t||null===(n=t.products[0])||void 0===n?void 0:n.discount),B(!0)}));(async()=>{var t;const e=await(0,S.p)(null===z||void 0===z||null===(t=z.products)||void 0===t?void 0:t[0],(0,f.Ipo)(Y),Y);tt(e),B(!0)})()}),[]),(0,I.jsxs)("div",{ref:t=>{t&&(t.style.setProperty("margin-top",R.tileTopMargin+"px"),t.style.setProperty("margin-bottom",R.tileBottomMMargin+"px"))},className:V&&!N?W?"whatmore-event-tile-scale-out-animation":"whatmore-event-tile-scale-in-animation":"none",style:{margin:"0 auto",cursor:"pointer",width:g},onClick:()=>{L(z)},children:[(0,I.jsx)("div",{style:{borderRadius:"round"==U?"5%":"0px",boxShadow:"round"==U?"0px 0px 5px 0px #B0B0B0":null,height:v,borderWidth:(0,f.alU)(Y),borderColor:(0,f.qPe)(Y),overflow:"hidden"},children:(0,I.jsx)(w.Z,{height:(0,f.dXm)(Y)+" !important",width:"100%",url:z.thumbnail_image,isPlaying:W||F||(0,C.gE)(),event:z})}),(0,I.jsxs)("div",{className:"wht-prod-info",style:{display:(0,f.pvY)(Y)?"flex":"none",flexDirection:"column",padding:"12px 4px",gap:et?"8px":"5px",alignItems:et?"center":"flex-start"},children:[(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-size",T),t.style.setProperty("line-height","120%"),t.style.setProperty("font-family",H,"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,j.s)(null===(a=z.products[0])||void 0===a?void 0:a.title)}),G&&(0,f.QaY)(Y)&&(0,I.jsxs)("div",{style:{display:"flex",gap:"12px",flexDirection:(0,f.$zZ)(Y)?"row":"row-reverse",justifyContent:et?"center":(0,f.$zZ)(Y)?"flex-start":"flex-end"},children:[(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,f.Uyp)(Y),"important"),t.style.setProperty("font-size",Z),t.style.setProperty("font-family",H,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textAlign:"left",fontWeight:"normal"==(0,f.rPP)(Y)?"normal":"bold"},children:(0,P.jx)(parseFloat((0,b.G)()?null===Q||void 0===Q?void 0:Q.price:null===z||void 0===z||null===(s=z.products)||void 0===s||null===(d=s[0])||void 0===d?void 0:d.price)," ",Y,null===(p=z.products[0])||void 0===p?void 0:p.currency)}),!isNaN(X)&&X>K&&(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,f.kPs)(Y),"important"),t.style.setProperty("font-size",Z),t.style.setProperty("font-family",H,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textDecoration:"line-through",alignItems:et?"center":void 0},children:(0,P.jx)(parseFloat((0,b.G)()?null===Q||void 0===Q?void 0:Q.compare_at_price:null===z||void 0===z||null===(h=z.products)||void 0===h||null===(x=h[0])||void 0===x?void 0:x.compare_price)," ",Y,null===(y=z.products[0])||void 0===y?void 0:y.currency)})]}),((0,f.QaY)(Y)&&!isNaN(q)&&0!=q&&G||et)&&(0,I.jsx)("div",{style:{display:(0,f.aKo)(Y)?"flex":"none",backgroundColor:et?D:"green"===(0,f.ZJm)(Y)?"#343434"===D?(0,f.ZJm)(Y):D:(0,f.ZJm)(Y),alignItems:"center",justifyContent:et?"center":void 0,borderRadius:et?"25px":(0,f.CF_)(Y)+"px",width:et?.5*g:"fit-content",padding:(0,f.Spx)(Y)?et?"12px 12px":"3px 6px":"0px",margin:et?"0 auto":void 0,textAlign:et?"center":void 0,height:et?"7%":void 0},children:(0,f.Spx)(Y)?(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,f.mso)(Y),"important"),t.style.setProperty("font-size",_,"important"),t.style.setProperty("font-family",H,"important"),t.style.setProperty("font-weight",et?"600":"normal","important"))},children:et?"BUY NOW":"".concat(q,"% Off")}):(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,f.aUT)(Y),"important"),t.style.setProperty("font-size",_,"important"),t.style.setProperty("font-family",(0,f.V3Y)(Y),"important"))},children:(0,f.sG7)(Y)})})]})]})},O=o(7381);const k=(0,s.Z)({key:"whatmore-css-hv"});function Y(t){const[e,o,r]=(0,c.Z)(),i=(0,u.MO)("whatmoreShopId"),l=t.events,a=t.onClick,{whatmoreWidgetSourceDetails:s}=(0,n.useContext)(y.I),d=Math.ceil(r),p=2*d,[h,m]=(0,n.useState)(p),[w,j]=(0,n.useState)(2*d),P=0===(0,f.WGf)(i)?24:(0,f.WGf)(i),[M,C]=(0,n.useState)({touchX:0,touchY:0}),S=()=>(0,I.jsx)("div",{style:{width:"50px",borderRadius:"50%",height:"50px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,I.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-right-portrait"})}),b=()=>(0,I.jsx)("div",{style:{width:"50px",borderRadius:"50%",height:"50px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,I.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-left-portrait"})}),O=t=>{if("next"===t){const t=2;j((t=>Math.min(t+Math.floor(r),l.length+d+1))),m((e=>Math.min(e+t,l.length+d+1)))}else j((t=>Math.max(t-Math.floor(r),p)));(0,v.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:s})};return(0,I.jsxs)("div",{className:"whatmore-events-carousel-portrait",style:{display:"flex",justifyContent:"flex-start",paddingLeft:"12px",overflow:"hidden",position:"relative"},onTouchStart:t=>{C({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)-M.touchX,l=(null===(n=t.changedTouches)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.clientY)-M.touchY;Math.sqrt(i**2+l**2)>10&&Math.abs(i)>Math.abs(l)&&O(i>0?"prev":"next")},children:[(0,f.Yxs)(i)&&(0,I.jsxs)(I.Fragment,{children:[w<=l.length+d&&(0,I.jsx)("div",{onClick:()=>O("next"),style:{position:"absolute",zIndex:1,top:"50%",right:"0",transform:"translateY(-100%)"},children:(0,I.jsx)(S,{})}),w>2*d&&(0,I.jsx)("div",{onClick:()=>O("prev"),style:{position:"absolute",left:"0",zIndex:1,top:"50%",transform:"translateY(-100%)"},children:(0,I.jsx)(b,{})})]}),(0,I.jsx)("div",{style:{display:"flex",gap:P,transform:"translateX(-".concat((w-p)*(o+P),"px)"),transition:"transform 0.4s ease-in-out"},children:l.map(((t,e)=>e<h?(0,I.jsx)("div",{children:(0,I.jsx)(E,{isOnFocus:e<=w-d-1&&e>=Math.max(0,w-p),playOnUnfocus:!1,animateOnFocus:!0,event:t,onClick:()=>a(t)})},"whatmore-carousel-tile-".concat(e)):(0,I.jsx)(x.Z,{})))})]})}function N(t){const[e,o,r,i]=(0,c.Z)(),[l,a]=(0,n.useState)(-1),s=(0,u.MO)("whatmoreShopId"),[d,p]=(0,n.useState)("next"),m=t.onClick,x=t.events,{whatmoreWidgetSourceDetails:w}=(0,n.useContext)(y.I),j=Math.min(Math.ceil(r),x.length),[P,M]=(0,n.useState)(0),C=0===(0,f.WGf)(s)?24:(0,f.WGf)(s),S=()=>(0,I.jsx)("div",{children:(0,I.jsx)("button",{onClick:Y,style:{width:"50px",borderRadius:"6px",height:"100px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,I.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-right"})})}),b=()=>(0,I.jsx)("div",{children:(0,I.jsx)("button",{onClick:k,style:{width:"50px",borderRadius:"6px",height:"100px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,I.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-left"})})});(0,n.useEffect)((()=>{P<=j&&M((t=>t+j))}),[j]);const O=()=>{a(-1)},k=()=>{P!==j&&(p("prev"),M((t=>Math.max(Math.ceil(t-r),j))),(0,v.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},Y=()=>{P>x.length+r||(p("next"),M((t=>Math.floor(t+r))),(0,v.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},N=P>x.length?x.length-j+1:P-j,T=P>=x.length?x.length:N+j,Z=x.slice(N,T);return(0,I.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:[("83584942374"===s||"56783601836"===s?x.length>j&&P>j:x.length>=r-1&&x.length>4)&&(0,I.jsx)("div",{style:{position:"absolute",left:i+"px",zIndex:1,top:"50%",transform:"translateY(-65%)"},children:P!==j&&(0,I.jsx)(b,{})}),(0,I.jsx)("div",{className:"wht-hide-scrollbar",style:{display:"flex",gap:C+"px",width:"".concat(o*r*(0,f.Su5)(s),"px"),justifyContent:"83584942374"===s||"56783601836"===s||x.length<=r-1||x.length<5?"center":"flex-start",overflow:"auto"},children:Z.map(((t,e)=>{const o="whatmore-event-tile-landscape-".concat(t.index).concat(e===j-1?"-last":""),n=e===l;return(0,I.jsx)("div",{className:"whatmore-event-tile-horizontal-swipe-animation-".concat("next"===d?"next":"prev"),onMouseEnter:()=>(t=>{const e=h()((()=>a(t)),300);return e(),e.cancel})(e),onMouseLeave:O,children:(0,I.jsx)(E,{isOnFocus:n,playOnUnfocus:!0,animateOnFocus:!0,event:t,onClick:()=>(t=>{m(t)})(t)})},o)}))}),("83584942374"===s||"56783601836"===s?x.length>j&&P>j:x.length>=r-1&&x.length>4)&&(0,I.jsx)("div",{style:{position:"absolute",zIndex:1,top:"50%",right:i+"px",transform:"translateY(-65%)"},children:P<=x.length&&(0,I.jsx)(S,{})})]})}var T=function(t){const[e,o,s]=(0,d.Z)(),[c]=(0,u.j1)("whatmoreShopId"),[p]=(0,u.j1)("whatmorePrimaryColor"),[h]=(0,u.j1)("whatmoreSecondaryColor"),[x]=(0,u.j1)("whatmoreTitleFont"),v="portrait"==e?(0,u.MO)("whatmoreTitleFontSizePortrait"):(0,u.MO)("whatmoreTitleFontSize"),{whatmoreRootId:g}=(0,n.useContext)(y.I),w=((0,u.MO)("isInDesignMode"),(0,u.MO)("whatmoreCollectionHeading")),{whatmoreIsCollectionsTemplate:j}=(0,n.useContext)(y.I),P=t.events,M=t.onClick,C=x;function S(t){M(t)}return(0,n.useEffect)((()=>{(0,O.Oo)("Video shopping powered by Whatmore!")}),[]),(0,n.useEffect)((()=>{i.IR.forEach((t=>{var e;const o=null!==(e=t.querySelector('.whatmore-template-type[data-wh="template-f"]'))&&void 0!==e?e:t.querySelector('.whatmore-template-type[data="template-f"]');if(!o)return;o&&t&&(t.style.minHeight="0px")}))}),[]),delete l.ZP.styles.global,(0,I.jsx)(a.C,{value:k,children:(0,I.jsx)("div",{className:"whatmore-carousel-events",children:(0,I.jsx)(r.x,{theme:l.ZP,cssVarsRoot:g,resetCSS:!1,children:(0,I.jsxs)(m.V.Provider,{value:{tileTopMargin:25,tileBottomMMargin:25,tileLeftMargin:4,tileRightMargin:4,showPlayButton:!0},children:[t.heading.trim().length>0||j?(0,I.jsx)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"62636458233"==c?"flex-start":"center"},children:(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-family",C,"important"),t.style.setProperty("font-size",v+"px","important"))},style:{color:p,backgroundClip:"text",textAlign:"center",fontWeight:(0,f.wOV)(c),lineHeight:(0,f.vY4)(c),letterSpacing:(0,f.X2K)(c)},children:j?"W"!==w?w:"":t.heading})}):(0,I.jsx)(I.Fragment,{}),"landscape"===e?(0,I.jsx)(N,{events:P,onClick:S}):(0,I.jsx)(Y,{events:P,onClick:S})]})})})})}},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),l=o(7753),a=o(6417);e.Z=function(t){var[e,o]=(0,r.Z)();(0,n.useContext)(i.V);const s=(0,l.MO)("whatmoreShopId");return t.event,(0,a.jsx)("div",{style:{margin:"0 auto",width:"8968077397"==s?void 0:o,aspectRatio:"8968077397"==s?9/16:void 0,height:"8968077397"==s?"100%":e,overflow:"hidden"}})}},6805:function(t,e,o){o.d(e,{$I:function(){return a},$w:function(){return c},AK:function(){return i},AL:function(){return l},YP:function(){return r},me:function(){return n},rE:function(){return s}});const n="device_type",r="device_mode",i="mobile",l="tablet",a="desktop",s="portrait",c="landscape"},9821:function(t,e,o){var n=o(7753),r=o(8866),i=o(6805),l=o(9854);e.Z=function(t){const[e,o,a]=(0,r.Z)(),[s]=(0,n.j1)("whatmoreLandscapePadding"),[c]=(0,n.j1)("whatmoreShopId"),[d]=(0,n.j1)("whatmoreVideoTileSize"),[p]=(0,n.j1)("whatmoreVideoTileSizePortrait"),h=a>=1025,u="portrait"==e?p:d,m=!("portrait"!=e||!(a>=481)),x=u/100*1.3*.5,f=u/100;var y=Math.min(a,o),[v,g,w,j]=[.6*y*(16/9),.6*y,1.4,0];function P(t){return Math.round(10*t)/10}var M={DEVICE_TYPE:i.AK,DEVICE_MODE:i.rE};if(h){const t=g*x,e=v*x;[v,g,w,j]=[e,t,(a-2*s-2*(0,l.mZU)(c))/(1.1*t),s],M[i.me]=i.$I,M[i.YP]=i.$w}else if(m){var C=.8*g,S=.8*v;"portrait"==e?(C*=f,S*=f,[v,g,w,j]=[S,C,P(a/(1.2*C)),0],M[i.me]=i.AL,M[i.YP]=i.rE):([v,g,w,j]=[S,C,(a-2*s)/(1.1*C),s],M[i.me]=i.AL,M[i.YP]=i.$w)}else{C=g,S=v;"portrait"==e?(C=C*f*.9,S=S*f*.9,[v,g,w,j]=[S,C,P(a/(1.15*C)),0],M[i.me]=i.AK,M[i.YP]=i.rE):(C=.7*g,S=.7*v,[v,g,w,j]=[S,C,(a-2*s)/(1.1*C),s],M[i.me]=i.AK,M[i.YP]=i.$w)}return[v,g,w,j,M]}},3439:function(){},7244:function(){},5892:function(){},4444:function(){}}]);