{"version":3,"file":"Cart.kVKPgQ4F.mjs","names":["CurrencySymbols","ShopifyDataType"],"sources":["https:/framerusercontent.com/modules/gd3dcT3w5rYoRy7ZcKte/KUBggIcCct5y9ndEplYj/Shared.js","https:/framerusercontent.com/modules/ibjYTPLnMMPhPLNCj4uG/I4Tv6VD4v0SimymTsX9I/Cart.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType}from\"framer\";import{cloneElement,useMemo,useId}from\"react\";import{motion}from\"framer-motion\";import CurrencySymbols from\"https://framerusercontent.com/modules/pJIZxaEdKo1uS87sS4xM/4PSl3AVmNoISomoZ0s7m/CurrencySymbols.js\";export const UPGRADE_LINK=\"https://buy.stripe.com/cN29CT5gi1spb5e9AN\";export var ShopifyDataType;(function(ShopifyDataType){ShopifyDataType[\"Product\"]=\"gid://shopify/Product/\";ShopifyDataType[\"ProductVariant\"]=\"gid://shopify/ProductVariant/\";ShopifyDataType[\"ProductOption\"]=\"gid://shopify/ProductOption/\";})(ShopifyDataType||(ShopifyDataType={}));export const SHOPIFY_ID_ATTRIBUTE=\"frameship-shopify-id\";export const OPEN_CART_EVENT=\"frameship-open-cart\";export const DEFAULT_TRANSITION={type:\"spring\",duration:.2,bounce:0};export const Colors={Primary:{color:\"#000\",fill:\"#F3F3F3\",fillA:\"#F3F3F3\",fillB:\"#999999\"},Accent:{color:\"#FFF\",fill:\"#111\",fillA:\"#5E5E5E\",fillB:\"#111\"}};const CHARACTERS=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";const EMPTY_SHOPIFY_DATA={shopifyId:\"\",tracksInventory:false,variants:[]};const shopifyDataCache={};export function parseShopifyId(id,type){if(typeof id!==\"string\"){return\"\";}if(id.startsWith(type)){return id;}return`${type}${id}`;}export function parseShopifyData(shopifyData){if(!shopifyData){return EMPTY_SHOPIFY_DATA;}const cachedData=shopifyDataCache[shopifyData];if(cachedData){return cachedData;}try{const data=JSON.parse(shopifyData);const parsedData={shopifyId:parseShopifyId(data.id,\"gid://shopify/Product/\"),tracksInventory:data.tracksInventory?true:false,variants:Array.isArray(data.variants)?data.variants.map(variant=>({...variant,id:parseShopifyId(variant.id,\"gid://shopify/ProductVariant/\")})):[]};shopifyDataCache[shopifyData]=parsedData;return parsedData;}catch(error){console.error(\"Error parsing Shopify data:\",error);return EMPTY_SHOPIFY_DATA;}}export const generateInstanceId=()=>{const id=useMemo(()=>{let result=\"\";for(let i=0;i<13;i++){result+=CHARACTERS.charAt(Math.floor(Math.random()*CHARACTERS.length));}return result;},[]);return id;};export const useInstanceId=()=>{const id=useId();const cleanId=id.replace(/:/g,\"\");const instanceId=`superfields-${cleanId}`;return instanceId;};export function styleLayer(layer,style){layer=Array.isArray(layer)?layer[0]:layer;let newLayer=layer;const width=style?.width;const height=style?.height;if(layer&&layer.props&&style&&(width||height)){if(typeof layer.type===\"function\"&&typeof layer.props.children===\"object\"){newLayer=/*#__PURE__*/cloneElement(layer,{children:{...layer.props.children,props:{...layer.props.children.props,style:{...layer.props.children.props.style,...width&&{width},...height&&{height}}}}});}else{newLayer=/*#__PURE__*/cloneElement(layer,{style:{...layer.props.style,...width&&{width},...height&&{height}}});}}return newLayer;}export function Icon({image,color,size,style={},defaultImage}){let colorValue=color||(image?.src?undefined:\"#999\");return /*#__PURE__*/_jsx(\"div\",{\"aria-label\":image?.alt,style:{width:size,height:size,minWidth:size,minHeight:size,pointerEvents:\"none\",backgroundColor:colorValue,backgroundImage:colorValue?\"none\":`url('${image?.src}')`,maskImage:image?.src?`url('${image?.src}')`:defaultImage,backgroundSize:\"contain\",backgroundPosition:\"center\",maskSize:\"contain\",maskPosition:\"center\",...style}});}Icon.displayName=\"Frameship/Icon\";export function iconProp({buttonTitle=\"Icon\",size=24,object=true}={}){return{type:ControlType.Object,buttonTitle,optional:true,defaultValue:{color:\"#000\",size},controls:{image:{type:ControlType.ResponsiveImage},color:{type:ControlType.Color,optional:true,defaultValue:\"#000\"},size:{type:ControlType.Number,defaultValue:size,min:1,step:1,displayStepper:true}}};}export function Button({tag=\"button\",fill,color,shadows,border,radius,padding,font,opacity,bgBlur,transition,variant=\"\",children,style,animate,...otherProps}){let background=\"none\";if(fill){if(fill.type===\"color\"){background=fill[`${variant}Color`]||fill.defaultColor;}else{background=`linear-gradient(${fill.gradientAngle}deg, ${fill[`${variant}ColorB`]||fill.defaultColorB}, ${fill[`${variant}ColorA`]||fill.defaultColorA})`;}}const Tag=motion[tag];const addWrapper=tag===\"input\";const elementChildren=[children,border&&/*#__PURE__*/_jsx(motion.div,{animate:{borderColor:border[`${variant}Color`]||border.defaultColor},style:{position:\"absolute\",inset:0,borderWidth:border.width,borderStyle:border.style,borderRadius:radius,pointerEvents:\"none\"},initial:false,transition:transition})];let element=/*#__PURE__*/_jsx(Tag,{style:{position:\"relative\",borderRadius:radius,padding:padding,textAlign:\"center\",appearance:\"none\",border:\"none\",backdropFilter:bgBlur?`blur(${bgBlur}px)`:undefined,...font,...style},animate:{background,color:typeof color===\"object\"?color[`${variant}Color`]||color.defaultColor:color,boxShadow:typeof shadows===\"object\"?shadows[`${variant}Shadows`]||shadows.defaultShadows:shadows,opacity:typeof opacity===\"object\"?typeof opacity[variant]===\"number\"?opacity[variant]:opacity.default:1,...animate},initial:false,transition:transition,children:addWrapper?undefined:elementChildren,...otherProps});if(addWrapper){element=/*#__PURE__*/_jsxs(\"div\",{style:{display:\"contents\"},children:[element,elementChildren]});}return element;}Button.displayName=\"Frameship/Button\";export function createButtonPropertyControls({variants=[],font=true,color=true,placeholder=false,opacity=false,padding=\"10px\",hidden={},endProps={},lastControlDescription=\"\"}){const allVariants=variants.length?variants:[{id:\"default\",title:\"Default\",optional:false,...Colors.Primary}];const colorControls={};const placeholderControls={};const fillControls={};const borderControls={};const shadowsControls={};const opacityControls={};const defaultColorValues={};const defaultPlaceholderValues={};const defaultFillValues={type:\"color\",gradientAngle:0};const defaultBorderValues={width:\"1px\",style:\"solid\"};const defaultOpacityValues={};let hasDefaultBorder=allVariants.some(variant=>variant.borderColor);for(const variant of allVariants){const isDefault=variant.id===\"default\";const optional=variant.optional??true;colorControls[`${variant.id}Color`]={type:ControlType.Color,optional,defaultValue:variant.color,title:isDefault?\"Color\":variant.title};if(placeholder){placeholderControls[`${variant.id}Color`]={type:ControlType.Color,optional,defaultValue:variant.placeholder,title:isDefault?\"Color\":variant.title};}fillControls[`${variant.id}Color`]={type:ControlType.Color,optional,defaultValue:variant.fill,title:isDefault?\"Color\":variant.title,hidden:props=>props.type!=\"color\"};fillControls[`${variant.id}ColorA`]={type:ControlType.Color,optional,defaultValue:variant.fillA,title:isDefault?\"Colors\":variant.title,hidden:props=>props.type!=\"linearGradient\"};fillControls[`${variant.id}ColorB`]={type:ControlType.Color,optional,defaultValue:variant.fillB,title:\" \",hidden:props=>props.type!=\"linearGradient\"};borderControls[`${variant.id}Color`]={type:ControlType.Color,optional,defaultValue:variant.borderColor||(variants.length===1?\"#222\":undefined),title:isDefault?\"Color\":variant.title};shadowsControls[`${variant.id}Shadows`]={type:ControlType.BoxShadow,title:variant.title};if(opacity){opacityControls[variant.id]={type:ControlType.Number,title:variant.title,defaultValue:typeof variant.opacity===\"number\"?variant.opacity:1,min:0,max:1,step:.01};}}for(const prop of Object.keys(colorControls)){defaultColorValues[prop]=colorControls[prop].defaultValue;}for(const prop of Object.keys(placeholderControls)){defaultPlaceholderValues[prop]=placeholderControls[prop].defaultValue;}for(const prop of Object.keys(fillControls)){defaultFillValues[prop]=fillControls[prop].defaultValue;}for(const prop of Object.keys(borderControls)){defaultBorderValues[prop]=borderControls[prop].defaultValue;}for(const prop of Object.keys(opacityControls)){defaultOpacityValues[prop]=opacityControls[prop].defaultValue;}const showTransition=variants.length>0;return{font:font?{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:1.4},hidden:hidden[\"font\"]}:undefined,color:color?variants.length?{type:ControlType.Object,defaultValue:defaultColorValues,controls:colorControls,buttonTitle:\"Font Color\"}:colorControls[\"default\"]:undefined,placeholder:placeholder?variants.length?{type:ControlType.Object,defaultValue:defaultPlaceholderValues,controls:placeholderControls,hidden:hidden[\"placeholder\"]}:{...placeholderControls[\"default\"],hidden:hidden[\"placeholder\"]}:undefined,fill:{type:ControlType.Object,optional:true,defaultValue:defaultFillValues,controls:{type:{type:ControlType.Enum,options:[\"color\",\"linearGradient\"],optionTitles:[\"Color\",\"Gradient\"],displaySegmentedControl:true},...fillControls,gradientAngle:{type:ControlType.Number,defaultValue:0,title:\"Angle\",step:1,min:0,max:360,unit:\"\\xb0\",hidden:props=>props.type!=\"linearGradient\"}}},radius:{type:ControlType.BorderRadius,defaultValue:\"10px\"},padding:{type:ControlType.Padding,defaultValue:padding},border:{type:ControlType.Object,optional:true,defaultValue:hasDefaultBorder?defaultBorderValues:undefined,controls:{...borderControls,width:{type:ControlType.Padding,defaultValue:defaultBorderValues.width},style:{type:ControlType.Enum,defaultValue:defaultBorderValues.style,options:[\"solid\",\"dashed\",\"dotted\",\"double\"],optionTitles:[\"Solid\",\"Dashed\",\"Dotted\",\"Double\"]}}},shadows:variants.length?{type:ControlType.Object,optional:true,controls:shadowsControls}:{type:ControlType.BoxShadow},opacity:opacity?{type:ControlType.Object,controls:opacityControls}:undefined,bgBlur:{type:ControlType.Number,min:0,max:100,step:1,displayStepper:true,title:\"BG Blur\",description:!showTransition?lastControlDescription:undefined},...endProps,transition:showTransition?{type:ControlType.Transition,defaultValue:DEFAULT_TRANSITION,description:lastControlDescription}:undefined};}export function Message({title,subtitle}){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",width:\"100%\",height:\"100%\",placeContent:\"center\",placeItems:\"center\",flexDirection:\"column\",gap:16,backgroundColor:\"rgba(136, 85, 255, 0.1)\",borderRadius:6,border:\"1px dashed rgb(136, 85, 255)\",color:\"rgb(136, 85, 255)\",fontSize:16,padding:20,minHeight:200,textWrap:\"balance\"},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontWeight:600,textAlign:\"center\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,opacity:.7,lineHeight:1.5,textAlign:\"center\"},children:subtitle})]});}Message.displayName=\"Frameship/Message\";export function currencyFormatProp({title=\"Format\",startProps={},hidden=null}={}){return{type:ControlType.Object,title,hidden,controls:{...startProps,style:{type:ControlType.Enum,defaultValue:\"symbol\",options:[\"symbol\",\"code\"],optionTitles:[\"Symbol ($)\",\"Code (USD)\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},location:{type:ControlType.Enum,defaultValue:\"after\",options:[\"before\",\"after\"],optionTitles:[\"Before\",\"After\"],displaySegmentedControl:true,hidden:props=>props.style!==\"code\"},decimals:{type:ControlType.Enum,defaultValue:\"auto\",options:[\"auto\",\"always\",\"never\"],optionTitles:[\"Auto\",\"Show (10.00)\",\"Hide (10)\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},formatted:{type:ControlType.Boolean,defaultValue:true},locale:{type:ControlType.String,defaultValue:\"\",placeholder:`Auto (${typeof navigator!==\"undefined\"?navigator.language:\"\"})`,description:\"Formatting examples:\\n*1,000* | *1.000* | *1 000*\",hidden:props=>!props.formatted}}};}export function formatCurrency(amount,currencyCode,options){amount=amount||0;const showDecimals=options.decimals==\"auto\"?amount%1!==0:options.decimals==\"always\";const decimals=showDecimals?2:0;let formattedAmount=\"\";if(options.formatted&&typeof Intl!==\"undefined\"){const locale=options.locale||(typeof navigator!==\"undefined\"?navigator.language:\"en-us\");const formatter=new Intl.NumberFormat(locale,{minimumFractionDigits:decimals,maximumFractionDigits:decimals});formattedAmount=formatter.format(amount);}else{formattedAmount=amount.toFixed(decimals);}if(!currencyCode||currencyCode===\"XXX\"){return formattedAmount;}const symbol=CurrencySymbols[currencyCode];if(options.style===\"code\"){return options.location===\"before\"?`${currencyCode} ${formattedAmount}`:`${formattedAmount} ${currencyCode}`;}else{return`${symbol}${formattedAmount}`;}}export function generateVariantTitle(variant,labelOptions){if(!variant||!Array.isArray(variant.selectedOptions)||!variant.selectedOptions.length||variant.title===\"Default Title\"){return\"\";}if(!labelOptions){return variant.title;}switch(labelOptions.style){case\"default\":return variant.selectedOptions.map(option=>option.value).join(labelOptions.separator);case\"multiline\":return variant.selectedOptions.map(option=>option.name+labelOptions.multilineSeparator+option.value).join(\"\\n\");}return variant.title||\"\";}\nexport const __FramerMetadata__ = {\"exports\":{\"UPGRADE_LINK\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Button\":{\"type\":\"reactComponent\",\"name\":\"Button\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"parseShopifyData\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Colors\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Icon\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"iconProp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"parseShopifyId\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Message\":{\"type\":\"reactComponent\",\"name\":\"Message\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"generateVariantTitle\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useInstanceId\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEFAULT_TRANSITION\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"generateInstanceId\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ShopifyDataType\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SHOPIFY_ID_ATTRIBUTE\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"OPEN_CART_EVENT\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"createButtonPropertyControls\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"currencyFormatProp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"styleLayer\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"formatCurrency\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shared.map","import create from\"zustand\";import{persist}from\"zustand/middleware\";import{useState,useEffect}from\"react\";import{parseShopifyData}from\"https://framerusercontent.com/modules/gd3dcT3w5rYoRy7ZcKte/KUBggIcCct5y9ndEplYj/Shared.js\";const CART_ID_STORAGE_ID=\"frameship-shopify-cart-id\";const frameshipDataCache={};async function fetchShopifyData(query,variables={}){const{shopUrl,accessToken}=getFrameshipInfo();if(!shopUrl||!accessToken){console.warn(\"Missing shop URL or access token\");return null;}try{const response=await fetch(`https://${shopUrl}/api/2024-10/graphql.json`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\",\"X-Shopify-Storefront-Access-Token\":accessToken},body:JSON.stringify({query,variables})});const value=await response.json();return value?value.data:null;}catch(error){console.error(error);return null;}}// Add this shared fragment for cart fields\nconst CART_FRAGMENT=`\n  fragment CartFields on Cart {\n    id\n    checkoutUrl\n    cost {\n      subtotalAmount {\n        amount\n        currencyCode\n      }\n    }\n    lines(first: 10) {\n      edges {\n        node {\n          id\n          quantity\n          cost {\n            subtotalAmount {\n              amount\n              currencyCode\n            }\n            compareAtAmountPerQuantity {\n              amount\n              currencyCode\n            }\n          }\n          merchandise {\n            ... on ProductVariant {\n              id\n              title\n              price {\n                amount\n                currencyCode\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n`;export const useCartStore=create(persist((set,get)=>({cartId:null,items:[],loading:false,error:null,checkoutUrl:null,subtotal:null,initializeCart:async(createNewCart=false)=>{if(get().items.length>0){return;}set({loading:true});try{const cartId=get().cartId;if(cartId){const cart=await fetchCart(cartId);set({items:cart.lines.edges.map(edge=>edge.node),checkoutUrl:generateCheckoutUrl(cart.checkoutUrl),subtotal:cart.cost.subtotalAmount,loading:false});}else if(createNewCart){const newCart=await createCart();set({cartId:newCart.id,items:[],checkoutUrl:generateCheckoutUrl(newCart.checkoutUrl),subtotal:newCart.cost.subtotalAmount,loading:false});}}catch(error){set({error:error.message,loading:false});}},addToCart:async(variantId,quantity)=>{set({loading:true});try{// Initialize cart if needed\n    if(!get().cartId){await get().initializeCart(true);}const cartId=get().cartId;const updatedCart=await addToCart(cartId,variantId,quantity);set({items:updatedCart.lines.edges.map(edge=>edge.node),subtotal:updatedCart.cost.subtotalAmount,loading:false});}catch(error){set({error:error.message,loading:false});}},removeFromCart:async lineId=>{set({loading:true});try{const cartId=get().cartId;const updatedCart=await removeFromCart(cartId,lineId);set({items:updatedCart.lines.edges.map(edge=>edge.node),subtotal:updatedCart.cost.subtotalAmount,loading:false});}catch(error){set({error:error.message,loading:false});}},setCartItemQuantity:async(lineId,quantity)=>{set({loading:true});try{const cartId=get().cartId;const updatedCart=await updateCartLineQuantity(cartId,lineId,quantity);set({items:updatedCart.lines.edges.map(edge=>edge.node),subtotal:updatedCart.cost.subtotalAmount,loading:false});}catch(error){set({error:error.message,loading:false});}},getCheckoutUrl:()=>{return get().checkoutUrl||\"\";},clearError:()=>set({error:null})}),{name:CART_ID_STORAGE_ID,partialize:state=>({cartId:state.cartId})}));async function createCart(){const mutation=`\n    ${CART_FRAGMENT}\n    mutation {\n      cartCreate {\n        cart {\n          ...CartFields\n        }\n      }\n    }\n  `;const data=await fetchShopifyData(mutation);return data?data.cartCreate.cart:null;}async function fetchCart(cartId){const query=`\n    ${CART_FRAGMENT}\n    query($cartId: ID!) {\n      cart(id: $cartId) {\n        ...CartFields\n      }\n    }\n  `;const variables={cartId};const data=await fetchShopifyData(query,variables);return data?data.cart:null;}async function addToCart(cartId,variantId,quantity){const mutation=`\n    ${CART_FRAGMENT}\n    mutation($cartId: ID!, $lines: [CartLineInput!]!) {\n      cartLinesAdd(cartId: $cartId, lines: $lines) {\n        cart {\n          ...CartFields\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }\n  `;const variables={cartId,lines:[{quantity:quantity,merchandiseId:variantId}]};try{const data=await fetchShopifyData(mutation,variables);if(data&&data.cartLinesAdd.userErrors.length>0){const cartNotFoundError=data.cartLinesAdd.userErrors.find(e=>e.message===\"The specified cart does not exist.\");if(cartNotFoundError){// Create new cart and retry adding the item\nconst newCart=await createCart();const retryVariables={cartId:newCart.id,lines:[{quantity:quantity,merchandiseId:variantId}]};const retryData=await fetchShopifyData(mutation,retryVariables);if(retryData&&retryData.cartLinesAdd.userErrors.length>0){throw new Error(retryData.cartLinesAdd.userErrors.map(e=>e.message).join(\", \"));}return retryData.cartLinesAdd.cart;}throw new Error(data.cartLinesAdd.userErrors.map(e=>e.message).join(\", \"));}return data?data.cartLinesAdd.cart:null;}catch(error){throw error;}}async function removeFromCart(cartId,lineId){const mutation=`\n    ${CART_FRAGMENT}\n    mutation($cartId: ID!, $lineIds: [ID!]!) {\n      cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n        cart {\n          ...CartFields\n        }\n      }\n    }\n  `;const variables={cartId,lineIds:[lineId]};const data=await fetchShopifyData(mutation,variables);return data?data.cartLinesRemove.cart:null;}export async function getAmountInStock(productId){const query=`\n\t\tquery getInventory($id: ID!) {\n\t\t\tproduct(id: $id) {\n\t\t\t\tvariants(first: 100) {\n\t\t\t\t\tedges {\n\t\t\t\t\t\tnode {\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\tquantityAvailable\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t`;const variables={id:productId};try{const data=await fetchShopifyData(query,variables);const inventoryByVariant={};if(data){for(const edge of data.product.variants.edges){inventoryByVariant[edge.node.id]=edge.node.quantityAvailable;}}return inventoryByVariant;}catch(error){console.error(\"Error fetching inventory:\",error);throw error;}}export function useAmountInStock(shopifyData){const{shopifyId}=parseShopifyData(shopifyData);const[inventory,setInventory]=useState({});const[isLoading,setIsLoading]=useState(true);useEffect(()=>{setIsLoading(true);getAmountInStock(shopifyId).then(value=>{setInventory(value);setIsLoading(false);});},[shopifyId]);return[inventory,isLoading];}async function updateCartLineQuantity(cartId,lineId,quantity){const mutation=`\n    ${CART_FRAGMENT}\n    mutation($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n      cartLinesUpdate(cartId: $cartId, lines: $lines) {\n        cart {\n          ...CartFields\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }\n  `;const variables={cartId,lines:[{id:lineId,quantity:quantity}]};const data=await fetchShopifyData(mutation,variables);if(data&&data.cartLinesUpdate.userErrors.length>0){throw new Error(data.cartLinesUpdate.userErrors.map(e=>e.message).join(\", \"));}return data?data.cartLinesUpdate.cart:null;}export async function generateBuyNowCheckoutUrl(variantId,quantity=1){const mutation=`\n\t\tmutation($input: CartInput!) {\n\t\t\tcartCreate(input: $input) {\n\t\t\t\tcart {\n\t\t\t\t\tcheckoutUrl\n\t\t\t\t}\n\t\t\t\tuserErrors {\n\t\t\t\t\tfield\n\t\t\t\t\tmessage\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t`;const variables={input:{lines:[{quantity:quantity,merchandiseId:variantId}]}};try{const data=await fetchShopifyData(mutation,variables);if(data&&data.cartCreate.userErrors.length>0){throw new Error(data.cartCreate.userErrors.map(e=>e.message).join(\", \"));}return data?generateCheckoutUrl(data.cartCreate.cart.checkoutUrl):null;}catch(error){console.error(\"Error creating buy now cart:\",error);throw error;}}export function getFrameshipInfo(){let shopUrl=\"\";let accessToken=\"\";let stagingDomain=\"\";let productionDomain=\"\";let isCreatorLicense=false;let hasAccess=false;if(typeof document!==\"undefined\"&&typeof window!==\"undefined\"){const hostname=window.location.hostname;const isPreview=hostname.endsWith(\".framercanvas.com\");if(isPreview){hasAccess=true;}const frameshipIdComponent=document.querySelector(\"div[data-frameship-id]\");if(frameshipIdComponent){const frameshipId=frameshipIdComponent.getAttribute(\"data-frameship-id\")||\"\";const frameshipData=parseFrameshipData(frameshipId);const newHasAccess=hasFrameshipAccess(frameshipData.stagingDomain,frameshipData.productionDomain);hasAccess=newHasAccess;if(hasAccess){shopUrl=frameshipData.shopUrl||\"\";accessToken=frameshipData.shopifyAccessToken||\"\";stagingDomain=frameshipData.stagingDomain||\"\";productionDomain=frameshipData.productionDomain||\"\";isCreatorLicense=frameshipData.isCreatorLicense??false;}}else{const frameshipComponent=document.querySelector(\"div[data-frameship-component]\");if(frameshipComponent){const newStagingDomain=frameshipComponent.getAttribute(\"data-staging-domain\")||\"\";const newProductionDomain=frameshipComponent.getAttribute(\"data-production-domain\")||\"\";const newHasAccess=hasFrameshipAccess(newStagingDomain,newProductionDomain);hasAccess=newHasAccess;if(hasAccess){shopUrl=frameshipComponent.getAttribute(\"data-shop-url\")||\"\";accessToken=frameshipComponent.getAttribute(\"data-shopify-access-token\")||\"\";stagingDomain=newStagingDomain;productionDomain=newProductionDomain;}}}}else{hasAccess=true// Show as having access in optimized version of site\n;}return{shopUrl,accessToken,stagingDomain,productionDomain,hasAccess,isCreatorLicense};}export function hasFrameshipAccess(stagingDomain,productionDomain){if(typeof document===\"undefined\"||typeof window===\"undefined\"){return true;}const hostname=window.location.hostname;const isPreview=hostname.endsWith(\".framercanvas.com\");const stagingDomainValue=(stagingDomain||\"\").replace(\"https://\",\"\");const productionDomainValue=(productionDomain||\"\").replace(\"https://\",\"\");if(isPreview||hostname===stagingDomainValue||hostname===productionDomainValue){return true;}else{return false;}}export function parseFrameshipData(frameshipData){if(!frameshipData||typeof frameshipData!==\"string\"){return{};}if(frameshipDataCache.hasOwnProperty(frameshipData)){return frameshipDataCache[frameshipData];}try{const decoded=decodeFromBase64WithoutPadding(rot13(reverseString(frameshipData)));const data=JSON.parse(decoded);// Validate required properties exist\nif(!data||typeof data!==\"object\"){return{};}const value={shopUrl:typeof data.a===\"string\"?data.a:\"\",shopifyAccessToken:typeof data.b===\"string\"?data.b:\"\",productionDomain:typeof data.c===\"string\"?data.c:\"\",stagingDomain:typeof data.d===\"string\"?data.d:\"\",isCreatorLicense:typeof data.e===\"boolean\"?data.e:false};frameshipDataCache[frameshipData]=value;return value;}catch(error){return{};}}function decodeFromBase64WithoutPadding(base64WithoutPadding){try{// Calculate and add back the required padding\nconst padding=base64WithoutPadding.length%4;const paddedBase64=padding?base64WithoutPadding+\"=\".repeat(4-padding):base64WithoutPadding;// Decode the base64 string back to the original string\nreturn atob(paddedBase64);}catch(error){console.error(\"Error decoding base64:\",error);return\"\";}}function rot13(str){return str.replace(/[A-Za-z]/g,function(char){const charCode=char.charCodeAt(0);const baseCharCode=char.toUpperCase()===char?65:97;return String.fromCharCode((charCode-baseCharCode+13)%26+baseCharCode);});}function reverseString(str){return str.split(\"\").reverse().join(\"\");}function generateCheckoutUrl(checkoutUrl){const{isCreatorLicense}=getFrameshipInfo();return isCreatorLicense?\"https://frameship.io/\":checkoutUrl;}\nexport const __FramerMetadata__ = {\"exports\":{\"hasFrameshipAccess\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getAmountInStock\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useCartStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getFrameshipInfo\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"parseFrameshipData\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"generateBuyNowCheckoutUrl\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useAmountInStock\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Cart.map"],"mappings":"giBAA6nC,SAAgB,EAAe,EAAG,EAAK,CAAuE,cAA5D,GAAK,SAAuB,EAAG,WAAW,EAAK,CAAS,KAAa,IAAO,IAAvD,EAA6D,UAA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