"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[19],{79:(e,t,n)=>{n.d(t,{a:()=>r,b:()=>a,c:()=>o,d:()=>s,e:()=>c});var i=n(12);const r=e=>{const t={event:"add_to_cart",event_action:"Add to Cart",event_category:"Product Interaction",event_label:e};i.a.push(t)},a=e=>{const t={event:"buy_now",event_action:"Buy Now",event_category:"Purchase Intent",event_label:e};i.a.push(t)},o=(e,t=!1)=>{const n={event:"side_cart_toggle",event_action:t?"click:addToCart":"click:toggle",event_category:"SideCart",event_label:e||t?"Open":"Close"};i.a.push(n)},c=(e,t)=>{const n=null==t?void 0:t.prices[e.productId];if(void 0!==n){const[e,t]=n.split("-"),i=parseFloat(e),r=parseFloat(t),a=Math.round(100*Number(i));return{price:a,final_price:a,compareAtPrice:Math.round(100*Number(r))}}const i=Number.parseInt(String(Math.round(100*Number(e.price)))),r=i,a=void 0!==e.compareAtPrice?e.compareAtPrice:"0.0";return{price:i,final_price:r,compareAtPrice:Number.parseInt(String(Math.round(100*Number(a))))}},s=e=>isFinite(e)?0===e?"":e<=2?"We think this item will sell out today!":e<=4?"We think this item may sell out in the next couple of days!":e<=10?"We think this item may sell out in less than a week!":"":""},53:(e,t,n)=>{n.d(t,{a:()=>i});const i=e=>{return t=void 0,n=void 0,r=function*(){const t={replenishDate:"",salesVelocityByDay:0};try{const n=yield fetch(`https://pheme-app.herokuapp.com/ip/api/v1/variants/c24250_${e}`),i=yield n.json();return i.variant?{replenishDate:"replenish_date"in i.variant?i.variant.replenish_date:"",salesVelocityByDay:(e=>{if(!("forecast_description"in e)||!e.forecast_description)return 0;const t="sales_velocity1"in e.forecast_description?e.forecast_description.sales_velocity1:0;return isFinite(t)?t:0})(i.variant)}:t}catch(e){return console.log("error when fetching stock info from pheme-app",e),t}},new((i=void 0)||(i=Promise))((function(e,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function c(e){try{s(r.throw(e))}catch(e){a(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,c)}s((r=r.apply(t,n||[])).next())}));var t,n,i,r}}}]);