(()=>{"use strict";const e=window.wp.blocks,l=window.React,t=window.wp.i18n,a=window.wp.blockEditor,i=window.wp.components,n=JSON.parse('{"u2":"wlc-algolia/result-field"}');(0,e.registerBlockType)(n.u2,{edit:function({attributes:e,setAttributes:n}){const{label:o,fieldPath:r,linkType:c,linkFieldPath:h,hideIfEmpty:w}=e;return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(a.InspectorControls,null,(0,l.createElement)(i.PanelBody,{title:(0,t.__)("Result Field","wlc-search-integration-with-algolia"),initialOpen:!0},(0,l.createElement)(i.TextControl,{label:(0,t.__)("Label (optional)","wlc-search-integration-with-algolia"),value:o||"",onChange:e=>n({label:e})}),(0,l.createElement)(i.TextControl,{label:(0,t.__)("Field path","wlc-search-integration-with-algolia"),help:(0,t.__)("Dot path into Algolia record, e.g. _price, taxonomies.product_cat.name","wlc-search-integration-with-algolia"),value:r||"",onChange:e=>n({fieldPath:e})}),(0,l.createElement)(i.SelectControl,{label:(0,t.__)("Link","wlc-search-integration-with-algolia"),value:c||"none",options:[{label:(0,t.__)("None","wlc-search-integration-with-algolia"),value:"none"},{label:(0,t.__)("Permalink","wlc-search-integration-with-algolia"),value:"permalink"},{label:(0,t.__)("Add to cart","wlc-search-integration-with-algolia"),value:"add_to_cart"},{label:(0,t.__)("Custom URL (field)","wlc-search-integration-with-algolia"),value:"field"}],onChange:e=>n({linkType:e})}),"field"===c?(0,l.createElement)(i.TextControl,{label:(0,t.__)("Link field path","wlc-search-integration-with-algolia"),value:h||"",onChange:e=>n({linkFieldPath:e})}):null,(0,l.createElement)(i.ToggleControl,{label:(0,t.__)("Hide if empty","wlc-search-integration-with-algolia"),checked:!1!==w,onChange:e=>n({hideIfEmpty:!!e})}))),(0,l.createElement)("div",{style:{fontSize:13}},(0,l.createElement)("strong",null,o||(0,t.__)("Field","wlc-search-integration-with-algolia"))," ",(0,l.createElement)("span",{style:{opacity:.65}},r?`(${r})`:(0,t.__)("(set fieldPath)","wlc-search-integration-with-algolia"))))},save:()=>null})})();