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},n={},t.d(n,o),n);var o,n;(0,r.store)("woocommerce/product-filter-price-slider",{state:{rangeStyle:()=>{const{minRange:e,maxRange:t}=(0,r.getContext)("woocommerce/product-filter-price"),o=(0,r.store)("woocommerce/product-filter-price"),{minPrice:n,maxPrice:a}=o.state;return`--low: ${100*(n-e)/(t-e)}%; --high: ${100*(a-e)/(t-e)}%;`}},actions:{selectInputContent:()=>{const e=(0,r.getElement)();e&&e.ref&&e.ref.select()},debounceSetPrice:(e=>{let t,r=null;const o=(...o)=>{r=o,t&&clearTimeout(t),t=setTimeout((()=>{t=null,r&&e(...r)}),1e3)};return o.flush=()=>{t&&r&&(e(...r),clearTimeout(t),t=null)},o})((e=>{e.target.dispatchEvent(new Event("change"))})),limitRange:e=>{const t=(0,r.store)("woocommerce/product-filter-price"),{minPrice:o,maxPrice:n}=t.state;e.target.classList.contains("min")?e.target.value=Math.min(parseInt(e.target.value,10),n-1).toString():e.target.value=Math.max(parseInt(e.target.value,10),o+1).toString()}}});