whatmore-react-assets 1.0.1401 → 1.0.1402
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[180],{3440:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return _}});var o=n(7753),i=n(7313),r=n(9854),l=n(4844);const a=function(t){new PerformanceObserver((e=>{for(const n of e.getEntries()){[`${window.location.origin}/cart/add.js`,`${window.location.origin}/cart/add`].includes(n.name)&&(console.debug("Whatmore :: Fetch request detected to",n.name),(0,r.qcZ)(whatmoreShopId)&&setTimeout((()=>{(0,l.Cj)(t)}),1e3))}})).observe({entryTypes:["resource"]})};var c=n(5416),s=n(364),u=n(6524);var d,f=n(2279),h=n.n(f),m=n(2860),g=n(6417);const p=i.lazy((()=>Promise.all([n.e(561),n.e(219),n.e(428)]).then(n.bind(n,5582)))),v=i.lazy((()=>Promise.all([n.e(302),n.e(13),n.e(240),n.e(423),n.e(561),n.e(751),n.e(219),n.e(281)]).then(n.bind(n,4284)))),w=i.lazy((()=>Promise.all([n.e(302),n.e(13),n.e(240),n.e(423),n.e(561),n.e(751),n.e(219),n.e(312)]).then(n.bind(n,2209)))),S=null!==(d="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==d&&d;let y=h()((t=>{fetch(m.Gc+"/customization/frontend/"+t).then((t=>t.json())).then((e=>{(0,r.TZM)(e,t),(0,o.bU)("brandCustomizationsLoaded",!0)})).catch((t=>{console.error("Whatmore : Error while fetching brandCustomizations : "+t)}))}),100,{leading:!0,trailing:!1});var _=function(){var t;const[e]=(0,o.j1)("whatmoreLandingLocationType"),[d]=(0,o.j1)("whatmoreShopId"),f=(0,o.MO)("isInDesignMode"),[h,m]=(0,o.j1)("brandCustomizationsLoaded"),[_]=(0,o.j1)("whatmoreEmbedAppUseVariant"),{whatmoreEventsBrowsingTemplate:j}=(0,i.useContext)(s.I),[x]=null===(t=performance)||void 0===t?void 0:t.getEntriesByType("navigation");if((0,i.useEffect)((()=>{if(!h){const t=3e5;(0,r.fmD)(t)&&"reload"!=(null===x||void 0===x?void 0:x.type)?m(!0):y(d)}null==localStorage.getItem("_user_wh_lc")&&"72201044272"==d&&n.e(897).then(n.bind(n,3488)).then((t=>{let{getLocationDetails:e}=t;return e()})).then((t=>(localStorage.setItem("_user_wh_lc",JSON.stringify(t)),{}))).catch((t=>{localStorage.setItem("_user_wh_lc",JSON.stringify({latitude:"",longitude:""})),console.error(`Error: ${t}`)}))}),[]),(0,i.useEffect)((()=>{a("true"===_),(0,r.cEH)(d)&&function(t){let e=document.createElement("style");e.innerHTML=t,document.head.appendChild(e)}((0,r.cEH)(d))}),[h]),!h)return(0,g.jsx)(g.Fragment,{});if((0,c.G)()){if((0,u.yK)(j))return(0,g.jsx)(g.Fragment,{});if("index"===e||"collection"===e||e.startsWith("collection")||e.startsWith("page")){if(!(0,u.ru)(j))return S&&console.debug("Whatmore : Shopify, rendering index/collection page carousels : "+j),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(i.Suspense,{children:(0,g.jsx)(p,{})})});if(function(){var t,e,n,i,l,a,c,s,u,h,m,g;const p=(0,o.MO)("whatmoreCollectionId");return f||(null===(t=window)||void 0===t||null===(e=t.Shopify)||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.role)&&"main"!==(null===(i=window)||void 0===i||null===(l=i.Shopify)||void 0===l||null===(a=l.theme)||void 0===a?void 0:a.role)||(0,r.ZKt)(d)&&(null===(c=window)||void 0===c||null===(s=c.Shopify)||void 0===s||null===(u=s.theme)||void 0===u?void 0:u.role)&&"main"===(null===(h=window)||void 0===h||null===(m=h.Shopify)||void 0===m||null===(g=m.theme)||void 0===g?void 0:g.role)&&((0,r.$i1)(d)||p&&(0,r.x6U)(d).includes(p))}())return S&&console.debug("Whatmore : Shopify, rendering index/collection page spotlight : "+j),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(i.Suspense,{children:(0,g.jsx)(w,{})})})}var b,I,O,T,E,$,N,P,W,J,F,D;return e.startsWith("product")?(0,u.ru)(j)?(null!==(b=window)&&void 0!==b&&null!==(I=b.Shopify)&&void 0!==I&&null!==(O=I.theme)&&void 0!==O&&O.role&&"main"===(null===(T=window)||void 0===T||null===(E=T.Shopify)||void 0===E||null===($=E.theme)||void 0===$?void 0:$.role)||window.location.href.includes("localhost:"))&&(0,r.Nbw)(d)?(S&&console.debug("Whatmore : Shopify, rendering PDP-page popup : "+j),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(i.Suspense,{children:(0,g.jsx)(v,{})})})):(null!==(N=window)&&void 0!==N&&null!==(P=N.Shopify)&&void 0!==P&&null!==(W=P.theme)&&void 0!==W&&W.role&&"main"!==(null===(J=window)||void 0===J||null===(F=J.Shopify)||void 0===F||null===(D=F.theme)||void 0===D?void 0:D.role)||f)&&(0,r.v6T)(d)?(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(i.Suspense,{children:(0,g.jsx)(v,{})})}):(S&&console.debug("Whatmore : Shopify, PDP-page popup disabled."),(0,g.jsx)(g.Fragment,{})):(S&&console.debug("Whatmore : Shopify, rendering PDP-page carousels : "+j),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(i.Suspense,{children:(0,g.jsx)(p,{})})})):((0,r.qcZ)(d)&&(0,r.Jy1)(d)&&"cart"===e&&(S&&console.debug("Whatmore : initiating whatmore attribution from cart page."),(0,l.Cj)("true"===_)),(0,g.jsx)(g.Fragment,{}))}return"index"===e||"collection"===e?(0,u.ru)(j)?(S&&console.debug("Whatmore : External, rendering index/collection page popup : "+j),(0,g.jsx)(g.Fragment,{})):(S&&console.debug("Whatmore : External, rendering index/collection page carousels : "+j),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(i.Suspense,{children:(0,g.jsx)(p,{})})})):e.startsWith("product")||"embed"===e?(0,u.yK)(j)||(0,u.ru)(j)?(0,r.Nbw)(d)?(S&&console.debug("Whatmore : External, rendering PDP-page popup : "+j),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(i.Suspense,{children:(0,g.jsx)(v,{})})})):(S&&console.debug("Whatmore : External, PDP-page popup disabled."),(0,g.jsx)(g.Fragment,{})):(S&&console.debug("Whatmore : External, rendering PDP-page carousels : "+j),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(i.Suspense,{children:(0,g.jsx)(p,{})})})):(0,g.jsx)(g.Fragment,{})}},5416:function(t,e,n){"use strict";function o(){return!(void 0==window.Shopify&&!window.location.href.includes("shopify")&&!window.location.href.includes("localhost:"))}n.d(e,{G:function(){return o}})},7381:function(t,e,n){"use strict";n.d(e,{EI:function(){return l},Oo:function(){return c},fs:function(){return a}});var o=n(7753);const i=(0,o.MO)("whatmoreShopId");function r(t){console.debug("Whatmore : "+t)}function l(t){var e;const n=null!==(e="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==e&&e;n&&(r("total events received : "+(t&&t.length)),r("events data : "+JSON.stringify(t)))}function a(t){var e;null!==(e="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==e&&e&&r(t)}const c=t=>{"STR60LW4WMA"!=i&&console.log(`%c ${t}`,"background: #D53F8C; color: white; font-size: 19px; padding: 5px; font-weight: semibold;","\n\nFind us here -> https://www.whatmore.ai")}},4844:function(t,e,n){"use strict";n.d(e,{wW:function(){return d},Cj:function(){return u},JL:function(){return h},bj:function(){return f},Bi:function(){return c},Mj:function(){return s},bN:function(){return m},m3:function(){return g}});var o=n(9854);const i="_whatmore-tracking-id";var r=n(2751),l=n(6967),a=n(7753);function c(){const t="https://"+window.location.hostname+"/cart.json";return fetch(t,{method:"GET"})}async function s(){const t="https://"+window.location.hostname+"/cart.json";return await fetch(t,{method:"GET"})}async function u(t){var e;let n=(0,r.x0)(),o=null,c=null,u={},d=null,f=null,h=null,m={},g=(0,l.MU)(),p=null===(e=localStorage)||void 0===e?void 0:e.wht_is_impression,v=g.length>0;g.forEach((t=>{m.hasOwnProperty(null===t||void 0===t?void 0:t.product_id)||(m[null===t||void 0===t?void 0:t.product_id]={widgetInfo:null===t||void 0===t?void 0:t.widget_info,location:null===t||void 0===t?void 0:t.location,userType:null===t||void 0===t?void 0:t.user_type})})),await s().then((t=>t.json())).then((e=>{n=e.token;let r=[];if(r=!0===t?e.items.map((t=>{const e=m[null===t||void 0===t?void 0:t.variant_id];return{...t,location:null===e||void 0===e?void 0:e.location,userType:null===e||void 0===e?void 0:e.userType,widget_info:null===e||void 0===e?void 0:e.widgetInfo}})):e.items.map((t=>{const e=m[null===t||void 0===t?void 0:t.product_id];return{...t,location:null===e||void 0===e?void 0:e.location,userType:null===e||void 0===e?void 0:e.userType,widget_info:null===e||void 0===e?void 0:e.widgetInfo}})),0==r.length)return console.debug("Whatmore :: no cart items available for view products"),null;r.map((e=>{if(o=e.key,c=e.quantity,u=e.properties,d=e.widget_info,f=e.location,h=e.userType,null===u||!(i in u)){const n=async function(t,e,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default",c=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0,d=arguments.length>8?arguments[8]:void 0;const f=(0,a.MO)("whatmoreShopId"),h=s?(0,l.hb)()+("72201044272"==f?`#${o}#${r}#${c?"olduser":"newuser"}`:`#${o}`):d?"_wht_video_session":u?"_wht_video_impression":"";let m={id:t,quantity:e,properties:{...h?{[i]:h}:{},...n}};return await fetch("https://"+window.location.hostname+"/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}).then((t=>t.json())).catch((t=>{console.error("Whatmore :: Error while updating cart attribute.",t)}))}(o,c,u,d,f,h,m.hasOwnProperty(JSON.stringify(!0===t?e.variant_id:e.product_id)),p,v);return n}}))})).catch((t=>{console.error("Whatmore :: Error while fetching cart_token for cart attribute update.",t)}))}async function d(t,e,n,r){let a,c,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default",u=arguments.length>5?arguments[5]:void 0,d=arguments.length>6?arguments[6]:void 0;if((0,o.qcZ)(n)){const o=(0,l.hb)()+("72201044272"==n?`#${r}#${s}#${u?"olduser":"newuser"}:direct`:`#${r}:direct`);if(a={items:[{id:t,quantity:e,properties:{[i]:o}}]},"77105758517"==n){c=new URLSearchParams,c.append("product-id",null===d||void 0===d?void 0:d.client_product_id),c.append("id",t),c.append("quantity",e);return await fetch("https://"+window.location.hostname+"/cart/add.js",{method:"POST",body:c})}}else a={items:[{id:t,quantity:e}]};const f=await fetch("https://"+window.location.hostname+"/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return f}function f(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default",l=arguments.length>5?arguments[5]:void 0;const a="https://"+window.location.hostname;var c;const s="72201044272"==n?`came-from-whatmore-live_${i}_${r}_${l?"olduser":"newuser"}`:`came-from-whatmore-live_${i}`;(0,o.lj5)(n)?(c=`${a}/cart/${t}:${e}?`+(0,o.awP)(n)+"&"+(0,o.n9s)(n)+"&"+(0,o.Uch)(n),(0,o.qcZ)(n)&&(c=`${c}&ref=`+s)):(c=`${a}/cart/${t}:${e}`,(0,o.qcZ)(n)&&(c=`${c}?ref=`+s)),window.location.href=c}function h(t){const e="https://"+window.location.hostname+"/cart";(0,o.lj5)(t)?window.location.href=e+"?"+(0,o.awP)(t)+"&"+(0,o.n9s)(t)+"&"+(0,o.poG)(t):window.location.href=e}async function m(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("27303477337"===n){var o,i;const n="https://"+window.location.hostname,r=window.location.pathname.split("/");e=n+"/"+(null!==r&&void 0!==r&&null!==(o=r[1])&&void 0!==o&&o.startsWith("en-")?(null===r||void 0===r?void 0:r[1])+"/":"")+(null===t||void 0===t||null===(i=t.product_link)||void 0===i?void 0:i.split(".co")[1])+".js"}else e=(null===t||void 0===t?void 0:t.product_link)+".js";const r=await fetch(e,{method:"GET"});if(!r.ok)throw new Error(`Error! status: ${r.status}`);const l=await r.json();return l}async function g(t){const e=t.product_link+".json",n=await fetch(e,{method:"GET"});if(!n.ok)throw new Error(`Error! status: ${n.status}`);return await n.json()}},6967:function(t,e,n){"use strict";n.d(e,{FF:function(){return y},H4:function(){return _},MU:function(){return j},hb:function(){return w},sQ:function(){return S},xV:function(){return b},xw:function(){return x}});var o=n(2751),i=n(7753),r=n(7008);const l="_whatmore_user_id",a="_whatmore_session_id",c="_whatmore_viewed_products",s="_whatmore_add_to_cart_products",u="_whatmore_session_time",d="_whatmore_store_id",f="_whatmore_qview_index",h="_whatmore_brand_questions",m=(0,i.MO)("whatmoreShopId"),g=18e5,p=2592e5,v="_whatmore_bulk_events";function w(){return localStorage.getItem(d)!=m&&localStorage.setItem(d,m),null==localStorage.getItem(l)&&function(){new Date;const t=(0,o.x0)();localStorage.setItem(l,t)}(),localStorage.getItem(l)}function S(){const t=new Date,e=JSON.parse(localStorage.getItem(v))||[],n=localStorage.getItem(u);return(null==localStorage.getItem(a)||null==n||t.getTime()>n)&&(localStorage.removeItem(a),localStorage.removeItem(u),function(){const t=(0,o.x0)(),e=(new Date).getTime()+g;localStorage.setItem(a,t),localStorage.setItem(u,e)}(),e&&e.length>0&&((0,r.K)(e),localStorage.removeItem(v))),localStorage.getItem(a)}function y(t,e,n,o,i){const r=(new Date).getTime(),l={event_id:t.event_id,product_id:e.client_product_id,product_title:e.title,price:e.price,timestamp:r,widget_info:n,location:o,user_type:i?"olduser":"newuser",variants:[]};if(null===localStorage.getItem(s))localStorage.setItem(s,JSON.stringify([l]));else{let t=JSON.parse(localStorage.getItem(s)).filter((t=>t.timestamp+p>r));localStorage.setItem(s,JSON.stringify([...t,l]))}}function _(t,e,n,o,i){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"default",l=arguments.length>6?arguments[6]:void 0;const a=[],s=(new Date).getTime();if(e.map((e=>{const c={event_id:t,product_id:e.client_product_id,product_title:e.title,price:e.price,timestamp:s,variants:[],page:n,widget_type:o,widget_info:i,location:r,user_type:l?"olduser":"newuser"};a.push(c)})),null===localStorage.getItem(c))console.debug("viewed Products",JSON.stringify(a)),localStorage.setItem(c,JSON.stringify(a));else{let e=JSON.parse(localStorage.getItem(c)),n=!1;e.map((e=>{let o=Object.assign({},e);return e.event_id===t&&(e.timestamp=s,n=!0),o})),n?localStorage.setItem(c,JSON.stringify(e)):localStorage.setItem(c,JSON.stringify([...e,...a]))}}function j(){const t=(new Date).getTime();let e=JSON.parse(localStorage.getItem(c));if(!e)return[];let n=e.filter((e=>e.timestamp+p>t));return localStorage.setItem(c,JSON.stringify(n)),n}function x(){if(null!=localStorage.getItem(f)){const t=parseInt(localStorage.getItem(f))+1;localStorage.setItem(f,t)}}function b(t){const e=(new Date).getTime();if(null==localStorage.getItem(h)){const n={questionList:null===t||void 0===t?void 0:t.filter((t=>1==(null===t||void 0===t?void 0:t.is_active))),timestamp:e};localStorage.setItem(h,JSON.stringify(n))}else{const n=JSON.parse(localStorage.getItem(h));if((null===n||void 0===n?void 0:n.timestamp)+6e5>e){const n={questionList:null===t||void 0===t?void 0:t.filter((t=>1==(null===t||void 0===t?void 0:t.is_active))),timestamp:e};localStorage.setItem(h,JSON.stringify(n))}}}},7008:function(t,e,n){"use strict";n.d(e,{K:function(){return r}});var o=n(2860),i=n(7381);const r=function(t){let e={};const n=t.length<10;e.metric_event_list=t,(async()=>{!function(t,e){const n="ingesting analytis-event";(0,i.fs)(n);const r=t;fetch(o.DG+"/event_metrics/bulk",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r),keepalive:e}).then((t=>t.json())).then((t=>{})).catch((t=>{console.error("error "+n,t)}))}(e,n)})()}},8624:function(t,e,n){var o=n(7289).Symbol;t.exports=o},8665:function(t,e,n){var o=n(8624),i=n(3596),r=n(8186),l=o?o.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":l&&l in Object(t)?i(t):r(t)}},2306:function(t,e,n){var o=n(5510),i=/^\s+/;t.exports=function(t){return t?t.slice(0,o(t)+1).replace(i,""):t}},2692:function(t,e,n){var o="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=o},3596:function(t,e,n){var o=n(8624),i=Object.prototype,r=i.hasOwnProperty,l=i.toString,a=o?o.toStringTag:void 0;t.exports=function(t){var e=r.call(t,a),n=t[a];try{t[a]=void 0;var o=!0}catch(c){}var i=l.call(t);return o&&(e?t[a]=n:delete t[a]),i}},8186:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},7289:function(t,e,n){var o=n(2692),i="object"==typeof self&&self&&self.Object===Object&&self,r=o||i||Function("return this")();t.exports=r},5510:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},2279:function(t,e,n){var o=n(1845),i=n(6170),r=n(7923),l=Math.max,a=Math.min;t.exports=function(t,e,n){var c,s,u,d,f,h,m=0,g=!1,p=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function w(e){var n=c,o=s;return c=s=void 0,m=e,d=t.apply(o,n)}function S(t){return m=t,f=setTimeout(_,e),g?w(t):d}function y(t){var n=t-h;return void 0===h||n>=e||n<0||p&&t-m>=u}function _(){var t=i();if(y(t))return j(t);f=setTimeout(_,function(t){var n=e-(t-h);return p?a(n,u-(t-m)):n}(t))}function j(t){return f=void 0,v&&c?w(t):(c=s=void 0,d)}function x(){var t=i(),n=y(t);if(c=arguments,s=this,h=t,n){if(void 0===f)return S(h);if(p)return clearTimeout(f),f=setTimeout(_,e),w(h)}return void 0===f&&(f=setTimeout(_,e)),d}return e=r(e)||0,o(n)&&(g=!!n.leading,u=(p="maxWait"in n)?l(r(n.maxWait)||0,e):u,v="trailing"in n?!!n.trailing:v),x.cancel=function(){void 0!==f&&clearTimeout(f),m=0,c=h=s=f=void 0},x.flush=function(){return void 0===f?d:j(i())},x}},1845:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},9752:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},2060:function(t,e,n){var o=n(8665),i=n(9752);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==o(t)}},6170:function(t,e,n){var o=n(7289);t.exports=function(){return o.Date.now()}},7923:function(t,e,n){var o=n(2306),i=n(1845),r=n(2060),l=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=o(t);var n=a.test(t);return n||c.test(t)?s(t.slice(2),n?2:8):l.test(t)?NaN:+t}},2751:function(t,e,n){"use strict";n.d(e,{x0:function(){return o}});let o=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"),"")}}}]);
|
@@ -0,0 +1 @@
|
|
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 N}});var n=o(7313),i=(o(3439),o(6090)),r=o(32),l=o(7616),a=(o(6143),o(4444),o(7244),o(123),o(5892),o(9302)),s=o(2575),d=o(9821),c=o(8866),p=o(2279),u=o.n(p),h=o(7753),v=o(7129),m=o(1855),x=o(9854),y=o(364),f=o(4522),g=o(778),w=o(4892),j=o(5945),P=o(9219),M=o(6805),C=o(8984),b=o(7053),S=o(5416),I=o(6417);var E=function(t){var e,o,i,r,l,a,s,c,p,u,m,y,f,g,E,O,k,Y,_,N,T,z,Z,A,D;const[L,R,W,F,$]=(0,d.Z)(),V=(0,h.MO)("whatmoreShopId"),U=(0,h.MO)("whatmoreLandingLocationType"),G="portrait"===$[M.YP],B=(G?1.076*R*(0,x.pEd)(V):R*(0,x.H4g)(V))+"px",H=(G?1.076*R*(0,x.pEd)(V):R*(0,x.H4g)(V))+"px",K=(G?.965*R*(0,x.pEd)(V):.859*R*(0,x.H4g)(V))+"px",[X,q]=(0,n.useState)(t.event),J=(0,h.MO)("whatmoreSecondaryColor");var Q=(0,n.useContext)(v.V);const tt=null===(e=t.isOnFocus)||void 0===e||e,et=null!==(o=t.playOnUnfocus)&&void 0!==o&&o,ot=t.onClick,nt=(0,h.MO)("whatmoreUITheme"),it=null!==(i=t.animateOnFocus&&(0,x.iWI)(V))&&void 0!==i&&i,[rt,lt]=(0,n.useState)(!1),at=(0,h.MO)("whatmorePrimaryFont"),st=Math.round(+(null===(r=X.products[0])||void 0===r?void 0:r.price)),dt=Math.round(+(null===(l=X.products[0])||void 0===l?void 0:l.compare_price)),ct=dt&&0!=dt&&dt>st?Math.round((dt-st)/dt*100):NaN,[pt,ut]=(0,n.useState)(ct),[ht,vt]=(0,n.useState)(),mt="55143268394"===V;return(0,n.useEffect)((()=>{(0,x.N8M)(V)&&(0,P.p_)(X,(0,x.Ipo)(V),V).then((t=>{var e,o,n;q(t),(null===t||void 0===t||null===(e=t.products)||void 0===e||null===(o=e[0])||void 0===o?void 0:o.discount)&&ut(null===t||void 0===t||null===(n=t.products[0])||void 0===n?void 0:n.discount),lt(!0)}));(async()=>{var t;const e=await(0,b.p)(null===X||void 0===X||null===(t=X.products)||void 0===t?void 0:t[0],(0,x.Ipo)(V),V);vt(e),lt(!0)})()}),[]),(0,I.jsxs)("div",{ref:t=>{t&&(t.style.setProperty("margin-top",Q.tileTopMargin+"px"),t.style.setProperty("margin-bottom",Q.tileBottomMMargin+"px"))},className:it&&!G?tt?"whatmore-event-tile-scale-out-animation":"whatmore-event-tile-scale-in-animation":"none",style:{margin:"0 auto",cursor:"pointer",width:R},onClick:()=>{ot(X)},children:[(0,I.jsx)("div",{style:{borderRadius:"round"==nt?"5%":"0px",boxShadow:"round"==nt?"0px 0px 5px 0px #B0B0B0":null,height:L,borderWidth:(0,x.alU)(V),borderColor:(0,x.qPe)(V),overflow:"hidden"},children:(0,I.jsx)(w.Z,{height:(0,x.dXm)(V)+" !important",width:"100%",url:X.thumbnail_image,isPlaying:tt||et||(0,C.gE)(),event:X})}),(0,I.jsxs)("div",{className:"wht-prod-info",style:{display:(0,x.pvY)(V)?"flex":"none",flexDirection:"column",padding:"12px 4px",gap:mt?"8px":"5px",alignItems:mt?"center":"flex-start"},children:[(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,x.anz)(V),"important"),t.style.setProperty("font-size","45034766485"==V&&"product"==U?"9px":B),t.style.setProperty("line-height","120%"),t.style.setProperty("font-family",at,"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=X.products[0])||void 0===a?void 0:a.title)}),rt&&(0,x.QaY)(V)&&(0,I.jsxs)("div",{style:{display:"flex",gap:"12px",flexDirection:(0,x.$zZ)(V)?"row":"row-reverse",justifyContent:mt?"center":(0,x.$zZ)(V)?"flex-start":"flex-end"},children:[(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,x.anz)(V),"important"),t.style.setProperty("font-size","45034766485"==V&&"product"==U?"8px":H),t.style.setProperty("font-family",at,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textAlign:"left",fontWeight:"normal"==(0,x.rPP)(V)?"normal":"bold"},children:(0,P.jx)(parseFloat((0,S.G)()?"61916709004"==V?(null===ht||void 0===ht||null===(s=ht.variants)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.price)>0?null===ht||void 0===ht||null===(p=ht.variants)||void 0===p||null===(u=p[0])||void 0===u?void 0:u.price:null===ht||void 0===ht?void 0:ht.price:(null===ht||void 0===ht?void 0:ht.price)>0?null===ht||void 0===ht?void 0:ht.price:null===ht||void 0===ht||null===(m=ht.variants)||void 0===m||null===(y=m[0])||void 0===y?void 0:y.price:(null===X||void 0===X||null===(f=X.products)||void 0===f||null===(g=f[0])||void 0===g?void 0:g.price)>0?null===X||void 0===X||null===(E=X.products)||void 0===E||null===(O=E[0])||void 0===O?void 0:O.price:null===X||void 0===X||null===(k=X.products)||void 0===k||null===(Y=k[0])||void 0===Y?void 0:Y.price_max)," ",V,null===(_=X.products[0])||void 0===_?void 0:_.currency)}),!isNaN(dt)&&dt>st&&(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,x.kPs)(V),"important"),t.style.setProperty("font-size",H),t.style.setProperty("font-family",at,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textDecoration:"line-through",alignItems:mt?"center":void 0},children:(0,P.jx)(parseFloat((0,S.G)()?"61916709004"==V&&null!==(N=null===ht||void 0===ht||null===(T=ht.variants)||void 0===T||null===(z=T[0])||void 0===z?void 0:z.compare_at_price)&&void 0!==N?N:null===ht||void 0===ht?void 0:ht.compare_at_price:null===X||void 0===X||null===(Z=X.products)||void 0===Z||null===(A=Z[0])||void 0===A?void 0:A.compare_price)," ",V,null===(D=X.products[0])||void 0===D?void 0:D.currency)})]}),((0,x.QaY)(V)&&!isNaN(pt)&&0!=pt&&rt||mt)&&(0,I.jsx)("div",{style:{display:(0,x.aKo)(V)?"flex":"none",backgroundColor:mt?J:"green"===(0,x.ZJm)(V)?"#343434"===J?(0,x.ZJm)(V):J:(0,x.ZJm)(V),alignItems:"center",justifyContent:mt?"center":void 0,borderRadius:mt?"25px":(0,x.CF_)(V)+"px",width:mt?.5*R:"fit-content",padding:(0,x.Spx)(V)?mt?"12px 12px":"3px 6px":"0px",margin:mt?"0 auto":void 0,textAlign:mt?"center":void 0,height:mt?"7%":void 0},children:(0,x.Spx)(V)?(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,x.mso)(V),"important"),t.style.setProperty("font-size",K,"important"),t.style.setProperty("font-family",at,"important"),t.style.setProperty("font-weight",mt?"600":"normal","important"))},children:mt?"BUY NOW":`${pt}% Off`}):(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,x.aUT)(V),"important"),t.style.setProperty("font-size",K,"important"),t.style.setProperty("font-family",(0,x.V3Y)(V),"important"))},children:(0,x.sG7)(V)})})]})]})},O=o(7381);const k=(0,s.Z)({key:"whatmore-css-hv"});function Y(t){const[e,o,i]=(0,d.Z)(),r=(0,h.MO)("whatmoreShopId"),l=(0,h.MO)("whatmoreLandingLocationType"),a=t.events,s=t.onClick,{whatmoreWidgetSourceDetails:c}=(0,n.useContext)(y.I),p=Math.ceil(i),u=2*p,[v,w]=(0,n.useState)(u),[j,P]=(0,n.useState)(2*p),M=0===(0,x.WGf)(r)?24:(0,x.WGf)(r),[C,b]=(0,n.useState)({touchX:0,touchY:0}),S=()=>(0,I.jsx)("div",{className:"navigation-button-next-container",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"})}),O=()=>(0,I.jsx)("div",{className:"navigation-button-prev-container",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"})}),k=t=>{if("next"===t){const t=2;P((t=>Math.min(t+Math.floor(i),a.length+p+1))),w((e=>Math.min(e+t,a.length+p+1)))}else P((t=>Math.max(t-Math.floor(i),u)));(0,f.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:c})};return(0,I.jsxs)("div",{className:"whatmore-events-carousel-portrait",style:{display:"flex",justifyContent:"45034766485"==r&&"product"==l?"center":"flex-start",paddingLeft:"12px",overflow:"hidden",position:"relative"},onTouchStart:t=>{b({touchX:t.touches[0].clientX,touchY:t.touches[0].clientY})},onTouchEnd:t=>{var e,o,n,i;const r=(null===(e=t.changedTouches)||void 0===e||null===(o=e[0])||void 0===o?void 0:o.clientX)-C.touchX,l=(null===(n=t.changedTouches)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.clientY)-C.touchY;Math.sqrt(r**2+l**2)>10&&Math.abs(r)>Math.abs(l)&&k(r>0?"prev":"next")},children:[(0,x.Yxs)(r)&&(0,I.jsxs)(I.Fragment,{children:[j<=a.length+p&&(0,I.jsx)("div",{onClick:()=>k("next"),style:{position:"absolute",zIndex:1,top:"50%",right:"0",transform:"translateY(-100%)"},children:(0,I.jsx)(S,{})}),j>2*p&&(0,I.jsx)("div",{onClick:()=>k("prev"),style:{position:"absolute",left:"0",zIndex:1,top:"50%",transform:"translateY(-100%)"},children:(0,I.jsx)(O,{})})]}),(0,I.jsx)("div",{style:{display:"flex",gap:M,transform:`translateX(-${(j-u)*(o+M)}px)`,transition:"transform 0.4s ease-in-out"},children:a.map(((t,e)=>e<v?(0,I.jsx)("div",{children:(0,I.jsx)(E,{isOnFocus:e<=j-p-1&&e>=Math.max(0,j-u),playOnUnfocus:!1,animateOnFocus:!0,event:t,onClick:()=>s(t)})},`whatmore-carousel-tile-${e}`):(0,I.jsx)(m.Z,{})))})]})}function _(t){const[e,o,i,r]=(0,d.Z)(),[l,a]=(0,n.useState)(-1),s=(0,h.MO)("whatmoreShopId"),[c,p]=(0,n.useState)("next"),v=t.onClick,m=t.events,{whatmoreWidgetSourceDetails:w}=(0,n.useContext)(y.I),j=Math.min(Math.ceil(i),m.length),[P,M]=(0,n.useState)(0),C=0===(0,x.WGf)(s)?24:(0,x.WGf)(s),b=()=>(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"})})}),S=()=>(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-i),j))),(0,f.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},Y=()=>{P>m.length+i||(p("next"),M((t=>Math.floor(t+i))),(0,f.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},_=P>m.length?m.length-j+1:P-j,N=P>=m.length?m.length:_+j,T=m.slice(_,N);return(0,I.jsxs)("div",{className:"whatmore-events-carousel-landscape",style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:`${r}px`,paddingRight:`${r}px`},children:[P!==j&&(0,I.jsx)("div",{style:{position:"absolute",left:r+"px",zIndex:1,top:"50%",transform:"translateY(-65%)"},children:(0,I.jsx)(S,{})}),(0,I.jsx)("div",{className:"wht-hide-scrollbar",style:{display:"flex",gap:C+"px",width:o*i*(0,x.Su5)(s)+"px",justifyContent:m.length<=j?"center":"flex-start",overflow:"auto"},children:T.map(((t,e)=>{const o=`whatmore-event-tile-landscape-${t.index}${e===j-1?"-last":""}`,n=e===l;return(0,I.jsx)("div",{className:"whatmore-event-tile-horizontal-swipe-animation-"+("next"===c?"next":"prev"),onMouseEnter:()=>(t=>{const e=u()((()=>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=>{v(t)})(t)})},o)}))}),P<m.length&&(0,I.jsx)("div",{style:{position:"absolute",zIndex:1,top:"50%",right:r+"px",transform:"translateY(-65%)"},children:(0,I.jsx)(b,{})})]})}var N=function(t){const[e,o,s]=(0,c.Z)(),[d]=(0,h.j1)("whatmoreShopId"),[p]=(0,h.j1)("whatmorePrimaryColor"),[u]=(0,h.j1)("whatmoreSecondaryColor"),[m]=(0,h.j1)("whatmoreTitleFont"),f="portrait"==e?(0,h.MO)("whatmoreTitleFontSizePortrait"):(0,h.MO)("whatmoreTitleFontSize"),{whatmoreRootId:g}=(0,n.useContext)(y.I),w=((0,h.MO)("isInDesignMode"),(0,h.MO)("whatmoreCollectionHeading")),{whatmoreIsCollectionsTemplate:j}=(0,n.useContext)(y.I),P=t.events,M=t.onClick,C=m;function b(t){M(t)}return(0,n.useEffect)((()=>{(0,O.Oo)("Video shopping powered by Whatmore!")}),[]),(0,n.useEffect)((()=>{r.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)(i.x,{theme:l.ZP,cssVarsRoot:g,resetCSS:!1,children:(0,I.jsxs)(v.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"==d?"flex-start":"center"},children:(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-family",C,"important"),t.style.setProperty("font-size",f+"px","important"))},style:{color:p,backgroundClip:"text",textAlign:"center",fontWeight:(0,x.wOV)(d),lineHeight:(0,x.vY4)(d),letterSpacing:(0,x.X2K)(d)},children:j?"W"!==w?w:"":t.heading})}):(0,I.jsx)(I.Fragment,{}),"landscape"===e?(0,I.jsx)(_,{events:P,onClick:b}):(0,I.jsx)(Y,{events:P,onClick:b})]})})})})}},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),i=o(9821),r=o(7129),l=o(7753),a=o(6417);e.Z=function(t){var[e,o]=(0,i.Z)();(0,n.useContext)(r.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 d},AK:function(){return r},AL:function(){return l},YP:function(){return i},me:function(){return n},rE:function(){return s}});const n="device_type",i="device_mode",r="mobile",l="tablet",a="desktop",s="portrait",d="landscape"},9821:function(t,e,o){var n=o(7753),i=o(8866),r=o(6805),l=o(9854);e.Z=function(t){const[e,o,a]=(0,i.Z)(),[s]=(0,n.j1)("whatmoreLandscapePadding"),[d]=(0,n.j1)("whatmoreShopId"),[c]=(0,n.j1)("whatmoreVideoTileSize"),[p]=(0,n.j1)("whatmoreVideoTileSizePortrait"),u=a>=1025,h="portrait"==e?p:c,v=!("portrait"!=e||!(a>=481)),m=h/100*1.3*.5,x=h/100;var y=Math.min(a,o),[f,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:r.AK,DEVICE_MODE:r.rE};if(u){const t=g*m,e=f*m;[f,g,w,j]=[e,t,(a-2*s-2*(0,l.mZU)(d))/(1.1*t),s],M[r.me]=r.$I,M[r.YP]=r.$w}else if(v){var C=.8*g,b=.8*f;"portrait"==e?(C*=x,b*=x,[f,g,w,j]=[b,C,P(a/(1.2*C)),0],M[r.me]=r.AL,M[r.YP]=r.rE):([f,g,w,j]=[b,C,(a-2*s)/(1.1*C),s],M[r.me]=r.AL,M[r.YP]=r.$w)}else{C=g,b=f;"portrait"==e?(C=C*x*.9,b=b*x*.9,[f,g,w,j]=[b,C,P(a/(1.15*C)),0],M[r.me]=r.AK,M[r.YP]=r.rE):(C=.7*g,b=.7*f,[f,g,w,j]=[b,C,(a-2*s)/(1.1*C),s],M[r.me]=r.AK,M[r.YP]=r.$w)}return[f,g,w,j,M]}},3439:function(){},7244:function(){},5892:function(){},4444:function(){}}]);
|