@fluentic/style 0.1.0-beta.15 → 0.1.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/compiler/compiler/compiler.ts +7 -0
  3. package/compiler/transform/evaluator/lazy_bindings.ts +63 -0
  4. package/compiler/transform/evaluator/tracer.ts +45 -38
  5. package/compiler/transform/extract/plugin.ts +19 -11
  6. package/compiler/transform/extract/utils/state.ts +3 -2
  7. package/dist/compiler/index.mjs +1 -1
  8. package/dist/{compiler-AOb_VaKQ.mjs → compiler-Cat8TmMk.mjs} +110 -44
  9. package/dist/compiler-Cat8TmMk.mjs.map +1 -0
  10. package/dist/config/index.js +2 -2
  11. package/dist/{config-B_OQYZSm.js → config-BK7oK4Hx.js} +3 -3
  12. package/dist/{config-B_OQYZSm.js.map → config-BK7oK4Hx.js.map} +1 -1
  13. package/dist/{config-BF-mxuPk.js → config-DFxeuT46.js} +4 -4
  14. package/dist/{config-BF-mxuPk.js.map → config-DFxeuT46.js.map} +1 -1
  15. package/dist/{css-RohOR3Vq.js → css-BkNqUfLD.js} +12 -12
  16. package/dist/{css-RohOR3Vq.js.map → css-BkNqUfLD.js.map} +1 -1
  17. package/dist/css.js +1 -1
  18. package/dist/{css_extra-CuzJtAR_.js → css_extra-qzi_eFFf.js} +2 -2
  19. package/dist/{css_extra-CuzJtAR_.js.map → css_extra-qzi_eFFf.js.map} +1 -1
  20. package/dist/{data-Bw3Xod5J.js → data-MrBhvIQZ.js} +7 -7
  21. package/dist/{data-Bw3Xod5J.js.map → data-MrBhvIQZ.js.map} +1 -1
  22. package/dist/{debug-CVO3xx4C.js → debug-Bo43rBKc.js} +2 -2
  23. package/dist/{debug-CVO3xx4C.js.map → debug-Bo43rBKc.js.map} +1 -1
  24. package/dist/dev/rsc.js +9 -9
  25. package/dist/{dev-BnQXPLQB.js → dev-BoEgFs_x.js} +6 -6
  26. package/dist/{dev-BnQXPLQB.js.map → dev-BoEgFs_x.js.map} +1 -1
  27. package/dist/dev.js +1 -1
  28. package/dist/dialect/extracted/index.js +1 -1
  29. package/dist/dialect/index.js +1 -1
  30. package/dist/{elementMarker-BrHXg161.js → elementMarker-nYeJnJPQ.js} +5 -5
  31. package/dist/{elementMarker-BrHXg161.js.map → elementMarker-nYeJnJPQ.js.map} +1 -1
  32. package/dist/entry/dev/adapter/preact.js +1 -1
  33. package/dist/entry/dev/adapter/react.js +1 -1
  34. package/dist/entry/dev/adapter/solid.js +1 -1
  35. package/dist/entry/dev/css.js +2 -2
  36. package/dist/entry/dev/jsx-dev-runtime.js +2 -2
  37. package/dist/entry/dev/jsx-runtime.js +2 -2
  38. package/dist/entry/dev.js +11 -11
  39. package/dist/{env-D6daex-9.js → env-BcNl1tsJ.js} +9 -16
  40. package/dist/{env-D6daex-9.js.map → env-BcNl1tsJ.js.map} +1 -1
  41. package/dist/{getClassName-m5DOkMFQ.js → getClassName-CkTq92nR.js} +4 -4
  42. package/dist/{getClassName-m5DOkMFQ.js.map → getClassName-CkTq92nR.js.map} +1 -1
  43. package/dist/{global-DeIYtcdl.js → global-DGcWZODV.js} +2 -8
  44. package/dist/{global-DeIYtcdl.js.map → global-DGcWZODV.js.map} +1 -1
  45. package/dist/{hash-DCJkLls_.js → hash-CjTP-uES.js} +3 -3
  46. package/dist/{hash-DCJkLls_.js.map → hash-CjTP-uES.js.map} +1 -1
  47. package/dist/index.js +9 -9
  48. package/dist/jsx/jsx-dev-runtime.js +1 -1
  49. package/dist/jsx/jsx-runtime.js +1 -1
  50. package/dist/{jsx-CvloSSpb.js → jsx-DA1LD8nU.js} +4 -4
  51. package/dist/{jsx-CvloSSpb.js.map → jsx-DA1LD8nU.js.map} +1 -1
  52. package/dist/{loader-fAuIjIik.mjs → loader-Cvz2pKYV.mjs} +3 -3
  53. package/dist/{loader-fAuIjIik.mjs.map → loader-Cvz2pKYV.mjs.map} +1 -1
  54. package/dist/{misc-CyZgGtc9.mjs → misc-BKaSZF14.mjs} +30 -4
  55. package/dist/misc-BKaSZF14.mjs.map +1 -0
  56. package/dist/{namedTokens-DwgmUMBM.js → namedTokens-paLD-Pdk.js} +2 -2
  57. package/dist/{namedTokens-DwgmUMBM.js.map → namedTokens-paLD-Pdk.js.map} +1 -1
  58. package/dist/plugin/farm/index.mjs +3 -3
  59. package/dist/plugin/nextjs/index.mjs +5 -5
  60. package/dist/plugin/nextjs/index.mjs.map +1 -1
  61. package/dist/plugin/nextjs/loader.mjs +4 -4
  62. package/dist/plugin/parcel/index.cjs +1 -1
  63. package/dist/plugin/parcel/index.mjs +2 -2
  64. package/dist/plugin/parcel/optimizer.cjs +1 -1
  65. package/dist/plugin/parcel/optimizer.mjs +2 -2
  66. package/dist/plugin/parcel/resolver.cjs +1 -1
  67. package/dist/plugin/parcel/resolver.mjs +2 -2
  68. package/dist/plugin/parcel/runtime.cjs +1 -1
  69. package/dist/plugin/parcel/runtime.mjs +1 -1
  70. package/dist/plugin/parcel/transformer.cjs +1 -1
  71. package/dist/plugin/parcel/transformer.mjs +2 -2
  72. package/dist/plugin/rspack/index.mjs +2 -2
  73. package/dist/plugin/vite/index.mjs +20 -17
  74. package/dist/plugin/vite/index.mjs.map +1 -1
  75. package/dist/plugin/webpack/index.mjs +2 -2
  76. package/dist/plugin/webpack/loader.mjs +2 -2
  77. package/dist/presets/tailwind/index.js +3 -3
  78. package/dist/{registry-BMijh1CM.mjs → registry-Bbxm5X90.mjs} +2 -2
  79. package/dist/{registry-BMijh1CM.mjs.map → registry-Bbxm5X90.mjs.map} +1 -1
  80. package/dist/server.js +14 -14
  81. package/dist/{shared-BfASWZo1.mjs → shared-BVciI9ew.mjs} +4 -4
  82. package/dist/{shared-BfASWZo1.mjs.map → shared-BVciI9ew.mjs.map} +1 -1
  83. package/dist/{shared-DY0kuBcN.cjs → shared-L-63tURh.cjs} +125 -45
  84. package/dist/shared-L-63tURh.cjs.map +1 -0
  85. package/dist/sheet-Biw_rI4_.js +1 -0
  86. package/dist/sheet-D_grHnaJ.js +7 -0
  87. package/dist/sheet-D_grHnaJ.js.map +1 -0
  88. package/dist/{sidecar-cCzTDkzg.mjs → sidecar-B7Q2P71F.mjs} +3 -3
  89. package/dist/{sidecar-cCzTDkzg.mjs.map → sidecar-B7Q2P71F.mjs.map} +1 -1
  90. package/dist/{style-a6ccye6R.js → style-CRs-vfY1.js} +10 -10
  91. package/dist/{style-a6ccye6R.js.map → style-CRs-vfY1.js.map} +1 -1
  92. package/dist/{styleStore-Ceoaqa5U.js → styleStore-HI4V2puu.js} +6 -6
  93. package/dist/{styleStore-Ceoaqa5U.js.map → styleStore-HI4V2puu.js.map} +1 -1
  94. package/dist/{token-Ci73NE6h.js → token-BX5jRxMb.js} +2 -2
  95. package/dist/{token-Ci73NE6h.js.map → token-BX5jRxMb.js.map} +1 -1
  96. package/dist/{trace-DDsvwdF0.js → trace-DdFJPELS.js} +3 -3
  97. package/dist/{trace-DDsvwdF0.js.map → trace-DdFJPELS.js.map} +1 -1
  98. package/dist/{transform-BkxIouPX.js → transform-BZ4jPwy3.js} +2 -2
  99. package/dist/{transform-BkxIouPX.js.map → transform-BZ4jPwy3.js.map} +1 -1
  100. package/dist/types/compiler/transform/evaluator/lazy_bindings.d.ts +22 -0
  101. package/dist/types/compiler/transform/evaluator/tracer.d.ts +1 -0
  102. package/dist/types/compiler/transform/extract/utils/state.d.ts +3 -2
  103. package/dist/types/plugin/utils/filter.d.ts +11 -0
  104. package/dist/{utils-BO6Ix8t5.mjs → utils-D2QdzQkX.mjs} +4 -4
  105. package/dist/{utils-BO6Ix8t5.mjs.map → utils-D2QdzQkX.mjs.map} +1 -1
  106. package/dist/{utils-EG9gh2g3.mjs → utils-D3KR1ht8.mjs} +3 -3
  107. package/dist/{utils-EG9gh2g3.mjs.map → utils-D3KR1ht8.mjs.map} +1 -1
  108. package/dist/utils.js +3 -3
  109. package/dist/{value-B-ThmbY-.js → value-BhyWGLkf.js} +5 -5
  110. package/dist/{value-B-ThmbY-.js.map → value-BhyWGLkf.js.map} +1 -1
  111. package/dist/{webpack-WXAJ3IYn.mjs → webpack-DRegoWgj.mjs} +6 -6
  112. package/dist/{webpack-WXAJ3IYn.mjs.map → webpack-DRegoWgj.mjs.map} +1 -1
  113. package/entry/dev/sheet.ts +4 -5
  114. package/package.json +16 -1
  115. package/plugin/bundler/vite/plugin.ts +20 -17
  116. package/plugin/bundler/webpack/plugin.ts +1 -1
  117. package/plugin/nextjs/plugin.ts +1 -1
  118. package/plugin/utils/filter.ts +65 -1
  119. package/dist/compiler-AOb_VaKQ.mjs.map +0 -1
  120. package/dist/misc-CyZgGtc9.mjs.map +0 -1
  121. package/dist/shared-DY0kuBcN.cjs.map +0 -1
  122. package/dist/sheet-B-5idGtZ.js +0 -9
  123. package/dist/sheet-B-5idGtZ.js.map +0 -1
  124. package/dist/sheet-D4f9KYPf.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"hash-DCJkLls_.js","names":[],"sources":["../utils/hash.ts","../utils/object.ts","../config/config/dev.ts","../utils/trace.ts","../builder/data/debug.ts","../atomic/utils/format.ts","../atomic/utils/cssIdent.ts","../atomic/utils/debug.ts","../atomic/utils/hash.ts"],"sourcesContent":["const BASE62_CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\nexport function toBase62(value: number) {\n let result = '';\n\n do {\n result = BASE62_CHARS[value % 62] + result;\n value = Math.floor(value / 62);\n } while (value > 0);\n\n return result;\n}\n\nexport function hashString(str: string) {\n let hash = 0x811c9dc5;\n\n for (let i = 0; i < str.length; i++) {\n hash = Math.imul(hash ^ str.charCodeAt(i), 0x01000193);\n }\n\n return (hash >>> 0).toString(36).padEnd(7, '0');\n}\n\nexport function normalizeHashLength(length: number) {\n return Number.isFinite(length) ? Math.max(1, Math.floor(length)) : 7;\n}\n","export function clone<T>(\n data: T | null | undefined,\n) {\n let cloned: Record<string, unknown> = {};\n\n for (let key in data) {\n cloned[key] = data[key];\n }\n\n return cloned as T;\n}\n\nexport function merge<T>(\n data1: T | null | undefined,\n data2: T | null | undefined,\n) {\n let merged: Record<string, unknown> = {};\n\n if (data1) {\n for (let key in data1) {\n merged[key] = data1[key];\n }\n }\n\n if (data2) {\n for (let key in data2) {\n merged[key] = data2[key];\n }\n }\n\n return merged as T;\n}\n\nexport function assign(\n target: unknown,\n data: object,\n) {\n for (let key in data) {\n (target as any)[key] = (data as any)[key];\n }\n}\n\nexport function set(\n target: unknown,\n field: string | symbol,\n data: unknown,\n) {\n (target as any)[field] = data;\n}\n\nexport function get(\n target: unknown,\n field: string | symbol,\n): unknown {\n return (target as any)[field] ?? null;\n}\n\nexport function unsetAll(obj: object) {\n for (const key of Object.keys(obj)) {\n delete (obj as any)[key];\n }\n}\n\nexport function hasOwn(\n target: object,\n field: PropertyKey,\n) {\n return Object.prototype.hasOwnProperty.call(target, field);\n}\n\nexport function toArray<T>(\n value: T | T[] | null | undefined,\n): T[] {\n return Array.isArray(value) ? value : (value ? [value] : []);\n}\n\nexport function isFunction(\n value: unknown,\n): value is Function {\n return typeof value === 'function';\n}\n\nexport function isPromiseLike<T>(\n value: T | Promise<T>,\n): value is Promise<T> {\n return typeof value === 'object' && value !== null && 'then' in value;\n}\n","import { globalData } from '../../utils/global';\nimport { normalizeHashLength } from '../../utils/hash';\nimport { unsetAll } from '../../utils/object';\nimport type { BuildDevConfig } from '../build';\nimport type { SourcemapLocationMode, StylePriorityMode } from '../types';\nimport { setDebugClassNameDefault } from './debug';\nimport { RUNTIME_CONFIG } from './runtime';\n\nexport type DevConfig = {\n isDev: boolean;\n\n isCheckSelectorEnabled: boolean;\n isSourcemapEnabled: boolean;\n isLocalClassNameEnabled: boolean;\n\n sheetMaxRules: number;\n sheetStyleTagNonce: string | null;\n hashLength: number | null;\n\n stylePriorityMode: StylePriorityMode;\n sourcemapLocationMode: SourcemapLocationMode;\n\n isElementClassNameEnabled: boolean;\n};\n\nexport const DEV_CONFIG_DEFAULT: DevConfig = {\n isDev: false,\n\n isCheckSelectorEnabled: true,\n isSourcemapEnabled: true,\n isLocalClassNameEnabled: true,\n\n sheetMaxRules: 1000,\n sheetStyleTagNonce: null,\n hashLength: null,\n\n stylePriorityMode: 'sort',\n sourcemapLocationMode: 'style',\n\n isElementClassNameEnabled: true,\n};\n\ntype PartialDevConfig = {\n config: Partial<DevConfig> | null;\n};\n\nexport const IS_DEV = globalData<{ isDev: boolean; }>(\n 'config.dev.isDev',\n () => ({ isDev: false }),\n);\n\nexport const DEV_CONFIG = globalData<DevConfig>(\n 'config.dev',\n () => ({ ...DEV_CONFIG_DEFAULT }),\n);\n\nexport const configPlugin = globalData<PartialDevConfig>(\n 'config.dev.plugin',\n () => ({ config: null }),\n);\n\nconst configBase = globalData<PartialDevConfig>(\n 'config.dev.base',\n () => ({ config: null }),\n);\n\nconst configUtils = globalData<PartialDevConfig>(\n 'config.dev.utils',\n () => ({ config: null }),\n);\n\nexport type DevRuntimeOptions = {\n priorityMode?: StylePriorityMode | null;\n sourcemapMode?: SourcemapLocationMode | null;\n elementClassName?: boolean | null;\n checkSelector?: boolean | null;\n hashLength?: number | null;\n};\n\nexport function getBuildDevConfig() {\n return configPlugin.config;\n}\n\nexport function setBuildDevConfig(config: BuildDevConfig) {\n const checkSelector = config.checkSelector === 'force' ? false : config.checkSelector;\n\n IS_DEV.isDev = true;\n\n setOptions(configPlugin, { ...config, checkSelector }, null);\n rebuildDevConfig();\n}\n\nexport function setStyleDevMode(isDev: boolean) {\n IS_DEV.isDev = isDev;\n rebuildDevConfig();\n}\n\nexport function setDevUtilsRuntimeOptions(options: DevRuntimeOptions | null) {\n setOptions(configUtils, options, null);\n rebuildDevConfig();\n}\n\nexport function setDevRuntimeOptions(options: DevRuntimeOptions | null) {\n setOptions(configBase, options, { ...DEV_CONFIG_DEFAULT });\n rebuildDevConfig();\n}\n\nfunction rebuildDevConfig() {\n unsetAll(DEV_CONFIG);\n\n Object.assign(\n DEV_CONFIG,\n DEV_CONFIG_DEFAULT,\n configBase.config,\n configPlugin.config,\n configUtils.config,\n );\n\n DEV_CONFIG.isDev = IS_DEV.isDev;\n DEV_CONFIG.isLocalClassNameEnabled = DEV_CONFIG.isDev;\n setDebugClassNameDefault(DEV_CONFIG.isDev);\n\n RUNTIME_CONFIG.changes += 1;\n}\n\nfunction setOptions(\n partialConfig: PartialDevConfig,\n options: DevRuntimeOptions | null,\n defaultConfig: DevConfig | null,\n) {\n if (!options) {\n partialConfig.config = defaultConfig;\n return;\n }\n\n if (!partialConfig.config) {\n partialConfig.config = defaultConfig || {};\n }\n\n const config = partialConfig.config;\n\n if (options.priorityMode) {\n config.stylePriorityMode = options.priorityMode;\n }\n\n if (options.sourcemapMode) {\n config.sourcemapLocationMode = options.sourcemapMode;\n }\n\n if (typeof options.elementClassName === 'boolean') {\n config.isElementClassNameEnabled = options.elementClassName;\n }\n\n if (typeof options.checkSelector === 'boolean') {\n config.isCheckSelectorEnabled = options.checkSelector;\n }\n\n if (typeof options.hashLength === 'number') {\n config.hashLength = normalizeHashLength(options.hashLength);\n }\n}\n","const FN_MARKER = '$fn_';\n\nexport function traceMarker(fn: unknown, name: string) {\n Object.defineProperty(fn, 'name', {\n value: FN_MARKER + name,\n configurable: true,\n });\n}\n\n// Regex to capture file paths, line numbers, and column numbers from stack frames.\n// Handles standard paths and URLs after parenthesized frame labels are removed.\nconst CALLSITE_REGEX = /(.+):(\\d+):(\\d+)$/;\n\nexport type TraceCallsite = {\n stack: string;\n filePath: string;\n sourceUrl?: string;\n sourceContent?: string;\n line: number;\n column: number;\n};\n\nexport function traceCallsite(): TraceCallsite | null {\n const error = new Error();\n\n const adjustedError = traceAdjustError(error);\n const stack = adjustedError.stack || '';\n const lines = stack.split('\\n');\n\n const frames = lines.slice(1);\n const parsedFrames = frames.map(parseStackFrame).filter((frame) => frame !== null);\n if (!parsedFrames.length) return null;\n\n const targetFrame = parsedFrames.find((frame) => !isInternalCallsite(frame.filePath)) ??\n parsedFrames[0];\n\n return {\n stack: [lines[0] || 'Error', createStackFrameLine(targetFrame)].join('\\n'),\n filePath: targetFrame.filePath,\n sourceUrl: targetFrame.sourceUrl,\n line: targetFrame.line,\n column: targetFrame.column,\n };\n}\n\ntype ParsedStackFrame = {\n filePath: string;\n sourceUrl?: string;\n line: number;\n column: number;\n};\n\nfunction parseStackFrame(lineText: string): ParsedStackFrame | null {\n const match = getStackFrameLocationText(lineText).match(CALLSITE_REGEX);\n if (!match) return null;\n const rawFilePath = normalizeCallsiteSourceUrl(match[1]);\n\n return {\n filePath: normalizeCallsiteFilePath(rawFilePath),\n sourceUrl: isFetchableCallsiteSourceUrl(rawFilePath) ? rawFilePath : undefined,\n line: parseInt(match[2], 10),\n column: parseInt(match[3], 10),\n };\n}\n\nfunction getStackFrameLocationText(lineText: string) {\n let frame = lineText.trim().replace(/^at\\s+/, '');\n\n if (frame.endsWith(')')) {\n const parenIndex = frame.lastIndexOf('(');\n\n if (parenIndex !== -1) {\n frame = frame.slice(parenIndex + 1, -1);\n }\n }\n\n return frame;\n}\n\nexport function normalizeCallsiteSourceUrl(source: string) {\n let filePath = source.trim();\n\n try {\n filePath = decodeURI(filePath);\n } catch {\n // Keep the raw path if a bundler produced a partially escaped URL.\n }\n\n if (filePath.startsWith('source:///at ') || filePath.startsWith('source:///at%20')) {\n filePath = filePath.slice('source:///'.length);\n }\n\n const strayAtMatch = filePath.match(/(?:^|\\/)at\\s+([a-zA-Z][a-zA-Z\\d+.-]*:\\/\\/.+|\\/.+)$/);\n\n return strayAtMatch ? strayAtMatch[1] : filePath.replace(/^at\\s+/, '');\n}\n\nfunction normalizeCallsiteFilePath(filePath: string) {\n filePath = normalizeCallsiteSourceUrl(filePath);\n\n // strip query strings (e.g., file.ts?vue&type=script or file.js?v=123)\n const queryIndex = findFirstIndex(filePath, ['?', '#']);\n if (queryIndex !== -1) {\n filePath = filePath.substring(0, queryIndex);\n }\n\n // clean up potential absolute URL schemes left over by web bundlers (e.g., file:///)\n filePath = filePath.replace(/^file:\\/\\/\\/?/, '');\n\n if (filePath.startsWith('/@fs/')) {\n filePath = '/' + filePath.slice('/@fs/'.length);\n }\n\n const webpackInternalMatch = filePath.match(/^webpack-internal:\\/\\/\\/(?:\\([^)]+\\)\\/)?(.+)$/);\n if (webpackInternalMatch) {\n filePath = webpackInternalMatch[1];\n }\n\n const webpackSourceMatch = filePath.match(/^webpack:\\/\\/[^/]+\\/(.+)$/);\n if (webpackSourceMatch) {\n filePath = webpackSourceMatch[1];\n }\n\n return filePath;\n}\n\nfunction isFetchableCallsiteSourceUrl(filePath: string) {\n return /^https?:\\/\\//.test(filePath) || filePath.startsWith('/');\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction createStackFrameLine(frame: ParsedStackFrame) {\n return ` at ${frame.filePath}:${frame.line}:${frame.column}`;\n}\n\nfunction isInternalCallsite(filePath: string) {\n const normalized = filePath.replace(/\\\\/g, '/');\n\n return normalized.startsWith('node:') ||\n normalized.startsWith('internal/') ||\n normalized.includes('/node_modules/') ||\n normalized.includes('/packages/style/dist/') ||\n normalized.includes('/packages/style/builder/') ||\n normalized.includes('/packages/style/css/') ||\n normalized.includes('/packages/style/runtime/') ||\n normalized.includes('/packages/style/utils/trace.');\n}\n\nexport type TraceErrorOptions = TraceAdjustErrorOptions & {\n stack?: string | null;\n name?: string | null;\n};\n\nexport function traceError(message: string | null, options: TraceErrorOptions = {}) {\n const error = new Error(message || '');\n\n error.name = options.name || 'StyleError';\n\n if (typeof options.stack === 'string') {\n error.stack = options.stack;\n return error;\n }\n\n return traceAdjustError(error, options);\n}\n\nexport type TraceAdjustErrorOptions = {\n offset?: number;\n limit?: number;\n};\n\nexport function traceAdjustError(error: Error, options: TraceAdjustErrorOptions = {}) {\n const offset = options.offset ?? 0;\n\n const stack = error.stack;\n\n if (!stack) return error;\n\n const lines = stack.split('\\n');\n\n const markerIndex = lines.findIndex((line) => line.includes(FN_MARKER));\n\n // marker not found\n if (markerIndex === -1) {\n return error;\n }\n\n const traced = new Error(error.message);\n traced.name = error.name;\n\n const frameStartIndex = Math.max(markerIndex + 1 + offset, 1);\n\n let frames = lines.slice(frameStartIndex);\n\n if (options.limit) {\n frames = frames.slice(0, options.limit);\n }\n\n traced.stack = [lines[0], ...frames].join('\\n');\n\n return traced;\n}\n","import { DEV_CONFIG } from '../../config/config/dev';\nimport { hashString } from '../../utils/hash';\nimport { type TraceCallsite } from '../../utils/trace';\n\nexport const LOC_LINE = 0;\nexport const LOC_COL = 1;\n\nexport const TRACE_STYLE = 0;\nexport const TRACE_VALUE = 1;\n\nexport const LABEL_SHORT = 0;\nexport const LABEL_LONG = 1;\nexport const LABEL_FILE = 2;\n\nexport type DebugLoc = [\n line: number,\n column: number,\n trace?: number,\n sourceUrl?: string,\n sourceContent?: string,\n];\n\ntype DebugLabel = [\n short: string,\n long: string,\n file: string,\n];\n\nexport type DebugData = {\n $$debug: true;\n loc: DebugLoc;\n label: DebugLabel;\n fields?: Record<string, DebugLoc | Record<number, DebugLoc>>;\n classNames?: Record<string, DebugLoc>;\n vars?: Record<string, string>;\n sourceUrl: string;\n code?: string;\n};\n\nexport function isDebugData(value: unknown): value is DebugData {\n if (!value || typeof value !== 'object') return false;\n\n const data = value as Partial<DebugData>;\n return data.$$debug === true && Array.isArray(data.loc) && Array.isArray(data.label);\n}\n\nexport function getDebugCallsiteId(debug: DebugData) {\n const label = debug.label[LABEL_SHORT] || debug.label[LABEL_LONG];\n\n if (!label) return null;\n\n const hash = debug.sourceUrl + '\\n' + debug.loc[LOC_LINE] + ':' + debug.loc[LOC_COL] + '\\n' +\n (debug.label[LABEL_LONG] || label);\n\n return label + '_' + hashString(hash);\n}\n\nexport function getTraceCallsiteId(callsite: TraceCallsite) {\n const hash = callsite.filePath + '\\n' + callsite.line + ':' + callsite.column;\n\n return hashString(hash);\n}\n\nexport function getDebugCallsite(debug: DebugData): TraceCallsite {\n return createDebugCallsite(debug.loc, debug);\n}\n\nexport function getDebugFieldCallsite(\n debug: DebugData | null,\n field: string,\n): TraceCallsite | null {\n if (!debug) return null;\n\n const loc = getDebugFieldLoc(debug, field);\n\n return loc ? createDebugCallsite(loc, debug) : null;\n}\n\nexport function getDebugFieldVarName(\n debug: DebugData | null,\n field: string,\n) {\n return debug?.vars?.[field] ?? null;\n}\n\nexport function getDebugFieldLoc(\n debug: DebugData | null,\n field: string,\n) {\n const loc = debug?.fields?.[field];\n if (!loc) return null;\n if (Array.isArray(loc)) return loc;\n\n const trace = DEV_CONFIG.sourcemapLocationMode === 'value'\n ? TRACE_VALUE\n : TRACE_STYLE;\n\n return loc[trace] ?? loc[TRACE_STYLE] ?? loc[TRACE_VALUE] ?? null;\n}\n\nfunction createDebugCallsite(loc: DebugLoc, debug: DebugData): TraceCallsite {\n const [line, column] = loc;\n const sourceUrl = loc[3] ?? debug.sourceUrl;\n const sourceContent = loc[4] ?? debug.code;\n\n return {\n stack: `Error\\n at ${sourceUrl}:${line}:${column}`,\n filePath: sourceUrl,\n sourceUrl,\n sourceContent,\n line,\n column,\n };\n}\n","type FormatInfo = { [key: string]: string | null; };\n\ntype NameFormatFn<Info> = (info: Info) => string;\ntype NameFormat<Info> = string | NameFormatFn<Info>;\n\ntype CompiledSegment<Key extends string> = {\n optional: boolean;\n parts: CompiledPart<Key>[];\n};\n\ntype CompiledPart<Key extends string> =\n | { type: 'text'; value: string; }\n | {\n type: 'token';\n key: Key;\n maxLength: number | null;\n truncate: boolean;\n };\n\nconst TOKEN_REGEX = /\\(([a-zA-Z][a-zA-Z0-9]*)(?::([0-9]+)(!)?)?\\)/g;\nconst OPTIONAL_REGEX = /\\[([^[\\]]*)\\]/g;\n\nconst HASH_TOKEN = '$hash';\n\nexport type NameFormatter<Info extends object> = ReturnType<typeof createNameFormatter<Info>>;\n\nexport function createNameFormatter<Info extends object>(\n keys: readonly (keyof Info & string)[],\n) {\n const keySet = new Set<string>(keys);\n const cache = new Map<string, NameFormatFn<Info>>();\n\n function getFormatFn(format: NameFormat<Info>) {\n if (typeof format === 'function') return format;\n\n let fn = cache.get(format);\n\n if (!fn) {\n fn = compileFormat(format, keySet);\n cache.set(format, fn);\n }\n\n return fn;\n }\n\n return function format(format: NameFormat<Info>, hash: string | null, info: Info) {\n const name = getFormatFn(format)(info);\n\n if (!hash) return name;\n\n if (name.includes(HASH_TOKEN)) {\n return name.replace(HASH_TOKEN, hash);\n }\n\n return name ? (name + '--' + hash) : hash;\n };\n}\n\nfunction compileFormat<Info extends object>(\n format: string,\n keySet: ReadonlySet<string>,\n): NameFormatFn<Info> {\n type Key = keyof Info & string;\n const segments = compileSegments<Key>(format, keySet);\n\n return (info) => {\n let name = '';\n\n for (const segment of segments) {\n const text = formatSegment(info, segment);\n\n if (text === null) {\n if (!segment.optional) return '';\n continue;\n }\n\n name += text;\n }\n\n return name;\n };\n}\n\nfunction compileSegments<Key extends string>(\n format: string,\n keySet: ReadonlySet<string>,\n) {\n const segments: CompiledSegment<Key>[] = [];\n let lastIndex = 0;\n\n for (const match of format.matchAll(OPTIONAL_REGEX)) {\n const index = match.index ?? 0;\n\n if (index > lastIndex) {\n segments.push({\n optional: false,\n parts: compileParts<Key>(format.slice(lastIndex, index), keySet),\n });\n }\n\n segments.push({\n optional: true,\n parts: compileParts<Key>(match[1], keySet),\n });\n\n lastIndex = index + match[0].length;\n }\n\n if (lastIndex < format.length) {\n segments.push({\n optional: false,\n parts: compileParts<Key>(format.slice(lastIndex), keySet),\n });\n }\n\n return segments;\n}\n\nfunction compileParts<Key extends string>(\n segment: string,\n keySet: ReadonlySet<string>,\n) {\n const parts: CompiledPart<Key>[] = [];\n let lastIndex = 0;\n\n for (const match of segment.matchAll(TOKEN_REGEX)) {\n const index = match.index ?? 0;\n const key = match[1];\n\n if (!keySet.has(key)) continue;\n\n if (index > lastIndex) {\n parts.push({ type: 'text', value: segment.slice(lastIndex, index) });\n }\n\n parts.push({\n type: 'token',\n key: key as Key,\n maxLength: match[2] ? Number(match[2]) : null,\n truncate: Boolean(match[3]),\n });\n\n lastIndex = index + match[0].length;\n }\n\n if (lastIndex < segment.length) {\n parts.push({ type: 'text', value: segment.slice(lastIndex) });\n }\n\n return parts;\n}\n\nfunction formatSegment<Info extends object, Key extends keyof Info & string>(\n info: Info,\n segment: CompiledSegment<Key>,\n) {\n let text = '';\n\n for (const part of segment.parts) {\n if (part.type === 'text') {\n text += part.value;\n continue;\n }\n\n const value = formatTokenValue(\n (info as FormatInfo)[part.key],\n part.maxLength,\n part.truncate,\n );\n if (value === null) {\n if (segment.optional) return null;\n continue;\n }\n\n text += value;\n }\n\n return text;\n}\n\nfunction formatTokenValue(\n value: string | null,\n maxLength: number | null,\n truncate: boolean,\n) {\n if (!value) return null;\n if (!maxLength) return value;\n\n if (!Number.isFinite(maxLength) || maxLength < 0 || value.length <= maxLength) return value;\n\n return truncate ? value.slice(0, maxLength) : null;\n}\n","export function escapeCssIdent(ident: string): string {\n let result = '';\n\n for (let i = 0; i < ident.length; i++) {\n const char = ident.charAt(i);\n const code = ident.charCodeAt(i);\n const nextCode = ident.charCodeAt(i + 1);\n\n if (code === 0) {\n result += '\\uFFFD';\n continue;\n }\n\n if (\n (code >= 1 && code <= 31) ||\n code === 127 ||\n (i === 0 && code >= 48 && code <= 57) ||\n (i === 1 && code >= 48 && code <= 57 && ident.charCodeAt(0) === 45)\n ) {\n result += '\\\\' + code.toString(16) + ' ';\n continue;\n }\n\n if (i === 0 && code === 45 && ident.length === 1) {\n result += '\\\\-';\n continue;\n }\n\n if (code >= 0xD800 && code <= 0xDBFF && nextCode >= 0xDC00 && nextCode <= 0xDFFF) {\n result += char + ident.charAt(++i);\n continue;\n }\n\n if (\n code >= 128 ||\n code === 45 ||\n code === 95 ||\n (code >= 48 && code <= 57) ||\n (code >= 65 && code <= 90) ||\n (code >= 97 && code <= 122)\n ) {\n result += char;\n continue;\n }\n\n result += '\\\\' + char;\n }\n\n return result;\n}\n\nexport function sanitizeCssIdentName(value: string, fallback: string = '') {\n return value.replace(/[^a-zA-Z0-9_-]+/g, '-').replace(/^-+|-+$/g, '') || fallback;\n}\n","import { sanitizeCssIdentName } from './cssIdent';\n\nexport function normalizeDebugKeywordValue(value: string) {\n const normalized = value.trim().toLowerCase();\n return /^[a-z][a-z0-9-]*$/.test(normalized) ? normalized : null;\n}\n\nexport function sanitizeDebugName(value: string | undefined) {\n if (!value) return '';\n\n const normalized = value\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .toLowerCase();\n\n return sanitizeCssIdentName(normalized, '');\n}\n\nexport function normalizePropertyName(property: string) {\n return property\n .trim()\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/_/g, '-')\n .toLowerCase();\n}\n\nexport function sanitizeDebugPropertyName(property: string) {\n let name = property;\n\n if (name.charCodeAt(0) === 45 && name.charCodeAt(1) === 45) {\n name = name.slice(2);\n }\n\n return name\n .replace(/[^a-z0-9_-]+/g, '-')\n .replace(/[-_]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n","import { hashString, normalizeHashLength } from '../../utils/hash';\n\nexport function getIdentifierSafeHash(value: string, startLength = 7) {\n const normalizedStartLength = normalizeHashLength(startLength);\n return getIdentifierSafeHashValue(hashString(value)).slice(0, normalizedStartLength);\n}\n\nfunction getIdentifierSafeHashValue(hash: string) {\n const first = hash.charCodeAt(0);\n\n if (first < 48 || first > 57) return hash;\n\n return String.fromCharCode(97 + first - 48) + hash.slice(1);\n}\n"],"mappings":";;;AAaA,SAAgB,WAAW,KAAa;CACtC,IAAI,OAAO;CAEX,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,KAC9B,OAAO,KAAK,KAAK,OAAO,IAAI,WAAW,CAAC,GAAG,QAAU;CAGvD,QAAQ,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,GAAG,GAAG;AAChD;AAEA,SAAgB,oBAAoB,QAAgB;CAClD,OAAO,OAAO,SAAS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KAAK,MAAM,CAAC;AAC5D"}
