{"ast":null,"code":"import useMemo from \"rc-util/es/hooks/useMemo\";\nimport isEqual from \"rc-util/es/isEqual\";\nimport { devUseWarning } from '../../_util/warning';\nimport { defaultConfig } from '../../theme/internal';\nimport useThemeKey from './useThemeKey';\nexport default function useTheme(theme, parentTheme, config) {\n var _a, _b;\n const warning = devUseWarning('ConfigProvider');\n const themeConfig = theme || {};\n const parentThemeConfig = themeConfig.inherit === false || !parentTheme ? Object.assign(Object.assign({}, defaultConfig), {\n hashed: (_a = parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.hashed) !== null && _a !== void 0 ? _a : defaultConfig.hashed,\n cssVar: parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.cssVar\n }) : parentTheme;\n const themeKey = useThemeKey();\n if (process.env.NODE_ENV !== 'production') {\n const cssVarEnabled = themeConfig.cssVar || parentThemeConfig.cssVar;\n const validKey = !!(typeof themeConfig.cssVar === 'object' && ((_b = themeConfig.cssVar) === null || _b === void 0 ? void 0 : _b.key) || themeKey);\n process.env.NODE_ENV !== \"production\" ? warning(!cssVarEnabled || validKey, 'breaking', 'Missing key in `cssVar` config. Please upgrade to React 18 or set `cssVar.key` manually in each ConfigProvider inside `cssVar` enabled ConfigProvider.') : void 0;\n }\n return useMemo(() => {\n var _a, _b;\n if (!theme) {\n return parentTheme;\n }\n // Override\n const mergedComponents = Object.assign({}, parentThemeConfig.components);\n Object.keys(theme.components || {}).forEach(componentName => {\n mergedComponents[componentName] = Object.assign(Object.assign({}, mergedComponents[componentName]), theme.components[componentName]);\n });\n const cssVarKey = `css-var-${themeKey.replace(/:/g, '')}`;\n const mergedCssVar = ((_a = themeConfig.cssVar) !== null && _a !== void 0 ? _a : parentThemeConfig.cssVar) && Object.assign(Object.assign(Object.assign({\n prefix: config === null || config === void 0 ? void 0 : config.prefixCls\n }, typeof parentThemeConfig.cssVar === 'object' ? parentThemeConfig.cssVar : {}), typeof themeConfig.cssVar === 'object' ? themeConfig.cssVar : {}), {\n key: typeof themeConfig.cssVar === 'object' && ((_b = themeConfig.cssVar) === null || _b === void 0 ? void 0 : _b.key) || cssVarKey\n });\n // Base token\n return Object.assign(Object.assign(Object.assign({}, parentThemeConfig), themeConfig), {\n token: Object.assign(Object.assign({}, parentThemeConfig.token), themeConfig.token),\n components: mergedComponents,\n cssVar: mergedCssVar\n });\n }, [themeConfig, parentThemeConfig], (prev, next) => prev.some((prevTheme, index) => {\n const nextTheme = next[index];\n return !isEqual(prevTheme, nextTheme, true);\n }));\n}","map":{"version":3,"names":["useMemo","isEqual","devUseWarning","defaultConfig","useThemeKey","useTheme","theme","parentTheme","config","_a","_b","warning","themeConfig","parentThemeConfig","inherit","Object","assign","hashed","cssVar","themeKey","process","env","NODE_ENV","cssVarEnabled","validKey","key","mergedComponents","components","keys","forEach","componentName","cssVarKey","replace","mergedCssVar","prefix","prefixCls","token","prev","next","some","prevTheme","index","nextTheme"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/config-provider/hooks/useTheme.js"],"sourcesContent":["import useMemo from \"rc-util/es/hooks/useMemo\";\nimport isEqual from \"rc-util/es/isEqual\";\nimport { devUseWarning } from '../../_util/warning';\nimport { defaultConfig } from '../../theme/internal';\nimport useThemeKey from './useThemeKey';\nexport default function useTheme(theme, parentTheme, config) {\n var _a, _b;\n const warning = devUseWarning('ConfigProvider');\n const themeConfig = theme || {};\n const parentThemeConfig = themeConfig.inherit === false || !parentTheme ? Object.assign(Object.assign({}, defaultConfig), {\n hashed: (_a = parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.hashed) !== null && _a !== void 0 ? _a : defaultConfig.hashed,\n cssVar: parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.cssVar\n }) : parentTheme;\n const themeKey = useThemeKey();\n if (process.env.NODE_ENV !== 'production') {\n const cssVarEnabled = themeConfig.cssVar || parentThemeConfig.cssVar;\n const validKey = !!(typeof themeConfig.cssVar === 'object' && ((_b = themeConfig.cssVar) === null || _b === void 0 ? void 0 : _b.key) || themeKey);\n process.env.NODE_ENV !== \"production\" ? warning(!cssVarEnabled || validKey, 'breaking', 'Missing key in `cssVar` config. Please upgrade to React 18 or set `cssVar.key` manually in each ConfigProvider inside `cssVar` enabled ConfigProvider.') : void 0;\n }\n return useMemo(() => {\n var _a, _b;\n if (!theme) {\n return parentTheme;\n }\n // Override\n const mergedComponents = Object.assign({}, parentThemeConfig.components);\n Object.keys(theme.components || {}).forEach(componentName => {\n mergedComponents[componentName] = Object.assign(Object.assign({}, mergedComponents[componentName]), theme.components[componentName]);\n });\n const cssVarKey = `css-var-${themeKey.replace(/:/g, '')}`;\n const mergedCssVar = ((_a = themeConfig.cssVar) !== null && _a !== void 0 ? _a : parentThemeConfig.cssVar) && Object.assign(Object.assign(Object.assign({\n prefix: config === null || config === void 0 ? void 0 : config.prefixCls\n }, typeof parentThemeConfig.cssVar === 'object' ? parentThemeConfig.cssVar : {}), typeof themeConfig.cssVar === 'object' ? themeConfig.cssVar : {}), {\n key: typeof themeConfig.cssVar === 'object' && ((_b = themeConfig.cssVar) === null || _b === void 0 ? void 0 : _b.key) || cssVarKey\n });\n // Base token\n return Object.assign(Object.assign(Object.assign({}, parentThemeConfig), themeConfig), {\n token: Object.assign(Object.assign({}, parentThemeConfig.token), themeConfig.token),\n components: mergedComponents,\n cssVar: mergedCssVar\n });\n }, [themeConfig, parentThemeConfig], (prev, next) => prev.some((prevTheme, index) => {\n const nextTheme = next[index];\n return !isEqual(prevTheme, nextTheme, true);\n }));\n}"],"mappings":"AAAA,OAAOA,OAAO,MAAM,0BAA0B;AAC9C,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,OAAOC,WAAW,MAAM,eAAe;AACvC,eAAe,SAASC,QAAQA,CAACC,KAAK,EAAEC,WAAW,EAAEC,MAAM,EAAE;EAC3D,IAAIC,EAAE,EAAEC,EAAE;EACV,MAAMC,OAAO,GAAGT,aAAa,CAAC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