@m3ui-vue/m3ui-vue 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/API.md +940 -33
  2. package/dist/{MButton-CPghlKb0.js → MButton-OQ4wIERQ.js} +2 -2
  3. package/dist/{MButton-CPghlKb0.js.map → MButton-OQ4wIERQ.js.map} +1 -1
  4. package/dist/{MDialog-X50At1Gk.js → MDialog-DYMnaBlt.js} +3 -3
  5. package/dist/{MDialog-X50At1Gk.js.map → MDialog-DYMnaBlt.js.map} +1 -1
  6. package/dist/{MListItem-DVi1j1QI.js → MListItem-D2cNUyzP.js} +211 -168
  7. package/dist/MListItem-D2cNUyzP.js.map +1 -0
  8. package/dist/{MLoadingIndicator-vooA3110.js → MLoadingIndicator-DWUj0BAB.js} +2 -2
  9. package/dist/{MLoadingIndicator-vooA3110.js.map → MLoadingIndicator-DWUj0BAB.js.map} +1 -1
  10. package/dist/{MMenuItem-CRNZkVVr.js → MMenuItem-BuxYoASE.js} +133 -151
  11. package/dist/MMenuItem-BuxYoASE.js.map +1 -0
  12. package/dist/{MSeekBar-BL2W5_rD.js → MSeekBar-C4cn9RIF.js} +2 -2
  13. package/dist/{MSeekBar-BL2W5_rD.js.map → MSeekBar-C4cn9RIF.js.map} +1 -1
  14. package/dist/{MSlider-B9NcKTmZ.js → MSlider-BIkA6DiE.js} +2 -2
  15. package/dist/{MSlider-B9NcKTmZ.js.map → MSlider-BIkA6DiE.js.map} +1 -1
  16. package/dist/{MSpinner-_XpTRkAg.js → MSpinner-DZkXZJpc.js} +2 -2
  17. package/dist/{MSpinner-_XpTRkAg.js.map → MSpinner-DZkXZJpc.js.map} +1 -1
  18. package/dist/{MTextField-DpcPmR5B.js → MTextField-CNH-byir.js} +2 -2
  19. package/dist/{MTextField-DpcPmR5B.js.map → MTextField-CNH-byir.js.map} +1 -1
  20. package/dist/{MTooltip-BL3jPYPT.js → MTooltip-Dd5g2zhh.js} +4 -4
  21. package/dist/{MTooltip-BL3jPYPT.js.map → MTooltip-Dd5g2zhh.js.map} +1 -1
  22. package/dist/{_useEscapeStack-C5-BYr8y.js → _popupPosition-nL8SVKPK.js} +20 -2
  23. package/dist/_popupPosition-nL8SVKPK.js.map +1 -0
  24. package/dist/api.json +1 -1
  25. package/dist/code-editor.js +1 -1
  26. package/dist/components/MAddressField.vue.d.ts +54 -0
  27. package/dist/components/MAudioPlayer.vue.d.ts +1 -1
  28. package/dist/components/MAudioRecorder.vue.d.ts +51 -0
  29. package/dist/components/MAvailabilityCalendar.vue.d.ts +1 -1
  30. package/dist/components/MCameraCapture.vue.d.ts +51 -0
  31. package/dist/components/MCollapse.vue.d.ts +32 -0
  32. package/dist/components/MCountrySelect.vue.d.ts +41 -0
  33. package/dist/components/MCronField.vue.d.ts +26 -0
  34. package/dist/components/MDashboardGrid.vue.d.ts +65 -0
  35. package/dist/components/MDiffViewer.vue.d.ts +56 -0
  36. package/dist/components/MExpansionPanel.vue.d.ts +26 -3
  37. package/dist/components/MFilterBuilder.vue.d.ts +22 -0
  38. package/dist/components/MFlex.vue.d.ts +1 -1
  39. package/dist/components/MMapCluster.vue.d.ts +80 -0
  40. package/dist/components/MMapDraw.vue.d.ts +79 -0
  41. package/dist/components/MMentionField.vue.d.ts +102 -0
  42. package/dist/components/MNotificationCenter.vue.d.ts +57 -0
  43. package/dist/components/MQRScanner.vue.d.ts +52 -0
  44. package/dist/components/MQuiz.vue.d.ts +1 -1
  45. package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
  46. package/dist/components/MStack.vue.d.ts +1 -1
  47. package/dist/components/MTimezoneSelect.vue.d.ts +39 -0
  48. package/dist/components/MToolbar.vue.d.ts +1 -1
  49. package/dist/components/MVideoPlayer.vue.d.ts +1 -1
  50. package/dist/components/_MFilterGroup.vue.d.ts +17 -0
  51. package/dist/composables/_caretPosition.d.ts +6 -0
  52. package/dist/composables/_useCamera.d.ts +16 -0
  53. package/dist/composables/_useFollowAnchor.d.ts +15 -0
  54. package/dist/composables/cron.d.ts +29 -0
  55. package/dist/composables/dashboardLayout.d.ts +28 -0
  56. package/dist/composables/filterBuilder.d.ts +55 -0
  57. package/dist/composables/mapAdapters.d.ts +6 -1
  58. package/dist/composables/mapSearch.d.ts +1 -0
  59. package/dist/composables/textDiff.d.ts +24 -0
  60. package/dist/composables/useLocale.d.ts +108 -0
  61. package/dist/draw.js +3 -3
  62. package/dist/flow.js +1 -1
  63. package/dist/gantt.js +1 -1
  64. package/dist/index.d.ts +25 -0
  65. package/dist/locales/index.js +749 -0
  66. package/dist/locales/index.js.map +1 -1
  67. package/dist/m3ui-vue.css +1 -1
  68. package/dist/m3ui.js +9888 -6940
  69. package/dist/m3ui.js.map +1 -1
  70. package/dist/map.d.ts +5 -0
  71. package/dist/map.js +1462 -576
  72. package/dist/map.js.map +1 -1
  73. package/dist/media.js +5 -5
  74. package/dist/pdf.js +5 -5
  75. package/dist/rich-text-editor.js +5 -5
  76. package/dist/styles.css +1 -1
  77. package/dist/{useLocale-COav9m8C.js → useLocale-DaVSTdm0.js} +108 -1
  78. package/dist/useLocale-DaVSTdm0.js.map +1 -0
  79. package/package.json +1 -1
  80. package/src/__tests__/MAddressField.test.ts +149 -0
  81. package/src/__tests__/MAudioRecorder.test.ts +125 -0
  82. package/src/__tests__/MCameraCapture.test.ts +154 -0
  83. package/src/__tests__/MCountrySelect.test.ts +67 -0
  84. package/src/__tests__/MCronField.test.ts +100 -0
  85. package/src/__tests__/MDashboardGrid.test.ts +122 -0
  86. package/src/__tests__/MDiffViewer.test.ts +68 -0
  87. package/src/__tests__/MExpansionPanel.test.ts +107 -0
  88. package/src/__tests__/MFilterBuilder.test.ts +130 -0
  89. package/src/__tests__/MMapCluster.test.ts +127 -0
  90. package/src/__tests__/MMapDraw.test.ts +188 -0
  91. package/src/__tests__/MMapLayers.test.ts +56 -0
  92. package/src/__tests__/MMentionField.test.ts +163 -0
  93. package/src/__tests__/MNotificationCenter.test.ts +94 -0
  94. package/src/__tests__/_fakeMaplibre.ts +14 -3
  95. package/src/__tests__/attrsFallthrough.test.ts +4 -0
  96. package/src/__tests__/cron.test.ts +68 -0
  97. package/src/__tests__/dashboardLayout.test.ts +45 -0
  98. package/src/__tests__/filterBuilder.test.ts +91 -0
  99. package/src/__tests__/followAnchor.test.ts +162 -0
  100. package/src/__tests__/ssr.test.ts +3 -0
  101. package/src/__tests__/textDiff.test.ts +37 -0
  102. package/src/components/MAddressField.vue +301 -0
  103. package/src/components/MAudioRecorder.vue +334 -0
  104. package/src/components/MAutocomplete.vue +3 -7
  105. package/src/components/MCameraCapture.vue +156 -0
  106. package/src/components/MCollapse.vue +91 -0
  107. package/src/components/MColorPicker.vue +4 -8
  108. package/src/components/MCountrySelect.vue +89 -0
  109. package/src/components/MCronField.vue +251 -0
  110. package/src/components/MDashboardGrid.vue +382 -0
  111. package/src/components/MDatePicker.vue +10 -7
  112. package/src/components/MDateRangePicker.vue +10 -7
  113. package/src/components/MDiffViewer.vue +234 -0
  114. package/src/components/MExpansionPanel.vue +56 -48
  115. package/src/components/MFilterBuilder.vue +47 -0
  116. package/src/components/MMapCluster.vue +295 -0
  117. package/src/components/MMapDraw.vue +601 -0
  118. package/src/components/MMapSearch.vue +1 -9
  119. package/src/components/MMentionField.vue +373 -0
  120. package/src/components/MMultiAutocomplete.vue +3 -7
  121. package/src/components/MMultiSelect.vue +3 -7
  122. package/src/components/MNotificationCenter.vue +252 -0
  123. package/src/components/MPhoneInput.vue +3 -10
  124. package/src/components/MQRScanner.vue +177 -0
  125. package/src/components/MSelect.vue +3 -7
  126. package/src/components/MTimePicker.vue +10 -7
  127. package/src/components/MTimezoneSelect.vue +116 -0
  128. package/src/components/_MFilterGroup.vue +210 -0
  129. package/src/composables/_caretPosition.ts +44 -0
  130. package/src/composables/_useCamera.ts +66 -0
  131. package/src/composables/_useFollowAnchor.ts +109 -0
  132. package/src/composables/cron.ts +179 -0
  133. package/src/composables/dashboardLayout.ts +94 -0
  134. package/src/composables/filterBuilder.ts +195 -0
  135. package/src/composables/mapAdapters.ts +29 -15
  136. package/src/composables/mapSearch.ts +10 -0
  137. package/src/composables/textDiff.ts +106 -0
  138. package/src/composables/useLocale.ts +215 -0
  139. package/src/index.ts +25 -0
  140. package/src/locales/de.ts +107 -0
  141. package/src/locales/es.ts +107 -0
  142. package/src/locales/fr.ts +107 -0
  143. package/src/locales/ja.ts +107 -0
  144. package/src/locales/ko.ts +107 -0
  145. package/src/locales/pt.ts +107 -0
  146. package/src/locales/zh.ts +107 -0
  147. package/src/map.ts +5 -0
  148. package/dist/MListItem-DVi1j1QI.js.map +0 -1
  149. package/dist/MMenuItem-CRNZkVVr.js.map +0 -1
  150. package/dist/_useEscapeStack-C5-BYr8y.js.map +0 -1
  151. package/dist/useLocale-COav9m8C.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MMenuItem-BuxYoASE.js","names":["_hoisted_1","_openBlock","_createElementBlock","$attrs","_hoisted_2","_hoisted_3","_hoisted_4","MMenuDivider","_openBlock","_createElementBlock","_Fragment","_createElementVNode","_mergeProps","_renderSlot","_createBlock","_Teleport","_createVNode","_Transition","_withCtx","_normalizeClass","_normalizeStyle","_unref","MIcon","_resolveDynamicComponent","_renderList","$slots","_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_withCtx","_createVNode","MIcon","_renderSlot","_createElementVNode","_toDisplayString","_unref","_Teleport","_Transition","_normalizeStyle","FAST_SPATIAL","sampleSpring","FAST_EFFECTS","playSamples","useSpring","prefersReducedMotion","motionSprings","MIcon_default","fitPopup","useEscapeStack","dropdownX","_hoisted_1$2","MMenuDivider_default","defineComponent","openBlock","createElementBlock","SHARED_AXIS_OFFSET","SLIDE_SETTLE_MS","SWIPE_SLOP","SWIPE_DISTANCE","SWIPE_VELOCITY","useMenuNav","navStack","ref","currentNav","computed","navDirection","navBox","leaveFromX","leaveFromOpacity","navSlideEnter","dir","anim","el","done","navSlideLeave","htmlEl","from","opacity","resizeAround","prevOverflow","restore","change","to","h","slide","r","pushNav","entry","nextTick","focusFirst","popNav","resetNav","swipe","levelEl","onNavPointerDown","level","onMove","onUp","onCancel","writeDrag","dx","dy","stopListening","a","dt","s","swallowClick","swallowTimer","stopSwallowing","settleBack","width","x","onUnmounted","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_hoisted_5","trajectoryStep","MMenu_default","__expose","props","__props","slots","useSlots","flattenVNodes","out","vnode","vnodes","Fragment","isGapDivider","gap","groups","raw","result","g","isGrouped","focusFirstItem","cachedTrajectory","openTrajectory","samples","scale","scaleVel","alpha","alphaVel","t","currentIdx","cancelActive","finishLeave","playTrajectory","last","opening","step","frames","i","style","ended","complete","panelEnter","placeX","panelLeave","open","triggerEl","dropdownEl","dropStyle","panelRegistry","inject","provide","watch","oldEl","siblingGroup","anchorRect","openAbove","computePos","rect","spaceBelow","originX","pivot","fromEdge","focusableItems","moveFocus","items","idx","toggle","close","onOutsideClick","panel","onScroll","onKeydown","onMounted","origin","createElementVNode","mergeProps","_ctx","renderSlot","createBlock","Teleport","createVNode","Transition","withCtx","normalizeClass","normalizeStyle","unref","_cache","args","resolveDynamicComponent","renderList","group","createCommentVNode","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","ICON_SPACE","MMenuItem_default","__emit","emit","checkable","selectable","on","slidingIcon","onIcon","position","measurePosition","itemEl","choice","n","prev","next","radii","top","bottom","tl","tr","br","bl","controlEl","iconSlotEl","snap","siblingsObserver","parent","tag","hasChildren","menuClose","nav","showSub","subStyle","positionSub","placeSub","sub","w","left","toggleSub","handleClick","onPointerEnter","onPointerLeave","onSubPointerLeave","related","\"width\"","\"opacity\"","toDisplayString"],"sources":["../src/components/MMenuDivider.vue","../src/composables/_useMenuNav.ts","../src/components/MMenu.vue","../src/components/MMenuItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A line between groups of items in an MMenu or MContextMenu; with `gap` in an expressive menu it splits the\n * menu into separate rounded groups.\n */\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","import { computed, nextTick, onUnmounted, ref } from 'vue'\nimport { motionSprings } from './motion'\nimport { playSamples, prefersReducedMotion, sampleSpring } from './_springAnimation'\n\n/*\n * Internal (not exported from index.ts): the `submenuMode=\"push\"` navigation shared by MMenu and MContextMenu.\n * A stack of levels (one per opened MMenuItem with #children) shown one at a time in the panel's scroll\n * wrapper (`navBox`), with:\n * - M3's shared axis X between levels: a 30dp slide with a crossfade, the old level fading out quickly and the\n * new one fading in after it. Driven by the Web Animations API through a `:css=\"false\"` Transition: with\n * direction-dependent classes on a mode-less Transition, Vue's class swap unreliably never completed.\n * - the panel's height following the new level on a spring (Standard DefaultSpatial), measured before and\n * after the swap, with no scrollbar while the levels cross.\n * - swipe right to go back on touch: the level follows the finger and, released past a third of the panel\n * (or flung), leaves from where it is; otherwise it springs back.\n */\n\nexport type MenuNavEntry = { icon?: string, header?: () => any, content?: () => any }\n\nconst SHARED_AXIS_OFFSET = 30\n// Back to scrolling once the slide (60ms delay + 300ms) has settled\nconst SLIDE_SETTLE_MS = 380\n// A touch decides between a vertical scroll and a swipe once it has moved this far\nconst SWIPE_SLOP = 8\nconst SWIPE_DISTANCE = 1 / 3\nconst SWIPE_VELOCITY = 0.5 // px/ms\n\nexport function useMenuNav(focusFirst: () => void) {\n const navStack = ref<MenuNavEntry[]>([])\n const currentNav = computed(() => navStack.value[navStack.value.length - 1])\n const navDirection = ref<'forward' | 'backward'>('forward')\n const navBox = ref<HTMLElement>()\n\n // Where a swiped level was released, so its leave starts there instead of jumping back to 0\n let leaveFromX = 0\n let leaveFromOpacity = 1\n\n function 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 * SHARED_AXIS_OFFSET}px)`, opacity: 0 },\n { transform: 'translateX(0)', opacity: 1 },\n ],\n { duration: 300, delay: 60, easing: 'cubic-bezier(0.05,0.7,0.1,1)', fill: 'backwards' },\n )\n anim.onfinish = done\n }\n\n function 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 from = leaveFromX\n const opacity = leaveFromOpacity\n leaveFromX = 0\n leaveFromOpacity = 1\n const anim = htmlEl.animate(\n [\n { transform: `translateX(${from}px)`, opacity },\n { transform: `translateX(${from + dir * SHARED_AXIS_OFFSET}px)`, opacity: 0 },\n ],\n { duration: 90, easing: 'cubic-bezier(0.3,0,0.8,0.15)', fill: 'forwards' },\n )\n anim.onfinish = done\n }\n\n function resizeAround(change: () => void) {\n const el = navBox.value\n const from = el?.offsetHeight ?? 0\n // Both levels overflow for a moment: no scrollbar until they settle, then the wrapper's own inline value\n const prevOverflow = el?.style.overflowY ?? ''\n if (el) el.style.overflowY = 'hidden'\n const restore = () => { if (el) el.style.overflowY = prevOverflow }\n change()\n if (!el || prefersReducedMotion()) return restore()\n nextTick(() => {\n const to = el.offsetHeight\n const anim = Math.abs(to - from) < 1 ? null\n : playSamples(el, sampleSpring(from, to, 0, motionSprings.standard.defaultSpatial, 0.5), (h) => ({ height: `${h}px` }))\n const slide = new Promise((r) => setTimeout(r, SLIDE_SETTLE_MS))\n Promise.all([slide, anim?.finished.catch(() => {})]).then(restore)\n })\n }\n\n function pushNav(entry: MenuNavEntry) {\n navDirection.value = 'forward'\n resizeAround(() => navStack.value.push(entry))\n nextTick(focusFirst)\n }\n\n function popNav() {\n navDirection.value = 'backward'\n resizeAround(() => navStack.value.pop())\n nextTick(focusFirst)\n }\n\n function resetNav() {\n navStack.value = []\n }\n\n // Swipe back. The wrapper has `touch-action: pan-y` while a level is pushed, so a sideways drag reaches us\n // as pointer events while vertical ones still scroll the list\n let swipe: { id: number, x: number, y: number, level: HTMLElement, width: number, active: boolean, lastX: number, lastT: number, vel: number } | null = null\n\n function levelEl() {\n // The level on screen (a level still leaving has another depth)\n return navBox.value?.querySelector<HTMLElement>(`:scope > [data-menu-level=\"${navStack.value.length}\"]`) ?? null\n }\n\n function onNavPointerDown(e: PointerEvent) {\n if (e.pointerType !== 'touch' || !navStack.value.length || swipe) return\n const level = levelEl()\n if (!level) return\n swipe = { id: e.pointerId, x: e.clientX, y: e.clientY, level, width: navBox.value!.clientWidth, active: false, lastX: e.clientX, lastT: e.timeStamp, vel: 0 }\n window.addEventListener('pointermove', onMove)\n window.addEventListener('pointerup', onUp)\n window.addEventListener('pointercancel', onCancel)\n }\n\n function writeDrag(dx: number) {\n if (!swipe) return\n swipe.level.style.transform = `translateX(${dx}px)`\n swipe.level.style.opacity = String(1 - 0.5 * Math.min(1, dx / swipe.width))\n }\n\n function onMove(e: PointerEvent) {\n if (!swipe || e.pointerId !== swipe.id) return\n const dx = e.clientX - swipe.x\n const dy = e.clientY - swipe.y\n if (!swipe.active) {\n if (Math.hypot(dx, dy) < SWIPE_SLOP) return\n // Vertical (a scroll) or leftwards: not ours\n if (Math.abs(dy) > Math.abs(dx) || dx < 0) return stopListening()\n swipe.active = true\n swipe.x = e.clientX\n swipe.level.getAnimations().forEach((a) => a.finish())\n }\n const dt = e.timeStamp - swipe.lastT\n if (dt > 0) swipe.vel = 0.8 * ((e.clientX - swipe.lastX) / dt) + 0.2 * swipe.vel\n swipe.lastX = e.clientX\n swipe.lastT = e.timeStamp\n writeDrag(Math.max(0, e.clientX - swipe.x))\n }\n\n function onUp(e: PointerEvent) {\n if (!swipe || e.pointerId !== swipe.id) return\n const s = swipe\n stopListening()\n if (!s.active) return\n // The finger lifted on an item: that's not a tap on it. The click comes in a later task, so the guard\n // waits for it a little while\n window.addEventListener('click', swallowClick, { capture: true, once: true })\n clearTimeout(swallowTimer)\n swallowTimer = setTimeout(stopSwallowing, 400)\n const dx = Math.max(0, e.clientX - s.x)\n if (dx > s.width * SWIPE_DISTANCE || s.vel > SWIPE_VELOCITY) {\n leaveFromX = dx\n leaveFromOpacity = Number(s.level.style.opacity || 1)\n popNav()\n }\n else settleBack(s.level, dx)\n }\n\n function onCancel(e: PointerEvent) {\n if (!swipe || e.pointerId !== swipe.id) return\n const s = swipe\n stopListening()\n if (s.active) settleBack(s.level, Math.max(0, s.lastX - s.x))\n }\n\n function settleBack(level: HTMLElement, dx: number) {\n level.style.transform = ''\n level.style.opacity = ''\n if (prefersReducedMotion() || dx < 1) return\n const width = navBox.value?.clientWidth || 1\n playSamples(level, sampleSpring(dx, 0, 0, motionSprings.standard.defaultSpatial, 0.5), (x) => ({\n transform: `translateX(${x}px)`,\n opacity: String(1 - 0.5 * Math.min(1, x / width)),\n }))\n }\n\n let swallowTimer: ReturnType<typeof setTimeout> | undefined\n function stopSwallowing() {\n clearTimeout(swallowTimer)\n window.removeEventListener('click', swallowClick, { capture: true })\n }\n\n function swallowClick(e: Event) {\n e.stopPropagation()\n e.preventDefault()\n }\n\n function stopListening() {\n swipe = null\n window.removeEventListener('pointermove', onMove)\n window.removeEventListener('pointerup', onUp)\n window.removeEventListener('pointercancel', onCancel)\n }\n\n onUnmounted(() => {\n stopListening()\n stopSwallowing()\n })\n\n return { navStack, currentNav, navBox, navSlideEnter, navSlideLeave, pushNav, popNav, resetNav, onNavPointerDown }\n}\n","<script setup lang=\"ts\">\n/**\n * A trigger-based dropdown menu, composed with `MMenuItem` and `MMenuDivider`. Items support unlimited-depth\n * nested submenus via the `#children` slot.\n *\n * @slot trigger The element that opens the menu when clicked; `open` tells whether it's open.\n * @slot default The menu's items (MMenuItem, MMenuDivider or your own markup); `close()` closes the menu.\n */\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'\nimport { useEscapeStack } from '../composables/_useEscapeStack'\nimport { useMenuNav } from '../composables/_useMenuNav'\nimport { POPUP_MARGIN, dropdownX } from '../composables/_popupPosition'\n\ndefineOptions({ inheritAttrs: false })\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 (4dp corners). 'expressive' is M3's rounder 'vertical menu' styling\n * (16dp corners) — combine with `<MMenuDivider gap />` to split the panel into independently-rounded groups\n * with a visible gap, instead of a plain divider line.\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 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\nconst { navStack, currentNav, navBox, navSlideEnter, navSlideLeave, pushNav, popNav, onNavPointerDown } = useMenuNav(() => focusFirstItem())\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 animation actually stops instead\n// of running alongside the new one, fighting over the same style) have to live outside this function to survive that interruption.\nlet currentIdx = 0\nlet cancelActive: (() => void) | null = null\n// Set only while a close is playing: stops the animation *and* calls its `done()`.\n// Used on unmount — a menu item that navigates away (e.g. \"Log out\" ->\n// router.push) unmounts this component mid-close, and Vue only removes the\n// Teleported panel from <body> inside the leave's `done()`, so merely\n// cancelling the animation there left the half-closed panel stranded on screen.\nlet finishLeave: (() => 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 from = Math.round(Math.max(0, Math.min(last, currentIdx)))\n const to = opening ? last : 0\n const step = opening ? 1 : -1\n const frames: { scale: number, alpha: number }[] = []\n for (let i = from; opening ? i <= to : i >= to; i += step) frames.push(samples[i]!)\n const style = (s: { scale: number, alpha: number }) => ({\n transform: `scale(${s.scale})`,\n opacity: String(Math.min(1, Math.max(0, s.alpha))),\n })\n // Played as a Web Animation (see _springAnimation.ts), which the compositor runs, so the open isn't janked by\n // the panel's content mounting at the same moment. The end state goes inline underneath it.\n Object.assign(htmlEl.style, style(samples[to]!))\n let ended = false\n function complete() {\n if (ended) return\n ended = true\n currentIdx = to\n cancelActive = null\n finishLeave = null\n done()\n }\n if (frames.length < 2 || typeof htmlEl.animate !== 'function') return complete()\n const anim = htmlEl.animate(frames.map(style), { duration: (frames.length - 1) * trajectoryStep * 1000, easing: 'linear' })\n anim.finished.catch(() => {})\n anim.onfinish = complete\n cancelActive = () => {\n // Remember where it got to, so the reversal continues from there\n const t = Number(anim.currentTime ?? 0) / (trajectoryStep * 1000)\n currentIdx = Math.max(0, Math.min(last, from + step * t))\n ended = true\n anim.cancel()\n }\n finishLeave = opening ? null : () => { cancelActive?.(); cancelActive = null; finishLeave = null; done() }\n}\nfunction panelEnter(el: Element, done: () => void) {\n placeX(el as HTMLElement)\n playTrajectory(el, done, true)\n}\nfunction panelLeave(el: Element, done: () => void) {\n playTrajectory(el, done, false)\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\n// The vertical side and height from the trigger alone; the horizontal position needs the panel's width, so\n// placeX() sets it once the panel is in the DOM (in its enter hook, before it paints). Until then it sits at the\n// window's left edge, where nothing narrows it while it's measured.\nlet anchorRect: DOMRect | null = null\nconst openAbove = ref(false)\nfunction computePos() {\n if (!triggerEl.value) return\n const rect = triggerEl.value.getBoundingClientRect()\n anchorRect = rect\n const spaceBelow = window.innerHeight - rect.bottom - 8\n openAbove.value = spaceBelow < 200 && rect.top > spaceBelow\n\n const style: Record<string, string> = {\n maxHeight: `${Math.min(openAbove.value ? rect.top - 12 : spaceBelow, 400)}px`,\n maxWidth: `${window.innerWidth - 2 * POPUP_MARGIN}px`,\n left: '0px',\n }\n\n if (openAbove.value) {\n style.bottom = `${window.innerHeight - rect.top + 4}px`\n } else {\n style.top = `${rect.bottom + 4}px`\n }\n\n dropStyle.value = style\n}\n\n// Keeps the panel on screen (Compose's DropdownMenuPositionProvider, see _popupPosition.ts): aligned with the\n// trigger's `align` edge if it fits there, else its other edge, else against the window edge on its side. The\n// animation grows from the trigger, wherever the panel ended up.\nconst originX = ref(props.align === 'right' ? 'right' : 'left')\nfunction placeX(el: HTMLElement) {\n if (!anchorRect) return\n const width = el.offsetWidth\n const x = dropdownX(anchorRect, width, window.innerWidth, props.align === 'right' ? 'end' : 'start')\n const pivot = Math.min(width, Math.max(0, (anchorRect.left + anchorRect.right) / 2 - x))\n const fromEdge = Math.abs(x - anchorRect.left) < 1 ? 'left' : Math.abs(x + width - anchorRect.right) < 1 ? 'right' : `${pivot}px`\n originX.value = fromEdge\n dropStyle.value = { ...dropStyle.value, left: `${x}px` }\n // Now, not on the next render: the enter animation starts this frame\n el.style.left = `${x}px`\n el.style.transformOrigin = `${fromEdge} ${openAbove.value ? 'bottom' : 'top'}`\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\n// Escape goes through the library's stack, so a menu open in a dialog or an overlay closes alone (a pushed\n// submenu steps back first)\nuseEscapeStack(() => open.value, () => (navStack.value.length ? popNav() : close()))\n\nfunction onKeydown(e: KeyboardEvent) {\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 if (finishLeave) finishLeave()\n else cancelActive?.()\n})\n\nconst origin = computed(() => `${originX.value} ${openAbove.value ? 'bottom' : 'top'}`)\n</script>\n\n<template>\n <div ref=\"triggerEl\" v-bind=\"$attrs\" 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\n ref=\"navBox\"\n class=\"relative overflow-x-hidden overflow-y-auto overscroll-contain py-1\"\n :style=\"{ maxHeight: dropStyle.maxHeight, touchAction: currentNav ? 'pan-y' : undefined }\"\n @pointerdown=\"onNavPointerDown\"\n >\n <Transition :css=\"false\" @enter=\"navSlideEnter\" @leave=\"navSlideLeave\">\n <div v-if=\"currentNav\" :key=\"navStack.length\" :data-menu-level=\"navStack.length\">\n <!-- Back: a header row in the menu's own item metrics, labelled like an M3 menu group, then a divider -->\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-3 px-4 py-2.5 text-left text-label-large text-on-surface-variant 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=\"arrow_back\" :size=\"20\" class=\"shrink-0\" />\n <span class=\"flex-1 truncate\"><component :is=\"() => currentNav?.header?.()\" /></span>\n </button>\n <hr class=\"my-1 border-outline-variant\" />\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\">\n/**\n * An item of an MMenu or MContextMenu: icon, label and a shortcut hint. Put more items in its `#children` slot\n * to make it open a submenu. With `selected` it's one choice of several (Compose's SelectableDropdownMenuItem),\n * with `checked` an on/off setting (CheckableDropdownMenuItem): tertiary-container and rounder while on, with a\n * check that slides in.\n *\n * @slot default Item label text.\n * @slot icon Replaces the leading icon (an `MIcon` with a class, an image, an avatar…), `{ on }` while selected or\n * checked. It gets the icon's 20px box and color\n * @slot children Nested submenu items. In the parent MMenu's default 'flyout' mode, clicking or hovering (mouse\n * only) the item opens a side panel — supports unlimited nesting depth. In 'push' mode, clicking the item\n * instead swaps the whole menu panel to the submenu with a back header; hover does nothing.\n * @event click Emitted when a leaf item (no #children) is clicked. Not emitted for disabled items or for items\n * with #children, since clicking those just opens/toggles the submenu instead.\n * @event update:checked Emitted on click when `checked` is set, with the new value — powers v-model:checked\n */\nimport { computed, inject, nextTick, onMounted, onUnmounted, ref, useSlots, watch } from 'vue'\nimport MIcon from './MIcon.vue'\nimport { FAST_EFFECTS, FAST_SPATIAL, useSpring } from '../composables/_useSpring'\nimport { POPUP_MARGIN, fitPopup } from '../composables/_popupPosition'\n\nconst props = withDefaults(defineProps<{\n /** Material Symbol icon name */\n icon?: string\n /** Keyboard shortcut hint displayed on the right (e.g. \"Ctrl+C\") — hidden when the item has #children */\n shortcut?: string\n /** Vue Router destination — renders as RouterLink instead of button */\n to?: string | Record<string, any>\n /** Disables the item */\n disabled?: boolean\n /** Danger/destructive styling (error color) */\n danger?: boolean\n /** Keep the menu open after this item is clicked. Defaults to true for `checked` items, false otherwise */\n keepOpen?: boolean\n /** Makes it one choice of several (radio-like): selected look while true. Leave unset for a plain item */\n selected?: boolean\n /** Makes it an on/off setting (v-model:checked, checkbox-like): checked look while true. Leave unset for a plain item */\n checked?: boolean\n /**\n * Icon shown while selected or checked. Defaults to a check that slides in when the item has no `icon`;\n * with an `icon`, that icon stays and turns filled\n */\n selectedIcon?: string\n}>(), {\n disabled: false,\n danger: false,\n keepOpen: undefined,\n selected: undefined,\n checked: undefined,\n})\n\nconst emit = defineEmits<{ click: [], 'update:checked': [boolean] }>()\n\nconst slots = useSlots()\nconst checkable = computed(() => props.checked !== undefined)\nconst selectable = computed(() => checkable.value || props.selected !== undefined)\nconst on = computed(() => !!(props.checked ?? props.selected))\n// Without an `icon`, the selected icon (a check by default) only shows while on and slides the label aside\nconst slidingIcon = computed(() => selectable.value && !props.icon && !slots.icon)\nconst onIcon = computed(() => props.selectedIcon ?? (props.icon ? undefined : 'check'))\n\n// Where this item sits in a run of consecutive selectable/checkable siblings, MenuDefaults.itemShape(index,\n// count): the first rounds its top corners, the last its bottom ones, a lone one stays square-ish\nconst position = ref<'single' | 'first' | 'middle' | 'last'>('single')\nfunction measurePosition() {\n const el = itemEl.value\n if (!el || !selectable.value) return\n const choice = (n: Element | null) => !!n?.hasAttribute('data-m3-menu-choice')\n const prev = choice(el.previousElementSibling)\n const next = choice(el.nextElementSibling)\n position.value = prev && next ? 'middle' : prev ? 'last' : next ? 'first' : 'single'\n}\n\n// Item shapes (SegmentedMenuTokens, MenuDefaults' leading/middle/trailing/standalone item shapes): ItemShape\n// 4dp, CornerMedium 12dp on the group's outer corners, ItemSelectedShape 12dp all round; corners morph on\n// FastSpatial. The sliding icon expands on FastSpatial and fades on FastEffects (AnimatedVisibility's\n// expandHorizontally + fadeIn).\nconst ICON_SPACE = 32 // 20dp icon + 12dp to the label\nfunction radii(): number[] {\n if (on.value) return [12, 12, 12, 12]\n const top = position.value === 'first' ? 12 : 4\n const bottom = position.value === 'last' ? 12 : 4\n return [top, top, bottom, bottom]\n}\nconst { snap } = useSpring(\n () => (selectable.value ? [...radii(), slidingIcon.value && on.value ? ICON_SPACE : 0] : []),\n ([tl, tr, br, bl, width]) => {\n const el = controlEl.value instanceof HTMLElement ? controlEl.value : controlEl.value?.$el\n if (el && bl !== undefined) el.style.borderRadius = `${tl}px ${tr}px ${br}px ${bl}px`\n if (iconSlotEl.value && width !== undefined) iconSlotEl.value.style.width = `${width}px`\n },\n FAST_SPATIAL,\n)\n// A position change comes from the layout (items added, removed, the menu opening): jump, don't morph\nwatch(position, () => snap())\n\nlet siblingsObserver: MutationObserver | null = null\nonMounted(() => {\n measurePosition()\n const parent = itemEl.value?.parentElement\n if (!parent) return\n siblingsObserver = new MutationObserver(measurePosition)\n siblingsObserver.observe(parent, { childList: true })\n})\nonUnmounted(() => siblingsObserver?.disconnect())\nwatch(selectable, () => nextTick(measurePosition))\nuseSpring(\n () => (slidingIcon.value ? [on.value ? 1 : 0] : []),\n ([opacity]) => { if (iconSlotEl.value && opacity !== undefined) iconSlotEl.value.style.opacity = String(opacity) },\n FAST_EFFECTS,\n)\n\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>()\n// The button, or a RouterLink instance when `to` is set\nconst controlEl = ref<HTMLElement | { $el: HTMLElement }>()\nconst iconSlotEl = ref<HTMLElement>()\nconst showSub = ref(false)\nconst subStyle = ref<Record<string, string>>({})\n\n// To the item's right, else its left, else clamped on screen (see _popupPosition.ts); placeSub() settles it once\n// the submenu is in the DOM and its size is known, before it paints\nfunction positionSub() {\n if (!itemEl.value) return\n const rect = itemEl.value.getBoundingClientRect()\n subStyle.value = {\n position: 'fixed',\n top: `${rect.top}px`,\n left: `${rect.right}px`,\n maxWidth: `${window.innerWidth - 2 * POPUP_MARGIN}px`,\n zIndex: '501',\n }\n}\n\nfunction placeSub(el: Element) {\n if (!itemEl.value) return\n const sub = el as HTMLElement\n const rect = itemEl.value.getBoundingClientRect()\n // Measured at the window's left edge, where nothing narrows it\n sub.style.left = '0px'\n const w = sub.offsetWidth\n const h = sub.offsetHeight\n const left = fitPopup([rect.right, rect.left - w], w, window.innerWidth)\n const top = fitPopup([rect.top, rect.bottom - h], h, window.innerHeight)\n subStyle.value = { ...subStyle.value, left: `${left}px`, top: `${top}px` }\n sub.style.left = `${left}px`\n sub.style.top = `${top}px`\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 if (checkable.value) emit('update:checked', !props.checked)\n emit('click')\n if (!(props.keepOpen ?? checkable.value)) 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 :data-m3-menu-choice=\"selectable || undefined\"\n @pointerenter=\"onPointerEnter\"\n @pointerleave=\"onPointerLeave\"\n >\n <!-- Selectable/checkable items sit 4dp in from the edges (DropdownMenuSelectableItemPadding) with 12dp\n inside, so their label lines up with plain items; the state layer is a pseudo-element so it can\n tint the selected container too -->\n <component\n :is=\"tag\"\n ref=\"controlEl\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n :role=\"selectable ? (checkable ? 'menuitemcheckbox' : 'menuitemradio') : undefined\"\n :aria-checked=\"selectable ? on : undefined\"\n class=\"flex items-center gap-3 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=\"selectable\n ? [\n 'relative mx-1 w-[calc(100%-0.5rem)] px-3 duration-150 before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity',\n on ? 'bg-tertiary-container text-on-tertiary-container' : 'text-on-surface',\n disabled ? 'cursor-not-allowed opacity-[0.38]' : 'cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]',\n ]\n : [\n 'w-full px-4',\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 <!-- -mr-3 cancels the flex gap, so the label sits flush while the slot is closed -->\n <span v-if=\"slidingIcon\" ref=\"iconSlotEl\" class=\"-mr-3 flex shrink-0 overflow-hidden\" style=\"width: 0; opacity: 0\">\n <MIcon :name=\"onIcon!\" :size=\"20\" class=\"shrink-0\" />\n </span>\n <span\n v-else-if=\"$slots.icon\"\n class=\"flex size-5 shrink-0 items-center justify-center\"\n :class=\"selectable ? (on ? '' : 'text-on-surface-variant') : danger ? 'text-error' : 'text-on-surface-variant'\"\n >\n <slot name=\"icon\" :on=\"on\" />\n </span>\n <MIcon\n v-else-if=\"icon\"\n :name=\"on && onIcon ? onIcon : icon\"\n :filled=\"on && !onIcon\"\n :size=\"20\"\n class=\"shrink-0\"\n :class=\"selectable ? (on ? '' : 'text-on-surface-variant') : danger ? 'text-error' : 'text-on-surface-variant'\"\n />\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 @enter=\"placeSub\"\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":";;;;;;;;;;;;;E,kBAqBEC,EAAA,GAAAC,EAA0C,MAA1CF,CAA0C;;A,ICFtCyD,KAAqB,IAErBC,IAAkB,KAElBC,KAAa,GACbC,IAAiB,IAAI,GACrBC,KAAiB;AAEvB,SAAgBC,EAAW,GAAwB;CACjD,IAAMC,IAAWC,EAAoB,CAAC,CAAC,GACjCC,IAAaC,QAAeH,EAAS,MAAMA,EAAS,MAAM,SAAS,EAAE,GACrEI,IAAeH,EAA4B,SAAS,GACpDI,IAASJ,EAAiB,GAG5BK,IAAa,GACbC,IAAmB;CAEvB,SAASC,EAAc,GAAa,GAAkB;EACpD,IAAMC,IAAML,EAAa,UAAU,YAAY,IAAI,IAC7CM,IAAQC,EAAmB,QAC/B,CACE;GAAE,WAAW,cAAcF,IAAMf,GAAmB;GAAM,SAAS;EAAE,GACrE;GAAE,WAAW;GAAiB,SAAS;EAAE,CAC3C,GACA;GAAE,UAAU;GAAK,OAAO;GAAI,QAAQ;GAAgC,MAAM;EAAY,CACxF;EACA,EAAK,WAAWkB;CAClB;CAEA,SAASC,EAAc,GAAa,GAAkB;EACpD,IAAMJ,IAAML,EAAa,UAAU,YAAY,KAAK,GAC9CU,IAASH;EAGf,AAFA,EAAO,MAAM,WAAW,YACxB,EAAO,MAAM,cAAc,KAC3B,EAAO,MAAM,MAAM;EACnB,IAAMI,IAAOT,GACPU,IAAUT;E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QADblG,EAAA,GAAAE,EAOEK,GAAA;;KALC,MAAM4L,EAAA,SAAME,EAAA,QAASA,EAAA,QAASnG,EAAA;KAC9B,QAAQiG,EAAA,SAAE,CAAKE,EAAA;KACf,MAAM;KACP,OAAKjM,EAAA,CAAC,YACE8L,EAAA,QAAcC,EAAA,QAAE,KAAA,4BAAqCjG,EAAA,SAAM,eAAA,yBAAA,CAAA;;;;;;IAErEzF,EAAoC,QAApCiL,IAAoC,CAAflL,EAAQiK,EAAA,QAAA,SAAA,C;IACjBvE,EAAA,YAAQ,CAAKwH,EAAA,SAAzB1N,EAAA,GAAAC,EAAqI,QAArI0L,GAAqIjL,EAAlBwF,EAAA,QAAQ,GAAA,CAAA,K;IAC9GwH,EAAA,SAAb1N,EAAA,GAAAE,EAAqGK,GAAA;;KAA3E,MAAK;KAAiB,MAAM;KAAI,OAAM;;;;;;;;;;;;;E,KAIlDmN,EAAA,SAAe/M,EAAAiN,CAAA,CAAG,EAAE,SAAI,UAAxC5N,EAAA,GAAAE,EAqBWU,GAAA;;GArB0C,IAAG;E,IACtDN,EAmBaO,GAAA;GAlBX,sBAAmB;GACnB,oBAAiB;GACjB,sBAAmB;GACnB,kBAAe;GACd,SAAOmN;;GAER,SAAA3N,SAWM,CAVEwN,EAAA,SADR7N,EAAA,GAAAC,EAWM,OAAA;;IATJ,OAAM;IACL,OAAKa,EAAEgN,EAAA,KAAQ;IACf,gBAAcU;G,IAIf/N,EAEM,OAFNmL,GAEM,CADJpL,EAAwBiK,EAAA,QAAA,UAAA,C"}
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-COav9m8C.js";
1
+ import { i as e } from "./useLocale-DaVSTdm0.js";
2
2
  import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as ee, openBlock as u, ref as d, renderList as te, renderSlot as ne, toDisplayString as f, unref as p, watch as m } from "vue";
