@m3ui-vue/m3ui-vue 1.2.2 → 1.3.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 (241) hide show
  1. package/dist/API.md +3010 -376
  2. package/dist/MButton-Bl_BSUep.js +172 -0
  3. package/dist/MButton-Bl_BSUep.js.map +1 -0
  4. package/dist/MDialog-D_Yik8ou.js +173 -0
  5. package/dist/MDialog-D_Yik8ou.js.map +1 -0
  6. package/dist/MIconButton-DoNotQ9v.js +282 -0
  7. package/dist/MIconButton-DoNotQ9v.js.map +1 -0
  8. package/dist/MListItem-BxifHJdU.js +824 -0
  9. package/dist/MListItem-BxifHJdU.js.map +1 -0
  10. package/dist/MLoadingIndicator-BxbFhSX6.js +115 -0
  11. package/dist/MLoadingIndicator-BxbFhSX6.js.map +1 -0
  12. package/dist/MMenuItem-Bih0h4-n.js +604 -0
  13. package/dist/MMenuItem-Bih0h4-n.js.map +1 -0
  14. package/dist/MProgressBar-BCoruxA-.js +184 -0
  15. package/dist/MProgressBar-BCoruxA-.js.map +1 -0
  16. package/dist/MSeekBar-BeN9QcB3.js +435 -0
  17. package/dist/MSeekBar-BeN9QcB3.js.map +1 -0
  18. package/dist/MSegmentedButton-DL9JtJFX.js +65 -0
  19. package/dist/MSegmentedButton-DL9JtJFX.js.map +1 -0
  20. package/dist/MSlider-BVSbJlGS.js +691 -0
  21. package/dist/MSlider-BVSbJlGS.js.map +1 -0
  22. package/dist/MSpinner-C2SUnWk4.js +65 -0
  23. package/dist/MSpinner-C2SUnWk4.js.map +1 -0
  24. package/dist/MTextField-CEkWSZ2v.js +296 -0
  25. package/dist/MTextField-CEkWSZ2v.js.map +1 -0
  26. package/dist/MTooltip-CodJGEO-.js +756 -0
  27. package/dist/MTooltip-CodJGEO-.js.map +1 -0
  28. package/dist/_storageKeys-CYXsUBwK.js +18 -0
  29. package/dist/_storageKeys-CYXsUBwK.js.map +1 -0
  30. package/dist/_useEscapeStack-CjndQhqg.js +19 -0
  31. package/dist/_useEscapeStack-CjndQhqg.js.map +1 -0
  32. package/dist/api.json +1 -1
  33. package/dist/chart.js +1 -1
  34. package/dist/code-editor.js +1 -1
  35. package/dist/components/MAudioPlayer.vue.d.ts +115 -0
  36. package/dist/components/MBadge.vue.d.ts +1 -1
  37. package/dist/components/MBottomSheetScaffold.vue.d.ts +1 -1
  38. package/dist/components/MBox.vue.d.ts +1 -1
  39. package/dist/components/MButton.vue.d.ts +1 -1
  40. package/dist/components/MConfirmDialog.vue.d.ts +1 -1
  41. package/dist/components/MCopyButton.vue.d.ts +2 -2
  42. package/dist/components/MDataTable.vue.d.ts +2 -2
  43. package/dist/components/MDialog.vue.d.ts +2 -2
  44. package/dist/components/MDivider.vue.d.ts +1 -1
  45. package/dist/components/MDragHandle.vue.d.ts +1 -1
  46. package/dist/components/MDrawCanvas.vue.d.ts +150 -0
  47. package/dist/components/MDrawLayers.vue.d.ts +3 -0
  48. package/dist/components/MDrawToolbar.vue.d.ts +34 -0
  49. package/dist/components/MExportButton.vue.d.ts +1 -1
  50. package/dist/components/MFab.vue.d.ts +2 -2
  51. package/dist/components/MFabMenu.vue.d.ts +2 -2
  52. package/dist/components/MFixed.vue.d.ts +1 -1
  53. package/dist/components/MFlex.vue.d.ts +2 -2
  54. package/dist/components/MFloorPlan.vue.d.ts +248 -0
  55. package/dist/components/MFloorPlanInspector.vue.d.ts +56 -0
  56. package/dist/components/MFloorPlanToolbar.vue.d.ts +51 -0
  57. package/dist/components/MFlow.vue.d.ts +318 -0
  58. package/dist/components/MFlowControls.vue.d.ts +33 -0
  59. package/dist/components/MFlowHandle.vue.d.ts +16 -0
  60. package/dist/components/MFlowMinimap.vue.d.ts +22 -0
  61. package/dist/components/MFlowNode.vue.d.ts +35 -0
  62. package/dist/components/MGantt.vue.d.ts +141 -0
  63. package/dist/components/MGanttControls.vue.d.ts +32 -0
  64. package/dist/components/MIconButton.vue.d.ts +3 -1
  65. package/dist/components/MImageCropper.vue.d.ts +110 -0
  66. package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
  67. package/dist/components/MLightbox.vue.d.ts +2 -2
  68. package/dist/components/MList.vue.d.ts +1 -1
  69. package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
  70. package/dist/components/MMapControl.vue.d.ts +1 -1
  71. package/dist/components/MMapSearch.vue.d.ts +1 -1
  72. package/dist/components/MMaskField.vue.d.ts +12 -1
  73. package/dist/components/MMenu.vue.d.ts +1 -1
  74. package/dist/components/MNavigationDrawer.vue.d.ts +1 -1
  75. package/dist/components/MNumberField.vue.d.ts +11 -2
  76. package/dist/components/MPdfViewer.vue.d.ts +174 -0
  77. package/dist/components/MPullToRefresh.vue.d.ts +1 -1
  78. package/dist/components/MResourceTimeline.vue.d.ts +149 -0
  79. package/dist/components/MScheduler.vue.d.ts +3 -3
  80. package/dist/components/MScheme.vue.d.ts +1 -1
  81. package/dist/components/MSearchField.vue.d.ts +1 -1
  82. package/dist/components/MSeekBar.vue.d.ts +1 -1
  83. package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
  84. package/dist/components/MSkeleton.vue.d.ts +1 -1
  85. package/dist/components/MSlider.vue.d.ts +2 -2
  86. package/dist/components/MSparkline.vue.d.ts +1 -1
  87. package/dist/components/MSplitter.vue.d.ts +1 -1
  88. package/dist/components/MStack.vue.d.ts +2 -2
  89. package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
  90. package/dist/components/MSwitch.vue.d.ts +1 -1
  91. package/dist/components/MTable.vue.d.ts +1 -1
  92. package/dist/components/MTagInput.vue.d.ts +12 -1
  93. package/dist/components/MTextField.vue.d.ts +13 -2
  94. package/dist/components/MToolbar.vue.d.ts +1 -1
  95. package/dist/components/MTree.vue.d.ts +2 -2
  96. package/dist/components/MVideoPlayer.vue.d.ts +253 -0
  97. package/dist/components/MVirtualTable.vue.d.ts +1 -1
  98. package/dist/components/MWindow.vue.d.ts +3 -3
  99. package/dist/components/_MFlowEdge.vue.d.ts +9 -0
  100. package/dist/components/_MFlowEdgeLabel.vue.d.ts +9 -0
  101. package/dist/components/_MFlowNodeShell.vue.d.ts +9 -0
  102. package/dist/components/_MPdfPage.vue.d.ts +76 -0
  103. package/dist/components/_MTimeBackground.vue.d.ts +14 -0
  104. package/dist/components/_MTimeHeader.vue.d.ts +20 -0
  105. package/dist/composables/_flowPanel.d.ts +2 -0
  106. package/dist/composables/_flowSlot.d.ts +5 -0
  107. package/dist/composables/_ganttTime.d.ts +41 -0
  108. package/dist/composables/_useTimeAxis.d.ts +90 -0
  109. package/dist/composables/drawGeometry.d.ts +119 -0
  110. package/dist/composables/flowFormats.d.ts +79 -0
  111. package/dist/composables/flowLayout.d.ts +45 -0
  112. package/dist/composables/flowPaths.d.ts +53 -0
  113. package/dist/composables/ganttFormats.d.ts +52 -0
  114. package/dist/composables/ganttSchedule.d.ts +99 -0
  115. package/dist/composables/useDrawing.d.ts +44 -0
  116. package/dist/composables/useFloorPlan.d.ts +58 -0
  117. package/dist/composables/useFlow.d.ts +266 -0
  118. package/dist/composables/useGantt.d.ts +87 -0
  119. package/dist/composables/useLocale.d.ts +204 -0
  120. package/dist/composables/useMediaPlayer.d.ts +101 -0
  121. package/dist/composables/usePdf.d.ts +119 -0
  122. package/dist/composables/useResourceTimeline.d.ts +70 -0
  123. package/dist/draw.d.ts +7 -0
  124. package/dist/draw.js +1702 -0
  125. package/dist/draw.js.map +1 -0
  126. package/dist/flow.d.ts +14 -0
  127. package/dist/flow.js +3547 -0
  128. package/dist/flow.js.map +1 -0
  129. package/dist/flowPaths-CUc6X373.js +161 -0
  130. package/dist/flowPaths-CUc6X373.js.map +1 -0
  131. package/dist/gantt.d.ts +12 -0
  132. package/dist/gantt.js +3575 -0
  133. package/dist/gantt.js.map +1 -0
  134. package/dist/index.d.ts +9 -0
  135. package/dist/locales/index.js +1435 -7
  136. package/dist/locales/index.js.map +1 -1
  137. package/dist/m3ui-vue.css +1 -1
  138. package/dist/m3ui.js +8248 -7637
  139. package/dist/m3ui.js.map +1 -1
  140. package/dist/map.js +113 -108
  141. package/dist/map.js.map +1 -1
  142. package/dist/media.d.ts +5 -0
  143. package/dist/media.js +1311 -0
  144. package/dist/media.js.map +1 -0
  145. package/dist/pdf.d.ts +4 -0
  146. package/dist/pdf.js +1871 -0
  147. package/dist/pdf.js.map +1 -0
  148. package/dist/rich-text-editor.js +28 -26
  149. package/dist/rich-text-editor.js.map +1 -1
  150. package/dist/styles.css +1 -1
  151. package/dist/{useLocale-JYxDDeXC.js → useLocale-CaWwi-b6.js} +206 -2
  152. package/dist/useLocale-CaWwi-b6.js.map +1 -0
  153. package/dist/{useThemeTokens-y0HZpyhL.js → useThemeTokens-DQQcaWbE.js} +40 -54
  154. package/dist/useThemeTokens-DQQcaWbE.js.map +1 -0
  155. package/package.json +29 -5
  156. package/src/__tests__/MAudioPlayer.test.ts +75 -0
  157. package/src/__tests__/MDrawCanvas.test.ts +118 -0
  158. package/src/__tests__/MFloorPlan.test.ts +299 -0
  159. package/src/__tests__/MFlow.test.ts +590 -0
  160. package/src/__tests__/MGantt.test.ts +130 -0
  161. package/src/__tests__/MImageCropper.test.ts +89 -0
  162. package/src/__tests__/MPdfViewer.test.ts +235 -0
  163. package/src/__tests__/MResourceTimeline.test.ts +102 -0
  164. package/src/__tests__/MVideoPlayer.test.ts +201 -0
  165. package/src/__tests__/drawGeometry.test.ts +58 -0
  166. package/src/__tests__/fieldExpose.test.ts +30 -0
  167. package/src/__tests__/flowFormats.test.ts +185 -0
  168. package/src/__tests__/flowLayout.test.ts +113 -0
  169. package/src/__tests__/ganttFormats.test.ts +76 -0
  170. package/src/__tests__/ganttSchedule.test.ts +136 -0
  171. package/src/__tests__/pdfMock.ts +83 -0
  172. package/src/__tests__/useMediaPlayer.test.ts +182 -0
  173. package/src/__tests__/usePdf.test.ts +102 -0
  174. package/src/components/MAudioPlayer.vue +319 -0
  175. package/src/components/MDrawCanvas.vue +819 -0
  176. package/src/components/MDrawLayers.vue +114 -0
  177. package/src/components/MDrawToolbar.vue +171 -0
  178. package/src/components/MFloorPlan.vue +1080 -0
  179. package/src/components/MFloorPlanInspector.vue +169 -0
  180. package/src/components/MFloorPlanToolbar.vue +128 -0
  181. package/src/components/MFlow.vue +2060 -0
  182. package/src/components/MFlowControls.vue +110 -0
  183. package/src/components/MFlowHandle.vue +60 -0
  184. package/src/components/MFlowMinimap.vue +134 -0
  185. package/src/components/MFlowNode.vue +98 -0
  186. package/src/components/MGantt.vue +1609 -0
  187. package/src/components/MGanttControls.vue +77 -0
  188. package/src/components/MIconButton.vue +3 -1
  189. package/src/components/MImageCropper.vue +507 -0
  190. package/src/components/MMaskField.vue +13 -0
  191. package/src/components/MNumberField.vue +13 -0
  192. package/src/components/MPdfViewer.vue +1270 -0
  193. package/src/components/MResourceTimeline.vue +1020 -0
  194. package/src/components/MTagInput.vue +13 -0
  195. package/src/components/MTextField.vue +16 -0
  196. package/src/components/MVideoPlayer.vue +839 -0
  197. package/src/components/_MFlowEdge.vue +100 -0
  198. package/src/components/_MFlowEdgeLabel.vue +56 -0
  199. package/src/components/_MFlowNodeShell.vue +111 -0
  200. package/src/components/_MPdfPage.vue +456 -0
  201. package/src/components/_MTimeBackground.vue +16 -0
  202. package/src/components/_MTimeHeader.vue +31 -0
  203. package/src/composables/_flowPanel.ts +13 -0
  204. package/src/composables/_flowSlot.ts +6 -0
  205. package/src/composables/_ganttTime.ts +200 -0
  206. package/src/composables/_useTimeAxis.ts +224 -0
  207. package/src/composables/drawGeometry.ts +405 -0
  208. package/src/composables/flowFormats.ts +916 -0
  209. package/src/composables/flowLayout.ts +297 -0
  210. package/src/composables/flowPaths.ts +239 -0
  211. package/src/composables/ganttFormats.ts +366 -0
  212. package/src/composables/ganttSchedule.ts +403 -0
  213. package/src/composables/useDrawing.ts +53 -0
  214. package/src/composables/useFloorPlan.ts +73 -0
  215. package/src/composables/useFlow.ts +250 -0
  216. package/src/composables/useGantt.ts +92 -0
  217. package/src/composables/useLocale.ts +410 -0
  218. package/src/composables/useMediaPlayer.ts +406 -0
  219. package/src/composables/usePdf.ts +456 -0
  220. package/src/composables/useResourceTimeline.ts +76 -0
  221. package/src/draw.ts +25 -0
  222. package/src/flow.ts +26 -0
  223. package/src/gantt.ts +12 -0
  224. package/src/index.ts +9 -0
  225. package/src/locales/de.ts +204 -0
  226. package/src/locales/es.ts +204 -0
  227. package/src/locales/fr.ts +204 -0
  228. package/src/locales/ja.ts +204 -0
  229. package/src/locales/ko.ts +204 -0
  230. package/src/locales/pt.ts +204 -0
  231. package/src/locales/zh.ts +204 -0
  232. package/src/media.ts +5 -0
  233. package/src/pdf.ts +15 -0
  234. package/dist/MMenuItem-D4Gx_l3F.js +0 -929
  235. package/dist/MMenuItem-D4Gx_l3F.js.map +0 -1
  236. package/dist/MSlider-Dx_S3vJ9.js +0 -1506
  237. package/dist/MSlider-Dx_S3vJ9.js.map +0 -1
  238. package/dist/MTextField-Bz8JIsnl.js +0 -633
  239. package/dist/MTextField-Bz8JIsnl.js.map +0 -1
  240. package/dist/useLocale-JYxDDeXC.js.map +0 -1
  241. package/dist/useThemeTokens-y0HZpyhL.js.map +0 -1
