{"version":3,"sources":["../index.ts","../constants.ts","../utils.ts","../processors/css-processor.ts","../processors/jsx-processor.ts","../processors/ast-processor.ts"],"sourcesContent":["import type { Plugin } from \"vite\"\nimport { parse } from \"@babel/parser\"\nimport traverse from \"@babel/traverse\"\nimport type { NodePath } from \"@babel/traverse\"\nimport generate from \"@babel/generator\"\n\n// Fix for @babel/traverse default export issue with better error handling\nconst babelTraverse = (() => {\n\tif (typeof traverse === \"function\") return traverse\n\t// @ts-expect-error - Handle default export compatibility\n\tif (traverse && typeof traverse.default === \"function\") return traverse.default\n\tthrow new Error(\"@babel/traverse import failed\")\n})()\n\n// Fix for @babel/generator default export issue with better error handling\nconst babelGenerate = (() => {\n\tif (typeof generate === \"function\") return generate\n\t// @ts-expect-error - Handle default export compatibility\n\tif (generate && typeof generate.default === \"function\") return generate.default\n\tthrow new Error(\"@babel/generator import failed\")\n})()\n\n// Import types and utilities from separate modules\nimport type {\n\tAntdStylePxToRemOptions,\n\tTaggedTemplateExpression,\n\tCallExpression,\n\tObjectProperty,\n\tJSXElement,\n\tStringLiteral,\n} from \"./types\"\nimport { defaultOptions } from \"./constants\"\nimport {\n\tshouldProcess,\n\tshouldConvertProperty,\n\tisLengthProperty,\n\tcreatePxToRemConverter,\n} from \"./utils\"\n// CSS processing is now handled via ast-processor\nimport {\n\tprocessStyleObjectExpression,\n\tprocessConditionalExpression,\n} from \"./processors/jsx-processor\"\nimport { isTargetTemplateExpression, processCompleteTemplate } from \"./processors/ast-processor\"\n\n// Re-export types and main function\nexport type { AntdStylePxToRemOptions } from \"./types\"\nexport { defaultOptions } from \"./constants\"\n\nexport function antdStylePxToRem(options: AntdStylePxToRemOptions = {}): Plugin {\n\tconst mergedOptions = {\n\t\t...defaultOptions,\n\t\t...options,\n\t}\n\n\treturn {\n\t\tname: \"antd-style-px-to-rem\",\n\t\tenforce: \"pre\", // Run before other plugins to process JSX before React transforms it\n\t\ttransform(code: string, id: string) {\n\t\t\t// Skip if file should not be processed\n\t\t\tif (!shouldProcess(id, mergedOptions.include, mergedOptions.exclude)) {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\t// Skip if code doesn't contain target functions, createStyles, or JSX attributes (when enabled)\n\t\t\tconst hasTargetFunctions = mergedOptions.cssTemplateFunctions.some((fn) => {\n\t\t\t\tconst patterns = [\n\t\t\t\t\tfn + \"`\", // css`...`\n\t\t\t\t\t\".\" + fn + \"`\", // styled.css`...`\n\t\t\t\t\t\" \" + fn + \"`\", // { css }`...`\n\t\t\t\t\t\"(\" + fn + \"`\", // (css)`...`\n\t\t\t\t\t\"{\" + fn + \"`\", // {css}`...`\n\t\t\t\t]\n\t\t\t\treturn patterns.some((pattern) => code.includes(pattern))\n\t\t\t})\n\t\t\tconst hasCreateStyles = code.includes(\"createStyles\")\n\t\t\tconst hasJSXAttributes =\n\t\t\t\tmergedOptions.enableJSXTransform &&\n\t\t\t\t(code.includes(\"style=\") || \n\t\t\t\t Object.values(mergedOptions.jsxAttributeMapping).flat().some(attr => \n\t\t\t\t\tcode.includes(`${attr}=`)\n\t\t\t\t ))\n\n\t\t\tif (!hasTargetFunctions && !hasCreateStyles && !hasJSXAttributes) {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Parse the code into AST\n\t\t\t\tconst ast = parse(code, {\n\t\t\t\t\tsourceType: \"module\",\n\t\t\t\t\tplugins: [\n\t\t\t\t\t\t\"typescript\",\n\t\t\t\t\t\t\"jsx\",\n\t\t\t\t\t\t\"decorators-legacy\",\n\t\t\t\t\t\t\"classProperties\",\n\t\t\t\t\t\t\"objectRestSpread\",\n\t\t\t\t\t],\n\t\t\t\t})\n\n\t\t\t\tlet hasChanges = false\n\n\t\t\t\t// Split code into lines for checking ignore comments\n\t\t\t\tconst codeLines = code.split(\"\\n\")\n\n\t\t\t\tconst processOptions = {\n\t\t\t\t\trootValue: mergedOptions.rootValue,\n\t\t\t\t\tunitPrecision: mergedOptions.unitPrecision,\n\t\t\t\t\tminPixelValue: mergedOptions.minPixelValue,\n\t\t\t\t\tpropList: mergedOptions.propList,\n\t\t\t\t\treplace: mergedOptions.replace,\n\t\t\t\t\tmediaQuery: mergedOptions.mediaQuery,\n\t\t\t\t}\n\n\t\t\t\tconst pxToRem = createPxToRemConverter({\n\t\t\t\t\trootValue: processOptions.rootValue,\n\t\t\t\t\tunitPrecision: processOptions.unitPrecision,\n\t\t\t\t\tminPixelValue: processOptions.minPixelValue,\n\t\t\t\t})\n\n\t\t\t\t// Traverse AST to find and process CSS template literals\n\t\t\t\tbabelTraverse(ast, {\n\t\t\t\t\tTaggedTemplateExpression(path: NodePath<TaggedTemplateExpression>) {\n\t\t\t\t\t\tconst node = path.node\n\n\t\t\t\t\t\tif (isTargetTemplateExpression(node, mergedOptions.cssTemplateFunctions)) {\n\t\t\t\t\t\t\tconst templateChanged = processCompleteTemplate(\n\t\t\t\t\t\t\t\tnode.quasi,\n\t\t\t\t\t\t\t\tprocessOptions,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tif (templateChanged) {\n\t\t\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tCallExpression(path: NodePath<CallExpression>) {\n\t\t\t\t\t\tconst node = path.node\n\t\t\t\t\t\tconst callee = node.callee\n\n\t\t\t\t\t\t// Check for createStyles() call\n\t\t\t\t\t\tif (callee.type !== \"Identifier\" || callee.name !== \"createStyles\") {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpath.traverse({\n\t\t\t\t\t\t\tObjectProperty(propPath: NodePath<ObjectProperty>) {\n\t\t\t\t\t\t\t\tconst valueNode = propPath.node.value\n\t\t\t\t\t\t\t\tconst keyNode = propPath.node.key\n\n\t\t\t\t\t\t\t\tlet propName = \"\"\n\t\t\t\t\t\t\t\tif (keyNode.type === \"Identifier\") {\n\t\t\t\t\t\t\t\t\tpropName = keyNode.name\n\t\t\t\t\t\t\t\t} else if (keyNode.type === \"StringLiteral\") {\n\t\t\t\t\t\t\t\t\tpropName = keyNode.value\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (!propName) return\n\n\t\t\t\t\t\t\t\tconst shouldConvert = shouldConvertProperty(\n\t\t\t\t\t\t\t\t\tpropName,\n\t\t\t\t\t\t\t\t\tprocessOptions.propList,\n\t\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\t\tif (valueNode.type === \"StringLiteral\") {\n\t\t\t\t\t\t\t\t\tif (!shouldConvert) return\n\t\t\t\t\t\t\t\t\tconst originalValue = valueNode.value\n\t\t\t\t\t\t\t\t\tconst pxRegex = /(-?\\d*\\.?\\d+)px/g\n\t\t\t\t\t\t\t\t\tif (pxRegex.test(originalValue)) {\n\t\t\t\t\t\t\t\t\t\tconst newValue = originalValue.replace(\n\t\t\t\t\t\t\t\t\t\t\tpxRegex,\n\t\t\t\t\t\t\t\t\t\t\t(_, numStr) => pxToRem(numStr),\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\tif (newValue !== originalValue) {\n\t\t\t\t\t\t\t\t\t\t\tpropPath.get(\"value\").replaceWith({\n\t\t\t\t\t\t\t\t\t\t\t\ttype: \"StringLiteral\",\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (valueNode.type === \"NumericLiteral\") {\n\t\t\t\t\t\t\t\t\tif (!shouldConvert) return\n\t\t\t\t\t\t\t\t\tif (isLengthProperty(propName)) {\n\t\t\t\t\t\t\t\t\t\tconst newValue = pxToRem(valueNode.value)\n\t\t\t\t\t\t\t\t\t\tpropPath\n\t\t\t\t\t\t\t\t\t\t\t.get(\"value\")\n\t\t\t\t\t\t\t\t\t\t\t.replaceWith({ type: \"StringLiteral\", value: newValue })\n\t\t\t\t\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (valueNode.type === \"TemplateLiteral\") {\n\t\t\t\t\t\t\t\t\tif (processCompleteTemplate(valueNode, processOptions)) {\n\t\t\t\t\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t\tJSXElement(path: NodePath<JSXElement>) {\n\t\t\t\t\t\tconst node = path.node\n\t\t\t\t\t\tconst openingElement = node.openingElement\n\n\t\t\t\t\t\t// Check for ignore comment using line-based approach\n\t\t\t\t\t\tconst nodeStart = node.loc?.start.line\n\t\t\t\t\t\tlet hasIgnoreComment = false\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tnodeStart &&\n\t\t\t\t\t\t\tnodeStart > 0 &&\n\t\t\t\t\t\t\tnodeStart <= codeLines.length &&\n\t\t\t\t\t\t\tcodeLines.length > 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Check current line and previous line for ignore comment\n\t\t\t\t\t\t\tconst currentLine = codeLines[nodeStart - 1] || \"\"\n\t\t\t\t\t\t\tconst previousLine = nodeStart > 1 ? codeLines[nodeStart - 2] || \"\" : \"\"\n\n\t\t\t\t\t\t\thasIgnoreComment =\n\t\t\t\t\t\t\t\tcurrentLine.includes(\"antd-style-px-to-rem ignore\") ||\n\t\t\t\t\t\t\t\tcurrentLine.includes(\"antd-style-px-to-rem ignore\") ||\n\t\t\t\t\t\t\t\tpreviousLine.includes(\"antd-style-px-to-rem ignore\") ||\n\t\t\t\t\t\t\t\tpreviousLine.includes(\"antd-style-px-to-rem ignore\")\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (hasIgnoreComment) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Process JSX element attributes (only if JSX transform is enabled)\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tmergedOptions.enableJSXTransform &&\n\t\t\t\t\t\t\topeningElement.name.type === \"JSXIdentifier\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst componentName = openingElement.name.name\n\n\t\t\t\t\t\t\t// Process attributes\n\t\t\t\t\t\t\tfor (const attr of openingElement.attributes) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tattr.type === \"JSXAttribute\" &&\n\t\t\t\t\t\t\t\t\tattr.name.type === \"JSXIdentifier\"\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tconst attrName = attr.name.name\n\n\t\t\t\t\t\t\t\t\t// Handle style attribute - process on all elements\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tattrName === \"style\" &&\n\t\t\t\t\t\t\t\t\t\tattr.value?.type === \"JSXExpressionContainer\"\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t// Handle object expressions in style attribute\n\t\t\t\t\t\t\t\t\t\tif (attr.value.expression.type === \"ObjectExpression\") {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tprocessStyleObjectExpression(\n\t\t\t\t\t\t\t\t\t\t\t\t\tattr.value.expression,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocessOptions,\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Handle conditional expressions in style attribute\n\t\t\t\t\t\t\t\t\t\telse if (\n\t\t\t\t\t\t\t\t\t\t\tattr.value.expression.type === \"ConditionalExpression\"\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tprocessConditionalExpression(\n\t\t\t\t\t\t\t\t\t\t\t\t\tattr.value.expression,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocessOptions,\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Handle configured component attributes\n\t\t\t\t\t\t\t\t\telse if (mergedOptions.jsxAttributeMapping[componentName]?.includes(attrName)) {\n\t\t\t\t\t\t\t\t\t\t// Check if the attribute value is a numeric literal\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tattr.value?.type === \"JSXExpressionContainer\" &&\n\t\t\t\t\t\t\t\t\t\t\tattr.value.expression.type === \"NumericLiteral\"\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tconst numValue = attr.value.expression.value\n\n\t\t\t\t\t\t\t\t\t\t\t// Convert numeric value to rem string\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\ttypeof numValue === \"number\" &&\n\t\t\t\t\t\t\t\t\t\t\t\t!isNaN(numValue) &&\n\t\t\t\t\t\t\t\t\t\t\t\tMath.abs(numValue) > processOptions.minPixelValue\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst remValue = pxToRem(numValue)\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Replace numeric literal with string literal\n\t\t\t\t\t\t\t\t\t\t\t\tattr.value.expression = {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype: \"StringLiteral\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: remValue,\n\t\t\t\t\t\t\t\t\t\t\t\t} as StringLiteral\n\n\t\t\t\t\t\t\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t})\n\n\t\t\t\t// Return transformed code if changes were made\n\t\t\t\tif (hasChanges) {\n\t\t\t\t\tconst output = babelGenerate(ast, {\n\t\t\t\t\t\tretainLines: true,\n\t\t\t\t\t\tcompact: false,\n\t\t\t\t\t})\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcode: output.code,\n\t\t\t\t\t\tmap: output.map,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(`Failed to process file ${id}:`, error)\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\t}\n}\n","import type { AntdStylePxToRemOptions } from \"./types\"\n\nexport const defaultOptions: Required<AntdStylePxToRemOptions> = {\n\trootValue: 16,\n\tunitPrecision: 5,\n\tminPixelValue: 0,\n\tpropList: [\"*\"],\n\tselectorBlackList: [],\n\treplace: true,\n\tmediaQuery: false,\n\tinclude: undefined!,\n\texclude: undefined!,\n\tcssTemplateFunctions: [\"css\"],\n\tenableJSXTransform: true,\n\tjsxAttributeMapping: {},\n}\n\nexport const lengthProperties = new Set([\n\t\"width\",\n\t\"height\",\n\t\"minWidth\",\n\t\"minHeight\",\n\t\"maxWidth\",\n\t\"maxHeight\",\n\t\"padding\",\n\t\"paddingTop\",\n\t\"paddingRight\",\n\t\"paddingBottom\",\n\t\"paddingLeft\",\n\t\"margin\",\n\t\"marginTop\",\n\t\"marginRight\",\n\t\"marginBottom\",\n\t\"marginLeft\",\n\t\"left\",\n\t\"right\",\n\t\"top\",\n\t\"bottom\",\n\t\"fontSize\",\n\t\"lineHeight\",\n\t\"borderRadius\",\n\t\"borderTopLeftRadius\",\n\t\"borderTopRightRadius\",\n\t\"borderBottomLeftRadius\",\n\t\"borderBottomRightRadius\",\n\t\"borderWidth\",\n\t\"borderTopWidth\",\n\t\"borderRightWidth\",\n\t\"borderBottomWidth\",\n\t\"borderLeftWidth\",\n\t\"gap\",\n\t\"rowGap\",\n\t\"columnGap\",\n\t\"flexBasis\",\n\t\"outlineWidth\",\n\t\"letterSpacing\",\n\t\"wordSpacing\",\n])\n","import type { TemplateLiteral } from \"./types\"\nimport { lengthProperties } from \"./constants\"\n\n/**\n * Check if a file should be processed based on include/exclude patterns\n */\nexport function shouldProcess(\n\tid: string,\n\tinclude?: string | RegExp | (string | RegExp)[],\n\texclude?: string | RegExp | (string | RegExp)[],\n): boolean {\n\t// Check exclude patterns first\n\tif (exclude) {\n\t\tconst excludePatterns = Array.isArray(exclude) ? exclude : [exclude]\n\t\tfor (const pattern of excludePatterns) {\n\t\t\tif (typeof pattern === \"string\" && id.includes(pattern)) return false\n\t\t\tif (pattern instanceof RegExp && pattern.test(id)) return false\n\t\t}\n\t}\n\n\t// Check include patterns\n\tif (include) {\n\t\tconst includePatterns = Array.isArray(include) ? include : [include]\n\t\treturn includePatterns.some((pattern) => {\n\t\t\tif (typeof pattern === \"string\") return id.includes(pattern)\n\t\t\tif (pattern instanceof RegExp) return pattern.test(id)\n\t\t\treturn false\n\t\t})\n\t}\n\n\t// Default: process .ts, .tsx, .js, .jsx files\n\treturn /\\.(tsx?|jsx?)$/.test(id)\n}\n\n/**\n * Check if a CSS property should be converted based on propList configuration\n */\nexport function shouldConvertProperty(propName: string, propList: string[]): boolean {\n\t// If propList is empty, don't convert anything\n\tif (propList.length === 0) {\n\t\treturn false\n\t}\n\n\t// Check for wildcard - convert all properties\n\tconst hasWildcard = propList.includes(\"*\")\n\n\t// Get exclusion list (properties starting with !)\n\tconst exclusions = propList\n\t\t.filter((prop) => prop.startsWith(\"!\"))\n\t\t.map((prop) => prop.substring(1))\n\n\t// Get inclusion list (properties not starting with !)\n\tconst inclusions = propList.filter((prop) => !prop.startsWith(\"!\"))\n\n\t// If property is explicitly excluded, don't convert\n\tif (exclusions.includes(propName)) {\n\t\treturn false\n\t}\n\n\t// If wildcard is present and property is not excluded, convert\n\tif (hasWildcard) {\n\t\treturn true\n\t}\n\n\t// Otherwise, only convert if property is in inclusion list\n\treturn inclusions.includes(propName)\n}\n\n/**\n * Check if a property is a length property that should be converted\n */\nexport function isLengthProperty(propName: string): boolean {\n\treturn lengthProperties.has(propName)\n}\n\n/**\n * Check if template literal contains variable expressions\n */\nexport function hasVariableExpressions(template: TemplateLiteral): boolean {\n\treturn template.expressions.length > 0\n}\n\n/**\n * Create a px to rem conversion function with given options\n */\nexport function createPxToRemConverter(options: {\n\trootValue: number\n\tunitPrecision: number\n\tminPixelValue: number\n}) {\n\treturn function pxtorem(value: string | number): string {\n\t\tconst num = typeof value === \"string\" ? parseFloat(value) : value\n\t\tif (isNaN(num) || Math.abs(num) <= options.minPixelValue) {\n\t\t\treturn String(value)\n\t\t}\n\t\tconst rem = num / options.rootValue\n\t\tconst remValue = parseFloat(rem.toFixed(options.unitPrecision))\n\t\tif (remValue === 0) {\n\t\t\treturn \"0\"\n\t\t}\n\t\treturn `${remValue}rem`\n\t}\n}\n","import type { TemplateLiteral, ProcessOptions } from \"../types\"\nimport { shouldConvertProperty, createPxToRemConverter } from \"../utils\"\n\n/**\n * Convert px values to rem in CSS template strings\n * Uses regex matching to handle template expressions gracefully\n */\nexport function processCssTemplate(cssContent: string, options: ProcessOptions): string {\n\ttry {\n\t\tif (!cssContent || typeof cssContent !== \"string\" || cssContent.trim() === \"\") {\n\t\t\treturn cssContent\n\t\t}\n\n\t\tconst { rootValue, unitPrecision, minPixelValue, propList } = options\n\t\tlet hasChanges = false\n\n\t\tconst pxToRem = createPxToRemConverter({\n\t\t\trootValue,\n\t\t\tunitPrecision,\n\t\t\tminPixelValue,\n\t\t})\n\n\t\tconst pxRegex = /(-?\\d*\\.?\\d+)px/g\n\t\tconst lines = cssContent.split(\"\\n\")\n\t\tlet inBlockComment = false\n\n\t\tconst processedLines = lines.map((line, index) => {\n\t\t\tconst trimmedLine = line.trim()\n\n\t\t\tif (inBlockComment) {\n\t\t\t\tif (trimmedLine.includes(\"*/\")) {\n\t\t\t\t\tinBlockComment = false\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}\n\n\t\t\tif (trimmedLine.startsWith(\"/*\")) {\n\t\t\t\tif (!trimmedLine.includes(\"*/\")) {\n\t\t\t\t\tinBlockComment = true\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}\n\n\t\t\tif (trimmedLine.startsWith(\"//\")) {\n\t\t\t\treturn line\n\t\t\t}\n\n\t\t\t// Check if current line has ignore comment (support both old and new plugin names)\n\t\t\tconst currentLineHasIgnore = line.includes(\"antd-style-px-to-rem ignore\") || line.includes(\"antd-style-px-to-rem ignore\")\n\n\t\t\t// Check if previous line was a standalone ignore comment\n\t\t\tconst previousLineIsIgnoreComment =\n\t\t\t\tindex > 0 &&\n\t\t\t\tlines[index - 1] &&\n\t\t\t\t(lines[index - 1]!.trim().includes(\"antd-style-px-to-rem ignore\") || lines[index - 1]!.trim().includes(\"antd-style-px-to-rem ignore\")) &&\n\t\t\t\t!lines[index - 1]!.includes(\":\") // Previous line should be comment only, not a property\n\n\t\t\t// Skip processing if affected by previous line ignore comment\n\t\t\tif (previousLineIsIgnoreComment) {\n\t\t\t\treturn line\n\t\t\t}\n\n\t\t\tconst propertyMatch = line.match(/^(\\s*)(-{0,2}[a-zA-Z_][a-zA-Z0-9_-]*)(\\s*:\\s*)(.*)$/)\n\t\t\tif (propertyMatch) {\n\t\t\t\tconst indentation = propertyMatch[1] || \"\"\n\t\t\t\tconst propName = propertyMatch[2] || \"\"\n\t\t\t\tconst colonPart = propertyMatch[3] || \"\"\n\t\t\t\tlet value = propertyMatch[4] || \"\"\n\n\t\t\t\t// Don't convert if current line has ignore comment\n\t\t\t\tif (shouldConvertProperty(propName, propList) && !currentLineHasIgnore) {\n\t\t\t\t\tconst processedValue = value.replace(pxRegex, (match, numStr) => {\n\t\t\t\t\t\tconst convertedValue = pxToRem(numStr)\n\t\t\t\t\t\tif (convertedValue !== match) {\n\t\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn convertedValue\n\t\t\t\t\t})\n\t\t\t\t\tvalue = processedValue\n\t\t\t\t}\n\t\t\t\treturn `${indentation}${propName}${colonPart}${value}`\n\t\t\t} else if (propList.includes(\"*\") && !propList.some((p) => p.startsWith(\"!\"))) {\n\t\t\t\t// Only use fallback wildcard conversion if there are no exclusions and no ignore comment\n\t\t\t\tif (!currentLineHasIgnore) {\n\t\t\t\t\tconst processedLine = line.replace(pxRegex, (match, numStr) => {\n\t\t\t\t\t\tconst convertedValue = pxToRem(numStr)\n\t\t\t\t\t\tif (convertedValue !== match) {\n\t\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn convertedValue\n\t\t\t\t\t})\n\t\t\t\t\treturn processedLine\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn line\n\t\t})\n\n\t\tconst processedContent = processedLines.join(\"\\n\")\n\t\treturn hasChanges ? processedContent : cssContent\n\t} catch (error) {\n\t\tconsole.warn(\"Failed to process CSS template with px to rem conversion:\", error)\n\t\treturn cssContent\n\t}\n}\n\n/**\n * Process template quasis (static parts of template literals)\n */\nexport function processTemplateQuasis(template: TemplateLiteral, options: ProcessOptions): boolean {\n\tlet hasChanges = false\n\n\t// Process static CSS parts\n\tfor (const quasi of template.quasis) {\n\t\tif (quasi.value && quasi.value.raw) {\n\t\t\tconst originalCss = quasi.value.raw\n\t\t\tconst processedCss = processCssTemplate(originalCss, options)\n\n\t\t\tif (processedCss !== originalCss) {\n\t\t\t\tquasi.value.raw = processedCss\n\t\t\t\tquasi.value.cooked = processedCss\n\t\t\t\thasChanges = true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn hasChanges\n}\n","import type {\n\tObjectExpression,\n\tStringLiteral,\n\tProcessOptions,\n\tConditionalExpression,\n} from \"../types\"\nimport {\n\tshouldConvertProperty,\n\thasVariableExpressions,\n\tisLengthProperty,\n\tcreatePxToRemConverter,\n} from \"../utils\"\nimport { processTemplateQuasis } from \"./css-processor\"\n\n/**\n * Process JSX style object expressions to convert px values to rem\n */\nexport function processStyleObjectExpression(\n\tobjectExpression: ObjectExpression,\n\toptions: ProcessOptions,\n): boolean {\n\tlet hasChanges = false\n\n\tconst pxtorem = createPxToRemConverter({\n\t\trootValue: options.rootValue,\n\t\tunitPrecision: options.unitPrecision,\n\t\tminPixelValue: options.minPixelValue,\n\t})\n\n\tfor (const property of objectExpression.properties) {\n\t\tif (property.type === \"ObjectProperty\") {\n\t\t\tlet propName = \"\"\n\n\t\t\t// Get property name\n\t\t\tif (property.key.type === \"Identifier\") {\n\t\t\t\tpropName = property.key.name\n\t\t\t} else if (property.key.type === \"StringLiteral\") {\n\t\t\t\tpropName = property.key.value\n\t\t\t}\n\n\t\t\tif (!propName) continue\n\n\t\t\tconst shouldConvert = shouldConvertProperty(propName, options.propList)\n\n\t\t\t// Process different value types\n\t\t\tif (property.value.type === \"StringLiteral\") {\n\t\t\t\tif (!shouldConvert) continue\n\t\t\t\tconst originalValue = property.value.value\n\t\t\t\tconst pxRegex = /(-?\\d*\\.?\\d+)px/g\n\t\t\t\tif (pxRegex.test(originalValue)) {\n\t\t\t\t\tconst newValue = originalValue.replace(pxRegex, (_, numStr) => pxtorem(numStr))\n\t\t\t\t\tif (newValue !== originalValue) {\n\t\t\t\t\t\tproperty.value.value = newValue\n\t\t\t\t\t\thasChanges = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (property.value.type === \"NumericLiteral\") {\n\t\t\t\tif (!shouldConvert) continue\n\t\t\t\tif (isLengthProperty(propName)) {\n\t\t\t\t\tconst newValue = pxtorem(property.value.value)\n\t\t\t\t\t// Replace numeric literal with string literal\n\t\t\t\t\tproperty.value = {\n\t\t\t\t\t\ttype: \"StringLiteral\",\n\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t} as StringLiteral\n\t\t\t\t\thasChanges = true\n\t\t\t\t}\n\t\t\t} else if (property.value.type === \"TemplateLiteral\") {\n\t\t\t\t// Only process template literals without variable expressions\n\t\t\t\tif (!shouldConvert || hasVariableExpressions(property.value)) continue\n\n\t\t\t\tif (processTemplateQuasis(property.value, options)) {\n\t\t\t\t\thasChanges = true\n\t\t\t\t}\n\t\t\t} else if (property.value.type === \"ConditionalExpression\") {\n\t\t\t\t// Handle conditional property values like { padding: condition ? 10 : 20 }\n\t\t\t\tif (processConditionalPropertyValue(property.value, propName, options)) {\n\t\t\t\t\thasChanges = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn hasChanges\n}\n\n/**\n * Process conditional expressions in JSX style objects\n * Handles patterns like: condition ? { style1 } : { style2 }\n */\nexport function processConditionalExpression(\n\tconditionalExpression: ConditionalExpression,\n\toptions: ProcessOptions,\n): boolean {\n\tlet hasChanges = false\n\n\t// Process consequent (true branch)\n\tif (conditionalExpression.consequent.type === \"ObjectExpression\") {\n\t\tif (processStyleObjectExpression(conditionalExpression.consequent, options)) {\n\t\t\thasChanges = true\n\t\t}\n\t} else if (conditionalExpression.consequent.type === \"ConditionalExpression\") {\n\t\t// Handle nested conditional expressions\n\t\tif (processConditionalExpression(conditionalExpression.consequent, options)) {\n\t\t\thasChanges = true\n\t\t}\n\t}\n\n\t// Process alternate (false branch)\n\tif (conditionalExpression.alternate.type === \"ObjectExpression\") {\n\t\tif (processStyleObjectExpression(conditionalExpression.alternate, options)) {\n\t\t\thasChanges = true\n\t\t}\n\t} else if (conditionalExpression.alternate.type === \"ConditionalExpression\") {\n\t\t// Handle nested conditional expressions\n\t\tif (processConditionalExpression(conditionalExpression.alternate, options)) {\n\t\t\thasChanges = true\n\t\t}\n\t}\n\n\treturn hasChanges\n}\n\n/**\n * Process conditional property values in style objects\n * Handles patterns like: { padding: condition ? 10 : 20 }\n */\nexport function processConditionalPropertyValue(\n\tconditionalExpression: ConditionalExpression,\n\tpropName: string,\n\toptions: ProcessOptions,\n): boolean {\n\tlet hasChanges = false\n\n\tconst shouldConvert = shouldConvertProperty(propName, options.propList)\n\tif (!shouldConvert) return false\n\n\tconst pxtorem = createPxToRemConverter({\n\t\trootValue: options.rootValue,\n\t\tunitPrecision: options.unitPrecision,\n\t\tminPixelValue: options.minPixelValue,\n\t})\n\n\t// Process consequent (true branch)\n\tif (conditionalExpression.consequent.type === \"NumericLiteral\") {\n\t\tif (isLengthProperty(propName)) {\n\t\t\tconst newValue = pxtorem(conditionalExpression.consequent.value)\n\t\t\tconditionalExpression.consequent = {\n\t\t\t\ttype: \"StringLiteral\",\n\t\t\t\tvalue: newValue,\n\t\t\t} as StringLiteral\n\t\t\thasChanges = true\n\t\t}\n\t} else if (conditionalExpression.consequent.type === \"StringLiteral\") {\n\t\tconst originalValue = conditionalExpression.consequent.value\n\t\tconst pxRegex = /(-?\\d*\\.?\\d+)px/g\n\t\tif (pxRegex.test(originalValue)) {\n\t\t\tconst newValue = originalValue.replace(pxRegex, (_, numStr) => pxtorem(numStr))\n\t\t\tif (newValue !== originalValue) {\n\t\t\t\tconditionalExpression.consequent.value = newValue\n\t\t\t\thasChanges = true\n\t\t\t}\n\t\t}\n\t} else if (conditionalExpression.consequent.type === \"ConditionalExpression\") {\n\t\t// Handle nested conditional expressions\n\t\tif (processConditionalPropertyValue(conditionalExpression.consequent, propName, options)) {\n\t\t\thasChanges = true\n\t\t}\n\t}\n\n\t// Process alternate (false branch)\n\tif (conditionalExpression.alternate.type === \"NumericLiteral\") {\n\t\tif (isLengthProperty(propName)) {\n\t\t\tconst newValue = pxtorem(conditionalExpression.alternate.value)\n\t\t\tconditionalExpression.alternate = {\n\t\t\t\ttype: \"StringLiteral\",\n\t\t\t\tvalue: newValue,\n\t\t\t} as StringLiteral\n\t\t\thasChanges = true\n\t\t}\n\t} else if (conditionalExpression.alternate.type === \"StringLiteral\") {\n\t\tconst originalValue = conditionalExpression.alternate.value\n\t\tconst pxRegex = /(-?\\d*\\.?\\d+)px/g\n\t\tif (pxRegex.test(originalValue)) {\n\t\t\tconst newValue = originalValue.replace(pxRegex, (_, numStr) => pxtorem(numStr))\n\t\t\tif (newValue !== originalValue) {\n\t\t\t\tconditionalExpression.alternate.value = newValue\n\t\t\t\thasChanges = true\n\t\t\t}\n\t\t}\n\t} else if (conditionalExpression.alternate.type === \"ConditionalExpression\") {\n\t\t// Handle nested conditional expressions\n\t\tif (processConditionalPropertyValue(conditionalExpression.alternate, propName, options)) {\n\t\t\thasChanges = true\n\t\t}\n\t}\n\n\treturn hasChanges\n}\n","import type {\n\tNode,\n\tTaggedTemplateExpression,\n\tTemplateLiteral,\n\tExpression,\n\tProcessOptions,\n} from \"../types\"\nimport { createPxToRemConverter } from \"../utils\"\nimport { processTemplateQuasis } from \"./css-processor\"\n\n/**\n * Check if a node is a target template expression\n */\nexport function isTargetTemplateExpression(\n\tnode: Node,\n\ttargetFunctions: string[],\n): node is TaggedTemplateExpression {\n\tif (node.type !== \"TaggedTemplateExpression\") return false\n\n\tconst tag = node.tag\n\n\t// Handle direct function calls like: css`...`\n\tif (tag.type === \"Identifier\") {\n\t\treturn targetFunctions.includes(tag.name)\n\t}\n\n\t// Handle member expressions like: styled.css`...` or theme.css`...`\n\tif (tag.type === \"MemberExpression\" && tag.property.type === \"Identifier\") {\n\t\treturn targetFunctions.includes(tag.property.name)\n\t}\n\n\treturn false\n}\n\n/**\n * Process template expressions to convert px values to rem in string literals\n */\nexport function processTemplateExpressions(\n\ttemplate: TemplateLiteral,\n\toptions: ProcessOptions,\n): boolean {\n\tlet hasChanges = false\n\n\tconst pxtorem = createPxToRemConverter({\n\t\trootValue: options.rootValue,\n\t\tunitPrecision: options.unitPrecision,\n\t\tminPixelValue: options.minPixelValue,\n\t})\n\n\tconst processExpression = (expr: Expression): boolean => {\n\t\tlet changed = false\n\n\t\tif (expr.type === \"StringLiteral\") {\n\t\t\tconst originalValue = expr.value\n\t\t\tconst pxRegex = /(-?\\d*\\.?\\d+)px/g\n\t\t\tconst newValue = originalValue.replace(pxRegex, (match, numStr) => {\n\t\t\t\tconst pxValue = parseFloat(numStr)\n\t\t\t\tif (isNaN(pxValue) || Math.abs(pxValue) < options.minPixelValue) {\n\t\t\t\t\treturn match\n\t\t\t\t}\n\t\t\t\treturn pxtorem(pxValue)\n\t\t\t})\n\t\t\tif (newValue !== originalValue) {\n\t\t\t\texpr.value = newValue\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t} else if (expr.type === \"ConditionalExpression\") {\n\t\t\t// Handle conditional expressions like: open ? \"340px\" : 0\n\t\t\tif (processExpression(expr.consequent)) changed = true\n\t\t\tif (processExpression(expr.alternate)) changed = true\n\t\t}\n\n\t\treturn changed\n\t}\n\n\t// Process expressions in template literals (${...} parts)\n\tfor (const expression of template.expressions) {\n\t\t// Only process actual expressions, not TypeScript types\n\t\tif (expression && typeof expression === \"object\" && expression.type) {\n\t\t\tif (processExpression(expression as Expression)) {\n\t\t\t\thasChanges = true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn hasChanges\n}\n\n/**\n * Process complete template literals (both static and dynamic parts)\n */\nexport function processCompleteTemplate(\n\ttemplate: TemplateLiteral,\n\toptions: ProcessOptions,\n): boolean {\n\tlet hasChanges = false\n\n\t// Process static CSS parts\n\tif (processTemplateQuasis(template, options)) {\n\t\thasChanges = true\n\t}\n\n\t// Process dynamic expressions\n\tif (processTemplateExpressions(template, options)) {\n\t\thasChanges = true\n\t}\n\n\treturn hasChanges\n}\n"],"mappings":";AACA,SAAS,aAAa;AACtB,OAAO,cAAc;AAErB,OAAO,cAAc;;;ACFd,IAAM,iBAAoD;AAAA,EAChE,WAAW;AAAA,EACX,eAAe;AAAA,EACf,eAAe;AAAA,EACf,UAAU,CAAC,GAAG;AAAA,EACd,mBAAmB,CAAC;AAAA,EACpB,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,sBAAsB,CAAC,KAAK;A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