@weasel-js/ui 1.3.0 → 1.4.0-pre.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 (225) hide show
  1. package/dist/chunks/{ActionBar-BTev_ZZl.js → ActionBar-D4N1o4LB.js} +2 -2
  2. package/dist/chunks/{ActionBar-BTev_ZZl.js.map → ActionBar-D4N1o4LB.js.map} +1 -1
  3. package/dist/chunks/{ActionsBar-CBi_dV4B.js → ActionsBar-B-gWm0NE.js} +3 -3
  4. package/dist/chunks/{ActionsBar-CBi_dV4B.js.map → ActionsBar-B-gWm0NE.js.map} +1 -1
  5. package/dist/chunks/{Badge-9dPfvYOk.js → Badge-BXTDs-zi.js} +1 -1
  6. package/dist/chunks/{Badge-9dPfvYOk.js.map → Badge-BXTDs-zi.js.map} +1 -1
  7. package/dist/chunks/{BandEditor-DeE-Nhyh.js → BandEditor-D13ybQN_.js} +1 -1
  8. package/dist/chunks/{BandEditor-DeE-Nhyh.js.map → BandEditor-D13ybQN_.js.map} +1 -1
  9. package/dist/chunks/{Button-CIu40Epu.js → Button-0OdcoOMx.js} +1 -1
  10. package/dist/chunks/{Button-CIu40Epu.js.map → Button-0OdcoOMx.js.map} +1 -1
  11. package/dist/chunks/{Callout-CxDNb9iE.js → Callout-DAFusbzz.js} +1 -1
  12. package/dist/chunks/Callout-DAFusbzz.js.map +1 -0
  13. package/dist/chunks/{Checkbox-Chtrlh19.js → Checkbox-BePa_djO.js} +1 -1
  14. package/dist/chunks/{Checkbox-Chtrlh19.js.map → Checkbox-BePa_djO.js.map} +1 -1
  15. package/dist/chunks/{ColorField-CSSRv3jG.js → ColorField-CKbnsEUN.js} +2 -2
  16. package/dist/chunks/{ColorField-CSSRv3jG.js.map → ColorField-CKbnsEUN.js.map} +1 -1
  17. package/dist/chunks/{ComboBox-BIQ8KP4h.js → ComboBox-B6QS8y3j.js} +2 -2
  18. package/dist/chunks/{ComboBox-BIQ8KP4h.js.map → ComboBox-B6QS8y3j.js.map} +1 -1
  19. package/dist/chunks/{CurveEditor-DiJk0NhK.js → CurveEditor-COJ6WK9K.js} +2 -2
  20. package/dist/chunks/{CurveEditor-DiJk0NhK.js.map → CurveEditor-COJ6WK9K.js.map} +1 -1
  21. package/dist/chunks/{DataGrid-BgiEYBLo.js → DataGrid-BWZZUekH.js} +2 -2
  22. package/dist/chunks/{DataGrid-BgiEYBLo.js.map → DataGrid-BWZZUekH.js.map} +1 -1
  23. package/dist/chunks/DetentSlider-CXIeTHaM.js +83 -0
  24. package/dist/chunks/DetentSlider-CXIeTHaM.js.map +1 -0
  25. package/dist/chunks/{Dialog-RzrboT4Q.js → Dialog-CQAZ7hS7.js} +1 -1
  26. package/dist/chunks/{Dialog-RzrboT4Q.js.map → Dialog-CQAZ7hS7.js.map} +1 -1
  27. package/dist/chunks/{DragHandleGlyph-CJbzRigu.js → DragHandleGlyph--2zsZzA2.js} +1 -1
  28. package/dist/chunks/{DragHandleGlyph-CJbzRigu.js.map → DragHandleGlyph--2zsZzA2.js.map} +1 -1
  29. package/dist/chunks/{Field-DrRby9vo.js → Field-BCcTt6Fd.js} +1 -1
  30. package/dist/chunks/{Field-DrRby9vo.js.map → Field-BCcTt6Fd.js.map} +1 -1
  31. package/dist/chunks/FontFamilySelect-DwkwRYrr.js +29 -0
  32. package/dist/chunks/FontFamilySelect-DwkwRYrr.js.map +1 -0
  33. package/dist/chunks/{GradientEditor-BuVR6pt-.js → GradientEditor-FwNdxxf-.js} +4 -4
  34. package/dist/chunks/{GradientEditor-BuVR6pt-.js.map → GradientEditor-FwNdxxf-.js.map} +1 -1
  35. package/dist/chunks/{PaintInput-K5W4Uho3.js → Icon-CxoJb_bw.js} +17 -127
  36. package/dist/chunks/Icon-CxoJb_bw.js.map +1 -0
  37. package/dist/chunks/{InlineRange-B-Jkv8AA.js → InlineRange-mb19EGOI.js} +1 -1
  38. package/dist/chunks/{InlineRange-B-Jkv8AA.js.map → InlineRange-mb19EGOI.js.map} +1 -1
  39. package/dist/chunks/{Input-BnxOPY4N.js → Input-DRUeowbz.js} +2 -2
  40. package/dist/chunks/{Input-BnxOPY4N.js.map → Input-DRUeowbz.js.map} +1 -1
  41. package/dist/chunks/ItemList-BUTk9E8-.js +42 -0
  42. package/dist/chunks/ItemList-BUTk9E8-.js.map +1 -0
  43. package/dist/chunks/{Keycaps-Dk33JOiH.js → Keycaps-DszN5Dwl.js} +1 -1
  44. package/dist/chunks/{Keycaps-Dk33JOiH.js.map → Keycaps-DszN5Dwl.js.map} +1 -1
  45. package/dist/chunks/{LayerStack-DQYvGNPA.js → LayerStack-htMwIsJ6.js} +3 -3
  46. package/dist/chunks/{LayerStack-DQYvGNPA.js.map → LayerStack-htMwIsJ6.js.map} +1 -1
  47. package/dist/chunks/{NumberField-BQ-KaK7T.js → NumberField-CQ7OJORF.js} +2 -2
  48. package/dist/chunks/{NumberField-BQ-KaK7T.js.map → NumberField-CQ7OJORF.js.map} +1 -1
  49. package/dist/chunks/{OptionsBar-BecAPCID.js → OptionsBar-efIwfqYe.js} +3 -3
  50. package/dist/chunks/{OptionsBar-BecAPCID.js.map → OptionsBar-efIwfqYe.js.map} +1 -1
  51. package/dist/chunks/PaintInput-CgZR3B0r.js +118 -0
  52. package/dist/chunks/PaintInput-CgZR3B0r.js.map +1 -0
  53. package/dist/chunks/{PatternPicker-BdLSj_f_.js → PatternPicker-v9BFsaMM.js} +2 -2
  54. package/dist/chunks/{PatternPicker-BdLSj_f_.js.map → PatternPicker-v9BFsaMM.js.map} +1 -1
  55. package/dist/chunks/{Plot2D-BEjpJhk-.js → Plot2D-B08SYGQV.js} +1 -1
  56. package/dist/chunks/{Plot2D-BEjpJhk-.js.map → Plot2D-B08SYGQV.js.map} +1 -1
  57. package/dist/chunks/{PointPlotter-C_tZb122.js → PointPlotter-DEh7a3xB.js} +2 -2
  58. package/dist/chunks/{PointPlotter-C_tZb122.js.map → PointPlotter-DEh7a3xB.js.map} +1 -1
  59. package/dist/chunks/{Powerline-Cc-Av8Pc.js → Powerline-M1Q3Hx5E.js} +2 -2
  60. package/dist/chunks/{Powerline-Cc-Av8Pc.js.map → Powerline-M1Q3Hx5E.js.map} +1 -1
  61. package/dist/chunks/{Prefs-CRTRAud6.js → Prefs-C2qhxnmt.js} +11 -11
  62. package/dist/chunks/{Prefs-CRTRAud6.js.map → Prefs-C2qhxnmt.js.map} +1 -1
  63. package/dist/chunks/{Properties-BRrWSBHM.js → Properties-CFRJ8mYH.js} +65 -58
  64. package/dist/chunks/Properties-CFRJ8mYH.js.map +1 -0
  65. package/dist/chunks/{RadioGroup-BrtV1Clm.js → RadioGroup-B8eMJ6lu.js} +2 -2
  66. package/dist/chunks/{RadioGroup-BrtV1Clm.js.map → RadioGroup-B8eMJ6lu.js.map} +1 -1
  67. package/dist/chunks/{RangeSlider-CJfhxDn6.js → RangeSlider-JczhglgA.js} +1 -1
  68. package/dist/chunks/RangeSlider-JczhglgA.js.map +1 -0
  69. package/dist/chunks/{ResizeHandle-Csz3DPew.js → ResizeHandle-CXBXV6Px.js} +1 -1
  70. package/dist/chunks/{ResizeHandle-Csz3DPew.js.map → ResizeHandle-CXBXV6Px.js.map} +1 -1
  71. package/dist/chunks/{Select-BYhHGmMl.js → Select-g8PhE010.js} +2 -2
  72. package/dist/chunks/{Select-BYhHGmMl.js.map → Select-g8PhE010.js.map} +1 -1
  73. package/dist/chunks/SelectionPanel-Cl18SdD6.js +561 -0
  74. package/dist/chunks/SelectionPanel-Cl18SdD6.js.map +1 -0
  75. package/dist/chunks/{Sidebar-DrBQZ9nP.js → Sidebar-mWGsndWw.js} +1 -1
  76. package/dist/chunks/{Sidebar-DrBQZ9nP.js.map → Sidebar-mWGsndWw.js.map} +1 -1
  77. package/dist/chunks/SidebarPanel-B2d0erLv.js +59 -0
  78. package/dist/chunks/SidebarPanel-B2d0erLv.js.map +1 -0
  79. package/dist/chunks/{Slider-DbOt9Dji.js → Slider-BbbmHE0c.js} +97 -63
  80. package/dist/chunks/Slider-BbbmHE0c.js.map +1 -0
  81. package/dist/chunks/{StatusBar-B6lPbvrF.js → StatusBar-xxCcWsfq.js} +1 -1
  82. package/dist/chunks/{StatusBar-B6lPbvrF.js.map → StatusBar-xxCcWsfq.js.map} +1 -1
  83. package/dist/chunks/{Switch-BSr-vaAC.js → Switch-QviBb61l.js} +1 -1
  84. package/dist/chunks/{Switch-BSr-vaAC.js.map → Switch-QviBb61l.js.map} +1 -1
  85. package/dist/chunks/{Tabs-CIa-Idzu.js → Tabs-DT-dIt6d.js} +1 -1
  86. package/dist/chunks/{Tabs-CIa-Idzu.js.map → Tabs-DT-dIt6d.js.map} +1 -1
  87. package/dist/chunks/Timeline-DsLeV5I1.js +894 -0
  88. package/dist/chunks/Timeline-DsLeV5I1.js.map +1 -0
  89. package/dist/chunks/{Toast-C0UnBqQu.js → Toast-CfkiN0Nv.js} +1 -1
  90. package/dist/chunks/{Toast-C0UnBqQu.js.map → Toast-CfkiN0Nv.js.map} +1 -1
  91. package/dist/chunks/{ToggleBar-1wDRwSGN.js → ToggleBar-D0veW91s.js} +2 -2
  92. package/dist/chunks/{ToggleBar-1wDRwSGN.js.map → ToggleBar-D0veW91s.js.map} +1 -1
  93. package/dist/chunks/{ToolButton-Bd9l_I8f.js → ToolButton-CLoR9Z4o.js} +2 -2
  94. package/dist/chunks/{ToolButton-Bd9l_I8f.js.map → ToolButton-CLoR9Z4o.js.map} +1 -1
  95. package/dist/chunks/{ToolGroup-gizXwttA.js → ToolGroup-BnE23mcA.js} +1 -1
  96. package/dist/chunks/{ToolGroup-gizXwttA.js.map → ToolGroup-BnE23mcA.js.map} +1 -1
  97. package/dist/chunks/{ToolOptionsBar-CXjeTE1d.js → ToolOptionsBar-ByHX7y1M.js} +1 -1
  98. package/dist/chunks/{ToolOptionsBar-CXjeTE1d.js.map → ToolOptionsBar-ByHX7y1M.js.map} +1 -1
  99. package/dist/chunks/{ToolPalette-3YpkSNfj.js → ToolPalette-W-rAsomq.js} +5 -5
  100. package/dist/chunks/{ToolPalette-3YpkSNfj.js.map → ToolPalette-W-rAsomq.js.map} +1 -1
  101. package/dist/chunks/{Tooltip-Di7vxbFa.js → Tooltip-Bq8Hvj4r.js} +1 -1
  102. package/dist/chunks/{Tooltip-Di7vxbFa.js.map → Tooltip-Bq8Hvj4r.js.map} +1 -1
  103. package/dist/chunks/icons-CdLHgzV8.js +144 -0
  104. package/dist/chunks/icons-CdLHgzV8.js.map +1 -0
  105. package/dist/chunks/{keyGlyph-D3X08tSp.js → keyGlyph-BLFMKZgF.js} +1 -1
  106. package/dist/chunks/{keyGlyph-D3X08tSp.js.map → keyGlyph-BLFMKZgF.js.map} +1 -1
  107. package/dist/chunks/{number-llMRJPJW.js → number-D3TDawLC.js} +1 -1
  108. package/dist/chunks/{number-llMRJPJW.js.map → number-D3TDawLC.js.map} +1 -1
  109. package/dist/chunks/{segmentedControl.module-YXqIjnmu.js → segmentedControl.module-XADeq9e5.js} +1 -1
  110. package/dist/chunks/{segmentedControl.module-YXqIjnmu.js.map → segmentedControl.module-XADeq9e5.js.map} +1 -1
  111. package/dist/chunks/{useReorderDragList-RSJqj18B.js → useReorderDragList-nQMVwNBd.js} +1 -1
  112. package/dist/chunks/{useReorderDragList-RSJqj18B.js.map → useReorderDragList-nQMVwNBd.js.map} +1 -1
  113. package/dist/chunks/{useRovingTabIndex-CuUl6DLF.js → useRovingTabIndex-ByjY4lnw.js} +1 -1
  114. package/dist/chunks/{useRovingTabIndex-CuUl6DLF.js.map → useRovingTabIndex-ByjY4lnw.js.map} +1 -1
  115. package/dist/components/ActionBar/index.js +1 -1
  116. package/dist/components/ActionsBar/index.js +1 -1
  117. package/dist/components/Badge/index.js +1 -1
  118. package/dist/components/BandEditor/index.js +1 -1
  119. package/dist/components/Button/index.js +1 -1
  120. package/dist/components/Callout/Callout.d.ts +3 -3
  121. package/dist/components/Callout/index.js +1 -1
  122. package/dist/components/Checkbox/index.js +1 -1
  123. package/dist/components/ColorField/index.js +1 -1
  124. package/dist/components/ComboBox/index.js +1 -1
  125. package/dist/components/CurveEditor/index.js +1 -1
  126. package/dist/components/DataGrid/index.js +1 -1
  127. package/dist/components/DetentSlider/DetentSlider.d.ts +52 -0
  128. package/dist/components/DetentSlider/DetentSlider.d.ts.map +1 -0
  129. package/dist/components/DetentSlider/index.d.ts +3 -0
  130. package/dist/components/DetentSlider/index.d.ts.map +1 -0
  131. package/dist/components/DetentSlider/index.js +2 -0
  132. package/dist/components/Dialog/index.js +1 -1
  133. package/dist/components/DragHandleGlyph/index.js +1 -1
  134. package/dist/components/Field/index.js +1 -1
  135. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts +15 -0
  136. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts.map +1 -0
  137. package/dist/components/FontFamilySelect/index.d.ts +3 -0
  138. package/dist/components/FontFamilySelect/index.d.ts.map +1 -0
  139. package/dist/components/FontFamilySelect/index.js +2 -0
  140. package/dist/components/GradientEditor/index.js +1 -1
  141. package/dist/components/InlineRange/index.js +1 -1
  142. package/dist/components/Input/index.js +1 -1
  143. package/dist/components/ItemList/ItemList.d.ts +45 -0
  144. package/dist/components/ItemList/ItemList.d.ts.map +1 -0
  145. package/dist/components/ItemList/index.d.ts +3 -0
  146. package/dist/components/ItemList/index.d.ts.map +1 -0
  147. package/dist/components/ItemList/index.js +2 -0
  148. package/dist/components/Keycaps/index.js +2 -2
  149. package/dist/components/LayerStack/index.js +1 -1
  150. package/dist/components/NumberField/index.js +1 -1
  151. package/dist/components/OptionsBar/index.js +1 -1
  152. package/dist/components/PaintInput/index.js +1 -1
  153. package/dist/components/PatternPicker/index.js +1 -1
  154. package/dist/components/Plot2D/index.js +1 -1
  155. package/dist/components/PointPlotter/index.js +1 -1
  156. package/dist/components/Powerline/index.js +2 -2
  157. package/dist/components/Prefs/index.js +1 -1
  158. package/dist/components/Properties/PropertyPanel.d.ts +21 -7
  159. package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
  160. package/dist/components/Properties/index.js +1 -1
  161. package/dist/components/RadioGroup/index.js +1 -1
  162. package/dist/components/RangeSlider/RangeSlider.d.ts +2 -2
  163. package/dist/components/RangeSlider/index.js +1 -1
  164. package/dist/components/ResizeHandle/index.js +1 -1
  165. package/dist/components/Select/index.js +1 -1
  166. package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
  167. package/dist/components/SelectionPanel/index.js +1 -1
  168. package/dist/components/Sidebar/index.js +1 -1
  169. package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
  170. package/dist/components/SidebarPanel/index.js +1 -1
  171. package/dist/components/Slider/Slider.d.ts +16 -1
  172. package/dist/components/Slider/Slider.d.ts.map +1 -1
  173. package/dist/components/Slider/index.js +1 -1
  174. package/dist/components/StatusBar/index.js +1 -1
  175. package/dist/components/Switch/index.js +1 -1
  176. package/dist/components/Tabs/index.js +1 -1
  177. package/dist/components/Timeline/AnimatedTimeline.d.ts +15 -0
  178. package/dist/components/Timeline/AnimatedTimeline.d.ts.map +1 -0
  179. package/dist/components/Timeline/EasingPicker.d.ts +8 -0
  180. package/dist/components/Timeline/EasingPicker.d.ts.map +1 -0
  181. package/dist/components/Timeline/Lane.d.ts +28 -0
  182. package/dist/components/Timeline/Lane.d.ts.map +1 -0
  183. package/dist/components/Timeline/Ruler.d.ts +12 -0
  184. package/dist/components/Timeline/Ruler.d.ts.map +1 -0
  185. package/dist/components/Timeline/Timeline.d.ts +39 -0
  186. package/dist/components/Timeline/Timeline.d.ts.map +1 -0
  187. package/dist/components/Timeline/Transport.d.ts +14 -0
  188. package/dist/components/Timeline/Transport.d.ts.map +1 -0
  189. package/dist/components/Timeline/easingSpec.d.ts +16 -0
  190. package/dist/components/Timeline/easingSpec.d.ts.map +1 -0
  191. package/dist/components/Timeline/index.d.ts +11 -0
  192. package/dist/components/Timeline/index.d.ts.map +1 -0
  193. package/dist/components/Timeline/index.js +2 -0
  194. package/dist/components/Timeline/keys.d.ts +34 -0
  195. package/dist/components/Timeline/keys.d.ts.map +1 -0
  196. package/dist/components/Timeline/lanes.d.ts +24 -0
  197. package/dist/components/Timeline/lanes.d.ts.map +1 -0
  198. package/dist/components/Timeline/timeScale.d.ts +31 -0
  199. package/dist/components/Timeline/timeScale.d.ts.map +1 -0
  200. package/dist/components/Toast/index.js +1 -1
  201. package/dist/components/ToggleBar/index.js +1 -1
  202. package/dist/components/ToolButton/index.js +1 -1
  203. package/dist/components/ToolGroup/index.js +1 -1
  204. package/dist/components/ToolOptionsBar/index.js +1 -1
  205. package/dist/components/ToolPalette/index.js +1 -1
  206. package/dist/components/Tooltip/index.js +1 -1
  207. package/dist/icons/index.d.ts +3 -1
  208. package/dist/icons/index.d.ts.map +1 -1
  209. package/dist/icons/paths.d.ts +2 -0
  210. package/dist/icons/paths.d.ts.map +1 -1
  211. package/dist/index.d.ts +4 -0
  212. package/dist/index.d.ts.map +1 -1
  213. package/dist/index.js +62 -189
  214. package/dist/index.js.map +1 -1
  215. package/dist/style.css +1 -1
  216. package/package.json +5 -4
  217. package/dist/chunks/Callout-CxDNb9iE.js.map +0 -1
  218. package/dist/chunks/PaintInput-K5W4Uho3.js.map +0 -1
  219. package/dist/chunks/Properties-BRrWSBHM.js.map +0 -1
  220. package/dist/chunks/RangeSlider-CJfhxDn6.js.map +0 -1
  221. package/dist/chunks/SelectionPanel-D2IYlj_K.js +0 -446
  222. package/dist/chunks/SelectionPanel-D2IYlj_K.js.map +0 -1
  223. package/dist/chunks/SidebarPanel-Dbqb79Kx.js +0 -59
  224. package/dist/chunks/SidebarPanel-Dbqb79Kx.js.map +0 -1
  225. package/dist/chunks/Slider-DbOt9Dji.js.map +0 -1
