var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/iconSelect/utils.tsx
var utils_exports = {};
__export(utils_exports, {
  get: () => get,
  getAntdIconList: () => getAntdIconList,
  getIconList: () => getIconList
});
module.exports = __toCommonJS(utils_exports);
var import_react = __toESM(require("react"));
function get(obj, path, defaultValue) {
  if (!path) return defaultValue;
  const keys = path.split(".");
  let result = obj;
  for (const key of keys) {
    if (result == null) {
      return defaultValue;
    }
    result = result[key];
  }
  return result === void 0 ? defaultValue : result;
}
function getIconfontIconList() {
  const symbols = Array.prototype.slice.call(
    window.document.querySelectorAll(
      'svg[style="position: absolute; width: 0px; height: 0px; overflow: hidden;"][aria-hidden="true"] > symbol'
    )
  );
  return symbols.map((symbol) => {
    const { id } = symbol;
    return {
      name: id,
      group: "iconfont",
      icon: (props) => /* @__PURE__ */ import_react.default.createElement("span", { role: "img", className: "anticon" }, /* @__PURE__ */ import_react.default.createElement(
        "svg",
        {
          viewBox: "64 64 896 896",
          width: "1em",
          height: "1em",
          fill: "currentColor",
          dangerouslySetInnerHTML: { __html: symbol.innerHTML }
        }
      ))
    };
  });
}
function getAntdIconList() {
  const antdIcons = window.icons;
  return Object.keys(antdIcons).map((key) => {
    var _a;
    const item = antdIcons[key];
    if (typeof item !== "object") {
      return null;
    }
    const name = (item == null ? void 0 : item.displayName) ?? ((_a = item == null ? void 0 : item.render) == null ? void 0 : _a.displayName) ?? key;
    let group = "outlined";
    const lowercaseName = name.toLowerCase();
    if (/outlined$/.test(lowercaseName)) {
      group = "outlined";
    } else if (/filled$/.test(lowercaseName)) {
      group = "filled";
    } else if (/twotone$/.test(lowercaseName)) {
      group = "two-tone";
    } else {
      return null;
    }
    return {
      name,
      group,
      icon: item
    };
  }).filter(Boolean);
}
function getIconList() {
  const iconfontIconList = getIconfontIconList();
  const antdIconList = getAntdIconList();
  const allIcons = [...iconfontIconList, ...antdIconList];
  const uniqueIconsMap = /* @__PURE__ */ new Map();
  allIcons.forEach((icon) => {
    if (!uniqueIconsMap.has(icon.name)) {
      uniqueIconsMap.set(icon.name, icon);
    }
  });
  return Array.from(uniqueIconsMap.values());
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  get,
  getAntdIconList,
  getIconList
});
