import{addCheckoutLineItem,updateCheckoutLineItem}from"../checkout/mutations";import{getLineItemByProductId}from"../checkout/getters";import{state}from"./store";export const updateDonationState=(t,e)=>{state[t]={...state[t],...e}};export const updateLineItem=(t,e)=>{const o=getLineItemByProductId(t);return(null==o?void 0:o.id)?updateCheckoutLineItem({id:o.id,data:{...{price:o.price.id,...(null==o?void 0:o.ad_hoc_amount)?{ad_hoc_amount:null==o?void 0:o.ad_hoc_amount}:{}},...e}}):addCheckoutLineItem(e)};