1
+ {"version":3,"file":"hash-CjTP-uES.js","names":[],"sources":["../utils/hash.ts","../utils/object.ts","../config/config/dev.ts","../utils/trace.ts","../builder/data/debug.ts","../atomic/utils/format.ts","../atomic/utils/cssIdent.ts","../atomic/utils/debug.ts","../atomic/utils/hash.ts"],"sourcesContent":["const BASE62_CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\nexport function toBase62(value: number) {\n let result = '';\n\n do {\n result = BASE62_CHARS[value % 62] + result;\n value = Math.floor(value / 62);\n } while (value > 0);\n\n return result;\n}\n\nexport function hashString(str: string) {\n let hash = 0x811c9dc5;\n\n for (let i = 0; i < str.length; i++) {\n hash = Math.imul(hash ^ str.charCodeAt(i), 0x01000193);\n }\n\n return (hash >>> 0).toString(36).padEnd(7, '0');\n}\n\nexport function normalizeHashLength(length: number) {\n return Number.isFinite(length) ? Math.max(1, Math.floor(length)) : 7;\n}\n","export function clone<T>(\n data: T | null | undefined,\n) {\n let cloned: Record<string, unknown> = {};\n\n for (let key in data) {\n cloned[key] = data[key];\n }\n\n return cloned as T;\n}\n\nexport function merge<T>(\n data1: T | null | undefined,\n data2: T | null | undefined,\n) {\n let merged: Record<string, unknown> = {};\n\n if (data1) {\n for (let key in data1) {\n merged[key] = data1[key];\n }\n }\n\n if (data2) {\n for (let key in data2) {\n merged[key] = data2[key];\n }\n }\n\n return merged as T;\n}\n\nexport function assign(\n target: unknown,\n data: object,\n) {\n for (let key in data) {\n (target as any)[key] = (data as any)[key];\n }\n}\n\nexport function set(\n target: unknown,\n field: string | symbol,\n data: unknown,\n) {\n (target as any)[field] = data;\n}\n\nexport function get(\n target: unknown,\n field: string | symbol,\n): unknown {\n return (target as any)[field] ?? null;\n}\n\nexport function unsetAll(obj: object) {\n for (const key of Object.keys(obj)) {\n delete (obj as any)[key];\n }\n}\n\nexport function hasOwn(\n target: object,\n field: PropertyKey,\n) {\n return Object.prototype.hasOwnProperty.call(target, field);\n}\n\nexport function toArray<T>(\n value: T | T[] | null | undefined,\n): T[] {\n return Array.isArray(value) ? value : (value ? [value] : []);\n}\n\nexport function isFunction(\n value: unknown,\n): value is Function {\n return typeof value === 'function';\n}\n\nexport function isPromiseLike<T>(\n value: T | Promise<T>,\n): value is Promise<T> {\n return typeof value === 'object' && value !== null && 'then' in value;\n}\n","import { globalData } from '../../utils/global';\nimport { normalizeHashLength } from '../../utils/hash';\nimport { unsetAll } from '../../utils/object';\nimport type { BuildDevConfig } from '../build';\nimport type { SourcemapLocationMode, StylePriorityMode } from '../types';\nimport { setDebugClassNameDefault } from './debug';\nimport { RUNTIME_CONFIG } from './runtime';\n\nexport type DevConfig = {\n isDev: boolean;\n\n isCheckSelectorEnabled: boolean;\n isSourcemapEnabled: boolean;\n isLocalClassNameEnabled: boolean;\n\n sheetMaxRules: number;\n sheetStyleTagNonce: string | null;\n hashLength: number | null;\n\n stylePriorityMode: StylePriorityMode;\n sourcemapLocationMode: SourcemapLocationMode;\n\n isElementClassNameEnabled: boolean;\n};\n\nexport const DEV_CONFIG_DEFAULT: DevConfig = {\n isDev: false,\n\n isCheckSelectorEnabled: true,\n isSourcemapEnabled: true,\n isLocalClassNameEnabled: true,\n\n sheetMaxRules: 1000,\n sheetStyleTagNonce: null,\n hashLength: null,\n\n stylePriorityMode: 'sort',\n sourcemapLocationMode: 'style',\n\n isElementClassNameEnabled: true,\n};\n\ntype PartialDevConfig = {\n config: Partial<DevConfig> | null;\n};\n\nexport const IS_DEV = globalData<{ isDev: boolean; }>(\n 'config.dev.isDev',\n () => ({ isDev: false }),\n);\n\nexport const DEV_CONFIG = globalData<DevConfig>(\n 'config.dev',\n () => ({ ...DEV_CONFIG_DEFAULT }),\n);\n\nexport const configPlugin = globalData<PartialDevConfig>(\n 'config.dev.plugin',\n () => ({ config: null }),\n);\n\nconst configBase = globalData<PartialDevConfig>(\n 'config.dev.base',\n () => ({ config: null }),\n);\n\nconst configUtils = globalData<PartialDevConfig>(\n 'config.dev.utils',\n () => ({ config: null }),\n);\n\nexport type DevRuntimeOptions = {\n priorityMode?: StylePriorityMode | null;\n sourcemapMode?: SourcemapLocationMode | null;\n elementClassName?: boolean | null;\n checkSelector?: boolean | null;\n hashLength?: number | null;\n};\n\nexport function getBuildDevConfig() {\n return configPlugin.config;\n}\n\nexport function setBuildDevConfig(config: BuildDevConfig) {\n const checkSelector = config.checkSelector === 'force' ? false : config.checkSelector;\n\n IS_DEV.isDev = true;\n\n setOptions(configPlugin, { ...config, checkSelector }, null);\n rebuildDevConfig();\n}\n\nexport function setStyleDevMode(isDev: boolean) {\n IS_DEV.isDev = isDev;\n rebuildDevConfig();\n}\n\nexport function setDevUtilsRuntimeOptions(options: DevRuntimeOptions | null) {\n setOptions(configUtils, options, null);\n rebuildDevConfig();\n}\n\nexport function setDevRuntimeOptions(options: DevRuntimeOptions | null) {\n setOptions(configBase, options, { ...DEV_CONFIG_DEFAULT });\n rebuildDevConfig();\n}\n\nfunction rebuildDevConfig() {\n unsetAll(DEV_CONFIG);\n\n Object.assign(\n DEV_CONFIG,\n DEV_CONFIG_DEFAULT,\n configBase.config,\n configPlugin.config,\n configUtils.config,\n );\n\n DEV_CONFIG.isDev = IS_DEV.isDev;\n DEV_CONFIG.isLocalClassNameEnabled = DEV_CONFIG.isDev;\n setDebugClassNameDefault(DEV_CONFIG.isDev);\n\n RUNTIME_CONFIG.changes += 1;\n}\n\nfunction setOptions(\n partialConfig: PartialDevConfig,\n options: DevRuntimeOptions | null,\n defaultConfig: DevConfig | null,\n) {\n if (!options) {\n partialConfig.config = defaultConfig;\n return;\n }\n\n if (!partialConfig.config) {\n partialConfig.config = defaultConfig || {};\n }\n\n const config = partialConfig.config;\n\n if (options.priorityMode) {\n config.stylePriorityMode = options.priorityMode;\n }\n\n if (options.sourcemapMode) {\n config.sourcemapLocationMode = options.sourcemapMode;\n }\n\n if (typeof options.elementClassName === 'boolean') {\n config.isElementClassNameEnabled = options.elementClassName;\n }\n\n if (typeof options.checkSelector === 'boolean') {\n config.isCheckSelectorEnabled = options.checkSelector;\n }\n\n if (typeof options.hashLength === 'number') {\n config.hashLength = normalizeHashLength(options.hashLength);\n }\n}\n","const FN_MARKER = '$fn_';\n\nexport function traceMarker(fn: unknown, name: string) {\n Object.defineProperty(fn, 'name', {\n value: FN_MARKER + name,\n configurable: true,\n });\n}\n\n// Regex to capture file paths, line numbers, and column numbers from stack frames.\n// Handles standard paths and URLs after parenthesized frame labels are removed.\nconst CALLSITE_REGEX = /(.+):(\\d+):(\\d+)$/;\n\nexport type TraceCallsite = {\n stack: string;\n filePath: string;\n sourceUrl?: string;\n sourceContent?: string;\n line: number;\n column: number;\n};\n\nexport function traceCallsite(): TraceCallsite | null {\n const error = new Error();\n\n const adjustedError = traceAdjustError(error);\n const stack = adjustedError.stack || '';\n const lines = stack.split('\\n');\n\n const frames = lines.slice(1);\n const parsedFrames = frames.map(parseStackFrame).filter((frame) => frame !== null);\n if (!parsedFrames.length) return null;\n\n const targetFrame = parsedFrames.find((frame) => !isInternalCallsite(frame.filePath)) ??\n parsedFrames[0];\n\n return {\n stack: [lines[0] || 'Error', createStackFrameLine(targetFrame)].join('\\n'),\n filePath: targetFrame.filePath,\n sourceUrl: targetFrame.sourceUrl,\n line: targetFrame.line,\n column: targetFrame.column,\n };\n}\n\ntype ParsedStackFrame = {\n filePath: string;\n sourceUrl?: string;\n line: number;\n column: number;\n};\n\nfunction parseStackFrame(lineText: string): ParsedStackFrame | null {\n const match = getStackFrameLocationText(lineText).match(CALLSITE_REGEX);\n if (!match) return null;\n const rawFilePath = normalizeCallsiteSourceUrl(match[1]);\n\n return {\n filePath: normalizeCallsiteFilePath(rawFilePath),\n sourceUrl: isFetchableCallsiteSourceUrl(rawFilePath) ? rawFilePath : undefined,\n line: parseInt(match[2], 10),\n column: parseInt(match[3], 10),\n };\n}\n\nfunction getStackFrameLocationText(lineText: string) {\n let frame = lineText.trim().replace(/^at\\s+/, '');\n\n if (frame.endsWith(')')) {\n const parenIndex = frame.lastIndexOf('(');\n\n if (parenIndex !== -1) {\n frame = frame.slice(parenIndex + 1, -1);\n }\n }\n\n return frame;\n}\n\nexport function normalizeCallsiteSourceUrl(source: string) {\n let filePath = source.trim();\n\n try {\n filePath = decodeURI(filePath);\n } catch {\n // Keep the raw path if a bundler produced a partially escaped URL.\n }\n\n if (filePath.startsWith('source:///at ') || filePath.startsWith('source:///at%20')) {\n filePath = filePath.slice('source:///'.length);\n }\n\n const strayAtMatch = filePath.match(/(?:^|\\/)at\\s+([a-zA-Z][a-zA-Z\\d+.-]*:\\/\\/.+|\\/.+)$/);\n\n return strayAtMatch ? strayAtMatch[1] : filePath.replace(/^at\\s+/, '');\n}\n\nfunction normalizeCallsiteFilePath(filePath: string) {\n filePath = normalizeCallsiteSourceUrl(filePath);\n\n // strip query strings (e.g., file.ts?vue&type=script or file.js?v=123)\n const queryIndex = findFirstIndex(filePath, ['?', '#']);\n if (queryIndex !== -1) {\n filePath = filePath.substring(0, queryIndex);\n }\n\n // clean up potential absolute URL schemes left over by web bundlers (e.g., file:///)\n filePath = filePath.replace(/^file:\\/\\/\\/?/, '');\n\n if (filePath.startsWith('/@fs/')) {\n filePath = '/' + filePath.slice('/@fs/'.length);\n }\n\n const webpackInternalMatch = filePath.match(/^webpack-internal:\\/\\/\\/(?:\\([^)]+\\)\\/)?(.+)$/);\n if (webpackInternalMatch) {\n filePath = webpackInternalMatch[1];\n }\n\n const webpackSourceMatch = filePath.match(/^webpack:\\/\\/[^/]+\\/(.+)$/);\n if (webpackSourceMatch) {\n filePath = webpackSourceMatch[1];\n }\n\n return filePath;\n}\n\nfunction isFetchableCallsiteSourceUrl(filePath: string) {\n return /^https?:\\/\\//.test(filePath) || filePath.startsWith('/');\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction createStackFrameLine(frame: ParsedStackFrame) {\n return ` at ${frame.filePath}:${frame.line}:${frame.column}`;\n}\n\nfunction isInternalCallsite(filePath: string) {\n const normalized = filePath.replace(/\\\\/g, '/');\n\n return normalized.startsWith('node:') ||\n normalized.startsWith('internal/') ||\n normalized.includes('/node_modules/') ||\n normalized.includes('/packages/style/dist/') ||\n normalized.includes('/packages/style/builder/') ||\n normalized.includes('/packages/style/css/') ||\n normalized.includes('/packages/style/runtime/') ||\n normalized.includes('/packages/style/utils/trace.');\n}\n\nexport type TraceErrorOptions = TraceAdjustErrorOptions & {\n stack?: string | null;\n name?: string | null;\n};\n\nexport function traceError(message: string | null, options: TraceErrorOptions = {}) {\n const error = new Error(message || '');\n\n error.name = options.name || 'StyleError';\n\n if (typeof options.stack === 'string') {\n error.stack = options.stack;\n return error;\n }\n\n return traceAdjustError(error, options);\n}\n\nexport type TraceAdjustErrorOptions = {\n offset?: number;\n limit?: number;\n};\n\nexport function traceAdjustError(error: Error, options: TraceAdjustErrorOptions = {}) {\n const offset = options.offset ?? 0;\n\n const stack = error.stack;\n\n if (!stack) return error;\n\n const lines = stack.split('\\n');\n\n const markerIndex = lines.findIndex((line) => line.includes(FN_MARKER));\n\n // marker not found\n if (markerIndex === -1) {\n return error;\n }\n\n const traced = new Error(error.message);\n traced.name = error.name;\n\n const frameStartIndex = Math.max(markerIndex + 1 + offset, 1);\n\n let frames = lines.slice(frameStartIndex);\n\n if (options.limit) {\n frames = frames.slice(0, options.limit);\n }\n\n traced.stack = [lines[0], ...frames].join('\\n');\n\n return traced;\n}\n","import { DEV_CONFIG } from '../../config/config/dev';\nimport { hashString } from '../../utils/hash';\nimport { type TraceCallsite } from '../../utils/trace';\n\nexport const LOC_LINE = 0;\nexport const LOC_COL = 1;\n\nexport const TRACE_STYLE = 0;\nexport const TRACE_VALUE = 1;\n\nexport const LABEL_SHORT = 0;\nexport const LABEL_LONG = 1;\nexport const LABEL_FILE = 2;\n\nexport type DebugLoc = [\n line: number,\n column: number,\n trace?: number,\n sourceUrl?: string,\n sourceContent?: string,\n];\n\ntype DebugLabel = [\n short: string,\n long: string,\n file: string,\n];\n\nexport type DebugData = {\n $$debug: true;\n loc: DebugLoc;\n label: DebugLabel;\n fields?: Record<string, DebugLoc | Record<number, DebugLoc>>;\n classNames?: Record<string, DebugLoc>;\n vars?: Record<string, string>;\n sourceUrl: string;\n code?: string;\n};\n\nexport function isDebugData(value: unknown): value is DebugData {\n if (!value || typeof value !== 'object') return false;\n\n const data = value as Partial<DebugData>;\n return data.$$debug === true && Array.isArray(data.loc) && Array.isArray(data.label);\n}\n\nexport function getDebugCallsiteId(debug: DebugData) {\n const label = debug.label[LABEL_SHORT] || debug.label[LABEL_LONG];\n\n if (!label) return null;\n\n const hash = debug.sourceUrl + '\\n' + debug.loc[LOC_LINE] + ':' + debug.loc[LOC_COL] + '\\n' +\n (debug.label[LABEL_LONG] || label);\n\n return label + '_' + hashString(hash);\n}\n\nexport function getTraceCallsiteId(callsite: TraceCallsite) {\n const hash = callsite.filePath + '\\n' + callsite.line + ':' + callsite.column;\n\n return hashString(hash);\n}\n\nexport function getDebugCallsite(debug: DebugData): TraceCallsite {\n return createDebugCallsite(debug.loc, debug);\n}\n\nexport function getDebugFieldCallsite(\n debug: DebugData | null,\n field: string,\n): TraceCallsite | null {\n if (!debug) return null;\n\n const loc = getDebugFieldLoc(debug, field);\n\n return loc ? createDebugCallsite(loc, debug) : null;\n}\n\nexport function getDebugFieldVarName(\n debug: DebugData | null,\n field: string,\n) {\n return debug?.vars?.[field] ?? null;\n}\n\nexport function getDebugFieldLoc(\n debug: DebugData | null,\n field: string,\n) {\n const loc = debug?.fields?.[field];\n if (!loc) return null;\n if (Array.isArray(loc)) return loc;\n\n const trace = DEV_CONFIG.sourcemapLocationMode === 'value'\n ? TRACE_VALUE\n : TRACE_STYLE;\n\n return loc[trace] ?? loc[TRACE_STYLE] ?? loc[TRACE_VALUE] ?? null;\n}\n\nfunction createDebugCallsite(loc: DebugLoc, debug: DebugData): TraceCallsite {\n const [line, column] = loc;\n const sourceUrl = loc[3] ?? debug.sourceUrl;\n const sourceContent = loc[4] ?? debug.code;\n\n return {\n stack: `Error\\n at ${sourceUrl}:${line}:${column}`,\n filePath: sourceUrl,\n sourceUrl,\n sourceContent,\n line,\n column,\n };\n}\n","type FormatInfo = { [key: string]: string | null; };\n\ntype NameFormatFn<Info> = (info: Info) => string;\ntype NameFormat<Info> = string | NameFormatFn<Info>;\n\ntype CompiledSegment<Key extends string> = {\n optional: boolean;\n parts: CompiledPart<Key>[];\n};\n\ntype CompiledPart<Key extends string> =\n | { type: 'text'; value: string; }\n | {\n type: 'token';\n key: Key;\n maxLength: number | null;\n truncate: boolean;\n };\n\nconst TOKEN_REGEX = /\\(([a-zA-Z][a-zA-Z0-9]*)(?::([0-9]+)(!)?)?\\)/g;\nconst OPTIONAL_REGEX = /\\[([^[\\]]*)\\]/g;\n\nconst HASH_TOKEN = '$hash';\n\nexport type NameFormatter<Info extends object> = ReturnType<typeof createNameFormatter<Info>>;\n\nexport function createNameFormatter<Info extends object>(\n keys: readonly (keyof Info & string)[],\n) {\n const keySet = new Set<string>(keys);\n const cache = new Map<string, NameFormatFn<Info>>();\n\n function getFormatFn(format: NameFormat<Info>) {\n if (typeof format === 'function') return format;\n\n let fn = cache.get(format);\n\n if (!fn) {\n fn = compileFormat(format, keySet);\n cache.set(format, fn);\n }\n\n return fn;\n }\n\n return function format(format: NameFormat<Info>, hash: string | null, info: Info) {\n const name = getFormatFn(format)(info);\n\n if (!hash) return name;\n\n if (name.includes(HASH_TOKEN)) {\n return name.replace(HASH_TOKEN, hash);\n }\n\n return name ? (name + '--' + hash) : hash;\n };\n}\n\nfunction compileFormat<Info extends object>(\n format: string,\n keySet: ReadonlySet<string>,\n): NameFormatFn<Info> {\n type Key = keyof Info & string;\n const segments = compileSegments<Key>(format, keySet);\n\n return (info) => {\n let name = '';\n\n for (const segment of segments) {\n const text = formatSegment(info, segment);\n\n if (text === null) {\n if (!segment.optional) return '';\n continue;\n }\n\n name += text;\n }\n\n return name;\n };\n}\n\nfunction compileSegments<Key extends string>(\n format: string,\n keySet: ReadonlySet<string>,\n) {\n const segments: CompiledSegment<Key>[] = [];\n let lastIndex = 0;\n\n for (const match of format.matchAll(OPTIONAL_REGEX)) {\n const index = match.index ?? 0;\n\n if (index > lastIndex) {\n segments.push({\n optional: false,\n parts: compileParts<Key>(format.slice(lastIndex, index), keySet),\n });\n }\n\n segments.push({\n optional: true,\n parts: compileParts<Key>(match[1], keySet),\n });\n\n lastIndex = index + match[0].length;\n }\n\n if (lastIndex < format.length) {\n segments.push({\n optional: false,\n parts: compileParts<Key>(format.slice(lastIndex), keySet),\n });\n }\n\n return segments;\n}\n\nfunction compileParts<Key extends string>(\n segment: string,\n keySet: ReadonlySet<string>,\n) {\n const parts: CompiledPart<Key>[] = [];\n let lastIndex = 0;\n\n for (const match of segment.matchAll(TOKEN_REGEX)) {\n const index = match.index ?? 0;\n const key = match[1];\n\n if (!keySet.has(key)) continue;\n\n if (index > lastIndex) {\n parts.push({ type: 'text', value: segment.slice(lastIndex, index) });\n }\n\n parts.push({\n type: 'token',\n key: key as Key,\n maxLength: match[2] ? Number(match[2]) : null,\n truncate: Boolean(match[3]),\n });\n\n lastIndex = index + match[0].length;\n }\n\n if (lastIndex < segment.length) {\n parts.push({ type: 'text', value: segment.slice(lastIndex) });\n }\n\n return parts;\n}\n\nfunction formatSegment<Info extends object, Key extends keyof Info & string>(\n info: Info,\n segment: CompiledSegment<Key>,\n) {\n let text = '';\n\n for (const part of segment.parts) {\n if (part.type === 'text') {\n text += part.value;\n continue;\n }\n\n const value = formatTokenValue(\n (info as FormatInfo)[part.key],\n part.maxLength,\n part.truncate,\n );\n if (value === null) {\n if (segment.optional) return null;\n continue;\n }\n\n text += value;\n }\n\n return text;\n}\n\nfunction formatTokenValue(\n value: string | null,\n maxLength: number | null,\n truncate: boolean,\n) {\n if (!value) return null;\n if (!maxLength) return value;\n\n if (!Number.isFinite(maxLength) || maxLength < 0 || value.length <= maxLength) return value;\n\n return truncate ? value.slice(0, maxLength) : null;\n}\n","export function escapeCssIdent(ident: string): string {\n let result = '';\n\n for (let i = 0; i < ident.length; i++) {\n const char = ident.charAt(i);\n const code = ident.charCodeAt(i);\n const nextCode = ident.charCodeAt(i + 1);\n\n if (code === 0) {\n result += '\\uFFFD';\n continue;\n }\n\n if (\n (code >= 1 && code <= 31) ||\n code === 127 ||\n (i === 0 && code >= 48 && code <= 57) ||\n (i === 1 && code >= 48 && code <= 57 && ident.charCodeAt(0) === 45)\n ) {\n result += '\\\\' + code.toString(16) + ' ';\n continue;\n }\n\n if (i === 0 && code === 45 && ident.length === 1) {\n result += '\\\\-';\n continue;\n }\n\n if (code >= 0xD800 && code <= 0xDBFF && nextCode >= 0xDC00 && nextCode <= 0xDFFF) {\n result += char + ident.charAt(++i);\n continue;\n }\n\n if (\n code >= 128 ||\n code === 45 ||\n code === 95 ||\n (code >= 48 && code <= 57) ||\n (code >= 65 && code <= 90) ||\n (code >= 97 && code <= 122)\n ) {\n result += char;\n continue;\n }\n\n result += '\\\\' + char;\n }\n\n return result;\n}\n\nexport function sanitizeCssIdentName(value: string, fallback: string = '') {\n return value.replace(/[^a-zA-Z0-9_-]+/g, '-').replace(/^-+|-+$/g, '') || fallback;\n}\n","import { sanitizeCssIdentName } from './cssIdent';\n\nexport function normalizeDebugKeywordValue(value: string) {\n const normalized = value.trim().toLowerCase();\n return /^[a-z][a-z0-9-]*$/.test(normalized) ? normalized : null;\n}\n\nexport function sanitizeDebugName(value: string | undefined) {\n if (!value) return '';\n\n const normalized = value\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .toLowerCase();\n\n return sanitizeCssIdentName(normalized, '');\n}\n\nexport function normalizePropertyName(property: string) {\n return property\n .trim()\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/_/g, '-')\n .toLowerCase();\n}\n\nexport function sanitizeDebugPropertyName(property: string) {\n let name = property;\n\n if (name.charCodeAt(0) === 45 && name.charCodeAt(1) === 45) {\n name = name.slice(2);\n }\n\n return name\n .replace(/[^a-z0-9_-]+/g, '-')\n .replace(/[-_]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n","import { hashString, normalizeHashLength } from '../../utils/hash';\n\nexport function getIdentifierSafeHash(value: string, startLength = 7) {\n const normalizedStartLength = normalizeHashLength(startLength);\n return getIdentifierSafeHashValue(hashString(value)).slice(0, normalizedStartLength);\n}\n\nfunction getIdentifierSafeHashValue(hash: string) {\n const first = hash.charCodeAt(0);\n\n if (first < 48 || first > 57) return hash;\n\n return String.fromCharCode(97 + first - 48) + hash.slice(1);\n}\n"],"mappings":";;;AAaA,SAAgB,WAAW,KAAa;CACtC,IAAI,OAAO;CAEX,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,KAC9B,OAAO,KAAK,KAAK,OAAO,IAAI,WAAW,CAAC,GAAG,QAAU;CAGvD,QAAQ,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,GAAG,GAAG;AAChD;AAEA,SAAgB,oBAAoB,QAAgB;CAClD,OAAO,OAAO,SAAS,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,MAAM,CAAC,IAAI;AACrE;;;ACiBA,SAAgB,IACd,QACA,OACA,MACA;CACA,OAAgB,SAAS;AAC3B;AASA,SAAgB,SAAS,KAAa;CACpC,KAAK,MAAM,OAAO,OAAO,KAAK,GAAG,GAC/B,OAAQ,IAAY;AAExB;AAEA,SAAgB,OACd,QACA,OACA;CACA,OAAO,OAAO,UAAU,eAAe,KAAK,QAAQ,KAAK;AAC3D;;;AC3CA,MAAa,qBAAgC;CAC3C,OAAO;CAEP,wBAAwB;CACxB,oBAAoB;CACpB,yBAAyB;CAEzB,eAAe;CACf,oBAAoB;CACpB,YAAY;CAEZ,mBAAmB;CACnB,uBAAuB;CAEvB,2BAA2B;AAC7B;AAMA,MAAa,SAAS,WACpB,2BACO,EAAE,OAAO,MAAM,EACxB;AAEA,MAAa,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,EAAE;AAC5C;AAEA,SAAgB,sBAAsB,UAAkB;CACtD,OAAO,SACJ,KAAK,EACL,QAAQ,sBAAsB,OAAO,EACrC,QAAQ,MAAM,GAAG,EACjB,YAAY;AACjB;AAEA,SAAgB,0BAA0B,UAAkB;CAC1D,IAAI,OAAO;CAEX,IAAI,KAAK,WAAW,CAAC,MAAM,MAAM,KAAK,WAAW,CAAC,MAAM,IACtD,OAAO,KAAK,MAAM,CAAC;CAGrB,OAAO,KACJ,QAAQ,iBAAiB,GAAG,EAC5B,QAAQ,UAAU,GAAG,EACrB,QAAQ,YAAY,EAAE;AAC3B;;;AClCA,SAAgB,sBAAsB,OAAe,cAAc,GAAG;CACpE,MAAM,wBAAwB,oBAAoB,WAAW;CAC7D,OAAO,2BAA2B,WAAW,KAAK,CAAC,EAAE,MAAM,GAAG,qBAAqB;AACrF;AAEA,SAAS,2BAA2B,MAAc;CAChD,MAAM,QAAQ,KAAK,WAAW,CAAC;CAE/B,IAAI,QAAQ,MAAM,QAAQ,IAAI,OAAO;CAErC,OAAO,OAAO,aAAa,KAAK,QAAQ,EAAE,IAAI,KAAK,MAAM,CAAC;AAC5D"}
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { p as LayerPlaceholder } from "./debug-CVO3xx4C.js";
2
- import { t as configureStyleRuntime } from "./config-B_OQYZSm.js";
3
- import { a as AT_RULE_REF, b as importantValue, o as createAtRuleRef, s as isAtRuleRef, v as isStyleWeightValue, x as isStyleImportantValue, y as weightValue } from "./data-Bw3Xod5J.js";
4
- import { a as resetStyleTokenIdCounter, c as getStyleTokenName, d as isStyleTokenOverrideData, f as TOKEN_ID, h as TOKEN_VAR_NAME, i as getStyleTokenOverrideDebug, l as getStyleTokenVarName, m as TOKEN_OVERRIDE, n as createStyleToken, p as TOKEN_NAME, r as createStyleTokenOverride, s as getStyleTokenId, t as TOKEN_DEBUG, u as isStyleTokenData } from "./token-Ci73NE6h.js";
5
- import { i as styleTransform, n as classNameValue, r as isClassNameValue, t as classNameTransform } from "./transform-BkxIouPX.js";
6
- import { a as createValues, c as resetStyleThemeIdCounter, d as createStyleFn, f as getStyleFnMeta, g as type, h as transformKeyframes, i as createToken, l as createClassNameFn, m as createStyleKeyframes, n as bindScope, o as createTokens, p as style, r as combineScope, s as createTheme, t as combineStyle, u as assignStyleFnMeta } from "./style-a6ccye6R.js";
7
- import { n as getToken } from "./css-RohOR3Vq.js";
8
- import { t as getClassName } from "./getClassName-m5DOkMFQ.js";
9
- import { t as transformElement } from "./jsx-CvloSSpb.js";
1
+ import { p as LayerPlaceholder } from "./debug-Bo43rBKc.js";
2
+ import { t as configureStyleRuntime } from "./config-BK7oK4Hx.js";
3
+ import { a as AT_RULE_REF, b as importantValue, o as createAtRuleRef, s as isAtRuleRef, v as isStyleWeightValue, x as isStyleImportantValue, y as weightValue } from "./data-MrBhvIQZ.js";
4
+ import { a as resetStyleTokenIdCounter, c as getStyleTokenName, d as isStyleTokenOverrideData, f as TOKEN_ID, h as TOKEN_VAR_NAME, i as getStyleTokenOverrideDebug, l as getStyleTokenVarName, m as TOKEN_OVERRIDE, n as createStyleToken, p as TOKEN_NAME, r as createStyleTokenOverride, s as getStyleTokenId, t as TOKEN_DEBUG, u as isStyleTokenData } from "./token-BX5jRxMb.js";
5
+ import { i as styleTransform, n as classNameValue, r as isClassNameValue, t as classNameTransform } from "./transform-BZ4jPwy3.js";
6
+ import { a as createValues, c as resetStyleThemeIdCounter, d as createStyleFn, f as getStyleFnMeta, g as type, h as transformKeyframes, i as createToken, l as createClassNameFn, m as createStyleKeyframes, n as bindScope, o as createTokens, p as style, r as combineScope, s as createTheme, t as combineStyle, u as assignStyleFnMeta } from "./style-CRs-vfY1.js";
7
+ import { n as getToken } from "./css-BkNqUfLD.js";
8
+ import { t as getClassName } from "./getClassName-CkTq92nR.js";
9
+ import { t as transformElement } from "./jsx-DA1LD8nU.js";
10
10
  import { createElement } from "./jsx/jsx-runtime.js";