3
3
  // src/components/MSeekBar.vue?vue&type=script&setup=true&lang.ts
4
4
  var re = [
@@ -431,4 +431,4 @@ var re = [
431
431
  });
432
432
  export { de as t };
433
433
 
434
- //# sourceMappingURL=MSeekBar-BL2W5_rD.js.map
434
+ //# sourceMappingURL=MSeekBar-C4cn9RIF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MSeekBar-BL2W5_rD.js","names":["_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_toDisplayString","_createElementVNode","_unref","_Fragment","_renderList","_renderSlot","useLocale","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","MSeekBar_default","defineComponent","__emit","props","__props","emit","locale","SIZES","s","computed","dur","inactive","ROLES","colors","active","pad","n","fmt","t","sec","h","m","scrubTime","ref","pos","current","showRemaining","v","toggleRemaining","timeStyle","startText","endText","valueText","chapterAt","found","c","trackEl","width","toPx","thumbX","x","inset","bufferedRanges","b","pieces","W","track","trackH","chapterGap","cuts","cx","gap","p","q","spans","at","c0","c1","full","small","playedTo","a","fills","t0","t1","l","r","stopDot","pressed","focused","hovered","thumbStyle","base","d","scale","dotIdle","narrow","hoverTime","previewTime","previewChapter","bubbleEl","bubbleW","bubbleObserver","el","previewX","half","press","timeAt","clientX","scrubTo","begin","commit","now","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","dx","dy","end","onHover","onLeave","onKeyDown","steps","baseAt","raf","last","amp","phase","wavePathEl","svgH","reducedMotion","ampTarget","advancing","syncPos","drawWave","path","wave","mid","k","length","px","frame","dt","kick","watch","resizeObserver","onMounted","onBeforeUnmount","openBlock","createElementBlock","normalizeClass","normalizeStyle","toDisplayString","createCommentVNode","createElementVNode","unref","_cache","Fragment","renderList","i","j","f","renderSlot","_ctx"],"sources":["../src/components/MSeekBar.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface SeekBarChapter {\n /** Where the chapter starts, in seconds */\n start: number\n /** Shown in the preview while the pointer is over it */\n title?: string\n}\n</script>\n\n<script setup lang=\"ts\">\n/**\n * A media seek bar (not an M3 spec component; Media3's ProgressSlider is a plain M3 Slider, which this follows in\n * its default look): the playback position on a track with the buffered part, optional chapters, elapsed and\n * total (or remaining) time, and a preview of the time under the pointer. Dragging scrubs locally and seeks once\n * on release (or live, with `live`); a tap or click seeks to that point. While `playing`, it advances on its own\n * between `modelValue` updates, so a 4Hz `timeupdate` still moves it smoothly.\n *\n * @slot preview Replaces the bubble shown above the pointer while hovering or dragging (a frame preview, say).\n * Props: `{ time, formatted, chapter }`\n * @event update:modelValue Emitted on a seek (and continuously while dragging with `live`) — powers v-model\n * @event seek Emitted once per seek with its time: on release of a drag, a tap or click, or a key press\n * @event scrub-start Emitted when a drag starts, with its time\n * @event scrub Emitted while dragging, with the time under the pointer\n * @event update:remaining Emitted when the end label is clicked to switch between total and remaining time\n */\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { useLocale } from '../composables/useLocale'\n\nconst props = withDefaults(defineProps<{\n /** Playback position in seconds (v-model) */\n modelValue: number\n /** Media length in seconds; 0, NaN or Infinity (not loaded yet, a live stream) disables seeking */\n duration: number\n /** How much is loaded: up to a time, or time ranges (`[[start, end], …]`, like a media element's `buffered`) */\n buffered?: number | [number, number][]\n /** Chapter starts, drawn as gaps in the track; their titles show in the preview */\n chapters?: SeekBarChapter[]\n /** The media is playing: the bar moves on its own between updates, and the wavy line waves */\n playing?: boolean\n /** Playback speed, for that motion between updates */\n playbackRate?: number\n /** Updates the v-model continuously while dragging (the media follows the thumb), not only on release */\n live?: boolean\n /** `slider`: the M3 slider (bar thumb with a gap around it). `line`: a plain line with a round thumb. `wavy`: the played part waves while playing */\n variant?: 'slider' | 'line' | 'wavy'\n /** Track thickness: `md` (16px, the smallest M3 slider), `sm` (8px) or `xs` (4px, over a video) */\n size?: 'xs' | 'sm' | 'md'\n /** Where the elapsed and total time go */\n time?: 'below' | 'sides' | 'none'\n /** The end label shows the remaining time (`-1:23`) instead of the total; clicking it switches (v-model:remaining) */\n remaining?: boolean\n /** Formats a time in seconds. Default `m:ss`, or `h:mm:ss` for media an hour or longer */\n format?: (seconds: number) => string\n /** Seconds the arrow keys move; Page Up/Down move 10% */\n keyStep?: number\n /** Shows the time (and chapter) above the pointer while hovering or dragging */\n preview?: boolean\n /** Played part and thumb: an M3 role (`primary`, `secondary`, `tertiary`, `error`) or any CSS color */\n color?: string\n /** Unplayed track: an M3 role or any CSS color. Default secondary-container */\n trackColor?: string\n /** The time labels' color, as a CSS color (white over a video, say). Default on-surface-variant */\n timeColor?: string\n /** Disables seeking */\n disabled?: boolean\n /** Accessible name. Default the locale's `seekBar` */\n label?: string\n}>(), {\n playing: false,\n playbackRate: 1,\n live: false,\n variant: 'slider',\n size: 'md',\n time: 'below',\n remaining: false,\n keyStep: 5,\n preview: true,\n color: 'primary',\n disabled: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [number]\n seek: [number]\n 'scrub-start': [number]\n scrub: [number]\n 'update:remaining': [boolean]\n}>()\n\nconst locale = useLocale()\n\n// track: thickness; thumbH: the bar thumb's height (md = MSlider xs, SliderTokens.HandleHeight); dot: the line\n// variant's round thumb under the pointer, dotIdle at rest (the thinner the line, the more it grows, as a\n// video player's does); gap: around the bar thumb; hit: the pointer target's height; wave/amp/length: the wavy line\nconst SIZES = {\n xs: { track: 4, thumbH: 16, dot: 21, dotIdle: 10, gap: 4, hit: 32, wave: 4, amp: 2.5, length: 18 },\n sm: { track: 8, thumbH: 28, dot: 20, dotIdle: 14, gap: 5, hit: 40, wave: 6, amp: 3, length: 22 },\n md: { track: 16, thumbH: 44, dot: 28, dotIdle: 21, gap: 6, hit: 46, wave: 8, amp: 4, length: 26 },\n}\nconst s = computed(() => SIZES[props.size] ?? SIZES.md)\n\nconst dur = computed(() => (Number.isFinite(props.duration) && props.duration > 0 ? props.duration : 0))\nconst inactive = computed(() => props.disabled || !dur.value)\n\n// ── Colors (as in MSlider: a role name or any CSS color; disabled per SliderTokens) ─────────────────────\nconst ROLES: Record<string, string> = {\n primary: 'var(--color-primary)',\n secondary: 'var(--color-secondary)',\n tertiary: 'var(--color-tertiary)',\n error: 'var(--color-error)',\n 'secondary-container': 'var(--color-secondary-container)',\n}\nconst colors = computed(() => {\n if (props.disabled) {\n return {\n active: 'color-mix(in srgb, var(--color-on-surface) 38%, transparent)',\n inactive: 'color-mix(in srgb, var(--color-on-surface) 12%, transparent)',\n buffered: 'color-mix(in srgb, var(--color-on-surface) 20%, transparent)',\n }\n }\n const active = ROLES[props.color] ?? props.color\n const inactive = props.trackColor ? ROLES[props.trackColor] ?? props.trackColor : 'var(--color-secondary-container)'\n return { active, inactive, buffered: `color-mix(in srgb, ${active} 35%, ${inactive})` }\n})\n\n// ── Time ────────────────────────────────────────────────────────────────────────────────────────────────\nconst pad = (n: number) => String(n).padStart(2, '0')\nfunction fmt(t: number) {\n if (props.format) return props.format(t)\n const sec = Math.max(0, Math.floor(t))\n const h = Math.floor(sec / 3600)\n const m = Math.floor((sec % 3600) / 60)\n return (dur.value >= 3600 ? `${h}:${pad(m)}` : String(h * 60 + m)) + ':' + pad(sec % 60)\n}\n\n// The shown position: the drag's while scrubbing, else `pos`, which follows modelValue and, while playing,\n// advances on its own (only written when it moves half a pixel or crosses a second, so it re-renders rarely)\nconst scrubTime = ref<number | null>(null)\nconst pos = ref(props.modelValue)\nconst current = computed(() => Math.min(dur.value || Infinity, Math.max(0, scrubTime.value ?? pos.value)))\n\nconst showRemaining = ref(props.remaining)\nwatch(() => props.remaining, (v) => { showRemaining.value = v })\nfunction toggleRemaining() {\n showRemaining.value = !showRemaining.value\n emit('update:remaining', showRemaining.value)\n}\nconst timeStyle = computed(() => (props.timeColor ? { color: props.timeColor } : undefined))\nconst startText = computed(() => fmt(current.value))\nconst endText = computed(() => {\n if (!dur.value) return '--:--'\n return showRemaining.value ? `-${fmt(dur.value - current.value)}` : fmt(dur.value)\n})\nconst valueText = computed(() =>\n locale.seekBarValue.replace('{position}', fmt(current.value)).replace('{duration}', dur.value ? fmt(dur.value) : '--:--'),\n)\n\nconst chapterAt = (t: number) => {\n let found: SeekBarChapter | null = null\n for (const c of props.chapters ?? []) if (c.start <= t && (!found || c.start >= found.start)) found = c\n return found\n}\n\n// ── Geometry (px, from the measured track width) ────────────────────────────────────────────────────────\nconst trackEl = ref<HTMLElement>()\nconst width = ref(0)\nconst toPx = (t: number) => (dur.value ? (width.value * Math.min(1, Math.max(0, t / dur.value))) : 0)\n\n// The bar thumb keeps clear of the track's ends, as MSlider's thumbInset; the round one may overhang them\nconst thumbX = computed(() => {\n const x = toPx(current.value)\n if (props.variant === 'line') return x\n const inset = Math.max(2, s.value.track * 0.3)\n return Math.min(width.value - inset, Math.max(inset, x))\n})\n\nconst bufferedRanges = computed<[number, number][]>(() => {\n const b = props.buffered\n if (b === undefined) return []\n return typeof b === 'number' ? [[0, b]] : b\n})\n\ninterface Piece { a: number; b: number; rl: number; rr: number; fills: { left: number; width: number; color: string }[] }\n\n// The track is drawn as pieces between cuts: chapter boundaries, the gap around the bar thumb and, for the wavy\n// line, everything before the thumb (drawn by the SVG). Outer ends get a full radius, cut ends a small one, as\n// the M3 slider's segments.\nconst pieces = computed<Piece[]>(() => {\n const W = width.value\n if (!W) return []\n const { gap } = s.value\n const track = trackH.value\n const x = thumbX.value\n const chapterGap = props.size === 'md' ? 4 : 2\n const cuts: [number, number][] = []\n for (const c of props.chapters ?? []) {\n if (c.start <= 0 || c.start >= dur.value) continue\n const cx = toPx(c.start)\n cuts.push([cx - chapterGap / 2, cx + chapterGap / 2])\n }\n if (props.variant === 'slider') cuts.push([x - gap, x + gap])\n if (props.variant === 'wavy') cuts.push([-Infinity, x + gap])\n cuts.sort((p, q) => p[0] - q[0])\n const spans: [number, number][] = []\n let at = 0\n for (const [c0, c1] of cuts) {\n if (c0 > at) spans.push([at, Math.min(c0, W)])\n at = Math.max(at, c1)\n }\n if (at < W) spans.push([at, W])\n\n const full = track / 2\n const small = Math.min(full, Math.max(1, track / 8))\n const playedTo = props.variant === 'line' ? toPx(current.value) : x\n return spans.filter(([a, b]) => b - a >= 0.5).map(([a, b]) => {\n const fills: Piece['fills'] = []\n for (const [t0, t1] of bufferedRanges.value) {\n const l = Math.max(a, toPx(t0))\n const r = Math.min(b, toPx(t1))\n if (r > l) fills.push({ left: l - a, width: r - l, color: colors.value.buffered })\n }\n if (playedTo > a) fills.push({ left: 0, width: Math.min(b, playedTo) - a, color: colors.value.active })\n return { a, b, rl: a <= 0.01 ? full : small, rr: b >= W - 0.01 ? full : small, fills }\n })\n})\n\n// M3's stop indicator at the far end of a (md) slider track, while the thumb hasn't reached it\nconst stopDot = computed(() => props.variant === 'slider' && props.size === 'md' && thumbX.value < width.value - 12 - s.value.gap)\n\n// ── Thumb ───────────────────────────────────────────────────────────────────────────────────────────────\nconst pressed = ref(false)\nconst focused = ref(false)\nconst hovered = ref(false)\n\n// The line thickens under the pointer, as a video player's does; the wavy line's unplayed part is as thick as the\n// wave's stroke (WavyProgressIndicatorDefaults: the same stroke for indicator and track)\nconst trackH = computed(() => {\n if (props.variant === 'wavy') return s.value.wave\n const t = s.value.track\n return props.variant === 'line' && !inactive.value && (hovered.value || pressed.value) ? t + Math.max(2, t / 4) : t\n})\nconst thumbStyle = computed(() => {\n const base = { left: `${thumbX.value}px`, backgroundColor: colors.value.active }\n if (props.variant === 'line') {\n const { dot: d, dotIdle } = s.value\n const scale = pressed.value || hovered.value || focused.value ? 1 : dotIdle / d\n return { ...base, width: `${d}px`, height: `${d}px`, borderRadius: '50%', transform: `translate(-50%, -50%) scale(${scale})` }\n }\n // Pinches to half its width while pressed or focused, as MSlider (SliderTokens.PressedHandleWidth)\n const narrow = pressed.value || focused.value ? 0.5 : 1\n return { ...base, width: '4px', height: `${s.value.thumbH}px`, borderRadius: '2px', transform: `translate(-50%, -50%) scaleX(${narrow})` }\n})\n\n// ── Preview bubble ──────────────────────────────────────────────────────────────────────────────────────\nconst hoverTime = ref<number | null>(null)\nconst previewTime = computed(() => (props.preview && !inactive.value ? scrubTime.value ?? hoverTime.value : null))\nconst previewChapter = computed(() => (previewTime.value === null ? null : chapterAt(previewTime.value)))\nconst bubbleEl = ref<HTMLElement>()\nconst bubbleW = ref(0)\nlet bubbleObserver: ResizeObserver | null = null\nwatch(bubbleEl, (el) => {\n bubbleObserver?.disconnect()\n if (!el || typeof ResizeObserver === 'undefined') return\n bubbleW.value = el.offsetWidth\n bubbleObserver = new ResizeObserver(() => { bubbleW.value = el.offsetWidth })\n bubbleObserver.observe(el)\n})\n// Centered over the time, but kept within the track\nconst previewX = computed(() => {\n const x = previewTime.value === null ? 0 : toPx(previewTime.value)\n const half = bubbleW.value / 2\n return half * 2 >= width.value ? width.value / 2 : Math.min(width.value - half, Math.max(half, x))\n})\n\n// ── Pointer: mouse/pen scrub from the press; a touch waits to see a horizontal move (touch-action pan-y leaves a\n// vertical one to the page), and a touch that doesn't move is a tap that seeks there ────────────────────────\nlet press: { id: number; x: number; y: number; touch: boolean; started: boolean } | null = null\n\nfunction timeAt(clientX: number) {\n const el = trackEl.value\n if (!el || !dur.value) return 0\n const r = el.getBoundingClientRect()\n return (Math.min(1, Math.max(0, (clientX - r.left) / (r.width || 1)))) * dur.value\n}\n\nfunction scrubTo(t: number) {\n scrubTime.value = t\n emit('scrub', t)\n if (props.live) emit('update:modelValue', t)\n}\n\nfunction begin(e: PointerEvent) {\n if (!press) return\n press.started = true\n pressed.value = true\n const t = timeAt(e.clientX)\n emit('scrub-start', t)\n scrubTo(t)\n}\n\nfunction commit(t: number) {\n emit('update:modelValue', t)\n emit('seek', t)\n // Show it at once; a later modelValue resyncs\n pos.value = t\n base = t\n baseAt = now()\n}\n\nfunction onPointerDown(e: PointerEvent) {\n if (inactive.value || e.button !== 0) return\n press = { id: e.pointerId, x: e.clientX, y: e.clientY, touch: e.pointerType === 'touch', started: false }\n window.addEventListener('pointermove', onPointerMove)\n window.addEventListener('pointerup', onPointerUp)\n window.addEventListener('pointercancel', onPointerCancel)\n if (!press.touch) {\n e.preventDefault()\n trackEl.value?.focus({ preventScroll: true })\n begin(e)\n }\n}\n\nfunction onPointerMove(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n if (!press.started) {\n const dx = Math.abs(e.clientX - press.x)\n const dy = Math.abs(e.clientY - press.y)\n if (dy > 8 && dy > dx) return end()\n if (dx < 4) return\n begin(e)\n }\n scrubTo(timeAt(e.clientX))\n}\n\nfunction onPointerUp(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n const t = press.started ? scrubTime.value ?? timeAt(e.clientX) : timeAt(e.clientX)\n end()\n commit(t)\n}\n\n// The browser took the touch (a scroll): a drag in progress still lands where it was\nfunction onPointerCancel(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n const t = press.started ? scrubTime.value : null\n end()\n if (t !== null) commit(t)\n}\n\nfunction end() {\n press = null\n pressed.value = false\n scrubTime.value = null\n window.removeEventListener('pointermove', onPointerMove)\n window.removeEventListener('pointerup', onPointerUp)\n window.removeEventListener('pointercancel', onPointerCancel)\n}\n\nfunction onHover(e: PointerEvent) {\n if (e.pointerType === 'touch') return\n hovered.value = true\n hoverTime.value = timeAt(e.clientX)\n}\nfunction onLeave() {\n hovered.value = false\n hoverTime.value = null\n}\n\nfunction onKeyDown(e: KeyboardEvent) {\n if (inactive.value) return\n const d = dur.value\n const steps: Record<string, number> = {\n ArrowRight: props.keyStep, ArrowUp: props.keyStep, ArrowLeft: -props.keyStep, ArrowDown: -props.keyStep,\n PageUp: d / 10, PageDown: -d / 10,\n }\n let t: number | null = null\n if (e.key in steps) t = current.value + steps[e.key]!\n else if (e.key === 'Home') t = 0\n else if (e.key === 'End') t = d\n if (t === null) return\n e.preventDefault()\n commit(Math.min(d, Math.max(0, t)))\n}\n\n// ── Motion between updates, and the wave (a rAF loop, only while either needs frames) ───────────────────\nconst now = () => (typeof performance !== 'undefined' ? performance.now() : 0)\nlet base = props.modelValue\nlet baseAt = now()\nlet raf = 0\nlet last = 0\nlet amp = 0\nlet phase = 0\nconst wavePathEl = ref<SVGPathElement>()\nconst svgH = computed(() => s.value.wave + 2 * s.value.amp + 2)\nconst reducedMotion = typeof window !== 'undefined' && !!window.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n\nconst ampTarget = () => (props.variant === 'wavy' && props.playing && scrubTime.value === null ? s.value.amp : 0)\namp = ampTarget()\n\nfunction advancing() {\n return props.playing && scrubTime.value === null && !!dur.value\n}\n\nfunction syncPos(t: number) {\n const W = width.value\n const d = dur.value\n if (Math.floor(t) !== Math.floor(pos.value) || (d && (Math.abs(t - pos.value) * W) / d >= 0.5)) pos.value = t\n}\n\nfunction drawWave() {\n const path = wavePathEl.value\n if (!path) return\n const { wave, length, gap } = s.value\n const half = wave / 2\n const end = thumbX.value - gap - half\n if (end <= half) return path.setAttribute('d', '')\n const mid = svgH.value / 2\n const k = (2 * Math.PI) / length\n let d = ''\n for (let x = half; ; x += 2) {\n const px = Math.min(x, end)\n d += `${d ? 'L' : 'M'}${px.toFixed(1)},${(mid + amp * Math.sin(k * px + phase)).toFixed(2)}`\n if (px >= end) break\n }\n path.setAttribute('d', d)\n}\n\nfunction frame(t: number) {\n const dt = last ? Math.min(0.1, (t - last) / 1000) : 0\n last = t\n if (advancing()) syncPos(Math.min(dur.value, base + ((t - baseAt) / 1000) * props.playbackRate))\n if (props.variant === 'wavy') {\n amp += (ampTarget() - amp) * (1 - Math.exp(-dt / 0.12))\n if (Math.abs(ampTarget() - amp) < 0.01) amp = ampTarget()\n // The wave travels with the playback, one length every 1.25s\n if (props.playing && !reducedMotion) phase -= (dt * 2 * Math.PI) / 1.25\n drawWave()\n }\n if (advancing() || (props.variant === 'wavy' && (amp !== ampTarget() || (props.playing && !reducedMotion)))) {\n raf = requestAnimationFrame(frame)\n } else {\n raf = 0\n last = 0\n }\n}\n\nfunction kick() {\n if (raf || typeof requestAnimationFrame === 'undefined') return\n raf = requestAnimationFrame(frame)\n}\n\nwatch(() => props.modelValue, (v) => {\n base = v\n baseAt = now()\n pos.value = v\n kick()\n})\nwatch(() => props.playing, () => {\n base = pos.value\n baseAt = now()\n kick()\n})\nwatch(scrubTime, (v) => {\n if (v === null) {\n base = pos.value\n baseAt = now()\n }\n kick()\n})\n// Paused, the (flat) wave still follows the thumb\nwatch([thumbX, () => props.variant, () => props.size], () => {\n if (props.variant === 'wavy') drawWave()\n}, { flush: 'post' })\n\nlet resizeObserver: ResizeObserver | null = null\nonMounted(() => {\n const el = trackEl.value!\n width.value = el.clientWidth\n if (typeof ResizeObserver !== 'undefined') {\n resizeObserver = new ResizeObserver(() => { width.value = el.clientWidth })\n resizeObserver.observe(el)\n }\n drawWave()\n kick()\n})\nonBeforeUnmount(() => {\n cancelAnimationFrame(raf)\n resizeObserver?.disconnect()\n bubbleObserver?.disconnect()\n end()\n})\n</script>\n\n<template>\n <div class=\"flex min-w-0 select-none\" :class=\"time === 'sides' ? 'items-center gap-3' : 'flex-col'\">\n <span v-if=\"time === 'sides'\" class=\"min-w-[4ch] shrink-0 text-right text-label-medium tabular-nums\" :class=\"!timeColor && 'text-on-surface-variant'\" :style=\"timeStyle\">{{ startText }}</span>\n\n <div\n ref=\"trackEl\"\n role=\"slider\"\n :tabindex=\"inactive ? -1 : 0\"\n :aria-label=\"label ?? locale.seekBar\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"Math.round(dur)\"\n :aria-valuenow=\"Math.round(current)\"\n :aria-valuetext=\"valueText\"\n :aria-disabled=\"inactive || undefined\"\n class=\"group relative min-w-0 shrink-0 touch-pan-y outline-none\"\n :class=\"[inactive ? 'cursor-default' : 'cursor-pointer', time === 'sides' && 'flex-1']\"\n :style=\"{ height: `${s.hit}px` }\"\n @pointerdown=\"onPointerDown\"\n @pointermove=\"onHover\"\n @pointerleave=\"onLeave\"\n @keydown=\"onKeyDown\"\n @focus=\"focused = true\"\n @blur=\"focused = false\"\n >\n <!-- A grace zone past the hit area (mostly above, where the preview opens), so the pointer doesn't have to\n land exactly on a thin line: its events reach the track like the track's own -->\n <div v-if=\"!inactive\" class=\"absolute inset-x-0 -top-3 -bottom-1\" />\n <div\n v-for=\"(p, i) in pieces\"\n :key=\"i\"\n class=\"absolute top-1/2 -translate-y-1/2 overflow-hidden transition-[height] duration-100\"\n :style=\"{\n left: `${p.a}px`, width: `${p.b - p.a}px`, height: `${trackH}px`,\n borderRadius: `${p.rl}px ${p.rr}px ${p.rr}px ${p.rl}px`, backgroundColor: colors.inactive,\n }\"\n >\n <div\n v-for=\"(f, j) in p.fills\"\n :key=\"j\"\n class=\"absolute inset-y-0\"\n :style=\"{ left: `${f.left}px`, width: `${f.width}px`, backgroundColor: f.color }\"\n />\n </div>\n\n <svg\n v-if=\"variant === 'wavy'\"\n class=\"pointer-events-none absolute top-1/2 left-0 -translate-y-1/2 overflow-visible\"\n :width=\"width\"\n :height=\"svgH\"\n aria-hidden=\"true\"\n >\n <path ref=\"wavePathEl\" fill=\"none\" :stroke=\"colors.active\" :stroke-width=\"s.wave\" stroke-linecap=\"round\" />\n </svg>\n\n <div\n v-if=\"stopDot\"\n class=\"pointer-events-none absolute top-1/2 right-3 size-1 -translate-y-1/2 rounded-full\"\n :style=\"{ backgroundColor: colors.active }\"\n />\n\n <div\n class=\"pointer-events-none absolute top-1/2 transition-transform duration-75 group-focus-visible:ring-2 group-focus-visible:ring-primary group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface\"\n :style=\"thumbStyle\"\n />\n\n <div\n v-if=\"previewTime !== null\"\n ref=\"bubbleEl\"\n class=\"pointer-events-none absolute bottom-full z-10 mb-1 -translate-x-1/2\"\n :style=\"{ left: `${previewX}px` }\"\n >\n <slot name=\"preview\" :time=\"previewTime\" :formatted=\"fmt(previewTime)\" :chapter=\"previewChapter\">\n <div class=\"flex h-7 max-w-60 items-center gap-1 rounded-full bg-inverse-surface px-2.5 text-label-medium whitespace-nowrap text-inverse-on-surface tabular-nums\">\n <span v-if=\"previewChapter?.title\" class=\"truncate\">{{ previewChapter.title }} ·</span>\n <span>{{ fmt(previewTime) }}</span>\n </div>\n </slot>\n </div>\n </div>\n\n <div v-if=\"time === 'below'\" class=\"flex items-center justify-between text-label-medium tabular-nums\" :class=\"!timeColor && 'text-on-surface-variant'\" :style=\"timeStyle\">\n <span>{{ startText }}</span>\n <button\n type=\"button\"\n class=\"cursor-pointer rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-secondary\"\n :aria-label=\"showRemaining ? locale.seekBarShowDuration : locale.seekBarShowRemaining\"\n @click=\"toggleRemaining\"\n >{{ endText }}</button>\n </div>\n <button\n v-else-if=\"time === 'sides'\"\n type=\"button\"\n class=\"min-w-[4ch] shrink-0 cursor-pointer rounded-sm text-left text-label-medium tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-secondary\"\n :class=\"!timeColor && 'text-on-surface-variant'\"\n :style=\"timeStyle\"\n :aria-label=\"showRemaining ? locale.seekBarShowDuration : locale.seekBarShowRemaining\"\n @click=\"toggleRemaining\"\n >{{ endText }}</button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BA,IAAMsB,IAAQC,GAqDRC,IAAOH,IAQPI,IAASf,EAAU,GAKnBgB,KAAQ;GACZ,IAAI;IAAE,OAAO;IAAG,QAAQ;IAAI,KAAK;IAAI,SAAS;IAAI,KAAK;IAAG,KAAK;IAAI,MAAM;IAAG,KAAK;IAAK,QAAQ;GAAG;GACjG,IAAI;IAAE,OAAO;IAAG,QAAQ;IAAI,KAAK;IAAI,SAAS;IAAI,KAAK;IAAG,KAAK;IAAI,MAAM;IAAG,KAAK;IAAG,QAAQ;GAAG;GAC/F,IAAI;IAAE,OAAO;IAAI,QAAQ;IAAI,KAAK;IAAI,SAAS;IAAI,KAAK;IAAG,KAAK;IAAI,MAAM;IAAG,KAAK;IAAG,QAAQ;GAAG;EAClG,GACMC,IAAIC,QAAeF,GAAMJ,EAAM,SAASI,GAAM,EAAE,GAEhDG,IAAMD,QAAgB,OAAO,S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AA,C,SAGAM,EAAA,SAAI,WADjBvB,EAAA,GAAAC,EAQuB,UAAA;;IANrB,MAAK;IACL,OAAKC,EAAA,CAAC,0JAAwJ,CACrJqB,EAAA,aAAS,yBAAA,CAAA;IACjB,OAAKpB,EAAE6C,EAAA,KAAS;IAChB,cAAYH,EAAA,QAAgBvC,EAAAmB,CAAA,CAAM,CAAC,sBAAsBnB,EAAAmB,CAAA,CAAM,CAAC;IAChE,SAAOsB;GACN,GAAA3C,EAAA8C,GAAA,KAAO,GAAA,IAAAhC,EAAA,K"}
1
+ {"version":3,"file":"MSeekBar-C4cn9RIF.js","names":["_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_toDisplayString","_createElementVNode","_unref","_Fragment","_renderList","_renderSlot","useLocale","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","MSeekBar_default","defineComponent","__emit","props","__props","emit","locale","SIZES","s","computed","dur","inactive","ROLES","colors","active","pad","n","fmt","t","sec","h","m","scrubTime","ref","pos","current","showRemaining","v","toggleRemaining","timeStyle","startText","endText","valueText","chapterAt","found","c","trackEl","width","toPx","thumbX","x","inset","bufferedRanges","b","pieces","W","track","trackH","chapterGap","cuts","cx","gap","p","q","spans","at","c0","c1","full","small","playedTo","a","fills","t0","t1","l","r","stopDot","pressed","focused","hovered","thumbStyle","base","d","scale","dotIdle","narrow","hoverTime","previewTime","previewChapter","bubbleEl","bubbleW","bubbleObserver","el","previewX","half","press","timeAt","clientX","scrubTo","begin","commit","now","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","dx","dy","end","onHover","onLeave","onKeyDown","steps","baseAt","raf","last","amp","phase","wavePathEl","svgH","reducedMotion","ampTarget","advancing","syncPos","drawWave","path","wave","mid","k","length","px","frame","dt","kick","watch","resizeObserver","onMounted","onBeforeUnmount","openBlock","createElementBlock","normalizeClass","normalizeStyle","toDisplayString","createCommentVNode","createElementVNode","unref","_cache","Fragment","renderList","i","j","f","renderSlot","_ctx"],"sources":["../src/components/MSeekBar.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface SeekBarChapter {\n /** Where the chapter starts, in seconds */\n start: number\n /** Shown in the preview while the pointer is over it */\n title?: string\n}\n</script>\n\n<script setup lang=\"ts\">\n/**\n * A media seek bar (not an M3 spec component; Media3's ProgressSlider is a plain M3 Slider, which this follows in\n * its default look): the playback position on a track with the buffered part, optional chapters, elapsed and\n * total (or remaining) time, and a preview of the time under the pointer. Dragging scrubs locally and seeks once\n * on release (or live, with `live`); a tap or click seeks to that point. While `playing`, it advances on its own\n * between `modelValue` updates, so a 4Hz `timeupdate` still moves it smoothly.\n *\n * @slot preview Replaces the bubble shown above the pointer while hovering or dragging (a frame preview, say).\n * Props: `{ time, formatted, chapter }`\n * @event update:modelValue Emitted on a seek (and continuously while dragging with `live`) — powers v-model\n * @event seek Emitted once per seek with its time: on release of a drag, a tap or click, or a key press\n * @event scrub-start Emitted when a drag starts, with its time\n * @event scrub Emitted while dragging, with the time under the pointer\n * @event update:remaining Emitted when the end label is clicked to switch between total and remaining time\n */\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { useLocale } from '../composables/useLocale'\n\nconst props = withDefaults(defineProps<{\n /** Playback position in seconds (v-model) */\n modelValue: number\n /** Media length in seconds; 0, NaN or Infinity (not loaded yet, a live stream) disables seeking */\n duration: number\n /** How much is loaded: up to a time, or time ranges (`[[start, end], …]`, like a media element's `buffered`) */\n buffered?: number | [number, number][]\n /** Chapter starts, drawn as gaps in the track; their titles show in the preview */\n chapters?: SeekBarChapter[]\n /** The media is playing: the bar moves on its own between updates, and the wavy line waves */\n playing?: boolean\n /** Playback speed, for that motion between updates */\n playbackRate?: number\n /** Updates the v-model continuously while dragging (the media follows the thumb), not only on release */\n live?: boolean\n /** `slider`: the M3 slider (bar thumb with a gap around it). `line`: a plain line with a round thumb. `wavy`: the played part waves while playing */\n variant?: 'slider' | 'line' | 'wavy'\n /** Track thickness: `md` (16px, the smallest M3 slider), `sm` (8px) or `xs` (4px, over a video) */\n size?: 'xs' | 'sm' | 'md'\n /** Where the elapsed and total time go */\n time?: 'below' | 'sides' | 'none'\n /** The end label shows the remaining time (`-1:23`) instead of the total; clicking it switches (v-model:remaining) */\n remaining?: boolean\n /** Formats a time in seconds. Default `m:ss`, or `h:mm:ss` for media an hour or longer */\n format?: (seconds: number) => string\n /** Seconds the arrow keys move; Page Up/Down move 10% */\n keyStep?: number\n /** Shows the time (and chapter) above the pointer while hovering or dragging */\n preview?: boolean\n /** Played part and thumb: an M3 role (`primary`, `secondary`, `tertiary`, `error`) or any CSS color */\n color?: string\n /** Unplayed track: an M3 role or any CSS color. Default secondary-container */\n trackColor?: string\n /** The time labels' color, as a CSS color (white over a video, say). Default on-surface-variant */\n timeColor?: string\n /** Disables seeking */\n disabled?: boolean\n /** Accessible name. Default the locale's `seekBar` */\n label?: string\n}>(), {\n playing: false,\n playbackRate: 1,\n live: false,\n variant: 'slider',\n size: 'md',\n time: 'below',\n remaining: false,\n keyStep: 5,\n preview: true,\n color: 'primary',\n disabled: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [number]\n seek: [number]\n 'scrub-start': [number]\n scrub: [number]\n 'update:remaining': [boolean]\n}>()\n\nconst locale = useLocale()\n\n// track: thickness; thumbH: the bar thumb's height (md = MSlider xs, SliderTokens.HandleHeight); dot: the line\n// variant's round thumb under the pointer, dotIdle at rest (the thinner the line, the more it grows, as a\n// video player's does); gap: around the bar thumb; hit: the pointer target's height; wave/amp/length: the wavy line\nconst SIZES = {\n xs: { track: 4, thumbH: 16, dot: 21, dotIdle: 10, gap: 4, hit: 32, wave: 4, amp: 2.5, length: 18 },\n sm: { track: 8, thumbH: 28, dot: 20, dotIdle: 14, gap: 5, hit: 40, wave: 6, amp: 3, length: 22 },\n md: { track: 16, thumbH: 44, dot: 28, dotIdle: 21, gap: 6, hit: 46, wave: 8, amp: 4, length: 26 },\n}\nconst s = computed(() => SIZES[props.size] ?? SIZES.md)\n\nconst dur = computed(() => (Number.isFinite(props.duration) && props.duration > 0 ? props.duration : 0))\nconst inactive = computed(() => props.disabled || !dur.value)\n\n// ── Colors (as in MSlider: a role name or any CSS color; disabled per SliderTokens) ─────────────────────\nconst ROLES: Record<string, string> = {\n primary: 'var(--color-primary)',\n secondary: 'var(--color-secondary)',\n tertiary: 'var(--color-tertiary)',\n error: 'var(--color-error)',\n 'secondary-container': 'var(--color-secondary-container)',\n}\nconst colors = computed(() => {\n if (props.disabled) {\n return {\n active: 'color-mix(in srgb, var(--color-on-surface) 38%, transparent)',\n inactive: 'color-mix(in srgb, var(--color-on-surface) 12%, transparent)',\n buffered: 'color-mix(in srgb, var(--color-on-surface) 20%, transparent)',\n }\n }\n const active = ROLES[props.color] ?? props.color\n const inactive = props.trackColor ? ROLES[props.trackColor] ?? props.trackColor : 'var(--color-secondary-container)'\n return { active, inactive, buffered: `color-mix(in srgb, ${active} 35%, ${inactive})` }\n})\n\n// ── Time ────────────────────────────────────────────────────────────────────────────────────────────────\nconst pad = (n: number) => String(n).padStart(2, '0')\nfunction fmt(t: number) {\n if (props.format) return props.format(t)\n const sec = Math.max(0, Math.floor(t))\n const h = Math.floor(sec / 3600)\n const m = Math.floor((sec % 3600) / 60)\n return (dur.value >= 3600 ? `${h}:${pad(m)}` : String(h * 60 + m)) + ':' + pad(sec % 60)\n}\n\n// The shown position: the drag's while scrubbing, else `pos`, which follows modelValue and, while playing,\n// advances on its own (only written when it moves half a pixel or crosses a second, so it re-renders rarely)\nconst scrubTime = ref<number | null>(null)\nconst pos = ref(props.modelValue)\nconst current = computed(() => Math.min(dur.value || Infinity, Math.max(0, scrubTime.value ?? pos.value)))\n\nconst showRemaining = ref(props.remaining)\nwatch(() => props.remaining, (v) => { showRemaining.value = v })\nfunction toggleRemaining() {\n showRemaining.value = !showRemaining.value\n emit('update:remaining', showRemaining.value)\n}\nconst timeStyle = computed(() => (props.timeColor ? { color: props.timeColor } : undefined))\nconst startText = computed(() => fmt(current.value))\nconst endText = computed(() => {\n if (!dur.value) return '--:--'\n return showRemaining.value ? `-${fmt(dur.value - current.value)}` : fmt(dur.value)\n})\nconst valueText = computed(() =>\n locale.seekBarValue.replace('{position}', fmt(current.value)).replace('{duration}', dur.value ? fmt(dur.value) : '--:--'),\n)\n\nconst chapterAt = (t: number) => {\n let found: SeekBarChapter | null = null\n for (const c of props.chapters ?? []) if (c.start <= t && (!found || c.start >= found.start)) found = c\n return found\n}\n\n// ── Geometry (px, from the measured track width) ────────────────────────────────────────────────────────\nconst trackEl = ref<HTMLElement>()\nconst width = ref(0)\nconst toPx = (t: number) => (dur.value ? (width.value * Math.min(1, Math.max(0, t / dur.value))) : 0)\n\n// The bar thumb keeps clear of the track's ends, as MSlider's thumbInset; the round one may overhang them\nconst thumbX = computed(() => {\n const x = toPx(current.value)\n if (props.variant === 'line') return x\n const inset = Math.max(2, s.value.track * 0.3)\n return Math.min(width.value - inset, Math.max(inset, x))\n})\n\nconst bufferedRanges = computed<[number, number][]>(() => {\n const b = props.buffered\n if (b === undefined) return []\n return typeof b === 'number' ? [[0, b]] : b\n})\n\ninterface Piece { a: number; b: number; rl: number; rr: number; fills: { left: number; width: number; color: string }[] }\n\n// The track is drawn as pieces between cuts: chapter boundaries, the gap around the bar thumb and, for the wavy\n// line, everything before the thumb (drawn by the SVG). Outer ends get a full radius, cut ends a small one, as\n// the M3 slider's segments.\nconst pieces = computed<Piece[]>(() => {\n const W = width.value\n if (!W) return []\n const { gap } = s.value\n const track = trackH.value\n const x = thumbX.value\n const chapterGap = props.size === 'md' ? 4 : 2\n const cuts: [number, number][] = []\n for (const c of props.chapters ?? []) {\n if (c.start <= 0 || c.start >= dur.value) continue\n const cx = toPx(c.start)\n cuts.push([cx - chapterGap / 2, cx + chapterGap / 2])\n }\n if (props.variant === 'slider') cuts.push([x - gap, x + gap])\n if (props.variant === 'wavy') cuts.push([-Infinity, x + gap])\n cuts.sort((p, q) => p[0] - q[0])\n const spans: [number, number][] = []\n let at = 0\n for (const [c0, c1] of cuts) {\n if (c0 > at) spans.push([at, Math.min(c0, W)])\n at = Math.max(at, c1)\n }\n if (at < W) spans.push([at, W])\n\n const full = track / 2\n const small = Math.min(full, Math.max(1, track / 8))\n const playedTo = props.variant === 'line' ? toPx(current.value) : x\n return spans.filter(([a, b]) => b - a >= 0.5).map(([a, b]) => {\n const fills: Piece['fills'] = []\n for (const [t0, t1] of bufferedRanges.value) {\n const l = Math.max(a, toPx(t0))\n const r = Math.min(b, toPx(t1))\n if (r > l) fills.push({ left: l - a, width: r - l, color: colors.value.buffered })\n }\n if (playedTo > a) fills.push({ left: 0, width: Math.min(b, playedTo) - a, color: colors.value.active })\n return { a, b, rl: a <= 0.01 ? full : small, rr: b >= W - 0.01 ? full : small, fills }\n })\n})\n\n// M3's stop indicator at the far end of a (md) slider track, while the thumb hasn't reached it\nconst stopDot = computed(() => props.variant === 'slider' && props.size === 'md' && thumbX.value < width.value - 12 - s.value.gap)\n\n// ── Thumb ───────────────────────────────────────────────────────────────────────────────────────────────\nconst pressed = ref(false)\nconst focused = ref(false)\nconst hovered = ref(false)\n\n// The line thickens under the pointer, as a video player's does; the wavy line's unplayed part is as thick as the\n// wave's stroke (WavyProgressIndicatorDefaults: the same stroke for indicator and track)\nconst trackH = computed(() => {\n if (props.variant === 'wavy') return s.value.wave\n const t = s.value.track\n return props.variant === 'line' && !inactive.value && (hovered.value || pressed.value) ? t + Math.max(2, t / 4) : t\n})\nconst thumbStyle = computed(() => {\n const base = { left: `${thumbX.value}px`, backgroundColor: colors.value.active }\n if (props.variant === 'line') {\n const { dot: d, dotIdle } = s.value\n const scale = pressed.value || hovered.value || focused.value ? 1 : dotIdle / d\n return { ...base, width: `${d}px`, height: `${d}px`, borderRadius: '50%', transform: `translate(-50%, -50%) scale(${scale})` }\n }\n // Pinches to half its width while pressed or focused, as MSlider (SliderTokens.PressedHandleWidth)\n const narrow = pressed.value || focused.value ? 0.5 : 1\n return { ...base, width: '4px', height: `${s.value.thumbH}px`, borderRadius: '2px', transform: `translate(-50%, -50%) scaleX(${narrow})` }\n})\n\n// ── Preview bubble ──────────────────────────────────────────────────────────────────────────────────────\nconst hoverTime = ref<number | null>(null)\nconst previewTime = computed(() => (props.preview && !inactive.value ? scrubTime.value ?? hoverTime.value : null))\nconst previewChapter = computed(() => (previewTime.value === null ? null : chapterAt(previewTime.value)))\nconst bubbleEl = ref<HTMLElement>()\nconst bubbleW = ref(0)\nlet bubbleObserver: ResizeObserver | null = null\nwatch(bubbleEl, (el) => {\n bubbleObserver?.disconnect()\n if (!el || typeof ResizeObserver === 'undefined') return\n bubbleW.value = el.offsetWidth\n bubbleObserver = new ResizeObserver(() => { bubbleW.value = el.offsetWidth })\n bubbleObserver.observe(el)\n})\n// Centered over the time, but kept within the track\nconst previewX = computed(() => {\n const x = previewTime.value === null ? 0 : toPx(previewTime.value)\n const half = bubbleW.value / 2\n return half * 2 >= width.value ? width.value / 2 : Math.min(width.value - half, Math.max(half, x))\n})\n\n// ── Pointer: mouse/pen scrub from the press; a touch waits to see a horizontal move (touch-action pan-y leaves a\n// vertical one to the page), and a touch that doesn't move is a tap that seeks there ────────────────────────\nlet press: { id: number; x: number; y: number; touch: boolean; started: boolean } | null = null\n\nfunction timeAt(clientX: number) {\n const el = trackEl.value\n if (!el || !dur.value) return 0\n const r = el.getBoundingClientRect()\n return (Math.min(1, Math.max(0, (clientX - r.left) / (r.width || 1)))) * dur.value\n}\n\nfunction scrubTo(t: number) {\n scrubTime.value = t\n emit('scrub', t)\n if (props.live) emit('update:modelValue', t)\n}\n\nfunction begin(e: PointerEvent) {\n if (!press) return\n press.started = true\n pressed.value = true\n const t = timeAt(e.clientX)\n emit('scrub-start', t)\n scrubTo(t)\n}\n\nfunction commit(t: number) {\n emit('update:modelValue', t)\n emit('seek', t)\n // Show it at once; a later modelValue resyncs\n pos.value = t\n base = t\n baseAt = now()\n}\n\nfunction onPointerDown(e: PointerEvent) {\n if (inactive.value || e.button !== 0) return\n press = { id: e.pointerId, x: e.clientX, y: e.clientY, touch: e.pointerType === 'touch', started: false }\n window.addEventListener('pointermove', onPointerMove)\n window.addEventListener('pointerup', onPointerUp)\n window.addEventListener('pointercancel', onPointerCancel)\n if (!press.touch) {\n e.preventDefault()\n trackEl.value?.focus({ preventScroll: true })\n begin(e)\n }\n}\n\nfunction onPointerMove(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n if (!press.started) {\n const dx = Math.abs(e.clientX - press.x)\n const dy = Math.abs(e.clientY - press.y)\n if (dy > 8 && dy > dx) return end()\n if (dx < 4) return\n begin(e)\n }\n scrubTo(timeAt(e.clientX))\n}\n\nfunction onPointerUp(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n const t = press.started ? scrubTime.value ?? timeAt(e.clientX) : timeAt(e.clientX)\n end()\n commit(t)\n}\n\n// The browser took the touch (a scroll): a drag in progress still lands where it was\nfunction onPointerCancel(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n const t = press.started ? scrubTime.value : null\n end()\n if (t !== null) commit(t)\n}\n\nfunction end() {\n press = null\n pressed.value = false\n scrubTime.value = null\n window.removeEventListener('pointermove', onPointerMove)\n window.removeEventListener('pointerup', onPointerUp)\n window.removeEventListener('pointercancel', onPointerCancel)\n}\n\nfunction onHover(e: PointerEvent) {\n if (e.pointerType === 'touch') return\n hovered.value = true\n hoverTime.value = timeAt(e.clientX)\n}\nfunction onLeave() {\n hovered.value = false\n hoverTime.value = null\n}\n\nfunction onKeyDown(e: KeyboardEvent) {\n if (inactive.value) return\n const d = dur.value\n const steps: Record<string, number> = {\n ArrowRight: props.keyStep, ArrowUp: props.keyStep, ArrowLeft: -props.keyStep, ArrowDown: -props.keyStep,\n PageUp: d / 10, PageDown: -d / 10,\n }\n let t: number | null = null\n if (e.key in steps) t = current.value + steps[e.key]!\n else if (e.key === 'Home') t = 0\n else if (e.key === 'End') t = d\n if (t === null) return\n e.preventDefault()\n commit(Math.min(d, Math.max(0, t)))\n}\n\n// ── Motion between updates, and the wave (a rAF loop, only while either needs frames) ───────────────────\nconst now = () => (typeof performance !== 'undefined' ? performance.now() : 0)\nlet base = props.modelValue\nlet baseAt = now()\nlet raf = 0\nlet last = 0\nlet amp = 0\nlet phase = 0\nconst wavePathEl = ref<SVGPathElement>()\nconst svgH = computed(() => s.value.wave + 2 * s.value.amp + 2)\nconst reducedMotion = typeof window !== 'undefined' && !!window.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n\nconst ampTarget = () => (props.variant === 'wavy' && props.playing && scrubTime.value === null ? s.value.amp : 0)\namp = ampTarget()\n\nfunction advancing() {\n return props.playing && scrubTime.value === null && !!dur.value\n}\n\nfunction syncPos(t: number) {\n const W = width.value\n const d = dur.value\n if (Math.floor(t) !== Math.floor(pos.value) || (d && (Math.abs(t - pos.value) * W) / d >= 0.5)) pos.value = t\n}\n\nfunction drawWave() {\n const path = wavePathEl.value\n if (!path) return\n const { wave, length, gap } = s.value\n const half = wave / 2\n const end = thumbX.value - gap - half\n if (end <= half) return path.setAttribute('d', '')\n const mid = svgH.value / 2\n const k = (2 * Math.PI) / length\n let d = ''\n for (let x = half; ; x += 2) {\n const px = Math.min(x, end)\n d += `${d ? 'L' : 'M'}${px.toFixed(1)},${(mid + amp * Math.sin(k * px + phase)).toFixed(2)}`\n if (px >= end) break\n }\n path.setAttribute('d', d)\n}\n\nfunction frame(t: number) {\n const dt = last ? Math.min(0.1, (t - last) / 1000) : 0\n last = t\n if (advancing()) syncPos(Math.min(dur.value, base + ((t - baseAt) / 1000) * props.playbackRate))\n if (props.variant === 'wavy') {\n amp += (ampTarget() - amp) * (1 - Math.exp(-dt / 0.12))\n if (Math.abs(ampTarget() - amp) < 0.01) amp = ampTarget()\n // The wave travels with the playback, one length every 1.25s\n if (props.playing && !reducedMotion) phase -= (dt * 2 * Math.PI) / 1.25\n drawWave()\n }\n if (advancing() || (props.variant === 'wavy' && (amp !== ampTarget() || (props.playing && !reducedMotion)))) {\n raf = requestAnimationFrame(frame)\n } else {\n raf = 0\n last = 0\n }\n}\n\nfunction kick() {\n if (raf || typeof requestAnimationFrame === 'undefined') return\n raf = requestAnimationFrame(frame)\n}\n\nwatch(() => props.modelValue, (v) => {\n base = v\n baseAt = now()\n pos.value = v\n kick()\n})\nwatch(() => props.playing, () => {\n base = pos.value\n baseAt = now()\n kick()\n})\nwatch(scrubTime, (v) => {\n if (v === null) {\n base = pos.value\n baseAt = now()\n }\n kick()\n})\n// Paused, the (flat) wave still follows the thumb\nwatch([thumbX, () => props.variant, () => props.size], () => {\n if (props.variant === 'wavy') drawWave()\n}, { flush: 'post' })\n\nlet resizeObserver: ResizeObserver | null = null\nonMounted(() => {\n const el = trackEl.value!\n width.value = el.clientWidth\n if (typeof ResizeObserver !== 'undefined') {\n resizeObserver = new ResizeObserver(() => { width.value = el.clientWidth })\n resizeObserver.observe(el)\n }\n drawWave()\n kick()\n})\nonBeforeUnmount(() => {\n cancelAnimationFrame(raf)\n resizeObserver?.disconnect()\n bubbleObserver?.disconnect()\n end()\n})\n</script>\n\n<template>\n <div class=\"flex min-w-0 select-none\" :class=\"time === 'sides' ? 'items-center gap-3' : 'flex-col'\">\n <span v-if=\"time === 'sides'\" class=\"min-w-[4ch] shrink-0 text-right text-label-medium tabular-nums\" :class=\"!timeColor && 'text-on-surface-variant'\" :style=\"timeStyle\">{{ startText }}</span>\n\n <div\n ref=\"trackEl\"\n role=\"slider\"\n :tabindex=\"inactive ? -1 : 0\"\n :aria-label=\"label ?? locale.seekBar\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"Math.round(dur)\"\n :aria-valuenow=\"Math.round(current)\"\n :aria-valuetext=\"valueText\"\n :aria-disabled=\"inactive || undefined\"\n class=\"group relative min-w-0 shrink-0 touch-pan-y outline-none\"\n :class=\"[inactive ? 'cursor-default' : 'cursor-pointer', time === 'sides' && 'flex-1']\"\n :style=\"{ height: `${s.hit}px` }\"\n @pointerdown=\"onPointerDown\"\n @pointermove=\"onHover\"\n @pointerleave=\"onLeave\"\n @keydown=\"onKeyDown\"\n @focus=\"focused = true\"\n @blur=\"focused = false\"\n >\n <!-- A grace zone past the hit area (mostly above, where the preview opens), so the pointer doesn't have to\n land exactly on a thin line: its events reach the track like the track's own -->\n <div v-if=\"!inactive\" class=\"absolute inset-x-0 -top-3 -bottom-1\" />\n <div\n v-for=\"(p, i) in pieces\"\n :key=\"i\"\n class=\"absolute top-1/2 -translate-y-1/2 overflow-hidden transition-[height] duration-100\"\n :style=\"{\n left: `${p.a}px`, width: `${p.b - p.a}px`, height: `${trackH}px`,\n borderRadius: `${p.rl}px ${p.rr}px ${p.rr}px ${p.rl}px`, backgroundColor: colors.inactive,\n }\"\n >\n <div\n v-for=\"(f, j) in p.fills\"\n :key=\"j\"\n class=\"absolute inset-y-0\"\n :style=\"{ left: `${f.left}px`, width: `${f.width}px`, backgroundColor: f.color }\"\n />\n </div>\n\n <svg\n v-if=\"variant === 'wavy'\"\n class=\"pointer-events-none absolute top-1/2 left-0 -translate-y-1/2 overflow-visible\"\n :width=\"width\"\n :height=\"svgH\"\n aria-hidden=\"true\"\n >\n <path ref=\"wavePathEl\" fill=\"none\" :stroke=\"colors.active\" :stroke-width=\"s.wave\" stroke-linecap=\"round\" />\n </svg>\n\n <div\n v-if=\"stopDot\"\n class=\"pointer-events-none absolute top-1/2 right-3 size-1 -translate-y-1/2 rounded-full\"\n :style=\"{ backgroundColor: colors.active }\"\n />\n\n <div\n class=\"pointer-events-none absolute top-1/2 transition-transform duration-75 group-focus-visible:ring-2 group-focus-visible:ring-primary group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface\"\n :style=\"thumbStyle\"\n />\n\n <div\n v-if=\"previewTime !== null\"\n ref=\"bubbleEl\"\n class=\"pointer-events-none absolute bottom-full z-10 mb-1 -translate-x-1/2\"\n :style=\"{ left: `${previewX}px` }\"\n >\n <slot name=\"preview\" :time=\"previewTime\" :formatted=\"fmt(previewTime)\" :chapter=\"previewChapter\">\n <div class=\"flex h-7 max-w-60 items-center gap-1 rounded-full bg-inverse-surface px-2.5 text-label-medium whitespace-nowrap text-inverse-on-surface tabular-nums\">\n <span v-if=\"previewChapter?.title\" class=\"truncate\">{{ previewChapter.title }} ·</span>\n <span>{{ fmt(previewTime) }}</span>\n </div>\n </slot>\n </div>\n </div>\n\n <div v-if=\"time === 'below'\" class=\"flex items-center justify-between text-label-medium tabular-nums\" :class=\"!timeColor && 'text-on-surface-variant'\" :style=\"timeStyle\">\n <span>{{ startText }}</span>\n <button\n type=\"button\"\n class=\"cursor-pointer rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-secondary\"\n :aria-label=\"showRemaining ? locale.seekBarShowDuration : locale.seekBarShowRemaining\"\n @click=\"toggleRemaining\"\n >{{ endText }}</button>\n </div>\n <button\n v-else-if=\"time === 'sides'\"\n type=\"button\"\n class=\"min-w-[4ch] shrink-0 cursor-pointer rounded-sm text-left text-label-medium tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-secondary\"\n :class=\"!timeColor && 'text-on-surface-variant'\"\n :style=\"timeStyle\"\n :aria-label=\"showRemaining ? locale.seekBarShowDuration : locale.seekBarShowRemaining\"\n @click=\"toggleRemaining\"\n >{{ endText }}</button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BA,IAAMsB,IAAQC,GAqDRC,IAAOH,IAQPI,IAASf,EAAU,GAKnBgB,KAAQ;GACZ,IAAI;IAAE,OAAO;IAAG,QAAQ;IAAI,KAAK;IAAI,SAAS;IAAI,KAAK;IAAG,KAAK;IAAI,MAAM;IAAG,KAAK;IAAK,QAAQ;GAAG;GACjG,IAAI;IAAE,OAAO;IAAG,QAAQ;IAAI,KAAK;IAAI,SAAS;IAAI,KAAK;IAAG,KAAK;IAAI,MAAM;IAAG,KAAK;IAAG,QAAQ;GAAG;GAC/F,IAAI;IAAE,OAAO;IAAI,QAAQ;IAAI,KAAK;IAAI,SAAS;IAAI,KA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wC,EAAA,QAAgBvC,EAAAmB,CAAA,CAAM,CAAC,sBAAsBnB,EAAAmB,CAAA,CAAM,CAAC;IAChE,SAAOsB;GACN,GAAA3C,EAAA8C,GAAA,KAAO,GAAA,GAAAjC,EAAA,C,SAGAM,EAAA,SAAI,WADjBvB,EAAA,GAAAC,EAQuB,UAAA;;IANrB,MAAK;IACL,OAAKC,EAAA,CAAC,0JAAwJ,CACrJqB,EAAA,aAAS,yBAAA,CAAA;IACjB,OAAKpB,EAAE6C,EAAA,KAAS;IAChB,cAAYH,EAAA,QAAgBvC,EAAAmB,CAAA,CAAM,CAAC,sBAAsBnB,EAAAmB,CAAA,CAAM,CAAC;IAChE,SAAOsB;GACN,GAAA3C,EAAA8C,GAAA,KAAO,GAAA,IAAAhC,EAAA,K"}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./MIcon-DpajuUTJ.js";
2
- import { i as t } from "./useLocale-COav9m8C.js";
2
+ import { i as t } from "./useLocale-DaVSTdm0.js";
3
3
  import { Fragment as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as ee, onMounted as te, openBlock as p, ref as m, renderList as ne, toDisplayString as h, unref as re, withCtx as ie } from "vue";
4
4
  // src/components/MSlider.vue?vue&type=script&setup=true&lang.ts
5
5
  var ae = {
@@ -687,4 +687,4 @@ var ae = {
687
687
  });
688
688
  export { fe as t };
689
689
 
690
- //# sourceMappingURL=MSlider-B9NcKTmZ.js.map
690
+ //# sourceMappingURL=MSlider-BIkA6DiE.js.map