var wc;(()=>{"use strict";var e={};(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);const t=window.wc.__experimentalInteractivity,{state:r,actions:i}=(0,t.store)("woocommerce/product-filter-rating",{state:{get selectedFilters(){return((0,t.store)("woocommerce/product-filters").state.activeFilters||[]).filter((e=>"rating"===e.type)).map((e=>e.value)).filter(Boolean)},get hasSelectedFilters(){return r.selectedFilters.length>0},get isItemSelected(){const{props:e}=(0,t.getElement)();return!!e.value&&r.selectedFilters.includes(e.value)}},actions:{getActiveLabel(e){const{activeLabelTemplate:r}=(0,t.getContext)();return r.replace("{{label}}",e)},toggleFilter:()=>{const{props:e}=(0,t.getElement)();let l=e["data-filter-item"];"string"==typeof l&&(l=JSON.parse(l));const{ariaLabel:o,value:c}=l;if(!c||!o)return;const a=(0,t.store)("woocommerce/product-filters");r.selectedFilters.includes(c)?a.actions.removeActiveFilter("rating",c):a.actions.setActiveFilter({type:"rating",value:c,label:i.getActiveLabel(o)}),a.actions.navigate()},clearFilters:()=>{const e=(0,t.store)("woocommerce/product-filters");e.actions.removeActiveFiltersByType("rating"),e.actions.navigate()}}});(wc=void 0===wc?{}:wc)["product-filter-rating"]=e})();