PromoCursed/node_modules/.cache/babel-loader/d58e0f309b4cf0027679a972239f5f3e5f89ffc93c492d5d19d35b847b75fdb1.json

1 line
17 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport hash from '@emotion/hash';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport { removeCSS, updateCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport { ATTR_MARK, ATTR_TOKEN } from \"../StyleContext\";\nimport { Theme } from \"../theme\";\n\n// Create a cache for memo concat\n\nvar resultCache = new WeakMap();\nvar RESULT_VALUE = {};\nexport function memoResult(callback, deps) {\n var current = resultCache;\n for (var i = 0; i < deps.length; i += 1) {\n var dep = deps[i];\n if (!current.has(dep)) {\n current.set(dep, new WeakMap());\n }\n current = current.get(dep);\n }\n if (!current.has(RESULT_VALUE)) {\n current.set(RESULT_VALUE, callback());\n }\n return current.get(RESULT_VALUE);\n}\n\n// Create a cache here to avoid always loop generate\nvar flattenTokenCache = new WeakMap();\n\n/**\n * Flatten token to string, this will auto cache the result when token not change\n */\nexport function flattenToken(token) {\n var hashed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var str = flattenTokenCache.get(token) || '';\n if (!str) {\n Object.keys(token).forEach(function (key) {\n var value = token[key];\n str += key;\n if (value instanceof Theme) {\n str += value.id;\n } else if (value && _typeof(value) === 'object') {\n str += flattenToken(value, hashed);\n } else {\n str += value;\n }\n });\n\n // https://github.com/ant-design/ant-design/issues/48386\n // Should hash the string to avoid style tag name too long\n if (hashed) {\n str = hash(str);\n }\n\n // Put in cache\n flattenTokenCache.set(token, str);\n }\n return str;\n}\n\n/**\n * Convert derivative token to key string\n */\nexport function token2key(token, salt) {\n return hash(\"\".concat(salt, \"_\").concat(flattenToken(token, true)));\n}\nvar randomSelectorKey = \"random-\".concat(Date.now(), \"-\").concat(Math.random()).replace(/\\./g, '');\n\n// Magic `content` for detect selector support\nvar checkContent = '_bAmBoO_';\nfunction supportSelector(styleStr, handleElement, supportCheck) {\n if (canUseDom()) {\n var _getComputedStyle$con, _ele$parentNode;\n updateCSS(styleStr, randomSelectorKey);\n var _ele = document.createElement('div');\n _ele.style.position = 'fixed';\n _ele.style.left = '0';\n _ele.style.top = '0';\n handleElement === null || handleElement === void 0 || handleElement(_ele);\n document.body.appendChild(_ele);\n if (process.env.NODE_ENV !== 'production') {\n _ele.innerHTML = 'Test';\n _ele.style.zIndex = '9999999';\n }\n var support = supportCheck ? supportCheck(_ele) : (_getComputedStyle$con = getComputedStyle(_ele).content) === null || _getComputedStyle$con === void 0 ? void 0 : _getComputedStyle$con.includes(checkContent);\n (_ele$parentNode = _ele.parentNode) === null || _ele$parentNode === void 0 || _ele$parentNode.removeChild(_ele);\n removeCSS(randomSelectorKey);\n return support;\n }\n return false;\n}\nvar canLayer = undefined;\nexport function supportLayer() {\n if (canLayer === undefined) {\n canLayer = supportSelector(\"@layer \".concat(randomSelectorKey, \" { .\").concat(randomSelectorKey, \" { content: \\\"\").concat(checkContent, \"\\\"!important; } }\"), function (ele) {\n ele.className = randomSelectorKey;\n });\n }\n return canLayer;\n}\nvar canWhere = undefined;\nexport function supportWhere() {\n if (canWhere === undefined) {\n canWhere = supportSelector(\":where(.\".concat(randomSelectorKey, \") { content: \\\"\").concat(checkContent, \"\\\"!important; }\"), function (ele) {\n ele.className = randomSelectorKey;\n });\n }\n return canWhere;\n}\nvar canLogic = undefined;\nexport function supportLogicProps() {\n if (canLogic === undefined) {\n canLogic = suppor