@stevederico/skateboard-ui 3.0.2 → 3.6.0

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 (175) hide show
  1. package/App.jsx +13 -13
  2. package/CHANGELOG.md +64 -0
  3. package/README.md +59 -65
  4. package/components/AuthOverlay.jsx +4 -4
  5. package/components/ProtectedRoute.jsx +1 -1
  6. package/components/ThemeToggle.jsx +1 -1
  7. package/components/UpgradeSheet.jsx +2 -2
  8. package/{core → components/core}/DynamicIcon.jsx +1 -1
  9. package/{layout → components/layout}/Header.jsx +4 -4
  10. package/{layout → components/layout}/Layout.jsx +1 -1
  11. package/{layout → components/layout}/Sidebar.jsx +2 -2
  12. package/{layout → components/layout}/TabBar.jsx +1 -1
  13. package/{views → components/views}/LandingView.jsx +5 -5
  14. package/{views → components/views}/NotFound.jsx +2 -2
  15. package/{views → components/views}/PaymentView.jsx +1 -1
  16. package/{views → components/views}/SettingsView.jsx +6 -6
  17. package/{views → components/views}/SignInView.jsx +6 -6
  18. package/{views → components/views}/SignOutView.jsx +1 -1
  19. package/{views → components/views}/SignUpView.jsx +6 -6
  20. package/{views → components/views}/TextView.jsx +3 -3
  21. package/hooks/useAuthGate.js +1 -1
  22. package/index.js +1 -1
  23. package/package.json +32 -50
  24. package/shadcn/lib/base-ui/LICENSE +21 -0
  25. package/shadcn/lib/base-ui/_chunk-01rqe37g.js +70 -0
  26. package/shadcn/lib/base-ui/_chunk-0h5sskyw.js +347 -0
  27. package/shadcn/lib/base-ui/_chunk-0xhx4g7r.js +57 -0
  28. package/shadcn/lib/base-ui/_chunk-1e6khrvm.js +218 -0
  29. package/shadcn/lib/base-ui/_chunk-1s41sngz.js +302 -0
  30. package/shadcn/lib/base-ui/_chunk-20rtfsz9.js +23 -0
  31. package/shadcn/lib/base-ui/_chunk-2tyt8f8r.js +6034 -0
  32. package/shadcn/lib/base-ui/_chunk-3f31ka8n.js +11 -0
  33. package/shadcn/lib/base-ui/_chunk-3h6zpchb.js +89 -0
  34. package/shadcn/lib/base-ui/_chunk-4s0k3h7t.js +114 -0
  35. package/shadcn/lib/base-ui/_chunk-502wngfc.js +598 -0
  36. package/shadcn/lib/base-ui/_chunk-536jvgeq.js +68 -0
  37. package/shadcn/lib/base-ui/_chunk-611pz5sm.js +10 -0
  38. package/shadcn/lib/base-ui/_chunk-65zw5gs2.js +15 -0
  39. package/shadcn/lib/base-ui/_chunk-6b17g8t7.js +34 -0
  40. package/shadcn/lib/base-ui/_chunk-6xevjepc.js +15 -0
  41. package/shadcn/lib/base-ui/_chunk-71zm6zgv.js +16 -0
  42. package/shadcn/lib/base-ui/_chunk-7fmjymvh.js +32 -0
  43. package/shadcn/lib/base-ui/_chunk-7jjzay8b.js +176 -0
  44. package/shadcn/lib/base-ui/_chunk-7v1t86x1.js +43 -0
  45. package/shadcn/lib/base-ui/_chunk-85vrgzwr.js +227 -0
  46. package/shadcn/lib/base-ui/_chunk-8jz3hb7q.js +9 -0
  47. package/shadcn/lib/base-ui/_chunk-8kh3xk78.js +35 -0
  48. package/shadcn/lib/base-ui/_chunk-97tas84n.js +67 -0
  49. package/shadcn/lib/base-ui/_chunk-9nyxkvte.js +13 -0
  50. package/shadcn/lib/base-ui/_chunk-a8fwg9d0.js +52 -0
  51. package/shadcn/lib/base-ui/_chunk-agc6ew3g.js +29 -0
  52. package/shadcn/lib/base-ui/_chunk-aqwsk46c.js +64 -0
  53. package/shadcn/lib/base-ui/_chunk-atd5kq5q.js +803 -0
  54. package/shadcn/lib/base-ui/_chunk-atnkefgd.js +104 -0
  55. package/shadcn/lib/base-ui/_chunk-b40erthe.js +7 -0
  56. package/shadcn/lib/base-ui/_chunk-b5jsqt97.js +50 -0
  57. package/shadcn/lib/base-ui/_chunk-bk7n9s9e.js +15 -0
  58. package/shadcn/lib/base-ui/_chunk-c3572b5x.js +19 -0
  59. package/shadcn/lib/base-ui/_chunk-cwr896nf.js +25 -0
  60. package/shadcn/lib/base-ui/_chunk-drfb9kp2.js +27 -0
  61. package/shadcn/lib/base-ui/_chunk-ds8fnpjj.js +0 -0
  62. package/shadcn/lib/base-ui/_chunk-ek863ta9.js +82 -0
  63. package/shadcn/lib/base-ui/_chunk-f09cp81f.js +12 -0
  64. package/shadcn/lib/base-ui/_chunk-f5d01bp9.js +0 -0
  65. package/shadcn/lib/base-ui/_chunk-f9tgee1q.js +21 -0
  66. package/shadcn/lib/base-ui/_chunk-fch5cba8.js +84 -0
  67. package/shadcn/lib/base-ui/_chunk-gfce3j3z.js +18 -0
  68. package/shadcn/lib/base-ui/_chunk-ha06w2pp.js +2391 -0
  69. package/shadcn/lib/base-ui/_chunk-hzgetm70.js +23 -0
  70. package/shadcn/lib/base-ui/_chunk-j0eqdjta.js +39 -0
  71. package/shadcn/lib/base-ui/_chunk-k1e5fvcj.js +48 -0
  72. package/shadcn/lib/base-ui/_chunk-k4mc2kan.js +81 -0
  73. package/shadcn/lib/base-ui/_chunk-kfz96xv1.js +128 -0
  74. package/shadcn/lib/base-ui/_chunk-m45547cc.js +15 -0
  75. package/shadcn/lib/base-ui/_chunk-mbn76q14.js +184 -0
  76. package/shadcn/lib/base-ui/_chunk-mvv30fkv.js +9 -0
  77. package/shadcn/lib/base-ui/_chunk-mznt6ktj.js +33 -0
  78. package/shadcn/lib/base-ui/_chunk-n7dnqnbw.js +7 -0
  79. package/shadcn/lib/base-ui/_chunk-nya71ccw.js +546 -0
  80. package/shadcn/lib/base-ui/_chunk-p6qynd6r.js +146 -0
  81. package/shadcn/lib/base-ui/_chunk-q3nee19r.js +323 -0
  82. package/shadcn/lib/base-ui/_chunk-q7yw9mz4.js +385 -0
  83. package/shadcn/lib/base-ui/_chunk-qce0xt57.js +107 -0
  84. package/shadcn/lib/base-ui/_chunk-qgzhcjsj.js +14 -0
  85. package/shadcn/lib/base-ui/_chunk-qt6r015s.js +38 -0
  86. package/shadcn/lib/base-ui/_chunk-r0vsdknk.js +4 -0
  87. package/shadcn/lib/base-ui/_chunk-sx6vkz01.js +150 -0
  88. package/shadcn/lib/base-ui/_chunk-szcr6mhk.js +6 -0
  89. package/shadcn/lib/base-ui/_chunk-t7j3rbpv.js +67 -0
  90. package/shadcn/lib/base-ui/_chunk-tmfmrzwe.js +39 -0
  91. package/shadcn/lib/base-ui/_chunk-v92ycsfj.js +9 -0
  92. package/shadcn/lib/base-ui/_chunk-vdc01ss3.js +6 -0
  93. package/shadcn/lib/base-ui/_chunk-vjbnhhg1.js +26 -0
  94. package/shadcn/lib/base-ui/_chunk-w68yxg9d.js +21 -0
  95. package/shadcn/lib/base-ui/_chunk-wana68v3.js +477 -0
  96. package/shadcn/lib/base-ui/_chunk-wtw745qd.js +12 -0
  97. package/shadcn/lib/base-ui/_chunk-xb7ph1ka.js +6 -0
  98. package/shadcn/lib/base-ui/_chunk-xfagb0fq.js +28 -0
  99. package/shadcn/lib/base-ui/_chunk-xxhqanfd.js +16 -0
  100. package/shadcn/lib/base-ui/_chunk-y887e46p.js +15 -0
  101. package/shadcn/lib/base-ui/_chunk-ymj1dpqg.js +14 -0
  102. package/shadcn/lib/base-ui/accordion.js +650 -0
  103. package/shadcn/lib/base-ui/alert-dialog.js +138 -0
  104. package/shadcn/lib/base-ui/avatar.js +235 -0
  105. package/shadcn/lib/base-ui/button.js +52 -0
  106. package/shadcn/lib/base-ui/checkbox.js +454 -0
  107. package/shadcn/lib/base-ui/collapsible.js +283 -0
  108. package/shadcn/lib/base-ui/context-menu.js +324 -0
  109. package/shadcn/lib/base-ui/dialog.js +71 -0
  110. package/shadcn/lib/base-ui/input.js +1028 -0
  111. package/shadcn/lib/base-ui/menu.js +61 -0
  112. package/shadcn/lib/base-ui/menubar.js +157 -0
  113. package/shadcn/lib/base-ui/merge-props.js +15 -0
  114. package/shadcn/lib/base-ui/navigation-menu.js +1854 -0
  115. package/shadcn/lib/base-ui/popover.js +1090 -0
  116. package/shadcn/lib/base-ui/preview-card.js +709 -0
  117. package/shadcn/lib/base-ui/progress.js +278 -0
  118. package/shadcn/lib/base-ui/radio-group.js +247 -0
  119. package/shadcn/lib/base-ui/radio.js +382 -0
  120. package/shadcn/lib/base-ui/scroll-area.js +1061 -0
  121. package/shadcn/lib/base-ui/select.js +2438 -0
  122. package/shadcn/lib/base-ui/separator.js +11 -0
  123. package/shadcn/lib/base-ui/slider.js +1595 -0
  124. package/shadcn/lib/base-ui/switch.js +333 -0
  125. package/shadcn/lib/base-ui/tabs.js +892 -0
  126. package/shadcn/lib/base-ui/toggle-group.js +152 -0
  127. package/shadcn/lib/base-ui/toggle.js +133 -0
  128. package/shadcn/lib/base-ui/tooltip.js +791 -0
  129. package/shadcn/lib/base-ui/use-render.js +15 -0
  130. package/shadcn/lib/tailwind-merge.js +3312 -0
  131. package/shadcn/lib/utils.js +1 -1
  132. package/shadcn/ui/accordion.jsx +1 -1
  133. package/shadcn/ui/alert-dialog.jsx +1 -1
  134. package/shadcn/ui/avatar.jsx +1 -1
  135. package/shadcn/ui/badge.jsx +2 -2
  136. package/shadcn/ui/breadcrumb.jsx +2 -2
  137. package/shadcn/ui/button-group.jsx +2 -2
  138. package/shadcn/ui/button.jsx +1 -1
  139. package/shadcn/ui/calendar.jsx +1 -1
  140. package/shadcn/ui/checkbox.jsx +1 -1
  141. package/shadcn/ui/collapsible.jsx +1 -1
  142. package/shadcn/ui/command.jsx +1 -1
  143. package/shadcn/ui/context-menu.jsx +1 -1
  144. package/shadcn/ui/dialog.jsx +1 -1
  145. package/shadcn/ui/drawer.jsx +176 -74
  146. package/shadcn/ui/dropdown-menu.jsx +1 -1
  147. package/shadcn/ui/hover-card.jsx +1 -1
  148. package/shadcn/ui/input.jsx +1 -1
  149. package/shadcn/ui/item.jsx +2 -2
  150. package/shadcn/ui/menubar.jsx +2 -2
  151. package/shadcn/ui/navigation-menu.jsx +1 -1
  152. package/shadcn/ui/popover.jsx +1 -1
  153. package/shadcn/ui/progress.jsx +1 -1
  154. package/shadcn/ui/radio-group.jsx +2 -2
  155. package/shadcn/ui/scroll-area.jsx +1 -1
  156. package/shadcn/ui/select.jsx +1 -1
  157. package/shadcn/ui/separator.jsx +1 -1
  158. package/shadcn/ui/sheet.jsx +1 -1
  159. package/shadcn/ui/sidebar.jsx +3 -3
  160. package/shadcn/ui/slider.jsx +1 -1
  161. package/shadcn/ui/switch.jsx +1 -1
  162. package/shadcn/ui/tabs.jsx +1 -1
  163. package/shadcn/ui/toggle-group.jsx +2 -2
  164. package/shadcn/ui/toggle.jsx +1 -1
  165. package/shadcn/ui/tooltip.jsx +1 -1
  166. package/styles.css +31 -0
  167. package/MIGRATION.md +0 -230
  168. package/shadcn/ui/carousel.jsx +0 -195
  169. package/shadcn/ui/chart.jsx +0 -312
  170. package/shadcn/ui/resizable.jsx +0 -47
  171. /package/{core → components/core}/Calendar.jsx +0 -0
  172. /package/{core → components/core}/Command.jsx +0 -0
  173. /package/{core → components/core}/Context.jsx +0 -0
  174. /package/{core → components/core}/ThemeProvider.jsx +0 -0
  175. /package/{core → components/core}/Utilities.js +0 -0
