import { w as t, av as e, dw as n, dM as o, ae as r, U as a, ah as i, dN as m, ai as l, aj as s, au as d, dO as u } from "./index-df8c00b4.js";
import "./lodash-f1e42446.js";
import { lA as c, lS as p, lR as $ } from "./ant-design-icons-b1480d8d.js";
import "./loglevel-6fb66d22.js";
import { useState as v, useRef as b, useEffect as y } from "react";
import { d as g } from "./styled-components-1e696d6b.js";
import { M as h } from "./antd-04a23d13.js";
import { S } from "./Segmented-63c0bebe.js";
import "./axios-84bb1c75.js";
import "./redux-devtools-d38e5b33.js";
import "./alasql-0ff6dabf.js";
import "./react-router-a1807b5b.js";
import "./fontawesome-2445f580.js";
import "react-dom";
import "./dnd-kit-56a2f36f.js";
import "./dayjs-844325ae.js";
import "./numbro-c1edb412.js";
import "./papaparse-1bac8e5f.js";
import "./uuid-82f303b2.js";
import "./supabase-c27c62e3.js";
import "./fetch-a3c8ad94.js";
import "./react-draggable-60f59f09.js";
import "./remark-gfm-f2973785.js";
import "./buffer-d3713d77.js";
import "./rehype-raw-41b6145f.js";
import "./parse5-6476676e.js";
import "./rehype-sanitize-deb53e9a.js";
import "./simplebar-react-e1b123a3.js";
import "./react-best-gradient-color-picker-4dd60dac.js";
import "./ua-parser-js-094f59ba.js";
import "./clsx-469c2c43.js";
import "./crypto-js-d5eac8ba.js";
import "./codemirror-73d8c217.js";
import "./really-relaxed-json-49b6a70d.js";
import "./immer-c0428a8d.js";
import "./redux-saga-5514e228.js";
import "./hotkeys-js-0dddb21a.js";
import "./cnchar-5678e6bc.js";
import "./react-documents-eb6de859.js";
import "./sql-formatter-69e8df59.js";
import "./rc-trigger-5125aafe.js";
import "./react-json-view-9403d8a1.js";
import "./qrcode-react-cb73d2b6.js";
import "./katex-a34f0265.js";
import "./ecogis-maps-bb0d63f9.js";
import "./devextreme-2fa5bb9a.js";
const I = [{ name: "backgroundColor", label: "background", backgroundColor: "backgroundColor", lineHeight: "1.5" }, { name: "color", label: "text", color: "color" }], f = { items: t(o(), [{ label: e("menuItem") + " 1", itemKey: n() }]), navItemStyle: r([{ name: "backgroundColor", label: "background", backgroundColor: "backgroundColor", lineHeight: "1.5" }, { name: "margin", label: "padding sub", margin: "padding" }, { name: "color", label: "text", color: "color" }, { name: "padding", label: "padding", padding: "padding" }, { name: "radius", label: "radius", radius: "radius", default: "10px" }, { name: "borderWidth", label: "margin bottom", borderWidth: "borderWidth" }, { name: "fontFamily", label: "font family", fontFamily: "fontFamily" }], "navItemStyle"), navItemHoverStyle: r(I, "navItemHoverStyle"), navItemActiveStyle: r(I, "navItemActiveStyle") }, j = g(h)`
  height: ${(t2) => t2.$height}px;
  background-color: transparent;
  border-right: none !important;
  
  @media only screen and (max-width: 768px) {
    .ant-menu-title-content {
      display: none;
    }
  }
  
  .ant-menu-title-content {
    margin-left: 10px;
  }
  
  &&& {
    .ant-menu-item::after,
    .ant-menu-item::before {
      display: none !important;
      opacity: 0 !important;
      border-right: none !important;
      right: auto !important;
      left: auto !important;
    }
  }
  
  &&& .ant-menu-item,
  &&& .ant-menu-submenu {
    margin-bottom: ${(t2) => t2.$navItemStyle.borderWidth};
    border-right: none !important;
  }
  
  &&& .ant-menu-item,
  &&& .ant-menu-submenu > .ant-menu-submenu-title {
    ${(t2) => t2.$width && t2.$width > 150 ? `padding-left: ${t2.$navItemStyle.padding} !important;` : "padding-left: 0 !important;"}
    background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
    color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.color;
}} !important;
    border-radius: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.radius;
}} !important;
    border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemStyle) == null ? void 0 : _a.border}`;
}} !important;
    font-family: ${(t2) => {
  var _a;
  return ((_a = t2.$navItemStyle) == null ? void 0 : _a.fontFamily) && `${t2.$navItemStyle.fontFamily} !important`;
}};
  }
  
  &&& .ant-menu-submenu > .ant-menu > .ant-menu-item {
    ${(t2) => t2.$width && t2.$width > 150 ? `padding-left: ${t2.$navItemStyle.margin} !important;` : "padding-left: 0 !important;"}
    background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
    color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.color;
}} !important;
    border-radius: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.radius;
}} !important;
    border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemStyle) == null ? void 0 : _a.border}`;
}} !important;
  }
  
  /* Multi-level submenu styling */
  &&& .ant-menu-submenu .ant-menu-submenu > .ant-menu > .ant-menu-item {
    background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
    color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.color;
}} !important;
    border-radius: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.radius;
}} !important;
    border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemStyle) == null ? void 0 : _a.border}`;
}} !important;
  }
  
  /* Handle deeper nesting levels */
  &&& .ant-menu-submenu .ant-menu-submenu .ant-menu-submenu > .ant-menu > .ant-menu-item {
    background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
    color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.color;
}} !important;
    border-radius: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.radius;
}} !important;
    border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemStyle) == null ? void 0 : _a.border}`;
}} !important;
  }
  
  &&& .ant-menu-title-content {
    ${(t2) => t2.$width && t2.$width < 150 ? "display: none;" : ""}
  }
  
  &&& .ant-menu-item > svg,
  &&& .ant-menu-submenu-title > svg {
    ${(t2) => t2.$width && t2.$width < 150 ? "width: 100% !important; height:50% !important" : ""}
  }
  
  &&& .ant-menu-item.ant-menu-item-active,
  &&& .ant-menu-item:hover {
    background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemHoverStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
    color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemHoverStyle) == null ? void 0 : _a.color;
}} !important;
    border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemHoverStyle) == null ? void 0 : _a.border}`;
}} !important;
  }
  
  &&& .ant-menu-item.ant-menu-item-selected {
    background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemActiveStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
    color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemActiveStyle) == null ? void 0 : _a.color;
}} !important;
    border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemActiveStyle) == null ? void 0 : _a.border}`;
}} !important;
  }

  &&& .ant-menu-submenu {
    .ant-menu-submenu-title {
      background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
      color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.color;
}} !important;
      border-radius: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.radius;
}} !important;
      border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemStyle) == null ? void 0 : _a.border}`;
}} !important;
      font-family: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.fontFamily;
}} !important;
    }

    &.ant-menu-submenu-active,
    &:hover {
      > .ant-menu-submenu-title {
        background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemHoverStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
        color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemHoverStyle) == null ? void 0 : _a.color;
}} !important;
        border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemHoverStyle) == null ? void 0 : _a.border}`;
}} !important;
      }
    }
    
    &.ant-menu-submenu-selected {
      > .ant-menu-submenu-title {
        background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemActiveStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
        color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemActiveStyle) == null ? void 0 : _a.color;
}} !important;
        border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemActiveStyle) == null ? void 0 : _a.border}`;
}} !important;
      }
    }

    .ant-menu-submenu {
      .ant-menu-submenu-title {
        background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
        color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.color;
}} !important;
        border-radius: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.radius;
}} !important;
        border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemStyle) == null ? void 0 : _a.border}`;
}} !important;
        font-family: ${(t2) => {
  var _a;
  return (_a = t2.$navItemStyle) == null ? void 0 : _a.fontFamily;
}} !important;
      }

      &.ant-menu-submenu-active,
      &:hover {
        > .ant-menu-submenu-title {
          background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemHoverStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
          color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemHoverStyle) == null ? void 0 : _a.color;
}} !important;
          border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemHoverStyle) == null ? void 0 : _a.border}`;
}} !important;
        }
      }
      
      &.ant-menu-submenu-selected {
        > .ant-menu-submenu-title {
          background-color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemActiveStyle) == null ? void 0 : _a.backgroundColor;
}} !important;
          color: ${(t2) => {
  var _a;
  return (_a = t2.$navItemActiveStyle) == null ? void 0 : _a.color;
}} !important;
          border: ${(t2) => {
  var _a;
  return `1px solid ${(_a = t2.$navItemActiveStyle) == null ? void 0 : _a.border}`;
}} !important;
        }
      }
    }
  }
