@m3ui-vue/m3ui-vue 0.8.2 → 0.8.3
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.
- package/README.md +34 -2
- package/dist/{MMenuItem-BAWmUTT3.js → MMenuItem-DiilFeDO.js} +6 -3
- package/dist/{MMenuItem-BAWmUTT3.js.map → MMenuItem-DiilFeDO.js.map} +1 -1
- package/dist/chart.js +22 -9
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/code-editor.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7 -4
- package/dist/m3ui.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/styles/theme.css +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/MChart.vue +12 -8
- package/src/components/MCircleProgressBar.vue +1 -1
- package/src/components/MCodeEditor.vue +3 -1
- package/src/components/MContextMenu.vue +9 -2
- package/src/components/MMarkdown.vue +1 -1
- package/src/components/MMenu.vue +8 -2
- package/src/styles/theme.css +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MMenuItem-BAWmUTT3.js","names":["$slots","$slots"],"sources":["../src/components/MSpinner.vue","../src/components/MSpinner.vue","../src/composables/useFieldBg.ts","../src/composables/useDebounce.ts","../src/components/MIconButton.vue","../src/components/MIconButton.vue","../src/components/MButton.vue","../src/components/MButton.vue","../src/components/MDialog.vue","../src/components/MDialog.vue","../src/components/MMenuDivider.vue","../src/components/MMenuDivider.vue","../src/components/MTextField.vue","../src/components/MTextField.vue","../src/components/MMenu.vue","../src/components/MMenu.vue","../src/components/MMenuItem.vue","../src/components/MMenuItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useLocale } from '../composables/useLocale';\n\nconst props = withDefaults(\n defineProps<{\n size?: number;\n wavy?: boolean;\n label?: string;\n }>(),\n { size: 20, wavy: false },\n);\n\nconst locale = useLocale();\n\nconst STROKE = 3;\nconst BUMPS = 9;\n\n// amp fraction of r = 0.25 → max radius = r * 1.25\n// Constrain so that max_r + STROKE/2 ≤ size/2 - 1 (1px margin from edge)\nconst r = computed(() => (props.size / 2 - 1 - STROKE / 2) / 1.25);\nconst cx = computed(() => props.size / 2);\n\n// Build the full bumpy-circle path and its total length.\nconst wavyData = computed(() => {\n const CX = cx.value;\n const R = r.value;\n const amp = R * 0.08;\n const segs = BUMPS * 24; // smooth curve\n\n const pts: string[] = [];\n let len = 0;\n let px = 0,\n py = 0;\n\n for (let i = 0; i <= segs; i++) {\n const theta = (2 * Math.PI * i) / segs - Math.PI / 2;\n const rr = R + amp * Math.sin(BUMPS * theta);\n const x = CX + rr * Math.cos(theta);\n const y = CX + rr * Math.sin(theta);\n if (i > 0) len += Math.sqrt((x - px) ** 2 + (y - py) ** 2);\n pts.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(2)},${y.toFixed(2)}`);\n px = x;\n py = y;\n }\n\n // Visible arc ~58% of the circumference, gap fills the rest.\n const visible = len * 0.58;\n const gap = len - visible;\n const dash = `${visible.toFixed(1)} ${gap.toFixed(1)}`;\n\n // The wave \"travels\" by shifting dashoffset over exactly one full length,\n // so the crests slide around the path independently of the rotation.\n return { path: pts.join(\"\") + \"Z\", dash, len: len.toFixed(1) };\n});\n</script>\n\n<template>\n <span\n class=\"inline-flex shrink-0 items-center justify-center\"\n :style=\"{ width: `${size}px`, height: `${size}px` }\"\n role=\"status\"\n :aria-label=\"label ?? locale.loading\"\n >\n <!-- Standard circular spinner -->\n <span\n v-if=\"!wavy\"\n class=\"block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n\n <!-- Wavy spinner (M3 Expressive): the whole shape rotates AND the wave\n travels along the stroke via dashoffset, giving the snake-like flow. -->\n <svg\n v-else\n :width=\"size\"\n :height=\"size\"\n :viewBox=\"`0 0 ${size} ${size}`\"\n fill=\"none\"\n class=\"animate-[m3-wavy-spin_2.8s_linear_infinite]\"\n :style=\"`transform-origin: ${cx}px ${cx}px`\"\n >\n <path\n :d=\"wavyData.path\"\n stroke=\"currentColor\"\n :stroke-width=\"STROKE\"\n stroke-linecap=\"round\"\n :stroke-dasharray=\"wavyData.dash\"\n class=\"animate-[m3-wavy-travel_2s_linear_infinite]\"\n :style=\"{ '--m3-wave-len': wavyData.len }\"\n />\n </svg>\n </span>\n</template>\n\n<style>\n/* The SVG element rotates the whole bumpy circle. */\n@keyframes m3-wavy-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* The stroke's dashoffset slides by one full path length, so the crests\n appear to crawl along the circle — the \"snake\" motion of M3 Expressive.\n Negative direction makes the wave travel forward relative to the spin. */\n@keyframes m3-wavy-travel {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: calc(var(--m3-wave-len) * -1px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animate-\\[m3-wavy-spin_2\\.8s_linear_infinite\\] {\n animation: m3-wavy-spin 2.8s linear infinite;\n }\n .animate-\\[m3-wavy-travel_2s_linear_infinite\\] {\n animation: none !important;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useLocale } from '../composables/useLocale';\n\nconst props = withDefaults(\n defineProps<{\n size?: number;\n wavy?: boolean;\n label?: string;\n }>(),\n { size: 20, wavy: false },\n);\n\nconst locale = useLocale();\n\nconst STROKE = 3;\nconst BUMPS = 9;\n\n// amp fraction of r = 0.25 → max radius = r * 1.25\n// Constrain so that max_r + STROKE/2 ≤ size/2 - 1 (1px margin from edge)\nconst r = computed(() => (props.size / 2 - 1 - STROKE / 2) / 1.25);\nconst cx = computed(() => props.size / 2);\n\n// Build the full bumpy-circle path and its total length.\nconst wavyData = computed(() => {\n const CX = cx.value;\n const R = r.value;\n const amp = R * 0.08;\n const segs = BUMPS * 24; // smooth curve\n\n const pts: string[] = [];\n let len = 0;\n let px = 0,\n py = 0;\n\n for (let i = 0; i <= segs; i++) {\n const theta = (2 * Math.PI * i) / segs - Math.PI / 2;\n const rr = R + amp * Math.sin(BUMPS * theta);\n const x = CX + rr * Math.cos(theta);\n const y = CX + rr * Math.sin(theta);\n if (i > 0) len += Math.sqrt((x - px) ** 2 + (y - py) ** 2);\n pts.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(2)},${y.toFixed(2)}`);\n px = x;\n py = y;\n }\n\n // Visible arc ~58% of the circumference, gap fills the rest.\n const visible = len * 0.58;\n const gap = len - visible;\n const dash = `${visible.toFixed(1)} ${gap.toFixed(1)}`;\n\n // The wave \"travels\" by shifting dashoffset over exactly one full length,\n // so the crests slide around the path independently of the rotation.\n return { path: pts.join(\"\") + \"Z\", dash, len: len.toFixed(1) };\n});\n</script>\n\n<template>\n <span\n class=\"inline-flex shrink-0 items-center justify-center\"\n :style=\"{ width: `${size}px`, height: `${size}px` }\"\n role=\"status\"\n :aria-label=\"label ?? locale.loading\"\n >\n <!-- Standard circular spinner -->\n <span\n v-if=\"!wavy\"\n class=\"block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n\n <!-- Wavy spinner (M3 Expressive): the whole shape rotates AND the wave\n travels along the stroke via dashoffset, giving the snake-like flow. -->\n <svg\n v-else\n :width=\"size\"\n :height=\"size\"\n :viewBox=\"`0 0 ${size} ${size}`\"\n fill=\"none\"\n class=\"animate-[m3-wavy-spin_2.8s_linear_infinite]\"\n :style=\"`transform-origin: ${cx}px ${cx}px`\"\n >\n <path\n :d=\"wavyData.path\"\n stroke=\"currentColor\"\n :stroke-width=\"STROKE\"\n stroke-linecap=\"round\"\n :stroke-dasharray=\"wavyData.dash\"\n class=\"animate-[m3-wavy-travel_2s_linear_infinite]\"\n :style=\"{ '--m3-wave-len': wavyData.len }\"\n />\n </svg>\n </span>\n</template>\n\n<style>\n/* The SVG element rotates the whole bumpy circle. */\n@keyframes m3-wavy-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* The stroke's dashoffset slides by one full path length, so the crests\n appear to crawl along the circle — the \"snake\" motion of M3 Expressive.\n Negative direction makes the wave travel forward relative to the spin. */\n@keyframes m3-wavy-travel {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: calc(var(--m3-wave-len) * -1px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animate-\\[m3-wavy-spin_2\\.8s_linear_infinite\\] {\n animation: m3-wavy-spin 2.8s linear infinite;\n }\n .animate-\\[m3-wavy-travel_2s_linear_infinite\\] {\n animation: none !important;\n }\n}\n</style>\n","import { ref, computed, onMounted, onBeforeUnmount, type Ref } from 'vue'\n\nconst M3_BG_CLASSES = [\n 'bg-surface-container-highest',\n 'bg-surface-container-high',\n 'bg-surface-container-low',\n 'bg-surface-container-lowest',\n 'bg-surface-container',\n 'bg-surface-variant',\n 'bg-surface-bright',\n 'bg-surface-dim',\n 'bg-surface',\n 'bg-background',\n 'bg-inverse-surface',\n 'bg-primary-container',\n 'bg-secondary-container',\n 'bg-tertiary-container',\n 'bg-error-container',\n 'bg-primary',\n 'bg-secondary',\n 'bg-tertiary',\n 'bg-error',\n] as const\n\nfunction findM3BgVar(el: HTMLElement): string | null {\n for (const cls of M3_BG_CLASSES) {\n if (el.classList.contains(cls)) return `var(--color-${cls.slice(3)})`\n }\n return null\n}\n\nfunction isTransparent(color: string): boolean {\n if (!color || color === 'transparent') return true\n const m = color.match(/^rgba?\\(([^)]+)\\)$/)\n if (m) {\n const parts = m[1]!.split(',').map((s) => s.trim())\n if (parts.length === 4 && parseFloat(parts[3]!) === 0) return true\n }\n return false\n}\n\n/**\n * Auto-detects the background behind `containerEl` and exposes it as `--field-bg`.\n * Prefers a CSS variable reference (e.g. var(--color-surface-container-low)) over a\n * raw computed color so the outlined label cutout transitions in sync with the rest\n * of the theme switch instead of lagging behind.\n *\n * @param containerEl The element that receives `--field-bg` as an inline style.\n * @param fieldBgProp Getter for the explicit `fieldBg` prop (overrides auto-detect).\n */\nexport function useFieldBg(\n containerEl: Ref<HTMLElement | null>,\n fieldBgProp: () => string | undefined,\n) {\n const detectedBg = ref<string>('var(--color-surface)')\n\n function applyFieldBg(value: string) {\n detectedBg.value = value\n containerEl.value?.style.setProperty('--field-bg', fieldBgProp() ?? value)\n }\n\n function resolveBg() {\n let el: HTMLElement | null = containerEl.value?.parentElement ?? null\n while (el) {\n const cssVar = findM3BgVar(el)\n if (cssVar) { applyFieldBg(cssVar); return }\n if (el === document.body) { applyFieldBg('var(--color-surface)'); return }\n const bg = getComputedStyle(el).backgroundColor\n if (!isTransparent(bg)) { applyFieldBg(bg); return }\n el = el.parentElement\n }\n applyFieldBg('var(--color-surface)')\n }\n\n let observer: MutationObserver | null = null\n\n onMounted(() => {\n resolveBg()\n observer = new MutationObserver(() => resolveBg())\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class', 'style', 'data-theme'],\n })\n })\n\n onBeforeUnmount(() => observer?.disconnect())\n\n const resolvedFieldBg = computed(() => fieldBgProp() ?? detectedBg.value)\n\n return { resolvedFieldBg }\n}\n","import { onBeforeUnmount } from 'vue'\n\nexport function useDebounce(fn: (...args: any[]) => void, ms: number) {\n let timer: ReturnType<typeof setTimeout> | null = null\n\n function debounced(...args: any[]) {\n if (timer) clearTimeout(timer)\n timer = setTimeout(() => {\n timer = null\n fn(...args)\n }, ms)\n }\n\n function cancel() {\n if (timer) {\n clearTimeout(timer)\n timer = null\n }\n }\n\n onBeforeUnmount(cancel)\n\n return { debounced, cancel }\n}\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport MIcon from './MIcon.vue'\n\nconst props = withDefaults(\n defineProps<{\n icon: string\n label?: string\n variant?: 'standard' | 'filled' | 'tonal' | 'outlined'\n shape?: 'rounded' | 'squared'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n disabled?: boolean\n to?: string | Record<string, any>\n }>(),\n {\n variant: 'standard',\n shape: 'rounded',\n size: 'sm',\n disabled: false,\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\n// Container height/width (icon buttons are always square by default — real\n// `IconButtonDefaults.<tier>ContainerSize()` also has Narrow/Wide width options not\n// implemented here, matching the existing scope of MButton's size tiers) and icon size\n// per M3's 5-tier `{XSmall,Small,Medium,Large,XLarge}IconButtonTokens.kt`. `squareRadius`\n// matches each tier's own `ContainerShapeSquare` (12px xs/sm, 16px md, 28px lg/xl) — same\n// pattern as MButton's size tiers.\nconst sizeMap = {\n xs: { px: 32, icon: 20, squareRadius: 'rounded-md' },\n sm: { px: 40, icon: 24, squareRadius: 'rounded-md' },\n md: { px: 56, icon: 24, squareRadius: 'rounded-lg' },\n lg: { px: 96, icon: 32, squareRadius: 'rounded-xl' },\n xl: { px: 136, icon: 40, squareRadius: 'rounded-xl' },\n}\n\nconst resolved = computed(() => {\n if (typeof props.size === 'number') return { px: props.size, icon: Math.round(props.size * 0.55), squareRadius: 'rounded-md' }\n return sizeMap[props.size] ?? sizeMap.sm\n})\n\n/*\n * State layer via a `before:` overlay (same technique MButton uses) rather than a direct\n * `hover:bg-*`/`active:bg-*` utility: a solid `bg-primary`/`bg-secondary-container`\n * container can't also swap to a translucent hover background without just replacing the\n * color outright, so hover/press need a separate semi-transparent layer painted on top,\n * tinted with the button's own content color (`before:bg-current`) — matches real M3's\n * per-variant Hovered/PressedColor tokens, which are all just the content color at a fixed\n * opacity (8%/12%), the same universal state-layer pattern across every variant.\n */\nconst base =\n 'relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled container opacity is 10% on-surface (DisabledContainerOpacity, Filled/Tonal\n// only — Outlined has no container). Outlined's border needs no separate disabled class:\n// it's `border-current` (see `variantClasses`), so it dims automatically along with the\n// `disabled:text-on-surface/38` in `base` above, exactly like the real `outlinedIconButtonBorder`\n// (which literally reuses `LocalContentColor` at the same disabled opacity as the icon).\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n return 'disabled:bg-on-surface/10'\n default:\n return ''\n }\n})\n\nconst shapeClass = computed(() => props.shape === 'squared' ? resolved.value.squareRadius : 'rounded-full')\n\nfunction createRipple(event: PointerEvent) {\n if (props.disabled) return\n const button = event.currentTarget as HTMLElement\n const rect = button.getBoundingClientRect()\n const d = Math.max(rect.width, rect.height) * 2\n const el = document.createElement('span')\n el.className = 'm3-ripple'\n el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`\n button.appendChild(el)\n el.addEventListener('animationend', () => el.remove(), { once: true })\n}\n\nconst variantClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n // Real IconButton.kt has no elevation tokens at all for any variant — flat, unlike Button\n return 'bg-primary text-on-primary'\n case 'tonal':\n return 'bg-secondary-container text-on-secondary-container'\n case 'outlined':\n // OutlinedIconButtonTokens' default (non-\"vibrant\") border tracks LocalContentColor,\n // i.e. the same on-surface-variant used for the icon itself — not a fixed outline token\n return 'border border-current text-on-surface-variant'\n default:\n return 'text-on-surface-variant'\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n :aria-label=\"label || undefined\"\n :disabled=\"disabled\"\n :class=\"[base, shapeClass, variantClasses, disabledContainerClasses]\"\n :style=\"{ width: `${resolved.px}px`, height: `${resolved.px}px` }\"\n @pointerdown=\"createRipple\"\n >\n <MIcon :name=\"icon\" :size=\"resolved.icon\" />\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport MIcon from './MIcon.vue'\n\nconst props = withDefaults(\n defineProps<{\n icon: string\n label?: string\n variant?: 'standard' | 'filled' | 'tonal' | 'outlined'\n shape?: 'rounded' | 'squared'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n disabled?: boolean\n to?: string | Record<string, any>\n }>(),\n {\n variant: 'standard',\n shape: 'rounded',\n size: 'sm',\n disabled: false,\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\n// Container height/width (icon buttons are always square by default — real\n// `IconButtonDefaults.<tier>ContainerSize()` also has Narrow/Wide width options not\n// implemented here, matching the existing scope of MButton's size tiers) and icon size\n// per M3's 5-tier `{XSmall,Small,Medium,Large,XLarge}IconButtonTokens.kt`. `squareRadius`\n// matches each tier's own `ContainerShapeSquare` (12px xs/sm, 16px md, 28px lg/xl) — same\n// pattern as MButton's size tiers.\nconst sizeMap = {\n xs: { px: 32, icon: 20, squareRadius: 'rounded-md' },\n sm: { px: 40, icon: 24, squareRadius: 'rounded-md' },\n md: { px: 56, icon: 24, squareRadius: 'rounded-lg' },\n lg: { px: 96, icon: 32, squareRadius: 'rounded-xl' },\n xl: { px: 136, icon: 40, squareRadius: 'rounded-xl' },\n}\n\nconst resolved = computed(() => {\n if (typeof props.size === 'number') return { px: props.size, icon: Math.round(props.size * 0.55), squareRadius: 'rounded-md' }\n return sizeMap[props.size] ?? sizeMap.sm\n})\n\n/*\n * State layer via a `before:` overlay (same technique MButton uses) rather than a direct\n * `hover:bg-*`/`active:bg-*` utility: a solid `bg-primary`/`bg-secondary-container`\n * container can't also swap to a translucent hover background without just replacing the\n * color outright, so hover/press need a separate semi-transparent layer painted on top,\n * tinted with the button's own content color (`before:bg-current`) — matches real M3's\n * per-variant Hovered/PressedColor tokens, which are all just the content color at a fixed\n * opacity (8%/12%), the same universal state-layer pattern across every variant.\n */\nconst base =\n 'relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled container opacity is 10% on-surface (DisabledContainerOpacity, Filled/Tonal\n// only — Outlined has no container). Outlined's border needs no separate disabled class:\n// it's `border-current` (see `variantClasses`), so it dims automatically along with the\n// `disabled:text-on-surface/38` in `base` above, exactly like the real `outlinedIconButtonBorder`\n// (which literally reuses `LocalContentColor` at the same disabled opacity as the icon).\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n return 'disabled:bg-on-surface/10'\n default:\n return ''\n }\n})\n\nconst shapeClass = computed(() => props.shape === 'squared' ? resolved.value.squareRadius : 'rounded-full')\n\nfunction createRipple(event: PointerEvent) {\n if (props.disabled) return\n const button = event.currentTarget as HTMLElement\n const rect = button.getBoundingClientRect()\n const d = Math.max(rect.width, rect.height) * 2\n const el = document.createElement('span')\n el.className = 'm3-ripple'\n el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`\n button.appendChild(el)\n el.addEventListener('animationend', () => el.remove(), { once: true })\n}\n\nconst variantClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n // Real IconButton.kt has no elevation tokens at all for any variant — flat, unlike Button\n return 'bg-primary text-on-primary'\n case 'tonal':\n return 'bg-secondary-container text-on-secondary-container'\n case 'outlined':\n // OutlinedIconButtonTokens' default (non-\"vibrant\") border tracks LocalContentColor,\n // i.e. the same on-surface-variant used for the icon itself — not a fixed outline token\n return 'border border-current text-on-surface-variant'\n default:\n return 'text-on-surface-variant'\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n :aria-label=\"label || undefined\"\n :disabled=\"disabled\"\n :class=\"[base, shapeClass, variantClasses, disabledContainerClasses]\"\n :style=\"{ width: `${resolved.px}px`, height: `${resolved.px}px` }\"\n @pointerdown=\"createRipple\"\n >\n <MIcon :name=\"icon\" :size=\"resolved.icon\" />\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n type?: 'button' | 'submit' | 'reset'\n disabled?: boolean\n loading?: boolean\n icon?: string\n /**\n * Which side of the label `icon` renders on. Real M3 buttons support both via\n * `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n * either way at every tier, so this only changes render order, not spacing.\n */\n iconPos?: 'leading' | 'trailing'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n shape?: 'rounded' | 'squared'\n to?: string | Record<string, any>\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n\nfunction createRipple(event: PointerEvent) {\n if (props.disabled || props.loading) return\n const button = event.currentTarget as HTMLElement\n const rect = button.getBoundingClientRect()\n const d = Math.max(rect.width, rect.height) * 2\n const el = document.createElement('span')\n el.className = 'm3-ripple'\n el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`\n button.appendChild(el)\n el.addEventListener('animationend', () => el.remove(), { once: true })\n}\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"customStyle\"\n @pointerdown=\"createRipple\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" />\n </template>\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n type?: 'button' | 'submit' | 'reset'\n disabled?: boolean\n loading?: boolean\n icon?: string\n /**\n * Which side of the label `icon` renders on. Real M3 buttons support both via\n * `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n * either way at every tier, so this only changes render order, not spacing.\n */\n iconPos?: 'leading' | 'trailing'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n shape?: 'rounded' | 'squared'\n to?: string | Record<string, any>\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n\nfunction createRipple(event: PointerEvent) {\n if (props.disabled || props.loading) return\n const button = event.currentTarget as HTMLElement\n const rect = button.getBoundingClientRect()\n const d = Math.max(rect.width, rect.height) * 2\n const el = document.createElement('span')\n el.className = 'm3-ripple'\n el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`\n button.appendChild(el)\n el.addEventListener('animationend', () => el.remove(), { once: true })\n}\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"customStyle\"\n @pointerdown=\"createRipple\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" />\n </template>\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { nextTick, onUnmounted, ref, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: boolean\n title?: string\n maxWidth?: string\n /**\n * M3's `AlertDialogDefaults` has no max-height token at all (only `DialogMaxWidth`) — the\n * default here is a library-chosen viewport-relative cap, not a spec value.\n */\n maxHeight?: string\n persistent?: boolean\n fullscreen?: boolean\n closeLabel?: string\n /**\n * Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n * button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n * deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n * this component's existing behavior) rather than added unconditionally.\n */\n closable?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n },\n)\n\nconst locale = useLocale()\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') close()\n}\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nwatch(\n () => props.modelValue,\n async (open) => {\n if (open) {\n document.addEventListener('keydown', onKeydown)\n document.body.style.overflow = 'hidden'\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n document.removeEventListener('keydown', onKeydown)\n document.body.style.overflow = ''\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n)\n\nonUnmounted(() => {\n document.removeEventListener('keydown', onKeydown)\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\">\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n class=\"dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3\"\n :class=\"[maxWidth, maxHeight]\"\n >\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\">\n <div\n v-if=\"modelValue\"\n class=\"dialog-fs fixed inset-0 z-50 flex flex-col bg-surface\"\n >\n <div class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { nextTick, onUnmounted, ref, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: boolean\n title?: string\n maxWidth?: string\n /**\n * M3's `AlertDialogDefaults` has no max-height token at all (only `DialogMaxWidth`) — the\n * default here is a library-chosen viewport-relative cap, not a spec value.\n */\n maxHeight?: string\n persistent?: boolean\n fullscreen?: boolean\n closeLabel?: string\n /**\n * Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n * button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n * deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n * this component's existing behavior) rather than added unconditionally.\n */\n closable?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n },\n)\n\nconst locale = useLocale()\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') close()\n}\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nwatch(\n () => props.modelValue,\n async (open) => {\n if (open) {\n document.addEventListener('keydown', onKeydown)\n document.body.style.overflow = 'hidden'\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n document.removeEventListener('keydown', onKeydown)\n document.body.style.overflow = ''\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n)\n\nonUnmounted(() => {\n document.removeEventListener('keydown', onKeydown)\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\">\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n class=\"dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3\"\n :class=\"[maxWidth, maxHeight]\"\n >\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\">\n <div\n v-if=\"modelValue\"\n class=\"dialog-fs fixed inset-0 z-50 flex flex-col bg-surface\"\n >\n <div class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\nwithDefaults(\n defineProps<{\n /**\n * Marks this as a group boundary for `MMenu`/`MContextMenu`'s\n * `variant=\"expressive\"` — instead of rendering this divider in place,\n * the parent menu splits its panel into two independently-rounded group\n * boxes with a small gap between them. Has no effect outside an\n * `expressive` menu, where it renders as a normal divider line.\n */\n gap?: boolean\n }>(),\n { gap: false },\n)\n</script>\n\n<template>\n <hr class=\"my-1 border-outline-variant\" />\n</template>\n","<script setup lang=\"ts\">\nwithDefaults(\n defineProps<{\n /**\n * Marks this as a group boundary for `MMenu`/`MContextMenu`'s\n * `variant=\"expressive\"` — instead of rendering this divider in place,\n * the parent menu splits its panel into two independently-rounded group\n * boxes with a small gap between them. Has no effect outside an\n * `expressive` menu, where it renders as a normal divider line.\n */\n gap?: boolean\n }>(),\n { gap: false },\n)\n</script>\n\n<template>\n <hr class=\"my-1 border-outline-variant\" />\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, useId, useSlots } from \"vue\";\nimport MIcon from \"./MIcon.vue\";\nimport { useFieldBg } from \"../composables/useFieldBg\";\nimport { useDebounce } from \"../composables/useDebounce\";\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string | number;\n label: string;\n type?: string;\n variant?: \"filled\" | \"outlined\";\n error?: boolean;\n errorLabel?: string;\n hint?: string;\n disabled?: boolean;\n required?: boolean;\n multiline?: boolean;\n rows?: number;\n autocomplete?: string;\n leadingIcon?: string;\n clearable?: boolean;\n fieldBg?: string;\n debounce?: number;\n }>(),\n {\n type: \"text\",\n variant: \"filled\",\n rows: 3,\n clearable: false,\n debounce: 0,\n },\n);\n\nconst emit = defineEmits<{ \"update:modelValue\": [string]; debounced: [string] }>();\n\nconst id = useId();\nconst slots = useSlots();\n\nconst fieldBgEl = ref<HTMLElement | null>(null);\nconst { resolvedFieldBg } = useFieldBg(fieldBgEl, () => props.fieldBg);\n\nconst { debounced: emitDebounced, cancel: cancelDebounce } = useDebounce((v: string) => emit(\"debounced\", v), props.debounce)\n\nconst showClear = computed(() => props.clearable && String(props.modelValue).length > 0 && !props.disabled)\n\nconst inputClasses = computed(() => {\n const hasTrailing = !!slots.trailing || props.clearable;\n const pl = props.leadingIcon ? \"pl-12\" : \"pl-4\";\n const pr = hasTrailing ? \"pr-12\" : \"pr-4\";\n const size = props.multiline ? \"resize-y min-h-[56px]\" : \"h-14\";\n const base = [\n \"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent\",\n \"transition-[border-color,border-width] duration-150\",\n \"disabled:cursor-not-allowed disabled:text-on-surface/38\",\n props.error ? \"caret-error\" : \"caret-primary\",\n size,\n pl,\n pr,\n ];\n\n if (props.variant === \"outlined\") {\n return [\n ...base,\n \"rounded-xs border bg-transparent py-4\",\n props.error\n ? \"border-error focus:border-2 focus:border-error\"\n : \"border-outline hover:border-on-surface focus:border-2 focus:border-primary\",\n \"disabled:border-on-surface/12\",\n ].join(\" \");\n }\n\n return [\n ...base,\n \"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2\",\n props.error\n ? \"border-error focus:border-b-2 focus:border-error\"\n : \"border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary\",\n \"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]\",\n ].join(\" \");\n});\n\nconst labelClasses = computed(() => {\n const left = props.leadingIcon\n ? props.variant === \"outlined\"\n ? \"left-11\"\n : \"left-12\"\n : props.variant === \"outlined\"\n ? \"left-3\"\n : \"left-4\";\n\n const unfloatedTop = props.variant === 'filled' ? 'top-[53%]' : 'top-1/2'\n const base = [\n \"pointer-events-none absolute truncate transition-all duration-200\",\n left,\n \"right-4\",\n `${unfloatedTop} -translate-y-1/2 text-body-large`,\n ];\n\n if (props.variant === \"outlined\") {\n // When floated: drop right-4 (right-auto) and cap max-width so the label\n // shrinks to its own text width. The bg then only covers the glyphs + px-1,\n // cutting the border just where the text sits instead of a long strip.\n return [\n ...base,\n \"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1\",\n \"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]\",\n \"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n }\n\n // Filled: label floats to top-2 (slightly higher than before)\n return [\n ...base,\n \"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small\",\n \"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n});\n\nfunction onInput(event: Event) {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n emit(\"update:modelValue\", target.value);\n if (props.debounce > 0) emitDebounced(target.value)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1\">\n <!--\n --field-bg: background behind the floating label in outlined mode, so it\n \"cuts through\" the border. Auto-detected from the nearest opaque ancestor\n (see resolveBg); overridable via the fieldBg prop; falls back to surface.\n -->\n <div\n ref=\"fieldBgEl\"\n class=\"relative\"\n :class=\"variant === 'outlined' ? 'mt-2' : ''\"\n :style=\"variant === 'outlined' ? { '--field-bg': resolvedFieldBg } : undefined\"\n >\n <div\n v-if=\"leadingIcon\"\n class=\"pointer-events-none absolute left-3.5\"\n :class=\"[\n multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-4.5' : 'top-4',\n disabled ? 'text-on-surface/38' : 'text-on-surface-variant',\n ]\"\n >\n <MIcon :name=\"leadingIcon\" :size=\"24\" />\n </div>\n\n <textarea\n v-if=\"multiline\"\n :id=\"id\"\n :value=\"String(modelValue)\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :required=\"required\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n <input\n v-else\n :id=\"id\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :required=\"required\"\n :autocomplete=\"autocomplete\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n\n <label :for=\"id\" :class=\"labelClasses\">\n {{ label }}<span v-if=\"required\" class=\"text-error\"> *</span>\n </label>\n\n <div v-if=\"$slots.trailing\" class=\"absolute right-2 top-1/2 -translate-y-1/2\">\n <slot name=\"trailing\" />\n </div>\n <button\n v-else-if=\"showClear\"\n type=\"button\"\n class=\"absolute right-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface\"\n @click=\"cancelDebounce(); emit('update:modelValue', '')\"\n >\n <MIcon name=\"close\" :size=\"18\" />\n </button>\n </div>\n\n <p v-if=\"error && errorLabel\" class=\"px-4 text-body-small text-error\">{{ errorLabel }}</p>\n <p v-else-if=\"hint\" class=\"px-4 text-body-small text-on-surface-variant\">{{ hint }}</p>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, useId, useSlots } from \"vue\";\nimport MIcon from \"./MIcon.vue\";\nimport { useFieldBg } from \"../composables/useFieldBg\";\nimport { useDebounce } from \"../composables/useDebounce\";\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string | number;\n label: string;\n type?: string;\n variant?: \"filled\" | \"outlined\";\n error?: boolean;\n errorLabel?: string;\n hint?: string;\n disabled?: boolean;\n required?: boolean;\n multiline?: boolean;\n rows?: number;\n autocomplete?: string;\n leadingIcon?: string;\n clearable?: boolean;\n fieldBg?: string;\n debounce?: number;\n }>(),\n {\n type: \"text\",\n variant: \"filled\",\n rows: 3,\n clearable: false,\n debounce: 0,\n },\n);\n\nconst emit = defineEmits<{ \"update:modelValue\": [string]; debounced: [string] }>();\n\nconst id = useId();\nconst slots = useSlots();\n\nconst fieldBgEl = ref<HTMLElement | null>(null);\nconst { resolvedFieldBg } = useFieldBg(fieldBgEl, () => props.fieldBg);\n\nconst { debounced: emitDebounced, cancel: cancelDebounce } = useDebounce((v: string) => emit(\"debounced\", v), props.debounce)\n\nconst showClear = computed(() => props.clearable && String(props.modelValue).length > 0 && !props.disabled)\n\nconst inputClasses = computed(() => {\n const hasTrailing = !!slots.trailing || props.clearable;\n const pl = props.leadingIcon ? \"pl-12\" : \"pl-4\";\n const pr = hasTrailing ? \"pr-12\" : \"pr-4\";\n const size = props.multiline ? \"resize-y min-h-[56px]\" : \"h-14\";\n const base = [\n \"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent\",\n \"transition-[border-color,border-width] duration-150\",\n \"disabled:cursor-not-allowed disabled:text-on-surface/38\",\n props.error ? \"caret-error\" : \"caret-primary\",\n size,\n pl,\n pr,\n ];\n\n if (props.variant === \"outlined\") {\n return [\n ...base,\n \"rounded-xs border bg-transparent py-4\",\n props.error\n ? \"border-error focus:border-2 focus:border-error\"\n : \"border-outline hover:border-on-surface focus:border-2 focus:border-primary\",\n \"disabled:border-on-surface/12\",\n ].join(\" \");\n }\n\n return [\n ...base,\n \"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2\",\n props.error\n ? \"border-error focus:border-b-2 focus:border-error\"\n : \"border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary\",\n \"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]\",\n ].join(\" \");\n});\n\nconst labelClasses = computed(() => {\n const left = props.leadingIcon\n ? props.variant === \"outlined\"\n ? \"left-11\"\n : \"left-12\"\n : props.variant === \"outlined\"\n ? \"left-3\"\n : \"left-4\";\n\n const unfloatedTop = props.variant === 'filled' ? 'top-[53%]' : 'top-1/2'\n const base = [\n \"pointer-events-none absolute truncate transition-all duration-200\",\n left,\n \"right-4\",\n `${unfloatedTop} -translate-y-1/2 text-body-large`,\n ];\n\n if (props.variant === \"outlined\") {\n // When floated: drop right-4 (right-auto) and cap max-width so the label\n // shrinks to its own text width. The bg then only covers the glyphs + px-1,\n // cutting the border just where the text sits instead of a long strip.\n return [\n ...base,\n \"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1\",\n \"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]\",\n \"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n }\n\n // Filled: label floats to top-2 (slightly higher than before)\n return [\n ...base,\n \"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small\",\n \"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n});\n\nfunction onInput(event: Event) {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n emit(\"update:modelValue\", target.value);\n if (props.debounce > 0) emitDebounced(target.value)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1\">\n <!--\n --field-bg: background behind the floating label in outlined mode, so it\n \"cuts through\" the border. Auto-detected from the nearest opaque ancestor\n (see resolveBg); overridable via the fieldBg prop; falls back to surface.\n -->\n <div\n ref=\"fieldBgEl\"\n class=\"relative\"\n :class=\"variant === 'outlined' ? 'mt-2' : ''\"\n :style=\"variant === 'outlined' ? { '--field-bg': resolvedFieldBg } : undefined\"\n >\n <div\n v-if=\"leadingIcon\"\n class=\"pointer-events-none absolute left-3.5\"\n :class=\"[\n multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-4.5' : 'top-4',\n disabled ? 'text-on-surface/38' : 'text-on-surface-variant',\n ]\"\n >\n <MIcon :name=\"leadingIcon\" :size=\"24\" />\n </div>\n\n <textarea\n v-if=\"multiline\"\n :id=\"id\"\n :value=\"String(modelValue)\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :required=\"required\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n <input\n v-else\n :id=\"id\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :required=\"required\"\n :autocomplete=\"autocomplete\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n\n <label :for=\"id\" :class=\"labelClasses\">\n {{ label }}<span v-if=\"required\" class=\"text-error\"> *</span>\n </label>\n\n <div v-if=\"$slots.trailing\" class=\"absolute right-2 top-1/2 -translate-y-1/2\">\n <slot name=\"trailing\" />\n </div>\n <button\n v-else-if=\"showClear\"\n type=\"button\"\n class=\"absolute right-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface\"\n @click=\"cancelDebounce(); emit('update:modelValue', '')\"\n >\n <MIcon name=\"close\" :size=\"18\" />\n </button>\n </div>\n\n <p v-if=\"error && errorLabel\" class=\"px-4 text-body-small text-error\">{{ errorLabel }}</p>\n <p v-else-if=\"hint\" class=\"px-4 text-body-small text-on-surface-variant\">{{ hint }}</p>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, Fragment, inject, nextTick, onMounted, onUnmounted, provide, ref, useSlots, watch, type VNode } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenuDivider from './MMenuDivider.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Which edge of the trigger the dropdown aligns to. */\n align?: 'left' | 'right'\n /**\n * How items with a `#children` slot behave.\n * `'flyout'` opens a hover-positioned side panel (desktop).\n * `'push'` replaces the panel's own content with the submenu and a\n * back header — no positioning math, works with touch. Useful for mobile.\n */\n submenuMode?: 'flyout' | 'push'\n /**\n * `'standard'` is M3's baseline menu — square-ish 4dp corners\n * (`MenuTokens.ContainerShape`/`CornerExtraSmall`).\n * `'expressive'` is M3's rounder \"vertical menu\" styling — 16dp corners\n * (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with\n * `<MMenuDivider gap />` to split the panel into independently-rounded\n * groups with a visible gap between them, instead of a plain line.\n */\n variant?: 'standard' | 'expressive'\n }>(),\n { align: 'right', submenuMode: 'flyout', variant: 'standard' },\n)\n\nconst slots = useSlots()\n\nfunction flattenVNodes(vnodes: VNode[]): VNode[] {\n const out: VNode[] = []\n for (const vnode of vnodes) {\n if (vnode.type === Fragment && Array.isArray(vnode.children)) {\n out.push(...flattenVNodes(vnode.children as VNode[]))\n } else {\n out.push(vnode)\n }\n }\n return out\n}\n\nfunction isGapDivider(vnode: VNode): boolean {\n if (vnode.type !== MMenuDivider) return false\n const gap = (vnode.props as { gap?: unknown } | null)?.gap\n return gap === '' || gap === true || gap === 'true'\n}\n\n// Splits the default slot's content into groups at each `<MMenuDivider gap />`\n// — only used by the 'expressive' variant to render independently-rounded\n// group boxes. A plain `<MMenuDivider />` (no `gap`) stays a normal in-line\n// divider inside a single group, same as 'standard'.\nconst groups = computed(() => {\n if (props.variant !== 'expressive') return null\n const raw = flattenVNodes((slots.default?.({ close }) ?? []) as VNode[])\n const result: VNode[][] = [[]]\n for (const vnode of raw) {\n if (isGapDivider(vnode)) result.push([])\n else result[result.length - 1]!.push(vnode)\n }\n return result.filter(g => g.length > 0)\n})\nconst isGrouped = computed(() => !!groups.value && groups.value.length > 1)\n\ntype NavEntry = { icon?: string, header?: () => any, content?: () => any }\nconst navStack = ref<NavEntry[]>([])\nconst currentNav = computed(() => navStack.value[navStack.value.length - 1])\nconst navDirection = ref<'forward' | 'backward'>('forward')\n\n// Driven by the Web Animations API rather than Vue's CSS-class transition\n// hooks — with dynamic (direction-dependent) enter/leave classes on a\n// Transition with no `mode`, Vue's from->active->to class swap unreliably\n// never completed (elements got stuck straddling from/active with the\n// animation never actually running), so this drives it directly instead.\nconst slideDuration = 220\nfunction navSlideEnter(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? 1 : -1\n const anim = (el as HTMLElement).animate(\n [\n { transform: `translateX(${dir * 100}%)`, opacity: 0.4 },\n { transform: 'translateX(0%)', opacity: 1 },\n ],\n { duration: slideDuration, easing: 'cubic-bezier(0.05,0.7,0.1,1)' },\n )\n anim.onfinish = done\n}\nfunction navSlideLeave(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? -1 : 1\n const htmlEl = el as HTMLElement\n htmlEl.style.position = 'absolute'\n htmlEl.style.insetInline = '0'\n htmlEl.style.top = '0'\n const anim = htmlEl.animate(\n [\n { transform: 'translateX(0%)', opacity: 1 },\n { transform: `translateX(${dir * 100}%)`, opacity: 0.4 },\n ],\n { duration: slideDuration, easing: 'cubic-bezier(0.3,0,0.8,0.15)' },\n )\n anim.onfinish = done\n}\n\n// The real DropdownMenuContent in Menu.kt animates scale (0.8 -> 1) and alpha\n// (0 -> 1) with actual springs (MotionSchemeKeyTokens.FastSpatial/FastEffects\n// on the Standard scheme, StandardMotionTokens: scale dampingRatio 0.9/\n// stiffness 1400, alpha dampingRatio 1.0/stiffness 3800) — not a duration+\n// easing tween, which is why a cubic-bezier stand-in read as an abrupt cut on\n// close (a bezier can't carry a spring's momentum). But running the *close*\n// as its own independent spring toward the opposite target isn't right\n// either: alpha (stiffness 3800) settles much faster than scale (stiffness\n// 1400), so on close the panel fades to invisible well before it finishes\n// shrinking — you never actually see the shrink. On open this isn't a\n// problem (it becomes visible early, *then* you watch it keep growing), but\n// close needs to be the literal time-reverse of open, not a forward\n// simulation toward reversed targets, so the shrink stays visible the whole\n// time and only the fade races ahead right at the very end (mirroring how\n// the fade led at the very start of open). Simulated once (open direction\n// only) and played back forwards for enter, backwards for leave.\n//\n// A damped spring approaches its target exponentially, so it keeps \"settling\"\n// long after the motion is visually done — with a tight (0.001) tolerance on\n// both position *and* velocity, roughly the last third of the recorded\n// trajectory is values within a fraction of a percent of the target, visually\n// indistinguishable from it. Reversed for close, that flat tail lands at the\n// *start* instead, so nothing visibly happens for the first ~80ms before the\n// close animation actually appears to begin. Trimmed on position alone with a\n// much looser tolerance instead, since that's what's actually visible.\nlet cachedTrajectory: { scale: number, alpha: number }[] | null = null\nconst trajectoryStep = 1 / 240\nfunction openTrajectory() {\n if (cachedTrajectory) return cachedTrajectory\n const samples: { scale: number, alpha: number }[] = []\n let scale = 0.8\n let scaleVel = 0\n let alpha = 0\n let alphaVel = 0\n const scaleDamping = 0.9\n const scaleStiffness = 1400\n const alphaDamping = 1.0\n const alphaStiffness = 3800\n for (let t = 0; t < 1; t += trajectoryStep) {\n samples.push({ scale, alpha })\n scaleVel += (-scaleStiffness * (scale - 1) - 2 * scaleDamping * Math.sqrt(scaleStiffness) * scaleVel) * trajectoryStep\n scale += scaleVel * trajectoryStep\n alphaVel += (-alphaStiffness * (alpha - 1) - 2 * alphaDamping * Math.sqrt(alphaStiffness) * alphaVel) * trajectoryStep\n alpha += alphaVel * trajectoryStep\n const visuallySettled = Math.abs(scale - 1) < 0.003 && Math.abs(alpha - 1) < 0.003\n if (visuallySettled) break\n }\n samples.push({ scale: 1, alpha: 1 })\n cachedTrajectory = samples\n return samples\n}\n\n// Vue interrupts and reverses this mid-flight when the menu is toggled\n// quickly (close while still opening, or vice versa) — it calls the other\n// hook on the same still-mounted element without waiting for `done()`. Both\n// `currentIdx` (how far along the trajectory we are, so a reversal continues\n// smoothly from wherever it currently is instead of snapping back to a fixed\n// start) and `cancelActive` (so the previous rAF loop actually stops instead\n// of running alongside the new one, fighting over the same style every\n// frame) have to live outside this function to survive that interruption.\nlet currentIdx = 0\nlet cancelActive: (() => void) | null = null\n\nfunction playTrajectory(el: Element, done: () => void, opening: boolean) {\n cancelActive?.()\n const htmlEl = el as HTMLElement\n const samples = openTrajectory()\n const last = samples.length - 1\n const direction = opening ? 1 : -1\n const target = opening ? last : 0\n let lastTime = 0\n let rafId = 0\n let cancelled = false\n\n function apply(idx: number) {\n const sample = samples[Math.round(Math.max(0, Math.min(last, idx)))]!\n htmlEl.style.transform = `scale(${sample.scale})`\n htmlEl.style.opacity = String(Math.min(1, Math.max(0, sample.alpha)))\n }\n\n function step(now: number) {\n if (cancelled) return\n const dtSteps = lastTime ? (now - lastTime) / 1000 / trajectoryStep : 1\n lastTime = now\n currentIdx = Math.max(0, Math.min(last, currentIdx + direction * dtSteps))\n apply(currentIdx)\n if ((opening && currentIdx >= target) || (!opening && currentIdx <= target)) {\n cancelActive = null\n done()\n return\n }\n rafId = requestAnimationFrame(step)\n }\n\n cancelActive = () => { cancelled = true; cancelAnimationFrame(rafId) }\n apply(currentIdx)\n rafId = requestAnimationFrame(step)\n}\nfunction panelEnter(el: Element, done: () => void) {\n playTrajectory(el, done, true)\n}\nfunction panelLeave(el: Element, done: () => void) {\n playTrajectory(el, done, false)\n}\n\nfunction pushNav(entry: NavEntry) {\n navDirection.value = 'forward'\n navStack.value.push(entry)\n nextTick(() => focusFirstItem())\n}\n\nfunction popNav() {\n navDirection.value = 'backward'\n navStack.value.pop()\n nextTick(() => focusFirstItem())\n}\n\nconst open = ref(false)\nconst triggerEl = ref<HTMLElement | null>(null)\nconst dropdownEl = ref<HTMLElement | null>(null)\nconst dropStyle = ref<Record<string, string>>({})\n\n// A menu can be nested inside another MMenu/MContextMenu's slot (e.g. a\n// \"Language\" picker menu inside a \"More options\" overflow menu) — since both\n// Teleport straight to <body>, the outer one's panel DOM never contains the\n// inner one's, so the outer's outside-click check would otherwise see a click\n// inside the nested menu as \"outside\" and close (unmount) itself on\n// mousedown, before the inner button's own click can fire. Sharing one\n// registry of open panel elements across the whole logical (not DOM) menu\n// tree via provide/inject fixes that for arbitrary nesting depth.\nconst panelRegistry = inject<Set<HTMLElement>>('m-menu-panel-registry', new Set())\nprovide('m-menu-panel-registry', panelRegistry)\n\nwatch(dropdownEl, (el, oldEl) => {\n if (oldEl) panelRegistry.delete(oldEl)\n if (el) panelRegistry.add(el)\n})\n\nonUnmounted(() => {\n if (dropdownEl.value) panelRegistry.delete(dropdownEl.value)\n})\n\n// Separate from panelRegistry above: that one is shared all the way down the\n// nesting chain so a click inside a descendant menu never closes an ancestor.\n// This one is scoped to just this menu's *direct* children (e.g. \"Language\"\n// and \"Color palette\", both nested inside the same \"More options\" menu) —\n// without it, opening one no longer closes the other (since panelRegistry now\n// treats a click on either as \"inside\" the shared ancestor), so two sibling\n// pickers could stay open at once. Only one child of the same parent open at\n// a time, like an accordion; doesn't affect unrelated top-level menus.\nconst siblingGroup = inject<{ current: (() => void) | null } | null>('m-menu-sibling-group', null)\nprovide('m-menu-sibling-group', { current: null })\n\nfunction computePos() {\n if (!triggerEl.value) return\n const rect = triggerEl.value.getBoundingClientRect()\n const spaceBelow = window.innerHeight - rect.bottom - 8\n const openAbove = spaceBelow < 200 && rect.top > spaceBelow\n\n const style: Record<string, string> = {\n maxHeight: `${Math.min(openAbove ? rect.top - 12 : spaceBelow, 400)}px`,\n }\n\n if (openAbove) {\n style.bottom = `${window.innerHeight - rect.top + 4}px`\n } else {\n style.top = `${rect.bottom + 4}px`\n }\n\n if (props.align === 'right') {\n style.right = `${window.innerWidth - rect.right}px`\n } else {\n style.left = `${rect.left}px`\n }\n\n dropStyle.value = style\n}\n\nfunction focusableItems() {\n if (!dropdownEl.value) return []\n return Array.from(\n dropdownEl.value.querySelectorAll<HTMLElement>('button:not(:disabled), a[href]'),\n )\n}\n\nfunction focusFirstItem() {\n nextTick(() => focusableItems()[0]?.focus())\n}\n\nfunction moveFocus(dir: 1 | -1) {\n const items = focusableItems()\n if (!items.length) return\n const idx = items.indexOf(document.activeElement as HTMLElement)\n const next = idx === -1\n ? (dir === 1 ? items[0] : items[items.length - 1])\n : items[(idx + dir + items.length) % items.length]\n next?.focus()\n}\n\nfunction toggle() {\n if (!open.value) {\n if (siblingGroup && siblingGroup.current && siblingGroup.current !== close) {\n siblingGroup.current()\n }\n if (siblingGroup) siblingGroup.current = close\n computePos()\n navStack.value = []\n } else if (siblingGroup?.current === close) {\n siblingGroup.current = null\n }\n open.value = !open.value\n if (open.value) focusFirstItem()\n}\n\nfunction close() {\n if (siblingGroup?.current === close) siblingGroup.current = null\n open.value = false\n}\n\nprovide('m-menu-close', close)\nprovide('m-menu-nav', { mode: props.submenuMode, push: pushNav })\ndefineExpose({ close, open })\n\nfunction onOutsideClick(e: MouseEvent) {\n const t = e.target as Node\n if (triggerEl.value?.contains(t)) return\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\nfunction onScroll(e: Event) {\n if (!open.value) return\n if (dropdownEl.value?.contains(e.target as Node)) return\n close()\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n if (navStack.value.length) popNav()\n else close()\n return\n }\n if (!open.value) return\n if (e.key === 'ArrowDown') { e.preventDefault(); moveFocus(1) }\n else if (e.key === 'ArrowUp') { e.preventDefault(); moveFocus(-1) }\n}\n\nonMounted(() => {\n document.addEventListener('mousedown', onOutsideClick)\n document.addEventListener('keydown', onKeydown)\n window.addEventListener('scroll', onScroll, true)\n})\n\nonUnmounted(() => {\n document.removeEventListener('mousedown', onOutsideClick)\n document.removeEventListener('keydown', onKeydown)\n window.removeEventListener('scroll', onScroll, true)\n cancelActive?.()\n})\n\nconst origin = computed(() =>\n props.align === 'right' ? 'top right' : 'top left',\n)\n</script>\n\n<template>\n <div ref=\"triggerEl\" class=\"inline-block\" @click=\"toggle\">\n <slot name=\"trigger\" :open=\"open\" />\n </div>\n\n <Teleport to=\"body\">\n <Transition :css=\"false\" @enter=\"panelEnter\" @leave=\"panelLeave\">\n <div\n v-if=\"open\"\n ref=\"dropdownEl\"\n class=\"fixed z-500 min-w-48\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'shadow-elevation-2',\n ]\"\n :style=\"{ ...dropStyle, transformOrigin: origin }\"\n >\n <!-- overflow-hidden (for the rounded-corner clip and to clip the push\n submenu's slide) lives on this inner wrapper, never together with\n shadow-elevation-2 on the same box — overflow-hidden clips an\n element's own box-shadow too, so the two have to be on separate\n elements or the shadow gets cut off -->\n <div\n class=\"overflow-hidden\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'bg-surface-container',\n ]\"\n >\n <div class=\"relative overflow-y-auto py-1\" :style=\"{ maxHeight: dropStyle.maxHeight }\">\n <Transition :css=\"false\" @enter=\"navSlideEnter\" @leave=\"navSlideLeave\">\n <div v-if=\"currentNav\" :key=\"navStack.length\">\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-3 border-b border-outline-variant px-4 py-2.5 text-left text-body-large text-on-surface outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n @click=\"popNav\"\n >\n <MIcon name=\"chevron_left\" :size=\"20\" class=\"shrink-0 text-on-surface-variant\" />\n <MIcon v-if=\"currentNav.icon\" :name=\"currentNav.icon\" :size=\"20\" class=\"shrink-0 text-on-surface-variant\" />\n <span class=\"flex-1 truncate\"><component :is=\"() => currentNav?.header?.()\" /></span>\n </button>\n <component :is=\"() => currentNav?.content?.()\" />\n </div>\n <div v-else key=\"root\">\n <div v-if=\"isGrouped\" class=\"flex flex-col gap-1 px-1.5\">\n <div v-for=\"(group, i) in groups\" :key=\"i\" class=\"rounded-lg shadow-elevation-2\">\n <div class=\"overflow-hidden rounded-lg bg-surface-container\">\n <component :is=\"() => group\" />\n </div>\n </div>\n </div>\n <slot v-else :close=\"close\" />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, Fragment, inject, nextTick, onMounted, onUnmounted, provide, ref, useSlots, watch, type VNode } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenuDivider from './MMenuDivider.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Which edge of the trigger the dropdown aligns to. */\n align?: 'left' | 'right'\n /**\n * How items with a `#children` slot behave.\n * `'flyout'` opens a hover-positioned side panel (desktop).\n * `'push'` replaces the panel's own content with the submenu and a\n * back header — no positioning math, works with touch. Useful for mobile.\n */\n submenuMode?: 'flyout' | 'push'\n /**\n * `'standard'` is M3's baseline menu — square-ish 4dp corners\n * (`MenuTokens.ContainerShape`/`CornerExtraSmall`).\n * `'expressive'` is M3's rounder \"vertical menu\" styling — 16dp corners\n * (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with\n * `<MMenuDivider gap />` to split the panel into independently-rounded\n * groups with a visible gap between them, instead of a plain line.\n */\n variant?: 'standard' | 'expressive'\n }>(),\n { align: 'right', submenuMode: 'flyout', variant: 'standard' },\n)\n\nconst slots = useSlots()\n\nfunction flattenVNodes(vnodes: VNode[]): VNode[] {\n const out: VNode[] = []\n for (const vnode of vnodes) {\n if (vnode.type === Fragment && Array.isArray(vnode.children)) {\n out.push(...flattenVNodes(vnode.children as VNode[]))\n } else {\n out.push(vnode)\n }\n }\n return out\n}\n\nfunction isGapDivider(vnode: VNode): boolean {\n if (vnode.type !== MMenuDivider) return false\n const gap = (vnode.props as { gap?: unknown } | null)?.gap\n return gap === '' || gap === true || gap === 'true'\n}\n\n// Splits the default slot's content into groups at each `<MMenuDivider gap />`\n// — only used by the 'expressive' variant to render independently-rounded\n// group boxes. A plain `<MMenuDivider />` (no `gap`) stays a normal in-line\n// divider inside a single group, same as 'standard'.\nconst groups = computed(() => {\n if (props.variant !== 'expressive') return null\n const raw = flattenVNodes((slots.default?.({ close }) ?? []) as VNode[])\n const result: VNode[][] = [[]]\n for (const vnode of raw) {\n if (isGapDivider(vnode)) result.push([])\n else result[result.length - 1]!.push(vnode)\n }\n return result.filter(g => g.length > 0)\n})\nconst isGrouped = computed(() => !!groups.value && groups.value.length > 1)\n\ntype NavEntry = { icon?: string, header?: () => any, content?: () => any }\nconst navStack = ref<NavEntry[]>([])\nconst currentNav = computed(() => navStack.value[navStack.value.length - 1])\nconst navDirection = ref<'forward' | 'backward'>('forward')\n\n// Driven by the Web Animations API rather than Vue's CSS-class transition\n// hooks — with dynamic (direction-dependent) enter/leave classes on a\n// Transition with no `mode`, Vue's from->active->to class swap unreliably\n// never completed (elements got stuck straddling from/active with the\n// animation never actually running), so this drives it directly instead.\nconst slideDuration = 220\nfunction navSlideEnter(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? 1 : -1\n const anim = (el as HTMLElement).animate(\n [\n { transform: `translateX(${dir * 100}%)`, opacity: 0.4 },\n { transform: 'translateX(0%)', opacity: 1 },\n ],\n { duration: slideDuration, easing: 'cubic-bezier(0.05,0.7,0.1,1)' },\n )\n anim.onfinish = done\n}\nfunction navSlideLeave(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? -1 : 1\n const htmlEl = el as HTMLElement\n htmlEl.style.position = 'absolute'\n htmlEl.style.insetInline = '0'\n htmlEl.style.top = '0'\n const anim = htmlEl.animate(\n [\n { transform: 'translateX(0%)', opacity: 1 },\n { transform: `translateX(${dir * 100}%)`, opacity: 0.4 },\n ],\n { duration: slideDuration, easing: 'cubic-bezier(0.3,0,0.8,0.15)' },\n )\n anim.onfinish = done\n}\n\n// The real DropdownMenuContent in Menu.kt animates scale (0.8 -> 1) and alpha\n// (0 -> 1) with actual springs (MotionSchemeKeyTokens.FastSpatial/FastEffects\n// on the Standard scheme, StandardMotionTokens: scale dampingRatio 0.9/\n// stiffness 1400, alpha dampingRatio 1.0/stiffness 3800) — not a duration+\n// easing tween, which is why a cubic-bezier stand-in read as an abrupt cut on\n// close (a bezier can't carry a spring's momentum). But running the *close*\n// as its own independent spring toward the opposite target isn't right\n// either: alpha (stiffness 3800) settles much faster than scale (stiffness\n// 1400), so on close the panel fades to invisible well before it finishes\n// shrinking — you never actually see the shrink. On open this isn't a\n// problem (it becomes visible early, *then* you watch it keep growing), but\n// close needs to be the literal time-reverse of open, not a forward\n// simulation toward reversed targets, so the shrink stays visible the whole\n// time and only the fade races ahead right at the very end (mirroring how\n// the fade led at the very start of open). Simulated once (open direction\n// only) and played back forwards for enter, backwards for leave.\n//\n// A damped spring approaches its target exponentially, so it keeps \"settling\"\n// long after the motion is visually done — with a tight (0.001) tolerance on\n// both position *and* velocity, roughly the last third of the recorded\n// trajectory is values within a fraction of a percent of the target, visually\n// indistinguishable from it. Reversed for close, that flat tail lands at the\n// *start* instead, so nothing visibly happens for the first ~80ms before the\n// close animation actually appears to begin. Trimmed on position alone with a\n// much looser tolerance instead, since that's what's actually visible.\nlet cachedTrajectory: { scale: number, alpha: number }[] | null = null\nconst trajectoryStep = 1 / 240\nfunction openTrajectory() {\n if (cachedTrajectory) return cachedTrajectory\n const samples: { scale: number, alpha: number }[] = []\n let scale = 0.8\n let scaleVel = 0\n let alpha = 0\n let alphaVel = 0\n const scaleDamping = 0.9\n const scaleStiffness = 1400\n const alphaDamping = 1.0\n const alphaStiffness = 3800\n for (let t = 0; t < 1; t += trajectoryStep) {\n samples.push({ scale, alpha })\n scaleVel += (-scaleStiffness * (scale - 1) - 2 * scaleDamping * Math.sqrt(scaleStiffness) * scaleVel) * trajectoryStep\n scale += scaleVel * trajectoryStep\n alphaVel += (-alphaStiffness * (alpha - 1) - 2 * alphaDamping * Math.sqrt(alphaStiffness) * alphaVel) * trajectoryStep\n alpha += alphaVel * trajectoryStep\n const visuallySettled = Math.abs(scale - 1) < 0.003 && Math.abs(alpha - 1) < 0.003\n if (visuallySettled) break\n }\n samples.push({ scale: 1, alpha: 1 })\n cachedTrajectory = samples\n return samples\n}\n\n// Vue interrupts and reverses this mid-flight when the menu is toggled\n// quickly (close while still opening, or vice versa) — it calls the other\n// hook on the same still-mounted element without waiting for `done()`. Both\n// `currentIdx` (how far along the trajectory we are, so a reversal continues\n// smoothly from wherever it currently is instead of snapping back to a fixed\n// start) and `cancelActive` (so the previous rAF loop actually stops instead\n// of running alongside the new one, fighting over the same style every\n// frame) have to live outside this function to survive that interruption.\nlet currentIdx = 0\nlet cancelActive: (() => void) | null = null\n\nfunction playTrajectory(el: Element, done: () => void, opening: boolean) {\n cancelActive?.()\n const htmlEl = el as HTMLElement\n const samples = openTrajectory()\n const last = samples.length - 1\n const direction = opening ? 1 : -1\n const target = opening ? last : 0\n let lastTime = 0\n let rafId = 0\n let cancelled = false\n\n function apply(idx: number) {\n const sample = samples[Math.round(Math.max(0, Math.min(last, idx)))]!\n htmlEl.style.transform = `scale(${sample.scale})`\n htmlEl.style.opacity = String(Math.min(1, Math.max(0, sample.alpha)))\n }\n\n function step(now: number) {\n if (cancelled) return\n const dtSteps = lastTime ? (now - lastTime) / 1000 / trajectoryStep : 1\n lastTime = now\n currentIdx = Math.max(0, Math.min(last, currentIdx + direction * dtSteps))\n apply(currentIdx)\n if ((opening && currentIdx >= target) || (!opening && currentIdx <= target)) {\n cancelActive = null\n done()\n return\n }\n rafId = requestAnimationFrame(step)\n }\n\n cancelActive = () => { cancelled = true; cancelAnimationFrame(rafId) }\n apply(currentIdx)\n rafId = requestAnimationFrame(step)\n}\nfunction panelEnter(el: Element, done: () => void) {\n playTrajectory(el, done, true)\n}\nfunction panelLeave(el: Element, done: () => void) {\n playTrajectory(el, done, false)\n}\n\nfunction pushNav(entry: NavEntry) {\n navDirection.value = 'forward'\n navStack.value.push(entry)\n nextTick(() => focusFirstItem())\n}\n\nfunction popNav() {\n navDirection.value = 'backward'\n navStack.value.pop()\n nextTick(() => focusFirstItem())\n}\n\nconst open = ref(false)\nconst triggerEl = ref<HTMLElement | null>(null)\nconst dropdownEl = ref<HTMLElement | null>(null)\nconst dropStyle = ref<Record<string, string>>({})\n\n// A menu can be nested inside another MMenu/MContextMenu's slot (e.g. a\n// \"Language\" picker menu inside a \"More options\" overflow menu) — since both\n// Teleport straight to <body>, the outer one's panel DOM never contains the\n// inner one's, so the outer's outside-click check would otherwise see a click\n// inside the nested menu as \"outside\" and close (unmount) itself on\n// mousedown, before the inner button's own click can fire. Sharing one\n// registry of open panel elements across the whole logical (not DOM) menu\n// tree via provide/inject fixes that for arbitrary nesting depth.\nconst panelRegistry = inject<Set<HTMLElement>>('m-menu-panel-registry', new Set())\nprovide('m-menu-panel-registry', panelRegistry)\n\nwatch(dropdownEl, (el, oldEl) => {\n if (oldEl) panelRegistry.delete(oldEl)\n if (el) panelRegistry.add(el)\n})\n\nonUnmounted(() => {\n if (dropdownEl.value) panelRegistry.delete(dropdownEl.value)\n})\n\n// Separate from panelRegistry above: that one is shared all the way down the\n// nesting chain so a click inside a descendant menu never closes an ancestor.\n// This one is scoped to just this menu's *direct* children (e.g. \"Language\"\n// and \"Color palette\", both nested inside the same \"More options\" menu) —\n// without it, opening one no longer closes the other (since panelRegistry now\n// treats a click on either as \"inside\" the shared ancestor), so two sibling\n// pickers could stay open at once. Only one child of the same parent open at\n// a time, like an accordion; doesn't affect unrelated top-level menus.\nconst siblingGroup = inject<{ current: (() => void) | null } | null>('m-menu-sibling-group', null)\nprovide('m-menu-sibling-group', { current: null })\n\nfunction computePos() {\n if (!triggerEl.value) return\n const rect = triggerEl.value.getBoundingClientRect()\n const spaceBelow = window.innerHeight - rect.bottom - 8\n const openAbove = spaceBelow < 200 && rect.top > spaceBelow\n\n const style: Record<string, string> = {\n maxHeight: `${Math.min(openAbove ? rect.top - 12 : spaceBelow, 400)}px`,\n }\n\n if (openAbove) {\n style.bottom = `${window.innerHeight - rect.top + 4}px`\n } else {\n style.top = `${rect.bottom + 4}px`\n }\n\n if (props.align === 'right') {\n style.right = `${window.innerWidth - rect.right}px`\n } else {\n style.left = `${rect.left}px`\n }\n\n dropStyle.value = style\n}\n\nfunction focusableItems() {\n if (!dropdownEl.value) return []\n return Array.from(\n dropdownEl.value.querySelectorAll<HTMLElement>('button:not(:disabled), a[href]'),\n )\n}\n\nfunction focusFirstItem() {\n nextTick(() => focusableItems()[0]?.focus())\n}\n\nfunction moveFocus(dir: 1 | -1) {\n const items = focusableItems()\n if (!items.length) return\n const idx = items.indexOf(document.activeElement as HTMLElement)\n const next = idx === -1\n ? (dir === 1 ? items[0] : items[items.length - 1])\n : items[(idx + dir + items.length) % items.length]\n next?.focus()\n}\n\nfunction toggle() {\n if (!open.value) {\n if (siblingGroup && siblingGroup.current && siblingGroup.current !== close) {\n siblingGroup.current()\n }\n if (siblingGroup) siblingGroup.current = close\n computePos()\n navStack.value = []\n } else if (siblingGroup?.current === close) {\n siblingGroup.current = null\n }\n open.value = !open.value\n if (open.value) focusFirstItem()\n}\n\nfunction close() {\n if (siblingGroup?.current === close) siblingGroup.current = null\n open.value = false\n}\n\nprovide('m-menu-close', close)\nprovide('m-menu-nav', { mode: props.submenuMode, push: pushNav })\ndefineExpose({ close, open })\n\nfunction onOutsideClick(e: MouseEvent) {\n const t = e.target as Node\n if (triggerEl.value?.contains(t)) return\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\nfunction onScroll(e: Event) {\n if (!open.value) return\n if (dropdownEl.value?.contains(e.target as Node)) return\n close()\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n if (navStack.value.length) popNav()\n else close()\n return\n }\n if (!open.value) return\n if (e.key === 'ArrowDown') { e.preventDefault(); moveFocus(1) }\n else if (e.key === 'ArrowUp') { e.preventDefault(); moveFocus(-1) }\n}\n\nonMounted(() => {\n document.addEventListener('mousedown', onOutsideClick)\n document.addEventListener('keydown', onKeydown)\n window.addEventListener('scroll', onScroll, true)\n})\n\nonUnmounted(() => {\n document.removeEventListener('mousedown', onOutsideClick)\n document.removeEventListener('keydown', onKeydown)\n window.removeEventListener('scroll', onScroll, true)\n cancelActive?.()\n})\n\nconst origin = computed(() =>\n props.align === 'right' ? 'top right' : 'top left',\n)\n</script>\n\n<template>\n <div ref=\"triggerEl\" class=\"inline-block\" @click=\"toggle\">\n <slot name=\"trigger\" :open=\"open\" />\n </div>\n\n <Teleport to=\"body\">\n <Transition :css=\"false\" @enter=\"panelEnter\" @leave=\"panelLeave\">\n <div\n v-if=\"open\"\n ref=\"dropdownEl\"\n class=\"fixed z-500 min-w-48\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'shadow-elevation-2',\n ]\"\n :style=\"{ ...dropStyle, transformOrigin: origin }\"\n >\n <!-- overflow-hidden (for the rounded-corner clip and to clip the push\n submenu's slide) lives on this inner wrapper, never together with\n shadow-elevation-2 on the same box — overflow-hidden clips an\n element's own box-shadow too, so the two have to be on separate\n elements or the shadow gets cut off -->\n <div\n class=\"overflow-hidden\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'bg-surface-container',\n ]\"\n >\n <div class=\"relative overflow-y-auto py-1\" :style=\"{ maxHeight: dropStyle.maxHeight }\">\n <Transition :css=\"false\" @enter=\"navSlideEnter\" @leave=\"navSlideLeave\">\n <div v-if=\"currentNav\" :key=\"navStack.length\">\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-3 border-b border-outline-variant px-4 py-2.5 text-left text-body-large text-on-surface outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n @click=\"popNav\"\n >\n <MIcon name=\"chevron_left\" :size=\"20\" class=\"shrink-0 text-on-surface-variant\" />\n <MIcon v-if=\"currentNav.icon\" :name=\"currentNav.icon\" :size=\"20\" class=\"shrink-0 text-on-surface-variant\" />\n <span class=\"flex-1 truncate\"><component :is=\"() => currentNav?.header?.()\" /></span>\n </button>\n <component :is=\"() => currentNav?.content?.()\" />\n </div>\n <div v-else key=\"root\">\n <div v-if=\"isGrouped\" class=\"flex flex-col gap-1 px-1.5\">\n <div v-for=\"(group, i) in groups\" :key=\"i\" class=\"rounded-lg shadow-elevation-2\">\n <div class=\"overflow-hidden rounded-lg bg-surface-container\">\n <component :is=\"() => group\" />\n </div>\n </div>\n </div>\n <slot v-else :close=\"close\" />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, inject, ref, useSlots } from 'vue'\nimport MIcon from './MIcon.vue'\n\nconst props = withDefaults(defineProps<{\n icon?: string\n shortcut?: string\n to?: string | Record<string, any>\n disabled?: boolean\n danger?: boolean\n /** Keep the menu open after this item is clicked (e.g. checkable/toggle items). */\n keepOpen?: boolean\n}>(), {\n disabled: false,\n danger: false,\n keepOpen: false,\n})\n\nconst emit = defineEmits<{ click: [] }>()\n\nconst slots = useSlots()\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\nconst hasChildren = computed(() => !!slots.children)\nconst menuClose = inject<(() => void) | null>('m-menu-close', null)\nconst nav = inject<{\n mode: 'flyout' | 'push'\n push: (entry: { icon?: string, header?: () => any, content?: () => any }) => void\n} | null>('m-menu-nav', null)\n\nconst itemEl = ref<HTMLElement>()\nconst showSub = ref(false)\nconst subStyle = ref<Record<string, string>>({})\n\nfunction positionSub() {\n if (!itemEl.value) return\n const rect = itemEl.value.getBoundingClientRect()\n const right = rect.right + 200 > window.innerWidth\n subStyle.value = {\n position: 'fixed',\n top: `${rect.top}px`,\n ...(right\n ? { right: `${window.innerWidth - rect.left}px` }\n : { left: `${rect.right}px` }),\n zIndex: '501',\n }\n}\n\nfunction toggleSub() {\n if (showSub.value) {\n showSub.value = false\n return\n }\n positionSub()\n showSub.value = true\n}\n\nfunction handleClick() {\n if (props.disabled) return\n\n if (hasChildren.value) {\n if (nav?.mode === 'push') {\n nav.push({ icon: props.icon, header: slots.default, content: slots.children })\n } else {\n toggleSub()\n }\n return\n }\n\n emit('click')\n if (!props.keepOpen) menuClose?.()\n}\n\n// Desktop hover convenience for the flyout variant — ignored on touch/pen so a\n// tap doesn't fire a spurious pointerleave (relatedTarget is null on touch)\n// and close the submenu before its click event can land.\nfunction onPointerEnter(e: PointerEvent) {\n if (e.pointerType !== 'mouse' || !hasChildren.value || props.disabled) return\n positionSub()\n showSub.value = true\n}\n\nfunction onPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu')) return\n showSub.value = false\n}\n\nfunction onSubPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu') || itemEl.value?.contains(related as Node)) return\n showSub.value = false\n}\n</script>\n\n<template>\n <div\n ref=\"itemEl\"\n @pointerenter=\"onPointerEnter\"\n @pointerleave=\"onPointerLeave\"\n >\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n class=\"flex w-full items-center gap-3 px-4 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n :class=\"[\n disabled ? 'cursor-not-allowed opacity-[0.38] text-on-surface' : 'cursor-pointer',\n !disabled && danger ? 'text-error hover:bg-error/8' : '',\n !disabled && !danger ? 'text-on-surface hover:bg-on-surface/8' : '',\n ]\"\n :disabled=\"disabled || undefined\"\n :aria-haspopup=\"hasChildren ? 'menu' : undefined\"\n :aria-expanded=\"hasChildren ? showSub : undefined\"\n @click=\"handleClick\"\n >\n <MIcon v-if=\"icon\" :name=\"icon\" :size=\"20\" class=\"shrink-0\" :class=\"danger ? 'text-error' : 'text-on-surface-variant'\" />\n <span class=\"flex-1\"><slot /></span>\n <span v-if=\"shortcut && !hasChildren\" class=\"ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60\">{{ shortcut }}</span>\n <MIcon v-if=\"hasChildren\" name=\"chevron_right\" :size=\"18\" class=\"shrink-0 text-on-surface-variant\" />\n </component>\n\n <!-- Submenu (flyout variant only — \"push\" mode is rendered by the root MMenu/MContextMenu panel) -->\n <Teleport v-if=\"hasChildren && nav?.mode !== 'push'\" to=\"body\">\n <Transition\n enter-active-class=\"transition-opacity duration-100\"\n enter-from-class=\"opacity-0\"\n leave-active-class=\"transition-opacity duration-75\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"showSub\"\n class=\"m3-submenu min-w-44 rounded-xs shadow-elevation-2\"\n :style=\"subStyle\"\n @pointerleave=\"onSubPointerLeave\"\n >\n <!-- overflow-hidden lives here, separate from shadow-elevation-2 above —\n overflow-hidden clips an element's own box-shadow too -->\n <div class=\"overflow-hidden rounded-xs bg-surface-container py-1\">\n <slot name=\"children\" />\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, inject, ref, useSlots } from 'vue'\nimport MIcon from './MIcon.vue'\n\nconst props = withDefaults(defineProps<{\n icon?: string\n shortcut?: string\n to?: string | Record<string, any>\n disabled?: boolean\n danger?: boolean\n /** Keep the menu open after this item is clicked (e.g. checkable/toggle items). */\n keepOpen?: boolean\n}>(), {\n disabled: false,\n danger: false,\n keepOpen: false,\n})\n\nconst emit = defineEmits<{ click: [] }>()\n\nconst slots = useSlots()\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\nconst hasChildren = computed(() => !!slots.children)\nconst menuClose = inject<(() => void) | null>('m-menu-close', null)\nconst nav = inject<{\n mode: 'flyout' | 'push'\n push: (entry: { icon?: string, header?: () => any, content?: () => any }) => void\n} | null>('m-menu-nav', null)\n\nconst itemEl = ref<HTMLElement>()\nconst showSub = ref(false)\nconst subStyle = ref<Record<string, string>>({})\n\nfunction positionSub() {\n if (!itemEl.value) return\n const rect = itemEl.value.getBoundingClientRect()\n const right = rect.right + 200 > window.innerWidth\n subStyle.value = {\n position: 'fixed',\n top: `${rect.top}px`,\n ...(right\n ? { right: `${window.innerWidth - rect.left}px` }\n : { left: `${rect.right}px` }),\n zIndex: '501',\n }\n}\n\nfunction toggleSub() {\n if (showSub.value) {\n showSub.value = false\n return\n }\n positionSub()\n showSub.value = true\n}\n\nfunction handleClick() {\n if (props.disabled) return\n\n if (hasChildren.value) {\n if (nav?.mode === 'push') {\n nav.push({ icon: props.icon, header: slots.default, content: slots.children })\n } else {\n toggleSub()\n }\n return\n }\n\n emit('click')\n if (!props.keepOpen) menuClose?.()\n}\n\n// Desktop hover convenience for the flyout variant — ignored on touch/pen so a\n// tap doesn't fire a spurious pointerleave (relatedTarget is null on touch)\n// and close the submenu before its click event can land.\nfunction onPointerEnter(e: PointerEvent) {\n if (e.pointerType !== 'mouse' || !hasChildren.value || props.disabled) return\n positionSub()\n showSub.value = true\n}\n\nfunction onPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu')) return\n showSub.value = false\n}\n\nfunction onSubPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu') || itemEl.value?.contains(related as Node)) return\n showSub.value = false\n}\n</script>\n\n<template>\n <div\n ref=\"itemEl\"\n @pointerenter=\"onPointerEnter\"\n @pointerleave=\"onPointerLeave\"\n >\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n class=\"flex w-full items-center gap-3 px-4 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n :class=\"[\n disabled ? 'cursor-not-allowed opacity-[0.38] text-on-surface' : 'cursor-pointer',\n !disabled && danger ? 'text-error hover:bg-error/8' : '',\n !disabled && !danger ? 'text-on-surface hover:bg-on-surface/8' : '',\n ]\"\n :disabled=\"disabled || undefined\"\n :aria-haspopup=\"hasChildren ? 'menu' : undefined\"\n :aria-expanded=\"hasChildren ? showSub : undefined\"\n @click=\"handleClick\"\n >\n <MIcon v-if=\"icon\" :name=\"icon\" :size=\"20\" class=\"shrink-0\" :class=\"danger ? 'text-error' : 'text-on-surface-variant'\" />\n <span class=\"flex-1\"><slot /></span>\n <span v-if=\"shortcut && !hasChildren\" class=\"ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60\">{{ shortcut }}</span>\n <MIcon v-if=\"hasChildren\" name=\"chevron_right\" :size=\"18\" class=\"shrink-0 text-on-surface-variant\" />\n </component>\n\n <!-- Submenu (flyout variant only — \"push\" mode is rendered by the root MMenu/MContextMenu panel) -->\n <Teleport v-if=\"hasChildren && nav?.mode !== 'push'\" to=\"body\">\n <Transition\n enter-active-class=\"transition-opacity duration-100\"\n enter-from-class=\"opacity-0\"\n leave-active-class=\"transition-opacity duration-75\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"showSub\"\n class=\"m3-submenu min-w-44 rounded-xs shadow-elevation-2\"\n :style=\"subStyle\"\n @pointerleave=\"onSubPointerLeave\"\n >\n <!-- overflow-hidden lives here, separate from shadow-elevation-2 above —\n overflow-hidden clips an element's own box-shadow too -->\n <div class=\"overflow-hidden rounded-xs bg-surface-container py-1\">\n <slot name=\"children\" />\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;mCAeM,IAAS,GACT,KAAQ;;;;;;;;;;;EAZd,IAAM,IAAQ,GASR,IAAS,EAAU,GAOnB,IAAI,SAAgB,EA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AA,CAAA,KAAA,EAAA,IAAA,EAAA;IAC9G,EAAA,SAAb,EAAA,GAAA,EAAqG,GAAA;;KAA3E,MAAK;KAAiB,MAAM;KAAI,OAAM;;;;;;;;;;;EAIlD,CAAA,IAAA,EAAA,SAAe,EAAA,CAAA,CAAG,EAAE,SAAI,UAAxC,EAAA,GAAA,EAoBW,GAAA;;GApB0C,IAAG;EACtD,GAAA,CAAA,EAkBa,GAAA;GAjBX,sBAAmB;GACnB,oBAAiB;GACjB,sBAAmB;GACnB,kBAAe;;GAEf,SAAA,QAWM,CAVE,EAAA,SADR,EAAA,GAAA,EAWM,OAAA;;IATJ,OAAM;IACL,OAAK,EAAE,EAAA,KAAQ;IACf,gBAAc;GAIf,GAAA,CAAA,EAEM,OAFN,IAEM,CADJ,EAAwB,EAAA,QAAA,UAAA,CAAA,CAAA,CAAA,GAAA,EAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"MMenuItem-DiilFeDO.js","names":["$slots","$slots"],"sources":["../src/components/MSpinner.vue","../src/components/MSpinner.vue","../src/composables/useFieldBg.ts","../src/composables/useDebounce.ts","../src/components/MIconButton.vue","../src/components/MIconButton.vue","../src/components/MButton.vue","../src/components/MButton.vue","../src/components/MDialog.vue","../src/components/MDialog.vue","../src/components/MMenuDivider.vue","../src/components/MMenuDivider.vue","../src/components/MTextField.vue","../src/components/MTextField.vue","../src/components/MMenu.vue","../src/components/MMenu.vue","../src/components/MMenuItem.vue","../src/components/MMenuItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useLocale } from '../composables/useLocale';\n\nconst props = withDefaults(\n defineProps<{\n size?: number;\n wavy?: boolean;\n label?: string;\n }>(),\n { size: 20, wavy: false },\n);\n\nconst locale = useLocale();\n\nconst STROKE = 3;\nconst BUMPS = 9;\n\n// amp fraction of r = 0.25 → max radius = r * 1.25\n// Constrain so that max_r + STROKE/2 ≤ size/2 - 1 (1px margin from edge)\nconst r = computed(() => (props.size / 2 - 1 - STROKE / 2) / 1.25);\nconst cx = computed(() => props.size / 2);\n\n// Build the full bumpy-circle path and its total length.\nconst wavyData = computed(() => {\n const CX = cx.value;\n const R = r.value;\n const amp = R * 0.08;\n const segs = BUMPS * 24; // smooth curve\n\n const pts: string[] = [];\n let len = 0;\n let px = 0,\n py = 0;\n\n for (let i = 0; i <= segs; i++) {\n const theta = (2 * Math.PI * i) / segs - Math.PI / 2;\n const rr = R + amp * Math.sin(BUMPS * theta);\n const x = CX + rr * Math.cos(theta);\n const y = CX + rr * Math.sin(theta);\n if (i > 0) len += Math.sqrt((x - px) ** 2 + (y - py) ** 2);\n pts.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(2)},${y.toFixed(2)}`);\n px = x;\n py = y;\n }\n\n // Visible arc ~58% of the circumference, gap fills the rest.\n const visible = len * 0.58;\n const gap = len - visible;\n const dash = `${visible.toFixed(1)} ${gap.toFixed(1)}`;\n\n // The wave \"travels\" by shifting dashoffset over exactly one full length,\n // so the crests slide around the path independently of the rotation.\n return { path: pts.join(\"\") + \"Z\", dash, len: len.toFixed(1) };\n});\n</script>\n\n<template>\n <span\n class=\"inline-flex shrink-0 items-center justify-center\"\n :style=\"{ width: `${size}px`, height: `${size}px` }\"\n role=\"status\"\n :aria-label=\"label ?? locale.loading\"\n >\n <!-- Standard circular spinner -->\n <span\n v-if=\"!wavy\"\n class=\"block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n\n <!-- Wavy spinner (M3 Expressive): the whole shape rotates AND the wave\n travels along the stroke via dashoffset, giving the snake-like flow. -->\n <svg\n v-else\n :width=\"size\"\n :height=\"size\"\n :viewBox=\"`0 0 ${size} ${size}`\"\n fill=\"none\"\n class=\"animate-[m3-wavy-spin_2.8s_linear_infinite]\"\n :style=\"`transform-origin: ${cx}px ${cx}px`\"\n >\n <path\n :d=\"wavyData.path\"\n stroke=\"currentColor\"\n :stroke-width=\"STROKE\"\n stroke-linecap=\"round\"\n :stroke-dasharray=\"wavyData.dash\"\n class=\"animate-[m3-wavy-travel_2s_linear_infinite]\"\n :style=\"{ '--m3-wave-len': wavyData.len }\"\n />\n </svg>\n </span>\n</template>\n\n<style>\n/* The SVG element rotates the whole bumpy circle. */\n@keyframes m3-wavy-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* The stroke's dashoffset slides by one full path length, so the crests\n appear to crawl along the circle — the \"snake\" motion of M3 Expressive.\n Negative direction makes the wave travel forward relative to the spin. */\n@keyframes m3-wavy-travel {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: calc(var(--m3-wave-len) * -1px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animate-\\[m3-wavy-spin_2\\.8s_linear_infinite\\] {\n animation: m3-wavy-spin 2.8s linear infinite;\n }\n .animate-\\[m3-wavy-travel_2s_linear_infinite\\] {\n animation: none !important;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useLocale } from '../composables/useLocale';\n\nconst props = withDefaults(\n defineProps<{\n size?: number;\n wavy?: boolean;\n label?: string;\n }>(),\n { size: 20, wavy: false },\n);\n\nconst locale = useLocale();\n\nconst STROKE = 3;\nconst BUMPS = 9;\n\n// amp fraction of r = 0.25 → max radius = r * 1.25\n// Constrain so that max_r + STROKE/2 ≤ size/2 - 1 (1px margin from edge)\nconst r = computed(() => (props.size / 2 - 1 - STROKE / 2) / 1.25);\nconst cx = computed(() => props.size / 2);\n\n// Build the full bumpy-circle path and its total length.\nconst wavyData = computed(() => {\n const CX = cx.value;\n const R = r.value;\n const amp = R * 0.08;\n const segs = BUMPS * 24; // smooth curve\n\n const pts: string[] = [];\n let len = 0;\n let px = 0,\n py = 0;\n\n for (let i = 0; i <= segs; i++) {\n const theta = (2 * Math.PI * i) / segs - Math.PI / 2;\n const rr = R + amp * Math.sin(BUMPS * theta);\n const x = CX + rr * Math.cos(theta);\n const y = CX + rr * Math.sin(theta);\n if (i > 0) len += Math.sqrt((x - px) ** 2 + (y - py) ** 2);\n pts.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(2)},${y.toFixed(2)}`);\n px = x;\n py = y;\n }\n\n // Visible arc ~58% of the circumference, gap fills the rest.\n const visible = len * 0.58;\n const gap = len - visible;\n const dash = `${visible.toFixed(1)} ${gap.toFixed(1)}`;\n\n // The wave \"travels\" by shifting dashoffset over exactly one full length,\n // so the crests slide around the path independently of the rotation.\n return { path: pts.join(\"\") + \"Z\", dash, len: len.toFixed(1) };\n});\n</script>\n\n<template>\n <span\n class=\"inline-flex shrink-0 items-center justify-center\"\n :style=\"{ width: `${size}px`, height: `${size}px` }\"\n role=\"status\"\n :aria-label=\"label ?? locale.loading\"\n >\n <!-- Standard circular spinner -->\n <span\n v-if=\"!wavy\"\n class=\"block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n\n <!-- Wavy spinner (M3 Expressive): the whole shape rotates AND the wave\n travels along the stroke via dashoffset, giving the snake-like flow. -->\n <svg\n v-else\n :width=\"size\"\n :height=\"size\"\n :viewBox=\"`0 0 ${size} ${size}`\"\n fill=\"none\"\n class=\"animate-[m3-wavy-spin_2.8s_linear_infinite]\"\n :style=\"`transform-origin: ${cx}px ${cx}px`\"\n >\n <path\n :d=\"wavyData.path\"\n stroke=\"currentColor\"\n :stroke-width=\"STROKE\"\n stroke-linecap=\"round\"\n :stroke-dasharray=\"wavyData.dash\"\n class=\"animate-[m3-wavy-travel_2s_linear_infinite]\"\n :style=\"{ '--m3-wave-len': wavyData.len }\"\n />\n </svg>\n </span>\n</template>\n\n<style>\n/* The SVG element rotates the whole bumpy circle. */\n@keyframes m3-wavy-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* The stroke's dashoffset slides by one full path length, so the crests\n appear to crawl along the circle — the \"snake\" motion of M3 Expressive.\n Negative direction makes the wave travel forward relative to the spin. */\n@keyframes m3-wavy-travel {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: calc(var(--m3-wave-len) * -1px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animate-\\[m3-wavy-spin_2\\.8s_linear_infinite\\] {\n animation: m3-wavy-spin 2.8s linear infinite;\n }\n .animate-\\[m3-wavy-travel_2s_linear_infinite\\] {\n animation: none !important;\n }\n}\n</style>\n","import { ref, computed, onMounted, onBeforeUnmount, type Ref } from 'vue'\n\nconst M3_BG_CLASSES = [\n 'bg-surface-container-highest',\n 'bg-surface-container-high',\n 'bg-surface-container-low',\n 'bg-surface-container-lowest',\n 'bg-surface-container',\n 'bg-surface-variant',\n 'bg-surface-bright',\n 'bg-surface-dim',\n 'bg-surface',\n 'bg-background',\n 'bg-inverse-surface',\n 'bg-primary-container',\n 'bg-secondary-container',\n 'bg-tertiary-container',\n 'bg-error-container',\n 'bg-primary',\n 'bg-secondary',\n 'bg-tertiary',\n 'bg-error',\n] as const\n\nfunction findM3BgVar(el: HTMLElement): string | null {\n for (const cls of M3_BG_CLASSES) {\n if (el.classList.contains(cls)) return `var(--color-${cls.slice(3)})`\n }\n return null\n}\n\nfunction isTransparent(color: string): boolean {\n if (!color || color === 'transparent') return true\n const m = color.match(/^rgba?\\(([^)]+)\\)$/)\n if (m) {\n const parts = m[1]!.split(',').map((s) => s.trim())\n if (parts.length === 4 && parseFloat(parts[3]!) === 0) return true\n }\n return false\n}\n\n/**\n * Auto-detects the background behind `containerEl` and exposes it as `--field-bg`.\n * Prefers a CSS variable reference (e.g. var(--color-surface-container-low)) over a\n * raw computed color so the outlined label cutout transitions in sync with the rest\n * of the theme switch instead of lagging behind.\n *\n * @param containerEl The element that receives `--field-bg` as an inline style.\n * @param fieldBgProp Getter for the explicit `fieldBg` prop (overrides auto-detect).\n */\nexport function useFieldBg(\n containerEl: Ref<HTMLElement | null>,\n fieldBgProp: () => string | undefined,\n) {\n const detectedBg = ref<string>('var(--color-surface)')\n\n function applyFieldBg(value: string) {\n detectedBg.value = value\n containerEl.value?.style.setProperty('--field-bg', fieldBgProp() ?? value)\n }\n\n function resolveBg() {\n let el: HTMLElement | null = containerEl.value?.parentElement ?? null\n while (el) {\n const cssVar = findM3BgVar(el)\n if (cssVar) { applyFieldBg(cssVar); return }\n if (el === document.body) { applyFieldBg('var(--color-surface)'); return }\n const bg = getComputedStyle(el).backgroundColor\n if (!isTransparent(bg)) { applyFieldBg(bg); return }\n el = el.parentElement\n }\n applyFieldBg('var(--color-surface)')\n }\n\n let observer: MutationObserver | null = null\n\n onMounted(() => {\n resolveBg()\n observer = new MutationObserver(() => resolveBg())\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class', 'style', 'data-theme'],\n })\n })\n\n onBeforeUnmount(() => observer?.disconnect())\n\n const resolvedFieldBg = computed(() => fieldBgProp() ?? detectedBg.value)\n\n return { resolvedFieldBg }\n}\n","import { onBeforeUnmount } from 'vue'\n\nexport function useDebounce(fn: (...args: any[]) => void, ms: number) {\n let timer: ReturnType<typeof setTimeout> | null = null\n\n function debounced(...args: any[]) {\n if (timer) clearTimeout(timer)\n timer = setTimeout(() => {\n timer = null\n fn(...args)\n }, ms)\n }\n\n function cancel() {\n if (timer) {\n clearTimeout(timer)\n timer = null\n }\n }\n\n onBeforeUnmount(cancel)\n\n return { debounced, cancel }\n}\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport MIcon from './MIcon.vue'\n\nconst props = withDefaults(\n defineProps<{\n icon: string\n label?: string\n variant?: 'standard' | 'filled' | 'tonal' | 'outlined'\n shape?: 'rounded' | 'squared'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n disabled?: boolean\n to?: string | Record<string, any>\n }>(),\n {\n variant: 'standard',\n shape: 'rounded',\n size: 'sm',\n disabled: false,\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\n// Container height/width (icon buttons are always square by default — real\n// `IconButtonDefaults.<tier>ContainerSize()` also has Narrow/Wide width options not\n// implemented here, matching the existing scope of MButton's size tiers) and icon size\n// per M3's 5-tier `{XSmall,Small,Medium,Large,XLarge}IconButtonTokens.kt`. `squareRadius`\n// matches each tier's own `ContainerShapeSquare` (12px xs/sm, 16px md, 28px lg/xl) — same\n// pattern as MButton's size tiers.\nconst sizeMap = {\n xs: { px: 32, icon: 20, squareRadius: 'rounded-md' },\n sm: { px: 40, icon: 24, squareRadius: 'rounded-md' },\n md: { px: 56, icon: 24, squareRadius: 'rounded-lg' },\n lg: { px: 96, icon: 32, squareRadius: 'rounded-xl' },\n xl: { px: 136, icon: 40, squareRadius: 'rounded-xl' },\n}\n\nconst resolved = computed(() => {\n if (typeof props.size === 'number') return { px: props.size, icon: Math.round(props.size * 0.55), squareRadius: 'rounded-md' }\n return sizeMap[props.size] ?? sizeMap.sm\n})\n\n/*\n * State layer via a `before:` overlay (same technique MButton uses) rather than a direct\n * `hover:bg-*`/`active:bg-*` utility: a solid `bg-primary`/`bg-secondary-container`\n * container can't also swap to a translucent hover background without just replacing the\n * color outright, so hover/press need a separate semi-transparent layer painted on top,\n * tinted with the button's own content color (`before:bg-current`) — matches real M3's\n * per-variant Hovered/PressedColor tokens, which are all just the content color at a fixed\n * opacity (8%/12%), the same universal state-layer pattern across every variant.\n */\nconst base =\n 'relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled container opacity is 10% on-surface (DisabledContainerOpacity, Filled/Tonal\n// only — Outlined has no container). Outlined's border needs no separate disabled class:\n// it's `border-current` (see `variantClasses`), so it dims automatically along with the\n// `disabled:text-on-surface/38` in `base` above, exactly like the real `outlinedIconButtonBorder`\n// (which literally reuses `LocalContentColor` at the same disabled opacity as the icon).\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n return 'disabled:bg-on-surface/10'\n default:\n return ''\n }\n})\n\nconst shapeClass = computed(() => props.shape === 'squared' ? resolved.value.squareRadius : 'rounded-full')\n\nfunction createRipple(event: PointerEvent) {\n if (props.disabled) return\n const button = event.currentTarget as HTMLElement\n const rect = button.getBoundingClientRect()\n const d = Math.max(rect.width, rect.height) * 2\n const el = document.createElement('span')\n el.className = 'm3-ripple'\n el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`\n button.appendChild(el)\n el.addEventListener('animationend', () => el.remove(), { once: true })\n}\n\nconst variantClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n // Real IconButton.kt has no elevation tokens at all for any variant — flat, unlike Button\n return 'bg-primary text-on-primary'\n case 'tonal':\n return 'bg-secondary-container text-on-secondary-container'\n case 'outlined':\n // OutlinedIconButtonTokens' default (non-\"vibrant\") border tracks LocalContentColor,\n // i.e. the same on-surface-variant used for the icon itself — not a fixed outline token\n return 'border border-current text-on-surface-variant'\n default:\n return 'text-on-surface-variant'\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n :aria-label=\"label || undefined\"\n :disabled=\"disabled\"\n :class=\"[base, shapeClass, variantClasses, disabledContainerClasses]\"\n :style=\"{ width: `${resolved.px}px`, height: `${resolved.px}px` }\"\n @pointerdown=\"createRipple\"\n >\n <MIcon :name=\"icon\" :size=\"resolved.icon\" />\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport MIcon from './MIcon.vue'\n\nconst props = withDefaults(\n defineProps<{\n icon: string\n label?: string\n variant?: 'standard' | 'filled' | 'tonal' | 'outlined'\n shape?: 'rounded' | 'squared'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n disabled?: boolean\n to?: string | Record<string, any>\n }>(),\n {\n variant: 'standard',\n shape: 'rounded',\n size: 'sm',\n disabled: false,\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\n// Container height/width (icon buttons are always square by default — real\n// `IconButtonDefaults.<tier>ContainerSize()` also has Narrow/Wide width options not\n// implemented here, matching the existing scope of MButton's size tiers) and icon size\n// per M3's 5-tier `{XSmall,Small,Medium,Large,XLarge}IconButtonTokens.kt`. `squareRadius`\n// matches each tier's own `ContainerShapeSquare` (12px xs/sm, 16px md, 28px lg/xl) — same\n// pattern as MButton's size tiers.\nconst sizeMap = {\n xs: { px: 32, icon: 20, squareRadius: 'rounded-md' },\n sm: { px: 40, icon: 24, squareRadius: 'rounded-md' },\n md: { px: 56, icon: 24, squareRadius: 'rounded-lg' },\n lg: { px: 96, icon: 32, squareRadius: 'rounded-xl' },\n xl: { px: 136, icon: 40, squareRadius: 'rounded-xl' },\n}\n\nconst resolved = computed(() => {\n if (typeof props.size === 'number') return { px: props.size, icon: Math.round(props.size * 0.55), squareRadius: 'rounded-md' }\n return sizeMap[props.size] ?? sizeMap.sm\n})\n\n/*\n * State layer via a `before:` overlay (same technique MButton uses) rather than a direct\n * `hover:bg-*`/`active:bg-*` utility: a solid `bg-primary`/`bg-secondary-container`\n * container can't also swap to a translucent hover background without just replacing the\n * color outright, so hover/press need a separate semi-transparent layer painted on top,\n * tinted with the button's own content color (`before:bg-current`) — matches real M3's\n * per-variant Hovered/PressedColor tokens, which are all just the content color at a fixed\n * opacity (8%/12%), the same universal state-layer pattern across every variant.\n */\nconst base =\n 'relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled container opacity is 10% on-surface (DisabledContainerOpacity, Filled/Tonal\n// only — Outlined has no container). Outlined's border needs no separate disabled class:\n// it's `border-current` (see `variantClasses`), so it dims automatically along with the\n// `disabled:text-on-surface/38` in `base` above, exactly like the real `outlinedIconButtonBorder`\n// (which literally reuses `LocalContentColor` at the same disabled opacity as the icon).\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n return 'disabled:bg-on-surface/10'\n default:\n return ''\n }\n})\n\nconst shapeClass = computed(() => props.shape === 'squared' ? resolved.value.squareRadius : 'rounded-full')\n\nfunction createRipple(event: PointerEvent) {\n if (props.disabled) return\n const button = event.currentTarget as HTMLElement\n const rect = button.getBoundingClientRect()\n const d = Math.max(rect.width, rect.height) * 2\n const el = document.createElement('span')\n el.className = 'm3-ripple'\n el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`\n button.appendChild(el)\n el.addEventListener('animationend', () => el.remove(), { once: true })\n}\n\nconst variantClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n // Real IconButton.kt has no elevation tokens at all for any variant — flat, unlike Button\n return 'bg-primary text-on-primary'\n case 'tonal':\n return 'bg-secondary-container text-on-secondary-container'\n case 'outlined':\n // OutlinedIconButtonTokens' default (non-\"vibrant\") border tracks LocalContentColor,\n // i.e. the same on-surface-variant used for the icon itself — not a fixed outline token\n return 'border border-current text-on-surface-variant'\n default:\n return 'text-on-surface-variant'\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n :aria-label=\"label || undefined\"\n :disabled=\"disabled\"\n :class=\"[base, shapeClass, variantClasses, disabledContainerClasses]\"\n :style=\"{ width: `${resolved.px}px`, height: `${resolved.px}px` }\"\n @pointerdown=\"createRipple\"\n >\n <MIcon :name=\"icon\" :size=\"resolved.icon\" />\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n type?: 'button' | 'submit' | 'reset'\n disabled?: boolean\n loading?: boolean\n icon?: string\n /**\n * Which side of the label `icon` renders on. Real M3 buttons support both via\n * `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n * either way at every tier, so this only changes render order, not spacing.\n */\n iconPos?: 'leading' | 'trailing'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n shape?: 'rounded' | 'squared'\n to?: string | Record<string, any>\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n\nfunction createRipple(event: PointerEvent) {\n if (props.disabled || props.loading) return\n const button = event.currentTarget as HTMLElement\n const rect = button.getBoundingClientRect()\n const d = Math.max(rect.width, rect.height) * 2\n const el = document.createElement('span')\n el.className = 'm3-ripple'\n el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`\n button.appendChild(el)\n el.addEventListener('animationend', () => el.remove(), { once: true })\n}\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"customStyle\"\n @pointerdown=\"createRipple\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" />\n </template>\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n type?: 'button' | 'submit' | 'reset'\n disabled?: boolean\n loading?: boolean\n icon?: string\n /**\n * Which side of the label `icon` renders on. Real M3 buttons support both via\n * `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n * either way at every tier, so this only changes render order, not spacing.\n */\n iconPos?: 'leading' | 'trailing'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n shape?: 'rounded' | 'squared'\n to?: string | Record<string, any>\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n\nfunction createRipple(event: PointerEvent) {\n if (props.disabled || props.loading) return\n const button = event.currentTarget as HTMLElement\n const rect = button.getBoundingClientRect()\n const d = Math.max(rect.width, rect.height) * 2\n const el = document.createElement('span')\n el.className = 'm3-ripple'\n el.style.cssText = `width:${d}px;height:${d}px;top:${event.clientY - rect.top - d / 2}px;left:${event.clientX - rect.left - d / 2}px`\n button.appendChild(el)\n el.addEventListener('animationend', () => el.remove(), { once: true })\n}\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"customStyle\"\n @pointerdown=\"createRipple\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" />\n </template>\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { nextTick, onUnmounted, ref, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: boolean\n title?: string\n maxWidth?: string\n /**\n * M3's `AlertDialogDefaults` has no max-height token at all (only `DialogMaxWidth`) — the\n * default here is a library-chosen viewport-relative cap, not a spec value.\n */\n maxHeight?: string\n persistent?: boolean\n fullscreen?: boolean\n closeLabel?: string\n /**\n * Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n * button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n * deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n * this component's existing behavior) rather than added unconditionally.\n */\n closable?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n },\n)\n\nconst locale = useLocale()\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') close()\n}\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nwatch(\n () => props.modelValue,\n async (open) => {\n if (open) {\n document.addEventListener('keydown', onKeydown)\n document.body.style.overflow = 'hidden'\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n document.removeEventListener('keydown', onKeydown)\n document.body.style.overflow = ''\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n)\n\nonUnmounted(() => {\n document.removeEventListener('keydown', onKeydown)\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\">\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n class=\"dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3\"\n :class=\"[maxWidth, maxHeight]\"\n >\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\">\n <div\n v-if=\"modelValue\"\n class=\"dialog-fs fixed inset-0 z-50 flex flex-col bg-surface\"\n >\n <div class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { nextTick, onUnmounted, ref, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: boolean\n title?: string\n maxWidth?: string\n /**\n * M3's `AlertDialogDefaults` has no max-height token at all (only `DialogMaxWidth`) — the\n * default here is a library-chosen viewport-relative cap, not a spec value.\n */\n maxHeight?: string\n persistent?: boolean\n fullscreen?: boolean\n closeLabel?: string\n /**\n * Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n * button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n * deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n * this component's existing behavior) rather than added unconditionally.\n */\n closable?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n },\n)\n\nconst locale = useLocale()\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') close()\n}\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nwatch(\n () => props.modelValue,\n async (open) => {\n if (open) {\n document.addEventListener('keydown', onKeydown)\n document.body.style.overflow = 'hidden'\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n document.removeEventListener('keydown', onKeydown)\n document.body.style.overflow = ''\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n)\n\nonUnmounted(() => {\n document.removeEventListener('keydown', onKeydown)\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\">\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n class=\"dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3\"\n :class=\"[maxWidth, maxHeight]\"\n >\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\">\n <div\n v-if=\"modelValue\"\n class=\"dialog-fs fixed inset-0 z-50 flex flex-col bg-surface\"\n >\n <div class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\nwithDefaults(\n defineProps<{\n /**\n * Marks this as a group boundary for `MMenu`/`MContextMenu`'s\n * `variant=\"expressive\"` — instead of rendering this divider in place,\n * the parent menu splits its panel into two independently-rounded group\n * boxes with a small gap between them. Has no effect outside an\n * `expressive` menu, where it renders as a normal divider line.\n */\n gap?: boolean\n }>(),\n { gap: false },\n)\n</script>\n\n<template>\n <hr class=\"my-1 border-outline-variant\" />\n</template>\n","<script setup lang=\"ts\">\nwithDefaults(\n defineProps<{\n /**\n * Marks this as a group boundary for `MMenu`/`MContextMenu`'s\n * `variant=\"expressive\"` — instead of rendering this divider in place,\n * the parent menu splits its panel into two independently-rounded group\n * boxes with a small gap between them. Has no effect outside an\n * `expressive` menu, where it renders as a normal divider line.\n */\n gap?: boolean\n }>(),\n { gap: false },\n)\n</script>\n\n<template>\n <hr class=\"my-1 border-outline-variant\" />\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, useId, useSlots } from \"vue\";\nimport MIcon from \"./MIcon.vue\";\nimport { useFieldBg } from \"../composables/useFieldBg\";\nimport { useDebounce } from \"../composables/useDebounce\";\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string | number;\n label: string;\n type?: string;\n variant?: \"filled\" | \"outlined\";\n error?: boolean;\n errorLabel?: string;\n hint?: string;\n disabled?: boolean;\n required?: boolean;\n multiline?: boolean;\n rows?: number;\n autocomplete?: string;\n leadingIcon?: string;\n clearable?: boolean;\n fieldBg?: string;\n debounce?: number;\n }>(),\n {\n type: \"text\",\n variant: \"filled\",\n rows: 3,\n clearable: false,\n debounce: 0,\n },\n);\n\nconst emit = defineEmits<{ \"update:modelValue\": [string]; debounced: [string] }>();\n\nconst id = useId();\nconst slots = useSlots();\n\nconst fieldBgEl = ref<HTMLElement | null>(null);\nconst { resolvedFieldBg } = useFieldBg(fieldBgEl, () => props.fieldBg);\n\nconst { debounced: emitDebounced, cancel: cancelDebounce } = useDebounce((v: string) => emit(\"debounced\", v), props.debounce)\n\nconst showClear = computed(() => props.clearable && String(props.modelValue).length > 0 && !props.disabled)\n\nconst inputClasses = computed(() => {\n const hasTrailing = !!slots.trailing || props.clearable;\n const pl = props.leadingIcon ? \"pl-12\" : \"pl-4\";\n const pr = hasTrailing ? \"pr-12\" : \"pr-4\";\n const size = props.multiline ? \"resize-y min-h-[56px]\" : \"h-14\";\n const base = [\n \"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent\",\n \"transition-[border-color,border-width] duration-150\",\n \"disabled:cursor-not-allowed disabled:text-on-surface/38\",\n props.error ? \"caret-error\" : \"caret-primary\",\n size,\n pl,\n pr,\n ];\n\n if (props.variant === \"outlined\") {\n return [\n ...base,\n \"rounded-xs border bg-transparent py-4\",\n props.error\n ? \"border-error focus:border-2 focus:border-error\"\n : \"border-outline hover:border-on-surface focus:border-2 focus:border-primary\",\n \"disabled:border-on-surface/12\",\n ].join(\" \");\n }\n\n return [\n ...base,\n \"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2\",\n props.error\n ? \"border-error focus:border-b-2 focus:border-error\"\n : \"border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary\",\n \"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]\",\n ].join(\" \");\n});\n\nconst labelClasses = computed(() => {\n const left = props.leadingIcon\n ? props.variant === \"outlined\"\n ? \"left-11\"\n : \"left-12\"\n : props.variant === \"outlined\"\n ? \"left-3\"\n : \"left-4\";\n\n const unfloatedTop = props.variant === 'filled' ? 'top-[53%]' : 'top-1/2'\n const base = [\n \"pointer-events-none absolute truncate transition-all duration-200\",\n left,\n \"right-4\",\n `${unfloatedTop} -translate-y-1/2 text-body-large`,\n ];\n\n if (props.variant === \"outlined\") {\n // When floated: drop right-4 (right-auto) and cap max-width so the label\n // shrinks to its own text width. The bg then only covers the glyphs + px-1,\n // cutting the border just where the text sits instead of a long strip.\n return [\n ...base,\n \"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1\",\n \"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]\",\n \"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n }\n\n // Filled: label floats to top-2 (slightly higher than before)\n return [\n ...base,\n \"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small\",\n \"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n});\n\nfunction onInput(event: Event) {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n emit(\"update:modelValue\", target.value);\n if (props.debounce > 0) emitDebounced(target.value)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1\">\n <!--\n --field-bg: background behind the floating label in outlined mode, so it\n \"cuts through\" the border. Auto-detected from the nearest opaque ancestor\n (see resolveBg); overridable via the fieldBg prop; falls back to surface.\n -->\n <div\n ref=\"fieldBgEl\"\n class=\"relative\"\n :class=\"variant === 'outlined' ? 'mt-2' : ''\"\n :style=\"variant === 'outlined' ? { '--field-bg': resolvedFieldBg } : undefined\"\n >\n <div\n v-if=\"leadingIcon\"\n class=\"pointer-events-none absolute left-3.5\"\n :class=\"[\n multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-4.5' : 'top-4',\n disabled ? 'text-on-surface/38' : 'text-on-surface-variant',\n ]\"\n >\n <MIcon :name=\"leadingIcon\" :size=\"24\" />\n </div>\n\n <textarea\n v-if=\"multiline\"\n :id=\"id\"\n :value=\"String(modelValue)\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :required=\"required\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n <input\n v-else\n :id=\"id\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :required=\"required\"\n :autocomplete=\"autocomplete\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n\n <label :for=\"id\" :class=\"labelClasses\">\n {{ label }}<span v-if=\"required\" class=\"text-error\"> *</span>\n </label>\n\n <div v-if=\"$slots.trailing\" class=\"absolute right-2 top-1/2 -translate-y-1/2\">\n <slot name=\"trailing\" />\n </div>\n <button\n v-else-if=\"showClear\"\n type=\"button\"\n class=\"absolute right-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface\"\n @click=\"cancelDebounce(); emit('update:modelValue', '')\"\n >\n <MIcon name=\"close\" :size=\"18\" />\n </button>\n </div>\n\n <p v-if=\"error && errorLabel\" class=\"px-4 text-body-small text-error\">{{ errorLabel }}</p>\n <p v-else-if=\"hint\" class=\"px-4 text-body-small text-on-surface-variant\">{{ hint }}</p>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, useId, useSlots } from \"vue\";\nimport MIcon from \"./MIcon.vue\";\nimport { useFieldBg } from \"../composables/useFieldBg\";\nimport { useDebounce } from \"../composables/useDebounce\";\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string | number;\n label: string;\n type?: string;\n variant?: \"filled\" | \"outlined\";\n error?: boolean;\n errorLabel?: string;\n hint?: string;\n disabled?: boolean;\n required?: boolean;\n multiline?: boolean;\n rows?: number;\n autocomplete?: string;\n leadingIcon?: string;\n clearable?: boolean;\n fieldBg?: string;\n debounce?: number;\n }>(),\n {\n type: \"text\",\n variant: \"filled\",\n rows: 3,\n clearable: false,\n debounce: 0,\n },\n);\n\nconst emit = defineEmits<{ \"update:modelValue\": [string]; debounced: [string] }>();\n\nconst id = useId();\nconst slots = useSlots();\n\nconst fieldBgEl = ref<HTMLElement | null>(null);\nconst { resolvedFieldBg } = useFieldBg(fieldBgEl, () => props.fieldBg);\n\nconst { debounced: emitDebounced, cancel: cancelDebounce } = useDebounce((v: string) => emit(\"debounced\", v), props.debounce)\n\nconst showClear = computed(() => props.clearable && String(props.modelValue).length > 0 && !props.disabled)\n\nconst inputClasses = computed(() => {\n const hasTrailing = !!slots.trailing || props.clearable;\n const pl = props.leadingIcon ? \"pl-12\" : \"pl-4\";\n const pr = hasTrailing ? \"pr-12\" : \"pr-4\";\n const size = props.multiline ? \"resize-y min-h-[56px]\" : \"h-14\";\n const base = [\n \"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent\",\n \"transition-[border-color,border-width] duration-150\",\n \"disabled:cursor-not-allowed disabled:text-on-surface/38\",\n props.error ? \"caret-error\" : \"caret-primary\",\n size,\n pl,\n pr,\n ];\n\n if (props.variant === \"outlined\") {\n return [\n ...base,\n \"rounded-xs border bg-transparent py-4\",\n props.error\n ? \"border-error focus:border-2 focus:border-error\"\n : \"border-outline hover:border-on-surface focus:border-2 focus:border-primary\",\n \"disabled:border-on-surface/12\",\n ].join(\" \");\n }\n\n return [\n ...base,\n \"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2\",\n props.error\n ? \"border-error focus:border-b-2 focus:border-error\"\n : \"border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary\",\n \"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]\",\n ].join(\" \");\n});\n\nconst labelClasses = computed(() => {\n const left = props.leadingIcon\n ? props.variant === \"outlined\"\n ? \"left-11\"\n : \"left-12\"\n : props.variant === \"outlined\"\n ? \"left-3\"\n : \"left-4\";\n\n const unfloatedTop = props.variant === 'filled' ? 'top-[53%]' : 'top-1/2'\n const base = [\n \"pointer-events-none absolute truncate transition-all duration-200\",\n left,\n \"right-4\",\n `${unfloatedTop} -translate-y-1/2 text-body-large`,\n ];\n\n if (props.variant === \"outlined\") {\n // When floated: drop right-4 (right-auto) and cap max-width so the label\n // shrinks to its own text width. The bg then only covers the glyphs + px-1,\n // cutting the border just where the text sits instead of a long strip.\n return [\n ...base,\n \"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1\",\n \"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]\",\n \"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n }\n\n // Filled: label floats to top-2 (slightly higher than before)\n return [\n ...base,\n \"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small\",\n \"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small\",\n props.error\n ? \"text-error peer-focus:text-error\"\n : \"text-on-surface-variant peer-focus:text-primary\",\n \"peer-disabled:text-on-surface/38\",\n ].join(\" \");\n});\n\nfunction onInput(event: Event) {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n emit(\"update:modelValue\", target.value);\n if (props.debounce > 0) emitDebounced(target.value)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1\">\n <!--\n --field-bg: background behind the floating label in outlined mode, so it\n \"cuts through\" the border. Auto-detected from the nearest opaque ancestor\n (see resolveBg); overridable via the fieldBg prop; falls back to surface.\n -->\n <div\n ref=\"fieldBgEl\"\n class=\"relative\"\n :class=\"variant === 'outlined' ? 'mt-2' : ''\"\n :style=\"variant === 'outlined' ? { '--field-bg': resolvedFieldBg } : undefined\"\n >\n <div\n v-if=\"leadingIcon\"\n class=\"pointer-events-none absolute left-3.5\"\n :class=\"[\n multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-4.5' : 'top-4',\n disabled ? 'text-on-surface/38' : 'text-on-surface-variant',\n ]\"\n >\n <MIcon :name=\"leadingIcon\" :size=\"24\" />\n </div>\n\n <textarea\n v-if=\"multiline\"\n :id=\"id\"\n :value=\"String(modelValue)\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :required=\"required\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n <input\n v-else\n :id=\"id\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :required=\"required\"\n :autocomplete=\"autocomplete\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n\n <label :for=\"id\" :class=\"labelClasses\">\n {{ label }}<span v-if=\"required\" class=\"text-error\"> *</span>\n </label>\n\n <div v-if=\"$slots.trailing\" class=\"absolute right-2 top-1/2 -translate-y-1/2\">\n <slot name=\"trailing\" />\n </div>\n <button\n v-else-if=\"showClear\"\n type=\"button\"\n class=\"absolute right-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface\"\n @click=\"cancelDebounce(); emit('update:modelValue', '')\"\n >\n <MIcon name=\"close\" :size=\"18\" />\n </button>\n </div>\n\n <p v-if=\"error && errorLabel\" class=\"px-4 text-body-small text-error\">{{ errorLabel }}</p>\n <p v-else-if=\"hint\" class=\"px-4 text-body-small text-on-surface-variant\">{{ hint }}</p>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, Fragment, inject, nextTick, onMounted, onUnmounted, provide, ref, useSlots, watch, type VNode } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenuDivider from './MMenuDivider.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Which edge of the trigger the dropdown aligns to. */\n align?: 'left' | 'right'\n /**\n * How items with a `#children` slot behave.\n * `'flyout'` opens a hover-positioned side panel (desktop).\n * `'push'` replaces the panel's own content with the submenu and a\n * back header — no positioning math, works with touch. Useful for mobile.\n */\n submenuMode?: 'flyout' | 'push'\n /**\n * `'standard'` is M3's baseline menu — square-ish 4dp corners\n * (`MenuTokens.ContainerShape`/`CornerExtraSmall`).\n * `'expressive'` is M3's rounder \"vertical menu\" styling — 16dp corners\n * (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with\n * `<MMenuDivider gap />` to split the panel into independently-rounded\n * groups with a visible gap between them, instead of a plain line.\n */\n variant?: 'standard' | 'expressive'\n }>(),\n { align: 'right', submenuMode: 'flyout', variant: 'standard' },\n)\n\nconst slots = useSlots()\n\nfunction flattenVNodes(vnodes: VNode[]): VNode[] {\n const out: VNode[] = []\n for (const vnode of vnodes) {\n if (vnode.type === Fragment && Array.isArray(vnode.children)) {\n out.push(...flattenVNodes(vnode.children as VNode[]))\n } else {\n out.push(vnode)\n }\n }\n return out\n}\n\nfunction isGapDivider(vnode: VNode): boolean {\n if (vnode.type !== MMenuDivider) return false\n const gap = (vnode.props as { gap?: unknown } | null)?.gap\n return gap === '' || gap === true || gap === 'true'\n}\n\n// Splits the default slot's content into groups at each `<MMenuDivider gap />`\n// — only used by the 'expressive' variant to render independently-rounded\n// group boxes. A plain `<MMenuDivider />` (no `gap`) stays a normal in-line\n// divider inside a single group, same as 'standard'.\nconst groups = computed(() => {\n if (props.variant !== 'expressive') return null\n const raw = flattenVNodes((slots.default?.({ close }) ?? []) as VNode[])\n const result: VNode[][] = [[]]\n for (const vnode of raw) {\n if (isGapDivider(vnode)) result.push([])\n else result[result.length - 1]!.push(vnode)\n }\n return result.filter(g => g.length > 0)\n})\nconst isGrouped = computed(() => !!groups.value && groups.value.length > 1)\n\ntype NavEntry = { icon?: string, header?: () => any, content?: () => any }\nconst navStack = ref<NavEntry[]>([])\nconst currentNav = computed(() => navStack.value[navStack.value.length - 1])\nconst navDirection = ref<'forward' | 'backward'>('forward')\n\n// Driven by the Web Animations API rather than Vue's CSS-class transition\n// hooks — with dynamic (direction-dependent) enter/leave classes on a\n// Transition with no `mode`, Vue's from->active->to class swap unreliably\n// never completed (elements got stuck straddling from/active with the\n// animation never actually running), so this drives it directly instead.\nconst slideDuration = 220\nfunction navSlideEnter(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? 1 : -1\n const anim = (el as HTMLElement).animate(\n [\n { transform: `translateX(${dir * 100}%)`, opacity: 0.4 },\n { transform: 'translateX(0%)', opacity: 1 },\n ],\n { duration: slideDuration, easing: 'cubic-bezier(0.05,0.7,0.1,1)' },\n )\n anim.onfinish = done\n}\nfunction navSlideLeave(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? -1 : 1\n const htmlEl = el as HTMLElement\n htmlEl.style.position = 'absolute'\n htmlEl.style.insetInline = '0'\n htmlEl.style.top = '0'\n const anim = htmlEl.animate(\n [\n { transform: 'translateX(0%)', opacity: 1 },\n { transform: `translateX(${dir * 100}%)`, opacity: 0.4 },\n ],\n { duration: slideDuration, easing: 'cubic-bezier(0.3,0,0.8,0.15)' },\n )\n anim.onfinish = done\n}\n\n// The real DropdownMenuContent in Menu.kt animates scale (0.8 -> 1) and alpha\n// (0 -> 1) with actual springs (MotionSchemeKeyTokens.FastSpatial/FastEffects\n// on the Standard scheme, StandardMotionTokens: scale dampingRatio 0.9/\n// stiffness 1400, alpha dampingRatio 1.0/stiffness 3800) — not a duration+\n// easing tween, which is why a cubic-bezier stand-in read as an abrupt cut on\n// close (a bezier can't carry a spring's momentum). But running the *close*\n// as its own independent spring toward the opposite target isn't right\n// either: alpha (stiffness 3800) settles much faster than scale (stiffness\n// 1400), so on close the panel fades to invisible well before it finishes\n// shrinking — you never actually see the shrink. On open this isn't a\n// problem (it becomes visible early, *then* you watch it keep growing), but\n// close needs to be the literal time-reverse of open, not a forward\n// simulation toward reversed targets, so the shrink stays visible the whole\n// time and only the fade races ahead right at the very end (mirroring how\n// the fade led at the very start of open). Simulated once (open direction\n// only) and played back forwards for enter, backwards for leave.\n//\n// A damped spring approaches its target exponentially, so it keeps \"settling\"\n// long after the motion is visually done — with a tight (0.001) tolerance on\n// both position *and* velocity, roughly the last third of the recorded\n// trajectory is values within a fraction of a percent of the target, visually\n// indistinguishable from it. Reversed for close, that flat tail lands at the\n// *start* instead, so nothing visibly happens for the first ~80ms before the\n// close animation actually appears to begin. Trimmed on position alone with a\n// much looser tolerance instead, since that's what's actually visible.\nlet cachedTrajectory: { scale: number, alpha: number }[] | null = null\nconst trajectoryStep = 1 / 240\nfunction openTrajectory() {\n if (cachedTrajectory) return cachedTrajectory\n const samples: { scale: number, alpha: number }[] = []\n let scale = 0.8\n let scaleVel = 0\n let alpha = 0\n let alphaVel = 0\n const scaleDamping = 0.9\n const scaleStiffness = 1400\n const alphaDamping = 1.0\n const alphaStiffness = 3800\n for (let t = 0; t < 1; t += trajectoryStep) {\n samples.push({ scale, alpha })\n scaleVel += (-scaleStiffness * (scale - 1) - 2 * scaleDamping * Math.sqrt(scaleStiffness) * scaleVel) * trajectoryStep\n scale += scaleVel * trajectoryStep\n alphaVel += (-alphaStiffness * (alpha - 1) - 2 * alphaDamping * Math.sqrt(alphaStiffness) * alphaVel) * trajectoryStep\n alpha += alphaVel * trajectoryStep\n const visuallySettled = Math.abs(scale - 1) < 0.003 && Math.abs(alpha - 1) < 0.003\n if (visuallySettled) break\n }\n samples.push({ scale: 1, alpha: 1 })\n cachedTrajectory = samples\n return samples\n}\n\n// Vue interrupts and reverses this mid-flight when the menu is toggled\n// quickly (close while still opening, or vice versa) — it calls the other\n// hook on the same still-mounted element without waiting for `done()`. Both\n// `currentIdx` (how far along the trajectory we are, so a reversal continues\n// smoothly from wherever it currently is instead of snapping back to a fixed\n// start) and `cancelActive` (so the previous rAF loop actually stops instead\n// of running alongside the new one, fighting over the same style every\n// frame) have to live outside this function to survive that interruption.\nlet currentIdx = 0\nlet cancelActive: (() => void) | null = null\n\nfunction playTrajectory(el: Element, done: () => void, opening: boolean) {\n cancelActive?.()\n const htmlEl = el as HTMLElement\n const samples = openTrajectory()\n const last = samples.length - 1\n const direction = opening ? 1 : -1\n const target = opening ? last : 0\n let lastTime = 0\n let rafId = 0\n let cancelled = false\n\n function apply(idx: number) {\n const sample = samples[Math.round(Math.max(0, Math.min(last, idx)))]!\n htmlEl.style.transform = `scale(${sample.scale})`\n htmlEl.style.opacity = String(Math.min(1, Math.max(0, sample.alpha)))\n }\n\n function step(now: number) {\n if (cancelled) return\n const dtSteps = lastTime ? (now - lastTime) / 1000 / trajectoryStep : 1\n lastTime = now\n currentIdx = Math.max(0, Math.min(last, currentIdx + direction * dtSteps))\n apply(currentIdx)\n if ((opening && currentIdx >= target) || (!opening && currentIdx <= target)) {\n cancelActive = null\n done()\n return\n }\n rafId = requestAnimationFrame(step)\n }\n\n cancelActive = () => { cancelled = true; cancelAnimationFrame(rafId) }\n apply(currentIdx)\n rafId = requestAnimationFrame(step)\n}\nfunction panelEnter(el: Element, done: () => void) {\n playTrajectory(el, done, true)\n}\nfunction panelLeave(el: Element, done: () => void) {\n playTrajectory(el, done, false)\n}\n\nfunction pushNav(entry: NavEntry) {\n navDirection.value = 'forward'\n navStack.value.push(entry)\n nextTick(() => focusFirstItem())\n}\n\nfunction popNav() {\n navDirection.value = 'backward'\n navStack.value.pop()\n nextTick(() => focusFirstItem())\n}\n\nconst open = ref(false)\nconst triggerEl = ref<HTMLElement | null>(null)\nconst dropdownEl = ref<HTMLElement | null>(null)\nconst dropStyle = ref<Record<string, string>>({})\n\n// A menu can be nested inside another MMenu/MContextMenu's slot (e.g. a\n// \"Language\" picker menu inside a \"More options\" overflow menu) — since both\n// Teleport straight to <body>, the outer one's panel DOM never contains the\n// inner one's, so the outer's outside-click check would otherwise see a click\n// inside the nested menu as \"outside\" and close (unmount) itself on\n// mousedown, before the inner button's own click can fire. Sharing one\n// registry of open panel elements across the whole logical (not DOM) menu\n// tree via provide/inject fixes that for arbitrary nesting depth.\nconst panelRegistry = inject<Set<HTMLElement>>('m-menu-panel-registry', new Set())\nprovide('m-menu-panel-registry', panelRegistry)\n\nwatch(dropdownEl, (el, oldEl) => {\n if (oldEl) panelRegistry.delete(oldEl)\n if (el) panelRegistry.add(el)\n})\n\nonUnmounted(() => {\n if (dropdownEl.value) panelRegistry.delete(dropdownEl.value)\n})\n\n// Separate from panelRegistry above: that one is shared all the way down the\n// nesting chain so a click inside a descendant menu never closes an ancestor.\n// This one is scoped to just this menu's *direct* children (e.g. \"Language\"\n// and \"Color palette\", both nested inside the same \"More options\" menu) —\n// without it, opening one no longer closes the other (since panelRegistry now\n// treats a click on either as \"inside\" the shared ancestor), so two sibling\n// pickers could stay open at once. Only one child of the same parent open at\n// a time, like an accordion; doesn't affect unrelated top-level menus.\nconst siblingGroup = inject<{ current: (() => void) | null } | null>('m-menu-sibling-group', null)\nprovide('m-menu-sibling-group', { current: null })\n\nfunction computePos() {\n if (!triggerEl.value) return\n const rect = triggerEl.value.getBoundingClientRect()\n const spaceBelow = window.innerHeight - rect.bottom - 8\n const openAbove = spaceBelow < 200 && rect.top > spaceBelow\n\n const style: Record<string, string> = {\n maxHeight: `${Math.min(openAbove ? rect.top - 12 : spaceBelow, 400)}px`,\n }\n\n if (openAbove) {\n style.bottom = `${window.innerHeight - rect.top + 4}px`\n } else {\n style.top = `${rect.bottom + 4}px`\n }\n\n if (props.align === 'right') {\n style.right = `${window.innerWidth - rect.right}px`\n } else {\n style.left = `${rect.left}px`\n }\n\n dropStyle.value = style\n}\n\nfunction focusableItems() {\n if (!dropdownEl.value) return []\n return Array.from(\n dropdownEl.value.querySelectorAll<HTMLElement>('button:not(:disabled), a[href]'),\n )\n}\n\nfunction focusFirstItem() {\n nextTick(() => focusableItems()[0]?.focus())\n}\n\nfunction moveFocus(dir: 1 | -1) {\n const items = focusableItems()\n if (!items.length) return\n const idx = items.indexOf(document.activeElement as HTMLElement)\n const next = idx === -1\n ? (dir === 1 ? items[0] : items[items.length - 1])\n : items[(idx + dir + items.length) % items.length]\n next?.focus()\n}\n\nfunction toggle() {\n if (!open.value) {\n if (siblingGroup && siblingGroup.current && siblingGroup.current !== close) {\n siblingGroup.current()\n }\n if (siblingGroup) siblingGroup.current = close\n computePos()\n navStack.value = []\n } else if (siblingGroup?.current === close) {\n siblingGroup.current = null\n }\n open.value = !open.value\n if (open.value) focusFirstItem()\n}\n\nfunction close() {\n if (siblingGroup?.current === close) siblingGroup.current = null\n open.value = false\n}\n\nprovide('m-menu-close', close)\nprovide('m-menu-nav', { mode: props.submenuMode, push: pushNav })\ndefineExpose({ close, open })\n\nfunction onOutsideClick(e: MouseEvent) {\n const t = e.target as Node\n if (triggerEl.value?.contains(t)) return\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\n// Scrolling inside any panel of this menu tree (own, or a nested menu's\n// Teleported panel) isn't an \"outside\" scroll — same registry as onOutsideClick\nfunction onScroll(e: Event) {\n if (!open.value) return\n const t = e.target as Node\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n if (navStack.value.length) popNav()\n else close()\n return\n }\n if (!open.value) return\n if (e.key === 'ArrowDown') { e.preventDefault(); moveFocus(1) }\n else if (e.key === 'ArrowUp') { e.preventDefault(); moveFocus(-1) }\n}\n\nonMounted(() => {\n document.addEventListener('mousedown', onOutsideClick)\n document.addEventListener('keydown', onKeydown)\n window.addEventListener('scroll', onScroll, true)\n})\n\nonUnmounted(() => {\n document.removeEventListener('mousedown', onOutsideClick)\n document.removeEventListener('keydown', onKeydown)\n window.removeEventListener('scroll', onScroll, true)\n cancelActive?.()\n})\n\nconst origin = computed(() =>\n props.align === 'right' ? 'top right' : 'top left',\n)\n</script>\n\n<template>\n <div ref=\"triggerEl\" class=\"inline-block\" @click=\"toggle\">\n <slot name=\"trigger\" :open=\"open\" />\n </div>\n\n <Teleport to=\"body\">\n <Transition :css=\"false\" @enter=\"panelEnter\" @leave=\"panelLeave\">\n <div\n v-if=\"open\"\n ref=\"dropdownEl\"\n class=\"fixed z-500 min-w-48\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'shadow-elevation-2',\n ]\"\n :style=\"{ ...dropStyle, transformOrigin: origin }\"\n >\n <!-- overflow-hidden (for the rounded-corner clip and to clip the push\n submenu's slide) lives on this inner wrapper, never together with\n shadow-elevation-2 on the same box — overflow-hidden clips an\n element's own box-shadow too, so the two have to be on separate\n elements or the shadow gets cut off -->\n <div\n class=\"overflow-hidden\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'bg-surface-container',\n ]\"\n >\n <div class=\"relative overflow-y-auto overscroll-contain py-1\" :style=\"{ maxHeight: dropStyle.maxHeight }\">\n <Transition :css=\"false\" @enter=\"navSlideEnter\" @leave=\"navSlideLeave\">\n <div v-if=\"currentNav\" :key=\"navStack.length\">\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-3 border-b border-outline-variant px-4 py-2.5 text-left text-body-large text-on-surface outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n @click=\"popNav\"\n >\n <MIcon name=\"chevron_left\" :size=\"20\" class=\"shrink-0 text-on-surface-variant\" />\n <MIcon v-if=\"currentNav.icon\" :name=\"currentNav.icon\" :size=\"20\" class=\"shrink-0 text-on-surface-variant\" />\n <span class=\"flex-1 truncate\"><component :is=\"() => currentNav?.header?.()\" /></span>\n </button>\n <component :is=\"() => currentNav?.content?.()\" />\n </div>\n <div v-else key=\"root\">\n <div v-if=\"isGrouped\" class=\"flex flex-col gap-1 px-1.5\">\n <div v-for=\"(group, i) in groups\" :key=\"i\" class=\"rounded-lg shadow-elevation-2\">\n <div class=\"overflow-hidden rounded-lg bg-surface-container\">\n <component :is=\"() => group\" />\n </div>\n </div>\n </div>\n <slot v-else :close=\"close\" />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, Fragment, inject, nextTick, onMounted, onUnmounted, provide, ref, useSlots, watch, type VNode } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenuDivider from './MMenuDivider.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Which edge of the trigger the dropdown aligns to. */\n align?: 'left' | 'right'\n /**\n * How items with a `#children` slot behave.\n * `'flyout'` opens a hover-positioned side panel (desktop).\n * `'push'` replaces the panel's own content with the submenu and a\n * back header — no positioning math, works with touch. Useful for mobile.\n */\n submenuMode?: 'flyout' | 'push'\n /**\n * `'standard'` is M3's baseline menu — square-ish 4dp corners\n * (`MenuTokens.ContainerShape`/`CornerExtraSmall`).\n * `'expressive'` is M3's rounder \"vertical menu\" styling — 16dp corners\n * (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with\n * `<MMenuDivider gap />` to split the panel into independently-rounded\n * groups with a visible gap between them, instead of a plain line.\n */\n variant?: 'standard' | 'expressive'\n }>(),\n { align: 'right', submenuMode: 'flyout', variant: 'standard' },\n)\n\nconst slots = useSlots()\n\nfunction flattenVNodes(vnodes: VNode[]): VNode[] {\n const out: VNode[] = []\n for (const vnode of vnodes) {\n if (vnode.type === Fragment && Array.isArray(vnode.children)) {\n out.push(...flattenVNodes(vnode.children as VNode[]))\n } else {\n out.push(vnode)\n }\n }\n return out\n}\n\nfunction isGapDivider(vnode: VNode): boolean {\n if (vnode.type !== MMenuDivider) return false\n const gap = (vnode.props as { gap?: unknown } | null)?.gap\n return gap === '' || gap === true || gap === 'true'\n}\n\n// Splits the default slot's content into groups at each `<MMenuDivider gap />`\n// — only used by the 'expressive' variant to render independently-rounded\n// group boxes. A plain `<MMenuDivider />` (no `gap`) stays a normal in-line\n// divider inside a single group, same as 'standard'.\nconst groups = computed(() => {\n if (props.variant !== 'expressive') return null\n const raw = flattenVNodes((slots.default?.({ close }) ?? []) as VNode[])\n const result: VNode[][] = [[]]\n for (const vnode of raw) {\n if (isGapDivider(vnode)) result.push([])\n else result[result.length - 1]!.push(vnode)\n }\n return result.filter(g => g.length > 0)\n})\nconst isGrouped = computed(() => !!groups.value && groups.value.length > 1)\n\ntype NavEntry = { icon?: string, header?: () => any, content?: () => any }\nconst navStack = ref<NavEntry[]>([])\nconst currentNav = computed(() => navStack.value[navStack.value.length - 1])\nconst navDirection = ref<'forward' | 'backward'>('forward')\n\n// Driven by the Web Animations API rather than Vue's CSS-class transition\n// hooks — with dynamic (direction-dependent) enter/leave classes on a\n// Transition with no `mode`, Vue's from->active->to class swap unreliably\n// never completed (elements got stuck straddling from/active with the\n// animation never actually running), so this drives it directly instead.\nconst slideDuration = 220\nfunction navSlideEnter(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? 1 : -1\n const anim = (el as HTMLElement).animate(\n [\n { transform: `translateX(${dir * 100}%)`, opacity: 0.4 },\n { transform: 'translateX(0%)', opacity: 1 },\n ],\n { duration: slideDuration, easing: 'cubic-bezier(0.05,0.7,0.1,1)' },\n )\n anim.onfinish = done\n}\nfunction navSlideLeave(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? -1 : 1\n const htmlEl = el as HTMLElement\n htmlEl.style.position = 'absolute'\n htmlEl.style.insetInline = '0'\n htmlEl.style.top = '0'\n const anim = htmlEl.animate(\n [\n { transform: 'translateX(0%)', opacity: 1 },\n { transform: `translateX(${dir * 100}%)`, opacity: 0.4 },\n ],\n { duration: slideDuration, easing: 'cubic-bezier(0.3,0,0.8,0.15)' },\n )\n anim.onfinish = done\n}\n\n// The real DropdownMenuContent in Menu.kt animates scale (0.8 -> 1) and alpha\n// (0 -> 1) with actual springs (MotionSchemeKeyTokens.FastSpatial/FastEffects\n// on the Standard scheme, StandardMotionTokens: scale dampingRatio 0.9/\n// stiffness 1400, alpha dampingRatio 1.0/stiffness 3800) — not a duration+\n// easing tween, which is why a cubic-bezier stand-in read as an abrupt cut on\n// close (a bezier can't carry a spring's momentum). But running the *close*\n// as its own independent spring toward the opposite target isn't right\n// either: alpha (stiffness 3800) settles much faster than scale (stiffness\n// 1400), so on close the panel fades to invisible well before it finishes\n// shrinking — you never actually see the shrink. On open this isn't a\n// problem (it becomes visible early, *then* you watch it keep growing), but\n// close needs to be the literal time-reverse of open, not a forward\n// simulation toward reversed targets, so the shrink stays visible the whole\n// time and only the fade races ahead right at the very end (mirroring how\n// the fade led at the very start of open). Simulated once (open direction\n// only) and played back forwards for enter, backwards for leave.\n//\n// A damped spring approaches its target exponentially, so it keeps \"settling\"\n// long after the motion is visually done — with a tight (0.001) tolerance on\n// both position *and* velocity, roughly the last third of the recorded\n// trajectory is values within a fraction of a percent of the target, visually\n// indistinguishable from it. Reversed for close, that flat tail lands at the\n// *start* instead, so nothing visibly happens for the first ~80ms before the\n// close animation actually appears to begin. Trimmed on position alone with a\n// much looser tolerance instead, since that's what's actually visible.\nlet cachedTrajectory: { scale: number, alpha: number }[] | null = null\nconst trajectoryStep = 1 / 240\nfunction openTrajectory() {\n if (cachedTrajectory) return cachedTrajectory\n const samples: { scale: number, alpha: number }[] = []\n let scale = 0.8\n let scaleVel = 0\n let alpha = 0\n let alphaVel = 0\n const scaleDamping = 0.9\n const scaleStiffness = 1400\n const alphaDamping = 1.0\n const alphaStiffness = 3800\n for (let t = 0; t < 1; t += trajectoryStep) {\n samples.push({ scale, alpha })\n scaleVel += (-scaleStiffness * (scale - 1) - 2 * scaleDamping * Math.sqrt(scaleStiffness) * scaleVel) * trajectoryStep\n scale += scaleVel * trajectoryStep\n alphaVel += (-alphaStiffness * (alpha - 1) - 2 * alphaDamping * Math.sqrt(alphaStiffness) * alphaVel) * trajectoryStep\n alpha += alphaVel * trajectoryStep\n const visuallySettled = Math.abs(scale - 1) < 0.003 && Math.abs(alpha - 1) < 0.003\n if (visuallySettled) break\n }\n samples.push({ scale: 1, alpha: 1 })\n cachedTrajectory = samples\n return samples\n}\n\n// Vue interrupts and reverses this mid-flight when the menu is toggled\n// quickly (close while still opening, or vice versa) — it calls the other\n// hook on the same still-mounted element without waiting for `done()`. Both\n// `currentIdx` (how far along the trajectory we are, so a reversal continues\n// smoothly from wherever it currently is instead of snapping back to a fixed\n// start) and `cancelActive` (so the previous rAF loop actually stops instead\n// of running alongside the new one, fighting over the same style every\n// frame) have to live outside this function to survive that interruption.\nlet currentIdx = 0\nlet cancelActive: (() => void) | null = null\n\nfunction playTrajectory(el: Element, done: () => void, opening: boolean) {\n cancelActive?.()\n const htmlEl = el as HTMLElement\n const samples = openTrajectory()\n const last = samples.length - 1\n const direction = opening ? 1 : -1\n const target = opening ? last : 0\n let lastTime = 0\n let rafId = 0\n let cancelled = false\n\n function apply(idx: number) {\n const sample = samples[Math.round(Math.max(0, Math.min(last, idx)))]!\n htmlEl.style.transform = `scale(${sample.scale})`\n htmlEl.style.opacity = String(Math.min(1, Math.max(0, sample.alpha)))\n }\n\n function step(now: number) {\n if (cancelled) return\n const dtSteps = lastTime ? (now - lastTime) / 1000 / trajectoryStep : 1\n lastTime = now\n currentIdx = Math.max(0, Math.min(last, currentIdx + direction * dtSteps))\n apply(currentIdx)\n if ((opening && currentIdx >= target) || (!opening && currentIdx <= target)) {\n cancelActive = null\n done()\n return\n }\n rafId = requestAnimationFrame(step)\n }\n\n cancelActive = () => { cancelled = true; cancelAnimationFrame(rafId) }\n apply(currentIdx)\n rafId = requestAnimationFrame(step)\n}\nfunction panelEnter(el: Element, done: () => void) {\n playTrajectory(el, done, true)\n}\nfunction panelLeave(el: Element, done: () => void) {\n playTrajectory(el, done, false)\n}\n\nfunction pushNav(entry: NavEntry) {\n navDirection.value = 'forward'\n navStack.value.push(entry)\n nextTick(() => focusFirstItem())\n}\n\nfunction popNav() {\n navDirection.value = 'backward'\n navStack.value.pop()\n nextTick(() => focusFirstItem())\n}\n\nconst open = ref(false)\nconst triggerEl = ref<HTMLElement | null>(null)\nconst dropdownEl = ref<HTMLElement | null>(null)\nconst dropStyle = ref<Record<string, string>>({})\n\n// A menu can be nested inside another MMenu/MContextMenu's slot (e.g. a\n// \"Language\" picker menu inside a \"More options\" overflow menu) — since both\n// Teleport straight to <body>, the outer one's panel DOM never contains the\n// inner one's, so the outer's outside-click check would otherwise see a click\n// inside the nested menu as \"outside\" and close (unmount) itself on\n// mousedown, before the inner button's own click can fire. Sharing one\n// registry of open panel elements across the whole logical (not DOM) menu\n// tree via provide/inject fixes that for arbitrary nesting depth.\nconst panelRegistry = inject<Set<HTMLElement>>('m-menu-panel-registry', new Set())\nprovide('m-menu-panel-registry', panelRegistry)\n\nwatch(dropdownEl, (el, oldEl) => {\n if (oldEl) panelRegistry.delete(oldEl)\n if (el) panelRegistry.add(el)\n})\n\nonUnmounted(() => {\n if (dropdownEl.value) panelRegistry.delete(dropdownEl.value)\n})\n\n// Separate from panelRegistry above: that one is shared all the way down the\n// nesting chain so a click inside a descendant menu never closes an ancestor.\n// This one is scoped to just this menu's *direct* children (e.g. \"Language\"\n// and \"Color palette\", both nested inside the same \"More options\" menu) —\n// without it, opening one no longer closes the other (since panelRegistry now\n// treats a click on either as \"inside\" the shared ancestor), so two sibling\n// pickers could stay open at once. Only one child of the same parent open at\n// a time, like an accordion; doesn't affect unrelated top-level menus.\nconst siblingGroup = inject<{ current: (() => void) | null } | null>('m-menu-sibling-group', null)\nprovide('m-menu-sibling-group', { current: null })\n\nfunction computePos() {\n if (!triggerEl.value) return\n const rect = triggerEl.value.getBoundingClientRect()\n const spaceBelow = window.innerHeight - rect.bottom - 8\n const openAbove = spaceBelow < 200 && rect.top > spaceBelow\n\n const style: Record<string, string> = {\n maxHeight: `${Math.min(openAbove ? rect.top - 12 : spaceBelow, 400)}px`,\n }\n\n if (openAbove) {\n style.bottom = `${window.innerHeight - rect.top + 4}px`\n } else {\n style.top = `${rect.bottom + 4}px`\n }\n\n if (props.align === 'right') {\n style.right = `${window.innerWidth - rect.right}px`\n } else {\n style.left = `${rect.left}px`\n }\n\n dropStyle.value = style\n}\n\nfunction focusableItems() {\n if (!dropdownEl.value) return []\n return Array.from(\n dropdownEl.value.querySelectorAll<HTMLElement>('button:not(:disabled), a[href]'),\n )\n}\n\nfunction focusFirstItem() {\n nextTick(() => focusableItems()[0]?.focus())\n}\n\nfunction moveFocus(dir: 1 | -1) {\n const items = focusableItems()\n if (!items.length) return\n const idx = items.indexOf(document.activeElement as HTMLElement)\n const next = idx === -1\n ? (dir === 1 ? items[0] : items[items.length - 1])\n : items[(idx + dir + items.length) % items.length]\n next?.focus()\n}\n\nfunction toggle() {\n if (!open.value) {\n if (siblingGroup && siblingGroup.current && siblingGroup.current !== close) {\n siblingGroup.current()\n }\n if (siblingGroup) siblingGroup.current = close\n computePos()\n navStack.value = []\n } else if (siblingGroup?.current === close) {\n siblingGroup.current = null\n }\n open.value = !open.value\n if (open.value) focusFirstItem()\n}\n\nfunction close() {\n if (siblingGroup?.current === close) siblingGroup.current = null\n open.value = false\n}\n\nprovide('m-menu-close', close)\nprovide('m-menu-nav', { mode: props.submenuMode, push: pushNav })\ndefineExpose({ close, open })\n\nfunction onOutsideClick(e: MouseEvent) {\n const t = e.target as Node\n if (triggerEl.value?.contains(t)) return\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\n// Scrolling inside any panel of this menu tree (own, or a nested menu's\n// Teleported panel) isn't an \"outside\" scroll — same registry as onOutsideClick\nfunction onScroll(e: Event) {\n if (!open.value) return\n const t = e.target as Node\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n if (navStack.value.length) popNav()\n else close()\n return\n }\n if (!open.value) return\n if (e.key === 'ArrowDown') { e.preventDefault(); moveFocus(1) }\n else if (e.key === 'ArrowUp') { e.preventDefault(); moveFocus(-1) }\n}\n\nonMounted(() => {\n document.addEventListener('mousedown', onOutsideClick)\n document.addEventListener('keydown', onKeydown)\n window.addEventListener('scroll', onScroll, true)\n})\n\nonUnmounted(() => {\n document.removeEventListener('mousedown', onOutsideClick)\n document.removeEventListener('keydown', onKeydown)\n window.removeEventListener('scroll', onScroll, true)\n cancelActive?.()\n})\n\nconst origin = computed(() =>\n props.align === 'right' ? 'top right' : 'top left',\n)\n</script>\n\n<template>\n <div ref=\"triggerEl\" class=\"inline-block\" @click=\"toggle\">\n <slot name=\"trigger\" :open=\"open\" />\n </div>\n\n <Teleport to=\"body\">\n <Transition :css=\"false\" @enter=\"panelEnter\" @leave=\"panelLeave\">\n <div\n v-if=\"open\"\n ref=\"dropdownEl\"\n class=\"fixed z-500 min-w-48\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'shadow-elevation-2',\n ]\"\n :style=\"{ ...dropStyle, transformOrigin: origin }\"\n >\n <!-- overflow-hidden (for the rounded-corner clip and to clip the push\n submenu's slide) lives on this inner wrapper, never together with\n shadow-elevation-2 on the same box — overflow-hidden clips an\n element's own box-shadow too, so the two have to be on separate\n elements or the shadow gets cut off -->\n <div\n class=\"overflow-hidden\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'bg-surface-container',\n ]\"\n >\n <div class=\"relative overflow-y-auto overscroll-contain py-1\" :style=\"{ maxHeight: dropStyle.maxHeight }\">\n <Transition :css=\"false\" @enter=\"navSlideEnter\" @leave=\"navSlideLeave\">\n <div v-if=\"currentNav\" :key=\"navStack.length\">\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-3 border-b border-outline-variant px-4 py-2.5 text-left text-body-large text-on-surface outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n @click=\"popNav\"\n >\n <MIcon name=\"chevron_left\" :size=\"20\" class=\"shrink-0 text-on-surface-variant\" />\n <MIcon v-if=\"currentNav.icon\" :name=\"currentNav.icon\" :size=\"20\" class=\"shrink-0 text-on-surface-variant\" />\n <span class=\"flex-1 truncate\"><component :is=\"() => currentNav?.header?.()\" /></span>\n </button>\n <component :is=\"() => currentNav?.content?.()\" />\n </div>\n <div v-else key=\"root\">\n <div v-if=\"isGrouped\" class=\"flex flex-col gap-1 px-1.5\">\n <div v-for=\"(group, i) in groups\" :key=\"i\" class=\"rounded-lg shadow-elevation-2\">\n <div class=\"overflow-hidden rounded-lg bg-surface-container\">\n <component :is=\"() => group\" />\n </div>\n </div>\n </div>\n <slot v-else :close=\"close\" />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, inject, ref, useSlots } from 'vue'\nimport MIcon from './MIcon.vue'\n\nconst props = withDefaults(defineProps<{\n icon?: string\n shortcut?: string\n to?: string | Record<string, any>\n disabled?: boolean\n danger?: boolean\n /** Keep the menu open after this item is clicked (e.g. checkable/toggle items). */\n keepOpen?: boolean\n}>(), {\n disabled: false,\n danger: false,\n keepOpen: false,\n})\n\nconst emit = defineEmits<{ click: [] }>()\n\nconst slots = useSlots()\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\nconst hasChildren = computed(() => !!slots.children)\nconst menuClose = inject<(() => void) | null>('m-menu-close', null)\nconst nav = inject<{\n mode: 'flyout' | 'push'\n push: (entry: { icon?: string, header?: () => any, content?: () => any }) => void\n} | null>('m-menu-nav', null)\n\nconst itemEl = ref<HTMLElement>()\nconst showSub = ref(false)\nconst subStyle = ref<Record<string, string>>({})\n\nfunction positionSub() {\n if (!itemEl.value) return\n const rect = itemEl.value.getBoundingClientRect()\n const right = rect.right + 200 > window.innerWidth\n subStyle.value = {\n position: 'fixed',\n top: `${rect.top}px`,\n ...(right\n ? { right: `${window.innerWidth - rect.left}px` }\n : { left: `${rect.right}px` }),\n zIndex: '501',\n }\n}\n\nfunction toggleSub() {\n if (showSub.value) {\n showSub.value = false\n return\n }\n positionSub()\n showSub.value = true\n}\n\nfunction handleClick() {\n if (props.disabled) return\n\n if (hasChildren.value) {\n if (nav?.mode === 'push') {\n nav.push({ icon: props.icon, header: slots.default, content: slots.children })\n } else {\n toggleSub()\n }\n return\n }\n\n emit('click')\n if (!props.keepOpen) menuClose?.()\n}\n\n// Desktop hover convenience for the flyout variant — ignored on touch/pen so a\n// tap doesn't fire a spurious pointerleave (relatedTarget is null on touch)\n// and close the submenu before its click event can land.\nfunction onPointerEnter(e: PointerEvent) {\n if (e.pointerType !== 'mouse' || !hasChildren.value || props.disabled) return\n positionSub()\n showSub.value = true\n}\n\nfunction onPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu')) return\n showSub.value = false\n}\n\nfunction onSubPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu') || itemEl.value?.contains(related as Node)) return\n showSub.value = false\n}\n</script>\n\n<template>\n <div\n ref=\"itemEl\"\n @pointerenter=\"onPointerEnter\"\n @pointerleave=\"onPointerLeave\"\n >\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n class=\"flex w-full items-center gap-3 px-4 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n :class=\"[\n disabled ? 'cursor-not-allowed opacity-[0.38] text-on-surface' : 'cursor-pointer',\n !disabled && danger ? 'text-error hover:bg-error/8' : '',\n !disabled && !danger ? 'text-on-surface hover:bg-on-surface/8' : '',\n ]\"\n :disabled=\"disabled || undefined\"\n :aria-haspopup=\"hasChildren ? 'menu' : undefined\"\n :aria-expanded=\"hasChildren ? showSub : undefined\"\n @click=\"handleClick\"\n >\n <MIcon v-if=\"icon\" :name=\"icon\" :size=\"20\" class=\"shrink-0\" :class=\"danger ? 'text-error' : 'text-on-surface-variant'\" />\n <span class=\"flex-1\"><slot /></span>\n <span v-if=\"shortcut && !hasChildren\" class=\"ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60\">{{ shortcut }}</span>\n <MIcon v-if=\"hasChildren\" name=\"chevron_right\" :size=\"18\" class=\"shrink-0 text-on-surface-variant\" />\n </component>\n\n <!-- Submenu (flyout variant only — \"push\" mode is rendered by the root MMenu/MContextMenu panel) -->\n <Teleport v-if=\"hasChildren && nav?.mode !== 'push'\" to=\"body\">\n <Transition\n enter-active-class=\"transition-opacity duration-100\"\n enter-from-class=\"opacity-0\"\n leave-active-class=\"transition-opacity duration-75\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"showSub\"\n class=\"m3-submenu min-w-44 rounded-xs shadow-elevation-2\"\n :style=\"subStyle\"\n @pointerleave=\"onSubPointerLeave\"\n >\n <!-- overflow-hidden lives here, separate from shadow-elevation-2 above —\n overflow-hidden clips an element's own box-shadow too -->\n <div class=\"overflow-hidden rounded-xs bg-surface-container py-1\">\n <slot name=\"children\" />\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, inject, ref, useSlots } from 'vue'\nimport MIcon from './MIcon.vue'\n\nconst props = withDefaults(defineProps<{\n icon?: string\n shortcut?: string\n to?: string | Record<string, any>\n disabled?: boolean\n danger?: boolean\n /** Keep the menu open after this item is clicked (e.g. checkable/toggle items). */\n keepOpen?: boolean\n}>(), {\n disabled: false,\n danger: false,\n keepOpen: false,\n})\n\nconst emit = defineEmits<{ click: [] }>()\n\nconst slots = useSlots()\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\nconst hasChildren = computed(() => !!slots.children)\nconst menuClose = inject<(() => void) | null>('m-menu-close', null)\nconst nav = inject<{\n mode: 'flyout' | 'push'\n push: (entry: { icon?: string, header?: () => any, content?: () => any }) => void\n} | null>('m-menu-nav', null)\n\nconst itemEl = ref<HTMLElement>()\nconst showSub = ref(false)\nconst subStyle = ref<Record<string, string>>({})\n\nfunction positionSub() {\n if (!itemEl.value) return\n const rect = itemEl.value.getBoundingClientRect()\n const right = rect.right + 200 > window.innerWidth\n subStyle.value = {\n position: 'fixed',\n top: `${rect.top}px`,\n ...(right\n ? { right: `${window.innerWidth - rect.left}px` }\n : { left: `${rect.right}px` }),\n zIndex: '501',\n }\n}\n\nfunction toggleSub() {\n if (showSub.value) {\n showSub.value = false\n return\n }\n positionSub()\n showSub.value = true\n}\n\nfunction handleClick() {\n if (props.disabled) return\n\n if (hasChildren.value) {\n if (nav?.mode === 'push') {\n nav.push({ icon: props.icon, header: slots.default, content: slots.children })\n } else {\n toggleSub()\n }\n return\n }\n\n emit('click')\n if (!props.keepOpen) menuClose?.()\n}\n\n// Desktop hover convenience for the flyout variant — ignored on touch/pen so a\n// tap doesn't fire a spurious pointerleave (relatedTarget is null on touch)\n// and close the submenu before its click event can land.\nfunction onPointerEnter(e: PointerEvent) {\n if (e.pointerType !== 'mouse' || !hasChildren.value || props.disabled) return\n positionSub()\n showSub.value = true\n}\n\nfunction onPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu')) return\n showSub.value = false\n}\n\nfunction onSubPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu') || itemEl.value?.contains(related as Node)) return\n showSub.value = false\n}\n</script>\n\n<template>\n <div\n ref=\"itemEl\"\n @pointerenter=\"onPointerEnter\"\n @pointerleave=\"onPointerLeave\"\n >\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n class=\"flex w-full items-center gap-3 px-4 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n :class=\"[\n disabled ? 'cursor-not-allowed opacity-[0.38] text-on-surface' : 'cursor-pointer',\n !disabled && danger ? 'text-error hover:bg-error/8' : '',\n !disabled && !danger ? 'text-on-surface hover:bg-on-surface/8' : '',\n ]\"\n :disabled=\"disabled || undefined\"\n :aria-haspopup=\"hasChildren ? 'menu' : undefined\"\n :aria-expanded=\"hasChildren ? showSub : undefined\"\n @click=\"handleClick\"\n >\n <MIcon v-if=\"icon\" :name=\"icon\" :size=\"20\" class=\"shrink-0\" :class=\"danger ? 'text-error' : 'text-on-surface-variant'\" />\n <span class=\"flex-1\"><slot /></span>\n <span v-if=\"shortcut && !hasChildren\" class=\"ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60\">{{ shortcut }}</span>\n <MIcon v-if=\"hasChildren\" name=\"chevron_right\" :size=\"18\" class=\"shrink-0 text-on-surface-variant\" />\n </component>\n\n <!-- Submenu (flyout variant only — \"push\" mode is rendered by the root MMenu/MContextMenu panel) -->\n <Teleport v-if=\"hasChildren && nav?.mode !== 'push'\" to=\"body\">\n <Transition\n enter-active-class=\"transition-opacity duration-100\"\n enter-from-class=\"opacity-0\"\n leave-active-class=\"transition-opacity duration-75\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"showSub\"\n class=\"m3-submenu min-w-44 rounded-xs shadow-elevation-2\"\n :style=\"subStyle\"\n @pointerleave=\"onSubPointerLeave\"\n >\n <!-- overflow-hidden lives here, separate from shadow-elevation-2 above —\n overflow-hidden clips an element's own box-shadow too -->\n <div class=\"overflow-hidden rounded-xs bg-surface-container py-1\">\n <slot name=\"children\" />\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n"],"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