import{r as p,c as f,s as l,b as d,n as v}from"./BCLrUOBx.js";function C({product:a,emit:t}){const o=p(!1),r=f(),{authenticated:n}=l(r),u=d(),{setToastMessage:i,setToastError:c,postRequest:m}=u;return{ajaxingCompare:o,addToCompare:async()=>{var s;if(!n.value)return v("/login");o.value=!0;const e=await m({params:{product_id:a.value.id},api:"compareListAction"});o.value=!1,(e==null?void 0:e.status)===200?(e.data||t("removed"),i(e.message)):c((s=e==null?void 0:e.data)==null?void 0:s.form.join(", "))}}}export{C as u};
