import _extends from "@babel/runtime/helpers/extends";
import AlertMeta from "./alert/meta";
import AvatarMeta from "./avatar/meta";
import BadgeMeta from "./badge/meta";
import BalloonInnerMeta from "./balloon-inner/meta";
import BalloonMeta from "./balloon/meta";
import BoxMeta from "./box/meta";
import BreadcrumbItemMeta from "./breadcrumb-item/meta";
import BreadcrumbMeta from "./breadcrumb/meta";
import ButtonGroupMeta from "./button-group/meta";
import ButtonMeta from "./button/meta";
import CalendarMeta from "./calendar/meta";
import CardActionsMeta from "./card-actions/meta";
import CardBulletHeaderMeta from "./card-bullet-header/meta";
import CardCollaspeContentMeta from "./card-collaspe-content/meta";
import CardContentMeta from "./card-content/meta";
import CardDividerMeta from "./card-divider/meta";
import CardHeaderMeta from "./card-header/meta";
import CardMediaMeta from "./card-media/meta";
import CardMeta from "./card/meta";
import CascaderSelectMeta from "./cascader-select/meta";
import CascaderMeta from "./cascader/meta";
import CheckboxGroupMeta from "./checkbox-group/meta";
import CheckboxItemMeta from "./checkbox-item/meta";
import CheckboxMeta from "./checkbox/meta";
import CollapsePanelMeta from "./collapse-panel/meta";
import CollapseMeta from "./collapse/meta";
import DatePickerMeta from "./date-picker/meta";
import DialogMeta from "./dialog/meta";
import DivMeta from "./div/meta";
import DividerMeta from "./divider/meta";
import DrawerInnerMeta from "./drawer-inner/meta";
import DrawerMeta from "./drawer/meta";
import DropdownMeta from "./dropdown/meta";
import ErrorBoundaryMeta from "./error-boundary/meta";
import FieldMeta from "./field/meta";
import FormErrorMeta from "./form-error/meta";
import FormItemMeta from "./form-item/meta";
import FormResetMeta from "./form-reset/meta";
import FormSubmitMeta from "./form-submit/meta";
import FormMeta from "./form/meta";
import GroupMeta from "./group/meta";
import IconMeta from "./icon/meta";
import ImgMeta from "./img/meta";
import InnerMeta from "./inner/meta";
import InputGroupMeta from "./input-group/meta";
import InputPasswordMeta from "./input-password/meta";
import InputTextAreaMeta from "./input-text-area/meta";
import InputMeta from "./input/meta";
import LinkMeta from "./link/meta";
import ListItemMeta from "./list-item/meta";
import ListMeta from "./list/meta";
import LoadingMeta from "./loading/meta";
import MenuButtonMeta from "./menu-button/meta";
import MenuDividerMeta from "./menu-divider/meta";
import MenuGroupMeta from "./menu-group/meta";
import MenuItemMeta from "./menu-item/meta";
import MenuPopupItemMeta from "./menu-popup-item/meta";
import MenuMeta from "./menu/meta";
import MonthPickerMeta from "./month-picker/meta";
import NavItemMeta from "./nav-item/meta";
import NavMeta from "./nav/meta";
import NextTableMeta from "./next-table/meta";
import NextTextMeta from "./next-text/meta";
import NoteWrapperMeta from "./note-wrapper/meta";
import NumberPickerMeta from "./number-picker/meta";
import PageMeta from "./page/meta";
import PaginationMeta from "./pagination/meta";
import ParagraphMeta from "./paragraph/meta";
import PopupItemMeta from "./popup-item/meta";
import ProgressMeta from "./progress/meta";
import RadioGroupMeta from "./radio-group/meta";
import RadioItemMeta from "./radio-item/meta";
import RadioMeta from "./radio/meta";
import RangeCalendarMeta from "./range-calendar/meta";
import RangePickerMeta from "./range-picker/meta";
import RangeMeta from "./range/meta";
import RatingMeta from "./rating/meta";
import ResponsiveGridCellMeta from "./responsive-grid-cell/meta";
import ResponsiveGridMeta from "./responsive-grid/meta";
import RichTextMeta from "./rich-text/meta";
import SearchMeta from "./search/meta";
import SelectOptionMeta from "./select-option/meta";
import SelectMeta from "./select/meta";
import SliderMeta from "./slider/meta";
import SlotMeta from "./slot/meta";
import SplitButtonMeta from "./split-button/meta";
import StepItemMeta from "./step-item/meta";
import StepMeta from "./step/meta";
import SubMenuMeta from "./sub-menu/meta";
import SubNavMeta from "./sub-nav/meta";
import SwitchMeta from "./switch/meta";
import TabItemMeta from "./tab-item/meta";
import TabTabPaneMeta from "./tab-tab-pane/meta";
import TabMeta from "./tab/meta";
import TableColumnMeta from "./table-column/meta";
import TableMeta from "./table/meta";
import TagCloseableMeta from "./tag-closeable/meta";
import TagSelectableMeta from "./tag-selectable/meta";
import TagMeta from "./tag/meta";
import TimePickerMeta from "./time-picker/meta";
import TimelineItemMeta from "./timeline-item/meta";
import TimelineMeta from "./timeline/meta";
import ToastMeta from "./toast/meta";
import TooltipMeta from "./tooltip/meta";
import TransferMeta from "./transfer/meta";
import TreeNodeMeta from "./tree-node/meta";
import TreeSelectMeta from "./tree-select/meta";
import TreeMeta from "./tree/meta";
import TypographyTextMeta from "./typography-text/meta";
import TypographyMeta from "./typography/meta";
import UploadDraggerMeta from "./upload-dragger/meta";
import UploadListMeta from "./upload-list/meta";
import UploadSelecterMeta from "./upload-selecter/meta";
import UploadMeta from "./upload/meta";
import VideoMeta from "./video/meta";
import WeekPickerMeta from "./week-picker/meta";
import YearPickerMeta from "./year-picker/meta";
var componentCategorySort = {};
["通用", "导航", "信息输入", "信息展示", "信息反馈"].reverse().forEach(function (item, index) {
  componentCategorySort[item] = ++index;
});
function generateComponentList(components) {
  var componentList = [{
    title: '常用',
    icon: '',
    children: []
  }, {
    title: '容器',
    icon: '',
    children: []
  }, {
    title: '导航',
    icon: '',
    children: []
  }, {
    title: '内容',
    icon: '',
    children: []
  }, {
    title: 'Feedback 反馈',
    icon: '',
    children: []
  }];
  var groupMap = {
    原子组件: true
  };
  var compGroup = {};
  components.forEach(function (comp) {
    var category = comp.category || '其他';
    if (comp.group && !compGroup[comp.componentName]) {
      compGroup[comp.componentName] = comp.group;
    }
    if (comp.group && !groupMap[comp.group]) {
      groupMap[comp.group] = true;
    }
    var target = componentList.find(function (item) {
      return item.title === category;
    });
    if (!target) {
      target = {
        title: category,
        icon: '',
        children: []
      };
      componentList.push(target);
    }
    if (comp.snippets && comp.snippets.length) {
      target.children.push({
        componentName: comp.componentName,
        title: comp.title || comp.componentName,
        sort: {
          category: target.title,
          group: compGroup[comp.componentName] || '原子组件',
          priority: componentCategorySort[target.title] || 0
        },
        icon: '',
        "package": comp.npm.pkg,
        snippets: comp.snippets || []
      });
    }
  });
  return componentList;
}
function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
  if (packageName === void 0) {
    packageName = '@alilc/lowcode-materials';
  }
  if (version === void 0) {
    version = '1.2.0-beta.7';
  }
  if (basicLibraryVersion === void 0) {
    basicLibraryVersion = {
      "@alifd/next": "1.25.23",
      "@alifd/meet": "2.6.3",
      "antd": "4.17.3"
    };
  }
  if (!meta || !version) {
    return meta;
  }
  var npm = meta.npm;
  if (!npm) {
    return meta;
  }
  if (typeof basicLibraryVersion === 'object' && basicLibraryVersion[npm["package"]]) {
    meta.npm = _extends({}, npm, {
      version: basicLibraryVersion[npm["package"]]
    });
  } else if (npm["package"] === packageName) {
    meta.npm = _extends({}, npm, {
      version: version
    });
  }
  return meta;
}
var componentMetas = [AlertMeta, AvatarMeta, BadgeMeta, BalloonInnerMeta, BalloonMeta, BoxMeta, BreadcrumbItemMeta, BreadcrumbMeta, ButtonGroupMeta, ButtonMeta, CalendarMeta, CardActionsMeta, CardBulletHeaderMeta, CardCollaspeContentMeta, CardContentMeta, CardDividerMeta, CardHeaderMeta, CardMediaMeta, CardMeta, CascaderSelectMeta, CascaderMeta, CheckboxGroupMeta, CheckboxItemMeta, CheckboxMeta, CollapsePanelMeta, CollapseMeta, DatePickerMeta, DialogMeta, DivMeta, DividerMeta, DrawerInnerMeta, DrawerMeta, DropdownMeta, ErrorBoundaryMeta, FieldMeta, FormErrorMeta, FormItemMeta, FormResetMeta, FormSubmitMeta, FormMeta, GroupMeta, IconMeta, ImgMeta, InnerMeta, InputGroupMeta, InputPasswordMeta, InputTextAreaMeta, InputMeta, LinkMeta, ListItemMeta, ListMeta, LoadingMeta, MenuButtonMeta, MenuDividerMeta, MenuGroupMeta, MenuItemMeta, MenuPopupItemMeta, MenuMeta, MonthPickerMeta, NavItemMeta, NavMeta, NextTableMeta, NextTextMeta, NoteWrapperMeta, NumberPickerMeta, PageMeta, PaginationMeta, ParagraphMeta, PopupItemMeta, ProgressMeta, RadioGroupMeta, RadioItemMeta, RadioMeta, RangeCalendarMeta, RangePickerMeta, RangeMeta, RatingMeta, ResponsiveGridCellMeta, ResponsiveGridMeta, RichTextMeta, SearchMeta, SelectOptionMeta, SelectMeta, SliderMeta, SlotMeta, SplitButtonMeta, StepItemMeta, StepMeta, SubMenuMeta, SubNavMeta, SwitchMeta, TabItemMeta, TabTabPaneMeta, TabMeta, TableColumnMeta, TableMeta, TagCloseableMeta, TagSelectableMeta, TagMeta, TimePickerMeta, TimelineItemMeta, TimelineMeta, ToastMeta, TooltipMeta, TransferMeta, TreeNodeMeta, TreeSelectMeta, TreeMeta, TypographyTextMeta, TypographyMeta, UploadDraggerMeta, UploadListMeta, UploadSelecterMeta, UploadMeta, VideoMeta, WeekPickerMeta, YearPickerMeta];
var components = [];
var npmInfo = {};
componentMetas.forEach(function (meta) {
  if (Array.isArray(meta)) {
    components.push.apply(components, meta.map(function (item) {
      if (!item.npm) {
        var componentName = item.componentName;
        var names = componentName.split('.');
        var exportName = names[0],
          subName = names[1];
        item.npm = {
          exportName: exportName,
          main: '',
          destructuring: true,
          subName: names.length > 1 ? componentName.slice(componentName.indexOf('.') + 1) : subName
        };
      }
      item.npm = _extends({}, npmInfo, item.npm || {});
      return fillRealVersion(item);
    }));
  } else if (meta.components) {
    components.push.apply(components, meta.components.map(function (item) {
      if (!item.npm) {
        var componentName = item.componentName;
        var names = componentName.split('.');
        var exportName = names[0],
          subName = names[1];
        item.npm = {
          exportName: exportName,
          main: '',
          destructuring: true,
          subName: names.length > 1 ? componentName.slice(componentName.indexOf('.') + 1) : subName
        };
      }
      item.npm = _extends({}, npmInfo, item.npm || {});
      return fillRealVersion(item);
    }));
  } else {
    if (!meta.npm) {
      var componentName = meta.componentName;
      var names = componentName.split('.');
      var exportName = names[0],
        subName = names[1];
      meta.npm = {
        exportName: exportName,
        main: '',
        destructuring: true,
        subName: names.length > 1 ? componentName.slice(componentName.indexOf('.') + 1) : subName
      };
    }
    meta.npm = _extends({}, npmInfo, meta.npm || {});
    components.push(fillRealVersion(meta));
  }
});
var componentList = generateComponentList(components);
export { components, componentList };
var execCompile = !!true;
if (!execCompile) {
  window.AlilcLowcodeMaterialsMeta = {
    components: components,
    componentList: componentList
  };
}