"use strict";
/**
 * @desc 生成唯一样式名
 * @author denghuan
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.className = void 0;
const classnames_1 = __importDefault(require("classnames"));
/**
 * @param names: Original class name.
 * @returns Unique class name.
 */
exports.className = (() => {
    const classNameMap = new Map();
    return (...names) => {
        return classnames_1.default(names.map(n => {
            let className = classNameMap.get(n);
            let prefix = n.replace(/[aeiou]/g, '').slice(0, 2);
            if (prefix === '') {
                prefix = n.slice(0, 2);
            }
            if (!className) {
                className = `${prefix}-${Math.random().toString(36).slice(-6)}`;
                classNameMap.set(n, className);
            }
            return className;
        }));
    };
})();
