import { ad as e, ae as o, w as t, af as r, U as i, ag as a, ah as n, ai as m, aj as s, ak as l, al as p, a6 as c } from "./index-8935f1b4.js";
import "./lodash-226cb5b1.js";
import { lR as d, lA as h, lS as j } from "./ant-design-icons-14ab96af.js";
import "./loglevel-5e7e37fc.js";
import u, { memo as g, useState as x, useRef as v, useEffect as y } from "react";
import { d as w } from "./styled-components-c6abe9a3.js";
import { S as f } from "./Segmented-136b3e00.js";
import { D as $ } from "./antd-97b654da.js";
import "./axios-125479b5.js";
import "./redux-devtools-f8b1cd80.js";
import "./alasql-f59e855e.js";
import "./react-router-8d1fc2f1.js";
import "./fontawesome-89eb6278.js";
import "react-dom";
import "./dnd-kit-e67c9595.js";
import "./moment-d8baa15a.js";
import "./crypto-js-8020edb5.js";
import "./dayjs-7fc5ce65.js";
import "./numbro-48e81844.js";
import "./papaparse-088c0adc.js";
import "./uuid-82f303b2.js";
import "./supabase-2e4a9112.js";
import "./fetch-6a200310.js";
import "./react-draggable-fda4f1cb.js";
import "./remark-gfm-e9b5dec7.js";
import "./buffer-e20f80c8.js";
import "./rehype-raw-41b6145f.js";
import "./parse5-6476676e.js";
import "./rehype-sanitize-deb53e9a.js";
import "./simplebar-react-cab52c82.js";
import "./react-best-gradient-color-picker-812be7ee.js";
import "./ua-parser-js-1d18a3f8.js";
import "./clsx-469c2c43.js";
import "./codemirror-edf161cb.js";
import "./really-relaxed-json-e5391d6a.js";
import "./immer-c0428a8d.js";
import "./redux-saga-1b0a458d.js";
import "./hotkeys-js-0dddb21a.js";
import "./cnchar-8c3eaa86.js";
import "./react-documents-ae08f8b5.js";
import "./sql-formatter-69e8df59.js";
import "./rc-trigger-9e54e169.js";
import "./react-json-view-364658b4.js";
import "./qrcode-react-e4f7745b.js";
import "./katex-cda5b990.js";
import "./ecogis-maps-10bb29cf.js";
import "./devextreme-28d23085.js";
import "./exceljs-1678d36b.js";
import "./file-saver-es-c18fae8f.js";
const b = [{ name: "color", label: "Color", depName: "color", depType: l.CONTRAST_TEXT, transformer: p }, { name: "textSize", label: "Size", textSize: "30px" }], C = [{ value: "normal", label: "Normal" }, { value: "hover", label: "Hover" }], S = { options: e, iconStyle: o(b, "iconStyle"), itemTextSize: t(c, "14px"), itemTextWeight: t(c, "normal"), itemColor: t(r, "#222222"), itemIconWidth: t(c, "50px"), itemIconRadius: t(c, "0"), itemHoverTextWeight: t(c, "normal"), itemHoverColor: t(r, "#222222"), itemHoverBackgroundColor: r }, k = w.div`
  @media (max-width: 360px) {
    width: 15px;
    height: 15px;
  }
  width: ${(e2) => e2.$iconStyle.textSize};
  height: ${(e2) => e2.$iconStyle.textSize};
  line-height: ${(e2) => e2.$iconStyle.textSize};
  color: ${(e2) => e2.$iconStyle.color};
`, I = w.div`
  ul {
    display: flex;
    gap: 10px;

    li {
      padding: 0 !important;
    }
  }
`, z = w.div`
  text-align: ${(e2) => {
  var _a;
  return ((_a = e2.$style) == null ? void 0 : _a.align) || "left";
}};
  padding: 5px;
  font-weight: ${(e2) => {
  var _a, _b;
  return ((_a = e2.$style) == null ? void 0 : _a.fontWeight) ? ((_b = e2.$style) == null ? void 0 : _b.fontWeight) + "!important" : void 0;
}};

  img {
    border-radius: ${(e2) => {
  var _a, _b;
  return ((_a = e2.$style) == null ? void 0 : _a.iconRadius) ? (_b = e2.$style) == null ? void 0 : _b.iconRadius : void 0;
}};
  }

  p {
    color: ${(e2) => {
  var _a;
  return (_a = e2.$style) == null ? void 0 : _a.color;
}};
  }
  &:hover {
    background-color: ${(e2) => {
  var _a, _b;
  return ((_a = e2.$style) == null ? void 0 : _a.hoverBgColor) ? ((_b = e2.$style) == null ? void 0 : _b.hoverBgColor) + "!important" : void 0;
}};
    p {
      color: ${(e2) => {
  var _a;
  return (_a = e2.$style) == null ? void 0 : _a.hoverColor;
}};
    }
  }
  .menuItem-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: ${(e2) => {
  var _a;
  return (_a = e2.$style) == null ? void 0 : _a.fontSize;
}};
  }
  .menuItem-img {
    width: ${(e2) => {
  var _a;
  return (_a = e2.$style) == null ? void 0 : _a.iconWidth;
}};
    height: 50px;
  }
  @media (max-width: 360px) {
    .menuItem-text {
      font-size: 8px;
    }
    .menuItem-img {
      width: 20px;
      height: 20px;
    }
  }
  @media (min-width: 360px) and (max-width: 768px) {
    .menuItem-text {
      font-size: 10px;
    }
    .menuItem-img {
      width: "30px";
      height: "30px";
    }
  }
`, W = g((e2) => {
  var _a;
  const [o2, t2] = x(false);
  const r2 = v(null);
  var i2;
  y(() => {
    function e3(e4) {
      i2.current && !i2.current.contains(e4.target) && t2(false);
    }
    return document.addEventListener("mouseup", e3), () => {
      document.removeEventListener("mouseup", e3);
    };
  }, [i2 = r2]);
  const a2 = (_a = e2.options) == null ? void 0 : _a.map((o3, t3) => ({ key: t3, label: d(z, { $style: { align: o3.align, color: e2.itemColor, fontSize: e2.itemTextSize, fontWeight: e2.itemTextWeight, iconWidth: e2.itemIconWidth, iconRadius: e2.itemIconRadius, hoverColor: e2.itemHoverColor, hoverBgColor: e2.itemHoverBackgroundColor }, onClick: () => o3.onEvent("click"), children: ["" != (o3 == null ? void 0 : o3.icon) && h("img", { className: "menuItem-img", src: o3 == null ? void 0 : o3.icon, alt: "" }), h("p", { className: "menuItem-text", children: o3 == null ? void 0 : o3.label })] }, o3.label) }));
  return h(k, { onClick: () => t2(!o2), ref: r2, $iconStyle: e2.iconStyle, children: h($, { menu: { items: a2 }, popupRender: (e3) => h(I, { children: u.cloneElement(e3) }), open: o2, children: h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: h("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z" }) }) }) });
}), H = s(new i(S, (e2) => {
  const o2 = a({ ...e2 }, "HeaderMenuComp");
  return h(W, { ...o2 });
}).setPropertyViewFn((e2) => {
  const [o2, t2] = x("normal");
  return d(j, { children: [h(n, { name: "Basic", children: e2.options.propertyView({}) }), h(n, { name: "Icon", children: e2.iconStyle.getPropertyView() }), d(n, { name: "Menu Items", children: [m({}, h(f, { block: true, options: C, value: o2, onChange: (e3) => t2(e3) })), "normal" === o2 && e2.itemTextSize.propertyView({ label: "Font Size" }), "normal" === o2 && e2.itemColor.propertyView({ label: "Font Color" }), "normal" === o2 && e2.itemTextWeight.propertyView({ label: "Font Weight" }), "normal" === o2 && e2.itemIconWidth.propertyView({ label: "Icon Width" }), "normal" === o2 && e2.itemIconRadius.propertyView({ label: "Icon Radius" }), "hover" === o2 && e2.itemHoverColor.propertyView({ label: "Font Color" }), "hover" === o2 && e2.itemHoverBackgroundColor.propertyView({ label: "Background Color" })] })] });
}).build(), []);
export {
  H as HeaderMenuComp
};