@@ -0,0 +1,435 @@
1
+ import { i as e } from "./useLocale-CaWwi-b6.js";
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
+ //#region src/components/MSeekBar.vue?vue&type=script&setup=true&lang.ts
4
+ var re = [
5
+ "tabindex",
6
+ "aria-label",
7
+ "aria-valuemax",
8
+ "aria-valuenow",
9
+ "aria-valuetext",
10
+ "aria-disabled"
11
+ ], ie = {
12
+ key: 0,
13
+ class: "absolute inset-x-0 -top-3 -bottom-1"
14
+ }, ae = ["width", "height"], oe = ["stroke", "stroke-width"], se = { 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" }, ce = {
15
+ key: 0,
16
+ class: "truncate"
17
+ }, le = ["aria-label"], ue = ["aria-label"], de = /* @__PURE__ */ o({
18
+ __name: "MSeekBar",
19
+ props: {
20
+ modelValue: {},
21
+ duration: {},
22
+ buffered: {},
23
+ chapters: {},
24
+ playing: {
25
+ type: Boolean,
26
+ default: !1
27
+ },
28
+ playbackRate: { default: 1 },
29
+ live: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ variant: { default: "slider" },
34
+ size: { default: "md" },
35
+ time: { default: "below" },
36
+ remaining: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ format: {},
41
+ keyStep: { default: 5 },
42
+ preview: {
43
+ type: Boolean,
44
+ default: !0
45
+ },
46
+ color: { default: "primary" },
47
+ trackColor: {},
48
+ timeColor: {},
49
+ disabled: {
50
+ type: Boolean,
51
+ default: !1
52
+ },
53
+ label: {}
54
+ },
55
+ emits: [
56
+ "update:modelValue",
57
+ "seek",
58
+ "scrub-start",
59
+ "scrub",
60
+ "update:remaining"
61
+ ],
62
+ setup(o, { emit: de }) {
63
+ let h = o, g = de, _ = e(), fe = {
64
+ xs: {
65
+ track: 4,
66
+ thumbH: 16,
67
+ dot: 21,
68
+ dotIdle: 10,
69
+ gap: 4,
70
+ hit: 32,
71
+ wave: 4,
72
+ amp: 2.5,
73
+ length: 18
74
+ },
75
+ sm: {
76
+ track: 8,
77
+ thumbH: 28,
78
+ dot: 20,
79
+ dotIdle: 14,
80
+ gap: 5,
81
+ hit: 40,
82
+ wave: 6,
83
+ amp: 3,
84
+ length: 22
85
+ },
86
+ md: {
87
+ track: 16,
88
+ thumbH: 44,
89
+ dot: 28,
90
+ dotIdle: 21,
91
+ gap: 6,
92
+ hit: 46,
93
+ wave: 8,
94
+ amp: 4,
95
+ length: 26
96
+ }
97
+ }, v = n(() => fe[h.size] ?? fe.md), y = n(() => Number.isFinite(h.duration) && h.duration > 0 ? h.duration : 0), b = n(() => h.disabled || !y.value), pe = {
98
+ primary: "var(--color-primary)",
99
+ secondary: "var(--color-secondary)",
100
+ tertiary: "var(--color-tertiary)",
101
+ error: "var(--color-error)",
102
+ "secondary-container": "var(--color-secondary-container)"
103
+ }, x = n(() => {
104
+ if (h.disabled) return {
105
+ active: "color-mix(in srgb, var(--color-on-surface) 38%, transparent)",
106
+ inactive: "color-mix(in srgb, var(--color-on-surface) 12%, transparent)",
107
+ buffered: "color-mix(in srgb, var(--color-on-surface) 20%, transparent)"
108
+ };
109
+ let e = pe[h.color] ?? h.color, t = h.trackColor ? pe[h.trackColor] ?? h.trackColor : "var(--color-secondary-container)";
110
+ return {
111
+ active: e,
112
+ inactive: t,
113
+ buffered: `color-mix(in srgb, ${e} 35%, ${t})`
114
+ };
115
+ }), me = (e) => String(e).padStart(2, "0");
116
+ function S(e) {
117
+ if (h.format) return h.format(e);
118
+ let t = Math.max(0, Math.floor(e)), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60);
119
+ return (y.value >= 3600 ? `${n}:${me(r)}` : String(n * 60 + r)) + ":" + me(t % 60);
120
+ }
121
+ let C = d(null), w = d(h.modelValue), T = n(() => Math.min(y.value || Infinity, Math.max(0, C.value ?? w.value))), E = d(h.remaining);
122
+ m(() => h.remaining, (e) => {
123
+ E.value = e;
124
+ });
125
+ function he() {
126
+ E.value = !E.value, g("update:remaining", E.value);
127
+ }
128
+ let D = n(() => h.timeColor ? { color: h.timeColor } : void 0), ge = n(() => S(T.value)), _e = n(() => y.value ? E.value ? `-${S(y.value - T.value)}` : S(y.value) : "--:--"), ve = n(() => _.seekBarValue.replace("{position}", S(T.value)).replace("{duration}", y.value ? S(y.value) : "--:--")), ye = (e) => {
129
+ let t = null;
130
+ for (let n of h.chapters ?? []) n.start <= e && (!t || n.start >= t.start) && (t = n);
131
+ return t;
132
+ }, O = d(), k = d(0), A = (e) => y.value ? k.value * Math.min(1, Math.max(0, e / y.value)) : 0, j = n(() => {
133
+ let e = A(T.value);
134
+ if (h.variant === "line") return e;
135
+ let t = Math.max(2, v.value.track * .3);
136
+ return Math.min(k.value - t, Math.max(t, e));
137
+ }), be = n(() => {
138
+ let e = h.buffered;
139
+ return e === void 0 ? [] : typeof e == "number" ? [[0, e]] : e;
140
+ }), xe = n(() => {
141
+ let e = k.value;
142
+ if (!e) return [];
143
+ let { gap: t } = v.value, n = Ce.value, r = j.value, i = h.size === "md" ? 4 : 2, a = [];
144
+ for (let e of h.chapters ?? []) {
145
+ if (e.start <= 0 || e.start >= y.value) continue;
146
+ let t = A(e.start);
147
+ a.push([t - i / 2, t + i / 2]);
148
+ }
149
+ h.variant === "slider" && a.push([r - t, r + t]), h.variant === "wavy" && a.push([-Infinity, r + t]), a.sort((e, t) => e[0] - t[0]);
150
+ let o = [], s = 0;
151
+ for (let [t, n] of a) t > s && o.push([s, Math.min(t, e)]), s = Math.max(s, n);
152
+ s < e && o.push([s, e]);
153
+ let c = n / 2, l = Math.min(c, Math.max(1, n / 8)), ee = h.variant === "line" ? A(T.value) : r;
154
+ return o.filter(([e, t]) => t - e >= .5).map(([t, n]) => {
155
+ let r = [];
156
+ for (let [e, i] of be.value) {
157
+ let a = Math.max(t, A(e)), o = Math.min(n, A(i));
158
+ o > a && r.push({
159
+ left: a - t,
160
+ width: o - a,
161
+ color: x.value.buffered
162
+ });
163
+ }
164
+ return ee > t && r.push({
165
+ left: 0,
166
+ width: Math.min(n, ee) - t,
167
+ color: x.value.active
168
+ }), {
169
+ a: t,
170
+ b: n,
171
+ rl: t <= .01 ? c : l,
172
+ rr: n >= e - .01 ? c : l,
173
+ fills: r
174
+ };
175
+ });
176
+ }), Se = n(() => h.variant === "slider" && h.size === "md" && j.value < k.value - 12 - v.value.gap), M = d(!1), N = d(!1), P = d(!1), Ce = n(() => {
177
+ if (h.variant === "wavy") return v.value.wave;
178
+ let e = v.value.track;
179
+ return h.variant === "line" && !b.value && (P.value || M.value) ? e + Math.max(2, e / 4) : e;
180
+ }), we = n(() => {
181
+ let e = {
182
+ left: `${j.value}px`,
183
+ backgroundColor: x.value.active
184
+ };
185
+ if (h.variant === "line") {
186
+ let { dot: t, dotIdle: n } = v.value, r = M.value || P.value || N.value ? 1 : n / t;
187
+ return {
188
+ ...e,
189
+ width: `${t}px`,
190
+ height: `${t}px`,
191
+ borderRadius: "50%",
192
+ transform: `translate(-50%, -50%) scale(${r})`
193
+ };
194
+ }
195
+ let t = M.value || N.value ? .5 : 1;
196
+ return {
197
+ ...e,
198
+ width: "4px",
199
+ height: `${v.value.thumbH}px`,
200
+ borderRadius: "2px",
201
+ transform: `translate(-50%, -50%) scaleX(${t})`
202
+ };
203
+ }), F = d(null), I = n(() => h.preview && !b.value ? C.value ?? F.value : null), L = n(() => I.value === null ? null : ye(I.value)), Te = d(), R = d(0), z = null;
204
+ m(Te, (e) => {
205
+ z?.disconnect(), !(!e || typeof ResizeObserver > "u") && (R.value = e.offsetWidth, z = new ResizeObserver(() => {
206
+ R.value = e.offsetWidth;
207
+ }), z.observe(e));
208
+ });
209
+ let Ee = n(() => {
210
+ let e = I.value === null ? 0 : A(I.value), t = R.value / 2;
211
+ return t * 2 >= k.value ? k.value / 2 : Math.min(k.value - t, Math.max(t, e));
212
+ }), B = null;
213
+ function V(e) {
214
+ let t = O.value;
215
+ if (!t || !y.value) return 0;
216
+ let n = t.getBoundingClientRect();
217
+ return Math.min(1, Math.max(0, (e - n.left) / (n.width || 1))) * y.value;
218
+ }
219
+ function De(e) {
220
+ C.value = e, g("scrub", e), h.live && g("update:modelValue", e);
221
+ }
222
+ function Oe(e) {
223
+ if (!B) return;
224
+ B.started = !0, M.value = !0;
225
+ let t = V(e.clientX);
226
+ g("scrub-start", t), De(t);
227
+ }
228
+ function H(e) {
229
+ g("update:modelValue", e), g("seek", e), w.value = e, G = e, K = W();
230
+ }
231
+ function ke(e) {
232
+ b.value || e.button !== 0 || (B = {
233
+ id: e.pointerId,
234
+ x: e.clientX,
235
+ y: e.clientY,
236
+ touch: e.pointerType === "touch",
237
+ started: !1
238
+ }, window.addEventListener("pointermove", Ae), window.addEventListener("pointerup", je), window.addEventListener("pointercancel", Me), B.touch || (e.preventDefault(), O.value?.focus({ preventScroll: !0 }), Oe(e)));
239
+ }
240
+ function Ae(e) {
241
+ if (B && e.pointerId === B.id) {
242
+ if (!B.started) {
243
+ let t = Math.abs(e.clientX - B.x), n = Math.abs(e.clientY - B.y);
244
+ if (n > 8 && n > t) return U();
245
+ if (t < 4) return;
246
+ Oe(e);
247
+ }
248
+ De(V(e.clientX));
249
+ }
250
+ }
251
+ function je(e) {
252
+ if (!B || e.pointerId !== B.id) return;
253
+ let t = B.started ? C.value ?? V(e.clientX) : V(e.clientX);
254
+ U(), H(t);
255
+ }
256
+ function Me(e) {
257
+ if (!B || e.pointerId !== B.id) return;
258
+ let t = B.started ? C.value : null;
259
+ U(), t !== null && H(t);
260
+ }
261
+ function U() {
262
+ B = null, M.value = !1, C.value = null, window.removeEventListener("pointermove", Ae), window.removeEventListener("pointerup", je), window.removeEventListener("pointercancel", Me);
263
+ }
264
+ function Ne(e) {
265
+ e.pointerType !== "touch" && (P.value = !0, F.value = V(e.clientX));
266
+ }
267
+ function Pe() {
268
+ P.value = !1, F.value = null;
269
+ }
270
+ function Fe(e) {
271
+ if (b.value) return;
272
+ let t = y.value, n = {
273
+ ArrowRight: h.keyStep,
274
+ ArrowUp: h.keyStep,
275
+ ArrowLeft: -h.keyStep,
276
+ ArrowDown: -h.keyStep,
277
+ PageUp: t / 10,
278
+ PageDown: -t / 10
279
+ }, r = null;
280
+ e.key in n ? r = T.value + n[e.key] : e.key === "Home" ? r = 0 : e.key === "End" && (r = t), r !== null && (e.preventDefault(), H(Math.min(t, Math.max(0, r))));
281
+ }
282
+ let W = () => typeof performance < "u" ? performance.now() : 0, G = h.modelValue, K = W(), q = 0, J = 0, Y = 0, Ie = 0, Le = d(), Re = n(() => v.value.wave + 2 * v.value.amp + 2), ze = typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, X = () => h.variant === "wavy" && h.playing && C.value === null ? v.value.amp : 0;
283
+ Y = X();
284
+ function Be() {
285
+ return h.playing && C.value === null && !!y.value;
286
+ }
287
+ function Ve(e) {
288
+ let t = k.value, n = y.value;
289
+ (Math.floor(e) !== Math.floor(w.value) || n && Math.abs(e - w.value) * t / n >= .5) && (w.value = e);
290
+ }
291
+ function Z() {
292
+ let e = Le.value;
293
+ if (!e) return;
294
+ let { wave: t, length: n, gap: r } = v.value, i = t / 2, a = j.value - r - i;
295
+ if (a <= i) return e.setAttribute("d", "");
296
+ let o = Re.value / 2, s = 2 * Math.PI / n, c = "";
297
+ for (let e = i;; e += 2) {
298
+ let t = Math.min(e, a);
299
+ if (c += `${c ? "L" : "M"}${t.toFixed(1)},${(o + Y * Math.sin(s * t + Ie)).toFixed(2)}`, t >= a) break;
300
+ }
301
+ e.setAttribute("d", c);
302
+ }
303
+ function He(e) {
304
+ let t = J ? Math.min(.1, (e - J) / 1e3) : 0;
305
+ J = e, Be() && Ve(Math.min(y.value, G + (e - K) / 1e3 * h.playbackRate)), h.variant === "wavy" && (Y += (X() - Y) * (1 - Math.exp(-t / .12)), Math.abs(X() - Y) < .01 && (Y = X()), h.playing && !ze && (Ie -= t * 2 * Math.PI / 1.25), Z()), Be() || h.variant === "wavy" && (Y !== X() || h.playing && !ze) ? q = requestAnimationFrame(He) : (q = 0, J = 0);
306
+ }
307
+ function Q() {
308
+ q || typeof requestAnimationFrame > "u" || (q = requestAnimationFrame(He));
309
+ }
310
+ m(() => h.modelValue, (e) => {
311
+ G = e, K = W(), w.value = e, Q();
312
+ }), m(() => h.playing, () => {
313
+ G = w.value, K = W(), Q();
314
+ }), m(C, (e) => {
315
+ e === null && (G = w.value, K = W()), Q();
316
+ }), m([
317
+ j,
318
+ () => h.variant,
319
+ () => h.size
320
+ ], () => {
321
+ h.variant === "wavy" && Z();
322
+ }, { flush: "post" });
323
+ let $ = null;
324
+ return ee(() => {
325
+ let e = O.value;
326
+ k.value = e.clientWidth, typeof ResizeObserver < "u" && ($ = new ResizeObserver(() => {
327
+ k.value = e.clientWidth;
328
+ }), $.observe(e)), Z(), Q();
329
+ }), l(() => {
330
+ cancelAnimationFrame(q), $?.disconnect(), z?.disconnect(), U();
331
+ }), (e, n) => (u(), i("div", { class: s(["flex min-w-0 select-none", o.time === "sides" ? "items-center gap-3" : "flex-col"]) }, [
332
+ o.time === "sides" ? (u(), i("span", {
333
+ key: 0,
334
+ class: s(["min-w-[4ch] shrink-0 text-right text-label-medium tabular-nums", !o.timeColor && "text-on-surface-variant"]),
335
+ style: c(D.value)
336
+ }, f(ge.value), 7)) : r("", !0),
337
+ a("div", {
338
+ ref_key: "trackEl",
339
+ ref: O,
340
+ role: "slider",
341
+ tabindex: b.value ? -1 : 0,
342
+ "aria-label": o.label ?? p(_).seekBar,
343
+ "aria-valuemin": "0",
344
+ "aria-valuemax": Math.round(y.value),
345
+ "aria-valuenow": Math.round(T.value),
346
+ "aria-valuetext": ve.value,
347
+ "aria-disabled": b.value || void 0,
348
+ class: s(["group relative min-w-0 shrink-0 touch-pan-y outline-none", [b.value ? "cursor-default" : "cursor-pointer", o.time === "sides" && "flex-1"]]),
349
+ style: c({ height: `${v.value.hit}px` }),
350
+ onPointerdown: ke,
351
+ onPointermove: Ne,
352
+ onPointerleave: Pe,
353
+ onKeydown: Fe,
354
+ onFocus: n[0] ||= (e) => N.value = !0,
355
+ onBlur: n[1] ||= (e) => N.value = !1
356
+ }, [
357
+ b.value ? r("", !0) : (u(), i("div", ie)),
358
+ (u(!0), i(t, null, te(xe.value, (e, n) => (u(), i("div", {
359
+ key: n,
360
+ class: "absolute top-1/2 -translate-y-1/2 overflow-hidden transition-[height] duration-100",
361
+ style: c({
362
+ left: `${e.a}px`,
363
+ width: `${e.b - e.a}px`,
364
+ height: `${Ce.value}px`,
365
+ borderRadius: `${e.rl}px ${e.rr}px ${e.rr}px ${e.rl}px`,
366
+ backgroundColor: x.value.inactive
367
+ })
368
+ }, [(u(!0), i(t, null, te(e.fills, (e, t) => (u(), i("div", {
369
+ key: t,
370
+ class: "absolute inset-y-0",
371
+ style: c({
372
+ left: `${e.left}px`,
373
+ width: `${e.width}px`,
374
+ backgroundColor: e.color
375
+ })
376
+ }, null, 4))), 128))], 4))), 128)),
377
+ o.variant === "wavy" ? (u(), i("svg", {
378
+ key: 1,
379
+ class: "pointer-events-none absolute top-1/2 left-0 -translate-y-1/2 overflow-visible",
380
+ width: k.value,
381
+ height: Re.value,
382
+ "aria-hidden": "true"
383
+ }, [a("path", {
384
+ ref_key: "wavePathEl",
385
+ ref: Le,
386
+ fill: "none",
387
+ stroke: x.value.active,
388
+ "stroke-width": v.value.wave,
389
+ "stroke-linecap": "round"
390
+ }, null, 8, oe)], 8, ae)) : r("", !0),
391
+ Se.value ? (u(), i("div", {
392
+ key: 2,
393
+ class: "pointer-events-none absolute top-1/2 right-3 size-1 -translate-y-1/2 rounded-full",
394
+ style: c({ backgroundColor: x.value.active })
395
+ }, null, 4)) : r("", !0),
396
+ a("div", {
397
+ 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",
398
+ style: c(we.value)
399
+ }, null, 4),
400
+ I.value === null ? r("", !0) : (u(), i("div", {
401
+ key: 3,
402
+ ref_key: "bubbleEl",
403
+ ref: Te,
404
+ class: "pointer-events-none absolute bottom-full z-10 mb-1 -translate-x-1/2",
405
+ style: c({ left: `${Ee.value}px` })
406
+ }, [ne(e.$slots, "preview", {
407
+ time: I.value,
408
+ formatted: S(I.value),
409
+ chapter: L.value
410
+ }, () => [a("div", se, [L.value?.title ? (u(), i("span", ce, f(L.value.title) + " ·", 1)) : r("", !0), a("span", null, f(S(I.value)), 1)])])], 4))
411
+ ], 46, re),
412
+ o.time === "below" ? (u(), i("div", {
413
+ key: 1,
414
+ class: s(["flex items-center justify-between text-label-medium tabular-nums", !o.timeColor && "text-on-surface-variant"]),
415
+ style: c(D.value)
416
+ }, [a("span", null, f(ge.value), 1), a("button", {
417
+ type: "button",
418
+ class: "cursor-pointer rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-secondary",
419
+ "aria-label": E.value ? p(_).seekBarShowDuration : p(_).seekBarShowRemaining,
420
+ onClick: he
421
+ }, f(_e.value), 9, le)], 6)) : o.time === "sides" ? (u(), i("button", {
422
+ key: 2,
423
+ type: "button",
424
+ class: s(["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", !o.timeColor && "text-on-surface-variant"]),
425
+ style: c(D.value),
426
+ "aria-label": E.value ? p(_).seekBarShowDuration : p(_).seekBarShowRemaining,
427
+ onClick: he
428
+ }, f(_e.value), 15, ue)) : r("", !0)
429
+ ], 2));
430
+ }
431
+ });
432
+ //#endregion
433
+ export { de as t };
434
+
435
+ //# sourceMappingURL=MSeekBar-BeN9QcB3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MSeekBar-BeN9QcB3.js","names":[],"sources":["../src/components/MSeekBar.vue","../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","<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,IAAM,IAAQ,GAqDR,IAAO,IAQP,IAAS,EAAU,GAKnB,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,MA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G,MAAE,CAAA,KAAA,EAAA,IAAA,EAAA,GAChF,EAAmC,QAAA,MAAA,EAA1B,EAAI,EAAA,KAAW,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA;;GAMrB,EAAA,SAAI,WAAf,EAAA,GAAA,EAQM,OAAA;;IARuB,OAAK,EAAA,CAAC,oEAAkE,CAAU,EAAA,aAAS,yBAAA,CAAA;IAAgC,OAAK,EAAE,EAAA,KAAS;GACtK,GAAA,CAAA,EAA4B,QAAA,MAAA,EAAnB,GAAA,KAAS,GAAA,CAAA,GAClB,EAKuB,UAAA;IAJrB,MAAK;IACL,OAAM;IACL,cAAY,EAAA,QAAgB,EAAA,CAAA,CAAM,CAAC,sBAAsB,EAAA,CAAA,CAAM,CAAC;IAChE,SAAO;GACN,GAAA,EAAA,GAAA,KAAO,GAAA,GAAA,EAAA,CAAA,GAAA,CAAA,KAGA,EAAA,SAAI,WADjB,EAAA,GAAA,EAQuB,UAAA;;IANrB,MAAK;IACL,OAAK,EAAA,CAAC,0JAAwJ,CACrJ,EAAA,aAAS,yBAAA,CAAA;IACjB,OAAK,EAAE,EAAA,KAAS;IAChB,cAAY,EAAA,QAAgB,EAAA,CAAA,CAAM,CAAC,sBAAsB,EAAA,CAAA,CAAM,CAAC;IAChE,SAAO;GACN,GAAA,EAAA,GAAA,KAAO,GAAA,IAAA,EAAA,KAAA,EAAA,IAAA,EAAA"}
@@ -0,0 +1,65 @@
1
+ import { t as e } from "./MIcon-Bxh9j135.js";
2
+ import { Fragment as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderList as l, toDisplayString as u } from "vue";
3
+ //#region src/components/MSegmentedButton.vue?vue&type=script&setup=true&lang.ts
4
+ var d = {
5
+ class: "inline-flex overflow-hidden rounded-full border border-outline",
6
+ role: "group"
7
+ }, f = [
8
+ "disabled",
9
+ "aria-pressed",
10
+ "onClick"
11
+ ], p = /* @__PURE__ */ o({
12
+ __name: "MSegmentedButton",
13
+ props: {
14
+ modelValue: {},
15
+ options: {},
16
+ multiSelect: {
17
+ type: Boolean,
18
+ default: !1
19
+ },
20
+ density: { default: "default" },
21
+ color: { default: "primary" }
22
+ },
23
+ emits: ["update:modelValue"],
24
+ setup(o, { emit: p }) {
25
+ let m = p;
26
+ function h(e, t) {
27
+ return Array.isArray(t) ? t.includes(e) : t === e;
28
+ }
29
+ function g(e, t, n) {
30
+ if (!e.disabled) {
31
+ if (n) {
32
+ let n = Array.isArray(t) ? [...t] : [t], r = n.indexOf(e.value);
33
+ r >= 0 ? n.splice(r, 1) : n.push(e.value), m("update:modelValue", n);
34
+ } else m("update:modelValue", e.value);
35
+ }
36
+ }
37
+ return (p, m) => (c(), i("div", d, [(c(!0), i(t, null, l(o.options, (t, l) => (c(), i("button", {
38
+ key: t.value,
39
+ type: "button",
40
+ class: s(["relative inline-flex grow items-center justify-center gap-2 text-label-large font-medium transition-[background-color,color] duration-150 outline-none before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", [
41
+ o.density === "compact" ? "h-8 px-3" : o.density === "comfortable" ? "h-10 px-4" : "h-10 px-6",
42
+ l > 0 ? t.disabled ? "border-l border-outline/12" : "border-l border-outline" : "",
43
+ t.disabled ? "cursor-not-allowed" : "cursor-pointer",
44
+ h(t.value, o.modelValue) && (o.color === "secondary" ? "bg-secondary-container" : o.color === "tertiary" ? "bg-tertiary-container" : "bg-primary-container"),
45
+ t.disabled ? "text-on-surface/38" : h(t.value, o.modelValue) ? o.color === "secondary" ? "text-on-secondary-container" : o.color === "tertiary" ? "text-on-tertiary-container" : "text-on-primary-container" : "text-on-surface"
46
+ ]]),
47
+ disabled: t.disabled,
48
+ "aria-pressed": h(t.value, o.modelValue),
49
+ onClick: (e) => g(t, o.modelValue, o.multiSelect)
50
+ }, [h(t.value, o.modelValue) ? (c(), n(e, {
51
+ key: 0,
52
+ name: "check",
53
+ size: 18,
54
+ class: "transition-transform duration-150"
55
+ })) : t.icon ? (c(), n(e, {
56
+ key: 1,
57
+ name: t.icon,
58
+ size: 18
59
+ }, null, 8, ["name"])) : r("", !0), a("span", null, u(t.label), 1)], 10, f))), 128))]));
60
+ }
61
+ });
62
+ //#endregion
63
+ export { p as t };
64
+
65
+ //# sourceMappingURL=MSegmentedButton-DL9JtJFX.js.map