{"version":3,"sources":["../src/index.ts","../src/generators/system-color-palette.ts","../src/constants/colors.ts","../src/constants/thresholds.ts","../src/libs/adobe-leonardo.ts","../src/utils/color.ts","../src/generators/brand-color-palette.ts","../src/generators/semantic-mapping.ts"],"sourcesContent":["export * from './generators';\nexport * from './constants';\nexport type * from './types';\nexport { getColorLightness } from './utils';\n","import { formatCss, oklch } from 'culori';\n\nimport {\n    BASE_COLORS,\n    DEFAULT_CONTRAST_RATIOS,\n    DEFAULT_MAIN_BACKGROUND_LIGHTNESS,\n    DEFAULT_PRIMITIVE_COLORS,\n} from '../constants';\nimport { generateThemeTokens } from '../libs';\nimport type { ColorGeneratorConfig, ColorPaletteResult, ColorToken } from '../types';\nimport { formatOklchForWeb } from '../utils';\n\nconst createBaseColorTokens = (formatter: (oklchString: string) => string) => {\n    return Object.entries(BASE_COLORS).reduce(\n        (tokens, [colorName, colorData]) => {\n            const oklchColor = oklch(colorData.hex);\n            tokens[colorName as keyof typeof BASE_COLORS] = {\n                name: colorData.name,\n                hex: colorData.hex,\n                oklch: formatter(formatCss(oklchColor) ?? ''),\n                codeSyntax: colorData.codeSyntax,\n            };\n            return tokens;\n        },\n        {} as Record<keyof typeof BASE_COLORS, ColorToken>,\n    );\n};\n\n/**\n * 시스템 컬러 팔레트를 생성합니다.\n * Primitive 토큰들을 포함한 일관된 토큰 컨테이너 형태로 반환합니다.\n *\n * @param config - 색상 생성기 설정\n * @returns 기본, 라이트, 다크 테마의 토큰 컨테이너\n *\n * @example\n * generateSystemColorPalette()\n * // returns: {\n * //   base: { tokens: { \"color-white\": {...}, \"color-black\": {...} }, metadata: {...} },\n * //   light: { tokens: { \"color-blue-050\": {...}, \"color-background-canvas\": {...} }, metadata: {...} },\n * //   dark: { tokens: { ... }, metadata: {...} }\n * // }\n */\nfunction generateSystemColorPalette(config: ColorGeneratorConfig = {}): ColorPaletteResult {\n    const colors = config.colors || DEFAULT_PRIMITIVE_COLORS;\n    const contrastRatios = config.contrastRatios || DEFAULT_CONTRAST_RATIOS;\n    const background = config.background || {\n        color: '#FFFFFF',\n        lightness: DEFAULT_MAIN_BACKGROUND_LIGHTNESS,\n        name: 'gray',\n    };\n\n    const lightTokens = generateThemeTokens({\n        colors,\n        contrastRatios,\n        backgroundColor: background.color,\n        backgroundName: background.name,\n        lightness: background.lightness.light,\n    });\n\n    const darkTokens = generateThemeTokens({\n        colors,\n        contrastRatios,\n        backgroundColor: background.color,\n        backgroundName: background.name,\n        lightness: background.lightness.dark,\n    });\n\n    const lightContainer: ColorPaletteResult['light'] = {\n        tokens: lightTokens,\n        metadata: {\n            type: 'primitive',\n            theme: 'light',\n        },\n    };\n\n    const darkContainer: ColorPaletteResult['dark'] = {\n        tokens: darkTokens,\n        metadata: {\n            type: 'primitive',\n            theme: 'dark',\n        },\n    };\n\n    const baseTokens = createBaseColorTokens(formatOklchForWeb);\n\n    // Create base token container\n    const baseContainer = {\n        tokens: Object.entries(baseTokens).reduce(\n            (acc, [, token]) => {\n                acc[token.name!] = token;\n                return acc;\n            },\n            {} as Record<string, ColorToken>,\n        ),\n        metadata: {\n            type: 'primitive' as const,\n            theme: 'base' as const,\n        },\n    };\n\n    return {\n        base: baseContainer,\n        light: lightContainer,\n        dark: darkContainer,\n    };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { generateSystemColorPalette };\n","import type { ColorToken } from '../types';\n\nconst BASE_COLORS = {\n    white: {\n        name: 'color-white',\n        hex: '#FFFFFF',\n        oklch: 'oklch(1 0 0)',\n        codeSyntax: 'vapor-color-white',\n    },\n    black: {\n        name: 'color-black',\n        hex: '#000000',\n        oklch: 'oklch(0 0 0)',\n        codeSyntax: 'vapor-color-black',\n    },\n} as const satisfies Record<'white' | 'black', ColorToken>;\n\nconst DEFAULT_PRIMITIVE_COLORS = {\n    red: '#F5535E',\n    pink: '#F26394',\n    grape: '#CC5DE8',\n    violet: '#8662F3',\n    blue: '#448EFE',\n    cyan: '#1EBAD2',\n    green: '#04A37E',\n    lime: '#8FD327',\n    yellow: '#FFC107',\n    orange: '#ED670C',\n} as const;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { BASE_COLORS, DEFAULT_PRIMITIVE_COLORS };\n","const DEFAULT_MAIN_BACKGROUND_LIGHTNESS = {\n    light: 100,\n    dark: 14,\n} as const;\n\nconst DEFAULT_CONTRAST_RATIOS = {\n    '050': 1.07,\n    '100': 1.3,\n    '200': 1.7,\n    '300': 2.5,\n    '400': 3.0,\n    '500': 4.5,\n    '600': 6.5,\n    '700': 8.5,\n    '800': 11.5,\n    '900': 15.0,\n} as const;\n\nconst ADAPTIVE_COLOR_GENERATION = {\n    LIGHTNESS_THRESHOLD: 0.5,\n    DARK_LIGHTNESS_FACTOR: 0.55,\n    LIGHT_LIGHTNESS_FACTOR: 0.85,\n    CHROMA_REDUCTION_FACTOR: 0.85,\n} as const;\n\nconst BUTTON_FOREGROUND_LIGHTNESS_THRESHOLD = 0.65;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport {\n    DEFAULT_MAIN_BACKGROUND_LIGHTNESS,\n    DEFAULT_CONTRAST_RATIOS,\n    ADAPTIVE_COLOR_GENERATION,\n    BUTTON_FOREGROUND_LIGHTNESS_THRESHOLD,\n};\n","import type { CssColor } from '@adobe/leonardo-contrast-colors';\nimport { BackgroundColor, Color, Theme } from '@adobe/leonardo-contrast-colors';\nimport { differenceCiede2000, formatCss, formatHex, oklch } from 'culori';\n\nimport { ADAPTIVE_COLOR_GENERATION } from '../constants';\nimport type { Background, ColorToken, Colors, ContrastRatios, OklchColor, Tokens } from '../types';\nimport { formatOklchForWeb, generateCodeSyntax, generateTokenName } from '../utils';\n\n/**\n * 입력 색상의 명도를 분석하여 최적의 Light/Dark Key 쌍을 생성합니다.\n * 밝은 색상은 어두운 Key를, 어두운 색상은 밝은 Key를 생성하여 duoKey를 구성합니다.\n *\n * @param brandColorOklch - 브랜드 색상의 OKLCH 객체\n * @param originalHex - 원본 HEX 색상 문자열\n * @returns Light/Dark 테마용 색상 키 쌍\n *\n * @example\n * createAdaptiveColorKeys({ mode: 'oklch', l: 0.8, c: 0.15, h: 180 }, '#87CEEB')\n * // returns: {\n * //   lightKey: '#87CEEB',\n * //   darkKey: '#4A90A4'\n * // }\n */\nconst createAdaptiveColorKeys = (\n    brandColorOklch: OklchColor,\n    originalHex: string,\n): { lightKey: CssColor; darkKey: CssColor } => {\n    const isLightColor = brandColorOklch.l > ADAPTIVE_COLOR_GENERATION.LIGHTNESS_THRESHOLD;\n\n    if (isLightColor) {\n        const darkerKeyOklch: OklchColor = {\n            ...brandColorOklch,\n            mode: 'oklch',\n            l: brandColorOklch.l * ADAPTIVE_COLOR_GENERATION.DARK_LIGHTNESS_FACTOR,\n            c: brandColorOklch.c * ADAPTIVE_COLOR_GENERATION.CHROMA_REDUCTION_FACTOR,\n        };\n\n        const darkKeyHex = formatHex(darkerKeyOklch);\n        return {\n            lightKey: originalHex as CssColor,\n            darkKey: (darkKeyHex ?? originalHex) as CssColor,\n        };\n    } else {\n        const lighterKeyOklch: OklchColor = {\n            ...brandColorOklch,\n            mode: 'oklch',\n            l: Math.min(\n                brandColorOklch.l / ADAPTIVE_COLOR_GENERATION.DARK_LIGHTNESS_FACTOR,\n                ADAPTIVE_COLOR_GENERATION.LIGHT_LIGHTNESS_FACTOR,\n            ),\n            c: brandColorOklch.c * ADAPTIVE_COLOR_GENERATION.CHROMA_REDUCTION_FACTOR,\n        };\n\n        const lightKeyHex = formatHex(lighterKeyOklch);\n        return {\n            lightKey: (lightKeyHex ?? originalHex) as CssColor,\n            darkKey: originalHex as CssColor,\n        };\n    }\n};\n\n/**\n * Adobe Leonardo Color 정의 객체를 생성합니다.\n * 브랜드 컬러를 기반으로 adaptive light/dark key pair를 생성하여 Leonardo Color 객체를 만듭니다.\n *\n * @param config - 색상 정의 설정 객체\n * @param config.name - 색상 이름\n * @param config.colorHex - HEX 색상 값\n * @param config.contrastRatios - 대비 비율 설정\n * @returns Adobe Leonardo Color 객체 또는 null (유효하지 않은 색상인 경우)\n *\n * @example\n * createColorDefinition({\n *   name: 'blue',\n *   colorHex: '#448EFE',\n *   contrastRatios: { '050': 1.15, '100': 1.3, '200': 1.7 }\n * })\n * // returns: Color {\n * //   name: 'blue',\n * //   colorKeys: ['#448EFE', '#2563EB'],\n * //   colorspace: 'OKLCH',\n * //   ratios: { '050': 1.15, '100': 1.3, '200': 1.7 }\n * // }\n */\nconst createColorDefinition = ({\n    name,\n    colorHex,\n    contrastRatios,\n}: {\n    name: string;\n    colorHex: string;\n    contrastRatios: Record<string, number>;\n}): Color | null => {\n    const brandColorOklch = oklch(colorHex);\n    if (!brandColorOklch) {\n        console.warn(`Invalid brand color: ${name} - ${colorHex}. Skipping.`);\n        return null;\n    }\n\n    const { lightKey, darkKey } = createAdaptiveColorKeys(brandColorOklch, colorHex);\n\n    return new Color({\n        name,\n        colorKeys: [lightKey, darkKey],\n        colorspace: 'OKLCH',\n        ratios: contrastRatios,\n    });\n};\n\n/**\n * Adobe Leonardo Theme 객체를 생성합니다.\n *\n * @param colorDefinitions - Leonardo 색상 정의 배열\n * @param backgroundColor - 배경색\n * @param backgroundName - 배경색 이름\n * @param lightness - 테마의 명도 값\n * @param contrastRatios - 대비 비율\n * @returns Adobe Leonardo Theme 객체\n */\nconst createLeonardoTheme = ({\n    colorDefinitions,\n    backgroundColor,\n    backgroundName,\n    lightness,\n    contrastRatios,\n}: {\n    colorDefinitions: Color[];\n    backgroundColor: Background['color'];\n    backgroundName: Background['name'];\n    lightness: number;\n    contrastRatios: ContrastRatios;\n}): Theme => {\n    const backgroundColorObj = new BackgroundColor({\n        name: backgroundName,\n        colorKeys: [backgroundColor as CssColor],\n        ratios: contrastRatios,\n    });\n\n    return new Theme({\n        colors: [...colorDefinitions, backgroundColorObj],\n        backgroundColor: backgroundColorObj,\n        lightness,\n        output: 'HEX',\n    });\n};\n\n/**\n * Adobe Leonardo를 사용하여 테마별 컬러 토큰을 생성합니다.\n * 직접 TokenContainer 형태로 반환하여 변환 과정 없이 일관된 구조를 제공합니다.\n *\n * @param colors - 색상 이름과 HEX 값의 매핑\n * @param contrast - 대비 비율 설정\n * @param themeType - 테마 타입 ('light' | 'dark')\n * @returns 생성된 토큰들이 포함된 TokenContainer\n *\n * @example\n * generateThemeTokens({ blue: '#448EFE' }, { '050': 1.15, '100': 1.3 }, 'light')\n * // returns: {\n * //   tokens: { \"vapor-color-blue-050\": {...}, \"vapor-color-background-canvas\": {...} },\n * //   metadata: { type: 'primitive', theme: 'light', generated: '...' }\n * // }\n */\nexport const generateThemeTokens = ({\n    colors,\n    contrastRatios,\n    backgroundColor,\n    backgroundName,\n    lightness,\n}: {\n    colors: Colors;\n    contrastRatios: ContrastRatios;\n    backgroundColor: Background['color'];\n    backgroundName: Background['name'];\n    lightness: number;\n}): Tokens => {\n    const colorDefinitions = Object.entries(colors)\n        .map(([name, hex]) => createColorDefinition({ name, colorHex: hex, contrastRatios }))\n        .filter((def): def is Color => def !== null);\n\n    const theme = createLeonardoTheme({\n        colorDefinitions,\n        backgroundColor,\n        backgroundName,\n        lightness,\n        contrastRatios,\n    });\n    const [backgroundObj, ...themeColors] = theme.contrastColors;\n\n    const calculateDeltaE = differenceCiede2000();\n    const tokens: Record<string, ColorToken> = {};\n\n    // Background canvas token 처리\n    if ('background' in backgroundObj) {\n        const oklchColor = oklch(backgroundObj.background);\n        const oklchValue = formatCss(oklchColor);\n\n        if (oklchValue) {\n            const canvasToken: ColorToken = {\n                name: generateTokenName(['background', 'canvas']),\n                hex: backgroundObj.background,\n                oklch: formatOklchForWeb(oklchValue),\n                codeSyntax: generateCodeSyntax(['background', 'canvas']),\n            };\n            tokens[canvasToken.name!] = canvasToken;\n        }\n    }\n\n    // 색상 팔레트 토큰들 처리\n    themeColors.forEach((color) => {\n        if ('name' in color && 'values' in color && color.values.length > 0) {\n            const colorName = color.name;\n            const originalColorHex = colors[colorName];\n\n            const shadeData: Array<{\n                name: string;\n                hex: string;\n                oklch: string;\n                deltaE: number;\n                tokenName: string;\n                codeSyntax: string;\n            }> = [];\n\n            color.values.forEach((instance) => {\n                const oklchColor = oklch(instance.value);\n                const oklchValue = formatCss(oklchColor);\n\n                if (oklchValue) {\n                    let deltaE: number | undefined = undefined;\n                    if (originalColorHex) {\n                        deltaE =\n                            Math.round(calculateDeltaE(originalColorHex, instance.value) * 100) /\n                            100;\n                    }\n\n                    shadeData.push({\n                        name: instance.name,\n                        hex: instance.value,\n                        oklch: formatOklchForWeb(oklchValue),\n                        deltaE: deltaE || 0,\n                        tokenName: generateTokenName([colorName, instance.name]),\n                        codeSyntax: generateCodeSyntax([colorName, instance.name]),\n                    });\n                }\n            });\n\n            // 숫자 순으로 정렬\n            shadeData.sort((a, b) => {\n                const numA = parseInt(a.name, 10);\n                const numB = parseInt(b.name, 10);\n                return numA - numB;\n            });\n\n            // 토큰 객체에 추가\n            shadeData.forEach((shade) => {\n                const token: ColorToken = {\n                    name: shade.tokenName,\n                    hex: shade.hex,\n                    oklch: shade.oklch,\n                    deltaE: shade.deltaE,\n                    codeSyntax: shade.codeSyntax,\n                };\n                tokens[shade.tokenName] = token;\n            });\n        }\n    });\n\n    return tokens;\n};\n","import { lch, oklch } from 'culori';\n\nimport { BASE_COLORS, BUTTON_FOREGROUND_LIGHTNESS_THRESHOLD } from '../constants';\n\n/* -------------------------------------------------------------------------------------------------\n * Color Formatting Utilities\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * OKLCH 색상 값을 웹 호환성을 위해 포맷팅합니다.\n * - Lightness, Chroma를 3자리 소수점으로 반올림\n * - Hue를 1자리 소수점으로 반올림\n * - 'none' 값을 '0.0'으로 변환\n *\n * @param oklchString - 원본 OKLCH 문자열\n * @returns 포맷팅된 OKLCH 문자열\n *\n * @example\n * formatOklchForWeb('oklch(0.7121111 0.15199999 180)')\n * // returns: 'oklch(0.712 0.152 180.0)'\n */\nconst formatOklchForWeb = (oklchString: string): string => {\n    const match = oklchString.match(/oklch\\(([^\\s]+)\\s+([^\\s]+)\\s+([^)]+)\\)/);\n    if (match) {\n        const [, l, c, h] = match;\n        const roundedL = parseFloat(l).toFixed(3);\n        const roundedC = parseFloat(c).toFixed(3);\n\n        let roundedH: string;\n        if (h === 'none' || isNaN(parseFloat(h))) {\n            roundedH = '0.0';\n        } else {\n            roundedH = parseFloat(h).toFixed(1);\n        }\n\n        return `oklch(${roundedL} ${roundedC} ${roundedH})`;\n    }\n    return oklchString;\n};\n\n/**\n * 상위 계층 key값 조합으로 CSS 변수 이름을 생성합니다.\n * 최상위 계층(base, light, dark)는 제외하고 생성합니다.\n *\n * @param keyPath - 계층 구조의 key 경로들\n * @returns `vapor-color-` prefix를 포함한 CSS 변수명\n *\n * @example\n * generateCodeSyntax(['light', 'blue', '050'])\n * // returns: 'vapor-color-blue-050'\n *\n * generateCodeSyntax(['background', 'canvas'])\n * // returns: 'vapor-color-background-canvas'\n */\nconst generateCodeSyntax = (keyPath: string[]): string => {\n    const topLevelKeys = ['base', 'light', 'dark'];\n    const filteredPath = keyPath.filter((key) => !topLevelKeys.includes(key));\n    return `vapor-color-${filteredPath.join('-')}`;\n};\n\n/**\n * 상위 계층 key값 조합으로 토큰 name을 생성합니다.\n * `vapor-` prefix가 없는 name을 생성하여 tokens 객체의 key로 사용됩니다.\n *\n * @param keyPath - 계층 구조의 key 경로들\n * @returns `color-` prefix를 포함한 토큰 name\n *\n * @example\n * generateTokenName(['light', 'blue', '050'])\n * // returns: 'color-blue-050'\n *\n * generateTokenName(['background', 'canvas'])\n * // returns: 'color-background-canvas'\n */\nconst generateTokenName = (keyPath: string[]): string => {\n    const topLevelKeys = ['base', 'light', 'dark'];\n    const filteredPath = keyPath.filter((key) => !topLevelKeys.includes(key));\n    return `color-${filteredPath.join('-')}`;\n};\n\n/**\n * 배경 색상의 명도에 따라 적절한 전경 색상(흑/백)을 결정합니다.\n *\n * @param backgroundOklch - 배경 색상의 OKLCH 문자열\n * @param threshold - 명도 임계값 (기본값: 0.65)\n * @returns 검은색 또는 흰색 ColorToken 객체\n *\n * @example\n * getContrastingForegroundColor('oklch(0.8 0.1 180)')\n * // returns: { name: 'color-black', hex: '#000000', ... }\n *\n * getContrastingForegroundColor('oklch(0.3 0.1 180)')\n * // returns: { name: 'color-white', hex: '#FFFFFF', ... }\n */\nconst getContrastingForegroundColor = (\n    backgroundOklch: string,\n    threshold: number = BUTTON_FOREGROUND_LIGHTNESS_THRESHOLD,\n) => {\n    const colorObj = oklch(backgroundOklch);\n    const lightness = colorObj?.l ?? 0;\n\n    return lightness > threshold ? { ...BASE_COLORS.black } : { ...BASE_COLORS.white };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Palette Scale Utilities\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * 팔레트의 스케일 키를 숫자 순서로 정렬합니다.\n *\n * @param palette - 색상 팔레트 객체\n * @returns 정렬된 스케일 키 배열\n *\n * @example\n * getSortedScales({ '100': {...}, '050': {...}, '200': {...} })\n * // returns: ['050', '100', '200']\n */\nfunction getSortedScales(palette: Record<string, unknown>): string[] {\n    return Object.keys(palette).sort((a, b) => parseInt(a, 10) - parseInt(b, 10));\n}\n\n/**\n * deltaE 값이 가장 낮은(원본 색상과 가장 유사한) 스케일을 찾습니다.\n *\n * @param palette - deltaE 정보를 포함한 색상 팔레트\n * @returns 가장 가까운 스케일 키 또는 null\n *\n * @example\n * findClosestScale({ '100': { deltaE: 5.2 }, '200': { deltaE: 1.1 }, '300': { deltaE: 8.7 } })\n * // returns: '200'\n */\nfunction findClosestScale(palette: Record<string, { deltaE?: number }>): string | null {\n    const scaleKeys = Object.keys(palette);\n    if (scaleKeys.length === 0) return null;\n\n    return scaleKeys.reduce((closestKey, currentKey) => {\n        const closestDeltaE = palette[closestKey]?.deltaE ?? Infinity;\n        const currentDeltaE = palette[currentKey]?.deltaE ?? Infinity;\n        return currentDeltaE < closestDeltaE ? currentKey : closestKey;\n    });\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\n/**\n * 색상의 LCH Lightness 값을 반환합니다.\n *\n * @param colorHex - HEX 색상 값\n * @returns 0-100 범위의 정수 lightness 값 또는 null\n */\nconst getColorLightness = (colorHex: string): number | null => {\n    const lchColor = lch(colorHex);\n    if (lchColor && typeof lchColor.l === 'number') {\n        return Math.round(lchColor.l);\n    }\n    return null;\n};\n\nexport {\n    formatOklchForWeb,\n    generateCodeSyntax,\n    generateTokenName,\n    getContrastingForegroundColor,\n    getSortedScales,\n    findClosestScale,\n    getColorLightness,\n};\n","import { formatCss, oklch } from 'culori';\n\nimport { DEFAULT_CONTRAST_RATIOS, DEFAULT_MAIN_BACKGROUND_LIGHTNESS } from '../constants';\nimport { generateThemeTokens } from '../libs';\nimport type { BrandColorGeneratorConfig, ColorPaletteResult, ColorToken, Tokens } from '../types';\nimport {\n    findClosestScale,\n    formatOklchForWeb,\n    generateCodeSyntax,\n    generateTokenName,\n} from '../utils';\n\n/**\n * 사용자 지정 색상(customColors)을 기반으로 기존 토큰(tokens) 객체의 색상 값을 덮어씁니다.\n *\n * @param {Tokens} tokens - 덮어쓰기의 대상이 될 원본 토큰 객체.\n * @param {Record<string, string>} customColors - 적용할 색상. { '색상이름': '새로운 hex값' } 형태.\n * @returns {Tokens} 사용자 지정 색상이 적용된 새로운 토큰 객체.\n *\n * @example\n * const tokens = {\n * 'color-primary-500': { name: '...', hex: '#7878f8ff' },\n * 'color-primary-600': { name: '...', hex: '#0000DD' },\n * };\n *\n * const custom = { 'primary': '#0808dbff' };\n *\n * // 'primary'와 가장 가까운 'color-primary-500'의 hex값이 '#0808dbff'으로 변경됨\n * const newTokens = overrideCustomColors(tokens, custom);\n */\nfunction overrideCustomColors(tokens: Tokens, customColors: Record<string, string>): Tokens {\n    const newTokens = { ...tokens };\n\n    for (const [colorName, hexValue] of Object.entries(customColors)) {\n        if (colorName === 'background') continue;\n\n        // 토큰 구조 재구성\n        const colorTokens: Record<string, ColorToken> = {};\n        Object.entries(newTokens).forEach(([tokenName, token]) => {\n            const isRelatedColorToken =\n                token && typeof token === 'object' && tokenName.includes(`-${colorName}-`);\n\n            if (isRelatedColorToken) {\n                const scaleMatch = tokenName.match(/-(\\d{3})$/);\n                if (scaleMatch) {\n                    const scale = scaleMatch[1];\n                    colorTokens[scale] = token;\n                }\n            }\n        });\n\n        if (Object.keys(colorTokens).length === 0) {\n            console.warn(`Palette for \"${colorName}\" not found in tokens.`);\n            continue;\n        }\n\n        // deltaE 기준으로 가장 가까운 스케일 찾기\n        const closestScaleKey = findClosestScale(colorTokens);\n        if (!closestScaleKey) continue;\n\n        const oklchColor = oklch(hexValue);\n        const oklchValue = formatCss(oklchColor) ?? '';\n        const oklchString = formatOklchForWeb(oklchValue);\n\n        const tokenIdentifier = [colorName, closestScaleKey];\n        const updatedTokenName = generateTokenName(tokenIdentifier);\n\n        const updatedToken: ColorToken = {\n            name: updatedTokenName,\n            deltaE: 0,\n            hex: hexValue,\n            oklch: oklchString,\n            codeSyntax: generateCodeSyntax(tokenIdentifier),\n        };\n\n        newTokens[updatedTokenName] = updatedToken;\n    }\n\n    return newTokens;\n}\n\n/**\n * 브랜드 컬러 팔레트를 생성합니다.\n * 사용자 정의 브랜드 컬러를 기반으로 Primitive 토큰들을 생성합니다.\n *\n * @param config - 브랜드 컬러 설정\n * @returns 라이트, 다크 테마의 토큰 컨테이너 (base 제외)\n *\n * @example\n * generateBrandColorPalette({ colors: { myBlue: '#448EFE' } })\n * // returns: {\n * //   light: { tokens: { \"color-myBlue-050\": {...}, \"color-myBlue-100\": {...} }, metadata: {...} },\n * //   dark: { tokens: { ... }, metadata: {...} }\n * // }\n */\ntype BrandColorPalette = Omit<ColorPaletteResult, 'base'>;\n\nfunction generateBrandColorPalette(config: BrandColorGeneratorConfig): BrandColorPalette {\n    const contrastRatios = config.contrastRatios || DEFAULT_CONTRAST_RATIOS;\n    const background = config.background || {\n        color: '#FFFFFF',\n        name: 'gray',\n        lightness: DEFAULT_MAIN_BACKGROUND_LIGHTNESS,\n    };\n\n    const lightTokens = generateThemeTokens({\n        colors: config.colors,\n        contrastRatios,\n        backgroundColor: background.color,\n        backgroundName: background.name,\n        lightness: background.lightness.light,\n    });\n\n    const darkTokens = generateThemeTokens({\n        colors: config.colors,\n        contrastRatios,\n        backgroundColor: background.color,\n        backgroundName: background.name,\n        lightness: background.lightness.dark,\n    });\n\n    // Apply custom color overrides\n    const adjustedLightTokens = overrideCustomColors(lightTokens, config.colors);\n\n    return {\n        light: {\n            tokens: adjustedLightTokens,\n            metadata: {\n                type: 'primitive',\n                theme: 'light',\n            },\n        },\n        dark: {\n            tokens: darkTokens,\n            metadata: {\n                type: 'primitive',\n                theme: 'dark',\n            },\n        },\n    };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { generateBrandColorPalette };\n","import { BASE_COLORS } from '../constants';\nimport type { Background, ColorToken, ScaleInfo, SemanticTokensResult, ThemeType } from '../types';\nimport { findClosestScale, getContrastingForegroundColor, getSortedScales } from '../utils';\nimport { generateBrandColorPalette } from './brand-color-palette';\n\n/* -------------------------------------------------------------------------------------------------\n * Interfaces\n * -----------------------------------------------------------------------------------------------*/\ninterface SemanticMappingConfig {\n    primary: { name: string; color: string };\n    secondary?: { name: string; color: string };\n    success?: { name: string; color: string };\n    warning?: { name: string; color: string };\n    error?: { name: string; color: string };\n    background: Background;\n}\n\ninterface SemanticTokenMapping {\n    themeName: ThemeType;\n    semanticRole: string;\n    brandColorName: string;\n    scaleInfo: ScaleInfo;\n    buttonForegroundColor: ColorToken;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Helper Functions\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * 전체 토큰 맵에서 특정 색상에 해당하는 팔레트만 추출하여 재구성합니다.\n */\nfunction reconstructPalette(\n    sourceTokens: Record<string, ColorToken | string>,\n    colorName: string,\n): Record<string, ColorToken> {\n    const palette: Record<string, ColorToken> = {};\n    Object.entries(sourceTokens).forEach(([tokenName, token]) => {\n        const isRelatedToken = typeof token === 'object' && tokenName.includes(`-${colorName}-`);\n        if (isRelatedToken) {\n            const scaleMatch = tokenName.match(/-(\\d{3})$/);\n            if (scaleMatch) {\n                const scale = scaleMatch[1];\n                palette[scale] = token;\n            }\n        }\n    });\n    return palette;\n}\n\n/**\n * 배경 토큰의 oklch 값을 기반으로 대비가 높은 버튼 전경색을 결정합니다.\n */\nfunction determineButtonForegroundColor(backgroundToken: ColorToken | undefined): ColorToken {\n    if (backgroundToken?.oklch) {\n        return getContrastingForegroundColor(backgroundToken.oklch);\n    }\n    return { ...BASE_COLORS.white };\n}\n\nfunction createSemanticTokenMapping({\n    themeName,\n    semanticRole,\n    brandColorName,\n    scaleInfo,\n    buttonForegroundColor,\n}: SemanticTokenMapping): {\n    semantic: Record<string, string>;\n    componentSpecific: Record<string, string>;\n} {\n    const background100Scale = themeName === 'dark' ? 800 : 100;\n\n    return {\n        semantic: {\n            [`color-background-${semanticRole}-100`]: `color-${brandColorName}-${background100Scale}`,\n            [`color-background-${semanticRole}-200`]: `color-${brandColorName}-${scaleInfo.backgroundScale}`,\n            [`color-foreground-${semanticRole}-100`]: `color-${brandColorName}-${scaleInfo.foregroundScale}`,\n            [`color-foreground-${semanticRole}-200`]: `color-${brandColorName}-${scaleInfo.alternativeScale}`,\n            [`color-border-${semanticRole}`]: `color-${brandColorName}-${scaleInfo.backgroundScale}`,\n        },\n        componentSpecific: {\n            [`color-button-foreground-${semanticRole}`]: buttonForegroundColor.name!,\n        },\n    };\n}\n\n/**\n * 라이트 테마용 스케일 정보를 찾습니다.\n * deltaE가 0인 스케일을 배경으로, 그 다음 스케일들을 전경으로 사용합니다.\n *\n * @param palette - 색상 팔레트\n * @param scales - 명도순으로 정렬된 스케일 배열\n * @returns 배경, 전경, 대체 스케일 정보\n *\n * @example\n * // palette에서 '400' 스케일의 deltaE가 0이라고 가정\n * const palette = {\n * '300': { deltaE: 15 },\n * '400': { deltaE: 0 },   // 이 스케일이 background\n * '500': { deltaE: 12 },  // 그 다음 스케일이 foreground\n * '600': { deltaE: 25 },  // 다다음 스케일이 alternative\n * };\n * const scales = ['300', '400', '500', '600'];\n *\n * findLightThemeScales(palette, scales)\n * // returns: { backgroundScale: '400', foregroundScale: '500', alternativeScale: '600' }\n */\nfunction findLightThemeScales(\n    palette: Record<string, { deltaE?: number }>,\n    scales: string[],\n): ScaleInfo {\n    const deltaEZeroScale = scales.find((scale) => palette[scale]?.deltaE === 0);\n    if (!deltaEZeroScale) {\n        throw new Error('No scale with deltaE 0 found for light theme');\n    }\n\n    const backgroundScale = deltaEZeroScale;\n    const backgroundIndex = scales.indexOf(backgroundScale);\n    const foregroundScale = scales[backgroundIndex + 1] ?? backgroundScale;\n    const alternativeScale = scales[backgroundIndex + 2] ?? foregroundScale;\n\n    return { backgroundScale, foregroundScale, alternativeScale };\n}\n\n/**\n * 다크 테마용 스케일 정보를 찾습니다.\n * deltaE가 가장 낮은 스케일을 배경으로, 그 다음 스케일들을 전경으로 사용합니다.\n *\n * @param palette - 색상 팔레트\n * @param scales - 명도순으로 정렬된 스케일 배열\n * @returns 배경, 전경, 대체 스케일 정보\n *\n * @example\n * // palette에서 '800' 스케일의 deltaE가 가장 낮다고 가정\n * const palette = {\n * '600': { deltaE: 14.44 },\n * '700': { deltaE: 7.53 },\n * '800': { deltaE: 0.35 },  // deltaE가 가장 낮으므로 이 스케일이 background\n * '900': { deltaE: 13.97 }, // 그 다음 스케일이 foreground\n * };\n * const scales = ['600', '700', '800', '900'];\n *\n * findDarkThemeScales(palette, scales)\n * // returns: { backgroundScale: '800', foregroundScale: '900', alternativeScale: '900' } // '900'이 마지막 스케일이므로 foreground와 alternative가 동일\n */\nfunction findDarkThemeScales(\n    palette: Record<string, { deltaE?: number }>,\n    scales: string[],\n): ScaleInfo {\n    const backgroundScale = findClosestScale(palette);\n\n    if (!backgroundScale) {\n        throw new Error('Could not find a valid background scale in the palette for dark theme.');\n    }\n\n    const backgroundIndex = scales.indexOf(backgroundScale);\n    const foregroundScale = scales[backgroundIndex + 1] ?? backgroundScale;\n    const alternativeScale = scales[backgroundIndex + 2] ?? foregroundScale;\n\n    return {\n        backgroundScale,\n        foregroundScale,\n        alternativeScale,\n    };\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Main Function\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * 시맨틱 토큰을 생성합니다.\n * 브랜드 컬러를 기반으로 semantic과 component-specific 토큰을 분리하여 생성합니다.\n *\n * @param mappingConfig - 시맨틱 역할과 브랜드 컬러 매핑 설정\n * @returns semantic과 componentSpecific으로 분리된 토큰 컨테이너\n */\nfunction getSemanticDependentTokens(mappingConfig: SemanticMappingConfig): SemanticTokensResult {\n    const lightSemanticMapping: Record<string, string> = {};\n    const lightComponentMapping: Record<string, string> = {};\n    const darkSemanticMapping: Record<string, string> = {};\n    const darkComponentMapping: Record<string, string> = {};\n\n    const brandColors: Record<string, string> = {};\n    Object.entries(mappingConfig).forEach(([semanticRole, config]) => {\n        if (semanticRole !== 'background') {\n            brandColors[config.name] = config.color;\n        }\n    });\n\n    const brandPalette = generateBrandColorPalette({\n        colors: brandColors,\n        background: mappingConfig.background,\n    });\n\n    Object.entries(mappingConfig).forEach(([semanticRole, config]) => {\n        if (semanticRole === 'background') return;\n\n        const themes = [\n            {\n                name: 'light' as ThemeType,\n                tokens: brandPalette.light.tokens,\n                findScales: findLightThemeScales,\n                semanticMappingTarget: lightSemanticMapping,\n                componentMappingTarget: lightComponentMapping,\n            },\n            {\n                name: 'dark' as ThemeType,\n                tokens: brandPalette.dark.tokens,\n                findScales: findDarkThemeScales,\n                semanticMappingTarget: darkSemanticMapping,\n                componentMappingTarget: darkComponentMapping,\n            },\n        ];\n\n        for (const theme of themes) {\n            const palette = reconstructPalette(theme.tokens, config.name);\n            const scales = getSortedScales(palette);\n            const scaleInfo = theme.findScales(palette, scales);\n            const backgroundToken = palette[scaleInfo.backgroundScale];\n            const buttonForegroundColor = determineButtonForegroundColor(backgroundToken);\n\n            const tokenMappings = createSemanticTokenMapping({\n                themeName: theme.name,\n                semanticRole,\n                brandColorName: config.name,\n                scaleInfo,\n                buttonForegroundColor,\n            });\n\n            Object.assign(theme.semanticMappingTarget, tokenMappings.semantic);\n            Object.assign(theme.componentMappingTarget, tokenMappings.componentSpecific);\n        }\n    });\n\n    return {\n        semantic: {\n            light: {\n                tokens: lightSemanticMapping,\n                metadata: {\n                    type: 'semantic',\n                    theme: 'light',\n                },\n            },\n            dark: {\n                tokens: darkSemanticMapping,\n                metadata: {\n                    type: 'semantic',\n                    theme: 'dark',\n                },\n            },\n        },\n        componentSpecific: {\n            light: {\n                tokens: lightComponentMapping,\n                metadata: {\n                    type: 'component-specific',\n                    theme: 'light',\n                },\n            },\n            dark: {\n                tokens: darkComponentMapping,\n                metadata: {\n                    type: 'component-specific',\n                    theme: 'dark',\n                },\n            },\n        },\n    };\n}\n\nexport type { SemanticMappingConfig };\nexport { getSemanticDependentTokens };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,iBAAiC;;;ACEjC,IAAM,cAAc;AAAA,EAChB,OAAO;AAAA,IACH,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,IACP,YAAY;AAAA,EAChB;AAAA,EACA,OAAO;AAAA,IACH,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,IACP,YAAY;AAAA,EAChB;AACJ;AAEA,IAAM,2BAA2B;AAAA,EAC7B,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AACZ;;;AC5BA,IAAM,oCAAoC;AAAA,EACtC,OAAO;AAAA,EACP,MAAM;AACV;AAEA,IAAM,0BAA0B;AAAA,EAC5B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,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