whatmore-react-assets 1.0.347 → 1.0.348
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/143.6cfd5b17.chunk.js +1 -0
- package/static/js/{166.2e410c2e.chunk.js → 166.978660a0.chunk.js} +1 -1
- package/static/js/184.47568a90.chunk.js +1 -0
- package/static/js/{204.fb4f8ecd.chunk.js → 204.83c78c22.chunk.js} +1 -1
- package/static/js/{244.24dba3b7.chunk.js → 244.a452af36.chunk.js} +1 -1
- package/static/js/{516.5cf90956.chunk.js → 516.0ac713ab.chunk.js} +1 -1
- package/static/js/{580.d18fbff9.chunk.js → 580.edcb7bf5.chunk.js} +1 -1
- package/static/js/{642.59328000.chunk.js → 642.ceaa86be.chunk.js} +1 -1
- package/static/js/{667.1240aae4.chunk.js → 667.bf0f7728.chunk.js} +1 -1
- package/static/js/{95.f35cc75c.chunk.js → 95.ed77436b.chunk.js} +1 -1
- package/static/js/972.dc35941b.chunk.js +1 -0
- package/whatmore.js +2 -2
- package/static/js/143.59d8ce91.chunk.js +0 -1
- package/static/js/184.46acdc26.chunk.js +0 -1
- package/static/js/972.42b6153a.chunk.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[143],{4284:function(e,t,n){n.r(t);var o=n(7313),i=n(9854),a=n(2860),r=n(7753),c=n(5160),s=(n(4844),n(6967)),d=n(5380),h=n(58),l=n(8984),u=(n(7247),n(1824),n(4669)),p=n(941),w=n(9302),f=n(2575),v=n(7300),m=n(6524),g=(n(4136),n(6417));const E=(0,f.Z)({key:"whatmore-css-ppv"}),S=o.lazy((()=>Promise.all([n.e(648),n.e(576),n.e(853),n.e(843),n.e(926),n.e(607),n.e(282),n.e(204)]).then(n.bind(n,2607))));function j(e){return e.split(/[?#]/)[0]}t.default=function(e){const[t,n]=(0,o.useState)(),[f,y]=(0,o.useState)(),[_]=(0,r.j1)("isInDesignMode"),[k]=(0,r.j1)("isDemoBrand"),[b]=(0,r.j1)("whatmoreEmbedAppUseVariant"),[x,I]=(0,o.useState)(-2),[C]=(0,r.j1)("whatmoreVariantId"),[M]=(0,r.j1)("whatmoreShopId");var[O]=(0,r.j1)("whatmoreProductId");const P=(0,r.MO)("isLandingSharedLink"),T=(0,r.MO)("whatmoreShareTemplateId"),V=((0,r.MO)("whatmoreShareStoryId"),(0,r.MO)("whatmoreShareEventId"));O=(0,i.iX)(M)?j(window.location.href):O;const[D,L]=(0,o.useState)((()=>"true"===b?C:O));var U=a.Gc+"/v2/brand/"+M+"/product-events";(0,o.useEffect)((()=>{(0,s.hb)()}),[]),(0,o.useEffect)((()=>{(0,u.ll)(M)}),[]),(0,o.useEffect)((()=>{null==t||0==t.length||f||!(0,l.KE)()||(0,r.MO)("whatmoreVideoPlayerPoolInitiated")||(0,h.b5)(h.UD)}),[t]),(0,o.useEffect)((()=>{I(-1),fetch(U.toString()+"?client_product_id="+D.toString()+"&status="+"upcoming".toString()+"&event_type=video").then((e=>e.json())).then((e=>e.events)).then((e=>(n(e),e))).then((e=>((0,i.yo)(M)&&function(e,t){setTimeout((async()=>{const n=e.reduce(((e,t)=>[...e,...t.products]),[]).filter((e=>e.client_product_id==t))[0];if(!n||n.product_link==j(window.location.href))return;const o={product_id:n.product_id,product_link:j(window.location.href)};fetch(a.Gc+"/product",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)})}),500)}(e,D),e))).catch((e=>{y(e.message)}))}),[D]),(0,o.useEffect)((()=>{I(-2)}),[t]),(0,o.useEffect)((()=>{let e=history.pushState;history.pushState=function(){let t=e.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),t};let t=history.replaceState;history.replaceState=function(){let e=t.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),e},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))})),window.addEventListener("locationchange",(function(){if("true"===b){const e=function(e){for(var t=window.location.search.substring(1).split("&"),n=0;n<t.length;n++){var o=t[n].split("=");if(o[0]==e)return o[1]}return!1}("variant");e&&""!==e&&L(e)}}))}),[]),(0,o.useEffect)((()=>{null==t||0==t.length||f||P&&"template-embed"==(0,m.zv)(T)&&null!=V&&t.forEach(((e,t)=>{V==e.event_id&&A(e,!0,t)}))}),[t]);const A=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((0,l.KE)()&&!t&&(0,h.QV)(),(0,v.B6)(e)||(0,v.WJ)(e))return _||k||(async()=>{(0,c.wh)(e),(0,u.Tc)(M,a.h7,a.dU),(0,s.H4)(e.event_id,e.products,"product_page","video_popup")})(),void I(n)};function B(){return(0,g.jsx)(g.Fragment,{})}return null==t||0==t.length||f?(0,g.jsx)("div",{}):(0,g.jsx)(w.C,{value:E,children:"no-product"===D||-1===x||0===t.length?(0,g.jsx)(B,{}):-2===x&&t.length>0?(0,g.jsx)("div",{children:(0,g.jsx)(d.Z,{event:t[0],inVideoClick:A,closeClick:e=>{e.stopPropagation(),I(-1)}})}):(0,g.jsx)("div",{children:(0,g.jsx)(o.Suspense,{children:(0,g.jsx)(S,{events:t,index:x,onBack:function(){(0,i.n2)(M)&&(0,r.MO)("whatmoreAddedToCart")&&(0,p.D)(M,(()=>{}),100,window.location.hostname),I(-2)},template:"template-product-page"})})})})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[184],{7381:function(e,t,n){n.d(t,{E:function(){return r},u:function(){return i}});function o(e){console.debug("Whatmore : "+e)}function r(e){var t;const n=null!==(t=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=localStorage.getItem("whatmoreActivateLogs"))&&void 0!==t&&t&&o(e)}},3388:function(e,t,n){n.d(t,{OC:function(){return c},e8:function(){return i},kT:function(){return o},kW:function(){return u},xg:function(){return r}});const o=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},r=function(e,t){return!(void 0==e.products||0==e.products.length)},i=function(e,t){if(null!=e)return e.filter((e=>1==o(e)))},u=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null!=e)return t?e.events[0].events:e.events};const c=function(e,t){var n;if(null==e)return[];if(!("eventsets"in e))return[];const o=null!==(n=e.eventsets[t])&&void 0!==n?n:null;return o?function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach((e=>{e.events.forEach((e=>{t.push(e)}))})),t}(o):[]}},2209:function(e,t,n){n.r(t);var o=n(7313),r=n(9854),i=n(2860),u=n(7753),c=n(5160),s=n(6967),l=n(5380),a=n(58),h=n(8984),d=n(4669),f=n(941),v=n(9302),g=n(7381),m=n(2575),p=n(7300),w=n(6524),S=n(3388),E=n(6417);const j=(0,m.Z)({key:"whatmore-css-wsv"}),k=o.lazy((()=>Promise.all([n.e(648),n.e(576),n.e(853),n.e(843),n.e(926),n.e(607),n.e(282),n.e(26)]).then(n.bind(n,2607))));t.default=function(e){const[t,n]=(0,o.useState)(),[m,x]=(0,o.useState)(),[O]=(0,u.j1)("isInDesignMode"),[M]=(0,u.j1)("isDemoBrand"),[_,b]=(0,o.useState)(-2),[y]=(0,u.j1)("whatmoreShopId"),C=(0,u.MO)("isLandingSharedLink"),I=(0,u.MO)("whatmoreShareTemplateId"),L=((0,u.MO)("whatmoreShareStoryId"),(0,u.MO)("whatmoreShareEventId")),D=(0,u.MO)("whatmoreLandingLocationType"),T=(0,u.MO)("whatmoreLoggingActive");var A=(0,r.ef)(y)?i.Dm+"/get_eventset/":i.Gc+"/get_eventset/";(0,o.useEffect)((()=>{(0,s.hb)()}),[]),(0,o.useEffect)((()=>{(0,d.ll)(y)}),[]),(0,o.useEffect)((()=>{null==t||0==t.length||m||!(0,h.KE)()||(0,u.MO)("whatmoreVideoPlayerPoolInitiated")||(0,a.b5)(a.UD)}),[t]),(0,o.useEffect)((()=>{b(-1);const e=w.NX,t=(0,w.H1)(D),o=A.toString()+y.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+y;fetch(o).then((e=>e.json())).then((t=>(0,S.OC)(t,e))).then((e=>(n(e),e))).catch((e=>{x(e.message)}))}),[]),(0,o.useEffect)((()=>{b(-2)}),[t]),(0,o.useEffect)((()=>{null==t||0==t.length||m||C&&"template-embed"==(0,w.zv)(I)&&null!=L&&t.forEach(((e,t)=>{L==e.event_id&&P(e,!0,t)}))}),[t]);const P=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((0,h.KE)()&&!t&&(0,a.QV)(),(0,p.B6)(e)||(0,p.WJ)(e))return O||M||(async()=>{(0,c.wh)(e),(0,d.Tc)(y,i.h7,i.dU),(0,s.H4)(e.event_id,e.products,"spotlight","video_popup")})(),void b(n)};function B(){return(0,E.jsx)(E.Fragment,{})}return null==t||0==t.length||m?(0,E.jsx)("div",{}):(T&&(0,g.E)(t),(0,E.jsx)(v.C,{value:j,children:-1===_||0===t.length?(0,E.jsx)(B,{}):-2===_&&t.length>0?(0,E.jsx)("div",{children:(0,E.jsx)(l.Z,{event:t[0],inVideoClick:P,closeClick:e=>{e.stopPropagation(),b(-1)}})}):(0,E.jsx)("div",{children:(0,E.jsx)(o.Suspense,{children:(0,E.jsx)(k,{events:t,index:_,onBack:function(){(0,r.n2)(y)&&(0,u.MO)("whatmoreAddedToCart")&&(0,f.D)(y,(()=>{}),100,window.location.hostname),b(-2)},template:"template-embed"})})})}))}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[972],{7381:function(e,t,n){n.d(t,{E:function(){return r},u:function(){return i}});function o(e){console.debug("Whatmore : "+e)}function r(e){var t;const n=null!==(t=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=localStorage.getItem("whatmoreActivateLogs"))&&void 0!==t&&t&&o(e)}},3972:function(e,t,n){n.r(t),n.d(t,{default:function(){return L}});var o=n(7753),r=n(7313),i=n(2860),a=n(499),s=n(4897),c=n(5160),u=n(9854),d=n(6967),l=n(8984),h=n(58),p=n(4669),v=n(941),m=n(4136),g=n(7300),f=n(6524),b=n(6417);const y=r.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(853),n.e(926),n.e(282),n.e(95)]).then(n.bind(n,4095)))),_=r.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(576),n.e(516),n.e(517)]).then(n.bind(n,5523)))),S=r.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(926),n.e(642),n.e(136)]).then(n.bind(n,3827)))),T=r.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(926),n.e(642),n.e(92)]).then(n.bind(n,6071)))),w=r.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(926),n.e(642),n.e(245)]).then(n.bind(n,1291)))),j=r.lazy((()=>Promise.all([n.e(302),n.e(580)]).then(n.bind(n,3580)))),I=r.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(240),n.e(576),n.e(853),n.e(843),n.e(926),n.e(607),n.e(282),n.e(166)]).then(n.bind(n,2607)))),x=r.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(853),n.e(926),n.e(516),n.e(850)]).then(n.bind(n,4048)))),C=r.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(367),n.e(240),n.e(576),n.e(516),n.e(602)]).then(n.bind(n,8091)))),E=r.lazy((()=>Promise.all([n.e(302),n.e(725),n.e(648),n.e(240),n.e(576),n.e(853),n.e(843),n.e(926),n.e(607),n.e(282),n.e(667)]).then(n.bind(n,4658))));var O=function(e){const[t]=(0,o.j1)("isInDesignMode"),[n]=(0,o.j1)("isDemoBrand"),[O]=(0,o.j1)("whatmoreTopBottomPadding"),[P]=(0,o.j1)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:M}=(0,r.useContext)(m.I),[k]=(0,o.j1)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:D}=(0,r.useContext)(m.I),L=(0,o.MO)("isLandingSharedLink"),N=(0,o.MO)("whatmoreShareTemplateId"),A=(0,o.MO)("whatmoreShareStoryId"),z=(0,o.MO)("whatmoreShareEventId"),[G,Z]=(0,r.useState)(-1),[J,H]=(0,r.useState)(null);var U=e.events,B=null;function R(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,l.KE)()&&!o&&(0,h.QV)(),t||n||(async()=>{const t=B[e].events[0];(0,c.wh)(t),(0,p.Tc)(k,i.Xh,i.OW),(0,d.H4)(t.event_id,t.products,"homepage","stories")})();var a=0;null!=r&&B[e].events.map(((e,t)=>{e.event_id==r&&(a=t)})),Z(a),H(e)}function V(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,l.KE)()&&!o&&(0,h.QV)(),(0,g.B6)(e)||(0,g.WJ)(e))return t||n||(async()=>{(0,c.wh)(e),(0,p.Tc)(k,i.Xh,i.pR),(0,d.H4)(e.event_id,e.products,"homepage","carousel")})(),void Z(e.index);const r=20;var{status:u,bannerText:v,timeToStartInMins:m}=s.Z.getEventStatus(e);m<=r&&u.name!==a.Z.LIVE.name?console.debug(" TODO : show toast on upcoming live event."):Z(e.index)}function W(e){return(0,b.jsx)(b.Fragment,{})}return M&&!B&&(B=function(e){var t=e.reduce(((e,t,n)=>{var o=t.storyset_id;return o in e?(e[o].total_events=e[o].total_events+1,e[o].events.push(t)):e[o]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,events:[t]},e}),{}),n=Object.values(t);return n.sort(((e,t)=>e.start_event_index-t.start_event_index)),n}(U)),(0,r.useEffect)((()=>{L&&D==(0,f.zv)(N)&&(null!=A&&M?B.forEach(((e,t)=>{A==e.id&&R(t,!0,z)})):null!=z&&U.forEach(((e,t)=>{z==e.event_id&&V(e,!0)})))}),[]),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{marginTop:(M?P:O)+"px",marginBottom:(M?P:O)+"px"},children:"template-b"===D?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(y,{events:U,onClick:V,heading:e.heading})}):"template-a-1"===D?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(_,{events:U,onClick:V,heading:e.heading})}):"template-feed-a"===D?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(C,{events:U,onClick:V,heading:e.heading})}):"template-collections-a"===D||"template-c"===D?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(S,{events:U,onClick:V,heading:e.heading})}):"template-collections-b"===D||"template-d"===D?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(T,{events:U,onClick:V,heading:e.heading})}):"template-collections-c"===D||"template-e"===D?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(w,{events:U,onClick:V,heading:e.heading})}):"template-collections-d"===D?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(y,{events:U,onClick:V,heading:e.heading})}):"template-collections-e"===D?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(x,{events:U,onClick:V,heading:e.heading})}):"template-banner-a"===D?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(E,{events:U})}):M?(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(j,{eventsStories:B,onClick:R,template:D})}):(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(x,{events:U,onClick:V,heading:e.heading})})}),-1==G?(0,b.jsx)(W,{}):(0,b.jsx)(r.Suspense,{children:(0,b.jsx)(I,{events:U,index:G,onBack:function(e){(0,u.n2)(k)&&(0,o.MO)("whatmoreAddedToCart")&&(0,v.D)(k,(()=>{}),100,window.location.hostname),Z(-1)},slideDirection:M||"horizontal"===(0,u.e8)(k)?"horizontal":"vertical",eventsStories:B,initialStoryIndex:J,template:D})})]})};const P=function(e,t,n){const r=(0,o.MO)("whatmoreShopId");var i=t.reduce(((e,t,n)=>(t.products.map((e=>e.client_product_id)).forEach((t=>{t in e||(e[t]=!0)})),e)),{}),a=Object.keys(i);if("60960964855"==r&&"undefined"!=typeof fera&&"function"===typeof fera.getRatings){var s={};fera.getRatings(a,(e=>{new Promise(((t,n)=>{e.forEach((e=>{s[e.external_product_id]={avgRating:e.average,totalRatings:e.count}})),t(s)})).then((e=>n(e)))}))}if("23114481744"==r){const e="1e6MQXxzYR19mpw9Km6Dcm86";s={};fetch("https://api.juniphq.com/v1/products?filter[remote_ids]="+a.toString(),{headers:{"Junip-Store-Key":e}}).then((e=>e.json())).then((e=>(e.products.forEach((e=>{s[e.remote_id]={avgRating:parseFloat(e.rating_average).toFixed(1),totalRatings:e.rating_count}})),s))).then((e=>n(e))).catch((e=>console.error(e)))}};var M=n(3388),k=n(7381);var D=function(e){const[t,n]=(0,r.useState)(),[a,s]=(0,r.useState)(),{whatmoreIsStoriesTemplate:c}=(0,r.useContext)(m.I),{whatmoreIsCollectionsTemplate:p}=(0,r.useContext)(m.I),{whatmoreIsBannerTemplate:v}=(0,r.useContext)(m.I),[g]=(0,o.j1)("whatmoreShopId"),[y]=(0,o.j1)("whatmoreCollectionId"),_=(0,o.MO)("whatmoreLandingLocationType"),S=(0,o.MO)("whatmoreLoggingActive"),T=(0,u.cZ)(g)?window.location.href.split(/[?#]/)[0]:y,[w,j]=(0,o.j1)("productRatings");var I=(0,u.ef)(g)?i.Dm+"/v2/events/":i.Gc+"/v2/events/",x=(0,u.ef)(g)?i.Dm+"/get_eventset/":i.Gc+"/get_eventset/",C=(0,u.ef)(g)?i.Dm+"/collection/":i.Gc+"/collection/",E=(0,u.ef)(g)?i.Dm+"/v2/brand/"+g+"/product-events":i.Gc+"/v2/brand/"+g+"/product-events",D=e.shopId,L="live,upcoming";return(0,r.useEffect)((()=>{(0,d.hb)()}),[]),(0,r.useEffect)((()=>{null==t||0==t.length||a||!(0,l.KE)()||(0,o.MO)("whatmoreVideoPlayerPoolInitiated")||(0,h.b5)(h.UD)}),[t]),(0,r.useEffect)((()=>{var e;if(_.startsWith("product")){const t=(0,o.MO)("whatmoreProductId");e=E.toString()+"?client_product_id="+t.toString()+"&status="+L.toString()+"&event_type=video"}else if(p)e=C.toString()+"?store_id="+D.toString()+"&client_collection_id="+T;else if(v){const t=f.ls,n=(0,f.H1)(_);e=x.toString()+D.toString()+"?eventset_type="+t+"&source="+n+"&source_id="+g}else e=I.toString()+D.toString()+"?status="+L.toString()+"&is_active="+"true".toString()+(c?"&template_type=stories":"");fetch(e).then((e=>e.json())).then((e=>{if("brand_customization"in e?(0,u.TZ)(e.brand_customization,g):(0,k.u)("brand_customization not found in events api response"),v){const t=f.ls;return(0,M.OC)(e,t)}return(0,M.kW)(e,p)})).then((e=>(S&&console.debug("initial received events size : "+e.length),c||v?e:(0,M.e8)(e,D)))).then((e=>(null!=e&&0!=e.length&&(0,u.LU)(g)&&function(e,t,n){const r=setInterval((()=>{null===(0,o.MO)("productRatings")&&P(e,t,n)}),1e3);setTimeout((()=>{clearInterval(r)}),1e4)}(g,e,(e=>{j(e)})),e))).then((e=>{null==e||0==e.length||c||(0,u.NO)(D,e),n(e)})).catch((e=>{s(e.message)}))}),[]),null==t||0==t.length||a?(0,b.jsx)("div",{}):(S&&(0,k.E)(t),function(e,t){if(null!=e){var n=0;e.forEach((e=>{e.index=n++}))}}(t),S&&console.debug("final transformed events data : "+JSON.stringify(t)),S&&console.debug("valid events size : "+t.length),(0,b.jsx)("div",{children:(0,b.jsx)(O,{heading:e.heading,events:t})},"whatmore-main-coponent"))};var L=function(e){const[t]=(0,o.j1)("isInDesignMode"),[n]=(0,o.j1)("isDemoBrand"),[a]=(0,o.j1)("whatmoreShopId"),[s]=(0,o.j1)("whatmoreHeading"),[c]=(0,o.j1)("whatmorePrimaryColor"),[u]=(0,o.j1)("whatmoreSecondaryColor");return(0,r.useEffect)((()=>{(0,p.ll)(a)}),[]),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("div",{children:t||n?(0,b.jsx)("div",{children:(0,b.jsx)(D,{heading:s,shopId:i.aA})}):(0,b.jsx)("div",{children:(0,b.jsx)(D,{heading:s,shopId:a})})})})}},499:function(e,t){t.Z={LIVE:{name:"LIVE",color:"gray.600"},UPCOMING:{name:"UPCOMING",color:"gray.600"},DEFAULT:{name:"LIVE EVENT",color:"gray.600"},COMPLETED:{name:"ENDED",color:"gray.600"}}},4897:function(e,t,n){var o=n(499);t.Z=class{static getEventStatus(e){e.time_zone="GMT+5:30";var t=e.start_time+":00",n=e.end_time,r=e.scheduled_date,i=e.status,a=e.time_zone;if(i.toUpperCase()==o.Z.LIVE.name)return{status:o.Z.LIVE,bannerText:" "+o.Z.LIVE.name+" ",timeToStartInMins:0};if(i.toUpperCase()==o.Z.UPCOMING.name){var s=new Date(r+" "+t+" "+a),c=(new Date(r+" "+n+" "+a),function(e){var t=new Date,n=(e.getTime()-t.getTime())/1e3,r=n/60,i=r/60,a=i/24;return n<=0?{status:o.Z.COMPLETED,bannerText:" "+o.Z.COMPLETED.name+" ",timeToStartInMins:0}:n>=1&&n<=30?{status:o.Z.UPCOMING,bannerText:"Starts in "+Math.round(n)+" sec ",timeToStartInMins:n/60}:r<60?{status:o.Z.UPCOMING,bannerText:"Starts in "+Math.round(r)+" min ",timeToStartInMins:r}:i<24?{status:o.Z.UPCOMING,bannerText:"Starts in "+Math.round(i)+" hr ",timeToStartInMins:60*i}:a<7?{status:o.Z.UPCOMING,bannerText:" "+["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()]+" ",timeToStartInMins:60*a*24}:{status:o.Z.UPCOMING,bannerText:"Upcoming",timeToStartInMins:2880}}(s));return{status:c.status,bannerText:c.bannerText,timeToStartInMins:c.timeToStartInMins}}return console.error("invalid status for event :: id : "+e.event_id+", status : "+e.status),{status:o.Z.DEFAULT,bannerText:"live event",timeToStartInMins:2880}}}},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 r=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:r,openMiniCart:!0}}));else if("19506115"==e)window.PXUTheme.jsAjaxCart.showDrawer(),window.PXUTheme.jsAjaxCart.updateView();else if("54465429691"==e)refreshCart(r),window.setTimeout((function(){$.fancybox.close(),$(".cart-button").click()}),500);else if("25427564"==e||"4243849314"==e||"57708314789"==e){(new theme.CartDrawer).open()}else"62602182872"==e||"57362710572"==e?(CartJS.getCart(),$(".block-cart").addClass("active")):"60492578980"==e||"12183765088"==e||"58546946211"==e||"42070737058"==e||"71321583919"==e||"68492624171"==e||"74541891876"==e?(document.documentElement.dispatchEvent(new CustomEvent("ajaxProduct:added",{bubbles:!0,detail:{}})),document.documentElement.dispatchEvent(new CustomEvent("cart:open",{bubbles:!0,detail:{}}))):"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)})):"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"),r=document.getElementById("CartDrawer");o&&r&&(r.innerHTML=o.innerHTML),n.querySelector("#CartDrawer .totals__subtotal-value");const i=document.querySelector("cart-drawer");i&&i.classList.remove("is-empty");const a=document.querySelector("cart-drawer-items");a&&a.classList.remove("is-empty");const s=document.getElementById("cart-icon-bubble");if(s.querySelector(".cart-count-bubble"))s.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 "),s.appendChild(t)}s.click(),document.getElementById("CartDrawer-Overlay").addEventListener("click",(()=>{const e=document.querySelector("cart-drawer");e&&e.classList.remove("active"),document.body.classList.remove("overflow-hidden")}))}))})):"61094723750"==e?SLIDECART&&(SLIDECART_UPDATE(),SLIDECART_OPEN()):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()}}},3388:function(e,t,n){n.d(t,{OC:function(){return s},e8:function(){return i},kT:function(){return o},kW:function(){return a},xg:function(){return r}});const o=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},r=function(e,t){return!(void 0==e.products||0==e.products.length)},i=function(e,t){if(null!=e)return e.filter((e=>1==o(e)))},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null!=e)return t?e.events[0].events:e.events};const s=function(e,t){var n;if(null==e)return[];if(!("eventsets"in e))return[];const o=null!==(n=e.eventsets[t])&&void 0!==n?n:null;return o?function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach((e=>{e.events.forEach((e=>{t.push(e)}))})),t}(o):[]}},7300:function(e,t,n){n.d(t,{B6:function(){return o},WJ:function(){return r},yC:function(){return i}});const o=function(e){return"video"===e.event_type},r=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 u},JX:function(){return c},Z6:function(){return i},rp:function(){return d},wh:function(){return r},wz:function(){return s},x0:function(){return a}});var o=n(2860);n(7753);function r(e){console.debug("updating user view count for event.");const t={event_id:e.event_id,increase_by:1};fetch(o.Gc+"/event/metrics/views",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(console.debug("updating user view count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating user view count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating user view count user for event : ",e)}))}function i(e,t){console.debug("updating like count for event.");const n={event_id:e.event_id,increase_by:t};fetch(o.Gc+"/event/metrics/like",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating like count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating like count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating like count user for event : ",e)}))}function a(e){console.debug("updating share count for event.");const t={event_id:e.event_id,increase_by:1};fetch(o.Gc+"/event/metrics/share",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>(console.debug("updating share count response : HTTP "+e.status),e.json()))).then((e=>{console.debug("updating share count response : "+JSON.stringify(e))})).catch((e=>{console.error("error updating share count user for event : ",e)}))}function s(e,t){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(o.Gc+"/event/metrics/clicks",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating user event-product click count response : HTTP "+e.status),e.json()))).then((e=>{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 c(e,t,n){console.debug("updating event-product add to cart count for event {} and product {}.",e.event_id,t.product_id);const r={event_id:e.event_id,product_id:t.product_id,increase_by:n};fetch(o.Gc+"/event/metrics/add_to_cart",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r)}).then((e=>(console.debug("updating user event-product add to cart count response : HTTP "+e.status),e.json()))).then((e=>{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 u(e,t){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(o.Gc+"/event/metrics/buy_now",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(console.debug("updating user event-product buy now count response : HTTP "+e.status),e.json()))).then((e=>{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 d(){let{storeId:e="",eventId:t=0,productId:n="",variantId:r="",cartToken:i="",checkoutToken:a="",quantity:s=0,price:c="",actionType:u="",trackingId:d=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l={event_id:t,product_id:n,cart_token:i,checkout_token:a,quantity:s,price:c,variant_id:r,action_type:u,tracking_id:d};console.debug("initiating ATC metadata event for eventId {}, productId {}, variantId {} ",t,n,r);const h=await fetch(o.Gc+"/cart-metadata/"+e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(l)}).then((e=>(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,r)}));return h}},4669:function(e,t,n){n.d(t,{Tc:function(){return l},ll:function(){return d}});var o=n(1824),r=n(7786),i=n(9854);n(7753);const a="Whatmore Video Shopping",s="Video View",c={carousel:"Carousel",stories:"Stories",video_popup:"Video Popup"},u={homepage:"Home Page",product_page:"Product Page"};async function d(e){if((0,i.Dv)(e)&&null!==(0,i.hf)(e)&&(r.ZP.initialize((0,i.hf)(e)),console.debug("Whatmore: initialized GA4")),(0,i.hv)(e)&&null!==(0,i.BH)(e)){const t=(0,i.OQ)(e);o.ZP.initialize((0,i.BH)(e),{useExistingGa:t}),console.debug("Whatmore: initialized GA3")}}async function l(e,t,n){(0,i.hv)(e)&&null!==(0,i.BH)(e)&&(o.ZP.event({category:a,action:s,label:u[t]+":"+c[n]}),console.debug("Whatmore: pushed view event to GA3")),(0,i.Dv)(e)&&null!==(0,i.hf)(e)&&(r.ZP.event({category:a,action:s+":"+u[t]+":"+c[n],value:1,nonInteraction:!1}),console.debug("Whatmore: pushed view event to GA4"))}}}]);
|