11
11
  export { AT_RULE_REF, LayerPlaceholder, TOKEN_DEBUG, TOKEN_ID, TOKEN_NAME, TOKEN_OVERRIDE, TOKEN_VAR_NAME, assignStyleFnMeta, bindScope, classNameTransform, classNameValue, combineScope, combineStyle, configureStyleRuntime, createAtRuleRef, createClassNameFn, createElement, createStyleFn, createStyleKeyframes, createStyleToken, createStyleTokenOverride, createTheme, createToken, createTokens, createValues, getClassName, getStyleFnMeta, getStyleTokenId, getStyleTokenName, getStyleTokenOverrideDebug, getStyleTokenVarName, getToken, importantValue, isAtRuleRef, isClassNameValue, isStyleImportantValue, isStyleTokenData, isStyleTokenOverrideData, isStyleWeightValue, resetStyleThemeIdCounter, resetStyleTokenIdCounter, style, styleTransform, transformElement, transformKeyframes, type, weightValue };
@@ -1,4 +1,4 @@
1
- import { t as transformElement } from "../jsx-CvloSSpb.js";
1
+ import { t as transformElement } from "../jsx-DA1LD8nU.js";
2
2
  import { i as wrapFragment, n as createJsxDEV, r as wrapCreateElement } from "../utils-CdI6vZsP.js";
