(()=>{"use strict";const e=window.wp.blocks,t=window.React,n=window.wp.components,l=window.wp.blockEditor,a=window.wp.element,i=window.wp.i18n,o=window.wp.serverSideRender,r=JSON.parse('{"UU":"sabaiapps/drts-view-filter"}');(0,e.registerBlockType)(r.UU,{edit:function({attributes:e,setAttributes:s}){const[c,_]=(0,a.useState)(drts_wordpress_block_editor_vars_view_filter.bundles||[]),[d,b]=(0,a.useState)(!1),u=drts_wordpress_block_editor_vars_view_filter.cache_options||[],p=e.bundle&&""!==e.bundle;return(0,a.useEffect)((()=>{_((e=>[{value:"",label:(0,i.__)("Select form","directories-pro")},...e])),b(!0)}),[]),(0,a.useEffect)((()=>{d&&s({hideOnMobile:!1,cacheLifetime:0})}),[e.bundle]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(l.InspectorControls,null,(0,t.createElement)(n.PanelBody,{title:(0,i.__)("Settings","directories-pro")},(0,t.createElement)(n.SelectControl,{value:e.bundle,options:c,onChange:e=>s({bundle:e})}),p&&(0,t.createElement)(n.CheckboxControl,{label:(0,i.__)("Hide on mobile","directories-pro"),checked:e.hideOnMobile,onChange:e=>s({hideOnMobile:e})}),p&&u.length>0&&(0,t.createElement)(n.SelectControl,{label:(0,i.__)("Cache output","directories-pro"),value:e.cacheLifetime,options:u,onChange:e=>s({cacheLifetime:""!==e?parseInt(e,10):void 0})}))),(0,t.createElement)("div",{...(0,l.useBlockProps)()},p?(0,t.createElement)(n.Disabled,null,(0,t.createElement)(o.ServerSideRender,{block:r.UU,attributes:e})):(0,t.createElement)(n.SelectControl,{value:e.bundle,options:c,onChange:e=>s({bundle:e})})))}})})();