(function(blocks, element, blockEditor, components, i18n, data) {
  "use strict";
  const $schema = "https://schemas.wp.org/trunk/block.json";
  const apiVersion = 3;
  const name = "bookiflex/search-form";
  const version = "1.0.0";
  const title = "Booking Search Form";
  const category = "bookiflex";
  const description = "Let visitors search availability by dates and guests from any page — ideal for building a call-to-action section. Matching results open right in the booking widget.";
  const keywords = ["bookiflex", "booking", "search", "hotel", "reservation"];
  const supports = { "html": false, "align": ["wide", "full"] };
  const textdomain = "bookiflex";
  const attributes = { "layout": { "type": "string", "default": "bar", "enum": ["bar", "hero", "sidebar"] }, "locale": { "type": "string", "default": "" }, "buttonText": { "type": "string", "default": "" }, "hideGuests": { "type": "boolean", "default": false }, "hidePromo": { "type": "boolean", "default": false }, "hideChildren": { "type": "boolean", "default": false }, "maxAdults": { "type": "number" }, "maxChildren": { "type": "number" }, "maxChildAge": { "type": "number" }, "accommodationTypes": { "type": "string", "default": "" }, "ratePlans": { "type": "string", "default": "" }, "submitMode": { "type": "string", "default": "event", "enum": ["redirect", "event"] }, "actionUrl": { "type": "string", "default": "" }, "colorPrimary": { "type": "string", "default": "" }, "colorPrimaryHover": { "type": "string", "default": "" }, "colorOnPrimary": { "type": "string", "default": "" }, "colorSurface": { "type": "string", "default": "" }, "colorOnSurface": { "type": "string", "default": "" }, "colorBorder": { "type": "string", "default": "" }, "colorMuted": { "type": "string", "default": "" }, "radius": { "type": "string", "default": "" }, "radiusTl": { "type": "number" }, "radiusTr": { "type": "number" }, "radiusBr": { "type": "number" }, "radiusBl": { "type": "number" }, "borderWidth": { "type": "string", "default": "" }, "gap": { "type": "string", "default": "" }, "fieldPadding": { "type": "string", "default": "" }, "fontFamily": { "type": "string", "default": "" }, "fontSize": { "type": "string", "default": "" }, "buttonTextTransform": { "type": "string", "default": "" }, "shadow": { "type": "string", "default": "" } };
  const editorScript = "file:./index.js";
  const metadata = {
    $schema,
    apiVersion,
    name,
    version,
    title,
    category,
    description,
    keywords,
    supports,
    textdomain,
    attributes,
    editorScript
  };
  const PRESETS = [
    {
      id: "classic",
      label: i18n.__("Classic (default)", "bookiflex"),
      tokens: {
        colorPrimary: "",
        colorPrimaryHover: "",
        colorOnPrimary: "",
        colorSurface: "",
        colorOnSurface: "",
        colorBorder: "",
        colorMuted: "",
        radius: "",
        borderWidth: "",
        gap: "",
        fieldPadding: "",
        fontFamily: "",
        fontSize: "",
        buttonTextTransform: "",
        shadow: ""
      }
    },
    {
      id: "ocean",
      label: i18n.__("Ocean Resort", "bookiflex"),
      tokens: {
        colorPrimary: "#e67e22",
        colorPrimaryHover: "#d35400",
        radius: "8px",
        shadow: "0 8px 32px rgba(0,0,0,0.25)"
      }
    },
    {
      id: "paris",
      label: i18n.__("Paris Gold", "bookiflex"),
      tokens: {
        colorPrimary: "#9a7c3f",
        colorPrimaryHover: "#7d6332",
        colorSurface: "#fdf8ee",
        colorBorder: "rgba(154,124,63,0.35)",
        colorOnSurface: "#1a1209",
        colorMuted: "#7a6a50",
        radius: "8px",
        fontSize: "14px"
      }
    },
    {
      id: "dark",
      label: i18n.__("Mountain Dark", "bookiflex"),
      tokens: {
        colorPrimary: "#e77f23",
        colorPrimaryHover: "#d35400",
        colorSurface: "#1e272e",
        colorOnSurface: "#eeeeee",
        colorBorder: "#3d4a53",
        colorMuted: "#8395a7",
        radius: "0",
        fontSize: "15px"
      }
    },
    {
      id: "navy",
      label: i18n.__("Navy Classic", "bookiflex"),
      tokens: {
        colorPrimary: "#2c3e50",
        colorPrimaryHover: "#1a252f",
        colorBorder: "#cccccc",
        radius: "0",
        fontSize: "15px"
      }
    },
    {
      id: "green",
      label: i18n.__("Forest Green", "bookiflex"),
      tokens: {
        colorPrimary: "#27ae60",
        colorPrimaryHover: "#219a52"
      }
    },
    {
      id: "violet",
      label: i18n.__("Violet", "bookiflex"),
      tokens: {
        colorPrimary: "#6c5ce7",
        colorPrimaryHover: "#5a4bd1",
        colorSurface: "#f8f9fa",
        radius: "12px",
        fontSize: "15px",
        fieldPadding: "16px 20px",
        shadow: "0 2px 16px rgba(108,92,231,0.15)"
      }
    }
  ];
  const SEARCH_LABELS = { en: "Search", ru: "Поиск", pl: "Szukaj", de: "Suchen", es: "Buscar", it: "Cerca", fr: "Rechercher" };
  const CHECKIN_LABELS = { en: "Check-in", ru: "Заезд", pl: "Przyjazd", de: "Anreise", es: "Llegada", it: "Arrivo", fr: "Arrivée" };
  const CHECKOUT_LABELS = { en: "Check-out", ru: "Выезд", pl: "Wyjazd", de: "Abreise", es: "Salida", it: "Partenza", fr: "Départ" };
  const GUESTS_LABELS = { en: "Guests", ru: "Гости", pl: "Goście", de: "Gäste", es: "Huéspedes", it: "Ospiti", fr: "Voyageurs" };
  const PROMO_LABELS = { en: "Promo code", ru: "Промокод", pl: "Kod promo", de: "Promo-Code", es: "Código promo", it: "Codice promo", fr: "Code promo" };
  const ADULTS_LABELS = { en: "adults", ru: "взрослых", pl: "dorosłych", de: "Erwachsene", es: "adultos", it: "adulti", fr: "adultes" };
  const PREVIEW_CSS = `
.bflex-prev-wrap {
  font-size: 14px; font-family: inherit; line-height: 1.4;
  color: var(--bflex-on-surface, #333);  border: none;
}
.bflex-prev-container {
  background: var(--bflex-surface, #fff);
  border-radius:
    var(--bflex-radius-tl, var(--bflex-radius, 4px))
    var(--bflex-radius-tr, var(--bflex-radius, 4px))
    var(--bflex-radius-br, var(--bflex-radius, 4px))
    var(--bflex-radius-bl, var(--bflex-radius, 4px));
  border: var(--bflex-border-width, 1px) solid var(--bflex-border, #ddd);
  overflow: hidden;
}
.bflex-prev-container.layout-bar,
.bflex-prev-container.layout-hero { display: grid; grid-template-columns: 1fr auto; }
.bflex-prev-container.layout-hero { box-shadow: var(--bflex-shadow, 0 4px 20px rgba(0,0,0,0.15)); }
.bflex-prev-container.layout-sidebar { display: flex; flex-direction: column; }
.bflex-prev-fields { display: flex; min-width: 0; }
.bflex-prev-container.layout-sidebar .bflex-prev-fields { flex-direction: column; }
.bflex-prev-field {
  flex: 1; padding: var(--bflex-field-padding, 12px 16px);
  display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow: hidden;
}
.bflex-prev-container.layout-bar .bflex-prev-field,
.bflex-prev-container.layout-hero .bflex-prev-field {
  border-right: var(--bflex-border-width, 1px) solid var(--bflex-border, #ddd);
}
.bflex-prev-container.layout-bar .bflex-prev-field:last-child,
.bflex-prev-container.layout-hero .bflex-prev-field:last-child { border-right: none; }
.bflex-prev-container.layout-sidebar .bflex-prev-field {
  border-bottom: var(--bflex-border-width, 1px) solid var(--bflex-border, #ddd);
}
.bflex-prev-label {
  font-size: 0.75em; color: var(--bflex-muted, #999); text-transform: uppercase;
  letter-spacing: 0.05em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bflex-prev-value {
  font-size: 1em; color: var(--bflex-on-surface, #333);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bflex-prev-value.placeholder { color: var(--bflex-muted, #999); }
.bflex-prev-btn {
  background: var(--bflex-primary, #c0392b); color: var(--bflex-on-primary, #fff);
  border: none; padding: var(--bflex-field-padding, 12px 16px);
  font-family: inherit; font-size: 1em; font-weight: 600; cursor: default;
  text-transform: var(--bflex-button-text-transform, uppercase);
  letter-spacing: 0.05em; white-space: nowrap; align-self: stretch;
}
.bflex-prev-container.layout-bar .bflex-prev-btn,
.bflex-prev-container.layout-hero .bflex-prev-btn {
  border-radius: 0
    max(0px, calc(var(--bflex-radius-tr, var(--bflex-radius, 4px)) - var(--bflex-border-width, 1px)))
    max(0px, calc(var(--bflex-radius-br, var(--bflex-radius, 4px)) - var(--bflex-border-width, 1px)))
    0;
}
.bflex-prev-container.layout-sidebar .bflex-prev-btn {
  width: 100%;
  border-radius: 0 0
    max(0px, calc(var(--bflex-radius-br, var(--bflex-radius, 4px)) - var(--bflex-border-width, 1px)))
    max(0px, calc(var(--bflex-radius-bl, var(--bflex-radius, 4px)) - var(--bflex-border-width, 1px)));
}
`;
  function EditorPreview({ layout, locale, buttonText, hideGuests, hidePromo, cssVars }) {
    const l = locale || "en";
    const btnLabel = buttonText || SEARCH_LABELS[l] || SEARCH_LABELS.en;
    return /* @__PURE__ */ React.createElement("div", { className: "bflex-prev-wrap", style: cssVars }, /* @__PURE__ */ React.createElement("style", null, PREVIEW_CSS), /* @__PURE__ */ React.createElement("div", { className: `bflex-prev-container layout-${layout}` }, /* @__PURE__ */ React.createElement("div", { className: "bflex-prev-fields" }, /* @__PURE__ */ React.createElement("div", { className: "bflex-prev-field" }, /* @__PURE__ */ React.createElement("span", { className: "bflex-prev-label" }, CHECKIN_LABELS[l] || CHECKIN_LABELS.en, " — ", CHECKOUT_LABELS[l] || CHECKOUT_LABELS.en), /* @__PURE__ */ React.createElement("span", { className: "bflex-prev-value placeholder" }, "—")), !hideGuests && /* @__PURE__ */ React.createElement("div", { className: "bflex-prev-field" }, /* @__PURE__ */ React.createElement("span", { className: "bflex-prev-label" }, GUESTS_LABELS[l] || GUESTS_LABELS.en), /* @__PURE__ */ React.createElement("span", { className: "bflex-prev-value" }, "2 ", ADULTS_LABELS[l] || ADULTS_LABELS.en)), !hidePromo && /* @__PURE__ */ React.createElement("div", { className: "bflex-prev-field" }, /* @__PURE__ */ React.createElement("span", { className: "bflex-prev-label" }, PROMO_LABELS[l] || PROMO_LABELS.en), /* @__PURE__ */ React.createElement("span", { className: "bflex-prev-value placeholder" }, "—"))), /* @__PURE__ */ React.createElement("button", { className: "bflex-prev-btn", type: "button" }, btnLabel)));
  }
  function ColorTokenField({ label, value, onChange, enableAlpha = false }) {
    const [open, setOpen] = element.useState(false);
    const displayVal = value || "";
    return /* @__PURE__ */ React.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ React.createElement(components.Flex, { align: "center", justify: "space-between", style: { marginBottom: 4 } }, /* @__PURE__ */ React.createElement(components.FlexItem, null, /* @__PURE__ */ React.createElement("span", { style: { fontSize: 11, fontWeight: 500 } }, label)), /* @__PURE__ */ React.createElement(components.FlexItem, null, /* @__PURE__ */ React.createElement(
      components.Button,
      {
        variant: "tertiary",
        onClick: () => setOpen((o) => !o),
        style: { padding: "2px 4px", minWidth: 0, height: "auto", gap: 6, display: "flex", alignItems: "center" }
      },
      /* @__PURE__ */ React.createElement(components.ColorIndicator, { colorValue: displayVal || "transparent" }),
      /* @__PURE__ */ React.createElement("span", { style: { fontSize: 11, color: displayVal ? void 0 : "#aaa", fontFamily: "monospace" } }, displayVal || "—")
    ), open && /* @__PURE__ */ React.createElement(components.Popover, { onClose: () => setOpen(false), placement: "left-start", offset: 8 }, /* @__PURE__ */ React.createElement("div", { style: { padding: 8 } }, /* @__PURE__ */ React.createElement(
      components.ColorPicker,
      {
        color: displayVal,
        onChange,
        enableAlpha
      }
    ), displayVal && /* @__PURE__ */ React.createElement(
      components.Button,
      {
        variant: "tertiary",
        isDestructive: true,
        onClick: () => {
          onChange("");
          setOpen(false);
        },
        style: { width: "100%", marginTop: 4, justifyContent: "center" }
      },
      i18n.__("Clear", "bookiflex")
    ))))));
  }
  function decodeHtml(html) {
    const txt = document.createElement("textarea");
    txt.innerHTML = html;
    return txt.value;
  }
  function toOpaque(color) {
    return color && /^#[0-9a-f]{8}$/i.test(color) ? color.slice(0, 7) : color;
  }
  function PageUrlSelect({ value, onChange }) {
    const pages = data.useSelect(
      (select) => select("core").getEntityRecords("postType", "page", {
        per_page: 100,
        _fields: "id,title,link",
        status: "publish"
      }),
      []
    );
    const pageOptions = [
      { label: i18n.__("— Select a page —", "bookiflex"), value: "" },
      ...(pages || []).map((p) => ({
        label: decodeHtml(p.title?.rendered || `Page #${p.id}`),
        value: p.link
      }))
    ];
    const matchedValue = pages && pages.some((p) => p.link === value) ? value : "";
    return /* @__PURE__ */ React.createElement(React.Fragment, null, pages === null ? /* @__PURE__ */ React.createElement(components.Spinner, null) : /* @__PURE__ */ React.createElement(
      components.SelectControl,
      {
        label: i18n.__("Redirect URL", "bookiflex"),
        value: matchedValue,
        options: pageOptions,
        onChange: (val) => {
          if (val) onChange(val);
        },
        help: i18n.__("Pick a page or type a custom URL below.", "bookiflex")
      }
    ), /* @__PURE__ */ React.createElement(
      components.TextControl,
      {
        label: i18n.__("Custom URL", "bookiflex"),
        value,
        onChange,
        help: i18n.__("Overrides the page selection above.", "bookiflex")
      }
    ));
  }
  function Edit({ attributes: attributes2, setAttributes }) {
    const {
      layout,
      locale,
      buttonText,
      hideGuests,
      hidePromo,
      hideChildren,
      maxAdults,
      maxChildren,
      maxChildAge,
      accommodationTypes,
      ratePlans,
      submitMode,
      actionUrl,
      colorPrimary,
      colorPrimaryHover,
      colorOnPrimary,
      colorSurface,
      colorOnSurface,
      colorBorder,
      colorMuted,
      radius,
      radiusTl,
      radiusTr,
      radiusBr,
      radiusBl,
      borderWidth,
      gap,
      fieldPadding,
      fontFamily,
      fontSize,
      buttonTextTransform,
      shadow
    } = attributes2;
    const blockProps = blockEditor.useBlockProps();
    const cssVars = {
      ...colorPrimary ? { "--bflex-primary": colorPrimary } : {},
      ...colorPrimaryHover ? { "--bflex-primary-hover": colorPrimaryHover } : {},
      ...colorOnPrimary ? { "--bflex-on-primary": colorOnPrimary } : {},
      ...colorSurface ? { "--bflex-surface": colorSurface } : {},
      ...colorSurface ? { "--bflex-panel-bg": toOpaque(colorSurface) } : {},
      ...colorOnSurface ? { "--bflex-on-surface": colorOnSurface } : {},
      ...colorBorder ? { "--bflex-border": colorBorder } : {},
      ...colorMuted ? { "--bflex-muted": colorMuted } : {},
      ...radius ? { "--bflex-radius": radius } : {},
      ...radiusTl !== void 0 ? { "--bflex-radius-tl": `${radiusTl}px` } : {},
      ...radiusTr !== void 0 ? { "--bflex-radius-tr": `${radiusTr}px` } : {},
      ...radiusBr !== void 0 ? { "--bflex-radius-br": `${radiusBr}px` } : {},
      ...radiusBl !== void 0 ? { "--bflex-radius-bl": `${radiusBl}px` } : {},
      ...borderWidth ? { "--bflex-border-width": borderWidth } : {},
      ...gap ? { "--bflex-gap": gap } : {},
      ...fieldPadding ? { "--bflex-field-padding": fieldPadding } : {},
      ...fontFamily ? { "--bflex-font-family": fontFamily } : {},
      ...fontSize ? { "--bflex-font-size": fontSize } : {},
      ...buttonTextTransform ? { "--bflex-button-text-transform": buttonTextTransform } : {},
      ...shadow ? { "--bflex-shadow": shadow } : {}
    };
    function applyPreset(presetId) {
      if (!presetId) return;
      const preset = PRESETS.find((p) => p.id === presetId);
      if (preset) setAttributes(preset.tokens);
    }
    return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(blockEditor.InspectorControls, null, /* @__PURE__ */ React.createElement(components.PanelBody, { title: i18n.__("Layout", "bookiflex") }, /* @__PURE__ */ React.createElement(
      components.SelectControl,
      {
        label: i18n.__("Layout", "bookiflex"),
        value: layout,
        options: [
          { label: "Bar", value: "bar" },
          { label: "Hero", value: "hero" },
          { label: "Sidebar", value: "sidebar" }
        ],
        onChange: (val) => setAttributes({ layout: val })
      }
    ), /* @__PURE__ */ React.createElement(
      components.TextControl,
      {
        label: i18n.__("Button Text", "bookiflex"),
        value: buttonText,
        onChange: (val) => setAttributes({ buttonText: val }),
        help: i18n.__("Leave empty to use the locale default.", "bookiflex")
      }
    )), /* @__PURE__ */ React.createElement(components.PanelBody, { title: i18n.__("Guest Options", "bookiflex"), initialOpen: false }, /* @__PURE__ */ React.createElement(components.ToggleControl, { label: i18n.__("Hide Guests", "bookiflex"), checked: hideGuests, onChange: (val) => setAttributes({ hideGuests: val }) }), /* @__PURE__ */ React.createElement(components.ToggleControl, { label: i18n.__("Hide Children", "bookiflex"), checked: hideChildren, onChange: (val) => setAttributes({ hideChildren: val }) }), /* @__PURE__ */ React.createElement(components.ToggleControl, { label: i18n.__("Hide Promo Code", "bookiflex"), checked: hidePromo, onChange: (val) => setAttributes({ hidePromo: val }) }), /* @__PURE__ */ React.createElement(components.RangeControl, { label: i18n.__("Max Adults", "bookiflex"), value: maxAdults ?? 10, min: 1, max: 30, onChange: (val) => setAttributes({ maxAdults: val }) }), /* @__PURE__ */ React.createElement(components.RangeControl, { label: i18n.__("Max Children", "bookiflex"), value: maxChildren ?? 6, min: 0, max: 20, onChange: (val) => setAttributes({ maxChildren: val }) }), /* @__PURE__ */ React.createElement(components.RangeControl, { label: i18n.__("Max Child Age", "bookiflex"), value: maxChildAge ?? 17, min: 1, max: 25, onChange: (val) => setAttributes({ maxChildAge: val }) })), /* @__PURE__ */ React.createElement(components.PanelBody, { title: i18n.__("Appearance", "bookiflex"), initialOpen: false }, /* @__PURE__ */ React.createElement(
      components.SelectControl,
      {
        label: i18n.__("Load Preset", "bookiflex"),
        value: "",
        options: [
          { label: i18n.__("— choose preset —", "bookiflex"), value: "" },
          ...PRESETS.map((p) => ({ label: p.label, value: p.id }))
        ],
        onChange: applyPreset,
        help: i18n.__("Applies a predefined set of tokens. You can adjust individual values after.", "bookiflex")
      }
    ), /* @__PURE__ */ React.createElement("hr", { style: { margin: "12px 0", borderColor: "#e0e0e0" } }), /* @__PURE__ */ React.createElement(ColorTokenField, { label: i18n.__("Button Color", "bookiflex"), value: colorPrimary, onChange: (v) => setAttributes({ colorPrimary: v }) }), /* @__PURE__ */ React.createElement(ColorTokenField, { label: i18n.__("Button Hover Color", "bookiflex"), value: colorPrimaryHover, onChange: (v) => setAttributes({ colorPrimaryHover: v }) }), /* @__PURE__ */ React.createElement(ColorTokenField, { label: i18n.__("Button Text", "bookiflex"), value: colorOnPrimary, onChange: (v) => setAttributes({ colorOnPrimary: v }) }), /* @__PURE__ */ React.createElement(ColorTokenField, { label: i18n.__("Background", "bookiflex"), value: colorSurface, onChange: (v) => setAttributes({ colorSurface: v }), enableAlpha: true }), /* @__PURE__ */ React.createElement(ColorTokenField, { label: i18n.__("Text Color", "bookiflex"), value: colorOnSurface, onChange: (v) => setAttributes({ colorOnSurface: v }) }), /* @__PURE__ */ React.createElement(ColorTokenField, { label: i18n.__("Borders & Dividers", "bookiflex"), value: colorBorder, onChange: (v) => setAttributes({ colorBorder: v }) }), /* @__PURE__ */ React.createElement(ColorTokenField, { label: i18n.__("Labels & Hints", "bookiflex"), value: colorMuted, onChange: (v) => setAttributes({ colorMuted: v }) }), /* @__PURE__ */ React.createElement("hr", { style: { margin: "12px 0", borderColor: "#e0e0e0" } }), /* @__PURE__ */ React.createElement(components.TextControl, { label: i18n.__("Border Width", "bookiflex"), value: borderWidth, onChange: (v) => setAttributes({ borderWidth: v }), help: "--bflex-border-width · e.g. 1px" }), /* @__PURE__ */ React.createElement(components.TextControl, { label: i18n.__("Gap", "bookiflex"), value: gap, onChange: (v) => setAttributes({ gap: v }), help: "--bflex-gap · e.g. 0px" }), /* @__PURE__ */ React.createElement(components.TextControl, { label: i18n.__("Field Padding", "bookiflex"), value: fieldPadding, onChange: (v) => setAttributes({ fieldPadding: v }), help: "--bflex-field-padding · e.g. 12px 16px" }), /* @__PURE__ */ React.createElement(components.TextControl, { label: i18n.__("Font Family", "bookiflex"), value: fontFamily, onChange: (v) => setAttributes({ fontFamily: v }), help: "--bflex-font-family" }), /* @__PURE__ */ React.createElement(components.TextControl, { label: i18n.__("Font Size", "bookiflex"), value: fontSize, onChange: (v) => setAttributes({ fontSize: v }), help: "--bflex-font-size · e.g. 14px" }), /* @__PURE__ */ React.createElement(components.TextControl, { label: i18n.__("Button Text Transform", "bookiflex"), value: buttonTextTransform, onChange: (v) => setAttributes({ buttonTextTransform: v }), help: "--bflex-button-text-transform · e.g. uppercase" }), /* @__PURE__ */ React.createElement(components.TextControl, { label: i18n.__("Box Shadow", "bookiflex"), value: shadow, onChange: (v) => setAttributes({ shadow: v }), help: "--bflex-shadow" })), /* @__PURE__ */ React.createElement(components.PanelBody, { title: i18n.__("Border Radius", "bookiflex"), initialOpen: false }, /* @__PURE__ */ React.createElement(
      components.TextControl,
      {
        label: i18n.__("All Corners", "bookiflex"),
        value: radius,
        onChange: (v) => setAttributes({ radius: v }),
        help: "CSS value: e.g. 8px, 0.5rem → --bflex-radius"
      }
    ), /* @__PURE__ */ React.createElement(components.RangeControl, { label: i18n.__("Top Left (px)", "bookiflex"), value: radiusTl ?? 0, min: 0, max: 48, allowReset: true, onChange: (v) => setAttributes({ radiusTl: v }) }), /* @__PURE__ */ React.createElement(components.RangeControl, { label: i18n.__("Top Right (px)", "bookiflex"), value: radiusTr ?? 0, min: 0, max: 48, allowReset: true, onChange: (v) => setAttributes({ radiusTr: v }) }), /* @__PURE__ */ React.createElement(components.RangeControl, { label: i18n.__("Bottom Right (px)", "bookiflex"), value: radiusBr ?? 0, min: 0, max: 48, allowReset: true, onChange: (v) => setAttributes({ radiusBr: v }) }), /* @__PURE__ */ React.createElement(components.RangeControl, { label: i18n.__("Bottom Left (px)", "bookiflex"), value: radiusBl ?? 0, min: 0, max: 48, allowReset: true, onChange: (v) => setAttributes({ radiusBl: v }) })), /* @__PURE__ */ React.createElement(components.PanelBody, { title: i18n.__("Search Settings", "bookiflex"), initialOpen: false }, /* @__PURE__ */ React.createElement(
      components.SelectControl,
      {
        label: i18n.__("Search Results", "bookiflex"),
        value: submitMode,
        options: [
          { label: i18n.__("Modal Window", "bookiflex"), value: "event" },
          { label: i18n.__("On Page", "bookiflex"), value: "redirect" }
        ],
        onChange: (val) => setAttributes({ submitMode: val }),
        help: submitMode === "event" ? i18n.__("Search results will open in a modal window on the same page.", "bookiflex") : i18n.__("Visitor will be redirected to the selected page where results are displayed.", "bookiflex")
      }
    ), submitMode === "redirect" && /* @__PURE__ */ React.createElement(
      PageUrlSelect,
      {
        value: actionUrl,
        onChange: (val) => setAttributes({ actionUrl: val })
      }
    ))), /* @__PURE__ */ React.createElement("div", { ...blockProps }, /* @__PURE__ */ React.createElement(
      EditorPreview,
      {
        layout,
        locale,
        buttonText,
        hideGuests,
        hidePromo,
        cssVars
      }
    )));
  }
  blocks.registerBlockType(metadata.name, {
    ...metadata,
    edit: Edit,
    save: () => null
  });
})(wp.blocks, wp.element, wp.blockEditor, wp.components, wp.i18n, wp.data);