@@ -0,0 +1,1595 @@
1
+ /* @base-ui/react 1.4.1 — vendored (MIT — MUI Inc).
2
+ * Refresh: scripts/vendor-base-ui.js (see header for instructions).
3
+ * Do not edit by hand. */
4
+ import {
5
+ getDefaultLabelId,
6
+ resolveAriaLabelledBy
7
+ } from "./_chunk-611pz5sm.js";
8
+ import {
9
+ clamp
10
+ } from "./_chunk-szcr6mhk.js";
11
+ import {
12
+ useIsHydrating
13
+ } from "./_chunk-vjbnhhg1.js";
14
+ import {
15
+ useCSPContext
16
+ } from "./_chunk-ymj1dpqg.js";
17
+ import {
18
+ focusElementWithVisible,
19
+ useLabel
20
+ } from "./_chunk-fch5cba8.js";
21
+ import {
22
+ useLabelableId
23
+ } from "./_chunk-k4mc2kan.js";
24
+ import {
25
+ formatNumber,
26
+ valueToPercent
27
+ } from "./_chunk-tmfmrzwe.js";
28
+ import"./_chunk-w68yxg9d.js";
29
+ import {
30
+ useFormContext,
31
+ useRegisterFieldControl
32
+ } from "./_chunk-97tas84n.js";
33
+ import {
34
+ fieldValidityMapping,
35
+ useFieldRootContext,
36
+ useLabelableContext
37
+ } from "./_chunk-kfz96xv1.js";
38
+ import"./_chunk-ds8fnpjj.js";
39
+ import {
40
+ useCompositeListItem
41
+ } from "./_chunk-ek863ta9.js";
42
+ import {
43
+ CompositeList
44
+ } from "./_chunk-p6qynd6r.js";
45
+ import"./_chunk-20rtfsz9.js";
46
+ import {
47
+ useDirection
48
+ } from "./_chunk-wtw745qd.js";
49
+ import {
50
+ useControlled
51
+ } from "./_chunk-01rqe37g.js";
52
+ import"./_chunk-aqwsk46c.js";
53
+ import {
54
+ ownerDocument
55
+ } from "./_chunk-xb7ph1ka.js";
56
+ import {
57
+ activeElement,
58
+ contains,
59
+ getTarget,
60
+ matchesFocusVisible
61
+ } from "./_chunk-atnkefgd.js";
62
+ import {
63
+ useValueAsRef
64
+ } from "./_chunk-drfb9kp2.js";
65
+ import {
66
+ ARROW_DOWN,
67
+ ARROW_LEFT,
68
+ ARROW_RIGHT,
69
+ ARROW_UP,
70
+ COMPOSITE_KEYS,
71
+ END,
72
+ HOME,
73
+ PAGE_DOWN,
74
+ PAGE_UP
75
+ } from "./_chunk-qce0xt57.js";
76
+ import"./_chunk-nya71ccw.js";
77
+ import"./_chunk-t7j3rbpv.js";
78
+ import {
79
+ useValueChanged
80
+ } from "./_chunk-cwr896nf.js";
81
+ import {
82
+ visuallyHidden
83
+ } from "./_chunk-hzgetm70.js";
84
+ import {
85
+ addEventListener
86
+ } from "./_chunk-mvv30fkv.js";
87
+ import {
88
+ createChangeEventDetails,
89
+ createGenericEventDetails,
90
+ exports_reason_parts
91
+ } from "./_chunk-4s0k3h7t.js";
92
+ import {
93
+ useBaseUiId
94
+ } from "./_chunk-8kh3xk78.js";
95
+ import {
96
+ useAnimationFrame
97
+ } from "./_chunk-3h6zpchb.js";
98
+ import"./_chunk-8jz3hb7q.js";
99
+ import"./_chunk-71zm6zgv.js";
100
+ import {
101
+ isElement,
102
+ isHTMLElement
103
+ } from "./_chunk-sx6vkz01.js";
104
+ import"./_chunk-n7dnqnbw.js";
105
+ import {
106
+ useStableCallback
107
+ } from "./_chunk-mznt6ktj.js";
108
+ import {
109
+ useIsoLayoutEffect
110
+ } from "./_chunk-b40erthe.js";
111
+ import {
112
+ useMergedRefs,
113
+ useRenderElement,
114
+ warn
115
+ } from "./_chunk-1s41sngz.js";
116
+ import {
117
+ __export,
118
+ mergeProps
119
+ } from "./_chunk-1e6khrvm.js";
120
+
121
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/index.parts.js
122
+ var exports_index_parts = {};
123
+ __export(exports_index_parts, {
124
+ Value: () => SliderValue,
125
+ Track: () => SliderTrack,
126
+ Thumb: () => SliderThumb,
127
+ Root: () => SliderRoot,
128
+ Label: () => SliderLabel,
129
+ Indicator: () => SliderIndicator,
130
+ Control: () => SliderControl
131
+ });
132
+
133
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/root/SliderRoot.js
134
+ import * as React2 from "react";
135
+
136
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/internals/areArraysEqual.js
137
+ function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {
138
+ return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));
139
+ }
140
+
141
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/utils/asc.js
142
+ function asc(a, b) {
143
+ return a - b;
144
+ }
145
+
146
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/utils/replaceArrayItemAtIndex.js
147
+ function replaceArrayItemAtIndex(array, index, newValue) {
148
+ const output = array.slice();
149
+ output[index] = newValue;
150
+ return output.sort(asc);
151
+ }
152
+
153
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/utils/getSliderValue.js
154
+ function getSliderValue(valueInput, index, min, max, range, values) {
155
+ let newValue = valueInput;
156
+ newValue = clamp(newValue, min, max);
157
+ if (range) {
158
+ newValue = replaceArrayItemAtIndex(values, index, clamp(newValue, values[index - 1] || -Infinity, values[index + 1] || Infinity));
159
+ }
160
+ return newValue;
161
+ }
162
+
163
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/utils/validateMinimumDistance.js
164
+ function validateMinimumDistance(values, step, minStepsBetweenValues) {
165
+ if (!Array.isArray(values)) {
166
+ return true;
167
+ }
168
+ const distances = values.reduce((acc, val, index, vals) => {
169
+ if (index === vals.length - 1) {
170
+ return acc;
171
+ }
172
+ acc.push(Math.abs(val - vals[index + 1]));
173
+ return acc;
174
+ }, []);
175
+ return Math.min(...distances) >= step * minStepsBetweenValues;
176
+ }
177
+
178
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/root/stateAttributesMapping.js
179
+ var sliderStateAttributesMapping = {
180
+ activeThumbIndex: () => null,
181
+ max: () => null,
182
+ min: () => null,
183
+ minStepsBetweenValues: () => null,
184
+ step: () => null,
185
+ values: () => null,
186
+ ...fieldValidityMapping
187
+ };
188
+
189
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/root/SliderRootContext.js
190
+ import * as React from "react";
191
+ "use client";
192
+ var SliderRootContext = /* @__PURE__ */ React.createContext(undefined);
193
+ if (true)
194
+ SliderRootContext.displayName = "SliderRootContext";
195
+ function useSliderRootContext() {
196
+ const context = React.useContext(SliderRootContext);
197
+ if (context === undefined) {
198
+ throw new Error("Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>.");
199
+ }
200
+ return context;
201
+ }
202
+
203
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/root/SliderRoot.js
204
+ import { jsx as _jsx } from "react/jsx-runtime";
205
+ "use client";
206
+ function getSliderChangeEventReason(event) {
207
+ return "key" in event ? exports_reason_parts.keyboard : exports_reason_parts.inputChange;
208
+ }
209
+ function areValuesEqual(newValue, oldValue) {
210
+ if (typeof newValue === "number" && typeof oldValue === "number") {
211
+ return newValue === oldValue;
212
+ }
213
+ if (Array.isArray(newValue) && Array.isArray(oldValue)) {
214
+ return areArraysEqual(newValue, oldValue);
215
+ }
216
+ return false;
217
+ }
218
+ var SliderRoot = /* @__PURE__ */ React2.forwardRef(function SliderRoot2(componentProps, forwardedRef) {
219
+ const {
220
+ "aria-labelledby": ariaLabelledByProp,
221
+ className,
222
+ defaultValue,
223
+ disabled: disabledProp = false,
224
+ id: idProp,
225
+ format,
226
+ largeStep = 10,
227
+ locale,
228
+ render,
229
+ max = 100,
230
+ min = 0,
231
+ minStepsBetweenValues = 0,
232
+ form,
233
+ name: nameProp,
234
+ onValueChange: onValueChangeProp,
235
+ onValueCommitted: onValueCommittedProp,
236
+ orientation = "horizontal",
237
+ step = 1,
238
+ thumbCollisionBehavior = "push",
239
+ thumbAlignment = "center",
240
+ value: valueProp,
241
+ style,
242
+ ...elementProps
243
+ } = componentProps;
244
+ const id = useBaseUiId(idProp);
245
+ const defaultLabelId = getDefaultLabelId(id);
246
+ const onValueChange = useStableCallback(onValueChangeProp);
247
+ const onValueCommitted = useStableCallback(onValueCommittedProp);
248
+ const {
249
+ clearErrors
250
+ } = useFormContext();
251
+ const {
252
+ state: fieldState,
253
+ disabled: fieldDisabled,
254
+ name: fieldName,
255
+ setTouched,
256
+ setDirty,
257
+ validityData,
258
+ shouldValidateOnChange,
259
+ validation
260
+ } = useFieldRootContext();
261
+ const {
262
+ labelId: fieldLabelId
263
+ } = useLabelableContext();
264
+ const [labelId, setLabelId] = React2.useState();
265
+ const ariaLabelledby = ariaLabelledByProp ?? resolveAriaLabelledBy(fieldLabelId, labelId);
266
+ const disabled = fieldDisabled || disabledProp;
267
+ const name = fieldName ?? nameProp;
268
+ const [valueUnwrapped, setValueUnwrapped] = useControlled({
269
+ controlled: valueProp,
270
+ default: defaultValue ?? min,
271
+ name: "Slider"
272
+ });
273
+ const sliderRef = React2.useRef(null);
274
+ const controlRef = React2.useRef(null);
275
+ const thumbRefs = React2.useRef([]);
276
+ const pressedInputRef = React2.useRef(null);
277
+ const pressedThumbCenterOffsetRef = React2.useRef(null);
278
+ const pressedThumbIndexRef = React2.useRef(-1);
279
+ const pressedValuesRef = React2.useRef(null);
280
+ const lastChangedValueRef = React2.useRef(null);
281
+ const lastChangeReasonRef = React2.useRef("none");
282
+ const formatOptionsRef = useValueAsRef(format);
283
+ const [active, setActiveState] = React2.useState(-1);
284
+ const [lastUsedThumbIndex, setLastUsedThumbIndex] = React2.useState(-1);
285
+ const [dragging, setDragging] = React2.useState(false);
286
+ const [thumbMap, setThumbMap] = React2.useState(() => new Map);
287
+ const [indicatorPosition, setIndicatorPosition] = React2.useState([undefined, undefined]);
288
+ const setActive = useStableCallback((value) => {
289
+ setActiveState(value);
290
+ if (value !== -1) {
291
+ setLastUsedThumbIndex(value);
292
+ }
293
+ });
294
+ useRegisterFieldControl(controlRef, {
295
+ id,
296
+ value: valueUnwrapped
297
+ });
298
+ useValueChanged(valueUnwrapped, () => {
299
+ clearErrors(name);
300
+ if (shouldValidateOnChange()) {
301
+ validation.commit(valueUnwrapped);
302
+ } else {
303
+ validation.commit(valueUnwrapped, true);
304
+ }
305
+ const initialValue = validityData.initialValue;
306
+ let isDirty;
307
+ if (Array.isArray(valueUnwrapped) && Array.isArray(initialValue)) {
308
+ isDirty = !areArraysEqual(valueUnwrapped, initialValue);
309
+ } else {
310
+ isDirty = valueUnwrapped !== initialValue;
311
+ }
312
+ setDirty(isDirty);
313
+ });
314
+ const registerFieldControlRef = useStableCallback((element2) => {
315
+ if (element2) {
316
+ controlRef.current = element2;
317
+ }
318
+ });
319
+ const range = Array.isArray(valueUnwrapped);
320
+ const values = React2.useMemo(() => {
321
+ if (!range) {
322
+ return [clamp(valueUnwrapped, min, max)];
323
+ }
324
+ return valueUnwrapped.slice().sort(asc);
325
+ }, [max, min, range, valueUnwrapped]);
326
+ const setValue = useStableCallback((newValue, details) => {
327
+ if (Number.isNaN(newValue) || areValuesEqual(newValue, valueUnwrapped)) {
328
+ return;
329
+ }
330
+ const changeDetails = details ?? createChangeEventDetails(exports_reason_parts.none, undefined, undefined, {
331
+ activeThumbIndex: -1
332
+ });
333
+ lastChangeReasonRef.current = changeDetails.reason;
334
+ const nativeEvent = changeDetails.event;
335
+ const EventConstructor = nativeEvent.constructor ?? Event;
336
+ const clonedEvent = new EventConstructor(nativeEvent.type, nativeEvent);
337
+ Object.defineProperty(clonedEvent, "target", {
338
+ writable: true,
339
+ value: {
340
+ value: newValue,
341
+ name
342
+ }
343
+ });
344
+ changeDetails.event = clonedEvent;
345
+ lastChangedValueRef.current = newValue;
346
+ onValueChange(newValue, changeDetails);
347
+ if (changeDetails.isCanceled) {
348
+ return;
349
+ }
350
+ setValueUnwrapped(newValue);
351
+ });
352
+ const handleInputChange = useStableCallback((valueInput, index, event) => {
353
+ const newValue = getSliderValue(valueInput, index, min, max, range, values);
354
+ if (validateMinimumDistance(newValue, step, minStepsBetweenValues)) {
355
+ const reason = getSliderChangeEventReason(event);
356
+ setValue(newValue, createChangeEventDetails(reason, event.nativeEvent, undefined, {
357
+ activeThumbIndex: index
358
+ }));
359
+ setTouched(true);
360
+ const nextValue = lastChangedValueRef.current ?? newValue;
361
+ onValueCommitted(nextValue, createGenericEventDetails(reason, event.nativeEvent));
362
+ }
363
+ });
364
+ if (true) {
365
+ if (min >= max) {
366
+ warn("Slider `max` must be greater than `min`.");
367
+ }
368
+ }
369
+ useIsoLayoutEffect(() => {
370
+ const activeEl = activeElement(ownerDocument(sliderRef.current));
371
+ if (disabled && contains(sliderRef.current, activeEl)) {
372
+ activeEl.blur();
373
+ }
374
+ }, [disabled]);
375
+ if (disabled && active !== -1) {
376
+ setActive(-1);
377
+ }
378
+ const state = React2.useMemo(() => ({
379
+ ...fieldState,
380
+ activeThumbIndex: active,
381
+ disabled,
382
+ dragging,
383
+ orientation,
384
+ max,
385
+ min,
386
+ minStepsBetweenValues,
387
+ step,
388
+ values
389
+ }), [fieldState, active, disabled, dragging, max, min, minStepsBetweenValues, orientation, step, values]);
390
+ const contextValue = React2.useMemo(() => ({
391
+ active,
392
+ controlRef,
393
+ disabled,
394
+ dragging,
395
+ validation,
396
+ formatOptionsRef,
397
+ handleInputChange,
398
+ indicatorPosition,
399
+ inset: thumbAlignment !== "center",
400
+ labelId: ariaLabelledby,
401
+ rootLabelId: defaultLabelId,
402
+ largeStep,
403
+ lastUsedThumbIndex,
404
+ lastChangedValueRef,
405
+ lastChangeReasonRef,
406
+ form,
407
+ locale,
408
+ max,
409
+ min,
410
+ minStepsBetweenValues,
411
+ name,
412
+ onValueCommitted,
413
+ orientation,
414
+ pressedInputRef,
415
+ pressedThumbCenterOffsetRef,
416
+ pressedThumbIndexRef,
417
+ pressedValuesRef,
418
+ registerFieldControlRef,
419
+ renderBeforeHydration: thumbAlignment === "edge",
420
+ setActive,
421
+ setDragging,
422
+ setIndicatorPosition,
423
+ setLabelId,
424
+ setValue,
425
+ state,
426
+ step,
427
+ thumbCollisionBehavior,
428
+ thumbMap,
429
+ thumbRefs,
430
+ values
431
+ }), [active, controlRef, ariaLabelledby, defaultLabelId, disabled, dragging, validation, formatOptionsRef, handleInputChange, indicatorPosition, largeStep, lastUsedThumbIndex, lastChangedValueRef, lastChangeReasonRef, form, locale, max, min, minStepsBetweenValues, name, onValueCommitted, orientation, pressedInputRef, pressedThumbCenterOffsetRef, pressedThumbIndexRef, pressedValuesRef, registerFieldControlRef, setActive, setDragging, setIndicatorPosition, setLabelId, setValue, state, step, thumbCollisionBehavior, thumbAlignment, thumbMap, thumbRefs, values]);
432
+ const element = useRenderElement("div", componentProps, {
433
+ state,
434
+ ref: [forwardedRef, sliderRef],
435
+ props: [{
436
+ "aria-labelledby": ariaLabelledby,
437
+ id,
438
+ role: "group"
439
+ }, validation.getValidationProps, elementProps],
440
+ stateAttributesMapping: sliderStateAttributesMapping
441
+ });
442
+ return /* @__PURE__ */ _jsx(SliderRootContext.Provider, {
443
+ value: contextValue,
444
+ children: /* @__PURE__ */ _jsx(CompositeList, {
445
+ elementsRef: thumbRefs,
446
+ onMapChange: setThumbMap,
447
+ children: element
448
+ })
449
+ });
450
+ });
451
+ if (true)
452
+ SliderRoot.displayName = "SliderRoot";
453
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/label/SliderLabel.js
454
+ import * as React3 from "react";
455
+ "use client";
456
+ var SliderLabel = /* @__PURE__ */ React3.forwardRef(function SliderLabel2(componentProps, forwardedRef) {
457
+ const {
458
+ render,
459
+ className,
460
+ style,
461
+ ...elementProps
462
+ } = componentProps;
463
+ const elementPropsWithoutId = elementProps;
464
+ delete elementPropsWithoutId.id;
465
+ const {
466
+ state,
467
+ setLabelId,
468
+ controlRef,
469
+ rootLabelId
470
+ } = useSliderRootContext();
471
+ function focusControl(event, controlId) {
472
+ if (controlId) {
473
+ const controlElement = ownerDocument(event.currentTarget).getElementById(controlId);
474
+ if (isHTMLElement(controlElement)) {
475
+ focusElementWithVisible(controlElement);
476
+ return;
477
+ }
478
+ }
479
+ const fallbackInputs = controlRef.current?.querySelectorAll('input[type="range"]');
480
+ const fallbackInput = fallbackInputs?.length === 1 ? fallbackInputs[0] : null;
481
+ if (isHTMLElement(fallbackInput)) {
482
+ focusElementWithVisible(fallbackInput);
483
+ }
484
+ }
485
+ const labelProps = useLabel({
486
+ id: rootLabelId,
487
+ setLabelId,
488
+ focusControl
489
+ });
490
+ return useRenderElement("div", componentProps, {
491
+ ref: forwardedRef,
492
+ state,
493
+ props: [labelProps, elementProps],
494
+ stateAttributesMapping: sliderStateAttributesMapping
495
+ });
496
+ });
497
+ if (true)
498
+ SliderLabel.displayName = "SliderLabel";
499
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/value/SliderValue.js
500
+ import * as React4 from "react";
501
+ "use client";
502
+ var SliderValue = /* @__PURE__ */ React4.forwardRef(function SliderValue2(componentProps, forwardedRef) {
503
+ const {
504
+ "aria-live": ariaLive = "off",
505
+ render,
506
+ className,
507
+ children,
508
+ style,
509
+ ...elementProps
510
+ } = componentProps;
511
+ const {
512
+ thumbMap,
513
+ state,
514
+ values,
515
+ formatOptionsRef,
516
+ locale
517
+ } = useSliderRootContext();
518
+ const outputFor = React4.useMemo(() => {
519
+ let htmlFor = "";
520
+ for (const thumbMetadata of thumbMap.values()) {
521
+ if (thumbMetadata?.inputId) {
522
+ htmlFor += `${thumbMetadata.inputId} `;
523
+ }
524
+ }
525
+ return htmlFor.trim() === "" ? undefined : htmlFor.trim();
526
+ }, [thumbMap]);
527
+ const formattedValues = React4.useMemo(() => {
528
+ const arr = [];
529
+ for (let i = 0;i < values.length; i += 1) {
530
+ arr.push(formatNumber(values[i], locale, formatOptionsRef.current ?? undefined));
531
+ }
532
+ return arr;
533
+ }, [formatOptionsRef, locale, values]);
534
+ const defaultDisplayValue = React4.useMemo(() => {
535
+ const arr = [];
536
+ for (let i = 0;i < values.length; i += 1) {
537
+ arr.push(formattedValues[i] || values[i]);
538
+ }
539
+ return arr.join(" – ");
540
+ }, [values, formattedValues]);
541
+ const element = useRenderElement("output", componentProps, {
542
+ state,
543
+ ref: forwardedRef,
544
+ props: [{
545
+ "aria-live": ariaLive,
546
+ children: typeof children === "function" ? children(formattedValues, values) : defaultDisplayValue,
547
+ htmlFor: outputFor
548
+ }, elementProps],
549
+ stateAttributesMapping: sliderStateAttributesMapping
550
+ });
551
+ return element;
552
+ });
553
+ if (true)
554
+ SliderValue.displayName = "SliderValue";
555
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/control/SliderControl.js
556
+ import * as React5 from "react";
557
+
558
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/utils/getMidpoint.js
559
+ function getMidpoint(element) {
560
+ const rect = element.getBoundingClientRect();
561
+ return {
562
+ x: (rect.left + rect.right) / 2,
563
+ y: (rect.top + rect.bottom) / 2
564
+ };
565
+ }
566
+
567
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/utils/roundValueToStep.js
568
+ function getDecimalPrecision(num) {
569
+ if (num === 0) {
570
+ return 0;
571
+ }
572
+ if (Math.abs(num) < 1) {
573
+ const parts = num.toExponential().split("e-");
574
+ const matissaDecimalPart = parts[0].split(".")[1];
575
+ return (matissaDecimalPart ? matissaDecimalPart.length : 0) + parseInt(parts[1], 10);
576
+ }
577
+ const decimalPart = num.toString().split(".")[1];
578
+ return decimalPart ? decimalPart.length : 0;
579
+ }
580
+ function roundValueToStep(value, step, min) {
581
+ const nearest = Math.round((value - min) / step) * step + min;
582
+ return Number(nearest.toFixed(Math.max(getDecimalPrecision(step), getDecimalPrecision(min))));
583
+ }
584
+
585
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/utils/getPushedThumbValues.js
586
+ function getPushedThumbValues({
587
+ values,
588
+ index,
589
+ nextValue,
590
+ min,
591
+ max,
592
+ step,
593
+ minStepsBetweenValues,
594
+ initialValues
595
+ }) {
596
+ if (values.length === 0) {
597
+ return [];
598
+ }
599
+ const nextValues = values.slice();
600
+ const minValueDifference = step * minStepsBetweenValues;
601
+ const lastIndex = nextValues.length - 1;
602
+ const baseInitialValues = initialValues ?? values;
603
+ const indexMin = min + index * minValueDifference;
604
+ const indexMax = max - (lastIndex - index) * minValueDifference;
605
+ nextValues[index] = clamp(nextValue, indexMin, indexMax);
606
+ for (let i = index + 1;i <= lastIndex; i += 1) {
607
+ const minAllowed = nextValues[i - 1] + minValueDifference;
608
+ const maxAllowed = max - (lastIndex - i) * minValueDifference;
609
+ const initialValue = baseInitialValues[i] ?? nextValues[i];
610
+ let candidate = Math.max(nextValues[i], minAllowed);
611
+ if (initialValue < candidate) {
612
+ candidate = Math.max(initialValue, minAllowed);
613
+ }
614
+ nextValues[i] = clamp(candidate, minAllowed, maxAllowed);
615
+ }
616
+ for (let i = index - 1;i >= 0; i -= 1) {
617
+ const maxAllowed = nextValues[i + 1] - minValueDifference;
618
+ const minAllowed = min + i * minValueDifference;
619
+ const initialValue = baseInitialValues[i] ?? nextValues[i];
620
+ let candidate = Math.min(nextValues[i], maxAllowed);
621
+ if (initialValue > candidate) {
622
+ candidate = Math.min(initialValue, maxAllowed);
623
+ }
624
+ nextValues[i] = clamp(candidate, minAllowed, maxAllowed);
625
+ }
626
+ for (let i = 0;i <= lastIndex; i += 1) {
627
+ nextValues[i] = Number(nextValues[i].toFixed(12));
628
+ }
629
+ return nextValues;
630
+ }
631
+
632
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/utils/resolveThumbCollision.js
633
+ function resolveThumbCollision({
634
+ behavior,
635
+ values,
636
+ currentValues,
637
+ initialValues,
638
+ pressedIndex,
639
+ nextValue,
640
+ min,
641
+ max,
642
+ step,
643
+ minStepsBetweenValues
644
+ }) {
645
+ const activeValues = currentValues ?? values;
646
+ const baselineValues = initialValues ?? values;
647
+ const range = activeValues.length > 1;
648
+ if (!range) {
649
+ return {
650
+ value: nextValue,
651
+ thumbIndex: 0,
652
+ didSwap: false
653
+ };
654
+ }
655
+ const minValueDifference = step * minStepsBetweenValues;
656
+ switch (behavior) {
657
+ case "swap": {
658
+ const pressedInitialValue = activeValues[pressedIndex];
659
+ const epsilon = 0.0000001;
660
+ const candidateValues = activeValues.slice();
661
+ const previousNeighbor = candidateValues[pressedIndex - 1];
662
+ const nextNeighbor = candidateValues[pressedIndex + 1];
663
+ const lowerBound = previousNeighbor != null ? previousNeighbor + minValueDifference : min;
664
+ const upperBound = nextNeighbor != null ? nextNeighbor - minValueDifference : max;
665
+ const constrainedValue = clamp(nextValue, lowerBound, upperBound);
666
+ const pressedValueAfterClamp = Number(constrainedValue.toFixed(12));
667
+ candidateValues[pressedIndex] = pressedValueAfterClamp;
668
+ const movingForward = nextValue > pressedInitialValue;
669
+ const movingBackward = nextValue < pressedInitialValue;
670
+ const shouldSwapForward = movingForward && nextNeighbor != null && nextValue >= nextNeighbor - epsilon;
671
+ const shouldSwapBackward = movingBackward && previousNeighbor != null && nextValue <= previousNeighbor + epsilon;
672
+ if (!shouldSwapForward && !shouldSwapBackward) {
673
+ return {
674
+ value: candidateValues,
675
+ thumbIndex: pressedIndex,
676
+ didSwap: false
677
+ };
678
+ }
679
+ const targetIndex = shouldSwapForward ? pressedIndex + 1 : pressedIndex - 1;
680
+ const initialValuesForPush = candidateValues.map((_, index) => {
681
+ if (index === pressedIndex) {
682
+ return pressedValueAfterClamp;
683
+ }
684
+ const baseline = baselineValues[index];
685
+ if (baseline != null) {
686
+ return baseline;
687
+ }
688
+ return activeValues[index];
689
+ });
690
+ let nextValueForTarget = nextValue;
691
+ if (shouldSwapForward) {
692
+ nextValueForTarget = Math.max(nextValue, candidateValues[targetIndex]);
693
+ } else {
694
+ nextValueForTarget = Math.min(nextValue, candidateValues[targetIndex]);
695
+ }
696
+ const adjustedValues = getPushedThumbValues({
697
+ values: candidateValues,
698
+ index: targetIndex,
699
+ nextValue: nextValueForTarget,
700
+ min,
701
+ max,
702
+ step,
703
+ minStepsBetweenValues,
704
+ initialValues: initialValuesForPush
705
+ });
706
+ const neighborIndex = shouldSwapForward ? targetIndex - 1 : targetIndex + 1;
707
+ if (neighborIndex >= 0 && neighborIndex < adjustedValues.length) {
708
+ const previousValue = adjustedValues[neighborIndex - 1];
709
+ const nextValueAfter = adjustedValues[neighborIndex + 1];
710
+ let neighborLowerBound = previousValue != null ? previousValue + minValueDifference : min;
711
+ neighborLowerBound = Math.max(neighborLowerBound, min + neighborIndex * minValueDifference);
712
+ let neighborUpperBound = nextValueAfter != null ? nextValueAfter - minValueDifference : max;
713
+ neighborUpperBound = Math.min(neighborUpperBound, max - (adjustedValues.length - 1 - neighborIndex) * minValueDifference);
714
+ const restoredValue = clamp(pressedValueAfterClamp, neighborLowerBound, neighborUpperBound);
715
+ adjustedValues[neighborIndex] = Number(restoredValue.toFixed(12));
716
+ }
717
+ return {
718
+ value: adjustedValues,
719
+ thumbIndex: targetIndex,
720
+ didSwap: true
721
+ };
722
+ }
723
+ case "push": {
724
+ const nextValues = getPushedThumbValues({
725
+ values: activeValues,
726
+ index: pressedIndex,
727
+ nextValue,
728
+ min,
729
+ max,
730
+ step,
731
+ minStepsBetweenValues
732
+ });
733
+ return {
734
+ value: nextValues,
735
+ thumbIndex: pressedIndex,
736
+ didSwap: false
737
+ };
738
+ }
739
+ case "none":
740
+ default: {
741
+ const candidateValues = activeValues.slice();
742
+ const previousNeighbor = candidateValues[pressedIndex - 1];
743
+ const nextNeighbor = candidateValues[pressedIndex + 1];
744
+ const lowerBound = previousNeighbor != null ? previousNeighbor + minValueDifference : min;
745
+ const upperBound = nextNeighbor != null ? nextNeighbor - minValueDifference : max;
746
+ const constrainedValue = clamp(nextValue, lowerBound, upperBound);
747
+ candidateValues[pressedIndex] = Number(constrainedValue.toFixed(12));
748
+ return {
749
+ value: candidateValues,
750
+ thumbIndex: pressedIndex,
751
+ didSwap: false
752
+ };
753
+ }
754
+ }
755
+ }
756
+
757
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/control/SliderControl.js
758
+ "use client";
759
+ var INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
760
+ function getControlOffset(styles, vertical) {
761
+ if (!styles) {
762
+ return {
763
+ start: 0,
764
+ end: 0
765
+ };
766
+ }
767
+ function parseSize(value) {
768
+ const parsed = value != null ? parseFloat(value) : 0;
769
+ return Number.isNaN(parsed) ? 0 : parsed;
770
+ }
771
+ const start = !vertical ? "InlineStart" : "Top";
772
+ const end = !vertical ? "InlineEnd" : "Bottom";
773
+ return {
774
+ start: parseSize(styles[`border${start}Width`]) + parseSize(styles[`padding${start}`]),
775
+ end: parseSize(styles[`border${end}Width`]) + parseSize(styles[`padding${end}`])
776
+ };
777
+ }
778
+ function getFingerCoords(event, touchIdRef) {
779
+ if (touchIdRef.current != null && event.changedTouches) {
780
+ const touchEvent = event;
781
+ for (let i = 0;i < touchEvent.changedTouches.length; i += 1) {
782
+ const touch = touchEvent.changedTouches[i];
783
+ if (touch.identifier === touchIdRef.current) {
784
+ return {
785
+ x: touch.clientX,
786
+ y: touch.clientY
787
+ };
788
+ }
789
+ }
790
+ return null;
791
+ }
792
+ return {
793
+ x: event.clientX,
794
+ y: event.clientY
795
+ };
796
+ }
797
+ var SliderControl = /* @__PURE__ */ React5.forwardRef(function SliderControl2(componentProps, forwardedRef) {
798
+ const {
799
+ render: renderProp,
800
+ className,
801
+ style,
802
+ ...elementProps
803
+ } = componentProps;
804
+ const {
805
+ disabled,
806
+ dragging,
807
+ inset,
808
+ lastChangedValueRef,
809
+ lastChangeReasonRef,
810
+ max,
811
+ min,
812
+ minStepsBetweenValues,
813
+ onValueCommitted,
814
+ orientation,
815
+ pressedInputRef,
816
+ pressedThumbCenterOffsetRef,
817
+ pressedThumbIndexRef,
818
+ pressedValuesRef,
819
+ registerFieldControlRef,
820
+ renderBeforeHydration,
821
+ setActive,
822
+ setDragging,
823
+ setValue,
824
+ state,
825
+ step,
826
+ thumbCollisionBehavior,
827
+ thumbRefs,
828
+ values
829
+ } = useSliderRootContext();
830
+ const direction = useDirection();
831
+ const range = values.length > 1;
832
+ const vertical = orientation === "vertical";
833
+ const controlRef = React5.useRef(null);
834
+ const stylesRef = React5.useRef(null);
835
+ const setStylesRef = useStableCallback((element2) => {
836
+ if (element2 && stylesRef.current == null) {
837
+ if (stylesRef.current == null) {
838
+ stylesRef.current = getComputedStyle(element2);
839
+ }
840
+ }
841
+ });
842
+ const touchIdRef = React5.useRef(null);
843
+ const moveCountRef = React5.useRef(0);
844
+ const insetThumbOffsetRef = React5.useRef(0);
845
+ const latestValuesRef = useValueAsRef(values);
846
+ const updatePressedThumb = useStableCallback((nextIndex) => {
847
+ if (pressedThumbIndexRef.current !== nextIndex) {
848
+ pressedThumbIndexRef.current = nextIndex;
849
+ }
850
+ const thumbElement = thumbRefs.current[nextIndex];
851
+ if (!thumbElement) {
852
+ pressedThumbCenterOffsetRef.current = null;
853
+ pressedInputRef.current = null;
854
+ return;
855
+ }
856
+ pressedInputRef.current = thumbElement.querySelector('input[type="range"]');
857
+ });
858
+ const getFingerState = useStableCallback((fingerCoords) => {
859
+ const control = controlRef.current;
860
+ if (!control) {
861
+ return null;
862
+ }
863
+ const {
864
+ width,
865
+ height,
866
+ bottom,
867
+ left,
868
+ right
869
+ } = control.getBoundingClientRect();
870
+ const controlOffset = getControlOffset(stylesRef.current, vertical);
871
+ const insetThumbOffset = insetThumbOffsetRef.current;
872
+ const controlSize = (vertical ? height : width) - controlOffset.start - controlOffset.end - insetThumbOffset * 2;
873
+ const thumbCenterOffset = pressedThumbCenterOffsetRef.current ?? 0;
874
+ const fingerX = fingerCoords.x - thumbCenterOffset;
875
+ const fingerY = fingerCoords.y - thumbCenterOffset;
876
+ const valueSize = vertical ? bottom - fingerY - controlOffset.end : (direction === "rtl" ? right - fingerX : fingerX - left) - controlOffset.start;
877
+ const valueRescaled = clamp((valueSize - insetThumbOffset) / controlSize, 0, 1);
878
+ let newValue = (max - min) * valueRescaled + min;
879
+ newValue = roundValueToStep(newValue, step, min);
880
+ newValue = clamp(newValue, min, max);
881
+ if (!range) {
882
+ return {
883
+ value: newValue,
884
+ thumbIndex: 0,
885
+ didSwap: false
886
+ };
887
+ }
888
+ const thumbIndex = pressedThumbIndexRef.current;
889
+ if (thumbIndex < 0) {
890
+ return null;
891
+ }
892
+ const collisionResult = resolveThumbCollision({
893
+ behavior: thumbCollisionBehavior,
894
+ values,
895
+ currentValues: latestValuesRef.current ?? values,
896
+ initialValues: pressedValuesRef.current,
897
+ pressedIndex: thumbIndex,
898
+ nextValue: newValue,
899
+ min,
900
+ max,
901
+ step,
902
+ minStepsBetweenValues
903
+ });
904
+ if (thumbCollisionBehavior === "swap" && collisionResult.didSwap) {
905
+ updatePressedThumb(collisionResult.thumbIndex);
906
+ } else {
907
+ pressedThumbIndexRef.current = collisionResult.thumbIndex;
908
+ }
909
+ return collisionResult;
910
+ });
911
+ const startPressing = useStableCallback((fingerCoords) => {
912
+ pressedValuesRef.current = range ? values.slice() : null;
913
+ latestValuesRef.current = values;
914
+ const pressedThumbIndex = pressedThumbIndexRef.current;
915
+ let closestThumbIndex = pressedThumbIndex;
916
+ if (pressedThumbIndex > -1 && pressedThumbIndex < values.length) {
917
+ if (values[pressedThumbIndex] === max) {
918
+ let candidateIndex = pressedThumbIndex;
919
+ while (candidateIndex > 0 && values[candidateIndex - 1] === max) {
920
+ candidateIndex -= 1;
921
+ }
922
+ closestThumbIndex = candidateIndex;
923
+ }
924
+ } else {
925
+ const axis = !vertical ? "x" : "y";
926
+ let minDistance;
927
+ closestThumbIndex = -1;
928
+ for (let i = 0;i < thumbRefs.current.length; i += 1) {
929
+ const thumbEl = thumbRefs.current[i];
930
+ if (isElement(thumbEl)) {
931
+ const midpoint = getMidpoint(thumbEl);
932
+ const distance = Math.abs(fingerCoords[axis] - midpoint[axis]);
933
+ if (minDistance === undefined || distance <= minDistance) {
934
+ closestThumbIndex = i;
935
+ minDistance = distance;
936
+ }
937
+ }
938
+ }
939
+ }
940
+ if (closestThumbIndex > -1 && closestThumbIndex !== pressedThumbIndex) {
941
+ updatePressedThumb(closestThumbIndex);
942
+ }
943
+ if (inset) {
944
+ const thumbEl = thumbRefs.current[closestThumbIndex];
945
+ if (isElement(thumbEl)) {
946
+ const thumbRect = thumbEl.getBoundingClientRect();
947
+ const side = !vertical ? "width" : "height";
948
+ insetThumbOffsetRef.current = thumbRect[side] / 2;
949
+ }
950
+ }
951
+ });
952
+ const focusThumb = useStableCallback((thumbIndex) => {
953
+ const input = thumbRefs.current?.[thumbIndex]?.querySelector('input[type="range"]');
954
+ if (!input) {
955
+ return;
956
+ }
957
+ input.focus({
958
+ preventScroll: true,
959
+ focusVisible: false
960
+ });
961
+ });
962
+ const handleTouchMove = useStableCallback((nativeEvent) => {
963
+ const fingerCoords = getFingerCoords(nativeEvent, touchIdRef);
964
+ if (fingerCoords == null) {
965
+ return;
966
+ }
967
+ moveCountRef.current += 1;
968
+ if (nativeEvent.type === "pointermove" && nativeEvent.buttons === 0) {
969
+ handleTouchEnd(nativeEvent);
970
+ return;
971
+ }
972
+ const finger = getFingerState(fingerCoords);
973
+ if (finger == null) {
974
+ return;
975
+ }
976
+ if (validateMinimumDistance(finger.value, step, minStepsBetweenValues)) {
977
+ if (!dragging && moveCountRef.current > INTENTIONAL_DRAG_COUNT_THRESHOLD) {
978
+ setDragging(true);
979
+ }
980
+ setValue(finger.value, createChangeEventDetails(exports_reason_parts.drag, nativeEvent, undefined, {
981
+ activeThumbIndex: finger.thumbIndex
982
+ }));
983
+ latestValuesRef.current = Array.isArray(finger.value) ? finger.value : [finger.value];
984
+ if (finger.didSwap) {
985
+ focusThumb(finger.thumbIndex);
986
+ }
987
+ }
988
+ });
989
+ function handleTouchEnd(nativeEvent) {
990
+ setActive(-1);
991
+ setDragging(false);
992
+ pressedInputRef.current = null;
993
+ pressedThumbCenterOffsetRef.current = null;
994
+ const fingerCoords = getFingerCoords(nativeEvent, touchIdRef);
995
+ const finger = fingerCoords != null ? getFingerState(fingerCoords) : null;
996
+ if (finger != null) {
997
+ const commitReason = lastChangeReasonRef.current;
998
+ onValueCommitted(lastChangedValueRef.current ?? finger.value, createGenericEventDetails(commitReason, nativeEvent));
999
+ }
1000
+ if ("pointerType" in nativeEvent && controlRef.current?.hasPointerCapture(nativeEvent.pointerId)) {
1001
+ controlRef.current?.releasePointerCapture(nativeEvent.pointerId);
1002
+ }
1003
+ pressedThumbIndexRef.current = -1;
1004
+ touchIdRef.current = null;
1005
+ pressedValuesRef.current = null;
1006
+ stopListening();
1007
+ }
1008
+ const handleTouchStart = useStableCallback((nativeEvent) => {
1009
+ if (disabled) {
1010
+ return;
1011
+ }
1012
+ const touch = nativeEvent.changedTouches[0];
1013
+ if (touch != null) {
1014
+ touchIdRef.current = touch.identifier;
1015
+ }
1016
+ const fingerCoords = getFingerCoords(nativeEvent, touchIdRef);
1017
+ if (fingerCoords != null) {
1018
+ startPressing(fingerCoords);
1019
+ const finger = getFingerState(fingerCoords);
1020
+ if (finger == null) {
1021
+ return;
1022
+ }
1023
+ focusThumb(finger.thumbIndex);
1024
+ setValue(finger.value, createChangeEventDetails(exports_reason_parts.trackPress, nativeEvent, undefined, {
1025
+ activeThumbIndex: finger.thumbIndex
1026
+ }));
1027
+ latestValuesRef.current = Array.isArray(finger.value) ? finger.value : [finger.value];
1028
+ if (finger.didSwap) {
1029
+ focusThumb(finger.thumbIndex);
1030
+ }
1031
+ }
1032
+ moveCountRef.current = 0;
1033
+ const doc = ownerDocument(controlRef.current);
1034
+ doc.addEventListener("touchmove", handleTouchMove, {
1035
+ passive: true
1036
+ });
1037
+ doc.addEventListener("touchend", handleTouchEnd, {
1038
+ passive: true
1039
+ });
1040
+ });
1041
+ const stopListening = useStableCallback(() => {
1042
+ const doc = ownerDocument(controlRef.current);
1043
+ doc.removeEventListener("pointermove", handleTouchMove);
1044
+ doc.removeEventListener("pointerup", handleTouchEnd);
1045
+ doc.removeEventListener("touchmove", handleTouchMove);
1046
+ doc.removeEventListener("touchend", handleTouchEnd);
1047
+ pressedValuesRef.current = null;
1048
+ });
1049
+ const focusFrame = useAnimationFrame();
1050
+ React5.useEffect(() => {
1051
+ const control = controlRef.current;
1052
+ if (!control) {
1053
+ return () => stopListening();
1054
+ }
1055
+ const unsubscribeTouchStart = addEventListener(control, "touchstart", handleTouchStart, {
1056
+ passive: true
1057
+ });
1058
+ return () => {
1059
+ unsubscribeTouchStart();
1060
+ focusFrame.cancel();
1061
+ stopListening();
1062
+ };
1063
+ }, [stopListening, handleTouchStart, controlRef, focusFrame]);
1064
+ React5.useEffect(() => {
1065
+ if (disabled) {
1066
+ stopListening();
1067
+ }
1068
+ }, [disabled, stopListening]);
1069
+ const element = useRenderElement("div", componentProps, {
1070
+ state,
1071
+ ref: [forwardedRef, registerFieldControlRef, controlRef, setStylesRef],
1072
+ props: [{
1073
+ ["data-base-ui-slider-control"]: renderBeforeHydration ? "" : undefined,
1074
+ onPointerDown(event) {
1075
+ const control = controlRef.current;
1076
+ const target = getTarget(event.nativeEvent);
1077
+ if (!control || disabled || event.defaultPrevented || !isElement(target) || event.button !== 0) {
1078
+ return;
1079
+ }
1080
+ const fingerCoords = getFingerCoords(event, touchIdRef);
1081
+ if (fingerCoords != null) {
1082
+ startPressing(fingerCoords);
1083
+ const finger = getFingerState(fingerCoords);
1084
+ if (finger == null) {
1085
+ return;
1086
+ }
1087
+ const pressedOnFocusedThumb = contains(thumbRefs.current[finger.thumbIndex], activeElement(ownerDocument(control)));
1088
+ if (pressedOnFocusedThumb) {
1089
+ event.preventDefault();
1090
+ } else {
1091
+ focusFrame.request(() => {
1092
+ focusThumb(finger.thumbIndex);
1093
+ });
1094
+ }
1095
+ setDragging(true);
1096
+ const pressedOnAnyThumb = pressedThumbCenterOffsetRef.current != null;
1097
+ if (!pressedOnAnyThumb) {
1098
+ setValue(finger.value, createChangeEventDetails(exports_reason_parts.trackPress, event.nativeEvent, undefined, {
1099
+ activeThumbIndex: finger.thumbIndex
1100
+ }));
1101
+ latestValuesRef.current = Array.isArray(finger.value) ? finger.value : [finger.value];
1102
+ if (finger.didSwap) {
1103
+ focusThumb(finger.thumbIndex);
1104
+ }
1105
+ }
1106
+ }
1107
+ if (event.nativeEvent.pointerId) {
1108
+ control.setPointerCapture(event.nativeEvent.pointerId);
1109
+ }
1110
+ moveCountRef.current = 0;
1111
+ const doc = ownerDocument(controlRef.current);
1112
+ doc.addEventListener("pointermove", handleTouchMove, {
1113
+ passive: true
1114
+ });
1115
+ doc.addEventListener("pointerup", handleTouchEnd, {
1116
+ once: true
1117
+ });
1118
+ }
1119
+ }, elementProps],
1120
+ stateAttributesMapping: sliderStateAttributesMapping
1121
+ });
1122
+ return element;
1123
+ });
1124
+ if (true)
1125
+ SliderControl.displayName = "SliderControl";
1126
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/track/SliderTrack.js
1127
+ import * as React6 from "react";
1128
+ "use client";
1129
+ var SliderTrack = /* @__PURE__ */ React6.forwardRef(function SliderTrack2(componentProps, forwardedRef) {
1130
+ const {
1131
+ render,
1132
+ className,
1133
+ style,
1134
+ ...elementProps
1135
+ } = componentProps;
1136
+ const {
1137
+ state
1138
+ } = useSliderRootContext();
1139
+ const element = useRenderElement("div", componentProps, {
1140
+ state,
1141
+ ref: forwardedRef,
1142
+ props: [{
1143
+ style: {
1144
+ position: "relative"
1145
+ }
1146
+ }, elementProps],
1147
+ stateAttributesMapping: sliderStateAttributesMapping
1148
+ });
1149
+ return element;
1150
+ });
1151
+ if (true)
1152
+ SliderTrack.displayName = "SliderTrack";
1153
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/thumb/SliderThumb.js
1154
+ import * as React7 from "react";
1155
+
1156
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/thumb/SliderThumbDataAttributes.js
1157
+ var SliderThumbDataAttributes = /* @__PURE__ */ function(SliderThumbDataAttributes2) {
1158
+ SliderThumbDataAttributes2["index"] = "data-index";
1159
+ SliderThumbDataAttributes2["dragging"] = "data-dragging";
1160
+ SliderThumbDataAttributes2["orientation"] = "data-orientation";
1161
+ SliderThumbDataAttributes2["disabled"] = "data-disabled";
1162
+ SliderThumbDataAttributes2["valid"] = "data-valid";
1163
+ SliderThumbDataAttributes2["invalid"] = "data-invalid";
1164
+ SliderThumbDataAttributes2["touched"] = "data-touched";
1165
+ SliderThumbDataAttributes2["dirty"] = "data-dirty";
1166
+ SliderThumbDataAttributes2["focused"] = "data-focused";
1167
+ return SliderThumbDataAttributes2;
1168
+ }({});
1169
+
1170
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/thumb/prehydrationScript.min.js
1171
+ var script = '!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();';
1172
+
1173
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/thumb/SliderThumb.js
1174
+ import { jsx as _jsx2, jsxs as _jsxs } from "react/jsx-runtime";
1175
+ "use client";
1176
+ var ALL_KEYS = new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END, PAGE_UP, PAGE_DOWN]);
1177
+ function getDefaultAriaValueText(values, index, format, locale) {
1178
+ if (index < 0) {
1179
+ return;
1180
+ }
1181
+ if (values.length === 2) {
1182
+ if (index === 0) {
1183
+ return `${formatNumber(values[index], locale, format)} start range`;
1184
+ }
1185
+ return `${formatNumber(values[index], locale, format)} end range`;
1186
+ }
1187
+ return format ? formatNumber(values[index], locale, format) : undefined;
1188
+ }
1189
+ function getNewValue(thumbValue, increment, direction, min, max) {
1190
+ const value = direction === 1 ? thumbValue + increment : thumbValue - increment;
1191
+ const roundedValue = Number(value.toFixed(Math.max(getDecimalPrecision(thumbValue), getDecimalPrecision(increment), getDecimalPrecision(min))));
1192
+ return clamp(roundedValue, min, max);
1193
+ }
1194
+ var SliderThumb = /* @__PURE__ */ React7.forwardRef(function SliderThumb2(componentProps, forwardedRef) {
1195
+ const {
1196
+ render,
1197
+ children: childrenProp,
1198
+ className,
1199
+ "aria-describedby": ariaDescribedByProp,
1200
+ "aria-label": ariaLabelProp,
1201
+ "aria-labelledby": ariaLabelledByProp,
1202
+ disabled: disabledProp = false,
1203
+ getAriaLabel: getAriaLabelProp,
1204
+ getAriaValueText: getAriaValueTextProp,
1205
+ id: idProp,
1206
+ index: indexProp,
1207
+ inputRef: inputRefProp,
1208
+ onBlur: onBlurProp,
1209
+ onFocus: onFocusProp,
1210
+ onKeyDown: onKeyDownProp,
1211
+ tabIndex: tabIndexProp,
1212
+ style,
1213
+ ...elementProps
1214
+ } = componentProps;
1215
+ const {
1216
+ nonce
1217
+ } = useCSPContext();
1218
+ const id = useBaseUiId(idProp);
1219
+ const {
1220
+ active: activeIndex,
1221
+ lastUsedThumbIndex,
1222
+ controlRef,
1223
+ disabled: contextDisabled,
1224
+ validation,
1225
+ formatOptionsRef,
1226
+ handleInputChange,
1227
+ inset,
1228
+ labelId,
1229
+ largeStep,
1230
+ locale,
1231
+ max,
1232
+ min,
1233
+ minStepsBetweenValues,
1234
+ form,
1235
+ name,
1236
+ orientation,
1237
+ pressedInputRef,
1238
+ pressedThumbCenterOffsetRef,
1239
+ pressedThumbIndexRef,
1240
+ renderBeforeHydration,
1241
+ setActive,
1242
+ setIndicatorPosition,
1243
+ state,
1244
+ step,
1245
+ values: sliderValues
1246
+ } = useSliderRootContext();
1247
+ const direction = useDirection();
1248
+ const disabled = disabledProp || contextDisabled;
1249
+ const range = sliderValues.length > 1;
1250
+ const vertical = orientation === "vertical";
1251
+ const rtl = direction === "rtl";
1252
+ const {
1253
+ setTouched,
1254
+ setFocused,
1255
+ validationMode
1256
+ } = useFieldRootContext();
1257
+ const thumbRef = React7.useRef(null);
1258
+ const inputRef = React7.useRef(null);
1259
+ const restoringFocusVisibleRef = React7.useRef(false);
1260
+ const defaultInputId = useBaseUiId();
1261
+ const labelableId = useLabelableId();
1262
+ const inputId = range ? defaultInputId : labelableId;
1263
+ const thumbMetadata = React7.useMemo(() => ({
1264
+ inputId
1265
+ }), [inputId]);
1266
+ const {
1267
+ ref: listItemRef,
1268
+ index: compositeIndex
1269
+ } = useCompositeListItem({
1270
+ metadata: thumbMetadata
1271
+ });
1272
+ const index = !range ? 0 : indexProp ?? compositeIndex;
1273
+ const last = index === sliderValues.length - 1;
1274
+ const thumbValue = sliderValues[index];
1275
+ const thumbValuePercent = valueToPercent(thumbValue, min, max);
1276
+ const [positionPercent, setPositionPercent] = React7.useState();
1277
+ const isHydrating = useIsHydrating();
1278
+ const safeLastUsedThumbIndex = lastUsedThumbIndex >= 0 && lastUsedThumbIndex < sliderValues.length ? lastUsedThumbIndex : -1;
1279
+ const getInsetPosition = useStableCallback(() => {
1280
+ const control = controlRef.current;
1281
+ const thumb = thumbRef.current;
1282
+ if (!control || !thumb) {
1283
+ return;
1284
+ }
1285
+ const thumbRect = thumb.getBoundingClientRect();
1286
+ const controlRect = control.getBoundingClientRect();
1287
+ const side = vertical ? "height" : "width";
1288
+ const controlSize = controlRect[side] - thumbRect[side];
1289
+ const thumbOffsetFromControlEdge = thumbRect[side] / 2 + controlSize * thumbValuePercent / 100;
1290
+ const nextPositionPercent = thumbOffsetFromControlEdge / controlRect[side] * 100;
1291
+ const nextInsetPosition = Number.isFinite(nextPositionPercent) ? nextPositionPercent : undefined;
1292
+ setPositionPercent(nextInsetPosition);
1293
+ if (index === 0) {
1294
+ setIndicatorPosition((prevPosition) => [nextInsetPosition, prevPosition[1]]);
1295
+ } else if (last) {
1296
+ setIndicatorPosition((prevPosition) => [prevPosition[0], nextInsetPosition]);
1297
+ }
1298
+ });
1299
+ useIsoLayoutEffect(() => {
1300
+ if (inset) {
1301
+ queueMicrotask(getInsetPosition);
1302
+ }
1303
+ }, [getInsetPosition, inset]);
1304
+ useIsoLayoutEffect(() => {
1305
+ if (inset) {
1306
+ getInsetPosition();
1307
+ }
1308
+ }, [getInsetPosition, inset, thumbValuePercent]);
1309
+ useIsoLayoutEffect(() => {
1310
+ if (!inset || typeof ResizeObserver !== "function") {
1311
+ return;
1312
+ }
1313
+ const control = controlRef.current;
1314
+ const thumb = thumbRef.current;
1315
+ if (!control || !thumb) {
1316
+ return;
1317
+ }
1318
+ const resizeObserver = new ResizeObserver(getInsetPosition);
1319
+ resizeObserver.observe(control);
1320
+ resizeObserver.observe(thumb);
1321
+ return () => {
1322
+ resizeObserver.disconnect();
1323
+ };
1324
+ }, [controlRef, getInsetPosition, inset]);
1325
+ const getThumbStyle = React7.useCallback(() => {
1326
+ const startEdge = vertical ? "bottom" : "insetInlineStart";
1327
+ const crossOffsetProperty = vertical ? "left" : "top";
1328
+ let zIndex;
1329
+ if (range) {
1330
+ if (activeIndex === index) {
1331
+ zIndex = 2;
1332
+ } else if (safeLastUsedThumbIndex === index) {
1333
+ zIndex = 1;
1334
+ }
1335
+ } else if (activeIndex === index) {
1336
+ zIndex = 1;
1337
+ }
1338
+ if (!inset) {
1339
+ if (!Number.isFinite(thumbValuePercent)) {
1340
+ return visuallyHidden;
1341
+ }
1342
+ return {
1343
+ position: "absolute",
1344
+ [startEdge]: `${thumbValuePercent}%`,
1345
+ [crossOffsetProperty]: "50%",
1346
+ translate: `${(vertical || !rtl ? -1 : 1) * 50}% ${(vertical ? 1 : -1) * 50}%`,
1347
+ zIndex
1348
+ };
1349
+ }
1350
+ return {
1351
+ ["--position"]: `${positionPercent ?? 0}%`,
1352
+ visibility: renderBeforeHydration && isHydrating || positionPercent === undefined ? "hidden" : undefined,
1353
+ position: "absolute",
1354
+ [startEdge]: "var(--position)",
1355
+ [crossOffsetProperty]: "50%",
1356
+ translate: `${(vertical || !rtl ? -1 : 1) * 50}% ${(vertical ? 1 : -1) * 50}%`,
1357
+ zIndex
1358
+ };
1359
+ }, [activeIndex, index, inset, isHydrating, positionPercent, range, renderBeforeHydration, rtl, safeLastUsedThumbIndex, thumbValuePercent, vertical]);
1360
+ let cssWritingMode;
1361
+ if (orientation === "vertical") {
1362
+ cssWritingMode = rtl ? "vertical-rl" : "vertical-lr";
1363
+ }
1364
+ const ariaLabel = typeof getAriaLabelProp === "function" ? getAriaLabelProp(index) : ariaLabelProp;
1365
+ const inputProps = mergeProps({
1366
+ "aria-label": ariaLabel,
1367
+ "aria-labelledby": ariaLabelledByProp ?? (ariaLabel == null ? labelId : undefined),
1368
+ "aria-describedby": ariaDescribedByProp,
1369
+ "aria-orientation": orientation,
1370
+ "aria-valuenow": thumbValue,
1371
+ "aria-valuetext": typeof getAriaValueTextProp === "function" ? getAriaValueTextProp(formatNumber(thumbValue, locale, formatOptionsRef.current ?? undefined), thumbValue, index) : getDefaultAriaValueText(sliderValues, index, formatOptionsRef.current ?? undefined, locale),
1372
+ disabled,
1373
+ form,
1374
+ id: inputId,
1375
+ max,
1376
+ min,
1377
+ name,
1378
+ onChange(event) {
1379
+ handleInputChange(event.currentTarget.valueAsNumber, index, event);
1380
+ },
1381
+ onFocus(event) {
1382
+ const isRestoringFocusVisible = restoringFocusVisibleRef.current;
1383
+ restoringFocusVisibleRef.current = false;
1384
+ setActive(index);
1385
+ setFocused(true);
1386
+ if (isRestoringFocusVisible) {
1387
+ event.stopPropagation();
1388
+ }
1389
+ },
1390
+ onBlur(event) {
1391
+ if (restoringFocusVisibleRef.current) {
1392
+ event.stopPropagation();
1393
+ return;
1394
+ }
1395
+ if (!thumbRef.current) {
1396
+ return;
1397
+ }
1398
+ setActive(-1);
1399
+ setTouched(true);
1400
+ setFocused(false);
1401
+ if (validationMode === "onBlur") {
1402
+ validation.commit(getSliderValue(thumbValue, index, min, max, range, sliderValues));
1403
+ }
1404
+ },
1405
+ onKeyDown(event) {
1406
+ if (!ALL_KEYS.has(event.key)) {
1407
+ return;
1408
+ }
1409
+ if (COMPOSITE_KEYS.has(event.key)) {
1410
+ event.stopPropagation();
1411
+ }
1412
+ let newValue = null;
1413
+ const roundedValue = roundValueToStep(thumbValue, step, min);
1414
+ switch (event.key) {
1415
+ case ARROW_UP:
1416
+ newValue = getNewValue(roundedValue, event.shiftKey ? largeStep : step, 1, min, max);
1417
+ break;
1418
+ case ARROW_RIGHT:
1419
+ newValue = getNewValue(roundedValue, event.shiftKey ? largeStep : step, rtl ? -1 : 1, min, max);
1420
+ break;
1421
+ case ARROW_DOWN:
1422
+ newValue = getNewValue(roundedValue, event.shiftKey ? largeStep : step, -1, min, max);
1423
+ break;
1424
+ case ARROW_LEFT:
1425
+ newValue = getNewValue(roundedValue, event.shiftKey ? largeStep : step, rtl ? 1 : -1, min, max);
1426
+ break;
1427
+ case PAGE_UP:
1428
+ newValue = getNewValue(roundedValue, largeStep, 1, min, max);
1429
+ break;
1430
+ case PAGE_DOWN:
1431
+ newValue = getNewValue(roundedValue, largeStep, -1, min, max);
1432
+ break;
1433
+ case END:
1434
+ newValue = max;
1435
+ if (range) {
1436
+ newValue = Number.isFinite(sliderValues[index + 1]) ? sliderValues[index + 1] - step * minStepsBetweenValues : max;
1437
+ }
1438
+ break;
1439
+ case HOME:
1440
+ newValue = min;
1441
+ if (range) {
1442
+ newValue = Number.isFinite(sliderValues[index - 1]) ? sliderValues[index - 1] + step * minStepsBetweenValues : min;
1443
+ }
1444
+ break;
1445
+ default:
1446
+ break;
1447
+ }
1448
+ if (newValue !== null) {
1449
+ const input = event.currentTarget;
1450
+ if (!matchesFocusVisible(input)) {
1451
+ restoringFocusVisibleRef.current = true;
1452
+ input.blur();
1453
+ input.focus({
1454
+ preventScroll: true,
1455
+ focusVisible: true
1456
+ });
1457
+ }
1458
+ handleInputChange(newValue, index, event);
1459
+ event.preventDefault();
1460
+ }
1461
+ },
1462
+ step,
1463
+ style: {
1464
+ ...visuallyHidden,
1465
+ width: "100%",
1466
+ height: "100%",
1467
+ writingMode: cssWritingMode
1468
+ },
1469
+ tabIndex: tabIndexProp ?? undefined,
1470
+ type: "range",
1471
+ value: thumbValue ?? ""
1472
+ }, validation.getInputValidationProps);
1473
+ const mergedInputRef = useMergedRefs(inputRef, validation.inputRef, inputRefProp);
1474
+ const element = useRenderElement("div", componentProps, {
1475
+ state,
1476
+ ref: [forwardedRef, listItemRef, thumbRef],
1477
+ props: [{
1478
+ [SliderThumbDataAttributes.index]: index,
1479
+ children: /* @__PURE__ */ _jsxs(React7.Fragment, {
1480
+ children: [childrenProp, /* @__PURE__ */ _jsx2("input", {
1481
+ ref: mergedInputRef,
1482
+ ...inputProps,
1483
+ suppressHydrationWarning: true
1484
+ }), inset && isHydrating && renderBeforeHydration && last && /* @__PURE__ */ _jsx2("script", {
1485
+ nonce,
1486
+ dangerouslySetInnerHTML: {
1487
+ __html: script
1488
+ },
1489
+ suppressHydrationWarning: true
1490
+ })]
1491
+ }),
1492
+ id,
1493
+ onBlur: onBlurProp,
1494
+ onFocus: onFocusProp,
1495
+ onPointerDown(event) {
1496
+ pressedThumbIndexRef.current = index;
1497
+ if (thumbRef.current != null) {
1498
+ const axis = orientation === "horizontal" ? "x" : "y";
1499
+ const midpoint = getMidpoint(thumbRef.current);
1500
+ const offset = (orientation === "horizontal" ? event.clientX : event.clientY) - midpoint[axis];
1501
+ pressedThumbCenterOffsetRef.current = offset;
1502
+ }
1503
+ if (inputRef.current != null && pressedInputRef.current !== inputRef.current) {
1504
+ pressedInputRef.current = inputRef.current;
1505
+ }
1506
+ },
1507
+ style: getThumbStyle(),
1508
+ suppressHydrationWarning: renderBeforeHydration || undefined
1509
+ }, elementProps],
1510
+ stateAttributesMapping: sliderStateAttributesMapping
1511
+ });
1512
+ return element;
1513
+ });
1514
+ if (true)
1515
+ SliderThumb.displayName = "SliderThumb";
1516
+ // node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/slider/indicator/SliderIndicator.js
1517
+ import * as React8 from "react";
1518
+ "use client";
1519
+ function getInsetStyles(vertical, range, start, end, renderBeforeHydration, hydrating) {
1520
+ const visibility = start === undefined || range && end === undefined ? "hidden" : undefined;
1521
+ const startEdge = vertical ? "bottom" : "insetInlineStart";
1522
+ const mainSide = vertical ? "height" : "width";
1523
+ const crossSide = vertical ? "width" : "height";
1524
+ const styles = {
1525
+ visibility: renderBeforeHydration && hydrating ? "hidden" : visibility,
1526
+ position: vertical ? "absolute" : "relative",
1527
+ [crossSide]: "inherit"
1528
+ };
1529
+ styles["--start-position"] = `${start ?? 0}%`;
1530
+ if (!range) {
1531
+ styles[startEdge] = 0;
1532
+ styles[mainSide] = "var(--start-position)";
1533
+ return styles;
1534
+ }
1535
+ styles["--relative-size"] = `${(end ?? 0) - (start ?? 0)}%`;
1536
+ styles[startEdge] = "var(--start-position)";
1537
+ styles[mainSide] = "var(--relative-size)";
1538
+ return styles;
1539
+ }
1540
+ function getCenteredStyles(vertical, range, start, end) {
1541
+ const startEdge = vertical ? "bottom" : "insetInlineStart";
1542
+ const mainSide = vertical ? "height" : "width";
1543
+ const crossSide = vertical ? "width" : "height";
1544
+ const styles = {
1545
+ position: vertical ? "absolute" : "relative",
1546
+ [crossSide]: "inherit"
1547
+ };
1548
+ if (!range) {
1549
+ styles[startEdge] = 0;
1550
+ styles[mainSide] = `${start}%`;
1551
+ return styles;
1552
+ }
1553
+ const size = end - start;
1554
+ styles[startEdge] = `${start}%`;
1555
+ styles[mainSide] = `${size}%`;
1556
+ return styles;
1557
+ }
1558
+ var SliderIndicator = /* @__PURE__ */ React8.forwardRef(function SliderIndicator2(componentProps, forwardedRef) {
1559
+ const {
1560
+ render,
1561
+ className,
1562
+ style: styleProp,
1563
+ ...elementProps
1564
+ } = componentProps;
1565
+ const {
1566
+ indicatorPosition,
1567
+ inset,
1568
+ max,
1569
+ min,
1570
+ orientation,
1571
+ renderBeforeHydration,
1572
+ state,
1573
+ values
1574
+ } = useSliderRootContext();
1575
+ const isHydrating = useIsHydrating();
1576
+ const vertical = orientation === "vertical";
1577
+ const range = values.length > 1;
1578
+ const style = inset ? getInsetStyles(vertical, range, indicatorPosition[0], indicatorPosition[1], renderBeforeHydration, isHydrating) : getCenteredStyles(vertical, range, valueToPercent(values[0], min, max), valueToPercent(values[values.length - 1], min, max));
1579
+ const element = useRenderElement("div", componentProps, {
1580
+ state,
1581
+ ref: forwardedRef,
1582
+ props: [{
1583
+ ["data-base-ui-slider-indicator"]: renderBeforeHydration ? "" : undefined,
1584
+ style,
1585
+ suppressHydrationWarning: renderBeforeHydration || undefined
1586
+ }, elementProps],
1587
+ stateAttributesMapping: sliderStateAttributesMapping
1588
+ });
1589
+ return element;
1590
+ });
1591
+ if (true)
1592
+ SliderIndicator.displayName = "SliderIndicator";
1593
+ export {
1594
+ exports_index_parts as Slider
1595
+ };