1import y from"./CdQ7HG4D.js";import F from"./CjEvmQqE.js";import{u as S,r as b,q as B,o as _,Q as L,h as c,c as g,d as h,e as $,t as p,g as i,E as C,b as A,aB as N,D as E,aw as V}from"./cTqHTfvr.js";const O={key:0,class:"FilterDropdown__index tag-style"},Q={__name:"FilterDropdown",props:{title:String,allChoicesLabel:String,taxoSlug:String,choices:Array,showCount:{type:Boolean,default:!0},closeOnClick:{type:Boolean,default:!1}},emits:["change","reset"],setup(e,{emit:k}){const n=e,s=S(),r=k,o=b(!1),v=()=>{o.value||s.$emit("close-all-filters"),o.value=!o.value},u=l=>{l.target.closest(".FilterDropdown")||(o.value=!1)},d=()=>{o.value=!1},D=()=>{n.closeOnClick&&(o.value=!1)},f=B(()=>{var l,t;return(t=(l=n==null?void 0:n.choices)==null?void 0:l.filter(a=>a.selected))==null?void 0:t.length});return _(()=>{window.addEventListener("click",u),s.$on("close-all-filters",d)}),L(()=>{window.removeEventListener("click",u),s.$off("close-all-filters",d)}),(l,t)=>{const a=y,x=F;return c(),g("div",{class:V(["FilterDropdown",i(o)&&"open"])},[h("button",{class:"FilterDropdown__button",onClick:v},[$(p(e.title)+" ",1),e.showCount&&i(f)>0?(c(),g("span",O,p(i(f)),1)):C("",!0),A(a,{class:"FilterDropdown__svg"})]),h("div",{class:"FilterDropdown__dropdown",onClick:D},[N(l.$slots,"default",{},()=>{var m;return[(m=e.choices)!=null&&m.length?(c(),E(x,{key:0,onChange:t[0]||(t[0]=w=>r("change",w)),onReset:t[1]||(t[1]=w=>r("reset",{taxoSlug:e.taxoSlug})),type:e.taxoSlug,allChoicesLabel:e.allChoicesLabel,choices:e.choices},null,8,["type","allChoicesLabel","choices"])):C("",!0)]})])],2)}}};export{Q as default};
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.