function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
import React from 'react';
export function get(obj, path, defaultValue) {
  // 处理路径为空的情况
  if (!path) return defaultValue;

  // 将路径分割成数组
  var keys = path.split('.');
  var result = obj;

  // 遍历路径
  var _iterator = _createForOfIteratorHelper(keys),
    _step;
  try {
    for (_iterator.s(); !(_step = _iterator.n()).done;) {
      var key = _step.value;
      // 如果当前结果是null或undefined,返回默认值
      if (result == null) {
        return defaultValue;
      }
      result = result[key];
    }

    // 如果最终结果是null或undefined,返回默认值
  } catch (err) {
    _iterator.e(err);
  } finally {
    _iterator.f();
  }
  return result === undefined ? defaultValue : result;
}
function getIconfontIconList() {
  // iconfont的js会在页面中添加svg元素
  var 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(function (symbol) {
    var id = symbol.id;
    return {
      name: id,
      group: 'iconfont',
      icon: function icon(props) {
        return /*#__PURE__*/React.createElement("span", {
          role: "img",
          className: "anticon"
        }, /*#__PURE__*/React.createElement("svg", {
          viewBox: "64 64 896 896",
          width: "1em",
          height: "1em",
          fill: "currentColor",
          dangerouslySetInnerHTML: {
            __html: symbol.innerHTML
          }
        }));
      }
    };
  });
}
export function getAntdIconList() {
  var antdIcons = window.icons;
  return Object.keys(antdIcons).map(function (key) {
    var _ref, _item$displayName, _item$render;
    var item = antdIcons[key];
    if (_typeof(item) !== 'object') {
      return null;
    }
    var name = (_ref = (_item$displayName = item === null || item === void 0 ? void 0 : item.displayName) !== null && _item$displayName !== void 0 ? _item$displayName : item === null || item === void 0 || (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.displayName) !== null && _ref !== void 0 ? _ref : key;
    var group = 'outlined';
    var 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: name,
      group: group,
      icon: item
    };
  }).filter(Boolean);
}
export function getIconList() {
  var iconfontIconList = getIconfontIconList();
  var antdIconList = getAntdIconList();
  var allIcons = [].concat(_toConsumableArray(iconfontIconList), _toConsumableArray(antdIconList));
  var uniqueIconsMap = new Map();
  allIcons.forEach(function (icon) {
    if (!uniqueIconsMap.has(icon.name)) {
      uniqueIconsMap.set(icon.name, icon);
    }
  });
  return Array.from(uniqueIconsMap.values());
}