(()=>{"use strict";const e=window.wp.blocks,t=window.wp.blockEditor,a=window.wp.components,s=window.wp.i18n,i=JSON.parse('{"UU":"gateway/field-date"}'),n=window.ReactJSXRuntime;(0,e.registerBlockType)(i.UU,{edit:({attributes:e,setAttributes:i})=>{const{fieldKey:d}=e,o=(0,t.useBlockProps)({className:"gateway-field-date"});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.InspectorControls,{children:(0,n.jsx)(a.PanelBody,{title:(0,s.__)("Field Date Settings","gateway"),children:(0,n.jsx)(a.TextControl,{label:(0,s.__)("Field Key","gateway"),value:d,onChange:e=>i({fieldKey:e}),help:(0,s.__)("The record property containing the date value.","gateway")})})}),(0,n.jsx)("span",{...o,children:d?(0,n.jsx)("em",{children:`[date: ${d}]`}):(0,n.jsx)("em",{children:(0,s.__)("(no field key set)","gateway")})})]})},save:({attributes:e})=>{const{fieldKey:a}=e;return(0,n.jsx)("time",{...t.useBlockProps.save({className:"gateway-field-date"}),"data-wp-text":a?`context.record.${a}`:void 0})}})})();