{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/ajKYBgRXgNyNgL1GkpqG/TCkwiz1aAAYNzX1Z6PwT/ProductState.js", "ssg:https://framerusercontent.com/modules/Be5mN5EUhdOwl54qCG8y/Icj1ZU450uFtWcyrdGTm/CartItemContext.js", "ssg:https://framerusercontent.com/modules/Ncx6rwHWSXe5kU34gWm3/WEpEZKxeDJvXSYBJ1ur4/ProductInfoLabel.js"],
  "sourcesContent": ["import create from\"zustand\";import{useMemo}from\"react\";import{parseShopifyData}from\"https://framerusercontent.com/modules/gd3dcT3w5rYoRy7ZcKte/ynLwCe8GqEfFnZbs0Ao6/Shared.js\";export const useProductStore=create(set=>({products:{},setSelectedVariantOption:(productId,variantOption,option)=>set(state=>({products:{...state.products,[productId]:{...state.products[productId],selectedVariantOptions:{...state.products[productId]?.selectedVariantOptions,[variantOption]:option}}}})),setQuantity:(productId,quantity)=>{set(state=>({products:{...state.products,[productId]:{...state.products?.[productId],quantity:Math.max(quantity,1)}}}));}}));export function useSelectedVariant(shopifyData){const parsedData=useMemo(()=>parseShopifyData(shopifyData),[shopifyData]);const{shopifyId,variants}=parsedData;const selectedVariantOptions=useProductStore(state=>state.products[shopifyId]?.selectedVariantOptions);const selectedVariant=useMemo(()=>{if(!Array.isArray(variants)||!selectedVariantOptions){return variants[0];}for(const variant of variants){if(variant.selectedOptions.every(option=>selectedVariantOptions[option.name]===option.value)){return variant;}}return variants[0];},[variants,selectedVariantOptions]);return selectedVariant;}\nexport const __FramerMetadata__ = {\"exports\":{\"useProductStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useSelectedVariant\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}", "import{createContext,useContext}from\"react\";export const CartItemContext=/*#__PURE__*/createContext({inCart:false,cartItemId:null,shopifyId:null,variantId:null,quantity:1,price:null,compareAtPrice:null,sku:null,barcode:null,variant:null});export const useCartItem=()=>useContext(CartItemContext);\nexport const __FramerMetadata__ = {\"exports\":{\"useCartItem\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CartItemContext\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CartItemContext.map", "import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,withCSS}from\"framer\";import{useSelectedVariant}from\"https://framerusercontent.com/modules/ajKYBgRXgNyNgL1GkpqG/TCkwiz1aAAYNzX1Z6PwT/ProductState.js\";import{useCartItem}from\"https://framerusercontent.com/modules/Be5mN5EUhdOwl54qCG8y/Icj1ZU450uFtWcyrdGTm/CartItemContext.js\";import{currencyFormatProp,formatCurrency}from\"https://framerusercontent.com/modules/gd3dcT3w5rYoRy7ZcKte/ynLwCe8GqEfFnZbs0Ao6/Shared.js\";import currencySymbols from\"https://framerusercontent.com/modules/pJIZxaEdKo1uS87sS4xM/4PSl3AVmNoISomoZ0s7m/CurrencySymbols.js\";const HIDDEN_CLASS=\"frameship-price-label-hidden\";var ProductInfoType;(function(ProductInfoType){ProductInfoType[\"Price\"]=\"price\";ProductInfoType[\"CompareAtPrice\"]=\"compareAtPrice\";})(ProductInfoType||(ProductInfoType={}));function ProductInfoLabelComponent(props){const{type,whenZero,textWhenZero,currencyFormat}=props;const Tag=props.htmlTag||\"p\";const variant=useSelectedVariant(props.shopifyData);const{inCart,price:cartPrice,compareAtPrice:cartCompareAtPrice}=useCartItem();let value=0;let currencyCode=props.currency;let hidden=false;if(inCart){if(type===\"price\"){if(isPriceV2(cartPrice)){value=cartPrice.amount||0;currencyCode=cartPrice.currencyCode||props.currency;}}else if(type===\"compareAtPrice\"){if(isPriceV2(cartCompareAtPrice)){value=cartCompareAtPrice.amount||0;currencyCode=cartCompareAtPrice.currencyCode||props.currency;}}}else if(variant){const price=variant[type];if(isPriceV2(price)){value=price.amount||0;currencyCode=price.currencyCode||props.currency;}else if(typeof price===\"number\"){value=price;}}let text=\"\";if(whenZero==\"hide\"&&!value){hidden=true;}else if(whenZero==\"showText\"&&!value){text=textWhenZero;}else{text=formatCurrency(value,currencyCode,currencyFormat);}return hidden?/*#__PURE__*/_jsx(\"div\",{className:HIDDEN_CLASS}):/*#__PURE__*/_jsxs(Tag,{style:{color:props.color,margin:0,whiteSpace:\"pre\",userSelect:props.selectable?undefined:\"none\",textDecoration:props.decoration===\"strikethrough\"?\"line-through\":props.decoration,textWrap:props.style?.width==\"100%\"?\"wrap\":\"nowrap\",...props.font,...props.style},children:[props.prefix,text,props.suffix]});}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */const ProductInfoLabel=withCSS(ProductInfoLabelComponent,[`.${HIDDEN_CLASS} { display: none !important; }`,`div:has(> .${HIDDEN_CLASS}) { display: none !important; }`]);export default ProductInfoLabel;ProductInfoLabel.displayName=\"Price Label\";addPropertyControls(ProductInfoLabel,{shopifyData:{type:ControlType.String,defaultValue:\"\",placeholder:\"Shopify Data\",preventLocalization:true},type:{type:ControlType.Enum,defaultValue:\"price\",options:Object.values(ProductInfoType),optionTitles:[\"Price\",\"Compare-at Price\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},whenZero:{type:ControlType.Enum,defaultValue:\"show\",options:[\"show\",\"showText\",\"hide\"],optionTitles:[\"Show\",\"Show Text\",\"Hide\"],title:\"When Zero\"},textWhenZero:{type:ControlType.String,defaultValue:\"Free\",title:\"Text\",description:\"This text is shown when the price is 0\",hidden:props=>props.whenZero!==\"showText\"},currency:{type:ControlType.Enum,defaultValue:\"USD\",title:\"Default Currency\",options:Object.keys(currencySymbols)},currencyFormat:currencyFormatProp(),font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:16,lineHeight:1.4}},color:{type:ControlType.Color,defaultValue:\"#999999\"},prefix:{type:ControlType.String,defaultValue:\"\"},suffix:{type:ControlType.String,defaultValue:\"\"},decoration:{type:ControlType.Enum,defaultValue:\"none\",options:[\"none\",\"strikethrough\",\"underline\"],optionTitles:[\"None\",\"Strikethrough\",\"Underline\"]},selectable:{type:ControlType.Boolean,defaultValue:true,title:\"User Select\"},htmlTag:{type:ControlType.Enum,options:[\"p\",\"span\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],title:\"Tag\"}});function isPriceV2(value){return value&&typeof value===\"object\"&&value.hasOwnProperty(\"amount\");}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProductInfoLabel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],
  "mappings": "iMAAsL,IAAMA,EAAgBC,EAAOC,IAAM,CAAC,SAAS,CAAC,EAAE,yBAAyB,CAACC,EAAUC,EAAcC,IAASH,EAAII,IAAQ,CAAC,SAAS,CAAC,GAAGA,EAAM,SAAS,CAACH,CAAS,EAAE,CAAC,GAAGG,EAAM,SAASH,CAAS,EAAE,uBAAuB,CAAC,GAAGG,EAAM,SAASH,CAAS,GAAG,uBAAuB,CAACC,CAAa,EAAEC,CAAM,CAAC,CAAC,CAAC,EAAE,EAAE,YAAY,CAACF,EAAUI,IAAW,CAACL,EAAII,IAAQ,CAAC,SAAS,CAAC,GAAGA,EAAM,SAAS,CAACH,CAAS,EAAE,CAAC,GAAGG,EAAM,WAAWH,CAAS,EAAE,SAAS,KAAK,IAAII,EAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAE,CAAC,EAAE,EAAS,SAASC,EAAmBC,EAAY,CAAC,IAAMC,EAAWC,EAAQ,IAAIC,EAAiBH,CAAW,EAAE,CAACA,CAAW,CAAC,EAAO,CAAC,UAAAI,EAAU,SAAAC,CAAQ,EAAEJ,EAAi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zB,GAAOA,EAAM,WAAW,UAAU,EAAE,SAAS,CAAC,KAAKyB,EAAY,KAAK,aAAa,MAAM,MAAM,mBAAmB,QAAQ,OAAO,KAAKC,CAAe,CAAC,EAAE,eAAeC,EAAmB,EAAE,KAAK,CAAC,KAAK,OAAO,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,SAAS,GAAG,WAAW,GAAG,CAAC,EAAE,MAAM,CAAC,KAAKF,EAAY,MAAM,aAAa,SAAS,EAAE,OAAO,CAAC,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,OAAO,CAAC,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,WAAW,CAAC,KAAKA,EAAY,KAAK,aAAa,OAAO,QAAQ,CAAC,OAAO,gBAAgB,WAAW,EAAE,aAAa,CAAC,OAAO,gBAAgB,WAAW,CAAC,EAAE,WAAW,CAAC,KAAKA,EAAY,QAAQ,aAAa,GAAK,MAAM,aAAa,EAAE,QAAQ,CAAC,KAAKA,EAAY,KAAK,QAAQ,CAAC,IAAI,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC,EAAE,SAASV,EAAUH,EAAM,CAAC,OAAOA,GAAO,OAAOA,GAAQ,UAAUA,EAAM,eAAe,QAAQ,CAAE",
  "names": ["useProductStore", "create", "set", "productId", "variantOption", "option", "state", "quantity", "useSelectedVariant", "shopifyData", "parsedData", "se", "parseShopifyData", "shopifyId", "variants", "selectedVariantOptions", "variant", "CartItemContext", "z", "useCartItem", "re", "HIDDEN_CLASS", "ProductInfoType", "ProductInfoLabelComponent", "props", "type", "whenZero", "textWhenZero", "currencyFormat", "Tag", "variant", "useSelectedVariant", "inCart", "cartPrice", "cartCompareAtPrice", "useCartItem", "value", "currencyCode", "hidden", "isPriceV2", "price", "text", "formatCurrency", "p", "u", "ProductInfoLabel", "withCSS", "ProductInfoLabel_default", "addPropertyControls", "ControlType", "CurrencySymbols_default", "currencyFormatProp"]
}