3
3
  import { createElement as createElement$1 } from "react";
4
4
  import * as react from "react/jsx-dev-runtime";
@@ -1,4 +1,4 @@
1
- import { t as transformElement } from "../jsx-CvloSSpb.js";
1
+ import { t as transformElement } from "../jsx-DA1LD8nU.js";
2
2
  import { i as wrapFragment, r as wrapCreateElement, t as createJsx } from "../utils-CdI6vZsP.js";
3
3
  import { createElement as createElement$1 } from "react";
4
4
  import * as react from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
- import { T as hasOwn } from "./hash-DCJkLls_.js";
2
- import { c as splitElementMarkerStyleProp, n as createElementMarkerClassName } from "./elementMarker-BrHXg161.js";
3
- import { t as getClassName } from "./getClassName-m5DOkMFQ.js";
1
+ import { T as hasOwn } from "./hash-CjTP-uES.js";
2
+ import { c as splitElementMarkerStyleProp, n as createElementMarkerClassName } from "./elementMarker-nYeJnJPQ.js";
3
+ import { t as getClassName } from "./getClassName-CkTq92nR.js";
4
4
  //#region runtime/core/createTransformElement.ts
5
5
  function createTransformElement(getClassName) {
6
6
  return ({ type, props }) => {
@@ -36,4 +36,4 @@ const transformElement = createTransformElement(getClassName);
36
36
  //#endregion
37
37
  export { createTransformElement as n, transformElement as t };
38
38
 
39
- //# sourceMappingURL=jsx-CvloSSpb.js.map
39
+ //# sourceMappingURL=jsx-DA1LD8nU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-CvloSSpb.js","names":[],"sources":["../runtime/core/createTransformElement.ts","../runtime/core/jsx.ts"],"sourcesContent":["import type { TransformElement } from '../../jsx/utils';\nimport { hasOwn } from '../../utils/object';\nimport type { RuntimeStyleAttributes, StyleProp } from '../types';\nimport type { ClassNameProps, ClassNameResult } from './className';\nimport { createElementMarkerClassName, splitElementMarkerStyleProp } from './elementMarker';\n\nexport function createTransformElement(\n getClassName: (styleProp: StyleProp, props?: ClassNameProps) => ClassNameResult,\n): TransformElement {\n return ({ type, props }) => {\n if (!props || typeof type !== 'string') return { type, props };\n if (!hasOwn(props as object, 'css')) return { type, props };\n\n const { css, ...rest } = props as RuntimeStyleAttributes & ClassNameProps;\n\n if (!css) return { type, props: rest };\n\n const marker = splitElementMarkerStyleProp(css);\n\n if (marker.styleProp) {\n Object.assign(rest, getClassName(marker.styleProp, rest));\n }\n\n prependClassName(rest, createElementMarkerClassName(marker.debug));\n\n return { type, props: rest };\n };\n}\n\nfunction prependClassName(\n props: ClassNameProps,\n className: string | null,\n) {\n if (!className) return;\n\n props.className = props.className\n ? `${className} ${props.className}`\n : className;\n}\n","import { createTransformElement } from './createTransformElement';\nimport { getClassName } from './getClassName';\n\nexport const transformElement = createTransformElement(getClassName);\n"],"mappings":";;;;AAMA,SAAgB,uBACd,cACkB;CAClB,QAAQ,EAAE,MAAM,YAAY;EAC1B,IAAI,CAAC,SAAS,OAAO,SAAS,UAAU,OAAO;GAAE;GAAM;EAAM;EAC7D,IAAI,CAAC,OAAO,OAAiB,KAAK,GAAG,OAAO;GAAE;GAAM;EAAM;EAE1D,MAAM,EAAE,KAAK,GAAG,SAAS;EAEzB,IAAI,CAAC,KAAK,OAAO;GAAE;GAAM,OAAO;EAAK;EAErC,MAAM,SAAS,4BAA4B,GAAG;EAE9C,IAAI,OAAO,WACT,OAAO,OAAO,MAAM,aAAa,OAAO,WAAW,IAAI,CAAC;EAG1D,iBAAiB,MAAM,6BAA6B,OAAO,KAAK,CAAC;EAEjE,OAAO;GAAE;GAAM,OAAO;EAAK;CAC7B;AACF;AAEA,SAAS,iBACP,OACA,WACA;CACA,IAAI,CAAC,WAAW;CAEhB,MAAM,YAAY,MAAM,YACpB,GAAG,UAAU,GAAG,MAAM,cACtB;AACN;;;ACnCA,MAAa,mBAAmB,uBAAuB,YAAY"}
1
+ {"version":3,"file":"jsx-DA1LD8nU.js","names":[],"sources":["../runtime/core/createTransformElement.ts","../runtime/core/jsx.ts"],"sourcesContent":["import type { TransformElement } from '../../jsx/utils';\nimport { hasOwn } from '../../utils/object';\nimport type { RuntimeStyleAttributes, StyleProp } from '../types';\nimport type { ClassNameProps, ClassNameResult } from './className';\nimport { createElementMarkerClassName, splitElementMarkerStyleProp } from './elementMarker';\n\nexport function createTransformElement(\n getClassName: (styleProp: StyleProp, props?: ClassNameProps) => ClassNameResult,\n): TransformElement {\n return ({ type, props }) => {\n if (!props || typeof type !== 'string') return { type, props };\n if (!hasOwn(props as object, 'css')) return { type, props };\n\n const { css, ...rest } = props as RuntimeStyleAttributes & ClassNameProps;\n\n if (!css) return { type, props: rest };\n\n const marker = splitElementMarkerStyleProp(css);\n\n if (marker.styleProp) {\n Object.assign(rest, getClassName(marker.styleProp, rest));\n }\n\n prependClassName(rest, createElementMarkerClassName(marker.debug));\n\n return { type, props: rest };\n };\n}\n\nfunction prependClassName(\n props: ClassNameProps,\n className: string | null,\n) {\n if (!className) return;\n\n props.className = props.className\n ? `${className} ${props.className}`\n : className;\n}\n","import { createTransformElement } from './createTransformElement';\nimport { getClassName } from './getClassName';\n\nexport const transformElement = createTransformElement(getClassName);\n"],"mappings":";;;;AAMA,SAAgB,uBACd,cACkB;CAClB,QAAQ,EAAE,MAAM,YAAY;EAC1B,IAAI,CAAC,SAAS,OAAO,SAAS,UAAU,OAAO;GAAE;GAAM;EAAM;EAC7D,IAAI,CAAC,OAAO,OAAiB,KAAK,GAAG,OAAO;GAAE;GAAM;EAAM;EAE1D,MAAM,EAAE,KAAK,GAAG,SAAS;EAEzB,IAAI,CAAC,KAAK,OAAO;GAAE;GAAM,OAAO;EAAK;EAErC,MAAM,SAAS,4BAA4B,GAAG;EAE9C,IAAI,OAAO,WACT,OAAO,OAAO,MAAM,aAAa,OAAO,WAAW,IAAI,CAAC;EAG1D,iBAAiB,MAAM,6BAA6B,OAAO,KAAK,CAAC;EAEjE,OAAO;GAAE;GAAM,OAAO;EAAK;CAC7B;AACF;AAEA,SAAS,iBACP,OACA,WACA;CACA,IAAI,CAAC,WAAW;CAEhB,MAAM,YAAY,MAAM,YACpB,GAAG,UAAU,GAAG,MAAM,cACtB;AACN;;;ACnCA,MAAa,mBAAmB,uBAAuB,YAAY"}
@@ -1,5 +1,5 @@
1
- import { s as normalizePath } from "./compiler-AOb_VaKQ.mjs";
2
- import { A as createTransformFilter, j as normalizeModuleId, t as formatError } from "./misc-CyZgGtc9.mjs";
1
+ import { s as normalizePath } from "./compiler-Cat8TmMk.mjs";
2
+ import { A as createTransformFilter, M as normalizeModuleId, t as formatError } from "./misc-BKaSZF14.mjs";
3
3
  import path from "node:path";
4
4
  //#region plugin/bundler/webpack/shared/loader.ts
5
5
  function createWebpackLoader(args) {
@@ -77,4 +77,4 @@ function isFilePathLike(value) {
77
77
  //#endregion
78
78
  export { createWebpackLoader as t };
79
79
 
80
- //# sourceMappingURL=loader-fAuIjIik.mjs.map
80
+ //# sourceMappingURL=loader-Cvz2pKYV.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"loader-fAuIjIik.mjs","names":[],"sources":["../plugin/bundler/webpack/shared/loader.ts"],"sourcesContent":["import path from 'node:path';\nimport type { LoaderDefinitionFunction } from 'webpack';\nimport type { BabelTransformSourceMap } from '../../../../compiler/transform';\nimport { normalizePath } from '../../../../compiler/utils/path';\nimport { createTransformFilter, normalizeModuleId, type PluginOptions } from '../../../utils';\nimport { formatError } from '../../../utils/misc';\n\nexport type WebpackLoaderOptions = PluginOptions & {\n compilerId: string;\n};\n\nexport type WebpackLoaderContext = ThisParameterType<LoaderDefinitionFunction<WebpackLoaderOptions>>;\n\nexport type WebpackLoaderResult = {\n code: string;\n sourcemap: string | null;\n};\n\nexport type WebpackLoaderTransformArgs<State> = {\n code: string;\n entry: State;\n filePath: string;\n inputMap: BabelTransformSourceMap;\n loaderContext: WebpackLoaderContext;\n options: WebpackLoaderOptions;\n};\n\nexport type WebpackLoaderFilterArgs<State> = {\n entry: State;\n filePath: string;\n options: WebpackLoaderOptions;\n};\n\nexport type MaybePromise<T> = Promise<T> | T;\n\nexport function createWebpackLoader<State>(args: {\n getEntry: (compilerId: string, options: WebpackLoaderOptions) => State | null | undefined;\n missingCompilerMessage: string;\n shouldTransform?: (args: WebpackLoaderFilterArgs<State>) => boolean;\n transform: (args: WebpackLoaderTransformArgs<State>) => MaybePromise<WebpackLoaderResult | null>;\n}): LoaderDefinitionFunction<WebpackLoaderOptions> {\n return function(source, inputMap) {\n const callback = this.async();\n const options = this.getOptions();\n\n const entry = args.getEntry(options.compilerId, options);\n\n if (!entry) {\n callback(new Error(formatError(args.missingCompilerMessage)));\n return;\n }\n\n const filePath = normalizeModuleId(this.resourcePath);\n const shouldTransform = args.shouldTransform\n ? args.shouldTransform({ entry, filePath, options })\n : createTransformFilter(options)(filePath);\n\n if (!shouldTransform) {\n callback(null, source, inputMap);\n return;\n }\n\n Promise.resolve().then(() =>\n args.transform({\n code: source.toString(),\n entry,\n filePath,\n inputMap: inputMap as BabelTransformSourceMap,\n loaderContext: this,\n options,\n })\n ).then((result) => {\n if (!result) {\n // Webpack exposes a callback API; bridge the completed transform promise.\n // oxlint-disable-next-line promise/no-callback-in-promise\n callback(null, source, inputMap);\n return;\n }\n\n // oxlint-disable-next-line promise/no-callback-in-promise\n callback(\n null,\n result.code,\n parseWebpackSourceMap(\n result.sourcemap,\n this.rootContext,\n ),\n );\n }).catch((err) => {\n // oxlint-disable-next-line promise/no-callback-in-promise\n callback(err as Error);\n });\n };\n}\n\ntype WebpackSourceMap = {\n version: number;\n sources: string[];\n names: string[];\n mappings: string;\n file: string;\n sourceRoot?: string;\n sourcesContent?: string[];\n debugId?: string;\n [key: string]: unknown;\n};\n\nfunction parseWebpackSourceMap(map: string | null, rootContext: string): WebpackSourceMap | null {\n if (!map) return null;\n return normalizeWebpackSourceMap(JSON.parse(map) as WebpackSourceMap, rootContext);\n}\n\nfunction normalizeWebpackSourceMap(map: WebpackSourceMap, rootContext: string): WebpackSourceMap {\n if (!Array.isArray(map.sources)) return map;\n\n const sourceRoot = typeof map.sourceRoot === 'string' ? map.sourceRoot : '';\n\n return {\n ...map,\n sourceRoot: isFilePathLike(sourceRoot) ? undefined : map.sourceRoot,\n sources: map.sources.map((source) => normalizeWebpackSource(source, rootContext, sourceRoot)),\n };\n}\n\nfunction normalizeWebpackSource(source: string, rootContext: string, sourceRoot: string) {\n if (!isFilePathLike(source) && !isFilePathLike(sourceRoot)) return source;\n\n const filePath = toAbsoluteFilePath(source, sourceRoot);\n\n if (!filePath) return source;\n\n const relativePath = normalizePath(path.relative(rootContext, filePath));\n\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;\n}\n\nfunction toAbsoluteFilePath(source: string, sourceRoot: string) {\n const sourcePath = stripFileProtocol(source);\n const rootPath = stripFileProtocol(sourceRoot);\n\n if (path.isAbsolute(sourcePath) || path.win32.isAbsolute(sourcePath)) {\n return sourcePath;\n }\n\n if (rootPath && (path.isAbsolute(rootPath) || path.win32.isAbsolute(rootPath))) {\n return path.join(rootPath, sourcePath);\n }\n\n return null;\n}\n\nfunction stripFileProtocol(value: string) {\n if (!value.startsWith('file://')) return value;\n return decodeURIComponent(value.slice('file://'.length));\n}\n\nfunction isFilePathLike(value: string) {\n if (!value) return false;\n if (value.startsWith('file://')) return true;\n return path.isAbsolute(value) || path.win32.isAbsolute(value);\n}\n"],"mappings":";;;;AAmCA,SAAgB,oBAA2B,MAKQ;CACjD,OAAO,SAAS,QAAQ,UAAU;EAChC,MAAM,WAAW,KAAK,MAAM;EAC5B,MAAM,UAAU,KAAK,WAAW;EAEhC,MAAM,QAAQ,KAAK,SAAS,QAAQ,YAAY,OAAO;EAEvD,IAAI,CAAC,OAAO;GACV,SAAS,IAAI,MAAM,YAAY,KAAK,sBAAsB,CAAC,CAAC;GAC5D;EACF;EAEA,MAAM,WAAW,kBAAkB,KAAK,YAAY;EAKpD,IAAI,EAJoB,KAAK,kBACzB,KAAK,gBAAgB;GAAE;GAAO;GAAU;EAAQ,CAAC,IACjD,sBAAsB,OAAO,EAAE,QAAQ,IAErB;GACpB,SAAS,MAAM,QAAQ,QAAQ;GAC/B;EACF;EAEA,QAAQ,QAAQ,EAAE,WAChB,KAAK,UAAU;GACb,MAAM,OAAO,SAAS;GACtB;GACA;GACU;GACV,eAAe;GACf;EACF,CAAC,CACH,EAAE,MAAM,WAAW;GACjB,IAAI,CAAC,QAAQ;IAGX,SAAS,MAAM,QAAQ,QAAQ;IAC/B;GACF;GAGA,SACE,MACA,OAAO,MACP,sBACE,OAAO,WACP,KAAK,WACP,CACF;EACF,CAAC,EAAE,OAAO,QAAQ;GAEhB,SAAS,GAAY;EACvB,CAAC;CACH;AACF;AAcA,SAAS,sBAAsB,KAAoB,aAA8C;CAC/F,IAAI,CAAC,KAAK,OAAO;CACjB,OAAO,0BAA0B,KAAK,MAAM,GAAG,GAAuB,WAAW;AACnF;AAEA,SAAS,0BAA0B,KAAuB,aAAuC;CAC/F,IAAI,CAAC,MAAM,QAAQ,IAAI,OAAO,GAAG,OAAO;CAExC,MAAM,aAAa,OAAO,IAAI,eAAe,WAAW,IAAI,aAAa;CAEzE,OAAO;EACL,GAAG;EACH,YAAY,eAAe,UAAU,IAAI,KAAA,IAAY,IAAI;EACzD,SAAS,IAAI,QAAQ,KAAK,WAAW,uBAAuB,QAAQ,aAAa,UAAU,CAAC;CAC9F;AACF;AAEA,SAAS,uBAAuB,QAAgB,aAAqB,YAAoB;CACvF,IAAI,CAAC,eAAe,MAAM,KAAK,CAAC,eAAe,UAAU,GAAG,OAAO;CAEnE,MAAM,WAAW,mBAAmB,QAAQ,UAAU;CAEtD,IAAI,CAAC,UAAU,OAAO;CAEtB,MAAM,eAAe,cAAc,KAAK,SAAS,aAAa,QAAQ,CAAC;CAEvE,OAAO,aAAa,WAAW,GAAG,IAAI,eAAe,KAAK;AAC5D;AAEA,SAAS,mBAAmB,QAAgB,YAAoB;CAC9D,MAAM,aAAa,kBAAkB,MAAM;CAC3C,MAAM,WAAW,kBAAkB,UAAU;CAE7C,IAAI,KAAK,WAAW,UAAU,KAAK,KAAK,MAAM,WAAW,UAAU,GACjE,OAAO;CAGT,IAAI,aAAa,KAAK,WAAW,QAAQ,KAAK,KAAK,MAAM,WAAW,QAAQ,IAC1E,OAAO,KAAK,KAAK,UAAU,UAAU;CAGvC,OAAO;AACT;AAEA,SAAS,kBAAkB,OAAe;CACxC,IAAI,CAAC,MAAM,WAAW,SAAS,GAAG,OAAO;CACzC,OAAO,mBAAmB,MAAM,MAAM,CAAgB,CAAC;AACzD;AAEA,SAAS,eAAe,OAAe;CACrC,IAAI,CAAC,OAAO,OAAO;CACnB,IAAI,MAAM,WAAW,SAAS,GAAG,OAAO;CACxC,OAAO,KAAK,WAAW,KAAK,KAAK,KAAK,MAAM,WAAW,KAAK;AAC9D"}
1
+ {"version":3,"file":"loader-Cvz2pKYV.mjs","names":[],"sources":["../plugin/bundler/webpack/shared/loader.ts"],"sourcesContent":["import path from 'node:path';\nimport type { LoaderDefinitionFunction } from 'webpack';\nimport type { BabelTransformSourceMap } from '../../../../compiler/transform';\nimport { normalizePath } from '../../../../compiler/utils/path';\nimport { createTransformFilter, normalizeModuleId, type PluginOptions } from '../../../utils';\nimport { formatError } from '../../../utils/misc';\n\nexport type WebpackLoaderOptions = PluginOptions & {\n compilerId: string;\n};\n\nexport type WebpackLoaderContext = ThisParameterType<LoaderDefinitionFunction<WebpackLoaderOptions>>;\n\nexport type WebpackLoaderResult = {\n code: string;\n sourcemap: string | null;\n};\n\nexport type WebpackLoaderTransformArgs<State> = {\n code: string;\n entry: State;\n filePath: string;\n inputMap: BabelTransformSourceMap;\n loaderContext: WebpackLoaderContext;\n options: WebpackLoaderOptions;\n};\n\nexport type WebpackLoaderFilterArgs<State> = {\n entry: State;\n filePath: string;\n options: WebpackLoaderOptions;\n};\n\nexport type MaybePromise<T> = Promise<T> | T;\n\nexport function createWebpackLoader<State>(args: {\n getEntry: (compilerId: string, options: WebpackLoaderOptions) => State | null | undefined;\n missingCompilerMessage: string;\n shouldTransform?: (args: WebpackLoaderFilterArgs<State>) => boolean;\n transform: (args: WebpackLoaderTransformArgs<State>) => MaybePromise<WebpackLoaderResult | null>;\n}): LoaderDefinitionFunction<WebpackLoaderOptions> {\n return function(source, inputMap) {\n const callback = this.async();\n const options = this.getOptions();\n\n const entry = args.getEntry(options.compilerId, options);\n\n if (!entry) {\n callback(new Error(formatError(args.missingCompilerMessage)));\n return;\n }\n\n const filePath = normalizeModuleId(this.resourcePath);\n const shouldTransform = args.shouldTransform\n ? args.shouldTransform({ entry, filePath, options })\n : createTransformFilter(options)(filePath);\n\n if (!shouldTransform) {\n callback(null, source, inputMap);\n return;\n }\n\n Promise.resolve().then(() =>\n args.transform({\n code: source.toString(),\n entry,\n filePath,\n inputMap: inputMap as BabelTransformSourceMap,\n loaderContext: this,\n options,\n })\n ).then((result) => {\n if (!result) {\n // Webpack exposes a callback API; bridge the completed transform promise.\n // oxlint-disable-next-line promise/no-callback-in-promise\n callback(null, source, inputMap);\n return;\n }\n\n // oxlint-disable-next-line promise/no-callback-in-promise\n callback(\n null,\n result.code,\n parseWebpackSourceMap(\n result.sourcemap,\n this.rootContext,\n ),\n );\n }).catch((err) => {\n // oxlint-disable-next-line promise/no-callback-in-promise\n callback(err as Error);\n });\n };\n}\n\ntype WebpackSourceMap = {\n version: number;\n sources: string[];\n names: string[];\n mappings: string;\n file: string;\n sourceRoot?: string;\n sourcesContent?: string[];\n debugId?: string;\n [key: string]: unknown;\n};\n\nfunction parseWebpackSourceMap(map: string | null, rootContext: string): WebpackSourceMap | null {\n if (!map) return null;\n return normalizeWebpackSourceMap(JSON.parse(map) as WebpackSourceMap, rootContext);\n}\n\nfunction normalizeWebpackSourceMap(map: WebpackSourceMap, rootContext: string): WebpackSourceMap {\n if (!Array.isArray(map.sources)) return map;\n\n const sourceRoot = typeof map.sourceRoot === 'string' ? map.sourceRoot : '';\n\n return {\n ...map,\n sourceRoot: isFilePathLike(sourceRoot) ? undefined : map.sourceRoot,\n sources: map.sources.map((source) => normalizeWebpackSource(source, rootContext, sourceRoot)),\n };\n}\n\nfunction normalizeWebpackSource(source: string, rootContext: string, sourceRoot: string) {\n if (!isFilePathLike(source) && !isFilePathLike(sourceRoot)) return source;\n\n const filePath = toAbsoluteFilePath(source, sourceRoot);\n\n if (!filePath) return source;\n\n const relativePath = normalizePath(path.relative(rootContext, filePath));\n\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;\n}\n\nfunction toAbsoluteFilePath(source: string, sourceRoot: string) {\n const sourcePath = stripFileProtocol(source);\n const rootPath = stripFileProtocol(sourceRoot);\n\n if (path.isAbsolute(sourcePath) || path.win32.isAbsolute(sourcePath)) {\n return sourcePath;\n }\n\n if (rootPath && (path.isAbsolute(rootPath) || path.win32.isAbsolute(rootPath))) {\n return path.join(rootPath, sourcePath);\n }\n\n return null;\n}\n\nfunction stripFileProtocol(value: string) {\n if (!value.startsWith('file://')) return value;\n return decodeURIComponent(value.slice('file://'.length));\n}\n\nfunction isFilePathLike(value: string) {\n if (!value) return false;\n if (value.startsWith('file://')) return true;\n return path.isAbsolute(value) || path.win32.isAbsolute(value);\n}\n"],"mappings":";;;;AAmCA,SAAgB,oBAA2B,MAKQ;CACjD,OAAO,SA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I,CAAC,eAAe,MAAM,KAAK,CAAC,eAAe,UAAU,GAAG,OAAO;CAEnE,MAAM,WAAW,mBAAmB,QAAQ,UAAU;CAEtD,IAAI,CAAC,UAAU,OAAO;CAEtB,MAAM,eAAe,cAAc,KAAK,SAAS,aAAa,QAAQ,CAAC;CAEvE,OAAO,aAAa,WAAW,GAAG,IAAI,eAAe,KAAK;AAC5D;AAEA,SAAS,mBAAmB,QAAgB,YAAoB;CAC9D,MAAM,aAAa,kBAAkB,MAAM;CAC3C,MAAM,WAAW,kBAAkB,UAAU;CAE7C,IAAI,KAAK,WAAW,UAAU,KAAK,KAAK,MAAM,WAAW,UAAU,GACjE,OAAO;CAGT,IAAI,aAAa,KAAK,WAAW,QAAQ,KAAK,KAAK,MAAM,WAAW,QAAQ,IAC1E,OAAO,KAAK,KAAK,UAAU,UAAU;CAGvC,OAAO;AACT;AAEA,SAAS,kBAAkB,OAAe;CACxC,IAAI,CAAC,MAAM,WAAW,SAAS,GAAG,OAAO;CACzC,OAAO,mBAAmB,MAAM,MAAM,CAAgB,CAAC;AACzD;AAEA,SAAS,eAAe,OAAe;CACrC,IAAI,CAAC,OAAO,OAAO;CACnB,IAAI,MAAM,WAAW,SAAS,GAAG,OAAO;CACxC,OAAO,KAAK,WAAW,KAAK,KAAK,KAAK,MAAM,WAAW,KAAK;AAC9D"}
@@ -1,4 +1,4 @@
1
- import { a as getDefaultSourcemapUrl, f as extractCss, n as createCompiler, p as compareLayerPriority, s as normalizePath } from "./compiler-AOb_VaKQ.mjs";
1
+ import { a as getDefaultSourcemapUrl, f as extractCss, n as createCompiler, p as compareLayerPriority, s as normalizePath } from "./compiler-Cat8TmMk.mjs";
2
2
  import { createHash } from "node:crypto";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
@@ -115,13 +115,16 @@ function normalizeModuleId(id) {
115
115
  }
116
116
  function createTransformFilter(options = {}) {
117
117
  const includes = normalizeMatchers(options.include);
118
+ const includePackages = createPackagePattern(options.includePackages);
119
+ const excludePackages = createPackagePattern(options.excludePackages);
118
120
  const excludes = normalizeMatchers(options.exclude ?? (options.include ? void 0 : DEFAULT_TRANSFORM_EXCLUDE));
119
121
  const cache = /* @__PURE__ */ new Map();
120
122
  const filter = ((id) => {
121
123
  const filePath = normalizeModuleId(id);
122
124
  const cached = cache.get(filePath);
123
125
  if (cached !== void 0) return cached;
124
- const result = shouldTransform(filePath, includes, excludes);
126
+ const packagePath = normalizePath(filePath);
127
+ const result = excludePackages?.test(packagePath) ? false : includePackages?.test(packagePath) ? DEFAULT_TRANSFORM_INCLUDE.test(filePath) : shouldTransform(filePath, includes, excludes);
125
128
  cache.set(filePath, result);
126
129
  return result;
127
130
  });
@@ -148,6 +151,29 @@ function shouldTransform(id, includes, excludes) {
148
151
  for (const include of includes) if (include(id)) return true;
149
152
  return false;
150
153
  }
154
+ /** A conservative native prefilter; the shared JS filter remains authoritative. */
155
+ function createTransformHookFilter(options = {}) {
156
+ const includePackages = createPackagePattern(options.includePackages);
157
+ const excludePackages = createPackagePattern(options.excludePackages);
158
+ const exclude = [];
159
+ if (excludePackages) exclude.push(excludePackages);
160
+ if (!options.include && options.exclude === void 0) exclude.push(new RegExp(`^${includePackages ? `(?!${includePackages.source})` : ""}[^?#]*node_modules`));
161
+ return { id: {
162
+ include: options.include ? void 0 : /^[^?#]*\.[cm]?[jt]sx?(?:[?#][\s\S]*)?$/,
163
+ exclude
164
+ } };
165
+ }
166
+ function createPackagePattern(packages) {
167
+ const names = typeof packages === "string" ? [packages] : packages ?? [];
168
+ if (!names.length) return void 0;
169
+ for (const name of names) if (!/^(?:@[a-zA-Z0-9_][a-zA-Z0-9._-]*\/)?[a-zA-Z0-9_][a-zA-Z0-9._-]*$/.test(name)) throw new Error(`[fluentic-style] Invalid package name in includePackages/excludePackages: ${JSON.stringify(name)}`);
170
+ const separator = "[/\\\\]";
171
+ const alternatives = names.map((name) => name.split("/").map(escapeRegExp).join(separator)).join("|");
172
+ return new RegExp(`^(?:[^?#]*${separator})?node_modules${separator}(?:${alternatives})(?![^?#]*${separator}node_modules${separator})(?:${separator}[^?#]*)?(?:[?#][\\s\\S]*)?$`);
173
+ }
174
+ function escapeRegExp(value) {
175
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
176
+ }
151
177
  //#endregion
152
178
  //#region plugin/utils/compiler.ts
153
179
  let nextCompilerId = 0;
@@ -360,6 +386,6 @@ function formatError(msg) {
360
386
  return `[${PLUGIN_NAME}] ${msg}`;
361
387
  }
362
388
  //#endregion
363
- export { createTransformFilter as A, createFileCssContentHash as B, createCompilerId as C, DEFAULT_TRANSFORM_EXCLUDE as D, invalidateFiles as E, PLUGIN_NAME as F, writeCacheFile as I, writePluginCacheFile as L, BUNDLE_CSS_FILE as M, EXTRACTED_CSS_MARKER as N, DEFAULT_TRANSFORM_INCLUDE as O, PLUGIN_CACHE_DIR as P, createFileCssCache as R, replaceCssMarker as S, getPluginCacheDir as T, getStyleRuntimeMode as _, VIRTUAL_MODULE_REQUEST_PATTERN as a, transformCssOutput as b, loadVirtualModule as c, resolvePluginSourcemapFilePath as d, resolvePluginSourcemapOptions as f, getStyleEntryDefines as g, getPluginBuildDevConfig as h, RUNTIME_MODULE_ID as i, normalizeModuleId as j, DEFAULT_TRANSFORM_INCLUDE_PATTERN as k, parseBundlerSourceMap as l, getPluginBuildConfig as m, CSS_MODULE_ID as n, getVirtualModuleId as o, createStyleEntryGlobalSource as p, RESOLVED_RUNTIME_MODULE_ID as r, isVirtualModuleRequest as s, formatError as t, resolveDevSourcemapMode as u, injectCodeAfterDirectivePrologue as v, createPluginCompiler as w, hasCssMarker as x, injectModuleImport as y, createFileCssConfigHash as z };
389
+ export { createTransformFilter as A, createFileCssConfigHash as B, createCompilerId as C, DEFAULT_TRANSFORM_EXCLUDE as D, invalidateFiles as E, PLUGIN_CACHE_DIR as F, PLUGIN_NAME as I, writeCacheFile as L, normalizeModuleId as M, BUNDLE_CSS_FILE as N, DEFAULT_TRANSFORM_INCLUDE as O, EXTRACTED_CSS_MARKER as P, writePluginCacheFile as R, replaceCssMarker as S, getPluginCacheDir as T, createFileCssContentHash as V, getStyleRuntimeMode as _, VIRTUAL_MODULE_REQUEST_PATTERN as a, transformCssOutput as b, loadVirtualModule as c, resolvePluginSourcemapFilePath as d, resolvePluginSourcemapOptions as f, getStyleEntryDefines as g, getPluginBuildDevConfig as h, RUNTIME_MODULE_ID as i, createTransformHookFilter as j, DEFAULT_TRANSFORM_INCLUDE_PATTERN as k, parseBundlerSourceMap as l, getPluginBuildConfig as m, CSS_MODULE_ID as n, getVirtualModuleId as o, createStyleEntryGlobalSource as p, RESOLVED_RUNTIME_MODULE_ID as r, isVirtualModuleRequest as s, formatError as t, resolveDevSourcemapMode as u, injectCodeAfterDirectivePrologue as v, createPluginCompiler as w, hasCssMarker as x, injectModuleImport as y, createFileCssCache as z };
364
390
 
365
- //# sourceMappingURL=misc-CyZgGtc9.mjs.map
391
+ //# sourceMappingURL=misc-BKaSZF14.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"misc-BKaSZF14.mjs","names":[],"sources":["../plugin/utils/cache/css_cache.ts","../plugin/utils/cache/file.ts","../plugin/utils/constants.ts","../plugin/utils/filter.ts","../plugin/utils/compiler.ts","../plugin/utils/cssMarker.ts","../plugin/utils/cssOutput.ts","../plugin/utils/injection.ts","../plugin/utils/runtimeEntry.ts","../plugin/utils/sourcemap.ts","../plugin/utils/virtual.ts","../plugin/utils/misc.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { compareLayerPriority } from '../../../atomic/layer';\nimport { type CompilerExtractCssArgs, type CssExtractRule, extractCss } from '../../../compiler/extract';\nimport { normalizePath } from '../../../compiler/utils/path';\n\nexport type FileCssCacheRule = CssExtractRule;\n\nexport type FileCssCacheRecord = {\n filePath: string;\n contentHash: string;\n configHash: string;\n rules: FileCssCacheRule[];\n updatedAt: number;\n};\n\nexport type SetFileCssArgs = {\n filePath: string;\n contentHash: string;\n configHash: string;\n rules: FileCssCacheRule[];\n};\n\nexport type GetFileCssArgs = CompilerExtractCssArgs & {\n configHash?: string;\n};\n\nexport type FileCssCacheArgs = {\n cacheDir: string;\n cacheSubdir: string;\n};\n\nexport type FileCssCache = ReturnType<typeof createFileCssCache>;\n\nexport function createFileCssCache(args: FileCssCacheArgs) {\n const rootDir = path.join(args.cacheDir, args.cacheSubdir);\n const filesDir = path.join(rootDir, 'files');\n\n const getFilePath = (filePath: string) => {\n return path.join(filesDir, hashFilePath(filePath) + '.json');\n };\n\n const setFileCss = (item: SetFileCssArgs) => {\n const record: FileCssCacheRecord = {\n filePath: normalizePath(item.filePath),\n contentHash: item.contentHash,\n configHash: item.configHash,\n rules: item.rules,\n updatedAt: Date.now(),\n };\n\n fs.mkdirSync(filesDir, { recursive: true });\n\n fs.writeFileSync(getFilePath(record.filePath), JSON.stringify(record), 'utf8');\n };\n\n const getCss = (args: GetFileCssArgs = {}) => {\n const rules = getRules(args);\n return extractCss(rules, args);\n };\n\n const getRules = (args: GetFileCssArgs = {}) => {\n const records = readRecords(filesDir, args);\n const rules: FileCssCacheRule[] = [];\n\n for (const record of records) {\n rules.push(...record.rules);\n }\n\n return rules.sort((a, b) => compareLayerPriority(a.priority, b.priority));\n };\n\n const clear = () => {\n try {\n fs.rmSync(rootDir, { recursive: true, force: true });\n } catch {\n // Cache cleanup is best effort.\n }\n };\n\n const invalidateFile = (filePath: string) => {\n try {\n fs.rmSync(getFilePath(normalizePath(filePath)));\n } catch {\n // Cache invalidation is best effort.\n }\n };\n\n return {\n rootDir,\n filesDir,\n setFileCss,\n getCss,\n getRules,\n clear,\n invalidateFile,\n };\n}\n\nexport function createFileCssContentHash(code: string) {\n return hash(code);\n}\n\nexport function createFileCssConfigHash(config: unknown) {\n return hash(JSON.stringify(config ?? null));\n}\n\nfunction readRecords(filesDir: string, args: GetFileCssArgs) {\n let entries: string[];\n\n try {\n entries = fs.readdirSync(filesDir);\n } catch {\n return [];\n }\n\n const records: FileCssCacheRecord[] = [];\n\n for (const entry of entries) {\n if (!entry.endsWith('.json')) continue;\n\n try {\n const record = JSON.parse(\n fs.readFileSync(path.join(filesDir, entry), 'utf8'),\n ) as FileCssCacheRecord;\n\n if (!record.filePath || !Array.isArray(record.rules)) continue;\n if (args.configHash && record.configHash !== args.configHash) continue;\n\n records.push(record);\n } catch {\n // Ignore partial cache files from interrupted dev builds.\n }\n }\n\n return records;\n}\n\nfunction hashFilePath(filePath: string) {\n return hash(normalizePath(path.resolve(filePath)));\n}\n\nfunction hash(text: string) {\n return createHash('sha256').update(text).digest('hex');\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport type { PluginCompiler } from '../compiler';\n\nexport function getPluginCacheFilePath(\n compiler: PluginCompiler,\n fileName: string,\n) {\n return path.join(compiler.cacheDir, fileName);\n}\n\nexport function writeCacheFile(\n cacheDir: string,\n fileName: string,\n content: string,\n) {\n const filePath = path.join(cacheDir, fileName);\n\n if (fs.existsSync(filePath)) {\n const size = Buffer.byteLength(content);\n const stat = fs.statSync(filePath);\n\n if (stat.size === size && fs.readFileSync(filePath, 'utf8') === content) {\n return filePath;\n }\n }\n\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n fs.writeFileSync(filePath, content, 'utf8');\n\n return filePath;\n}\n\nexport function writePluginCacheFile(\n compiler: PluginCompiler,\n fileName: string,\n content: string,\n) {\n return writeCacheFile(compiler.cacheDir, fileName, content);\n}\n","export const PLUGIN_NAME = 'fluentic-style';\n\nexport const PLUGIN_CACHE_DIR = 'node_modules/.cache/fluentic-style';\n\nexport const EXTRACTED_CSS_MARKER = '.__fluentic_style_css_marker__{--fluentic-style:0}';\n\nexport const BUNDLE_CSS_FILE = 'bundle.css';\n","import picomatch from 'picomatch';\nimport { normalizePath } from '../../compiler/utils/path';\n\nexport const DEFAULT_TRANSFORM_INCLUDE_PATTERN = '\\\\.[cm]?[jt]sx?$';\n\nexport const DEFAULT_TRANSFORM_INCLUDE = new RegExp(DEFAULT_TRANSFORM_INCLUDE_PATTERN);\n\nexport const DEFAULT_TRANSFORM_EXCLUDE = /node_modules/;\n\nexport type FilterPattern = string | RegExp | Array<string | RegExp>;\n\nexport type TransformFilterOptions = {\n include?: FilterPattern;\n exclude?: FilterPattern;\n /** Exact npm package names whose script files override file include/exclude rules. */\n includePackages?: string | string[];\n /** Exact npm package names excluded before all other filter rules. */\n excludePackages?: string | string[];\n};\n\nexport type TransformFilter = {\n (id: string): boolean;\n clear(): void;\n};\n\nexport function normalizeModuleId(id: string) {\n return id.split('?')[0]?.split('#')[0] ?? id;\n}\n\nexport function createTransformFilter(options: TransformFilterOptions = {}): TransformFilter {\n const includes = normalizeMatchers(options.include);\n const includePackages = createPackagePattern(options.includePackages);\n const excludePackages = createPackagePattern(options.excludePackages);\n\n const excludes = normalizeMatchers(\n options.exclude ?? (options.include ? undefined : DEFAULT_TRANSFORM_EXCLUDE),\n );\n\n const cache = new Map<string, boolean>();\n\n const filter = ((id: string) => {\n const filePath = normalizeModuleId(id);\n const cached = cache.get(filePath);\n\n if (cached !== undefined) return cached;\n\n const packagePath = normalizePath(filePath);\n const result = excludePackages?.test(packagePath)\n ? false\n : includePackages?.test(packagePath)\n ? DEFAULT_TRANSFORM_INCLUDE.test(filePath)\n : shouldTransform(filePath, includes, excludes);\n\n cache.set(filePath, result);\n\n return result;\n }) as TransformFilter;\n\n filter.clear = () => {\n cache.clear();\n };\n\n return filter;\n}\n\ntype FilterMatcher = (id: string) => boolean;\n\nfunction normalizeMatchers(patterns?: FilterPattern) {\n if (!patterns) return [];\n\n const items = Array.isArray(patterns) ? patterns : [patterns];\n\n return items.map(createMatcher);\n}\n\nfunction createMatcher(pattern: string | RegExp): FilterMatcher {\n if (pattern instanceof RegExp) {\n return (id) => {\n pattern.lastIndex = 0;\n return pattern.test(id);\n };\n }\n\n const matcher = picomatch(normalizePath(pattern), {\n dot: true,\n });\n\n return (id) => matcher(normalizePath(id));\n}\n\nfunction shouldTransform(\n id: string,\n includes: FilterMatcher[],\n excludes: FilterMatcher[],\n): boolean {\n for (const exclude of excludes) {\n if (exclude(id)) return false;\n }\n\n if (!includes.length) {\n return DEFAULT_TRANSFORM_INCLUDE.test(id);\n }\n\n for (const include of includes) {\n if (include(id)) return true;\n }\n\n return false;\n}\n\n/** A conservative native prefilter; the shared JS filter remains authoritative. */\nexport function createTransformHookFilter(options: TransformFilterOptions = {}) {\n const includePackages = createPackagePattern(options.includePackages);\n const excludePackages = createPackagePattern(options.excludePackages);\n const exclude: RegExp[] = [];\n if (excludePackages) exclude.push(excludePackages);\n\n if (!options.include && options.exclude === undefined) {\n // Package inclusions override the default node_modules exclusion.\n exclude.push(\n new RegExp(\n `^${includePackages ? `(?!${includePackages.source})` : ''}[^?#]*node_modules`,\n ),\n );\n }\n\n return {\n id: {\n // Custom globs/regexes run against normalized IDs in the shared filter.\n // Keeping the native check broad avoids changing their matching semantics.\n include: options.include ? undefined : /^[^?#]*\\.[cm]?[jt]sx?(?:[?#][\\s\\S]*)?$/,\n exclude,\n },\n };\n}\n\nfunction createPackagePattern(packages?: string | string[]): RegExp | undefined {\n const names = typeof packages === 'string' ? [packages] : packages ?? [];\n if (!names.length) return undefined;\n\n for (const name of names) {\n if (!/^(?:@[a-zA-Z0-9_][a-zA-Z0-9._-]*\\/)?[a-zA-Z0-9_][a-zA-Z0-9._-]*$/.test(name)) {\n throw new Error(\n `[fluentic-style] Invalid package name in includePackages/excludePackages: ${JSON.stringify(name)}`,\n );\n }\n }\n\n const separator = '[/\\\\\\\\]';\n const alternatives = names.map((name) => name.split('/').map(escapeRegExp).join(separator)).join('|');\n // Match the innermost node_modules owner, including pnpm's nested layout.\n // A package's nested dependencies must not inherit its include/exclude rule.\n return new RegExp(\n `^(?:[^?#]*${separator})?node_modules${separator}(?:${alternatives})` +\n `(?![^?#]*${separator}node_modules${separator})` +\n `(?:${separator}[^?#]*)?(?:[?#][\\\\s\\\\S]*)?$`,\n );\n}\n\nfunction escapeRegExp(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","import path from 'node:path';\nimport { createCompiler } from '../../compiler';\nimport type { Compiler, CompilerCssOptions, CompilerOptions, CompilerRuntimeMode } from '../../compiler';\nimport { PLUGIN_CACHE_DIR, PLUGIN_NAME } from './constants';\nimport type { PluginCssOutputOptions } from './cssOutput';\nimport { createTransformFilter, normalizeModuleId, type TransformFilterOptions } from './filter';\nimport type { BundlerSourceMap } from './sourcemap';\n\nexport type PluginCssOptions = CompilerCssOptions;\nexport { CssPropPresets } from '../../compiler';\nexport type { CompilerCssPropOptions } from '../../compiler';\n\nexport type PluginOptions = CompilerOptions & TransformFilterOptions & {\n cacheDir?: string;\n cssOutput?: PluginCssOutputOptions;\n};\n\nexport type PluginCompiler = ReturnType<typeof createPluginCompiler>;\n\nexport type PluginCompilerArgs = {\n dev: boolean;\n projectDir: string;\n cacheDir: string;\n options: PluginOptions;\n runtimeMode: CompilerRuntimeMode | null;\n};\n\nlet nextCompilerId = 0;\n\nexport function createCompilerId(name?: string) {\n return [PLUGIN_NAME, name, String(nextCompilerId++)].filter(Boolean).join('|');\n}\n\nexport function getPluginCacheDir(projectDir: string, cacheDir?: string) {\n return cacheDir ?? path.join(projectDir, PLUGIN_CACHE_DIR);\n}\n\nexport function createPluginCompiler(args: PluginCompilerArgs) {\n const dev = args.dev;\n const options = args.options;\n\n const projectDir = args.projectDir;\n const cacheDir = args.cacheDir;\n\n const compiler = createCompiler(\n {\n projectDir,\n cacheDir,\n runtimeMode: args.runtimeMode,\n },\n options,\n );\n\n const filter = createTransformFilter(options);\n\n const transform = (\n code: string,\n id: string,\n sourcemap: BundlerSourceMap | null = null,\n ) => {\n const filePath = normalizeModuleId(id);\n\n if (!filter(filePath)) return null;\n\n const result = dev\n ? compiler.compileDebug({ code, filePath, sourcemap })\n : compiler.compileExtract({ code, filePath, sourcemap });\n\n if (!result) return null;\n\n return {\n code: result.code,\n map: result.sourcemap,\n rules: 'rules' in result ? result.rules : [],\n };\n };\n\n return {\n projectDir,\n cacheDir,\n dev,\n //\n compiler,\n filter,\n transform,\n };\n}\n\nexport function invalidateFiles(\n compiler: Compiler,\n filePaths: Iterable<string>,\n) {\n for (const filePath of filePaths) {\n compiler.invalidateFile({ filePath });\n }\n}\n","import type { PluginCompiler } from './compiler';\nimport { EXTRACTED_CSS_MARKER } from './constants';\n\nexport function getExtractedCss(compiler: PluginCompiler) {\n return compiler.compiler.getExtractedCss();\n}\n\nexport function replaceCssMarker(text: string, css: string) {\n return text.replace(EXTRACTED_CSS_MARKER, css);\n}\n\nexport function hasCssMarker(text: string) {\n return text.includes(EXTRACTED_CSS_MARKER);\n}\n","import type { Features, Targets, TransformOptions } from 'lightningcss';\n\nexport type CssOutputTargets = Targets | string | string[];\n\nexport type CssOutputOptions = {\n targets?: CssOutputTargets;\n vendorPrefixes?: boolean;\n minify?: boolean;\n lightningcss?: Partial<\n Omit<\n TransformOptions<Record<string, never>>,\n 'code' | 'filename' | 'minify' | 'targets'\n >\n >;\n};\n\nexport type PluginCssOutputOptions = boolean | CssOutputOptions;\n\nexport async function transformCssOutput(\n css: string,\n options: PluginCssOutputOptions | undefined,\n filename: string,\n): Promise<string> {\n if (!css || !options) return css;\n\n const outputOptions = options === true ? {} : options;\n const lightningcss = await import('lightningcss');\n const targets = getLightningTargets(\n lightningcss.browserslistToTargets,\n outputOptions.targets ?? 'defaults',\n );\n const exclude = getLightningExclude(lightningcss.Features, outputOptions);\n\n const result = lightningcss.transform({\n filename,\n code: new TextEncoder().encode(css),\n ...outputOptions.lightningcss,\n targets,\n minify: outputOptions.minify,\n exclude,\n });\n\n return new TextDecoder().decode(result.code);\n}\n\nfunction getLightningTargets(\n browserslistToTargets: (browserslist: string[]) => Targets,\n targets: CssOutputTargets | undefined,\n): Targets | undefined {\n if (!targets) return undefined;\n if (typeof targets === 'string') return browserslistToTargets([targets]);\n if (Array.isArray(targets)) return browserslistToTargets(targets);\n return targets;\n}\n\nfunction getLightningExclude(\n features: typeof Features,\n options: CssOutputOptions,\n) {\n const exclude = options.lightningcss?.exclude ?? 0;\n\n return options.vendorPrefixes === false\n ? exclude | features.VendorPrefixes\n : exclude;\n}\n","export function shouldInjectModuleImport(code: string, moduleId: string) {\n return !code.includes(moduleId);\n}\n\nexport function injectModuleImport(code: string, moduleId: string) {\n if (!shouldInjectModuleImport(code, moduleId)) return code;\n\n return injectCodeAfterDirectivePrologue(\n code,\n `import ${JSON.stringify(moduleId)};\\n`,\n );\n}\n\nexport function injectCodeAfterDirectivePrologue(\n code: string,\n injectedCode: string,\n) {\n const insertAt = getDirectivePrologueEnd(code);\n\n return code.slice(0, insertAt) + injectedCode + code.slice(insertAt);\n}\n\nfunction getDirectivePrologueEnd(code: string) {\n const pattern = /^(?:\\s*(?:\"[^\"]*\"|'[^']*')\\s*;?)+/;\n const match = pattern.exec(code);\n\n return match ? match[0].length : 0;\n}\n","import { type CompilerCssOptions, type CompilerDevOptions, CompilerRuntimeMode } from '../../compiler';\nimport type { BuildConfig, BuildDevConfig } from '../../config/build';\nimport type { PluginOptions } from './compiler';\n\nexport function getStyleRuntimeMode(dev: boolean, rsc = false): CompilerRuntimeMode {\n if (rsc) {\n return dev ? CompilerRuntimeMode.RscDev : CompilerRuntimeMode.RscProd;\n }\n\n return dev ? CompilerRuntimeMode.Dev : CompilerRuntimeMode.Prod;\n}\n\nexport function getPluginBuildConfig(options: PluginOptions, dev = false): BuildConfig {\n const css: CompilerCssOptions = hasBuildConfig(options.css) ? options.css! : {};\n\n return {\n hoist: !dev && options.hoist !== false,\n css,\n check: options.check,\n };\n}\n\nexport function getPluginBuildDevConfig(options: PluginOptions): BuildDevConfig | null {\n const devConfig: BuildDevConfig | null = hasBuildConfig(options.dev) ? options.dev! : null;\n\n return devConfig;\n}\n\nfunction hasBuildConfig(config: CompilerCssOptions | CompilerDevOptions | null | undefined) {\n if (!config) return false;\n\n for (const key in config) {\n if (config[key as keyof typeof config] !== undefined) return true;\n }\n\n return false;\n}\n\nexport function getStyleEntryDefines(\n buildConfig: BuildConfig,\n buildDevConfig: BuildDevConfig | null,\n sidecarUrl: string | null,\n stringify = true,\n) {\n const defines: Record<string, string> = {\n FLUENTIC_STYLE_BUILD_CONFIG: JSON.stringify(buildConfig),\n FLUENTIC_STYLE_DEV_CONFIG: JSON.stringify(buildDevConfig ?? {}),\n FLUENTIC_STYLE_SIDECAR_SERVER_URL: sidecarUrl ?? '',\n };\n\n if (stringify) {\n Object.keys(defines).forEach((key) => {\n defines[key] = JSON.stringify(defines[key]);\n });\n }\n\n return defines;\n}\n\nexport function createStyleEntryGlobalSource(\n buildConfig: BuildConfig,\n buildDevConfig: BuildDevConfig | null,\n sidecarUrl: string | null,\n) {\n const defines = getStyleEntryDefines(buildConfig, buildDevConfig, sidecarUrl, false);\n\n return Object.entries(defines)\n .map(([key, value]) => `globalThis[${JSON.stringify(key)}] = ${JSON.stringify(value)};`)\n .join('\\n');\n}\n","import type { CompilerOptions, DevSourcemapMode } from '../../compiler';\nimport type { BabelTransformSourceMap } from '../../compiler/transform';\nimport { getDefaultSourcemapUrl, type GetSourcemapFilePathFn } from '../../compiler/utils/sourcemap';\nimport type { SourcemapSidecar } from './sidecar';\n\nexport type BundlerSourceMap = BabelTransformSourceMap | undefined;\n\nexport function parseBundlerSourceMap(map: string | null | undefined): any {\n if (!map) return null;\n return JSON.parse(map) as Exclude<BabelTransformSourceMap, string | null | undefined>;\n}\n\nexport function resolveDevSourcemapMode(\n mode: DevSourcemapMode | undefined,\n dev: boolean,\n): DevSourcemapMode {\n return mode ?? (dev ? 'sidecarServer' : 'sourceUrl');\n}\n\nexport function resolvePluginSourcemapFilePath(\n getSourcemapFilePath: GetSourcemapFilePathFn | undefined,\n sourcemapSidecar: SourcemapSidecar | null,\n): GetSourcemapFilePathFn {\n return (info) => {\n const defaultSourceUrl = getDefaultSourcemapUrl(info);\n\n const sourcePath = getSourcemapFilePath?.({\n ...info,\n sourcePath: info.sourcePath,\n sourceUrl: defaultSourceUrl,\n });\n\n const resolvedSourceUrl = sourcePath || defaultSourceUrl;\n\n sourcemapSidecar?.registerSource(info.absolutePath, resolvedSourceUrl);\n\n return resolvedSourceUrl;\n };\n}\n\nexport function resolvePluginSourcemapOptions<T extends CompilerOptions>(\n options: T,\n sourcemapSidecar: SourcemapSidecar | null,\n): T {\n return {\n ...options,\n getSourcemapFilePath: resolvePluginSourcemapFilePath(\n options.getSourcemapFilePath,\n sourcemapSidecar,\n ),\n };\n}\n","import { EXTRACTED_CSS_MARKER } from './constants';\n\nexport const RUNTIME_MODULE_ID = 'virtual:fluentic-style';\nexport const CSS_MODULE_ID = `${RUNTIME_MODULE_ID}.css`;\n\nexport const RESOLVED_RUNTIME_MODULE_ID = `\\0${RUNTIME_MODULE_ID}`;\nexport const RESOLVED_CSS_MODULE_ID = `\\0${CSS_MODULE_ID}`;\n\nexport const VIRTUAL_MODULE_REQUEST_PATTERN = `^${escapeRegex(RUNTIME_MODULE_ID)}(?:\\\\.css)?$`;\nexport const VIRTUAL_MODULE_REQUEST_REGEX = new RegExp(VIRTUAL_MODULE_REQUEST_PATTERN);\n\nexport function createRuntimeModuleSource(\n extract: boolean,\n cssModuleId?: string | null,\n) {\n return [\n extract && cssModuleId && `import ${JSON.stringify(cssModuleId)};`,\n '',\n ].filter(Boolean).join('\\n');\n}\n\nexport function createRuntimeImport() {\n return `import ${JSON.stringify(RUNTIME_MODULE_ID)};\\n`;\n}\n\nexport function prependRuntimeImport(code: string) {\n if (code.includes(RUNTIME_MODULE_ID)) return code;\n return createRuntimeImport() + code;\n}\n\nexport function isVirtualModuleRequest(id: string, moduleId: string) {\n const normalized = normalizeVirtualModuleId(id);\n\n return normalized === moduleId || normalized === `\\0${moduleId}`;\n}\n\nexport function getVirtualModuleId(id: string) {\n if (isVirtualModuleRequest(id, RUNTIME_MODULE_ID)) {\n return RESOLVED_RUNTIME_MODULE_ID;\n }\n\n if (isVirtualModuleRequest(id, CSS_MODULE_ID)) {\n return RESOLVED_CSS_MODULE_ID;\n }\n\n return null;\n}\n\nexport function loadVirtualModule(\n id: string,\n extract: boolean,\n cssModuleId: string | null,\n) {\n if (isVirtualModuleRequest(id, RUNTIME_MODULE_ID)) {\n return createRuntimeModuleSource(extract, cssModuleId);\n }\n\n if (isVirtualModuleRequest(id, CSS_MODULE_ID)) {\n return EXTRACTED_CSS_MARKER;\n }\n\n return null;\n}\n\nfunction normalizeVirtualModuleId(id: string) {\n const base = id.split('?')[0]?.split('#')[0] ?? id;\n\n if (base.startsWith('/@id/__x00__')) {\n return `\\0${base.slice('/@id/__x00__'.length)}`;\n }\n\n if (base.startsWith('/@id/')) {\n return base.slice('/@id/'.length);\n }\n\n return base;\n}\n\nfunction escapeRegex(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","import { PLUGIN_NAME } from './constants';\n\nexport function formatError(msg: string) {\n return `[${PLUGIN_NAME}] ${msg}`;\n}\n"],"mappings":";;;;;;AAmCA,SAAgB,mBAAmB,MAAwB;CACzD,MAAM,UAAU,KAAK,KAAK,KAAK,UAAU,KAAK,WAAW;CACzD,MAAM,WAAW,KAAK,KAAK,SAAS,OAAO;CAE3C,MAAM,eAAe,aAAqB;EACxC,OAAO,KAAK,KAAK,UAAU,aAAa,QAAQ,IAAI,OAAO;CAC7D;CAEA,MAAM,cAAc,SAAyB;EAC3C,MAAM,SAA6B;GACjC,UAAU,cAAc,KAAK,QAAQ;GACrC,aAAa,KAAK;GAClB,YAAY,KAAK;GACjB,OAAO,KAAK;GACZ,WAAW,KAAK,IAAI;EACtB;EAEA,GAAG,UAAU,UAAU,EAAE,WAAW,KAAK,CAAC;EAE1C,GAAG,cAAc,YAAY,OAAO,QAAQ,GAAG,KAAK,UAAU,MAAM,GAAG,MAAM;CAC/E;CAEA,MAAM,UAAU,OAAuB,CAAC,MAAM;EAE5C,OAAO,WADO,SAAS,IACD,GAAG,IAAI;CAC/B;CAEA,MAAM,YAAY,OAAuB,CAAC,MAAM;EAC9C,MAAM,UAAU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Y,UAAkB;CACnE,MAAM,aAAa,yBAAyB,EAAE;CAE9C,OAAO,eAAe,YAAY,eAAe,KAAK;AACxD;AAEA,SAAgB,mBAAmB,IAAY;CAC7C,IAAI,uBAAuB,IAAA,wBAAqB,GAC9C,OAAO;CAGT,IAAI,uBAAuB,IAAI,aAAa,GAC1C,OAAO;CAGT,OAAO;AACT;AAEA,SAAgB,kBACd,IACA,SACA,aACA;CACA,IAAI,uBAAuB,IAAA,wBAAqB,GAC9C,OAAO,0BAA0B,SAAS,WAAW;CAGvD,IAAI,uBAAuB,IAAI,aAAa,GAC1C,OAAO;CAGT,OAAO;AACT;AAEA,SAAS,yBAAyB,IAAY;CAC5C,MAAM,OAAO,GAAG,MAAM,GAAG,EAAE,IAAI,MAAM,GAAG,EAAE,MAAM;CAEhD,IAAI,KAAK,WAAW,cAAc,GAChC,OAAO,KAAK,KAAK,MAAM,EAAqB;CAG9C,IAAI,KAAK,WAAW,OAAO,GACzB,OAAO,KAAK,MAAM,CAAc;CAGlC,OAAO;AACT;AAEA,SAAS,YAAY,OAAe;CAClC,OAAO,MAAM,QAAQ,uBAAuB,MAAM;AACpD;;;AC9EA,SAAgB,YAAY,KAAa;CACvC,OAAO,IAAI,YAAY,IAAI;AAC7B"}
@@ -1,4 +1,4 @@
1
- import { f as TOKEN_ID, h as TOKEN_VAR_NAME, m as TOKEN_OVERRIDE, n as createStyleToken, p as TOKEN_NAME } from "./token-Ci73NE6h.js";
1
+ import { f as TOKEN_ID, h as TOKEN_VAR_NAME, m as TOKEN_OVERRIDE, n as createStyleToken, p as TOKEN_NAME } from "./token-BX5jRxMb.js";
2
2
  //#region dialect/namedTokens.ts
3
3
  const ROOT = Symbol("fluentic.namedTokens.root");
4
4
  function createNamedToken(id, value) {
@@ -86,4 +86,4 @@ function noop() {}
86
86
  //#endregion
87
87
  export { getNamedToken as i, createNamedTokenId as n, createNamedTokens as r, createNamedToken as t };
88
88
 
89
- //# sourceMappingURL=namedTokens-DwgmUMBM.js.map
89
+ //# sourceMappingURL=namedTokens-paLD-Pdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"namedTokens-DwgmUMBM.js","names":[],"sources":["../dialect/namedTokens.ts"],"sourcesContent":["import {\n createStyleToken,\n type StyleToken,\n TOKEN_ID,\n TOKEN_NAME,\n TOKEN_OVERRIDE,\n TOKEN_VAR_NAME,\n} from '../style/token';\n\ntype ValueRecord = Record<PropertyKey, unknown>;\n\nexport type NamedToken<Value = unknown> = StyleToken<Value>;\n\nexport type NamedTokenRecord<T extends object> = {\n [P in keyof T]: T[P] extends object ? NamedTokenRecord<T[P]>\n : NamedToken<T[P]>;\n};\n\ntype NamedTokenRoot = {\n readonly __fluenticNamedTokens: true;\n readonly namespace: string;\n readonly values: ValueRecord | undefined;\n readonly cache: Map<string, StyleToken>;\n};\n\nconst ROOT = Symbol('fluentic.namedTokens.root');\n\nexport function createNamedToken<T>(id: string, value?: T): NamedToken<T> {\n const tokenId = createNamedTokenId(id);\n const token = createStyleToken(value, tokenId) as NamedToken<T>;\n token[TOKEN_VAR_NAME] = '--token-' + tokenId;\n return token;\n}\n\nexport function createNamedTokens<T extends object>(\n namespace: string,\n values?: T,\n): NamedTokenRecord<T> {\n return createNamedTokenProxy({\n __fluenticNamedTokens: true,\n namespace,\n values: values as ValueRecord | undefined,\n cache: new Map(),\n }, []) as NamedTokenRecord<T>;\n}\n\nexport function getNamedToken<T = unknown>(\n tokens: unknown,\n ref: string,\n): StyleToken<T> | undefined {\n if (!ref.startsWith('$')) return undefined;\n\n const root = getNamedTokenRoot(tokens);\n if (!root) return undefined;\n\n const path = ref.slice(1).split('.').filter(Boolean);\n if (!path.length) return undefined;\n if (!hasNamedTokenPath(root, path)) return undefined;\n\n return getNamedTokenAtPath(root, path) as StyleToken<T>;\n}\n\nexport function createNamedTokenId(id: string) {\n return id.split('.').map(encodeNamedTokenSegment).join('-');\n}\n\n// Escape separators and the escape marker itself so distinct paths cannot collide.\nfunction encodeNamedTokenSegment(segment: string) {\n return segment.replace(/[^a-zA-Z0-9]/gu, (char) => '_x' + char.codePointAt(0)!.toString(16) + '_');\n}\n\nfunction createNamedTokenProxy(\n root: NamedTokenRoot,\n path: string[],\n): unknown {\n return new Proxy(noop, {\n get(_target, property) {\n if (property === ROOT) return root;\n if (property === 'then') return undefined;\n if (property === Symbol.toStringTag) return 'NamedTokens';\n if (\n property === TOKEN_ID ||\n property === TOKEN_NAME ||\n property === TOKEN_VAR_NAME ||\n property === TOKEN_OVERRIDE ||\n property === 'value' ||\n property === 'ref'\n ) {\n if (!path.length) return undefined;\n const token = getNamedTokenAtPath(root, path);\n return token[property as keyof typeof token];\n }\n if (typeof property === 'symbol') return undefined;\n\n return createNamedTokenProxy(root, path.concat(String(property)));\n },\n apply(_target, _thisArg, args) {\n if (!path.length) return undefined;\n const token = getNamedTokenAtPath(root, path);\n return token.apply(undefined, args as Parameters<typeof token>);\n },\n });\n}\n\nfunction getNamedTokenAtPath(\n root: NamedTokenRoot,\n path: string[],\n) {\n const key = JSON.stringify(path);\n const cached = root.cache.get(key);\n if (cached) return cached;\n\n const value = getValueAtPath(root.values, path);\n const id = root.namespace.split('.').concat(path).map(encodeNamedTokenSegment).join('-');\n const token = createStyleToken(value, id);\n token[TOKEN_VAR_NAME] = '--token-' + id;\n root.cache.set(key, token);\n return token;\n}\n\nfunction hasNamedTokenPath(\n root: NamedTokenRoot,\n path: string[],\n) {\n if (!root.values) return true;\n\n let current: unknown = root.values;\n\n for (let i = 0; i < path.length; i++) {\n if (!current || typeof current !== 'object') return false;\n if (!(path[i] in current)) return false;\n current = (current as ValueRecord)[path[i]];\n }\n\n return true;\n}\n\nfunction getNamedTokenRoot(tokens: unknown): NamedTokenRoot | undefined {\n if (!tokens || (typeof tokens !== 'object' && typeof tokens !== 'function')) return undefined;\n\n return (tokens as { [ROOT]?: NamedTokenRoot; })[ROOT];\n}\n\nfunction getValueAtPath(\n values: ValueRecord | undefined,\n path: string[],\n) {\n let current: unknown = values;\n\n for (let i = 0; i < path.length; i++) {\n if (!current || typeof current !== 'object') return undefined;\n current = (current as ValueRecord)[path[i]];\n }\n\n return current;\n}\n\nfunction noop() {}\n"],"mappings":";;AAyBA,MAAM,OAAO,OAAO,2BAA2B;AAE/C,SAAgB,iBAAoB,IAAY,OAA0B;CACxE,MAAM,UAAU,mBAAmB,EAAE;CACrC,MAAM,QAAQ,iBAAiB,OAAO,OAAO;CAC7C,MAAM,kBAAkB,aAAa;CACrC,OAAO;AACT;AAEA,SAAgB,kBACd,WACA,QACqB;CACrB,OAAO,sBAAsB;EAC3B,uBAAuB;EACvB;EACQ;EACR,uBAAO,IAAI,IAAI;CACjB,GAAG,CAAC,CAAC;AACP;AAEA,SAAgB,cACd,QACA,KAC2B;CAC3B,IAAI,CAAC,IAAI,WAAW,GAAG,GAAG,OAAO,KAAA;CAEjC,MAAM,OAAO,kBAAkB,MAAM;CACrC,IAAI,CAAC,MAAM,OAAO,KAAA;CAElB,MAAM,OAAO,IAAI,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,OAAO,OAAO;CACnD,IAAI,CAAC,KAAK,QAAQ,OAAO,KAAA;CACzB,IAAI,CAAC,kBAAkB,MAAM,IAAI,GAAG,OAAO,KAAA;CAE3C,OAAO,oBAAoB,MAAM,IAAI;AACvC;AAEA,SAAgB,mBAAmB,IAAY;CAC7C,OAAO,GAAG,MAAM,GAAG,EAAE,IAAI,uBAAuB,EAAE,KAAK,GAAG;AAC5D;AAGA,SAAS,wBAAwB,SAAiB;CAChD,OAAO,QAAQ,QAAQ,mBAAmB,SAAS,OAAO,KAAK,YAAY,CAAC,EAAG,SAAS,EAAE,IAAI,GAAG;AACnG;AAEA,SAAS,sBACP,MACA,MACS;CACT,OAAO,IAAI,MAAM,MAAM;EACrB,IAAI,SAAS,UAAU;GACrB,IAAI,aAAa,MAAM,OAAO;GAC9B,IAAI,aAAa,QAAQ,OAAO,KAAA;GAChC,IAAI,aAAa,OAAO,aAAa,OAAO;GAC5C,IACE,aAAa,YACb,a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AS,eACP,QACA,MACA;CACA,IAAI,UAAmB;CAEvB,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,IAAI,CAAC,WAAW,OAAO,YAAY,UAAU,OAAO,KAAA;EACpD,UAAW,QAAwB,KAAK;CAC1C;CAEA,OAAO;AACT;AAEA,SAAS,OAAO,CAAC"}
1
+ {"version":3,"file":"namedTokens-paLD-Pdk.js","names":[],"sources":["../dialect/namedTokens.ts"],"sourcesContent":["import {\n createStyleToken,\n type StyleToken,\n TOKEN_ID,\n TOKEN_NAME,\n TOKEN_OVERRIDE,\n TOKEN_VAR_NAME,\n} from '../style/token';\n\ntype ValueRecord = Record<PropertyKey, unknown>;\n\nexport type NamedToken<Value = unknown> = StyleToken<Value>;\n\nexport type NamedTokenRecord<T extends object> = {\n [P in keyof T]: T[P] extends object ? NamedTokenRecord<T[P]>\n : NamedToken<T[P]>;\n};\n\ntype NamedTokenRoot = {\n readonly __fluenticNamedTokens: true;\n readonly namespace: string;\n readonly values: ValueRecord | undefined;\n readonly cache: Map<string, StyleToken>;\n};\n\nconst ROOT = Symbol('fluentic.namedTokens.root');\n\nexport function createNamedToken<T>(id: string, value?: T): NamedToken<T> {\n const tokenId = createNamedTokenId(id);\n const token = createStyleToken(value, tokenId) as NamedToken<T>;\n token[TOKEN_VAR_NAME] = '--token-' + tokenId;\n return token;\n}\n\nexport function createNamedTokens<T extends object>(\n namespace: string,\n values?: T,\n): NamedTokenRecord<T> {\n return createNamedTokenProxy({\n __fluenticNamedTokens: true,\n namespace,\n values: values as ValueRecord | undefined,\n cache: new Map(),\n }, []) as NamedTokenRecord<T>;\n}\n\nexport function getNamedToken<T = unknown>(\n tokens: unknown,\n ref: string,\n): StyleToken<T> | undefined {\n if (!ref.startsWith('$')) return undefined;\n\n const root = getNamedTokenRoot(tokens);\n if (!root) return undefined;\n\n const path = ref.slice(1).split('.').filter(Boolean);\n if (!path.length) return undefined;\n if (!hasNamedTokenPath(root, path)) return undefined;\n\n return getNamedTokenAtPath(root, path) as StyleToken<T>;\n}\n\nexport function createNamedTokenId(id: string) {\n return id.split('.').map(encodeNamedTokenSegment).join('-');\n}\n\n// Escape separators and the escape marker itself so distinct paths cannot collide.\nfunction encodeNamedTokenSegment(segment: string) {\n return segment.replace(/[^a-zA-Z0-9]/gu, (char) => '_x' + char.codePointAt(0)!.toString(16) + '_');\n}\n\nfunction createNamedTokenProxy(\n root: NamedTokenRoot,\n path: string[],\n): unknown {\n return new Proxy(noop, {\n get(_target, property) {\n if (property === ROOT) return root;\n if (property === 'then') return undefined;\n if (property === Symbol.toStringTag) return 'NamedTokens';\n if (\n property === TOKEN_ID ||\n property === TOKEN_NAME ||\n property === TOKEN_VAR_NAME ||\n property === TOKEN_OVERRIDE ||\n property === 'value' ||\n property === 'ref'\n ) {\n if (!path.length) return undefined;\n const token = getNamedTokenAtPath(root, path);\n return token[property as keyof typeof token];\n }\n if (typeof property === 'symbol') return undefined;\n\n return createNamedTokenProxy(root, path.concat(String(property)));\n },\n apply(_target, _thisArg, args) {\n if (!path.length) return undefined;\n const token = getNamedTokenAtPath(root, path);\n return token.apply(undefined, args as Parameters<typeof token>);\n },\n });\n}\n\nfunction getNamedTokenAtPath(\n root: NamedTokenRoot,\n path: string[],\n) {\n const key = JSON.stringify(path);\n const cached = root.cache.get(key);\n if (cached) return cached;\n\n const value = getValueAtPath(root.values, path);\n const id = root.namespace.split('.').concat(path).map(encodeNamedTokenSegment).join('-');\n const token = createStyleToken(value, id);\n token[TOKEN_VAR_NAME] = '--token-' + id;\n root.cache.set(key, token);\n return token;\n}\n\nfunction hasNamedTokenPath(\n root: NamedTokenRoot,\n path: string[],\n) {\n if (!root.values) return true;\n\n let current: unknown = root.values;\n\n for (let i = 0; i < path.length; i++) {\n if (!current || typeof current !== 'object') return false;\n if (!(path[i] in current)) return false;\n current = (current as ValueRecord)[path[i]];\n }\n\n return true;\n}\n\nfunction getNamedTokenRoot(tokens: unknown): NamedTokenRoot | undefined {\n if (!tokens || (typeof tokens !== 'object' && typeof tokens !== 'function')) return undefined;\n\n return (tokens as { [ROOT]?: NamedTokenRoot; })[ROOT];\n}\n\nfunction getValueAtPath(\n values: ValueRecord | undefined,\n path: string[],\n) {\n let current: unknown = values;\n\n for (let i = 0; i < path.length; i++) {\n if (!current || typeof current !== 'object') return undefined;\n current = (current as ValueRecord)[path[i]];\n }\n\n return current;\n}\n\nfunction noop() {}\n"],"mappings":";;AAyBA,MAAM,OAAO,OAAO,2BAA2B;AAE/C,SAAgB,iBAAoB,IAAY,OAA0B;CACxE,MAAM,UAAU,mBAAmB,EAAE;CACrC,MAAM,QAAQ,iBAAiB,OAAO,OAAO;CAC7C,MAAM,kBAAkB,aAAa;CACrC,OAAO;AACT;AAEA,SAAgB,kBACd,WACA,QACqB;CACrB,OAAO,sBAAsB;EAC3B,uBAAuB;EACvB;EACQ;EACR,uBAAO,IAAI,IAAI;CACjB,GAAG,CAAC,CAAC;AACP;AAEA,SAAgB,cACd,QACA,KAC2B;CAC3B,IAAI,CAAC,IAAI,WAAW,GAAG,GAAG,OAAO,KAAA;CAEjC,MAAM,OAAO,kBAAkB,MAAM;CACrC,IAAI,CAAC,MAAM,OAAO,KAAA;CAElB,MAAM,OAAO,IAAI,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,OAAO,OAAO;CACnD,IAAI,CAAC,KAAK,QAAQ,OAAO,KAAA;CACzB,IAAI,CAAC,kBAAkB,MAAM,IAAI,GAAG,OAAO,KAAA;CAE3C,OAAO,oBAAoB,MAAM,IAAI;AACvC;AAEA,SAAgB,mBAAmB,IAAY;CAC7C,OAAO,GAAG,MAAM,GAAG,EAAE,IAAI,uBAAuB,EAAE,KAAK,GAAG;AAC5D;AAGA,SAAS,wBAAwB,SAAiB;CAChD,OAAO,QAAQ,QAAQ,mBAAmB,SAAS,OAAO,KAAK,YAAY,CAAC,EAAG,SAAS,EAAE,IAAI,GAAG;AACnG;AAEA,SAAS,sBACP,MACA,MACS;CACT,OAAO,IA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B,KAAK;CAC1C;CAEA,OAAO;AACT;AAEA,SAAS,kBAAkB,QAA6C;CACtE,IAAI,CAAC,UAAW,OAAO,WAAW,YAAY,OAAO,WAAW,YAAa,OAAO,KAAA;CAEpF,OAAQ,OAAwC;AAClD;AAEA,SAAS,eACP,QACA,MACA;CACA,IAAI,UAAmB;CAEvB,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,IAAI,CAAC,WAAW,OAAO,YAAY,UAAU,OAAO,KAAA;EACpD,UAAW,QAAwB,KAAK;CAC1C;CAEA,OAAO;AACT;AAEA,SAAS,OAAO,CAAC"}
@@ -1,6 +1,6 @@
1
- import { t as CssPropPresets } from "../../compiler-AOb_VaKQ.mjs";
2
- import { E as invalidateFiles, F as PLUGIN_NAME, S as replaceCssMarker, T as getPluginCacheDir, _ as getStyleRuntimeMode, a as VIRTUAL_MODULE_REQUEST_PATTERN, b as transformCssOutput, c as loadVirtualModule, d as resolvePluginSourcemapFilePath, g as getStyleEntryDefines, h as getPluginBuildDevConfig, k as DEFAULT_TRANSFORM_INCLUDE_PATTERN, l as parseBundlerSourceMap, m as getPluginBuildConfig, n as CSS_MODULE_ID, s as isVirtualModuleRequest, u as resolveDevSourcemapMode, w as createPluginCompiler, x as hasCssMarker } from "../../misc-CyZgGtc9.mjs";
3
- import { t as getSourcemapSidecar } from "../../sidecar-cCzTDkzg.mjs";
1
+ import { t as CssPropPresets } from "../../compiler-Cat8TmMk.mjs";
2
+ import { E as invalidateFiles, I as PLUGIN_NAME, S as replaceCssMarker, T as getPluginCacheDir, _ as getStyleRuntimeMode, a as VIRTUAL_MODULE_REQUEST_PATTERN, b as transformCssOutput, c as loadVirtualModule, d as resolvePluginSourcemapFilePath, g as getStyleEntryDefines, h as getPluginBuildDevConfig, k as DEFAULT_TRANSFORM_INCLUDE_PATTERN, l as parseBundlerSourceMap, m as getPluginBuildConfig, n as CSS_MODULE_ID, s as isVirtualModuleRequest, u as resolveDevSourcemapMode, w as createPluginCompiler, x as hasCssMarker } from "../../misc-BKaSZF14.mjs";
3
+ import { t as getSourcemapSidecar } from "../../sidecar-B7Q2P71F.mjs";
4
4
  import path from "node:path";
5
5
  import { Buffer } from "node:buffer";
6
6
  //#region plugin/bundler/farm/plugin.ts
@@ -1,7 +1,7 @@
1
- import { l as isPromiseLike, t as CssPropPresets } from "../../compiler-AOb_VaKQ.mjs";
2
- import { B as createFileCssContentHash, C as createCompilerId, D as DEFAULT_TRANSFORM_EXCLUDE, E as invalidateFiles, F as PLUGIN_NAME, I as writeCacheFile, M as BUNDLE_CSS_FILE, N as EXTRACTED_CSS_MARKER, O as DEFAULT_TRANSFORM_INCLUDE, P as PLUGIN_CACHE_DIR, R as createFileCssCache, _ as getStyleRuntimeMode, b as transformCssOutput, g as getStyleEntryDefines, w as createPluginCompiler } from "../../misc-CyZgGtc9.mjs";
3
- import { t as getSourcemapSidecar } from "../../sidecar-cCzTDkzg.mjs";
4
- import { _ as DEV_CSS_ROUTE, a as createNextBuildDevConfig, c as getNextCacheDir, f as nextRegistry, g as CSS_ENTRY_IMPORT_PATH, h as resolveNextCompilerOptions, i as createNextBuildConfig, l as getNextPrecollectCacheSubdir, m as replaceCssMarkerAsset, n as addAliases, o as createNextConfigHash, p as removeUndefinedValues, r as addWebpackPlugin, s as createSerializableImportSources, t as NEXT_COMPILER_IDS, u as getTransformLoaderPath, v as LOADER_IMPORT_PATH } from "../../utils-BO6Ix8t5.mjs";
1
+ import { l as isPromiseLike, t as CssPropPresets } from "../../compiler-Cat8TmMk.mjs";
2
+ import { C as createCompilerId, D as DEFAULT_TRANSFORM_EXCLUDE, E as invalidateFiles, F as PLUGIN_CACHE_DIR, I as PLUGIN_NAME, L as writeCacheFile, N as BUNDLE_CSS_FILE, O as DEFAULT_TRANSFORM_INCLUDE, P as EXTRACTED_CSS_MARKER, V as createFileCssContentHash, _ as getStyleRuntimeMode, b as transformCssOutput, g as getStyleEntryDefines, w as createPluginCompiler, z as createFileCssCache } from "../../misc-BKaSZF14.mjs";
3
+ import { t as getSourcemapSidecar } from "../../sidecar-B7Q2P71F.mjs";
4
+ import { _ as DEV_CSS_ROUTE, a as createNextBuildDevConfig, c as getNextCacheDir, f as nextRegistry, g as CSS_ENTRY_IMPORT_PATH, h as resolveNextCompilerOptions, i as createNextBuildConfig, l as getNextPrecollectCacheSubdir, m as replaceCssMarkerAsset, n as addAliases, o as createNextConfigHash, p as removeUndefinedValues, r as addWebpackPlugin, s as createSerializableImportSources, t as NEXT_COMPILER_IDS, u as getTransformLoaderPath, v as LOADER_IMPORT_PATH } from "../../utils-D2QdzQkX.mjs";
5
5
  import { createHash } from "node:crypto";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
@@ -274,7 +274,7 @@ function addTransformLoader(config, options, compilerId) {
274
274
  }],
275
275
  enforce: "pre",
276
276
  test: DEFAULT_TRANSFORM_INCLUDE,
277
- exclude: options.include ? void 0 : [
277
+ exclude: options.include || options.includePackages?.length ? void 0 : [
278
278
  DEFAULT_TRANSFORM_EXCLUDE,
279
279
  /\.next/,
280
280
  /\.git/