import { createVNode, Fragment } from 'vue';
import { renderToString } from 'vue/server-renderer';
import * as index from '../../../components/index.mjs';
import '../index.mjs';
import { DatePicker } from '../../../components/date-picker/index.mjs';
import { createCache, StyleProvider } from '../StyleContext.mjs';
import { extractStyle as extractStyle$1 } from '../hooks/useStyleRegister/index.mjs';

const blackList = ["ConfigProvider", "Grid", "Tour", "SelectOptGroup", "SelectOption", "MentionsOption", "TreeNode", "TreeSelectNode", "LocaleProvider"];
const pickerMap = {
  MonthPicker: "month",
  WeekPicker: "week",
  QuarterPicker: "quarter"
};
const compChildNameMap = {
  MenuDivider: "Menu",
  MenuItem: "Menu",
  MenuItemGroup: "Menu",
  SubMenu: "Menu",
  TableColumn: "Table",
  TableColumnGroup: "Table",
  TableSummary: "Table",
  TableSummaryRow: "Table",
  TableSummaryCell: "Table",
  TabPane: "Tabs",
  TimelineItem: "Timeline"
};
function defaultNode() {
  return createVNode(Fragment, null, [Object.keys(index).filter((name) => !blackList.includes(name) && name[0] === name[0].toUpperCase()).map((compName) => {
    const Comp = index[compName];
    if (compName === "Dropdown") {
      return createVNode(Comp, {
        "key": compName,
        "menu": {
          items: []
        }
      }, {
        default: () => [createVNode("div", null, null)]
      });
    }
    if (compName === "Anchor")
      return createVNode(Comp, {
        "key": compName,
        "items": []
      }, null);
    if (compName in pickerMap) {
      const Comp2 = DatePicker;
      const type = pickerMap[compName];
      return createVNode(Comp2, {
        "key": compName,
        "picker": type
      }, null);
    }
    if (compName in compChildNameMap) {
      const ParentComp = index[compChildNameMap[compName]];
      return createVNode(ParentComp, null, {
        default: () => [createVNode(Comp, null, null)]
      });
    }
    if (compName === "QRCode" || compName === "Segmented") {
      return createVNode(Comp, {
        "key": compName,
        "value": ""
      }, {
        default: () => [createVNode("div", null, null)]
      });
    }
    return createVNode(Comp, {
      "key": compName
    }, null);
  })]);
}
function extractStyle(customTheme) {
  const cache = createCache();
  renderToString(createVNode(StyleProvider, {
    "cache": cache
  }, {
    default: () => [customTheme ? customTheme(defaultNode()) : defaultNode()]
  }));
  const styleText = extractStyle$1(cache, true);
  return styleText;
}

export { extractStyle };
//# sourceMappingURL=index.mjs.map
