(()=>{var e={9498:()=>{}},t={};function o(r){var c=t[r];if(void 0!==c)return c.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,o),l.exports}o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";o.r(r);const e=window.wp.blocks,t=window.wc.wcSettings,c=window.React,l=window.wp.primitives,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"woocommerce/product-filter-active","version":"1.0.0","title":"Active (Experimental)","description":"Display the currently active filters.","category":"woocommerce","keywords":["WooCommerce"],"textdomain":"woocommerce","apiVersion":3,"ancestor":["woocommerce/product-filters"],"supports":{"interactivity":true,"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":false,"radius":false,"style":false,"width":false}},"spacing":{"margin":true,"padding":true,"blockGap":false,"__experimentalDefaultControls":{"margin":false,"padding":false,"blockGap":false}}},"usesContext":["activeFilters"],"attributes":{"clearButton":{"type":"boolean","default":false}}}'),i=window.wp.blockEditor,a=window.wp.i18n,s=window.wp.components,m=window.wp.data,u=window.wp.element,d=(e,t)=>{if(!e)return null;if(0===e.innerBlocks.length)return null;for(const o of e.innerBlocks){if(t(o))return o;const e=d(o,t);if(e)return e}return null},p=({attributes:t,setAttributes:o,clientId:r})=>{const{clearButton:l}=t;return(0,u.useEffect)((()=>{const t=(0,m.select)("core/block-editor").getBlock(r),o=("woocommerce/product-filter-clear-button",d(t,(function(e){return"woocommerce/product-filter-clear-button"===e.name})));o&&!l?((0,m.dispatch)("core/block-editor").updateBlockAttributes(o.clientId),(0,m.dispatch)("core/block-editor").removeBlock(o.clientId),(0,m.dispatch)("core/block-editor").selectBlock(r)):!o&&l&&(0,m.dispatch)("core/block-editor").insertBlock((0,e.createBlock)("woocommerce/product-filter-clear-button",{clearType:"all"}),1,r,!1)}),[l,r]),(0,c.createElement)(i.InspectorControls,{group:"styles"},(0,c.createElement)(s.PanelBody,{title:(0,a.__)("Display","woocommerce")},(0,c.createElement)(s.ToggleControl,{label:(0,a.__)("Clear button","woocommerce"),checked:l,onChange:e=>{o({clearButton:e})}})))};o(9498);const w=({children:e})=>(0,c.createElement)("div",{className:"wc-block-product-filter-components-initial-disabled"},(0,c.createElement)("div",{className:"wc-block-product-filter-components-initial-disabled-overlay"}),e),f=["woocommerce/product-filters","woocommerce/product-filter-attribute","woocommerce/product-filter-active","woocommerce/product-filter-price","woocommerce/product-filter-status","woocommerce/product-collection","core/query"],b=(t=[])=>(0,e.getBlockTypes)().map((e=>e.name)).filter((e=>!t.includes(e))),k=[{type:(0,a.__)("Color","woocommerce"),label:(0,a.__)("Blue","woocommerce")},{type:(0,a.__)("Color","woocommerce"),label:(0,a.__)("Red","woocommerce")},{type:(0,a.__)("Size","woocommerce"),label:(0,a.__)("Large","woocommerce")},{type:(0,a.__)("Status","woocommerce"),label:(0,a.__)("In stock","woocommerce")},{type:(0,a.__)("Status","woocommerce"),label:(0,a.__)("On sale","woocommerce")}];(()=>{const{experimentalBlocksEnabled:e}=(0,t.getSetting)("wcBlocksConfig",{experimentalBlocksEnabled:!1});return e})()&&(0,e.registerBlockType)(n,{icon:()=>(0,c.createElement)(l.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(l.Path,{d:"M9 17.5H11.5V16H9V17.5ZM5 6V7.5L17 7.5V6L5 6ZM7 12.5H15V11H7V12.5Z",fill:"currentColor"}),(0,c.createElement)(l.Path,{d:"M19.9982 13.1948L18.7945 12.2998L15.7111 16.1017L14.0969 14.8993L13.2002 16.1017L16.0185 18.2022L19.9982 13.1948Z",fill:"currentColor"})),edit:e=>{const{attributes:t}=e,{clearButton:o}=t,{children:r,...l}=(0,i.useInnerBlocksProps)((0,i.useBlockProps)(),{allowedBlocks:b(f),template:[["woocommerce/product-filter-removable-chips"],...o?[["woocommerce/product-filter-clear-button",{clearType:"all"}]]:[]]});return(0,c.createElement)("div",{...l},(0,c.createElement)(p,{...e}),(0,c.createElement)(w,null,(0,c.createElement)(i.BlockContextProvider,{value:{filterData:{items:k}}},r)))},save:()=>{const e=i.useBlockProps.save(),t=i.useInnerBlocksProps.save(e);return(0,c.createElement)("div",{...t})}})})(),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-filter-active"]=r})();