import*as e from"@wordpress/interactivity";var t={d:(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const r=(o={getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store},c={},t.d(c,o),c);var o,c;(0,r.store)("woocommerce/product-filter-active",{state:{get items(){const e=(0,r.getContext)();return(0,r.store)("woocommerce/product-filters").state.activeFilters.map((t=>({...t,removeLabel:e.removeLabelTemplate.replace("{{label}}",t.label)})))},get hasSelectedFilters(){return(0,r.store)("woocommerce/product-filters").state.activeFilters.length>0}},actions:{removeFilter:()=>{const{attributes:e}=(0,r.getElement)();let t=e["data-filter-item"];"string"==typeof t&&(t=JSON.parse(t));const{type:o,value:c}=t;if(!o||!c)return;const s=(0,r.store)("woocommerce/product-filters");s.actions.removeActiveFilter(o,c),s.actions.navigate()},clearFilters:()=>{(0,r.getContext)("woocommerce/product-filters").activeFilters=[],(0,r.store)("woocommerce/product-filters").actions.navigate()}}});