import U from"./CTAcmMAz.js";import V from"./Bvs3L9q-.js";import E from"./CWalxxGV.js";import{Y as M,y as O,b as q,s as i,a as D,u as H,c as P,f as l,m as y,A as W,p as t,j as c,k as s,l as d,t as Y,v as h,i as F,C as G}from"./BCLrUOBx.js";import{u as J}from"./D7xsgz5m.js";import{u as K}from"./D7g1oXVf.js";import"./Ce8lFovl.js";const Q={key:0,class:"sticky-cart-wrap"},X={class:"container-fluid"},Z={class:"sticky-cart"},tt={class:"sticky-title"},et={class:"ellipsis ellipsis-2"},ot={class:"btn-wrap"},st=["title"],_t={__name:"CartStickyBtn",props:{product:{type:Object,default(){return null}},disabled:{type:Boolean,default:!1},productInventory:{type:Object}},emits:["cart-error"],setup(v,{emit:k}){const C=v,{product:a,disabled:u,productInventory:_}=M(C),{getThumbImageURL:S}=O(),p=q(),{currencyIcon:at,setting:nt}=i(p),{setToastMessage:it,setToastError:rt,unAuthPost:lt,postRequest:ct}=p,T=k,{wishListAction:m,addToCart:b,ajaxingWishlist:w,buyingNow:R,ajaxing:$,wishListed:N}=K({product:a,productInventory:_,emit:T}),g=D(),{getUserToken:dt}=g,{profile:ut}=i(g),j=H(),{langCode:pt}=i(j),x=J(),{cartAction:mt,buyNow:bt}=x,B=P(),{authenticated:I}=i(B);l(()=>I.value||!1);const A=l(()=>N.value?"heart-fill-icon":"heart-icon"),r=l(()=>{var e;return(e=a.value)==null?void 0:e.title});return(e,o)=>{const L=U,f=V,z=E;return t(a)?(c(),y("div",Q,[s("div",X,[s("div",Z,[s("div",tt,[d(L,{"lazy-src":t(S)(t(a).image),title:r.value,alt:r.value},null,8,["lazy-src","title","alt"]),s("h5",et,Y(r.value),1)]),s("div",ot,[d(f,{id:"add-to-cart",class:"primary-btn btn",disabled:t(u),type:"button","fetching-data":t($),onClicked:t(b),"loading-text":e.$t("detailRight.adding"),text:e.$t("detailRight.addToCart")},null,8,["disabled","fetching-data","onClicked","loading-text","text"]),d(f,{class:"outline-btn btn",disabled:t(u),type:"button",color:"primary","fetching-data":t(R),onClicked:o[0]||(o[0]=n=>t(b)(!0)),"loading-text":e.$t("detailRight.buyNow"),text:e.$t("detailRight.buyNow")},null,8,["disabled","fetching-data","loading-text","text"]),s("button",{"aria-label":"submit",class:"compare-btn",onClick:o[1]||(o[1]=h((...n)=>t(m)&&t(m)(...n),["prevent"]))},[t(w)?(c(),F(z,{key:0,class:"mr-15"})):(c(),y("i",{key:1,class:G(["icon",A.value])},null,2))]),s("button",{"aria-label":"submit",class:"compare-btn",title:e.$t("product.compare"),onClick:o[2]||(o[2]=h((...n)=>e.addToCompare&&e.addToCompare(...n),["prevent"]))},o[3]||(o[3]=[s("i",{class:"icon reload-icon"},null,-1)]),8,st)])])])])):W("",!0)}}};export{_t as default};
