import { w as t, av as e, dw as o, dM as n, 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-0c01125c.js";
import "./lodash-226cb5b1.js";
import { lA as c, lS as p, lR as $ } from "./ant-design-icons-14ab96af.js";
import "./loglevel-5e7e37fc.js";
import { useState as v, useRef as b, useEffect as y } from "react";
import { d as g } from "./styled-components-c6abe9a3.js";
import { M as h } from "./antd-97b654da.js";
import { S } from "./Segmented-136b3e00.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 I = [{ name: "backgroundColor", label: "background", backgroundColor: "backgroundColor", lineHeight: "1.5" }, { name: "color", label: "text", color: "color" }], j = { items: t(n(), [{ label: e("menuItem") + " 1", itemKey: o() }]), 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") }, f = 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, o2) => {
    const { hidden: n2, label: r2, icon: a2, items: i2, onEvent: m2 } = t3.getView();
    if (n2)
      return null;
    const l2 = e2 ? `${e2}-${o2}` : `${o2}`, 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 o2 = false, n2 = [];
  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 && (o2 = true, n2.push(l2)), m2 && m2.length > 0) {
      const t4 = w(m2, l2);
      t4.hasActive && (o2 = true, n2.push(...t4.activeKeys));
    }
  }), { hasActive: o2, activeKeys: n2 };
}
const x = s(new a(j, (t2) => {
  const e2 = t2.items, [o2, n2] = 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(f, { ref: d2, mode: "inline", onClick: (t3) => {
    n2(t3.key), ((t4, e3) => {
      const o3 = e3[0].split("-").map(Number);
      let n3 = t4, r3 = null;
      for (let t5 = 0; t5 < o3.length; t5++) {
        const e4 = o3[t5];
        if (n3[e4] && (r3 = n3[e4], t5 < o3.length - 1)) {
          const { items: t6 } = r3.getView();
          n3 = t6.filter((t7) => !t7.children.hidden.getView());
        }
      }
      if (r3) {
        const { onEvent: t5 } = r3.getView();
        t5("click");
      }
    })(e2, t3.keyPath);
  }, selectedKeys: s2.length > 0 ? s2 : [o2], items: l2, $navItemActiveStyle: t2.navItemActiveStyle, $navItemHoverStyle: t2.navItemHoverStyle, $navItemStyle: t2.navItemStyle, $height: r2, $width: i2 }) });
}).setPropertyViewFn((t2) => {
  const [o2, n2] = 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: o2, onChange: (t3) => n2(t3) })), "normal" === o2 && t2.navItemStyle.getPropertyView(), "hover" === o2 && t2.navItemHoverStyle.getPropertyView(), "active" === o2 && t2.navItemActiveStyle.getPropertyView()] })] });
}).build(), [new d("items", e("navigation.itemsDesc"))]);
export {
  x as NavColComp
};