@@ -0,0 +1,894 @@
1
+ import { I as e, M as t, i as n } from "./icons-CdLHgzV8.js";
2
+ import { t as r } from "./DetentSlider-CXIeTHaM.js";
3
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
4
+ import { EASINGS as s, cubicBezierEasing as c, resolveEasing as l, sampleTrack as u, useVisibleRaf as d } from "@weasel-js/core";
5
+ import { useCallback as f, useEffect as p, useLayoutEffect as m, useMemo as h, useReducer as g, useRef as _, useState as v } from "react";
6
+ var y = {
7
+ ruler: "_ruler_1qsom_1",
8
+ tick: "_tick_1qsom_11",
9
+ playhead: "_playhead_1qsom_29",
10
+ lane: "_lane_1qsom_38",
11
+ laneLabel: "_laneLabel_1qsom_45",
12
+ disclosure: "_disclosure_1qsom_63",
13
+ disclosureIcon: "_disclosureIcon_1qsom_64",
14
+ disclosureCollapsed: "_disclosureCollapsed_1qsom_65",
15
+ laneTrack: "_laneTrack_1qsom_67",
16
+ key: "_key_1qsom_74",
17
+ eventMark: "_eventMark_1qsom_74",
18
+ keyGhost: "_keyGhost_1qsom_94",
19
+ eventGhost: "_eventGhost_1qsom_94",
20
+ curve: "_curve_1qsom_109",
21
+ nestedBar: "_nestedBar_1qsom_123",
22
+ transport: "_transport_1qsom_132",
23
+ transportButton: "_transportButton_1qsom_141",
24
+ transportRow: "_transportRow_1qsom_167",
25
+ time: "_time_1qsom_182",
26
+ rate: "_rate_1qsom_183",
27
+ rateSlider: "_rateSlider_1qsom_184",
28
+ rateReadout: "_rateReadout_1qsom_188",
29
+ root: "_root_1qsom_194",
30
+ label: "_label_1qsom_209",
31
+ body: "_body_1qsom_211",
32
+ gutter: "_gutter_1qsom_212",
33
+ rulerWrap: "_rulerWrap_1qsom_213",
34
+ lanes: "_lanes_1qsom_215",
35
+ inspector: "_inspector_1qsom_222",
36
+ segment: "_segment_1qsom_231",
37
+ easingPicker: "_easingPicker_1qsom_241",
38
+ easingLabel: "_easingLabel_1qsom_242",
39
+ easingPreview: "_easingPreview_1qsom_244",
40
+ bezierHandle: "_bezierHandle_1qsom_253"
41
+ };
42
+ //#endregion
43
+ //#region src/components/Timeline/easingSpec.ts
44
+ function b(e) {
45
+ return typeof e == "object" && e && "bezier" in e ? e.bezier : null;
46
+ }
47
+ function x(e) {
48
+ return e === void 0 ? null : b(e);
49
+ }
50
+ function S(e) {
51
+ if (e === void 0) return "linear";
52
+ if (typeof e == "string") return e;
53
+ let t = b(e);
54
+ if (t) return `cubic-bezier(${t.join(", ")})`;
55
+ for (let [t, n] of Object.entries(s)) if (n === e) return t;
56
+ return "custom";
57
+ }
58
+ function C(e, t) {
59
+ let n = l(e), r = Array(t), i = t - 1;
60
+ for (let e = 0; e < t; e++) r[e] = n(i === 0 ? 0 : e / i);
61
+ return r;
62
+ }
63
+ var w = Object.keys(s), T = 24, E = {
64
+ linear: [
65
+ 0,
66
+ 0,
67
+ 1,
68
+ 1
69
+ ],
70
+ easeInQuad: [
71
+ .11,
72
+ 0,
73
+ .5,
74
+ 0
75
+ ],
76
+ easeOutQuad: [
77
+ .5,
78
+ 1,
79
+ .89,
80
+ 1
81
+ ],
82
+ easeInOutQuad: [
83
+ .45,
84
+ 0,
85
+ .55,
86
+ 1
87
+ ],
88
+ easeInCubic: [
89
+ .32,
90
+ 0,
91
+ .67,
92
+ 0
93
+ ],
94
+ easeOutCubic: [
95
+ .33,
96
+ 1,
97
+ .68,
98
+ 1
99
+ ],
100
+ easeInOutCubic: [
101
+ .65,
102
+ 0,
103
+ .35,
104
+ 1
105
+ ],
106
+ easeInSine: [
107
+ .12,
108
+ 0,
109
+ .39,
110
+ 0
111
+ ],
112
+ easeOutSine: [
113
+ .61,
114
+ 1,
115
+ .88,
116
+ 1
117
+ ],
118
+ easeInOutSine: [
119
+ .37,
120
+ 0,
121
+ .63,
122
+ 1
123
+ ]
124
+ }, D = [
125
+ .25,
126
+ .1,
127
+ .25,
128
+ 1
129
+ ];
130
+ function O(e) {
131
+ let { value: t, onChange: n } = e, r = x(t), i = S(t), s = r === null && w.includes(i), c = r === null ? s ? i : "linear" : "custom", l = C(t, T).map((e, t) => `${t / (T - 1) * 100},${100 - e * 100}`).join(" ");
132
+ return /* @__PURE__ */ o("div", {
133
+ className: y.easingPicker,
134
+ children: [
135
+ /* @__PURE__ */ o("label", { children: ["Easing", /* @__PURE__ */ o("select", {
136
+ value: c,
137
+ onChange: (e) => n(e.target.value === "linear" ? void 0 : e.target.value),
138
+ children: [
139
+ /* @__PURE__ */ a("option", {
140
+ value: "linear",
141
+ children: "linear"
142
+ }),
143
+ w.filter((e) => e !== "linear").map((e) => /* @__PURE__ */ a("option", {
144
+ value: e,
145
+ children: e
146
+ }, e)),
147
+ r === null ? null : /* @__PURE__ */ a("option", {
148
+ value: "custom",
149
+ children: "custom"
150
+ })
151
+ ]
152
+ })] }),
153
+ r === null ? /* @__PURE__ */ a("button", {
154
+ type: "button",
155
+ className: y.transportButton,
156
+ onClick: () => n({ bezier: E[c] ?? D }),
157
+ children: "Convert to bezier"
158
+ }) : /* @__PURE__ */ a("span", {
159
+ className: y.easingLabel,
160
+ children: i
161
+ }),
162
+ /* @__PURE__ */ a("svg", {
163
+ className: y.easingPreview,
164
+ "data-testid": "easing-preview",
165
+ viewBox: "0 0 100 100",
166
+ preserveAspectRatio: "none",
167
+ children: /* @__PURE__ */ a("polyline", {
168
+ points: l,
169
+ vectorEffect: "non-scaling-stroke"
170
+ })
171
+ })
172
+ ]
173
+ });
174
+ }
175
+ //#endregion
176
+ //#region src/components/Timeline/timeScale.ts
177
+ var k = 1;
178
+ function A(e, t) {
179
+ let n = e.to - e.from, r = n === 0 ? 0 : t / n, i = t === 0 ? 0 : n / t;
180
+ return {
181
+ window: e,
182
+ widthPx: t,
183
+ toPx: (t) => (t - e.from) * r,
184
+ toMs: (t) => e.from + t * i
185
+ };
186
+ }
187
+ function j(e, t) {
188
+ let n = e.to - e.from;
189
+ return n === 0 ? 0 : (t - e.from) / n;
190
+ }
191
+ function M(e, t) {
192
+ return `${j(e, t) * 100}%`;
193
+ }
194
+ function N(e, t) {
195
+ let n = e.to - e.from;
196
+ return n === 0 ? 0 : t / n;
197
+ }
198
+ function P(e, t) {
199
+ return `${N(e, t) * 100}%`;
200
+ }
201
+ function F(e, t) {
202
+ let n = Math.min(e.to - e.from, t.to - t.from), r = e.from;
203
+ return r < t.from && (r = t.from), r + n > t.to && (r = t.to - n), {
204
+ from: r,
205
+ to: r + n
206
+ };
207
+ }
208
+ function I(e, t, n, r) {
209
+ let i = e.to - e.from, a = r.to - r.from, o = Math.min(a, Math.max(k, i * n)), s = i === 0 ? .5 : (t - e.from) / i;
210
+ return F({
211
+ from: t - s * o,
212
+ to: t + (1 - s) * o
213
+ }, r);
214
+ }
215
+ function L(e, t, n) {
216
+ return F({
217
+ from: e.from + t,
218
+ to: e.to + t
219
+ }, n);
220
+ }
221
+ function R(e) {
222
+ let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
223
+ return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * t;
224
+ }
225
+ function z(e, t, n) {
226
+ let r = e.to - e.from;
227
+ if (t <= 0 || r <= 0) return [];
228
+ let i = R(n / t * r), a = [];
229
+ for (let t = Math.ceil(e.from / i) * i; t <= e.to + 1e-9; t += i) a.push(Math.round(t / i) * i);
230
+ return a;
231
+ }
232
+ //#endregion
233
+ //#region src/components/Timeline/lanes.ts
234
+ function B(e) {
235
+ if (e.kind !== "sampled") return !1;
236
+ let t = e.keys;
237
+ return t.length > 0 && t.every((e) => typeof e.value == "number");
238
+ }
239
+ function V(e, t) {
240
+ let n = [], r = (e, i, a, o) => {
241
+ e.forEach((e, s) => {
242
+ let c = [...i, s], l = c.join(".");
243
+ n.push({
244
+ key: l,
245
+ path: c,
246
+ track: e,
247
+ label: e.label ?? `${e.kind} ${s}`,
248
+ depth: a,
249
+ offset: o,
250
+ kind: e.kind,
251
+ numeric: B(e)
252
+ }), e.kind === "timeline" && t.has(l) && r(e.timeline.tracks, c, a + 1, o + e.at);
253
+ });
254
+ };
255
+ return r(e, [], 0, 0), n;
256
+ }
257
+ function H(e, t) {
258
+ let n = e, r;
259
+ for (let e of t) {
260
+ if (r = n[e], !r) return;
261
+ n = r.kind === "timeline" ? r.timeline.tracks : [];
262
+ }
263
+ return r;
264
+ }
265
+ //#endregion
266
+ //#region src/components/Timeline/keys.ts
267
+ function U(e, t) {
268
+ return e.length === t.length && e.every((e, n) => e === t[n]);
269
+ }
270
+ function W(e, t) {
271
+ return {
272
+ ...e,
273
+ keys: t
274
+ };
275
+ }
276
+ function ee(e, t) {
277
+ return {
278
+ ...e,
279
+ events: t
280
+ };
281
+ }
282
+ function G(e, t, n) {
283
+ let r = e.slice(), [i, ...a] = t;
284
+ if (a.length === 0) return r[i] = n, r;
285
+ let o = r[i];
286
+ if (o?.kind !== "timeline") return r;
287
+ let s = o;
288
+ return r[i] = {
289
+ ...s,
290
+ timeline: {
291
+ ...s.timeline,
292
+ tracks: G(s.timeline.tracks, a, n)
293
+ }
294
+ }, r;
295
+ }
296
+ function K(e, t, n) {
297
+ let r = H(e, t.trackPath), i = Math.max(0, n);
298
+ if (r?.kind === "sampled") {
299
+ let n = r, a = {
300
+ ...n.keys[t.keyIndex],
301
+ t: i
302
+ }, o = n.keys.filter((e, n) => n !== t.keyIndex), s = o.findIndex((e) => e.t > i), c = s === -1 ? o.length : s;
303
+ return o.splice(c, 0, a), {
304
+ tracks: G(e, t.trackPath, W(r, o)),
305
+ selection: {
306
+ trackPath: t.trackPath,
307
+ keyIndex: c
308
+ }
309
+ };
310
+ }
311
+ if (r?.kind === "event") {
312
+ let n = r, a = {
313
+ ...n.events[t.keyIndex],
314
+ t: i
315
+ }, o = n.events.filter((e, n) => n !== t.keyIndex), s = o.findIndex((e) => e.t > i), c = s === -1 ? o.length : s;
316
+ return o.splice(c, 0, a), {
317
+ tracks: G(e, t.trackPath, ee(r, o)),
318
+ selection: {
319
+ trackPath: t.trackPath,
320
+ keyIndex: c
321
+ }
322
+ };
323
+ }
324
+ return {
325
+ tracks: e.slice(),
326
+ selection: t
327
+ };
328
+ }
329
+ function q(e, t, n) {
330
+ let r = H(e, t);
331
+ if (r?.kind !== "sampled") return {
332
+ tracks: e.slice(),
333
+ selection: null
334
+ };
335
+ let i = r, a = Math.max(0, n), o = i.keys.length === 0 ? 0 : u(i, a), s = i.keys.slice(), c = s.findIndex((e) => e.t > a), l = c === -1 ? s.length : c;
336
+ return s.splice(l, 0, {
337
+ t: a,
338
+ value: o
339
+ }), {
340
+ tracks: G(e, t, W(r, s)),
341
+ selection: {
342
+ trackPath: t,
343
+ keyIndex: l
344
+ }
345
+ };
346
+ }
347
+ function J(e, t) {
348
+ let n = H(e, t.trackPath);
349
+ if (n?.kind !== "sampled") return {
350
+ tracks: e.slice(),
351
+ selection: t
352
+ };
353
+ let r = n.keys.filter((e, n) => n !== t.keyIndex);
354
+ return {
355
+ tracks: G(e, t.trackPath, W(n, r)),
356
+ selection: r.length === 0 ? null : {
357
+ trackPath: t.trackPath,
358
+ keyIndex: Math.max(0, t.keyIndex - 1)
359
+ }
360
+ };
361
+ }
362
+ function Y(e, t, n) {
363
+ let r = H(e, t.trackPath);
364
+ if (r?.kind !== "sampled") return e.slice();
365
+ let i = r.keys.slice(), { easing: a, ...o } = i[t.keyIndex];
366
+ return i[t.keyIndex] = n === void 0 ? o : {
367
+ ...o,
368
+ easing: n
369
+ }, G(e, t.trackPath, W(r, i));
370
+ }
371
+ function X(e, t, n) {
372
+ let r = H(e, t.trackPath);
373
+ if (r?.kind !== "sampled") return e.slice();
374
+ let i = r.keys.slice();
375
+ return i[t.keyIndex] = {
376
+ ...i[t.keyIndex],
377
+ value: n
378
+ }, G(e, t.trackPath, W(r, i));
379
+ }
380
+ function te(e, t, n) {
381
+ let r = e, i = n;
382
+ for (let n of t) {
383
+ let t = Math.abs(n - e);
384
+ t <= i && (r = n, i = t);
385
+ }
386
+ return r;
387
+ }
388
+ //#endregion
389
+ //#region src/components/Timeline/Lane.tsx
390
+ var Z = 8, ne = 6, re = 10, ie = 16;
391
+ function ae(e, t) {
392
+ let n = c(...e), r = Array(t), i = t - 1;
393
+ for (let e = 0; e < t; e++) r[e] = n(i === 0 ? 0 : e / i);
394
+ return r;
395
+ }
396
+ function oe(e) {
397
+ return e.kind === "sampled" ? e.track.keys.map((e) => e.t) : e.kind === "event" ? e.track.events.map((e) => e.t) : [];
398
+ }
399
+ function Q(e) {
400
+ let { row: t, window: r, mode: s, selection: c, onSelect: l, onKeyInput: u, onKeyCommit: d, onInsert: f, onToggleExpand: m, expanded: h, snapTimes: g, selectedSegment: b = null, onSelectSegment: S, onEasingCommit: w } = e, T = _(null), E = _(null);
401
+ p(() => () => {
402
+ E.current?.();
403
+ }, []);
404
+ let [D, O] = v(null), [k, N] = v(null), F = (e) => M(r, e + t.offset), I = (e) => {
405
+ let n = T.current?.getBoundingClientRect();
406
+ return n ? A(r, n.width).toMs(e - n.left) - t.offset : r.from;
407
+ }, L = () => {
408
+ let e = A(r, T.current?.getBoundingClientRect().width ?? 0);
409
+ return e.toMs(ne) - e.toMs(0);
410
+ }, R = s === "graph" && t.numeric, z = t.kind === "sampled" ? t.track.keys : [], B = z.map((e) => e.value), V = R ? Math.min(...B) : 0, H = (R ? Math.max(...B) : 1) - V || 1, U = (e) => Z + (e - V) / H * (100 - 2 * Z), W = (e) => {
411
+ let t = T.current?.getBoundingClientRect();
412
+ if (!t || t.height === 0) return V;
413
+ let n = ((1 - (e - t.top) / t.height) * 100 - Z) / (100 - 2 * Z);
414
+ return V + Math.min(1, Math.max(0, n)) * H;
415
+ }, ee = () => {
416
+ let e = [];
417
+ for (let n = 1; n < z.length; n++) {
418
+ let i = z[n - 1], a = z[n], o = D && D.keyIndex === n ? ae(D.points, ie) : C(a.easing, ie);
419
+ for (let n = 0; n < o.length; n++) {
420
+ let s = i.t + (a.t - i.t) * n / (o.length - 1), c = i.value + (a.value - i.value) * o[n];
421
+ e.push(`${j(r, s + t.offset) * 100},${100 - U(c)}`);
422
+ }
423
+ }
424
+ return e.join(" ");
425
+ }, G = b != null && t.kind === "sampled" ? x(z[b]?.easing) : null, K = D && D.keyIndex === b ? D.points : G, q = (e, t, n) => {
426
+ let r = z[e - 1], i = z[e], a = r.t + t * (i.t - r.t), o = r.value + n * (i.value - r.value);
427
+ return {
428
+ left: F(a),
429
+ bottom: `${U(o)}%`
430
+ };
431
+ }, J = (e, t) => (n) => {
432
+ if (n.button !== 0 || !G) return;
433
+ n.stopPropagation();
434
+ let r = z[e - 1], i = z[e], a = [...G], o = (e) => {
435
+ let n = I(e.clientX), o = i.t === r.t ? 0 : Math.min(1, Math.max(0, (n - r.t) / (i.t - r.t))), s = W(e.clientY), c = i.value === r.value ? 0 : (s - r.value) / (i.value - r.value), l = [...a];
436
+ return l[t * 2] = o, l[t * 2 + 1] = c, l;
437
+ }, s = (t) => {
438
+ a = o(t), O({
439
+ keyIndex: e,
440
+ points: a
441
+ });
442
+ }, c = (t) => {
443
+ a = o(t), w?.(e, { bezier: a }), l();
444
+ }, l = () => {
445
+ O(null), document.removeEventListener("pointermove", s), document.removeEventListener("pointerup", c), document.removeEventListener("pointercancel", l), E.current = null;
446
+ };
447
+ document.addEventListener("pointermove", s), document.addEventListener("pointerup", c), document.addEventListener("pointercancel", l), E.current = l;
448
+ }, Y = (e) => (n) => {
449
+ if (n.button !== 0) return;
450
+ n.stopPropagation(), l(e);
451
+ let r = (e) => {
452
+ let n = Math.max(0, I(e.clientX));
453
+ return e.altKey ? n : te(n + t.offset, g, L()) - t.offset;
454
+ }, i = (e) => R ? W(e.clientY) : void 0;
455
+ N({
456
+ keyIndex: e,
457
+ t: Q[e],
458
+ value: B[e]
459
+ });
460
+ let a = (t) => {
461
+ let n = i(t);
462
+ N({
463
+ keyIndex: e,
464
+ t: r(t),
465
+ value: n ?? B[e]
466
+ }), n === void 0 ? u(e, r(t)) : u(e, r(t), n);
467
+ }, o = (t) => {
468
+ let n = i(t);
469
+ n === void 0 ? d(e, r(t)) : d(e, r(t), n), s();
470
+ }, s = () => {
471
+ N(null), document.removeEventListener("pointermove", a), document.removeEventListener("pointerup", o), document.removeEventListener("pointercancel", s), E.current = null;
472
+ };
473
+ document.addEventListener("pointermove", a), document.addEventListener("pointerup", o), document.addEventListener("pointercancel", s), E.current = s;
474
+ }, X = (e, t) => (n) => {
475
+ let r = re * (n.shiftKey ? 10 : 1);
476
+ n.key === "ArrowRight" && (n.preventDefault(), d(e, t + r)), n.key === "ArrowLeft" && (n.preventDefault(), d(e, Math.max(0, t - r)));
477
+ }, Q = oe(t);
478
+ return /* @__PURE__ */ o("div", {
479
+ className: y.lane,
480
+ "data-depth": t.depth,
481
+ "data-mode": s,
482
+ children: [/* @__PURE__ */ o("div", {
483
+ className: y.laneLabel,
484
+ children: [t.kind === "timeline" ? /* @__PURE__ */ a("span", {
485
+ role: "button",
486
+ tabIndex: 0,
487
+ "aria-expanded": h,
488
+ "data-testid": "timeline-disclosure",
489
+ className: y.disclosure,
490
+ onClick: m,
491
+ onKeyDown: (e) => {
492
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m());
493
+ },
494
+ children: /* @__PURE__ */ a(n, {
495
+ size: 14,
496
+ className: [y.disclosureIcon, !h && y.disclosureCollapsed].filter(Boolean).join(" ")
497
+ })
498
+ }) : null, t.label]
499
+ }), /* @__PURE__ */ o("div", {
500
+ className: y.laneTrack,
501
+ ref: T,
502
+ "data-testid": "timeline-lane-track",
503
+ onDoubleClick: (e) => {
504
+ t.kind === "sampled" && f(Math.max(0, I(e.clientX)));
505
+ },
506
+ children: [
507
+ t.kind === "timeline" ? /* @__PURE__ */ a("div", {
508
+ className: y.nestedBar,
509
+ "data-testid": "timeline-nested",
510
+ style: {
511
+ left: F(0),
512
+ width: P(r, t.track.timeline.duration ?? 0)
513
+ }
514
+ }) : null,
515
+ t.kind === "sampled" ? z.slice(1).map((e, n) => {
516
+ let i = n + 1;
517
+ return /* @__PURE__ */ a("div", {
518
+ role: "button",
519
+ tabIndex: 0,
520
+ "aria-label": `${t.label} segment into ${Math.round(e.t)} ms`,
521
+ "aria-current": b === i ? "true" : void 0,
522
+ "data-testid": "timeline-segment",
523
+ className: y.segment,
524
+ style: {
525
+ left: F(z[i - 1].t),
526
+ width: P(r, e.t - z[i - 1].t)
527
+ },
528
+ onClick: () => S?.(i),
529
+ onKeyDown: (e) => {
530
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), S?.(i));
531
+ }
532
+ }, `seg-${i}`);
533
+ }) : null,
534
+ R && z.length > 1 ? /* @__PURE__ */ a("svg", {
535
+ className: y.curve,
536
+ "data-testid": "timeline-curve",
537
+ viewBox: "0 0 100 100",
538
+ preserveAspectRatio: "none",
539
+ children: /* @__PURE__ */ a("polyline", {
540
+ points: ee(),
541
+ vectorEffect: "non-scaling-stroke"
542
+ })
543
+ }) : null,
544
+ Q.map((e, n) => /* @__PURE__ */ a("div", {
545
+ role: "button",
546
+ tabIndex: 0,
547
+ "aria-label": `${t.label} key at ${Math.round(e)} ms`,
548
+ "aria-current": c === n ? "true" : void 0,
549
+ "data-testid": t.kind === "event" ? "timeline-event" : "timeline-key",
550
+ "data-dragging": k?.keyIndex === n ? "true" : void 0,
551
+ className: t.kind === "event" ? y.eventMark : y.key,
552
+ style: R ? {
553
+ left: F(e),
554
+ bottom: `${U(B[n])}%`
555
+ } : { left: F(e) },
556
+ onPointerDown: Y(n),
557
+ onKeyDown: X(n, e)
558
+ }, n)),
559
+ k ? /* @__PURE__ */ a("div", {
560
+ "aria-hidden": "true",
561
+ "data-testid": "timeline-key-ghost",
562
+ className: t.kind === "event" ? y.eventGhost : y.keyGhost,
563
+ style: R && k.value !== void 0 ? {
564
+ left: F(k.t),
565
+ bottom: `${U(k.value)}%`
566
+ } : { left: F(k.t) }
567
+ }) : null,
568
+ R && K && b != null ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("div", {
569
+ role: "button",
570
+ tabIndex: 0,
571
+ "aria-label": `${t.label} bezier handle 1`,
572
+ "data-testid": "timeline-bezier-handle",
573
+ className: y.bezierHandle,
574
+ style: q(b, K[0], K[1]),
575
+ onPointerDown: J(b, 0)
576
+ }), /* @__PURE__ */ a("div", {
577
+ role: "button",
578
+ tabIndex: 0,
579
+ "aria-label": `${t.label} bezier handle 2`,
580
+ "data-testid": "timeline-bezier-handle",
581
+ className: y.bezierHandle,
582
+ style: q(b, K[2], K[3]),
583
+ onPointerDown: J(b, 1)
584
+ })] }) : null
585
+ ]
586
+ })]
587
+ });
588
+ }
589
+ //#endregion
590
+ //#region src/components/Timeline/Ruler.tsx
591
+ var se = 64, ce = .0015;
592
+ function le(e) {
593
+ return e >= 1e3 ? `${(e / 1e3).toFixed(e % 1e3 == 0 ? 0 : 2)}s` : `${Math.round(e)}ms`;
594
+ }
595
+ function ue(e) {
596
+ let { window: t, bounds: n, playhead: r, onScrub: i, onWindowChange: s } = e, c = _(null), l = _(null);
597
+ p(() => () => {
598
+ l.current?.();
599
+ }, []);
600
+ let [u, d] = v(0);
601
+ m(() => {
602
+ let e = c.current;
603
+ if (!e) return;
604
+ let t = () => d(e.getBoundingClientRect().width);
605
+ if (t(), typeof ResizeObserver > "u") return;
606
+ let n = new ResizeObserver(t);
607
+ return n.observe(e), () => n.disconnect();
608
+ }, []);
609
+ let f = () => c.current?.getBoundingClientRect().width ?? 0, h = (e) => {
610
+ let n = c.current?.getBoundingClientRect();
611
+ if (!n) return t.from;
612
+ let r = A(t, n.width).toMs(e - n.left);
613
+ return Math.min(t.to, Math.max(t.from, r));
614
+ }, g = (e) => {
615
+ if (e.button !== 0) return;
616
+ i(h(e.clientX));
617
+ let t = (e) => {
618
+ i(h(e.clientX));
619
+ }, n = () => {
620
+ document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", n), document.removeEventListener("pointercancel", n), l.current = null;
621
+ };
622
+ document.addEventListener("pointermove", t), document.addEventListener("pointerup", n), document.addEventListener("pointercancel", n), l.current = n;
623
+ }, b = (e) => {
624
+ if (e.ctrlKey) s(I(t, h(e.clientX), Math.exp(e.deltaY * ce), n));
625
+ else {
626
+ let r = f(), i = r === 0 ? 0 : (t.to - t.from) / r;
627
+ s(L(t, e.deltaY * i, n));
628
+ }
629
+ }, x = z(t, u, se), S = (e) => M(t, e);
630
+ return /* @__PURE__ */ o("div", {
631
+ className: y.ruler,
632
+ ref: c,
633
+ "data-testid": "timeline-ruler",
634
+ onPointerDown: g,
635
+ onWheel: b,
636
+ children: [x.map((e) => /* @__PURE__ */ a("span", {
637
+ className: y.tick,
638
+ "data-testid": "timeline-tick",
639
+ style: { left: S(e) },
640
+ children: le(e)
641
+ }, e)), /* @__PURE__ */ a("div", {
642
+ className: y.playhead,
643
+ "data-testid": "timeline-playhead",
644
+ style: { left: S(r) }
645
+ })]
646
+ });
647
+ }
648
+ //#endregion
649
+ //#region src/components/Timeline/Transport.tsx
650
+ var $ = [
651
+ .25,
652
+ .5,
653
+ 1,
654
+ 2,
655
+ 4
656
+ ], de = (e) => `${(e / 1e3).toFixed(2)}s`;
657
+ function fe(n) {
658
+ let { paused: i, loop: s, rate: c, playhead: l, duration: u, onPlay: d, onPause: f, onLoopChange: p, onRateChange: m } = n, h = s !== !1 && s !== 0, g = $.includes(c) ? $ : [...$, c].sort((e, t) => e - t);
659
+ return /* @__PURE__ */ o("div", {
660
+ className: y.transport,
661
+ children: [
662
+ /* @__PURE__ */ a("button", {
663
+ type: "button",
664
+ className: y.transportButton,
665
+ "aria-label": i ? "Play" : "Pause",
666
+ onClick: i ? d : f,
667
+ children: a(i ? e : t, { size: 14 })
668
+ }),
669
+ /* @__PURE__ */ o("span", {
670
+ className: y.time,
671
+ "data-testid": "timeline-time",
672
+ children: [
673
+ de(l),
674
+ " / ",
675
+ de(u)
676
+ ]
677
+ }),
678
+ /* @__PURE__ */ a("button", {
679
+ type: "button",
680
+ role: "switch",
681
+ "aria-checked": h,
682
+ "aria-label": "Loop",
683
+ className: y.transportButton,
684
+ onClick: () => p(!h),
685
+ children: "⟲"
686
+ }),
687
+ /* @__PURE__ */ o("div", {
688
+ className: y.rate,
689
+ children: [
690
+ "Rate",
691
+ /* @__PURE__ */ a(r, {
692
+ ariaLabel: "Rate",
693
+ items: g,
694
+ value: c,
695
+ onChange: m,
696
+ formatLabel: (e) => `${e}x`,
697
+ labels: "none",
698
+ className: y.rateSlider
699
+ }),
700
+ /* @__PURE__ */ o("span", {
701
+ className: y.rateReadout,
702
+ children: [c, "x"]
703
+ })
704
+ ]
705
+ })
706
+ ]
707
+ });
708
+ }
709
+ //#endregion
710
+ //#region src/components/Timeline/Timeline.tsx
711
+ function pe(e) {
712
+ let { tracks: t, duration: n, playhead: r, onInput: i, onChange: s, onScrub: c, renderKeyEditor: l, label: u, className: d } = e, [f, p] = v(() => /* @__PURE__ */ new Set()), [m, g] = v({
713
+ from: 0,
714
+ to: n
715
+ }), [_, b] = v(null), [x, S] = v(null), C = e.window ?? m, w = e.onWindowChange ?? g, T = e.selection === void 0 ? _ : e.selection, E = e.onSelect ?? b, D = {
716
+ from: 0,
717
+ to: n
718
+ }, k = h(() => V(t, f), [t, f]), A = h(() => {
719
+ let e = new Set([0, n]);
720
+ for (let t of k) if (t.kind === "sampled") for (let n of t.track.keys) e.add(n.t + t.offset);
721
+ return [...e];
722
+ }, [k, n]), j = (e) => {
723
+ p((t) => {
724
+ let n = new Set(t);
725
+ return n.has(e) ? n.delete(e) : n.add(e), n;
726
+ });
727
+ }, M = (e) => {
728
+ if ((e.key === "Delete" || e.key === "Backspace") && T) {
729
+ e.preventDefault();
730
+ let n = J(t, T);
731
+ s(n.tracks), E(n.selection);
732
+ }
733
+ }, N = T ? H(t, T.trackPath) : void 0, P = N?.kind === "sampled" ? N.keys[T.keyIndex] : void 0, F = x ? H(t, x.trackPath) : void 0, I = F?.kind === "sampled" ? F.keys[x.keyIndex] : void 0;
734
+ return /* @__PURE__ */ o("div", {
735
+ className: [y.root, d].filter(Boolean).join(" "),
736
+ "data-testid": "timeline-root",
737
+ tabIndex: -1,
738
+ onKeyDown: M,
739
+ children: [
740
+ u ? /* @__PURE__ */ a("div", {
741
+ className: y.label,
742
+ children: u
743
+ }) : null,
744
+ e.transport === !1 ? null : /* @__PURE__ */ o("div", {
745
+ className: y.transportRow,
746
+ children: [/* @__PURE__ */ a(fe, {
747
+ ...e.transport ?? {
748
+ paused: !0,
749
+ loop: !1,
750
+ rate: 1,
751
+ onPlay: () => {},
752
+ onPause: () => {},
753
+ onLoopChange: () => {},
754
+ onRateChange: () => {}
755
+ },
756
+ playhead: r,
757
+ duration: n
758
+ }), /* @__PURE__ */ a("button", {
759
+ type: "button",
760
+ role: "switch",
761
+ "aria-checked": (e.mode ?? "dope") === "graph",
762
+ "aria-label": "Graph mode",
763
+ className: y.transportButton,
764
+ onClick: () => e.onModeChange?.((e.mode ?? "dope") === "graph" ? "dope" : "graph"),
765
+ children: "Graph"
766
+ })]
767
+ }),
768
+ /* @__PURE__ */ o("div", {
769
+ className: y.body,
770
+ children: [/* @__PURE__ */ a("div", { className: y.gutter }), /* @__PURE__ */ a("div", {
771
+ className: y.rulerWrap,
772
+ children: /* @__PURE__ */ a(ue, {
773
+ window: C,
774
+ bounds: D,
775
+ playhead: r,
776
+ onScrub: c,
777
+ onWindowChange: w
778
+ })
779
+ })]
780
+ }),
781
+ /* @__PURE__ */ a("div", {
782
+ className: y.lanes,
783
+ children: k.map((n) => {
784
+ let r = n.path;
785
+ return /* @__PURE__ */ a(Q, {
786
+ row: n,
787
+ window: C,
788
+ mode: e.mode ?? "dope",
789
+ selection: T && U(T.trackPath, r) ? T.keyIndex : null,
790
+ expanded: f.has(n.key),
791
+ snapTimes: A,
792
+ onToggleExpand: () => j(n.key),
793
+ onSelect: (e) => E({
794
+ trackPath: r,
795
+ keyIndex: e
796
+ }),
797
+ onKeyInput: (e, n, a) => {
798
+ if (!i) return;
799
+ let o = K(t, {
800
+ trackPath: r,
801
+ keyIndex: e
802
+ }, n);
803
+ i(a === void 0 ? o.tracks : X(o.tracks, o.selection, a));
804
+ },
805
+ onKeyCommit: (e, n, i) => {
806
+ let a = K(t, {
807
+ trackPath: r,
808
+ keyIndex: e
809
+ }, n);
810
+ s(i === void 0 ? a.tracks : X(a.tracks, a.selection, i)), E(a.selection);
811
+ },
812
+ onInsert: (e) => {
813
+ let n = q(t, r, e);
814
+ s(n.tracks), E(n.selection);
815
+ },
816
+ selectedSegment: x && U(x.trackPath, r) ? x.keyIndex : null,
817
+ onSelectSegment: (e) => S({
818
+ trackPath: r,
819
+ keyIndex: e
820
+ }),
821
+ onEasingCommit: (e, n) => {
822
+ s(Y(t, {
823
+ trackPath: r,
824
+ keyIndex: e
825
+ }, n));
826
+ }
827
+ }, n.key);
828
+ })
829
+ }),
830
+ l && T && P && N?.kind === "sampled" ? /* @__PURE__ */ a("div", {
831
+ className: y.inspector,
832
+ children: l({
833
+ key: P,
834
+ track: N,
835
+ selection: T,
836
+ commit: (e) => s(X(t, T, e.value)),
837
+ setEasing: (e) => s(Y(t, T, e))
838
+ })
839
+ }) : null,
840
+ x && I ? /* @__PURE__ */ a("div", {
841
+ className: y.inspector,
842
+ children: /* @__PURE__ */ a(O, {
843
+ value: I.easing,
844
+ onChange: (e) => s(Y(t, x, e))
845
+ })
846
+ }) : null
847
+ ]
848
+ });
849
+ }
850
+ //#endregion
851
+ //#region src/components/Timeline/AnimatedTimeline.tsx
852
+ function me(e) {
853
+ let { handle: t, ...n } = e, [, r] = g((e) => e + 1, 0);
854
+ p(() => t.subscribe(r), [t]);
855
+ let i = _(null), o = d(() => {
856
+ r(), t.isPaused() || i.current?.request();
857
+ });
858
+ i.current = o, p(() => (t.isPaused() || o.request(), () => o.cancel()), [t, o]);
859
+ let s = f((e) => {
860
+ t.edit(() => {
861
+ let n = t.tracks();
862
+ n.splice(0, n.length, ...e);
863
+ });
864
+ }, [t]), c = t.time(), l = t.duration();
865
+ return /* @__PURE__ */ a(pe, {
866
+ ...n,
867
+ tracks: t.tracks(),
868
+ duration: l,
869
+ playhead: c,
870
+ onChange: s,
871
+ onScrub: t.seek,
872
+ transport: e.transport === !1 ? !1 : {
873
+ paused: t.isPaused(),
874
+ loop: t.loop(),
875
+ rate: t.timeScale(),
876
+ onPlay: () => {
877
+ t.time() >= l && t.seek(0), t.resume(), o.request(), r();
878
+ },
879
+ onPause: () => {
880
+ t.pause(), r();
881
+ },
882
+ onLoopChange: (e) => {
883
+ t.setLoop(e), r();
884
+ },
885
+ onRateChange: (e) => {
886
+ t.setTimeScale(e), r();
887
+ }
888
+ }
889
+ });
890
+ }
891
+ //#endregion
892
+ export { O as a, S as c, U as i, C as l, pe as n, w as o, fe as r, x as s, me as t };
893
+
894
+ //# sourceMappingURL=Timeline-DsLeV5I1.js.map