import { jsxs as r, jsx as e } from "react/jsx-runtime";
import { Button as i } from "../../../../../Button/Button.es.js";
import { ButtonEmphasis as w, ButtonStyle as f, ButtonSize as n } from "../../../../../Button/ButtonTypes.es.js";
import { Checkbox as b } from "../../../../../Checkbox/Checkbox.es.js";
import { TextInput as o } from "../../../../../TextInput/TextInput.es.js";
import v from "../../../../../../foundation/Icon/Generated/IconCheckMark20.es.js";
import { FormControl as a } from "../../../../../FormControl/FormControl.es.js";
import { FloatingModalWrapper as k } from "../../../../components/FloatingModal/FloatingModal.es.js";
const z = ({
  state: t,
  onTextChange: d,
  onUrlChange: m,
  onToggleTab: c,
  onCancel: s,
  onSave: h,
  isValidUrlOrEmpty: l,
  hasValues: p,
  testId: u,
  children: x
}) => /* @__PURE__ */ r(k, { "data-test-id": u, minWidth: "400px", padding: "28px", children: [
  /* @__PURE__ */ e(
    a,
    {
      label: {
        children: "Text",
        htmlFor: "linkText",
        required: !0
      },
      children: /* @__PURE__ */ e(o, { id: "linkText", value: t.text, placeholder: "Link Text", onChange: d })
    }
  ),
  x,
  /* @__PURE__ */ r("div", { className: "tw-pt-5", children: [
    /* @__PURE__ */ e(
      a,
      {
        label: {
          children: "URL",
          htmlFor: "url",
          required: !0
        },
        children: /* @__PURE__ */ e(
          o,
          {
            id: "url",
            value: t.url,
            placeholder: "https://example.com",
            focusOnMount: !0,
            onChange: m
          }
        )
      }
    ),
    !l() && /* @__PURE__ */ e("div", { className: "tw-text-red-65 tw-mt-3", children: "Please enter a valid URL." })
  ] }),
  /* @__PURE__ */ e("div", { className: "tw-pt-5", children: /* @__PURE__ */ e(b, { value: "new-tab", label: "Open in new tab", state: t.newTab, onChange: c }) }),
  /* @__PURE__ */ e("div", { className: "tw-mt-3", children: /* @__PURE__ */ r("div", { className: "tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10", children: [
    /* @__PURE__ */ e(
      i,
      {
        onClick: s,
        size: n.Medium,
        style: f.Default,
        emphasis: w.Default,
        children: "Cancel"
      }
    ),
    /* @__PURE__ */ e(
      i,
      {
        onClick: h,
        size: n.Medium,
        icon: /* @__PURE__ */ e(v, {}),
        disabled: !l() || !p,
        children: "Save"
      }
    )
  ] }) })
] });
export {
  z as InsertModal
};
//# sourceMappingURL=InsertModal.es.js.map
