import{K as p,m as r,j as o,F as C,B as k,l as d,w as i,q as l,t as u,v as y,_ as L,k as m,A as f,i as v,C as b,b as h,s as B}from"./BCLrUOBx.js";import{u as S}from"./Bxmfm8sn.js";const w={setup(){const t=h(),{categories:a}=B(t);return{categories:a}},name:"FilterCategory",props:{category:{type:Object,default:null},subCategoryId:{type:String,default:null},isCategoryPage:{type:Boolean,default:!1},allCategories:{type:Array,default(){return[]}}},data(){return{}},components:{},mixins:[S],computed:{categoryTitle(){var t;return(t=this.category)==null?void 0:t.title},subCategories(){var t;return(t=this.category)==null?void 0:t.public_sub_categories}},mounted(){},methods:{}},F={class:"category-wrapper"},I={key:0},N={key:1},P={class:"mb-10"},T={class:"mb-5 main-category"},V={key:0};function $(t,a,s,j,A,c){const n=L;return o(),r("div",F,[s.isCategoryPage?(o(),r("div",N,[m("p",P,[d(n,{onClick:a[0]||(a[0]=e=>t.$emit("close-filter")),to:t.listingLink({title:t.$t("listingLayout.allProducts")}),class:"flex start"},{default:i(()=>[a[2]||(a[2]=m("i",{class:"dimen-16x icon double-arrow-left-icon mr-5 opacity-6"},null,-1)),l(" "+u(t.$t("listingLayout.allProducts")),1)]),_:1,__:[2]},8,["to"])]),m("h5",T,[s.category?(o(),v(n,{key:0,class:b([{active:!s.subCategoryId},"bold"]),to:t.categoryLink(s.category),onClick:a[1]||(a[1]=y(e=>t.$emit("going-next",t.categoryLink(s.category)),["stop"]))},{default:i(()=>[l(u(c.categoryTitle),1)]),_:1},8,["class","to"])):f("",!0)]),c.subCategories?(o(),r("ul",V,[(o(!0),r(C,null,k(c.subCategories,(e,g)=>(o(),r("li",{class:b({active:s.subCategoryId&&s.subCategoryId.toString()===e.id.toString()}),key:g},[d(n,{to:t.subCategoryLink(e),onClick:y(_=>t.$emit("going-next",t.subCategoryLink(e)),["stop"])},{default:i(()=>[l(u(e.title),1)]),_:2},1032,["to","onClick"])],2))),128))])):f("",!0)])):(o(),r("ul",I,[(o(!0),r(C,null,k(s.allCategories,(e,g)=>(o(),r("li",{key:g},[d(n,{to:t.categoryLink(e),onClick:y(_=>t.$emit("going-next",t.categoryLink(e)),["stop"])},{default:i(()=>[l(u(e.title),1)]),_:2},1032,["to","onClick"])]))),128))]))])}const D=p(w,[["render",$]]);export{D as default};
