(()=>{"use strict";var e={n:o=>{var l=o&&o.__esModule?()=>o.default:()=>o;return e.d(l,{a:l}),l},d:(o,l)=>{for(var a in l)e.o(l,a)&&!e.o(o,a)&&Object.defineProperty(o,a,{enumerable:!0,get:l[a]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.blocks,l=window.wp.blockEditor,a=window.wp.serverSideRender;var n=e.n(a);const s=window.wp.components,t=JSON.parse('{"UU":"ggmc/product-grid"}'),r=window.ReactJSXRuntime;(0,o.registerBlockType)(t.UU,{edit:({attributes:e,setAttributes:o})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.InspectorControls,{children:[(0,r.jsxs)(s.PanelBody,{title:"Query",children:[(0,r.jsx)(s.RangeControl,{label:"Products Per Page",value:e.products_per_page,onChange:e=>o({products_per_page:e}),min:1,max:100}),(0,r.jsx)(s.SelectControl,{label:"Order By",value:e.orderby,options:[{label:"Date Created",value:"created_at"},{label:"Date Modified",value:"updated_at"},{label:"Name",value:"name"},{label:"Price",value:"price"},{label:"Stock",value:"stock"},{label:"Featured First",value:"featured"}],onChange:e=>o({orderby:e})}),(0,r.jsx)(s.SelectControl,{label:"Order",value:e.order,options:[{label:"Ascending",value:"ASC"},{label:"Descending",value:"DESC"}],onChange:e=>o({order:e})}),(0,r.jsx)(s.ToggleControl,{label:"Filter by Current Taxonomy",help:"On archive pages, filter to show only products in the current category/tag",checked:"yes"===e.filter_by_current_taxonomy,onChange:e=>o({filter_by_current_taxonomy:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Featured Products Only",checked:"yes"===e.show_featured_only,onChange:e=>o({show_featured_only:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Pagination",checked:"yes"===e.show_pagination,onChange:e=>o({show_pagination:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Enable Sorting",help:"Show a dropdown to allow users to sort products",checked:"yes"===e.enable_sorting,onChange:e=>o({enable_sorting:e?"yes":"no"})})]}),(0,r.jsxs)(s.PanelBody,{title:"Grid Layout",initialOpen:!1,children:[(0,r.jsx)(s.SelectControl,{label:"Grid Style",value:e.grid_style,options:[{label:"Standard Grid",value:"standard"},{label:"Masonry Grid",value:"masonry"},{label:"Justified Grid",value:"justified"}],onChange:e=>o({grid_style:e})}),(0,r.jsx)(s.SelectControl,{label:"Columns",value:e.columns,options:[{label:"1 Column",value:"1"},{label:"2 Columns",value:"2"},{label:"3 Columns",value:"3"},{label:"4 Columns",value:"4"},{label:"5 Columns",value:"5"},{label:"6 Columns",value:"6"}],onChange:e=>o({columns:e})}),(0,r.jsx)(s.RangeControl,{label:"Column Gap (px)",value:e.column_gap,onChange:e=>o({column_gap:e}),min:0,max:100}),(0,r.jsx)(s.RangeControl,{label:"Row Gap (px)",value:e.row_gap,onChange:e=>o({row_gap:e}),min:0,max:100}),"1"===e.columns&&(0,r.jsx)(s.SelectControl,{label:"Layout Style",value:e.layout_style,options:[{label:"Horizontal (Image + Content)",value:"horizontal"},{label:"Vertical (Stacked)",value:"vertical"},{label:"Compact (Minimal)",value:"compact"}],onChange:e=>o({layout_style:e})})]}),(0,r.jsxs)(s.PanelBody,{title:"Show/Hide Components",initialOpen:!1,children:[(0,r.jsx)(s.ToggleControl,{label:"Show Image",checked:"yes"===e.show_image,onChange:e=>o({show_image:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Badges",checked:"yes"===e.show_badge,onChange:e=>o({show_badge:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Quick View",checked:"yes"===e.show_quick_view,onChange:e=>o({show_quick_view:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Categories",checked:"yes"===e.show_categories,onChange:e=>o({show_categories:e?"yes":"no"})}),"yes"===e.show_categories&&(0,r.jsx)(s.ToggleControl,{label:"Link Categories",help:"Link category names to their archive pages",checked:"yes"===e.link_categories,onChange:e=>o({link_categories:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Title",checked:"yes"===e.show_title,onChange:e=>o({show_title:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Rating",checked:"yes"===e.show_rating,onChange:e=>o({show_rating:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Price",checked:"yes"===e.show_price,onChange:e=>o({show_price:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Description",checked:"yes"===e.show_description,onChange:e=>o({show_description:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Stock Status",checked:"yes"===e.show_stock,onChange:e=>o({show_stock:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Add to Cart",checked:"yes"===e.show_add_to_cart,onChange:e=>o({show_add_to_cart:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Wishlist",checked:"yes"===e.show_wishlist,onChange:e=>o({show_wishlist:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Compare",checked:"yes"===e.show_compare,onChange:e=>o({show_compare:e?"yes":"no"})})]})]}),(0,r.jsx)(n(),{block:t.UU,attributes:e})]}),save:()=>null})})();