(()=>{"use strict";var e={n:o=>{var n=o&&o.__esModule?()=>o.default:()=>o;return e.d(n,{a:n}),n},d:(o,n)=>{for(var l in n)e.o(n,l)&&!e.o(o,l)&&Object.defineProperty(o,l,{enumerable:!0,get:n[l]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.element,n=window.wp.blocks,l=window.wp.components,r=window.wp.serverSideRender;var a=e.n(r);const c=window.wp.i18n,t=window.wp.blockEditor,i=window.wp.data,s={from:[{type:"block",blocks:["core/navigation-link"],transform:()=>(0,n.createBlock)("fibosearch/search-nav",{inheritPluginSettings:!1,layout:"icon"})},{type:"block",blocks:["core/search"],transform:()=>(0,n.createBlock)("fibosearch/search-nav",{inheritPluginSettings:!1,layout:"icon"})}],to:[{type:"block",blocks:["core/search"],transform:()=>(0,n.createBlock)("core/search",{showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"})},{type:"block",blocks:["core/navigation-link"],transform:()=>(0,n.createBlock)("core/navigation-link")}]},m=window.wp.primitives,b=(0,o.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 88.000000 88.000000",fill:"none"},(0,o.createElement)("g",{transform:"translate(0.000000,88.000000) scale(0.100000,-0.100000)"},(0,o.createElement)("path",{stroke:"none",fill:"#040404",fillRule:"evenodd",d:"M434 840 c-22 -5 -58 -16 -80 -26 l-39 -17 66 -8 c153 -17 271 -131\n286 -277 l6 -55 15 29 c24 45 28 165 8 219 -22 57 -92 119 -151 134 -49 12\n-53 12 -111 1z"}),(0,o.createElement)("path",{stroke:"none",fill:"#7c3b7c",fillRule:"evenodd",d:"M766 725 c4 -11 18 -49 31 -85 61 -162 4 -334 -132 -400 -61 -30\n-168 -25 -238 9 l-49 24 -99 -99 c-54 -54 -97 -99 -95 -101 2 -2 39 12 82 30\n74 31 81 32 117 20 176 -60 367 19 451 185 54 106 54 215 2 326 -25 53 -84\n129 -70 91z"}),(0,o.createElement)("path",{stroke:"none",fill:"#7c3b7c",fillRule:"evenodd",d:"M265 711 c-62 -29 -102 -77 -119 -146 -20 -75 -20 -113 0 -191 l15\n-62 -46 -84 c-26 -46 -58 -103 -72 -128 -21 -37 -1 -21 120 100 l146 144 -6\n58 c-7 71 8 111 52 138 53 33 98 27 149 -20 23 -22 51 -58 61 -80 10 -22 21\n-40 25 -40 14 0 20 80 10 126 -15 65 -33 97 -81 137 -75 65 -177 84 -254 48z"})));(0,n.registerBlockType)("fibosearch/search-nav",{edit:function(e){const{deviceType:n}=(0,i.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:o}=e("core/edit-post");return{deviceType:o()}}),[]),r=(0,t.useBlockProps)({className:`wp-block-fibosearch-search__device-preview-${n.toLowerCase()}`}),{attributes:s}=e,{attributes:{darkenedBackground:m,mobileOverlay:b,inheritPluginSettings:d,layout:h,iconColor:w},name:u,setAttributes:p}=e;return(0,o.createElement)("div",r,(0,o.createElement)(t.InspectorControls,{key:"inspector"},(0,o.createElement)(l.PanelBody,{title:(0,c.__)("Settings","ajax-search-for-woocommerce"),initialOpen:!1},(0,o.createElement)(l.ToggleControl,{label:(0,c.__)("Inherit global plugin settings","ajax-search-for-woocommerce"),checked:d,onChange:()=>p({inheritPluginSettings:!d})}),d?null:(0,o.createElement)(l.SelectControl,{label:(0,c.__)("Layout","ajax-search-for-woocommerce"),value:h,options:[{label:(0,c.__)("Search bar","ajax-search-for-woocommerce"),value:"classic"},{label:(0,c.__)("Search icon","ajax-search-for-woocommerce"),value:"icon"},{label:(0,c.__)("Icon on mobile, search bar on desktop","ajax-search-for-woocommerce"),value:"icon-flexible"},{label:(0,c.__)("Icon on desktop, search bar on mobile","ajax-search-for-woocommerce"),value:"icon-flexible-inv"}],onChange:e=>{p({layout:e}),"icon"!==e&&"icon-flexible"!==e&&"icon-flexible-inv"!==e||p({mobileOverlay:!0})}}),d?null:(0,o.createElement)(l.ToggleControl,{label:(0,c.__)("Darkened background","ajax-search-for-woocommerce"),checked:m,onChange:()=>p({darkenedBackground:!m})}),d?null:(0,o.createElement)(l.ToggleControl,{label:(0,c.__)("Overlay on mobile","ajax-search-for-woocommerce"),checked:b,onChange:()=>p({mobileOverlay:!b}),help:b?(0,c.__)("The search will open in overlay on mobile","ajax-search-for-woocommerce"):""}),d||"classic"===h?null:(0,o.createElement)(t.PanelColorSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:(0,c.__)("Color","ajax-search-for-woocommerce"),initialOpen:!1,colorSettings:[{value:w,onChange:e=>{p({iconColor:e})},label:(0,c.__)("Icon","ajax-search-for-woocommerce")}]}))),(0,o.createElement)(l.Disabled,null,(0,o.createElement)(a(),{block:u,attributes:s})))},icon:{src:(0,o.createElement)((function(e){let{icon:n,size:l=24,...r}=e;return(0,o.cloneElement)(n,{width:l,height:l,...r})}),{icon:b})},save:()=>{},transforms:s})})();