antd
Version:
An enterprise-class UI design language and React components implementation
1,328 lines (1,196 loc) • 4.29 MB
JavaScript
/*!
*
* antd v5.16.1
*
* Copyright 2015-present, Alipay, Inc.
* All rights reserved.
*
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("react-dom"), require("dayjs"));
else if(typeof define === 'function' && define.amd)
define(["react", "react-dom", "dayjs"], factory);
else if(typeof exports === 'object')
exports["antd"] = factory(require("react"), require("react-dom"), require("dayjs"));
else
root["antd"] = factory(root["React"], root["ReactDOM"], root["dayjs"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom__, __WEBPACK_EXTERNAL_MODULE_dayjs__) {
return /******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./components sync recursive ^\\.\\/[^_][\\w-]+\\/style\\/index\\.tsx?$":
/*!***************************************************************!*\
!*** ./components/ sync ^\.\/[^_][\w-]+\/style\/index\.tsx?$ ***!
\***************************************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
var map = {
"./affix/style/index.ts": "./components/affix/style/index.ts",
"./alert/style/index.ts": "./components/alert/style/index.ts",
"./anchor/style/index.ts": "./components/anchor/style/index.ts",
"./app/style/index.ts": "./components/app/style/index.ts",
"./avatar/style/index.ts": "./components/avatar/style/index.ts",
"./back-top/style/index.ts": "./components/back-top/style/index.ts",
"./badge/style/index.ts": "./components/badge/style/index.ts",
"./breadcrumb/style/index.ts": "./components/breadcrumb/style/index.ts",
"./button/style/index.ts": "./components/button/style/index.ts",
"./calendar/style/index.ts": "./components/calendar/style/index.ts",
"./card/style/index.ts": "./components/card/style/index.ts",
"./carousel/style/index.ts": "./components/carousel/style/index.ts",
"./cascader/style/index.ts": "./components/cascader/style/index.ts",
"./checkbox/style/index.ts": "./components/checkbox/style/index.ts",
"./col/style/index.ts": "./components/col/style/index.ts",
"./collapse/style/index.ts": "./components/collapse/style/index.ts",
"./color-picker/style/index.ts": "./components/color-picker/style/index.ts",
"./config-provider/style/index.ts": "./components/config-provider/style/index.ts",
"./date-picker/style/index.ts": "./components/date-picker/style/index.ts",
"./descriptions/style/index.ts": "./components/descriptions/style/index.ts",
"./divider/style/index.ts": "./components/divider/style/index.ts",
"./drawer/style/index.ts": "./components/drawer/style/index.ts",
"./dropdown/style/index.ts": "./components/dropdown/style/index.ts",
"./empty/style/index.ts": "./components/empty/style/index.ts",
"./flex/style/index.ts": "./components/flex/style/index.ts",
"./float-button/style/index.ts": "./components/float-button/style/index.ts",
"./form/style/index.ts": "./components/form/style/index.ts",
"./grid/style/index.ts": "./components/grid/style/index.ts",
"./image/style/index.ts": "./components/image/style/index.ts",
"./input-number/style/index.ts": "./components/input-number/style/index.ts",
"./input/style/index.ts": "./components/input/style/index.ts",
"./layout/style/index.ts": "./components/layout/style/index.ts",
"./list/style/index.ts": "./components/list/style/index.ts",
"./mentions/style/index.ts": "./components/mentions/style/index.ts",
"./menu/style/index.ts": "./components/menu/style/index.ts",
"./message/style/index.ts": "./components/message/style/index.ts",
"./modal/style/index.ts": "./components/modal/style/index.ts",
"./notification/style/index.ts": "./components/notification/style/index.ts",
"./pagination/style/index.ts": "./components/pagination/style/index.ts",
"./popconfirm/style/index.ts": "./components/popconfirm/style/index.ts",
"./popover/style/index.ts": "./components/popover/style/index.ts",
"./progress/style/index.ts": "./components/progress/style/index.ts",
"./qr-code/style/index.ts": "./components/qr-code/style/index.ts",
"./qrcode/style/index.ts": "./components/qrcode/style/index.ts",
"./radio/style/index.ts": "./components/radio/style/index.ts",
"./rate/style/index.ts": "./components/rate/style/index.ts",
"./result/style/index.ts": "./components/result/style/index.ts",
"./row/style/index.ts": "./components/row/style/index.ts",
"./segmented/style/index.ts": "./components/segmented/style/index.ts",
"./select/style/index.ts": "./components/select/style/index.ts",
"./skeleton/style/index.ts": "./components/skeleton/style/index.ts",
"./slider/style/index.ts": "./components/slider/style/index.ts",
"./space/style/index.ts": "./components/space/style/index.ts",
"./spin/style/index.ts": "./components/spin/style/index.ts",
"./statistic/style/index.ts": "./components/statistic/style/index.ts",
"./steps/style/index.ts": "./components/steps/style/index.ts",
"./switch/style/index.ts": "./components/switch/style/index.ts",
"./table/style/index.ts": "./components/table/style/index.ts",
"./tabs/style/index.ts": "./components/tabs/style/index.ts",
"./tag/style/index.ts": "./components/tag/style/index.ts",
"./timeline/style/index.ts": "./components/timeline/style/index.ts",
"./tooltip/style/index.ts": "./components/tooltip/style/index.ts",
"./tour/style/index.ts": "./components/tour/style/index.ts",
"./transfer/style/index.ts": "./components/transfer/style/index.ts",
"./tree-select/style/index.ts": "./components/tree-select/style/index.ts",
"./tree/style/index.ts": "./components/tree/style/index.ts",
"./typography/style/index.ts": "./components/typography/style/index.ts",
"./upload/style/index.ts": "./components/upload/style/index.ts"
};
function webpackContext(req) {
var id = webpackContextResolve(req);
return __webpack_require__(id);
}
function webpackContextResolve(req) {
if(!__webpack_require__.o(map, req)) {
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
}
return map[req];
}
webpackContext.keys = function webpackContextKeys() {
return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = "./components sync recursive ^\\.\\/[^_][\\w-]+\\/style\\/index\\.tsx?$";
/***/ }),
/***/ "./node_modules/@ant-design/colors/es/index.js":
/*!*****************************************************************!*\
!*** ./node_modules/@ant-design/colors/es/index.js + 1 modules ***!
\*****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
blue: function() { return /* binding */ blue; },
generate: function() { return /* reexport */ generate; },
gold: function() { return /* binding */ gold; },
presetPrimaryColors: function() { return /* binding */ presetPrimaryColors; }
});
// UNUSED EXPORTS: cyan, geekblue, gray, green, grey, lime, magenta, orange, presetDarkPalettes, presetPalettes, purple, red, volcano, yellow
// EXTERNAL MODULE: ./node_modules/@ctrl/tinycolor/dist/module/conversion.js
var conversion = __webpack_require__("./node_modules/@ctrl/tinycolor/dist/module/conversion.js");
// EXTERNAL MODULE: ./node_modules/@ctrl/tinycolor/dist/module/format-input.js
var format_input = __webpack_require__("./node_modules/@ctrl/tinycolor/dist/module/format-input.js");
;// CONCATENATED MODULE: ./node_modules/@ant-design/colors/es/generate.js
var hueStep = 2; // 色相阶梯
var saturationStep = 0.16; // 饱和度阶梯,浅色部分
var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
var lightColorCount = 5; // 浅色数量,主色上
var darkColorCount = 4; // 深色数量,主色下
// 暗色主题颜色映射关系表
var darkColorMap = [{
index: 7,
opacity: 0.15
}, {
index: 6,
opacity: 0.25
}, {
index: 5,
opacity: 0.3
}, {
index: 5,
opacity: 0.45
}, {
index: 5,
opacity: 0.65
}, {
index: 5,
opacity: 0.85
}, {
index: 4,
opacity: 0.9
}, {
index: 3,
opacity: 0.95
}, {
index: 2,
opacity: 0.97
}, {
index: 1,
opacity: 0.98
}];
// Wrapper function ported from TinyColor.prototype.toHsv
// Keep it here because of `hsv.h * 360`
function toHsv(_ref) {
var r = _ref.r,
g = _ref.g,
b = _ref.b;
var hsv = (0,conversion.rgbToHsv)(r, g, b);
return {
h: hsv.h * 360,
s: hsv.s,
v: hsv.v
};
}
// Wrapper function ported from TinyColor.prototype.toHexString
// Keep it here because of the prefix `#`
function toHex(_ref2) {
var r = _ref2.r,
g = _ref2.g,
b = _ref2.b;
return "#".concat((0,conversion.rgbToHex)(r, g, b, false));
}
// Wrapper function ported from TinyColor.prototype.mix, not treeshakable.
// Amount in range [0, 1]
// Assume color1 & color2 has no alpha, since the following src code did so.
function mix(rgb1, rgb2, amount) {
var p = amount / 100;
var rgb = {
r: (rgb2.r - rgb1.r) * p + rgb1.r,
g: (rgb2.g - rgb1.g) * p + rgb1.g,
b: (rgb2.b - rgb1.b) * p + rgb1.b
};
return rgb;
}
function getHue(hsv, i, light) {
var hue;
// 根据色相不同,色相转向不同
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
} else {
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
}
if (hue < 0) {
hue += 360;
} else if (hue >= 360) {
hue -= 360;
}
return hue;
}
function getSaturation(hsv, i, light) {
// grey color don't change saturation
if (hsv.h === 0 && hsv.s === 0) {
return hsv.s;
}
var saturation;
if (light) {
saturation = hsv.s - saturationStep * i;
} else if (i === darkColorCount) {
saturation = hsv.s + saturationStep;
} else {
saturation = hsv.s + saturationStep2 * i;
}
// 边界值修正
if (saturation > 1) {
saturation = 1;
}
// 第一格的 s 限制在 0.06-0.1 之间
if (light && i === lightColorCount && saturation > 0.1) {
saturation = 0.1;
}
if (saturation < 0.06) {
saturation = 0.06;
}
return Number(saturation.toFixed(2));
}
function getValue(hsv, i, light) {
var value;
if (light) {
value = hsv.v + brightnessStep1 * i;
} else {
value = hsv.v - brightnessStep2 * i;
}
if (value > 1) {
value = 1;
}
return Number(value.toFixed(2));
}
function generate(color) {
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var patterns = [];
var pColor = (0,format_input.inputToRGB)(color);
for (var i = lightColorCount; i > 0; i -= 1) {
var hsv = toHsv(pColor);
var colorString = toHex((0,format_input.inputToRGB)({
h: getHue(hsv, i, true),
s: getSaturation(hsv, i, true),
v: getValue(hsv, i, true)
}));
patterns.push(colorString);
}
patterns.push(toHex(pColor));
for (var _i = 1; _i <= darkColorCount; _i += 1) {
var _hsv = toHsv(pColor);
var _colorString = toHex((0,format_input.inputToRGB)({
h: getHue(_hsv, _i),
s: getSaturation(_hsv, _i),
v: getValue(_hsv, _i)
}));
patterns.push(_colorString);
}
// dark theme patterns
if (opts.theme === 'dark') {
return darkColorMap.map(function (_ref3) {
var index = _ref3.index,
opacity = _ref3.opacity;
var darkColorString = toHex(mix((0,format_input.inputToRGB)(opts.backgroundColor || '#141414'), (0,format_input.inputToRGB)(patterns[index]), opacity * 100));
return darkColorString;
});
}
return patterns;
}
;// CONCATENATED MODULE: ./node_modules/@ant-design/colors/es/index.js
var presetPrimaryColors = {
red: '#F5222D',
volcano: '#FA541C',
orange: '#FA8C16',
gold: '#FAAD14',
yellow: '#FADB14',
lime: '#A0D911',
green: '#52C41A',
cyan: '#13C2C2',
blue: '#1677FF',
geekblue: '#2F54EB',
purple: '#722ED1',
magenta: '#EB2F96',
grey: '#666666'
};
var presetPalettes = {};
var presetDarkPalettes = {};
Object.keys(presetPrimaryColors).forEach(function (key) {
presetPalettes[key] = generate(presetPrimaryColors[key]);
presetPalettes[key].primary = presetPalettes[key][5];
// dark presetPalettes
presetDarkPalettes[key] = generate(presetPrimaryColors[key], {
theme: 'dark',
backgroundColor: '#141414'
});
presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
});
var red = presetPalettes.red;
var volcano = presetPalettes.volcano;
var gold = presetPalettes.gold;
var orange = presetPalettes.orange;
var yellow = presetPalettes.yellow;
var lime = presetPalettes.lime;
var green = presetPalettes.green;
var cyan = presetPalettes.cyan;
var blue = presetPalettes.blue;
var geekblue = presetPalettes.geekblue;
var purple = presetPalettes.purple;
var magenta = presetPalettes.magenta;
var grey = presetPalettes.grey;
var gray = presetPalettes.grey;
/***/ }),
/***/ "./node_modules/@ant-design/cssinjs/es/hooks/useHMR.js":
/*!*************************************************************!*\
!*** ./node_modules/@ant-design/cssinjs/es/hooks/useHMR.js ***!
\*************************************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* module decorator */ module = __webpack_require__.hmd(module);
function useProdHMR() {
return false;
}
var webpackHMR = false;
function useDevHMR() {
return webpackHMR;
}
/* harmony default export */ __webpack_exports__["default"] = ( false ? 0 : useDevHMR);
// Webpack `module.hot.accept` do not support any deps update trigger
// We have to hack handler to force mark as HRM
if ( true && module && module.hot && 0) { var originWebpackHotUpdate, win; }
/***/ }),
/***/ "./node_modules/@ant-design/cssinjs/es/index.js":
/*!*******************************************************************!*\
!*** ./node_modules/@ant-design/cssinjs/es/index.js + 34 modules ***!
\*******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Keyframes: function() { return /* reexport */ Keyframes; },
NaNLinter: function() { return /* reexport */ NaNLinter; },
StyleProvider: function() { return /* reexport */ StyleProvider; },
Theme: function() { return /* reexport */ Theme; },
_experimental: function() { return /* binding */ _experimental; },
createCache: function() { return /* reexport */ createCache; },
createTheme: function() { return /* reexport */ createTheme; },
extractStyle: function() { return /* reexport */ extractStyle; },
getComputedToken: function() { return /* reexport */ getComputedToken; },
legacyLogicalPropertiesTransformer: function() { return /* reexport */ legacyLogicalProperties; },
legacyNotSelectorLinter: function() { return /* reexport */ legacyNotSelectorLinter; },
logicalPropertiesLinter: function() { return /* reexport */ logicalPropertiesLinter; },
parentSelectorLinter: function() { return /* reexport */ parentSelectorLinter; },
px2remTransformer: function() { return /* reexport */ px2rem; },
token2CSSVar: function() { return /* reexport */ token2CSSVar; },
unit: function() { return /* reexport */ unit; },
useCSSVarRegister: function() { return /* reexport */ hooks_useCSSVarRegister; },
useCacheToken: function() { return /* reexport */ useCacheToken; },
useStyleRegister: function() { return /* reexport */ useStyleRegister; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
var toConsumableArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
var objectSpread2 = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
;// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js
/* eslint-disable */
// Inspired by https://github.com/garycourt/murmurhash-js
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
function murmur2(str) {
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
// const m = 0x5bd1e995;
// const r = 24;
// Initialize the hash
var h = 0; // Mix 4 bytes at a time into the hash
var k,
i = 0,
len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
k =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
k ^=
/* k >>> r: */
k >>> 24;
h =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Handle the last few bytes of the input array
switch (len) {
case 3:
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
case 1:
h ^= str.charCodeAt(i) & 0xff;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.
h ^= h >>> 13;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
/* harmony default export */ var hash_browser_esm = (murmur2);
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/dynamicCSS.js
var dynamicCSS = __webpack_require__("./node_modules/rc-util/es/Dom/dynamicCSS.js");
// EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("react");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
var objectWithoutProperties = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
// EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMemo.js
var useMemo = __webpack_require__("./node_modules/rc-util/es/hooks/useMemo.js");
// EXTERNAL MODULE: ./node_modules/rc-util/es/isEqual.js
var isEqual = __webpack_require__("./node_modules/rc-util/es/isEqual.js");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
var classCallCheck = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
var createClass = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createClass.js");
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/Cache.js
// [times, realValue]
var SPLIT = '%';
/** Connect key with `SPLIT` */
function pathKey(keys) {
return keys.join(SPLIT);
}
var Entity = /*#__PURE__*/function () {
function Entity(instanceId) {
(0,classCallCheck["default"])(this, Entity);
(0,defineProperty["default"])(this, "instanceId", void 0);
/** @private Internal cache map. Do not access this directly */
(0,defineProperty["default"])(this, "cache", new Map());
this.instanceId = instanceId;
}
(0,createClass["default"])(Entity, [{
key: "get",
value: function get(keys) {
return this.opGet(pathKey(keys));
}
/** A fast get cache with `get` concat. */
}, {
key: "opGet",
value: function opGet(keyPathStr) {
return this.cache.get(keyPathStr) || null;
}
}, {
key: "update",
value: function update(keys, valueFn) {
return this.opUpdate(pathKey(keys), valueFn);
}
/** A fast get cache with `get` concat. */
}, {
key: "opUpdate",
value: function opUpdate(keyPathStr, valueFn) {
var prevValue = this.cache.get(keyPathStr);
var nextValue = valueFn(prevValue);
if (nextValue === null) {
this.cache.delete(keyPathStr);
} else {
this.cache.set(keyPathStr, nextValue);
}
}
}]);
return Entity;
}();
/* harmony default export */ var Cache = (Entity);
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/StyleContext.js
var _excluded = ["children"];
var ATTR_TOKEN = 'data-token-hash';
var ATTR_MARK = 'data-css-hash';
var ATTR_CACHE_PATH = 'data-cache-path';
// Mark css-in-js instance in style element
var CSS_IN_JS_INSTANCE = '__cssinjs_instance__';
function createCache() {
var cssinjsInstanceId = Math.random().toString(12).slice(2);
// Tricky SSR: Move all inline style to the head.
// PS: We do not recommend tricky mode.
if (typeof document !== 'undefined' && document.head && document.body) {
var styles = document.body.querySelectorAll("style[".concat(ATTR_MARK, "]")) || [];
var firstChild = document.head.firstChild;
Array.from(styles).forEach(function (style) {
style[CSS_IN_JS_INSTANCE] = style[CSS_IN_JS_INSTANCE] || cssinjsInstanceId;
// Not force move if no head
if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
document.head.insertBefore(style, firstChild);
}
});
// Deduplicate of moved styles
var styleHash = {};
Array.from(document.querySelectorAll("style[".concat(ATTR_MARK, "]"))).forEach(function (style) {
var hash = style.getAttribute(ATTR_MARK);
if (styleHash[hash]) {
if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
var _style$parentNode;
(_style$parentNode = style.parentNode) === null || _style$parentNode === void 0 || _style$parentNode.removeChild(style);
}
} else {
styleHash[hash] = true;
}
});
}
return new Cache(cssinjsInstanceId);
}
var StyleContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
hashPriority: 'low',
cache: createCache(),
defaultCache: true
});
var StyleProvider = function StyleProvider(props) {
var children = props.children,
restProps = (0,objectWithoutProperties["default"])(props, _excluded);
var parentContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(StyleContext);
var context = (0,useMemo["default"])(function () {
var mergedContext = (0,objectSpread2["default"])({}, parentContext);
Object.keys(restProps).forEach(function (key) {
var value = restProps[key];
if (restProps[key] !== undefined) {
mergedContext[key] = value;
}
});
var cache = restProps.cache;
mergedContext.cache = mergedContext.cache || createCache();
mergedContext.defaultCache = !cache && parentContext.defaultCache;
return mergedContext;
}, [parentContext, restProps], function (prev, next) {
return !(0,isEqual["default"])(prev[0], next[0], true) || !(0,isEqual["default"])(prev[1], next[1], true);
});
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(StyleContext.Provider, {
value: context
}, children);
};
/* harmony default export */ var es_StyleContext = (StyleContext);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
var esm_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/canUseDom.js
var canUseDom = __webpack_require__("./node_modules/rc-util/es/Dom/canUseDom.js");
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/theme/ThemeCache.js
// ================================== Cache ==================================
function sameDerivativeOption(left, right) {
if (left.length !== right.length) {
return false;
}
for (var i = 0; i < left.length; i++) {
if (left[i] !== right[i]) {
return false;
}
}
return true;
}
var ThemeCache = /*#__PURE__*/function () {
function ThemeCache() {
(0,classCallCheck["default"])(this, ThemeCache);
(0,defineProperty["default"])(this, "cache", void 0);
(0,defineProperty["default"])(this, "keys", void 0);
(0,defineProperty["default"])(this, "cacheCallTimes", void 0);
this.cache = new Map();
this.keys = [];
this.cacheCallTimes = 0;
}
(0,createClass["default"])(ThemeCache, [{
key: "size",
value: function size() {
return this.keys.length;
}
}, {
key: "internalGet",
value: function internalGet(derivativeOption) {
var _cache2, _cache3;
var updateCallTimes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var cache = {
map: this.cache
};
derivativeOption.forEach(function (derivative) {
if (!cache) {
cache = undefined;
} else {
var _cache;
cache = (_cache = cache) === null || _cache === void 0 || (_cache = _cache.map) === null || _cache === void 0 ? void 0 : _cache.get(derivative);
}
});
if ((_cache2 = cache) !== null && _cache2 !== void 0 && _cache2.value && updateCallTimes) {
cache.value[1] = this.cacheCallTimes++;
}
return (_cache3 = cache) === null || _cache3 === void 0 ? void 0 : _cache3.value;
}
}, {
key: "get",
value: function get(derivativeOption) {
var _this$internalGet;
return (_this$internalGet = this.internalGet(derivativeOption, true)) === null || _this$internalGet === void 0 ? void 0 : _this$internalGet[0];
}
}, {
key: "has",
value: function has(derivativeOption) {
return !!this.internalGet(derivativeOption);
}
}, {
key: "set",
value: function set(derivativeOption, value) {
var _this = this;
// New cache
if (!this.has(derivativeOption)) {
if (this.size() + 1 > ThemeCache.MAX_CACHE_SIZE + ThemeCache.MAX_CACHE_OFFSET) {
var _this$keys$reduce = this.keys.reduce(function (result, key) {
var _result = (0,slicedToArray["default"])(result, 2),
callTimes = _result[1];
if (_this.internalGet(key)[1] < callTimes) {
return [key, _this.internalGet(key)[1]];
}
return result;
}, [this.keys[0], this.cacheCallTimes]),
_this$keys$reduce2 = (0,slicedToArray["default"])(_this$keys$reduce, 1),
targetKey = _this$keys$reduce2[0];
this.delete(targetKey);
}
this.keys.push(derivativeOption);
}
var cache = this.cache;
derivativeOption.forEach(function (derivative, index) {
if (index === derivativeOption.length - 1) {
cache.set(derivative, {
value: [value, _this.cacheCallTimes++]
});
} else {
var cacheValue = cache.get(derivative);
if (!cacheValue) {
cache.set(derivative, {
map: new Map()
});
} else if (!cacheValue.map) {
cacheValue.map = new Map();
}
cache = cache.get(derivative).map;
}
});
}
}, {
key: "deleteByPath",
value: function deleteByPath(currentCache, derivatives) {
var cache = currentCache.get(derivatives[0]);
if (derivatives.length === 1) {
var _cache$value;
if (!cache.map) {
currentCache.delete(derivatives[0]);
} else {
currentCache.set(derivatives[0], {
map: cache.map
});
}
return (_cache$value = cache.value) === null || _cache$value === void 0 ? void 0 : _cache$value[0];
}
var result = this.deleteByPath(cache.map, derivatives.slice(1));
if ((!cache.map || cache.map.size === 0) && !cache.value) {
currentCache.delete(derivatives[0]);
}
return result;
}
}, {
key: "delete",
value: function _delete(derivativeOption) {
// If cache exists
if (this.has(derivativeOption)) {
this.keys = this.keys.filter(function (item) {
return !sameDerivativeOption(item, derivativeOption);
});
return this.deleteByPath(this.cache, derivativeOption);
}
return undefined;
}
}]);
return ThemeCache;
}();
(0,defineProperty["default"])(ThemeCache, "MAX_CACHE_SIZE", 20);
(0,defineProperty["default"])(ThemeCache, "MAX_CACHE_OFFSET", 5);
// EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
var warning = __webpack_require__("./node_modules/rc-util/es/warning.js");
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/theme/Theme.js
var uuid = 0;
/**
* Theme with algorithms to derive tokens from design tokens.
* Use `createTheme` first which will help to manage the theme instance cache.
*/
var Theme = /*#__PURE__*/function () {
function Theme(derivatives) {
(0,classCallCheck["default"])(this, Theme);
(0,defineProperty["default"])(this, "derivatives", void 0);
(0,defineProperty["default"])(this, "id", void 0);
this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives];
this.id = uuid;
if (derivatives.length === 0) {
(0,warning.warning)(derivatives.length > 0, '[Ant Design CSS-in-JS] Theme should have at least one derivative function.');
}
uuid += 1;
}
(0,createClass["default"])(Theme, [{
key: "getDerivativeToken",
value: function getDerivativeToken(token) {
return this.derivatives.reduce(function (result, derivative) {
return derivative(token, result);
}, undefined);
}
}]);
return Theme;
}();
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/theme/createTheme.js
var cacheThemes = new ThemeCache();
/**
* Same as new Theme, but will always return same one if `derivative` not changed.
*/
function createTheme(derivatives) {
var derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives];
// Create new theme if not exist
if (!cacheThemes.has(derivativeArr)) {
cacheThemes.set(derivativeArr, new Theme(derivativeArr));
}
// Get theme from cache and return
return cacheThemes.get(derivativeArr);
}
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/theme/index.js
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/util/index.js
// Create a cache for memo concat
var resultCache = new WeakMap();
var RESULT_VALUE = {};
function memoResult(callback, deps) {
var current = resultCache;
for (var i = 0; i < deps.length; i += 1) {
var dep = deps[i];
if (!current.has(dep)) {
current.set(dep, new WeakMap());
}
current = current.get(dep);
}
if (!current.has(RESULT_VALUE)) {
current.set(RESULT_VALUE, callback());
}
return current.get(RESULT_VALUE);
}
// Create a cache here to avoid always loop generate
var flattenTokenCache = new WeakMap();
/**
* Flatten token to string, this will auto cache the result when token not change
*/
function flattenToken(token) {
var str = flattenTokenCache.get(token) || '';
if (!str) {
Object.keys(token).forEach(function (key) {
var value = token[key];
str += key;
if (value instanceof Theme) {
str += value.id;
} else if (value && (0,esm_typeof["default"])(value) === 'object') {
str += flattenToken(value);
} else {
str += value;
}
});
// Put in cache
flattenTokenCache.set(token, str);
}
return str;
}
/**
* Convert derivative token to key string
*/
function token2key(token, salt) {
return hash_browser_esm("".concat(salt, "_").concat(flattenToken(token)));
}
var randomSelectorKey = "random-".concat(Date.now(), "-").concat(Math.random()).replace(/\./g, '');
// Magic `content` for detect selector support
var checkContent = '_bAmBoO_';
function supportSelector(styleStr, handleElement, supportCheck) {
if ((0,canUseDom["default"])()) {
var _getComputedStyle$con, _ele$parentNode;
(0,dynamicCSS.updateCSS)(styleStr, randomSelectorKey);
var _ele = document.createElement('div');
_ele.style.position = 'fixed';
_ele.style.left = '0';
_ele.style.top = '0';
handleElement === null || handleElement === void 0 || handleElement(_ele);
document.body.appendChild(_ele);
if (true) {
_ele.innerHTML = 'Test';
_ele.style.zIndex = '9999999';
}
var support = supportCheck ? supportCheck(_ele) : (_getComputedStyle$con = getComputedStyle(_ele).content) === null || _getComputedStyle$con === void 0 ? void 0 : _getComputedStyle$con.includes(checkContent);
(_ele$parentNode = _ele.parentNode) === null || _ele$parentNode === void 0 || _ele$parentNode.removeChild(_ele);
(0,dynamicCSS.removeCSS)(randomSelectorKey);
return support;
}
return false;
}
var canLayer = undefined;
function supportLayer() {
if (canLayer === undefined) {
canLayer = supportSelector("@layer ".concat(randomSelectorKey, " { .").concat(randomSelectorKey, " { content: \"").concat(checkContent, "\"!important; } }"), function (ele) {
ele.className = randomSelectorKey;
});
}
return canLayer;
}
var canWhere = undefined;
function supportWhere() {
if (canWhere === undefined) {
canWhere = supportSelector(":where(.".concat(randomSelectorKey, ") { content: \"").concat(checkContent, "\"!important; }"), function (ele) {
ele.className = randomSelectorKey;
});
}
return canWhere;
}
var canLogic = undefined;
function supportLogicProps() {
if (canLogic === undefined) {
canLogic = supportSelector(".".concat(randomSelectorKey, " { inset-block: 93px !important; }"), function (ele) {
ele.className = randomSelectorKey;
}, function (ele) {
return getComputedStyle(ele).bottom === '93px';
});
}
return canLogic;
}
var isClientSide = (0,canUseDom["default"])();
function unit(num) {
if (typeof num === 'number') {
return "".concat(num, "px");
}
return num;
}
function toStyleStr(style, tokenKey, styleId) {
var _objectSpread2;
var customizeAttrs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var plain = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
if (plain) {
return style;
}
var attrs = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, customizeAttrs), {}, (_objectSpread2 = {}, (0,defineProperty["default"])(_objectSpread2, ATTR_TOKEN, tokenKey), (0,defineProperty["default"])(_objectSpread2, ATTR_MARK, styleId), _objectSpread2));
var attrStr = Object.keys(attrs).map(function (attr) {
var val = attrs[attr];
return val ? "".concat(attr, "=\"").concat(val, "\"") : null;
}).filter(function (v) {
return v;
}).join(' ');
return "<style ".concat(attrStr, ">").concat(style, "</style>");
}
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/util/css-variables.js
var token2CSSVar = function token2CSSVar(token) {
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return "--".concat(prefix ? "".concat(prefix, "-") : '').concat(token).replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/([A-Z]+)([A-Z][a-z0-9]+)/g, '$1-$2').replace(/([a-z])([A-Z0-9])/g, '$1-$2').toLowerCase();
};
var serializeCSSVar = function serializeCSSVar(cssVars, hashId, options) {
if (!Object.keys(cssVars).length) {
return '';
}
return ".".concat(hashId).concat(options !== null && options !== void 0 && options.scope ? ".".concat(options.scope) : '', "{").concat(Object.entries(cssVars).map(function (_ref) {
var _ref2 = (0,slicedToArray["default"])(_ref, 2),
key = _ref2[0],
value = _ref2[1];
return "".concat(key, ":").concat(value, ";");
}).join(''), "}");
};
var transformToken = function transformToken(token, themeKey, config) {
var cssVars = {};
var result = {};
Object.entries(token).forEach(function (_ref3) {
var _config$preserve, _config$ignore;
var _ref4 = (0,slicedToArray["default"])(_ref3, 2),
key = _ref4[0],
value = _ref4[1];
if (config !== null && config !== void 0 && (_config$preserve = config.preserve) !== null && _config$preserve !== void 0 && _config$preserve[key]) {
result[key] = value;
} else if ((typeof value === 'string' || typeof value === 'number') && !(config !== null && config !== void 0 && (_config$ignore = config.ignore) !== null && _config$ignore !== void 0 && _config$ignore[key])) {
var _config$unitless;
var cssVar = token2CSSVar(key, config === null || config === void 0 ? void 0 : config.prefix);
cssVars[cssVar] = typeof value === 'number' && !(config !== null && config !== void 0 && (_config$unitless = config.unitless) !== null && _config$unitless !== void 0 && _config$unitless[key]) ? "".concat(value, "px") : String(value);
result[key] = "var(".concat(cssVar, ")");
}
});
return [result, serializeCSSVar(cssVars, themeKey, {
scope: config === null || config === void 0 ? void 0 : config.scope
})];
};
// EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useLayoutEffect.js
var useLayoutEffect = __webpack_require__("./node_modules/rc-util/es/hooks/useLayoutEffect.js");
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/hooks/useCompatibleInsertionEffect.js
// import canUseDom from 'rc-util/lib/Dom/canUseDom';
// We need fully clone React function here
// to avoid webpack warning React 17 do not export `useId`
var fullClone = (0,objectSpread2["default"])({}, external_root_React_commonjs2_react_commonjs_react_amd_react_);
var useInsertionEffect = fullClone.useInsertionEffect;
/**
* Polyfill `useInsertionEffect` for React < 18
* @param renderEffect will be executed in `useMemo`, and do not have callback
* @param effect will be executed in `useLayoutEffect`
* @param deps
*/
var useInsertionEffectPolyfill = function useInsertionEffectPolyfill(renderEffect, effect, deps) {
external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(renderEffect, deps);
(0,useLayoutEffect["default"])(function () {
return effect(true);
}, deps);
};
/**
* Compatible `useInsertionEffect`
* will use `useInsertionEffect` if React version >= 18,
* otherwise use `useInsertionEffectPolyfill`.
*/
var useCompatibleInsertionEffect = useInsertionEffect ? function (renderEffect, effect, deps) {
return useInsertionEffect(function () {
renderEffect();
return effect();
}, deps);
} : useInsertionEffectPolyfill;
/* harmony default export */ var hooks_useCompatibleInsertionEffect = (useCompatibleInsertionEffect);
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/hooks/useEffectCleanupRegister.js
var useEffectCleanupRegister_fullClone = (0,objectSpread2["default"])({}, external_root_React_commonjs2_react_commonjs_react_amd_react_);
var useEffectCleanupRegister_useInsertionEffect = useEffectCleanupRegister_fullClone.useInsertionEffect;
// DO NOT register functions in useEffect cleanup function, or functions that registered will never be called.
var useCleanupRegister = function useCleanupRegister(deps) {
var effectCleanups = [];
var cleanupFlag = false;
function register(fn) {
if (cleanupFlag) {
if (true) {
(0,warning.warning)(false, '[Ant Design CSS-in-JS] You are registering a cleanup function after unmount, which will not have any effect.');
}
return;
}
effectCleanups.push(fn);
}
external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
// Compatible with strict mode
cleanupFlag = false;
return function () {
cleanupFlag = true;
if (effectCleanups.length) {
effectCleanups.forEach(function (fn) {
return fn();
});
}
};
}, deps);
return register;
};
var useRun = function useRun() {
return function (fn) {
fn();
};
};
// Only enable register in React 18
var useEffectCleanupRegister = typeof useEffectCleanupRegister_useInsertionEffect !== 'undefined' ? useCleanupRegister : useRun;
/* harmony default export */ var hooks_useEffectCleanupRegister = (useEffectCleanupRegister);
// EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs/es/hooks/useHMR.js
var useHMR = __webpack_require__("./node_modules/@ant-design/cssinjs/es/hooks/useHMR.js");
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/hooks/useGlobalCache.js
function useGlobalCache(prefix, keyPath, cacheFn, onCacheRemove,
// Add additional effect trigger by `useInsertionEffect`
onCacheEffect) {
var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_StyleContext),
globalCache = _React$useContext.cache;
var fullPath = [prefix].concat((0,toConsumableArray["default"])(keyPath));
var fullPathStr = pathKey(fullPath);
var register = hooks_useEffectCleanupRegister([fullPathStr]);
var HMRUpdate = (0,useHMR["default"])();
var buildCache = function buildCache(updater) {
globalCache.opUpdate(fullPathStr, function (prevCache) {
var _ref = prevCache || [undefined, undefined],
_ref2 = (0,slicedToArray["default"])(_ref, 2),
_ref2$ = _ref2[0],
times = _ref2$ === void 0 ? 0 : _ref2$,
cache = _ref2[1];
// HMR should always ignore cache since developer may change it
var tmpCache = cache;
if ( true && cache && HMRUpdate) {
onCacheRemove === null || onCacheRemove === void 0 || onCacheRemove(tmpCache, HMRUpdate);
tmpCache = null;
}
var mergedCache = tmpCache || cacheFn();
var data = [times, mergedCache];
// Call updater if need additional logic
return updater ? updater(data) : data;
});
};
// Create cache
external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
buildCache();
}, /* eslint-disable react-hooks/exhaustive-deps */
[fullPathStr]
/* eslint-enable */);
var cacheEntity = globalCache.opGet(fullPathStr);
// HMR clean the cache but not trigger `useMemo` again
// Let's fallback of this
// ref https://github.com/ant-design/cssinjs/issues/127
if ( true && !cacheEntity) {
buildCache();
cacheEntity = globalCache.opGet(fullPathStr);
}
var cacheContent = cacheEntity[1];
// Remove if no need anymore
hooks_useCompatibleInsertionEffect(function () {
onCacheEffect === null || onCacheEffect === void 0 || onCacheEffect(cacheContent);
}, function (polyfill) {
// It's bad to call build again in effect.
// But we have to do this since StrictMode will call effect twice
// which will clear cache on the first time.
buildCache(function (_ref3) {
var _ref4 = (0,slicedToArray["default"])(_ref3, 2),
times = _ref4[0],
cache = _ref4[1];
if (polyfill && times === 0) {
onCacheEffect === null || onCacheEffect === void 0 || onCacheEffect(cacheContent);
}
return [times + 1, cache];
});
return function () {
globalCache.opUpdate(fullPathStr, function (prevCache) {
var _ref5 = prevCache || [],
_ref6 = (0,slicedToArray["default"])(_ref5, 2),
_ref6$ = _ref6[0],
times = _ref6$ === void 0 ? 0 : _ref6$,
cache = _ref6[1];
var nextCount = times - 1;
if (nextCount === 0) {
// Always remove styles in useEffect callback
register(function () {
// With polyfill, registered callback will always be called synchronously
// But without polyfill, it will be called in effect clean up,
// And by that time this cache is cleaned up.
if (polyfill || !globalCache.opGet(fullPathStr)) {
onCacheRemove === null || onCacheRemove === void 0 || onCacheRemove(cache, false);
}
});
return null;
}
return [times - 1, cache];
});
};
}, [fullPathStr]);
return cacheContent;
}
;// CONCATENATED MODULE: ./node_modules/@ant-design/cssinjs/es/hooks/useCacheToken.js
var EMPTY_OVERRIDE = {};
// Generate different prefix to make user selector break in production env.
// This helps developer not to do style override directly on the hash id.
var hashPrefix = true ? 'css-dev-only-do-not-override' : 0;
var tokenKeys = new Map();
function recordCleanToken(tokenKey) {
tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) + 1);
}
function removeStyleTags(key, instanceId) {
if (typeof document !== 'undefined') {
var styles = document.querySelectorAll("style[".concat(ATTR_TOKEN, "=\"").concat(key, "\"]"));
styles.forEach(function (style) {
if (style[CSS_IN_JS_INSTANCE] === instanceId) {
var _style$parentNode;
(_style$parentNode = style.parentNode) === null || _style$parentNode === void 0 || _style$parentNode.removeChild(style);
}
});
}
}
var TOKEN_THRESHOLD = 0;
// Remove will check current keys first
function cleanTokenStyle(tokenKey, instanceId) {
tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) - 1);
var tokenKeyList = Array.from(tokenKeys.keys());
var cleanableKeyList = tokenKeyList.filter(function (key) {
var count = tokenKeys.get(key) || 0;
return count <= 0;
});
// Should keep tokens under threshold for not to insert style too often
if (tokenKeyList.length - cleanableKeyList.length > TOKEN_THRESHOLD) {
cleanableKeyList.forEach(function (key) {
removeStyleTags(key, instanceId);
tokenKeys.delete(key);
});
}
}
var getComputedToken = function getComputedToken(originToken, overrideToken, theme, format) {
var derivativeToken = theme.getDerivativeToken(originToken);
// Merge with override
var mergedDerivativeToken = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, derivativeToken), overrideToken);
// Format if needed
if (format) {
mergedDerivativeToken = format(mergedDerivativeToken);
}
return mergedDerivativeToken;
};
var TOKEN_PREFIX = 'token';
/**
* Cache theme derivative token as global shared one
* @param theme Theme entity
* @param tokens List of tokens, used for cache. Please do not dynamic generate object directly
* @param option Additional config
* @returns Call Theme.getDerivativeToken(tokenObject) to get token
*/
function useCacheToken(theme, tokens) {
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(es_StyleContext),
instanceId = _useContext.cache.instanceId,
container = _useContext.container;
var _option$salt = option.salt,
salt = _option$salt === void 0 ? '' : _option$salt,
_option$override = option.override,
override = _option$override === void 0 ? EMPTY_OVERRIDE : _option$override,
formatToken = option.formatToken,
compute = option.getComputedToken,
cssVar = option.cssVar;
// Basic - We do basic cache here
var mergedToken = memoResult(function () {
return Object.assign.apply(Object, [{}].concat((0,toConsumableArray["default"])(tokens)));
}, tokens);
var tokenStr = flattenToken(mergedToken);
var overrideTokenStr = flattenToken(override);
var cssVarStr = cssVar ? flattenToken(cssVar) : '';
var cachedToken = useGlobalCache(TOKEN_PREFIX, [salt, theme.id, tokenStr, overrideTokenStr, cssVarStr], function () {
var _cssVar$key;
var mergedDerivativeToken = compute ? compute(mergedToken, override, theme) : getComputedToken(mergedToken, override, theme, formatToken);
// Replace token value with css variables
var actualToken = (0,objectSpread2["default"])({}, mergedDerivativeToken);
var cssVarsStr = '';
if (!!cssVar) {
var _transformToken = transformToken(mergedDerivativeToken, cssVar.key, {
prefix: cssVar.prefix,
ignore: cssVar.ignore,
unitless: cssVar.unitless,
preserve: cssVar.preserve
});
var _transformToken2 = (0,slicedToArray["default"])(_transformToken, 2);
mergedDerivativeToken = _transformToken2[0];
cssVarsStr = _transformToken2[1];
}
// Optimize for `useStyleRegister` performance
var tokenKey = token2key(mergedDerivativeToken, salt);
mergedDerivativeToken._tokenKey = tokenKey;
actualToken._tokenKey = token2key(actualToken, salt);
var themeKey = (_cssVar$key = cssVar === null || cssVar === void 0 ? void 0 : cssVar.key) !== null && _cssVar$key !== void 0 ? _cssVar$key : tokenKey;
mergedDerivativeToken._themeKey = themeKey;
recordCleanToken(themeKey);
var hashId = "".concat(hashPrefix, "-").concat(hash_browser_esm(tokenKey));
mergedDerivativeToken._hashId = hashId; // Not used
return [mergedDerivativeToken, hashId, actualToken, cssVarsStr, (cssVar === null || cssVar === void 0 ? void 0 : cssVar.key) || ''];
}, function (cache) {
// Remove token will remove all related style
cleanTokenStyle(cache[0]._themeKey, instanceId);
}, function (_ref) {
var _ref2 = (0,slicedToArray["default"])(_ref, 4),
token = _ref2[0],
cssVarsStr = _ref2[3];
if (cssVar && cssVarsStr) {
var style = (0,dynamicCSS.updateCSS)(cssVarsStr, hash_browser_esm("css-variables-".concat(token._themeKey)), {
mark: ATTR_MARK,
prepend: 'queue',
attachTo: container,
priority: -999
});
style[CSS_IN_JS_INSTANCE] = instanceId;
// Used for `useCacheToken` to remove on batch when token removed
style.setAttribute(ATTR_TOKEN, token._themeKey);
}
});
return cachedToken;
}
var extract = function extract(cache, effectStyles, options) {
var _cache = (0