`;
function k(t2, e2 = "") {
  return t2.map((t3, n2) => {
    const { hidden: o2, label: r2, icon: a2, items: i2, onEvent: m2 } = t3.getView();
    if (o2)
      return null;
    const l2 = e2 ? `${e2}-${n2}` : `${n2}`, s2 = (i2 == null ? void 0 : i2.filter((t4) => !t4.children.hidden.getView())) || [], d2 = { key: l2, label: r2, icon: a2, onClick: () => m2("click") };
    return s2.length > 0 && (d2.children = k(s2, l2)), d2;
  }).filter(Boolean);
}
function w(t2, e2 = "") {
  let n2 = false, o2 = [];
  return t2.forEach((t3, r2) => {
    const { hidden: a2, active: i2, items: m2 } = t3.getView();
    if (a2)
      return;
    const l2 = e2 ? `${e2}-${r2}` : `${r2}`;
    if (i2 && (n2 = true, o2.push(l2)), m2 && m2.length > 0) {
      const t4 = w(m2, l2);
      t4.hasActive && (n2 = true, o2.push(...t4.activeKeys));
    }
  }), { hasActive: n2, activeKeys: o2 };
}
const x = s(new a(f, (t2) => {
  const e2 = t2.items, [n2, o2] = v(), [r2, a2] = v(window.innerHeight), [i2, m2] = v(), l2 = k(e2), { activeKeys: s2 } = w(e2), d2 = b(null);
  return y(() => {
    if (d2.current) {
      const t3 = d2.current.menu.list.clientWidth;
      m2(t3);
    }
  }, [d2.current]), y(() => {
    const t3 = () => {
      a2(window.innerHeight);
    };
    return window.addEventListener("resize", t3), () => {
      window.removeEventListener("resize", t3);
    };
  }, [window.screen.height]), c(p, { children: c(j, { ref: d2, mode: "inline", onClick: (t3) => {
    o2(t3.key), ((t4, e3) => {
      const n3 = e3[0].split("-").map(Number);
      let o3 = t4, r3 = null;
      for (let t5 = 0; t5 < n3.length; t5++) {
        const e4 = n3[t5];
        if (o3[e4] && (r3 = o3[e4], t5 < n3.length - 1)) {
          const { items: t6 } = r3.getView();
          o3 = t6.filter((t7) => !t7.children.hidden.getView());
        }
      }
      if (r3) {
        const { onEvent: t5 } = r3.getView();
        t5("click");
      }
    })(e2, t3.keyPath);
  }, selectedKeys: s2.length > 0 ? s2 : [n2], items: l2, $navItemActiveStyle: t2.navItemActiveStyle, $navItemHoverStyle: t2.navItemHoverStyle, $navItemStyle: t2.navItemStyle, $height: r2, $width: i2 }) });
}).setPropertyViewFn((t2) => {
  const [n2, o2] = v("normal");
  return $(p, { children: [c(i, { name: "Menu", children: m(t2 == null ? void 0 : t2.items) }), $(i, { name: e("navLayout.navItemStyle"), children: [l({}, c(S, { block: true, options: u, value: n2, onChange: (t3) => o2(t3) })), "normal" === n2 && t2.navItemStyle.getPropertyView(), "hover" === n2 && t2.navItemHoverStyle.getPropertyView(), "active" === n2 && t2.navItemActiveStyle.getPropertyView()] })] });
}).build(), [new d("items", e("navigation.itemsDesc"))]);
export {
  x as NavColComp
};
