1import{m as I,$ as Q,cg as j,ch as E,ci as O,ce as A,cj as S,ck as T,u as q,C as H,i as V,cl as Y,am as G,e as M}from"./entry.Br_yVqug.js";import{k as D,H as J,l as y,U as v,C as N,u as o,a6 as h,a0 as k,Y as K,a9 as W,a2 as X,a as g,am as R,b as $,a7 as w}from"./swiper-vue.ChDFjB_B.js";import{_ as Z}from"./BaseIconButton.vue.QaNJSVWe.js";const ee=["disabled"],te={key:0,class:"hidden md:block"},ae=D({__name:"BaseOutlineCircleButton",props:{iconType:{default:void 0},iconActiveType:{default:void 0},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{default:""}},setup(n){const r=n,{iconType:t,iconActiveType:s,active:e,disabled:c}=J(r),p=y(()=>e.value?" bg-ash-500 md:border-ash-300":""),u=y(()=>c.value?"cursor-not-allowed":"cursor-pointer"),a=y(()=>t?e.value&&(s==null?void 0:s.value)||t.value:null);return(d,m)=>{const _=I;return v(),N("button",{class:X(["flex h-8 min-w-[32px] cursor-pointer flex-row flex-nowrap content-center items-center justify-center gap-x-2 rounded-full bg-ash-500 text-lg text-ash-900 transition-all hover:bg-ash-300 hover:text-ash-500 disabled:border-ash-200 disabled:text-ash-200 md:min-h-11 md:min-w-20 md:border md:border-ash-200 md:bg-white md:px-5 md:hover:bg-ash-100 [&>svg]:hover:fill-white [&>svg]:disabled:fill-ash-200 md:[&>svg]:hover:fill-maroon-600",[o(p),o(u)]]),disabled:o(c)},[o(a)?(v(),h(_,{key:0,type:o(a),"hover-type":o(a),class:"w-4 fill-white md:w-6 md:fill-maroon-700"},null,8,["type","hover-type"])):k("",!0),K(d.$slots,"default",{},()=>[d.label?(v(),N("div",te,W(d.label),1)):k("",!0)])],10,ee)}}}),le=n=>{const{result:r,error:t,loading:s,refetch:e,onResult:c}=E(O,n.value,{fetchPolicy:"no-cache"});return{data:y(()=>{var u;return(u=r.value)==null?void 0:u.customerFavoriteClientList}),error:t,loading:s,refetch:e,onResult:c}},ce=async n=>await Q({query:j,variables:n,cache:!1,context:{ignoreError:!0}}),oe=()=>{const{mutate:n}=A(S);return{create:async r=>await n({in:{auctionUid:r}})}},ne=()=>{const{mutate:n,loading:r}=A(T);return{loading:r,remove:async t=>await n({auctionUid:t})}},ue=D({__name:"AuctionFavoriteButton",props:{modal:{},value:{type:Boolean},label:{},countFavorite:{},auctionUid:{},auctionName:{},isPreview:{type:Boolean}},emits:["update:value"],async setup(n,{emit:r}){let t,s;const e=n,c=r,{t:p}=q(),{loginModal:u}=H(),a=g(!1),d=g(!1),m=g(0),{create:_}=([t,s]=R(()=>oe()),t=await t,s(),t),{remove:F,loading:L}=([t,s]=R(()=>ne()),t=await t,s(),t),b=!!e.auctionUid,B=(l,f)=>{l&&G().$toast.success(f)},x=y(()=>V(m.value)?"":m.value>999?"999+":m.value+""),P=Y(async()=>{var l,f;if(!d.value){if(d.value=!0,a.value)try{const i=await _(e.auctionUid);B((l=i==null?void 0:i.data)==null?void 0:l.customerFavoriteClientCreate,p("auction.favorite"))}catch{}else try{const i=await F(e.auctionUid);B((f=i==null?void 0:i.data)==null?void 0:f.customerFavoriteClientRemove,p("auction.unfavorite"))}catch{}d.value=!1}},500),U=()=>{e.isPreview||u().then(()=>{a.value=!a.value,m.value+=+a.value||-1,c("update:value",a.value,e.auctionUid),P(),M("gtm-lot-favorite-btn",{"lot-id":e.auctionUid,"lot-name":e.auctionName,status:a.value?"add":"remove"})})},z=()=>{e.isPreview||u().then(async()=>{M("gtm-lot-favorite-btn",{"lot-id":e.auctionUid,"lot-name":e.auctionName,status:"remove"}),await F(e.auctionUid),c("update:value",a.value,e.auctionUid)})};return $(()=>e.value,l=>{a.value=l},{immediate:!0}),$(()=>e.countFavorite,l=>{m.value=l??0},{immediate:!0}),(l,f)=>{const i=ae,C=Z;return b&&e.modal==="full"?(v(),h(i,{key:0,"icon-type":"heart","icon-active-type":"heart-solid",active:o(a),label:e.label??o(x),onClick:w(U,["stop","prevent"])},null,8,["active","label"])):b&&e.modal==="remove"?(v(),h(C,{key:1,"icon-type":"xmark",disabled:o(L),onClick:w(z,["stop","prevent"])},null,8,["disabled"])):b&&e.modal==="simple"?(v(),h(C,{key:2,"icon-type":"heart","icon-active-type":"heart-solid",active:o(a),"icon-size":"lg",onClick:w(U,["stop","prevent"])},null,8,["active"])):b&&e.modal==="view"?(v(),h(C,{key:3,"icon-type":"heart-solid","icon-active-type":"heart-solid",active:o(a),"append-label":o(x),"icon-size":"lg",readonly:""},null,8,["active","append-label"])):k("",!0)}}});
1export{ue as _,ce as a,le as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.