@orioncactuscorp/ui 1.8.0 → 1.9.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.
- package/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +698 -547
- package/dist/components/Modal/bottomSheetGeometry.js +88 -0
- package/dist/components/Modal/modalScrollArbitration.js +9 -7
- package/dist/components/Modal/snapPoints.js +9 -8
- package/dist/components/Modal/useModalContentBlockTransition.js +64 -0
- package/dist/components/Modal/useModalDrag.js +979 -784
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +250 -223
- package/dist/components/ScrollArea/useScrollAreaGeometryStabilizer.js +36 -0
- package/dist/components/TextButton/TextButton.css +1 -1
- package/dist/components/TextButton/TextButton.module.scss.js +8 -6
- package/dist/styles.css +7 -7
- package/dist/ui/src/components/Modal/Modal.d.ts +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/bottomSheetGeometry.d.ts +36 -0
- package/dist/ui/src/components/Modal/bottomSheetGeometry.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/index.d.ts +1 -1
- package/dist/ui/src/components/Modal/index.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts +6 -1
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/snapPoints.d.ts +1 -0
- package/dist/ui/src/components/Modal/snapPoints.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +8 -0
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts +5 -0
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalDrag.d.ts +5 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/useScrollAreaGeometryStabilizer.d.ts +11 -0
- package/dist/ui/src/components/ScrollArea/useScrollAreaGeometryStabilizer.d.ts.map +1 -0
- package/package.json +2 -1
- package/src/scss/mixins/_element.scss +161 -14
- package/src/scss/mixins/_element.test.ts +94 -5
- package/src/scss/mixins/_icon.scss +27 -0
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { ocSpring as
|
|
3
|
-
import { resolveOcMotion as
|
|
4
|
-
import { resolveModalPopupSnapPositions as
|
|
5
|
-
import { setModalBodyTouchScrollLock as
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { useRef as w, useLayoutEffect as ot, useCallback as p, useEffect as It } from "react";
|
|
2
|
+
import { ocSpring as Ze } from "../../utils/spring.js";
|
|
3
|
+
import { resolveOcMotion as zt } from "../../utils/motion.js";
|
|
4
|
+
import { resolveModalPopupSnapPositions as qe } from "./snapPoints.js";
|
|
5
|
+
import { setModalBodyTouchScrollLock as Ut, shouldLockModalBodyTouchScroll as tr, shouldIgnoreDragTarget as Wt, getScrollableAncestor as er, hasActiveTextSelection as rr, getBottomTouchDragDecision as nr, getPopupTouchDragDecision as or } from "./modalScrollArbitration.js";
|
|
6
|
+
import { resolveResizedBottomSheetTranslate as ar, resolveBottomSheetRestState as sr } from "./bottomSheetGeometry.js";
|
|
7
|
+
import { createSpringAnimator as Gt } from "../../utils/spring/animator.js";
|
|
8
|
+
const F = {
|
|
8
9
|
dragStartThresholdPx: {
|
|
9
10
|
touch: 10,
|
|
10
11
|
mouse: 2
|
|
11
12
|
},
|
|
13
|
+
// Mouse drags on body content arbitrate against native text selection: the
|
|
14
|
+
// gesture drives the sheet only once it is clearly vertical past this
|
|
15
|
+
// distance, otherwise the browser keeps its selection behavior.
|
|
16
|
+
selectionArbitrationThresholdPx: 12,
|
|
12
17
|
releaseVelocity: {
|
|
13
18
|
sampleWindowMs: 90,
|
|
14
19
|
maxPxPerSecond: 4e3,
|
|
@@ -35,50 +40,50 @@ const M = {
|
|
|
35
40
|
popupDragFollower: {
|
|
36
41
|
settleDurationFactor: 1 / 6
|
|
37
42
|
}
|
|
38
|
-
},
|
|
39
|
-
duration:
|
|
40
|
-
}),
|
|
41
|
-
function
|
|
43
|
+
}, ir = Ze.snappy({
|
|
44
|
+
duration: F.settleSpring.durationSeconds * F.popupDragFollower.settleDurationFactor
|
|
45
|
+
}), lr = [], cr = [];
|
|
46
|
+
function Ye(r) {
|
|
42
47
|
r.cancelable !== !1 && r.preventDefault();
|
|
43
48
|
}
|
|
44
|
-
function
|
|
49
|
+
function A(r, n, i) {
|
|
45
50
|
return Math.min(Math.max(r, n), i);
|
|
46
51
|
}
|
|
47
|
-
function
|
|
52
|
+
function Me(r) {
|
|
48
53
|
return [...new Set(r)].sort((n, i) => n - i);
|
|
49
54
|
}
|
|
50
|
-
function
|
|
55
|
+
function ur(r, n) {
|
|
51
56
|
return r.reduce(
|
|
52
|
-
(i,
|
|
57
|
+
(i, o) => Math.abs(o - n) < Math.abs(i - n) ? o : i
|
|
53
58
|
);
|
|
54
59
|
}
|
|
55
|
-
function
|
|
60
|
+
function Ee({
|
|
56
61
|
deltaX: r,
|
|
57
62
|
deltaY: n,
|
|
58
63
|
placement: i
|
|
59
64
|
}) {
|
|
60
65
|
return i === "bottom" ? Math.abs(n) : Math.hypot(r, n);
|
|
61
66
|
}
|
|
62
|
-
function
|
|
67
|
+
function dr(r, n, i) {
|
|
63
68
|
if (i === "down")
|
|
64
69
|
return r.find((l) => l > n + 1) ?? r[r.length - 1] ?? 0;
|
|
65
70
|
for (let l = r.length - 1; l >= 0; l -= 1) {
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
return
|
|
71
|
+
const h = r[l];
|
|
72
|
+
if (h !== void 0 && h < n - 1)
|
|
73
|
+
return h;
|
|
69
74
|
}
|
|
70
75
|
return r[0] ?? 0;
|
|
71
76
|
}
|
|
72
|
-
function
|
|
73
|
-
const y =
|
|
74
|
-
if (
|
|
77
|
+
function pr(r, n, i, o, l = i) {
|
|
78
|
+
const y = dr(r, n, o), T = o === "down" ? Math.max(i, l) : Math.min(i, l);
|
|
79
|
+
if (o === "down") {
|
|
75
80
|
if (r.filter(
|
|
76
|
-
(
|
|
81
|
+
($) => $ > n + 1 && $ <= i + 1
|
|
77
82
|
).length === 0) return y;
|
|
78
|
-
const
|
|
79
|
-
(
|
|
83
|
+
const tt = r.filter(
|
|
84
|
+
($) => $ > n + 1 && $ <= T + 1
|
|
80
85
|
);
|
|
81
|
-
return
|
|
86
|
+
return tt[tt.length - 1] ?? y;
|
|
82
87
|
}
|
|
83
88
|
return r.filter(
|
|
84
89
|
(L) => L < n - 1 && L >= i - 1
|
|
@@ -86,78 +91,78 @@ function Re(r, n, i, a, l = i) {
|
|
|
86
91
|
(L) => L < n - 1 && L >= T - 1
|
|
87
92
|
)[0] ?? y;
|
|
88
93
|
}
|
|
89
|
-
function
|
|
94
|
+
function be(r, n) {
|
|
90
95
|
if (n <= 0) return 0;
|
|
91
|
-
const i = n, { resistance:
|
|
92
|
-
return r *
|
|
96
|
+
const i = n, { resistance: o } = F.rubberBand;
|
|
97
|
+
return r * o * i / (i + o * r);
|
|
93
98
|
}
|
|
94
|
-
function
|
|
99
|
+
function Kt({
|
|
95
100
|
targetTranslate: r,
|
|
96
101
|
minTranslate: n,
|
|
97
102
|
maxTranslate: i,
|
|
98
|
-
minBoundaryLimit:
|
|
103
|
+
minBoundaryLimit: o,
|
|
99
104
|
maxBoundaryLimit: l
|
|
100
105
|
}) {
|
|
101
|
-
return r < n ? n -
|
|
106
|
+
return r < n ? n - be(n - r, o) : r > i ? i + be(r - i, l) : r;
|
|
102
107
|
}
|
|
103
|
-
function
|
|
108
|
+
function Le(r) {
|
|
104
109
|
return typeof Element > "u" || !(r instanceof Element) ? !1 : !!r.closest('[data-oc-part="handle"], [data-oc-part="header"]');
|
|
105
110
|
}
|
|
106
|
-
function
|
|
111
|
+
function ke(r) {
|
|
107
112
|
return typeof Element > "u" || !(r instanceof Element) ? !1 : !!r.closest(
|
|
108
113
|
'[data-oc-part="handle"], [data-oc-component="modal-navigation"]'
|
|
109
114
|
);
|
|
110
115
|
}
|
|
111
|
-
function
|
|
116
|
+
function fr(r) {
|
|
112
117
|
return typeof Element > "u" || !(r instanceof Element) ? !1 : !!r.closest('[data-oc-component="modal-navigation"]');
|
|
113
118
|
}
|
|
114
|
-
function
|
|
119
|
+
function gr(r) {
|
|
115
120
|
return typeof Element > "u" || !(r instanceof Element) ? null : r.closest('[data-oc-component="modal-navigation"]');
|
|
116
121
|
}
|
|
117
|
-
function
|
|
122
|
+
function mr(r, n) {
|
|
118
123
|
return n ? !0 : r.pointerType ? r.pointerType === "touch" : typeof window > "u" ? !1 : window.matchMedia?.("(pointer: coarse)").matches ?? !1;
|
|
119
124
|
}
|
|
120
|
-
function
|
|
125
|
+
function Ce(r, n) {
|
|
121
126
|
if (!r.length)
|
|
122
127
|
return {
|
|
123
128
|
minTranslate: 0,
|
|
124
129
|
maxTranslate: 0
|
|
125
130
|
};
|
|
126
|
-
const i = r.map((
|
|
127
|
-
if (Math.abs(l -
|
|
128
|
-
const
|
|
131
|
+
const i = r.map((h) => h[n]), o = Math.min(...i), l = Math.max(...i);
|
|
132
|
+
if (Math.abs(l - o) < 0.5) {
|
|
133
|
+
const h = (o + l) / 2;
|
|
129
134
|
return {
|
|
130
|
-
minTranslate:
|
|
131
|
-
maxTranslate:
|
|
135
|
+
minTranslate: h,
|
|
136
|
+
maxTranslate: h
|
|
132
137
|
};
|
|
133
138
|
}
|
|
134
139
|
return {
|
|
135
|
-
minTranslate:
|
|
140
|
+
minTranslate: o,
|
|
136
141
|
maxTranslate: l
|
|
137
142
|
};
|
|
138
143
|
}
|
|
139
|
-
function
|
|
144
|
+
function Fe(r, n) {
|
|
140
145
|
for (let i = 0; i < r.length; i += 1) {
|
|
141
|
-
const
|
|
142
|
-
if (
|
|
146
|
+
const o = "item" in r && typeof r.item == "function" ? r.item(i) : r[i];
|
|
147
|
+
if (o?.identifier === n) return o;
|
|
143
148
|
}
|
|
144
149
|
return null;
|
|
145
150
|
}
|
|
146
|
-
function
|
|
151
|
+
function Re(r) {
|
|
147
152
|
if (!r) return { x: 0, y: 0 };
|
|
148
153
|
const n = window.getComputedStyle(r).transform;
|
|
149
154
|
if (!n || n === "none") return { x: 0, y: 0 };
|
|
150
155
|
const i = n.match(/^matrix\((.+)\)$/);
|
|
151
156
|
if (i) {
|
|
152
|
-
const l = i[1].split(",").map((
|
|
157
|
+
const l = i[1].split(",").map((h) => h.trim());
|
|
153
158
|
return {
|
|
154
159
|
x: Number.parseFloat(l[4] ?? "0") || 0,
|
|
155
160
|
y: Number.parseFloat(l[5] ?? "0") || 0
|
|
156
161
|
};
|
|
157
162
|
}
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
const l =
|
|
163
|
+
const o = n.match(/^matrix3d\((.+)\)$/);
|
|
164
|
+
if (o) {
|
|
165
|
+
const l = o[1].split(",").map((h) => h.trim());
|
|
161
166
|
return {
|
|
162
167
|
x: Number.parseFloat(l[12] ?? "0") || 0,
|
|
163
168
|
y: Number.parseFloat(l[13] ?? "0") || 0
|
|
@@ -165,332 +170,337 @@ function De(r) {
|
|
|
165
170
|
}
|
|
166
171
|
return { x: 0, y: 0 };
|
|
167
172
|
}
|
|
168
|
-
function
|
|
169
|
-
return
|
|
173
|
+
function Jt(r) {
|
|
174
|
+
return Re(r).y;
|
|
170
175
|
}
|
|
171
|
-
function
|
|
172
|
-
return
|
|
176
|
+
function Ae(r) {
|
|
177
|
+
return Re(r);
|
|
173
178
|
}
|
|
174
|
-
function
|
|
179
|
+
function yt(r) {
|
|
175
180
|
if (!r || !/^-?\d*\.?\d+(?:px)?$/.test(r.trim())) return;
|
|
176
181
|
const n = Number.parseFloat(r);
|
|
177
182
|
return Number.isFinite(n) ? n : void 0;
|
|
178
183
|
}
|
|
179
|
-
function
|
|
184
|
+
function Z() {
|
|
180
185
|
return Date.now();
|
|
181
186
|
}
|
|
182
|
-
function
|
|
183
|
-
const i = n -
|
|
187
|
+
function hr(r, n) {
|
|
188
|
+
const i = n - F.releaseVelocity.sampleWindowMs;
|
|
184
189
|
for (; r.length > 2 && (r[1]?.time ?? n) < i; )
|
|
185
190
|
r.shift();
|
|
186
191
|
}
|
|
187
|
-
function
|
|
188
|
-
const i = n.time ??
|
|
192
|
+
function St(r, n) {
|
|
193
|
+
const i = n.time ?? Z();
|
|
189
194
|
r.samples.push({
|
|
190
195
|
time: i,
|
|
191
196
|
pageX: n.pageX,
|
|
192
197
|
pageY: n.pageY,
|
|
193
198
|
translateX: n.translateX,
|
|
194
199
|
translateY: n.translateY
|
|
195
|
-
}),
|
|
200
|
+
}), hr(r.samples, i);
|
|
196
201
|
}
|
|
197
|
-
function
|
|
202
|
+
function Ot(r, n) {
|
|
198
203
|
return {
|
|
199
204
|
x: r.startTranslateX + n.pageX - r.startX,
|
|
200
205
|
y: r.startTranslate + n.pageY - r.startY
|
|
201
206
|
};
|
|
202
207
|
}
|
|
203
|
-
function
|
|
204
|
-
const i =
|
|
205
|
-
|
|
208
|
+
function Be(r, n) {
|
|
209
|
+
const i = Ot(r, n);
|
|
210
|
+
St(r, {
|
|
206
211
|
pageX: n.pageX,
|
|
207
212
|
pageY: n.pageY,
|
|
208
213
|
translateX: i.x,
|
|
209
214
|
translateY: i.y
|
|
210
215
|
});
|
|
211
216
|
}
|
|
212
|
-
function
|
|
217
|
+
function Ie({
|
|
213
218
|
session: r,
|
|
214
219
|
fallbackDeltaY: n,
|
|
215
220
|
fallbackElapsed: i
|
|
216
221
|
}) {
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
const y =
|
|
220
|
-
if (T && T !==
|
|
221
|
-
const D = Math.max(
|
|
222
|
-
if (Number.isFinite(
|
|
223
|
-
return b
|
|
222
|
+
const o = r.samples[r.samples.length - 1], { maxPxPerSecond: l, sampleWindowMs: h } = F.releaseVelocity;
|
|
223
|
+
if (o) {
|
|
224
|
+
const y = o.time - h, T = r.samples.find((D) => D.time >= y) ?? r.samples[0];
|
|
225
|
+
if (T && T !== o) {
|
|
226
|
+
const D = Math.max(o.time - T.time, 1), b = (o.translateY - T.translateY) / D * 1e3;
|
|
227
|
+
if (Number.isFinite(b))
|
|
228
|
+
return A(b, -l, l);
|
|
224
229
|
}
|
|
225
230
|
}
|
|
226
|
-
return
|
|
231
|
+
return A(
|
|
227
232
|
n / Math.max(i, 1) * 1e3,
|
|
228
233
|
-l,
|
|
229
234
|
l
|
|
230
235
|
);
|
|
231
236
|
}
|
|
232
|
-
function
|
|
237
|
+
function Oe({
|
|
233
238
|
session: r,
|
|
234
239
|
fallbackDelta: n,
|
|
235
240
|
fallbackElapsed: i
|
|
236
241
|
}) {
|
|
237
|
-
const
|
|
238
|
-
if (
|
|
239
|
-
const y =
|
|
240
|
-
if (T && T !==
|
|
241
|
-
const D = Math.max(
|
|
242
|
-
x: (
|
|
243
|
-
y: (
|
|
242
|
+
const o = r.samples[r.samples.length - 1], { maxPxPerSecond: l, sampleWindowMs: h } = F.releaseVelocity;
|
|
243
|
+
if (o) {
|
|
244
|
+
const y = o.time - h, T = r.samples.find((D) => D.time >= y) ?? r.samples[0];
|
|
245
|
+
if (T && T !== o) {
|
|
246
|
+
const D = Math.max(o.time - T.time, 1), b = {
|
|
247
|
+
x: (o.translateX - T.translateX) / D * 1e3,
|
|
248
|
+
y: (o.translateY - T.translateY) / D * 1e3
|
|
244
249
|
};
|
|
245
|
-
if (Number.isFinite(
|
|
250
|
+
if (Number.isFinite(b.x) && Number.isFinite(b.y))
|
|
246
251
|
return {
|
|
247
|
-
x: b
|
|
248
|
-
y: b
|
|
252
|
+
x: A(b.x, -l, l),
|
|
253
|
+
y: A(b.y, -l, l)
|
|
249
254
|
};
|
|
250
255
|
}
|
|
251
256
|
}
|
|
252
257
|
return {
|
|
253
|
-
x:
|
|
258
|
+
x: A(
|
|
254
259
|
n.x / Math.max(i, 1) * 1e3,
|
|
255
260
|
-l,
|
|
256
261
|
l
|
|
257
262
|
),
|
|
258
|
-
y:
|
|
263
|
+
y: A(
|
|
259
264
|
n.y / Math.max(i, 1) * 1e3,
|
|
260
265
|
-l,
|
|
261
266
|
l
|
|
262
267
|
)
|
|
263
268
|
};
|
|
264
269
|
}
|
|
265
|
-
function
|
|
270
|
+
function yr({
|
|
266
271
|
currentTranslate: r,
|
|
267
272
|
releaseVelocity: n
|
|
268
273
|
}) {
|
|
269
|
-
const { lookaheadSeconds: i, maxDistancePx:
|
|
270
|
-
return r +
|
|
274
|
+
const { lookaheadSeconds: i, maxDistancePx: o } = F.snapProjection;
|
|
275
|
+
return r + A(n * i, -o, o);
|
|
271
276
|
}
|
|
272
|
-
function
|
|
277
|
+
function Tr({
|
|
273
278
|
currentTranslate: r,
|
|
274
279
|
releaseVelocity: n
|
|
275
280
|
}) {
|
|
276
|
-
const { lookaheadSeconds: i, maxDistancePx:
|
|
281
|
+
const { lookaheadSeconds: i, maxDistancePx: o } = F.snapProjection;
|
|
277
282
|
return {
|
|
278
|
-
x: r.x +
|
|
283
|
+
x: r.x + A(
|
|
279
284
|
n.x * i,
|
|
280
|
-
-
|
|
281
|
-
|
|
285
|
+
-o,
|
|
286
|
+
o
|
|
282
287
|
),
|
|
283
|
-
y: r.y +
|
|
288
|
+
y: r.y + A(
|
|
284
289
|
n.y * i,
|
|
285
|
-
-
|
|
286
|
-
|
|
290
|
+
-o,
|
|
291
|
+
o
|
|
287
292
|
)
|
|
288
293
|
};
|
|
289
294
|
}
|
|
290
|
-
function
|
|
291
|
-
return Math.abs(r) / 1e3 >
|
|
295
|
+
function xr(r) {
|
|
296
|
+
return Math.abs(r) / 1e3 > F.releaseVelocity.flickThresholdPxPerMs;
|
|
292
297
|
}
|
|
293
|
-
function
|
|
294
|
-
return Math.hypot(r.x, r.y) / 1e3 >
|
|
298
|
+
function Pr(r) {
|
|
299
|
+
return Math.hypot(r.x, r.y) / 1e3 > F.releaseVelocity.flickThresholdPxPerMs;
|
|
295
300
|
}
|
|
296
|
-
function
|
|
301
|
+
function q(r, n) {
|
|
297
302
|
return Math.hypot(r.x - n.x, r.y - n.y);
|
|
298
303
|
}
|
|
299
|
-
function
|
|
304
|
+
function Ne(r, n) {
|
|
300
305
|
return r.reduce(
|
|
301
|
-
(i,
|
|
306
|
+
(i, o) => q(o, n) < q(i, n) ? o : i
|
|
302
307
|
);
|
|
303
308
|
}
|
|
304
|
-
function
|
|
309
|
+
function vr({
|
|
305
310
|
currentTranslate: r,
|
|
306
311
|
releaseVelocity: n,
|
|
307
312
|
targets: i
|
|
308
313
|
}) {
|
|
309
|
-
const
|
|
314
|
+
const o = Tr({
|
|
310
315
|
currentTranslate: r,
|
|
311
316
|
releaseVelocity: n
|
|
312
317
|
});
|
|
313
|
-
if (!
|
|
314
|
-
return
|
|
315
|
-
const l = i.filter((
|
|
316
|
-
const y =
|
|
318
|
+
if (!Pr(n))
|
|
319
|
+
return Ne(i, r);
|
|
320
|
+
const l = i.filter((h) => {
|
|
321
|
+
const y = h.x - r.x, T = h.y - r.y;
|
|
317
322
|
return y * n.x + T * n.y > 0;
|
|
318
323
|
});
|
|
319
|
-
return
|
|
324
|
+
return Ne(
|
|
320
325
|
l.length ? l : i,
|
|
321
|
-
|
|
326
|
+
o
|
|
322
327
|
);
|
|
323
328
|
}
|
|
324
|
-
function
|
|
329
|
+
function _e(r) {
|
|
325
330
|
return r === "top" || r.startsWith("top-") ? "top" : r === "bottom" || r.startsWith("bottom-") ? "bottom" : "center";
|
|
326
331
|
}
|
|
327
|
-
function
|
|
332
|
+
function wr({
|
|
328
333
|
target: r,
|
|
329
334
|
targets: n
|
|
330
335
|
}) {
|
|
331
|
-
const i = n.filter((
|
|
336
|
+
const i = n.filter((o) => o !== r);
|
|
332
337
|
if (i.length)
|
|
333
338
|
return i.reduce(
|
|
334
|
-
(
|
|
339
|
+
(o, l) => Math.min(o, q(r, l)),
|
|
335
340
|
Number.POSITIVE_INFINITY
|
|
336
341
|
);
|
|
337
342
|
}
|
|
338
|
-
function
|
|
343
|
+
function Dr({
|
|
339
344
|
closeThreshold: r,
|
|
340
345
|
currentTarget: n,
|
|
341
346
|
surfaceSize: i,
|
|
342
|
-
targets:
|
|
347
|
+
targets: o
|
|
343
348
|
}) {
|
|
344
|
-
const l =
|
|
345
|
-
|
|
346
|
-
|
|
349
|
+
const l = _e(n.key), h = l === "center" ? Math.min(i.width, i.height) : i.height, y = Math.max(
|
|
350
|
+
F.dismissal.minDistancePx,
|
|
351
|
+
h * r
|
|
347
352
|
);
|
|
348
353
|
if (l !== "center") return y;
|
|
349
|
-
const T =
|
|
354
|
+
const T = wr({
|
|
350
355
|
target: n,
|
|
351
|
-
targets:
|
|
356
|
+
targets: o
|
|
352
357
|
});
|
|
353
358
|
return !T || !Number.isFinite(T) ? y : Math.max(y, T * 0.75);
|
|
354
359
|
}
|
|
355
|
-
function
|
|
360
|
+
function Sr({
|
|
356
361
|
currentTarget: r,
|
|
357
362
|
currentTranslate: n
|
|
358
363
|
}) {
|
|
359
|
-
switch (
|
|
364
|
+
switch (_e(r.key)) {
|
|
360
365
|
case "top":
|
|
361
366
|
return r.y - n.y;
|
|
362
367
|
case "bottom":
|
|
363
368
|
return n.y - r.y;
|
|
364
369
|
case "center":
|
|
365
|
-
return
|
|
370
|
+
return q(r, n);
|
|
366
371
|
}
|
|
367
372
|
}
|
|
368
|
-
function
|
|
373
|
+
function Xr({
|
|
369
374
|
closeThreshold: r,
|
|
370
375
|
currentTarget: n,
|
|
371
376
|
currentTranslate: i,
|
|
372
|
-
releaseTarget:
|
|
377
|
+
releaseTarget: o,
|
|
373
378
|
surfaceSize: l,
|
|
374
|
-
targets:
|
|
379
|
+
targets: h
|
|
375
380
|
}) {
|
|
376
|
-
if (
|
|
377
|
-
const y =
|
|
381
|
+
if (o.key !== n.key) return !1;
|
|
382
|
+
const y = Sr({
|
|
378
383
|
currentTarget: n,
|
|
379
384
|
currentTranslate: i
|
|
380
385
|
});
|
|
381
|
-
return y <= 0 ? !1 : y >=
|
|
386
|
+
return y <= 0 ? !1 : y >= Dr({
|
|
382
387
|
closeThreshold: r,
|
|
383
388
|
currentTarget: n,
|
|
384
389
|
surfaceSize: l,
|
|
385
|
-
targets:
|
|
390
|
+
targets: h
|
|
386
391
|
});
|
|
387
392
|
}
|
|
388
|
-
function
|
|
393
|
+
function Yr({
|
|
389
394
|
presentationState: r,
|
|
390
395
|
releaseTranslate: n,
|
|
391
396
|
visibleTranslate: i
|
|
392
397
|
}) {
|
|
393
398
|
return r !== "visible" || Math.abs(n - i) > 1;
|
|
394
399
|
}
|
|
395
|
-
function
|
|
400
|
+
function Mr({
|
|
396
401
|
drag: r,
|
|
397
402
|
placement: n,
|
|
398
403
|
snapPositionCount: i
|
|
399
404
|
}) {
|
|
400
405
|
return n === "popup" && (r === "content" || r === "handle") && i > 0;
|
|
401
406
|
}
|
|
402
|
-
function
|
|
407
|
+
function Er({
|
|
403
408
|
dismissible: r,
|
|
404
409
|
peekTranslate: n,
|
|
405
410
|
sheetHeight: i,
|
|
406
|
-
visibleTranslate:
|
|
411
|
+
visibleTranslate: o
|
|
407
412
|
}) {
|
|
408
413
|
return {
|
|
409
|
-
maxTranslate: n > 0 ? n : r ? i :
|
|
414
|
+
maxTranslate: n > 0 ? n : r ? i : o,
|
|
410
415
|
minTranslate: 0
|
|
411
416
|
};
|
|
412
417
|
}
|
|
413
|
-
function
|
|
418
|
+
function Ve(r, n = 1) {
|
|
414
419
|
const i = Math.max(n, 1);
|
|
415
420
|
return r && Math.abs(r.maxTranslate - r.minTranslate) || i;
|
|
416
421
|
}
|
|
417
|
-
function
|
|
422
|
+
function He({
|
|
418
423
|
limit: r,
|
|
419
424
|
viewportSize: n,
|
|
420
425
|
viewportLimitRatio: i
|
|
421
426
|
}) {
|
|
422
|
-
const
|
|
423
|
-
return n <= 0 ?
|
|
427
|
+
const o = Math.max(r, 0);
|
|
428
|
+
return n <= 0 ? o : Math.min(o, n * i);
|
|
424
429
|
}
|
|
425
|
-
function
|
|
430
|
+
function br({
|
|
426
431
|
minTranslate: r,
|
|
427
432
|
sheetHeight: n,
|
|
428
433
|
surfaceMotion: i
|
|
429
434
|
}) {
|
|
430
|
-
const
|
|
435
|
+
const o = i.parentElement?.getBoundingClientRect(), l = o?.top ?? 0, h = o && o.height > 0 ? o.height : window.innerHeight, y = i.getBoundingClientRect(), T = Jt(i), D = y.top - T + r, b = Math.max(D - l, 0), { observedViewportLimitRatio: L } = F.rubberBand;
|
|
431
436
|
return {
|
|
432
|
-
minBoundaryLimit:
|
|
433
|
-
limit:
|
|
434
|
-
viewportSize:
|
|
437
|
+
minBoundaryLimit: He({
|
|
438
|
+
limit: b,
|
|
439
|
+
viewportSize: h,
|
|
435
440
|
viewportLimitRatio: L.top
|
|
436
441
|
}),
|
|
437
|
-
maxBoundaryLimit:
|
|
442
|
+
maxBoundaryLimit: He({
|
|
438
443
|
limit: n,
|
|
439
|
-
viewportSize:
|
|
444
|
+
viewportSize: h,
|
|
440
445
|
viewportLimitRatio: L.bottom
|
|
441
446
|
})
|
|
442
447
|
};
|
|
443
448
|
}
|
|
444
|
-
function
|
|
449
|
+
function Lr({
|
|
445
450
|
rubberBand: r,
|
|
446
451
|
targetTranslate: n,
|
|
447
452
|
sheetHeight: i,
|
|
448
|
-
peekTranslate:
|
|
453
|
+
peekTranslate: o,
|
|
449
454
|
bounds: l,
|
|
450
|
-
rubberBandLimits:
|
|
455
|
+
rubberBandLimits: h
|
|
451
456
|
}) {
|
|
452
|
-
const y =
|
|
453
|
-
r ?
|
|
457
|
+
const y = A(
|
|
458
|
+
r ? Kt({
|
|
454
459
|
targetTranslate: n,
|
|
455
|
-
...
|
|
460
|
+
...h,
|
|
456
461
|
...l
|
|
457
462
|
}) : n,
|
|
458
|
-
l.minTranslate -
|
|
459
|
-
l.maxTranslate +
|
|
460
|
-
), T = Math.max(-y, 0), D = Math.max(y, 0),
|
|
463
|
+
l.minTranslate - h.minBoundaryLimit,
|
|
464
|
+
l.maxTranslate + h.maxBoundaryLimit
|
|
465
|
+
), T = Math.max(-y, 0), D = Math.max(y, 0), b = o > 0 ? o : i, L = b > 0 ? 1 - D / Math.max(b, 1) : 0;
|
|
461
466
|
return {
|
|
462
467
|
translate: y,
|
|
463
468
|
overshootFillHeight: T,
|
|
464
|
-
backdropOpacity:
|
|
469
|
+
backdropOpacity: A(L, 0, 1)
|
|
465
470
|
};
|
|
466
471
|
}
|
|
467
|
-
function
|
|
472
|
+
function Nr({
|
|
468
473
|
enabled: r,
|
|
469
474
|
drag: n,
|
|
470
475
|
open: i,
|
|
471
|
-
placement:
|
|
476
|
+
placement: o,
|
|
472
477
|
surfaceMotionRef: l,
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
478
|
+
surfaceMotionNode: h,
|
|
479
|
+
backdropRef: y,
|
|
480
|
+
bodyNode: T,
|
|
481
|
+
snapHeights: D = lr,
|
|
482
|
+
sheetHeight: b,
|
|
483
|
+
snapPositions: L = cr,
|
|
484
|
+
defaultSnapPosition: tt,
|
|
485
|
+
peekHeight: $,
|
|
486
|
+
peekFallback: Qt,
|
|
487
|
+
presentationState: V,
|
|
488
|
+
setPresentationState: Nt,
|
|
489
|
+
requestClose: at,
|
|
490
|
+
canCloseAttempt: Zt,
|
|
491
|
+
dismissible: H = !0,
|
|
492
|
+
preserveShadowOpacity: qt = !1,
|
|
493
|
+
visibleTranslate: S = 0,
|
|
494
|
+
shouldDeferBottomSettle: te,
|
|
495
|
+
closeThreshold: Tt = 0.35,
|
|
496
|
+
scrollLockTimeout: ee = 500,
|
|
497
|
+
popupSnapLayoutVersion: re = 0
|
|
489
498
|
}) {
|
|
490
|
-
const
|
|
499
|
+
const M = w({
|
|
491
500
|
dragging: !1,
|
|
492
501
|
allowed: !1,
|
|
493
502
|
chrome: !1,
|
|
503
|
+
selectionArbitration: !1,
|
|
494
504
|
closeAllowed: null,
|
|
495
505
|
started: !1,
|
|
496
506
|
source: null,
|
|
@@ -506,361 +516,404 @@ function mr({
|
|
|
506
516
|
samples: [],
|
|
507
517
|
pointerId: null,
|
|
508
518
|
touchId: null
|
|
509
|
-
}),
|
|
519
|
+
}), z = w(T), ne = w(!1), oe = w(!1), $e = w((t) => {
|
|
510
520
|
t.preventDefault();
|
|
511
|
-
}),
|
|
521
|
+
}), Xt = w(0), Vt = w(!1), R = w(null), _ = w(
|
|
512
522
|
null
|
|
513
|
-
),
|
|
523
|
+
), Yt = w(null), U = w(null), xt = w(0), j = w(null), Ht = w(!1), Rt = w(!1), ae = w(V), Mt = w({
|
|
524
|
+
kind: "default-snap"
|
|
525
|
+
}), se = w(b ?? null), ie = w(S), le = w(D), _t = w(!1), st = w(!1), E = Mr({
|
|
514
526
|
drag: n,
|
|
515
|
-
placement:
|
|
516
|
-
snapPositionCount:
|
|
517
|
-
}),
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}, [
|
|
521
|
-
const t =
|
|
522
|
-
t && t !==
|
|
523
|
-
}, [
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
}, []),
|
|
527
|
-
if (
|
|
528
|
-
|
|
529
|
-
const e =
|
|
527
|
+
placement: o,
|
|
528
|
+
snapPositionCount: L.length
|
|
529
|
+
}), ce = `${tt ?? ""}:${L.join("|")}`, ue = w(L), Et = w(tt);
|
|
530
|
+
ot(() => {
|
|
531
|
+
ue.current = L, Et.current = tt;
|
|
532
|
+
}, [tt, ce, L]), ot(() => {
|
|
533
|
+
const t = z.current;
|
|
534
|
+
t && t !== T && Ut(t, !1), z.current = T, ne.current && Ut(T, !0);
|
|
535
|
+
}, [T]);
|
|
536
|
+
const it = p((t) => {
|
|
537
|
+
ne.current = t, Ut(z.current, t);
|
|
538
|
+
}, []), W = p((t) => {
|
|
539
|
+
if (oe.current === t) return;
|
|
540
|
+
oe.current = t;
|
|
541
|
+
const e = $e.current;
|
|
530
542
|
if (t) {
|
|
531
543
|
document.addEventListener("selectstart", e, !0), document.addEventListener("dragstart", e, !0);
|
|
532
544
|
return;
|
|
533
545
|
}
|
|
534
546
|
document.removeEventListener("selectstart", e, !0), document.removeEventListener("dragstart", e, !0);
|
|
535
|
-
}, []),
|
|
547
|
+
}, []), bt = p(
|
|
536
548
|
({ chrome: t, target: e }) => {
|
|
537
|
-
const
|
|
549
|
+
const a = tr({
|
|
538
550
|
target: e,
|
|
539
551
|
chrome: t,
|
|
540
|
-
bodyNode:
|
|
552
|
+
bodyNode: z.current
|
|
541
553
|
});
|
|
542
|
-
return
|
|
554
|
+
return it(a), a;
|
|
543
555
|
},
|
|
544
|
-
[
|
|
545
|
-
),
|
|
546
|
-
if (
|
|
547
|
-
if (
|
|
556
|
+
[it]
|
|
557
|
+
), I = p(() => l.current?.getBoundingClientRect().height ?? window.innerHeight, [l]), Lt = p(() => {
|
|
558
|
+
if ($ !== void 0) return $;
|
|
559
|
+
if (Qt === "header")
|
|
548
560
|
return l.current?.querySelector('[data-oc-part="header"]')?.getBoundingClientRect().height ?? void 0;
|
|
549
|
-
}, [
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
561
|
+
}, [Qt, $, l]), Pt = p(
|
|
562
|
+
(t) => {
|
|
563
|
+
const e = Lt();
|
|
564
|
+
return e === void 0 || e <= 0 ? 0 : A(t - e, 0, t);
|
|
565
|
+
},
|
|
566
|
+
[Lt]
|
|
567
|
+
), G = p(() => {
|
|
568
|
+
const t = Lt();
|
|
569
|
+
return t === void 0 || t <= 0 ? 0 : Pt(I());
|
|
570
|
+
}, [Lt, Pt, I]), $t = p(
|
|
571
|
+
() => V === "peeked" ? G() : S,
|
|
572
|
+
[G, V, S]
|
|
573
|
+
), et = p(() => {
|
|
558
574
|
const t = l.current;
|
|
559
|
-
if (!t) return
|
|
560
|
-
const e =
|
|
575
|
+
if (!t) return $t();
|
|
576
|
+
const e = yt(
|
|
561
577
|
t.style.getPropertyValue("--oc-modal-translate-y")
|
|
562
578
|
);
|
|
563
579
|
if (e !== void 0) return e;
|
|
564
|
-
const
|
|
580
|
+
const a = yt(
|
|
565
581
|
window.getComputedStyle(t).getPropertyValue("--oc-modal-translate-y")
|
|
566
582
|
);
|
|
567
|
-
return
|
|
568
|
-
}, [
|
|
583
|
+
return a !== void 0 ? a : $t();
|
|
584
|
+
}, [$t, l]), kt = p(() => {
|
|
569
585
|
const t = l.current;
|
|
570
586
|
if (!t) return { x: 0, y: 0 };
|
|
571
|
-
const e =
|
|
587
|
+
const e = yt(
|
|
572
588
|
t.style.getPropertyValue("--oc-modal-translate-x")
|
|
573
|
-
),
|
|
589
|
+
), a = yt(
|
|
574
590
|
t.style.getPropertyValue("--oc-modal-translate-y")
|
|
575
591
|
);
|
|
576
|
-
if (e !== void 0 ||
|
|
592
|
+
if (e !== void 0 || a !== void 0)
|
|
577
593
|
return {
|
|
578
594
|
x: e ?? 0,
|
|
579
|
-
y:
|
|
595
|
+
y: a ?? 0
|
|
580
596
|
};
|
|
581
597
|
const c = window.getComputedStyle(t);
|
|
582
598
|
return {
|
|
583
|
-
x:
|
|
584
|
-
y:
|
|
599
|
+
x: yt(c.getPropertyValue("--oc-modal-translate-x")) ?? 0,
|
|
600
|
+
y: yt(c.getPropertyValue("--oc-modal-translate-y")) ?? 0
|
|
585
601
|
};
|
|
586
|
-
}, [l]),
|
|
587
|
-
const t =
|
|
602
|
+
}, [l]), lt = p(() => {
|
|
603
|
+
const t = et(), e = Jt(l.current);
|
|
588
604
|
return Math.abs(e - t) > 1 ? e : t;
|
|
589
|
-
}, [
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
605
|
+
}, [et, l]), vt = p(
|
|
606
|
+
(t, e, a = 1) => Math.abs(t - e) <= a,
|
|
607
|
+
[]
|
|
608
|
+
), ct = p(() => {
|
|
609
|
+
const t = kt(), e = Ae(l.current);
|
|
610
|
+
return q(e, t) > 1 ? e : t;
|
|
611
|
+
}, [kt, l]), B = p(
|
|
593
612
|
(t, {
|
|
594
613
|
active: e,
|
|
595
|
-
nextDismissible:
|
|
596
|
-
rubberBand: c = !1
|
|
614
|
+
nextDismissible: a = H,
|
|
615
|
+
rubberBand: c = !1,
|
|
616
|
+
sheetHeightOverride: s,
|
|
617
|
+
peekTranslateOverride: u,
|
|
618
|
+
settled: d
|
|
597
619
|
}) => {
|
|
598
|
-
const
|
|
599
|
-
if (!
|
|
600
|
-
const
|
|
601
|
-
dismissible:
|
|
602
|
-
peekTranslate:
|
|
603
|
-
sheetHeight:
|
|
604
|
-
visibleTranslate:
|
|
605
|
-
}),
|
|
606
|
-
minTranslate:
|
|
607
|
-
sheetHeight:
|
|
608
|
-
surfaceMotion:
|
|
609
|
-
}), P =
|
|
620
|
+
const f = l.current;
|
|
621
|
+
if (!f) return;
|
|
622
|
+
const g = s ?? I(), m = f.parentElement, Y = u ?? G(), C = Er({
|
|
623
|
+
dismissible: a,
|
|
624
|
+
peekTranslate: Y,
|
|
625
|
+
sheetHeight: g,
|
|
626
|
+
visibleTranslate: S
|
|
627
|
+
}), x = br({
|
|
628
|
+
minTranslate: C.minTranslate,
|
|
629
|
+
sheetHeight: g,
|
|
630
|
+
surfaceMotion: f
|
|
631
|
+
}), P = Lr({
|
|
610
632
|
rubberBand: c,
|
|
611
633
|
targetTranslate: t,
|
|
612
|
-
sheetHeight:
|
|
613
|
-
peekTranslate:
|
|
614
|
-
bounds:
|
|
615
|
-
rubberBandLimits:
|
|
634
|
+
sheetHeight: g,
|
|
635
|
+
peekTranslate: Y,
|
|
636
|
+
bounds: C,
|
|
637
|
+
rubberBandLimits: x
|
|
616
638
|
});
|
|
617
|
-
|
|
639
|
+
M.current.lastTranslate = P.translate, f.style.setProperty(
|
|
618
640
|
"--oc-modal-translate-y",
|
|
619
641
|
`${P.translate}px`
|
|
620
|
-
),
|
|
642
|
+
), d === "frame" || !e ? f.style.setProperty(
|
|
643
|
+
"--oc-modal-settled-translate-y",
|
|
644
|
+
`${P.translate}px`
|
|
645
|
+
) : typeof d == "number" && f.style.setProperty(
|
|
646
|
+
"--oc-modal-settled-translate-y",
|
|
647
|
+
`${d}px`
|
|
648
|
+
), qt ? f.style.removeProperty(
|
|
649
|
+
"--_-modal-elevation-shadow-opacity"
|
|
650
|
+
) : f.style.setProperty(
|
|
621
651
|
"--_-modal-elevation-shadow-opacity",
|
|
622
652
|
String(1 - P.backdropOpacity)
|
|
623
|
-
),
|
|
653
|
+
), f.dataset.ocModalDragging = e ? "true" : "false", m?.style.setProperty(
|
|
624
654
|
"--oc-modal-overshoot-fill-height",
|
|
625
655
|
`${P.overshootFillHeight}px`
|
|
626
|
-
),
|
|
656
|
+
), m && (m.dataset.ocModalDragging = e ? "true" : "false"), e ? f.style.setProperty("transition", "none") : f.style.removeProperty("transition"), y.current && (y.current.style.setProperty(
|
|
627
657
|
"--oc-modal-backdrop-opacity",
|
|
628
658
|
String(P.backdropOpacity)
|
|
629
|
-
),
|
|
659
|
+
), y.current.style.transition = e ? "none" : "");
|
|
630
660
|
},
|
|
631
661
|
[
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
662
|
+
y,
|
|
663
|
+
H,
|
|
664
|
+
G,
|
|
665
|
+
I,
|
|
666
|
+
qt,
|
|
636
667
|
l,
|
|
637
|
-
|
|
668
|
+
S
|
|
638
669
|
]
|
|
639
|
-
),
|
|
640
|
-
const t = l.current, e =
|
|
670
|
+
), ut = p(() => {
|
|
671
|
+
const t = l.current, e = ue.current;
|
|
641
672
|
if (!(!t || !e.length))
|
|
642
|
-
return
|
|
643
|
-
defaultSnapPosition:
|
|
673
|
+
return qe({
|
|
674
|
+
defaultSnapPosition: Et.current,
|
|
644
675
|
snapPositions: e,
|
|
645
676
|
surfaceMotion: t
|
|
646
677
|
});
|
|
647
|
-
}, [l]),
|
|
678
|
+
}, [l]), K = p(
|
|
648
679
|
({ destroy: t = !0 } = {}) => {
|
|
649
|
-
t &&
|
|
680
|
+
t && _.current?.destroy(), _.current = null, Yt.current = null;
|
|
650
681
|
},
|
|
651
682
|
[]
|
|
652
|
-
),
|
|
683
|
+
), k = p(
|
|
653
684
|
(t, { active: e }) => {
|
|
654
|
-
const
|
|
655
|
-
if (!
|
|
656
|
-
const c =
|
|
657
|
-
x:
|
|
685
|
+
const a = l.current;
|
|
686
|
+
if (!a) return;
|
|
687
|
+
const c = ut(), s = c ? a.getBoundingClientRect() : void 0, u = c ? Ce(c.targets, "x") : void 0, d = c ? Ce(c.targets, "y") : void 0, f = Ve(u, s?.width), g = Ve(d, s?.height), m = c ? {
|
|
688
|
+
x: Kt({
|
|
658
689
|
targetTranslate: t.x,
|
|
659
690
|
minTranslate: u?.minTranslate ?? 0,
|
|
660
691
|
maxTranslate: u?.maxTranslate ?? 0,
|
|
661
|
-
minBoundaryLimit:
|
|
662
|
-
maxBoundaryLimit:
|
|
692
|
+
minBoundaryLimit: f,
|
|
693
|
+
maxBoundaryLimit: f
|
|
663
694
|
}),
|
|
664
|
-
y:
|
|
695
|
+
y: Kt({
|
|
665
696
|
targetTranslate: t.y,
|
|
666
|
-
minTranslate:
|
|
667
|
-
maxTranslate:
|
|
668
|
-
minBoundaryLimit:
|
|
669
|
-
maxBoundaryLimit:
|
|
697
|
+
minTranslate: d?.minTranslate ?? 0,
|
|
698
|
+
maxTranslate: d?.maxTranslate ?? 0,
|
|
699
|
+
minBoundaryLimit: g,
|
|
700
|
+
maxBoundaryLimit: g
|
|
670
701
|
})
|
|
671
702
|
} : t;
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
|
|
703
|
+
M.current.lastTranslateX = m.x, M.current.lastTranslate = m.y;
|
|
704
|
+
const Y = e ? void 0 : t.settledTranslate;
|
|
705
|
+
a.style.setProperty(
|
|
675
706
|
"--oc-modal-translate-x",
|
|
676
|
-
|
|
677
|
-
),
|
|
707
|
+
Y?.x ?? `${m.x}px`
|
|
708
|
+
), a.style.setProperty(
|
|
678
709
|
"--oc-modal-translate-y",
|
|
679
|
-
|
|
680
|
-
),
|
|
710
|
+
Y?.y ?? `${m.y}px`
|
|
711
|
+
), a.dataset.ocModalDragging = e ? "true" : "false", a.parentElement && (a.parentElement.dataset.ocModalDragging = e ? "true" : "false"), a.style.transition = e ? "none" : "";
|
|
681
712
|
},
|
|
682
|
-
[
|
|
683
|
-
), X =
|
|
684
|
-
|
|
685
|
-
}, [
|
|
686
|
-
(t, e =
|
|
713
|
+
[ut, l]
|
|
714
|
+
), X = p(() => {
|
|
715
|
+
R.current?.destroy(), R.current = null, K();
|
|
716
|
+
}, [K]), dt = p(
|
|
717
|
+
(t, e = H) => {
|
|
687
718
|
X(), B(t, {
|
|
688
719
|
active: !0,
|
|
689
720
|
nextDismissible: e,
|
|
690
|
-
rubberBand: !0
|
|
721
|
+
rubberBand: !0,
|
|
722
|
+
settled: "frame"
|
|
691
723
|
});
|
|
692
724
|
},
|
|
693
|
-
[B, X,
|
|
694
|
-
),
|
|
695
|
-
const t =
|
|
696
|
-
return
|
|
725
|
+
[B, X, H]
|
|
726
|
+
), de = p(() => {
|
|
727
|
+
const t = lt(), e = ct();
|
|
728
|
+
return R.current !== null || _.current !== null ? (X(), o === "popup" && q(e, { x: 0, y: 0 }) > 0.5 ? k(e, { active: !1 }) : o === "bottom" && Math.abs(t) > 0.5 && B(t, { active: !1 }), { startTranslate: t, startTranslatePoint: e }) : { startTranslate: t, startTranslatePoint: e };
|
|
697
729
|
}, [
|
|
698
|
-
|
|
730
|
+
k,
|
|
699
731
|
B,
|
|
700
732
|
X,
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
]),
|
|
733
|
+
lt,
|
|
734
|
+
ct,
|
|
735
|
+
o
|
|
736
|
+
]), v = p(() => {
|
|
705
737
|
const t = l.current;
|
|
706
|
-
t && (t.dataset.ocModalDragging = "false", t.style.removeProperty("transition"), t.parentElement && (t.parentElement.dataset.ocModalDragging = "false"),
|
|
707
|
-
}, [
|
|
738
|
+
t && (t.dataset.ocModalDragging = "false", t.style.removeProperty("transition"), t.style.removeProperty("--_-modal-elevation-shadow-opacity"), t.parentElement && (t.parentElement.dataset.ocModalDragging = "false"), y.current?.style.removeProperty("transition"), y.current?.style.removeProperty("--oc-modal-backdrop-opacity"));
|
|
739
|
+
}, [y, l]), pe = p(() => {
|
|
708
740
|
const t = l.current, e = t?.parentElement;
|
|
709
|
-
|
|
710
|
-
}, [
|
|
741
|
+
M.current.lastTranslate = 0, t?.style.removeProperty("--oc-modal-translate-y"), t?.style.removeProperty("--oc-modal-settled-translate-y"), t?.style.removeProperty("--_-modal-elevation-shadow-opacity"), e?.style.removeProperty("--oc-modal-overshoot-fill-height"), y.current?.style.removeProperty("--oc-modal-backdrop-opacity"), v();
|
|
742
|
+
}, [y, v, l]), fe = p(
|
|
711
743
|
({
|
|
712
744
|
preserveSnapPosition: t = !1,
|
|
713
745
|
resetY: e = !0
|
|
714
746
|
} = {}) => {
|
|
715
|
-
const
|
|
716
|
-
|
|
747
|
+
const a = l.current;
|
|
748
|
+
a && (t || (U.current = null), M.current.lastTranslateX = 0, a.style.removeProperty("--oc-modal-translate-x"), e && (M.current.lastTranslate = 0, a.style.removeProperty("--oc-modal-translate-y")), v());
|
|
717
749
|
},
|
|
718
|
-
[
|
|
719
|
-
),
|
|
750
|
+
[v, l]
|
|
751
|
+
), O = p(
|
|
720
752
|
(t, {
|
|
721
753
|
initialVelocity: e = 0,
|
|
722
|
-
intent:
|
|
754
|
+
intent: a = "sheet",
|
|
723
755
|
phase: c = "release",
|
|
724
756
|
from: s,
|
|
725
|
-
onComplete: u
|
|
757
|
+
onComplete: u,
|
|
758
|
+
peekTranslateOverride: d,
|
|
759
|
+
sheetHeightOverride: f
|
|
726
760
|
} = {}) => {
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
761
|
+
const g = l.current;
|
|
762
|
+
if (!g) return;
|
|
729
763
|
X();
|
|
730
|
-
const
|
|
731
|
-
if (Math.abs(
|
|
732
|
-
B(t, {
|
|
764
|
+
const m = s ?? Jt(g);
|
|
765
|
+
if (Math.abs(m - t) < 0.5) {
|
|
766
|
+
B(t, {
|
|
767
|
+
active: !1,
|
|
768
|
+
peekTranslateOverride: d,
|
|
769
|
+
sheetHeightOverride: f
|
|
770
|
+
}), v(), u?.();
|
|
733
771
|
return;
|
|
734
772
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
773
|
+
const Y = c === "enter" ? t : "frame";
|
|
774
|
+
B(m, {
|
|
775
|
+
active: !0,
|
|
776
|
+
peekTranslateOverride: d,
|
|
777
|
+
settled: Y,
|
|
778
|
+
sheetHeightOverride: f
|
|
779
|
+
});
|
|
780
|
+
const C = zt({
|
|
781
|
+
element: g,
|
|
782
|
+
intent: a,
|
|
739
783
|
phase: c,
|
|
740
784
|
reduced: "preserve",
|
|
741
785
|
reducedMotion: !1,
|
|
742
786
|
property: "transform"
|
|
743
|
-
}),
|
|
744
|
-
value:
|
|
787
|
+
}), x = Gt({
|
|
788
|
+
value: m,
|
|
745
789
|
target: t,
|
|
746
790
|
velocity: e,
|
|
747
|
-
spring:
|
|
791
|
+
spring: C.spring,
|
|
748
792
|
epsilon: 0.5,
|
|
749
793
|
velocityEpsilon: 50,
|
|
750
794
|
stabilityWindow: 0.02,
|
|
751
795
|
onUpdate: (P) => {
|
|
752
|
-
B(P, {
|
|
796
|
+
B(P, {
|
|
797
|
+
active: !0,
|
|
798
|
+
peekTranslateOverride: d,
|
|
799
|
+
settled: Y === "frame" ? "frame" : void 0,
|
|
800
|
+
sheetHeightOverride: f
|
|
801
|
+
});
|
|
753
802
|
},
|
|
754
803
|
onComplete: () => {
|
|
755
|
-
|
|
804
|
+
R.current === x && (R.current = null), B(t, {
|
|
805
|
+
active: !1,
|
|
806
|
+
peekTranslateOverride: d,
|
|
807
|
+
sheetHeightOverride: f
|
|
808
|
+
}), v(), u?.();
|
|
756
809
|
}
|
|
757
810
|
});
|
|
758
|
-
|
|
811
|
+
R.current = x;
|
|
759
812
|
},
|
|
760
|
-
[B, X,
|
|
761
|
-
),
|
|
813
|
+
[B, X, v, l]
|
|
814
|
+
), J = p(
|
|
762
815
|
(t, {
|
|
763
816
|
from: e,
|
|
764
|
-
initialVelocity:
|
|
817
|
+
initialVelocity: a = { x: 0, y: 0 }
|
|
765
818
|
} = {}) => {
|
|
766
819
|
const c = l.current;
|
|
767
820
|
if (!c) return;
|
|
768
821
|
X();
|
|
769
|
-
const s = e ??
|
|
770
|
-
if (
|
|
771
|
-
|
|
822
|
+
const s = e ?? Ae(c), u = { x: t.x, y: t.y };
|
|
823
|
+
if (q(s, u) < 0.5) {
|
|
824
|
+
k(t, { active: !1 }), v();
|
|
772
825
|
return;
|
|
773
826
|
}
|
|
774
|
-
|
|
775
|
-
const
|
|
827
|
+
k(s, { active: !0 });
|
|
828
|
+
const f = zt({
|
|
776
829
|
element: c,
|
|
777
830
|
intent: "gesture",
|
|
778
831
|
phase: "release",
|
|
779
832
|
reduced: "preserve",
|
|
780
833
|
reducedMotion: !1,
|
|
781
834
|
property: "transform"
|
|
782
|
-
}),
|
|
835
|
+
}), g = Gt({
|
|
783
836
|
value: s,
|
|
784
837
|
target: u,
|
|
785
|
-
velocity:
|
|
786
|
-
spring:
|
|
838
|
+
velocity: a,
|
|
839
|
+
spring: f.spring,
|
|
787
840
|
epsilon: 0.5,
|
|
788
841
|
velocityEpsilon: 50,
|
|
789
842
|
stabilityWindow: 0.02,
|
|
790
|
-
onUpdate: (
|
|
791
|
-
|
|
843
|
+
onUpdate: (m) => {
|
|
844
|
+
k(m, { active: !0 });
|
|
792
845
|
},
|
|
793
846
|
onComplete: () => {
|
|
794
|
-
|
|
847
|
+
R.current === g && (R.current = null), k(t, { active: !1 }), v();
|
|
795
848
|
}
|
|
796
849
|
});
|
|
797
|
-
|
|
850
|
+
R.current = g;
|
|
798
851
|
},
|
|
799
852
|
[
|
|
800
|
-
|
|
853
|
+
k,
|
|
801
854
|
X,
|
|
802
|
-
|
|
855
|
+
v,
|
|
803
856
|
l
|
|
804
857
|
]
|
|
805
|
-
),
|
|
806
|
-
const t =
|
|
858
|
+
), pt = p(() => {
|
|
859
|
+
const t = _.current;
|
|
807
860
|
if (!t) return null;
|
|
808
861
|
const e = t.sample();
|
|
809
|
-
return
|
|
810
|
-
}, [
|
|
862
|
+
return k(e.value, { active: !0 }), e;
|
|
863
|
+
}, [k]), ge = p(
|
|
811
864
|
(t) => {
|
|
812
865
|
if (!l.current) return null;
|
|
813
|
-
X(),
|
|
814
|
-
const
|
|
866
|
+
X(), k(t, { active: !0 });
|
|
867
|
+
const a = Gt({
|
|
815
868
|
value: t,
|
|
816
869
|
target: t,
|
|
817
|
-
spring:
|
|
870
|
+
spring: ir,
|
|
818
871
|
autoplay: !1,
|
|
819
872
|
epsilon: 0.5,
|
|
820
873
|
velocityEpsilon: 50,
|
|
821
874
|
stabilityWindow: 0.02,
|
|
822
875
|
onUpdate: (c) => {
|
|
823
|
-
|
|
876
|
+
k(c, { active: !0 });
|
|
824
877
|
},
|
|
825
878
|
onComplete: () => {
|
|
826
|
-
const c =
|
|
827
|
-
!c ||
|
|
879
|
+
const c = Yt.current;
|
|
880
|
+
!c || _.current !== a || (K({ destroy: !1 }), k(c, { active: !1 }), v());
|
|
828
881
|
}
|
|
829
882
|
});
|
|
830
|
-
return
|
|
883
|
+
return _.current = a, a;
|
|
831
884
|
},
|
|
832
885
|
[
|
|
833
|
-
|
|
886
|
+
k,
|
|
834
887
|
X,
|
|
835
|
-
|
|
836
|
-
|
|
888
|
+
K,
|
|
889
|
+
v,
|
|
837
890
|
l
|
|
838
891
|
]
|
|
839
|
-
),
|
|
892
|
+
), me = p(
|
|
840
893
|
(t) => {
|
|
841
|
-
const e =
|
|
842
|
-
e && (
|
|
894
|
+
const e = _.current ?? ge(ct());
|
|
895
|
+
e && (Yt.current = null, e.setTarget(t));
|
|
843
896
|
},
|
|
844
|
-
[
|
|
845
|
-
),
|
|
897
|
+
[ct, ge]
|
|
898
|
+
), ft = p(
|
|
846
899
|
(t, e) => {
|
|
847
|
-
const
|
|
848
|
-
return
|
|
900
|
+
const a = Ot(t, e);
|
|
901
|
+
return me(a), pt(), a;
|
|
849
902
|
},
|
|
850
|
-
[
|
|
851
|
-
),
|
|
903
|
+
[pt, me]
|
|
904
|
+
), Ct = p(
|
|
852
905
|
(t) => {
|
|
853
|
-
const e = l.current,
|
|
854
|
-
if (!e || !
|
|
855
|
-
|
|
906
|
+
const e = l.current, a = _.current;
|
|
907
|
+
if (!e || !a) {
|
|
908
|
+
J(t);
|
|
856
909
|
return;
|
|
857
910
|
}
|
|
858
|
-
const s =
|
|
859
|
-
if (
|
|
860
|
-
|
|
911
|
+
const s = pt() ? kt() : a.value, u = { x: t.x, y: t.y };
|
|
912
|
+
if (q(s, u) < 0.5) {
|
|
913
|
+
K(), k(t, { active: !1 }), v();
|
|
861
914
|
return;
|
|
862
915
|
}
|
|
863
|
-
const
|
|
916
|
+
const d = zt({
|
|
864
917
|
element: e,
|
|
865
918
|
intent: "gesture",
|
|
866
919
|
phase: "release",
|
|
@@ -868,116 +921,218 @@ function mr({
|
|
|
868
921
|
reducedMotion: !1,
|
|
869
922
|
property: "transform"
|
|
870
923
|
});
|
|
871
|
-
|
|
924
|
+
Yt.current = t, a.setTarget(u, { spring: d.spring });
|
|
872
925
|
},
|
|
873
926
|
[
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
927
|
+
k,
|
|
928
|
+
K,
|
|
929
|
+
v,
|
|
930
|
+
kt,
|
|
931
|
+
pt,
|
|
932
|
+
J,
|
|
880
933
|
l
|
|
881
934
|
]
|
|
882
|
-
),
|
|
935
|
+
), gt = p(
|
|
883
936
|
({
|
|
884
937
|
key: t,
|
|
885
938
|
settle: e
|
|
886
939
|
}) => {
|
|
887
|
-
if (
|
|
888
|
-
const
|
|
889
|
-
if (!
|
|
890
|
-
const c = (t ?
|
|
891
|
-
return
|
|
940
|
+
if (M.current.dragging) return !1;
|
|
941
|
+
const a = ut();
|
|
942
|
+
if (!a) return !1;
|
|
943
|
+
const c = (t ? a.targets.find((s) => s.key === t) : void 0) ?? a.defaultTarget;
|
|
944
|
+
return U.current = c.key, e ? J(c) : (X(), k(c, { active: !1 }), v()), !0;
|
|
892
945
|
},
|
|
893
946
|
[
|
|
894
|
-
|
|
947
|
+
k,
|
|
895
948
|
X,
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
949
|
+
v,
|
|
950
|
+
ut,
|
|
951
|
+
J
|
|
899
952
|
]
|
|
900
|
-
),
|
|
901
|
-
(t, { from: e, initialVelocity:
|
|
902
|
-
|
|
953
|
+
), he = p(
|
|
954
|
+
(t, { from: e, initialVelocity: a = 0 }) => {
|
|
955
|
+
O(t, {
|
|
903
956
|
from: e,
|
|
904
|
-
initialVelocity:
|
|
957
|
+
initialVelocity: a,
|
|
905
958
|
onComplete: () => {
|
|
906
|
-
|
|
959
|
+
at({ reason: "drag-dismiss" }, { skipAttempt: !0 });
|
|
907
960
|
}
|
|
908
961
|
});
|
|
909
962
|
},
|
|
910
|
-
[
|
|
963
|
+
[at, O]
|
|
911
964
|
);
|
|
912
|
-
|
|
965
|
+
It(
|
|
913
966
|
() => () => {
|
|
914
|
-
X(),
|
|
967
|
+
X(), W(!1), l.current && v();
|
|
915
968
|
},
|
|
916
969
|
[
|
|
917
970
|
X,
|
|
918
|
-
|
|
919
|
-
|
|
971
|
+
v,
|
|
972
|
+
W,
|
|
920
973
|
l
|
|
921
974
|
]
|
|
922
|
-
),
|
|
923
|
-
if (!i || !r ||
|
|
924
|
-
|
|
975
|
+
), ot(() => {
|
|
976
|
+
if (!i || !r || o !== "bottom") {
|
|
977
|
+
Ht.current = i;
|
|
925
978
|
return;
|
|
926
979
|
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
980
|
+
if (!l.current || te?.()) return;
|
|
981
|
+
Rt.current = !0;
|
|
982
|
+
const t = Ht.current;
|
|
983
|
+
Ht.current = !0;
|
|
984
|
+
const e = b ?? I(), a = se.current ?? e, c = ae.current, s = le.current, u = ie.current, d = () => {
|
|
985
|
+
se.current = e, ae.current = V, ie.current = S, le.current = D;
|
|
986
|
+
}, f = !vt(
|
|
987
|
+
a,
|
|
988
|
+
e
|
|
989
|
+
), g = Pt(e), m = V === "peeked" ? g : S;
|
|
931
990
|
if (!t) {
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
991
|
+
Mt.current = { kind: "default-snap" }, B(e, {
|
|
992
|
+
active: !0,
|
|
993
|
+
peekTranslateOverride: g,
|
|
994
|
+
sheetHeightOverride: e
|
|
995
|
+
}), O(m, {
|
|
996
|
+
from: e,
|
|
935
997
|
intent: "sheet",
|
|
936
|
-
|
|
937
|
-
|
|
998
|
+
peekTranslateOverride: g,
|
|
999
|
+
phase: "enter",
|
|
1000
|
+
sheetHeightOverride: e
|
|
1001
|
+
}), d();
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1004
|
+
if (V === "visible" && f) {
|
|
1005
|
+
const x = l.current, P = et(), Q = c === "visible" && a > 0 ? ar({
|
|
1006
|
+
currentTranslate: P,
|
|
1007
|
+
fallbackTranslate: S,
|
|
1008
|
+
restState: Mt.current,
|
|
1009
|
+
previousDefaultTranslate: u,
|
|
1010
|
+
previousSheetHeight: a,
|
|
1011
|
+
previousSnapHeights: s,
|
|
1012
|
+
targetSheetHeight: e,
|
|
1013
|
+
targetDefaultTranslate: S,
|
|
1014
|
+
targetSnapHeights: D
|
|
1015
|
+
}) : S;
|
|
1016
|
+
X();
|
|
1017
|
+
const N = Number.parseFloat(x.style.height), Dt = Number.isFinite(N) && N > 0 ? N : a, Je = A(
|
|
1018
|
+
Dt - P,
|
|
1019
|
+
0,
|
|
1020
|
+
Dt
|
|
1021
|
+
), Qe = A(
|
|
1022
|
+
e - Q,
|
|
1023
|
+
0,
|
|
1024
|
+
e
|
|
1025
|
+
), nt = Math.max(Dt, e), jt = Math.max(
|
|
1026
|
+
0,
|
|
1027
|
+
nt - Je
|
|
1028
|
+
), De = Math.max(
|
|
1029
|
+
0,
|
|
1030
|
+
nt - Qe
|
|
1031
|
+
), Se = Pt(nt), Xe = () => {
|
|
1032
|
+
B(Q, {
|
|
1033
|
+
active: !1,
|
|
1034
|
+
peekTranslateOverride: g,
|
|
1035
|
+
sheetHeightOverride: e
|
|
1036
|
+
}), x.style.setProperty("transition", "none"), x.style.removeProperty("height"), x.style.setProperty(
|
|
1037
|
+
"--oc-modal-sheet-height",
|
|
1038
|
+
`${e}px`
|
|
1039
|
+
), x.getBoundingClientRect(), x.style.removeProperty("transition");
|
|
1040
|
+
};
|
|
1041
|
+
if (vt(jt, De)) {
|
|
1042
|
+
Xe(), d();
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
x.style.setProperty("transition", "none"), x.style.setProperty("height", `${nt}px`), x.style.setProperty(
|
|
1046
|
+
"--oc-modal-sheet-height",
|
|
1047
|
+
`${nt}px`
|
|
1048
|
+
), B(jt, {
|
|
1049
|
+
active: !0,
|
|
1050
|
+
peekTranslateOverride: Se,
|
|
1051
|
+
sheetHeightOverride: nt
|
|
1052
|
+
}), x.getBoundingClientRect(), x.style.removeProperty("transition"), O(De, {
|
|
1053
|
+
from: jt,
|
|
1054
|
+
intent: "sheet",
|
|
1055
|
+
peekTranslateOverride: Se,
|
|
1056
|
+
sheetHeightOverride: nt,
|
|
1057
|
+
onComplete: Xe
|
|
1058
|
+
}), d();
|
|
938
1059
|
return;
|
|
939
1060
|
}
|
|
940
|
-
if (
|
|
941
|
-
|
|
1061
|
+
if (V === "peeked") {
|
|
1062
|
+
O(g, {
|
|
1063
|
+
peekTranslateOverride: g,
|
|
1064
|
+
sheetHeightOverride: e
|
|
1065
|
+
}), d();
|
|
942
1066
|
return;
|
|
943
1067
|
}
|
|
944
|
-
if (
|
|
945
|
-
|
|
1068
|
+
if (Vt.current) {
|
|
1069
|
+
Vt.current = !1, d();
|
|
946
1070
|
return;
|
|
947
1071
|
}
|
|
948
|
-
|
|
1072
|
+
const Y = c !== V;
|
|
1073
|
+
if (!vt(
|
|
1074
|
+
u,
|
|
1075
|
+
S
|
|
1076
|
+
)) {
|
|
1077
|
+
const x = et(), Q = R.current !== null && (S > u && x < S || S < u && x > S);
|
|
1078
|
+
if (vt(x, u) || Q) {
|
|
1079
|
+
X(), B(S, {
|
|
1080
|
+
active: !1,
|
|
1081
|
+
peekTranslateOverride: g,
|
|
1082
|
+
sheetHeightOverride: e
|
|
1083
|
+
}), v(), d();
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
if (!Y) {
|
|
1088
|
+
d();
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
O(S, {
|
|
1092
|
+
peekTranslateOverride: g,
|
|
1093
|
+
sheetHeightOverride: e
|
|
1094
|
+
}), Mt.current = { kind: "default-snap" }, d();
|
|
949
1095
|
}, [
|
|
950
1096
|
r,
|
|
951
|
-
|
|
952
|
-
|
|
1097
|
+
Pt,
|
|
1098
|
+
I,
|
|
1099
|
+
et,
|
|
1100
|
+
b,
|
|
1101
|
+
D,
|
|
953
1102
|
i,
|
|
954
|
-
|
|
955
|
-
|
|
1103
|
+
o,
|
|
1104
|
+
V,
|
|
1105
|
+
te,
|
|
956
1106
|
B,
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1107
|
+
X,
|
|
1108
|
+
v,
|
|
1109
|
+
vt,
|
|
1110
|
+
O,
|
|
1111
|
+
h,
|
|
1112
|
+
l,
|
|
1113
|
+
S
|
|
1114
|
+
]), ot(() => {
|
|
1115
|
+
o !== "bottom" && Rt.current && (Rt.current = !1, X(), pe());
|
|
1116
|
+
}, [X, o, pe]), ot(() => {
|
|
1117
|
+
if (!i || !r || !E) {
|
|
1118
|
+
const c = !i && o === "popup" && st.current, s = i && o !== "popup" && st.current;
|
|
1119
|
+
st.current && !c && (j.current !== null && (window.cancelAnimationFrame(j.current), j.current = null), X(), fe({
|
|
965
1120
|
preserveSnapPosition: s
|
|
966
|
-
})),
|
|
1121
|
+
})), st.current && c && (X(), v()), _t.current = i && o === "popup", st.current = !1;
|
|
967
1122
|
return;
|
|
968
1123
|
}
|
|
969
|
-
const t =
|
|
970
|
-
|
|
1124
|
+
const t = _t.current;
|
|
1125
|
+
_t.current = !0, st.current = !0;
|
|
971
1126
|
let e = null;
|
|
972
|
-
const
|
|
1127
|
+
const a = (c) => gt({
|
|
973
1128
|
key: c,
|
|
974
1129
|
settle: t
|
|
975
1130
|
});
|
|
976
|
-
return
|
|
977
|
-
|
|
1131
|
+
return a(
|
|
1132
|
+
U.current ?? Et.current
|
|
978
1133
|
) || (e = window.requestAnimationFrame(() => {
|
|
979
|
-
e = null,
|
|
980
|
-
|
|
1134
|
+
e = null, a(
|
|
1135
|
+
U.current ?? Et.current
|
|
981
1136
|
);
|
|
982
1137
|
})), () => {
|
|
983
1138
|
e !== null && window.cancelAnimationFrame(e);
|
|
@@ -985,28 +1140,28 @@ function mr({
|
|
|
985
1140
|
}, [
|
|
986
1141
|
X,
|
|
987
1142
|
r,
|
|
988
|
-
x,
|
|
989
|
-
i,
|
|
990
|
-
a,
|
|
991
|
-
Gt,
|
|
992
1143
|
v,
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1144
|
+
i,
|
|
1145
|
+
o,
|
|
1146
|
+
ce,
|
|
1147
|
+
E,
|
|
1148
|
+
fe,
|
|
1149
|
+
gt
|
|
1150
|
+
]), ot(() => {
|
|
1151
|
+
if (!i || !r || !E) return;
|
|
997
1152
|
const t = () => {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
key:
|
|
1153
|
+
M.current.dragging || j.current === null && (j.current = window.requestAnimationFrame(() => {
|
|
1154
|
+
j.current = null, !M.current.dragging && gt({
|
|
1155
|
+
key: U.current,
|
|
1001
1156
|
settle: !1
|
|
1002
1157
|
});
|
|
1003
1158
|
}));
|
|
1004
1159
|
};
|
|
1005
1160
|
window.addEventListener("resize", t), window.visualViewport?.addEventListener("resize", t);
|
|
1006
|
-
const e = l.current,
|
|
1161
|
+
const e = l.current, a = e?.parentElement, c = typeof ResizeObserver > "u" ? null : new ResizeObserver(t), s = (u) => {
|
|
1007
1162
|
e && u.target instanceof Element && e.contains(u.target) && t();
|
|
1008
1163
|
};
|
|
1009
|
-
return c && (e && c.observe(e),
|
|
1164
|
+
return c && (e && c.observe(e), a && c.observe(a)), e?.addEventListener(
|
|
1010
1165
|
"transitionend",
|
|
1011
1166
|
s,
|
|
1012
1167
|
!0
|
|
@@ -1023,20 +1178,20 @@ function mr({
|
|
|
1023
1178
|
"transitioncancel",
|
|
1024
1179
|
s,
|
|
1025
1180
|
!0
|
|
1026
|
-
), c?.disconnect(),
|
|
1181
|
+
), c?.disconnect(), j.current !== null && (window.cancelAnimationFrame(j.current), j.current = null);
|
|
1027
1182
|
};
|
|
1028
1183
|
}, [
|
|
1029
1184
|
r,
|
|
1030
1185
|
i,
|
|
1031
|
-
|
|
1186
|
+
E,
|
|
1032
1187
|
l,
|
|
1033
|
-
|
|
1034
|
-
]),
|
|
1035
|
-
if (
|
|
1188
|
+
gt
|
|
1189
|
+
]), ot(() => {
|
|
1190
|
+
if (re <= 0 || !i || !r || !E)
|
|
1036
1191
|
return;
|
|
1037
1192
|
let t = window.requestAnimationFrame(() => {
|
|
1038
|
-
t = null,
|
|
1039
|
-
key:
|
|
1193
|
+
t = null, gt({
|
|
1194
|
+
key: U.current,
|
|
1040
1195
|
settle: !1
|
|
1041
1196
|
});
|
|
1042
1197
|
});
|
|
@@ -1046,260 +1201,297 @@ function mr({
|
|
|
1046
1201
|
}, [
|
|
1047
1202
|
r,
|
|
1048
1203
|
i,
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1204
|
+
E,
|
|
1205
|
+
re,
|
|
1206
|
+
gt
|
|
1052
1207
|
]);
|
|
1053
|
-
const
|
|
1054
|
-
(t, e,
|
|
1055
|
-
if (typeof Element > "u" || !(t instanceof Element) ||
|
|
1056
|
-
const c = Date.now(), s = e > 0, u =
|
|
1057
|
-
return !
|
|
1208
|
+
const ye = p(
|
|
1209
|
+
(t, e, a) => {
|
|
1210
|
+
if (typeof Element > "u" || !(t instanceof Element) || Wt(t)) return !1;
|
|
1211
|
+
const c = Date.now(), s = e > 0, u = er(t, z.current);
|
|
1212
|
+
return !a && u && s && u.scrollTop > 0 || !a && Xt.current && c - Xt.current < ee && Math.abs(et()) <= 1 ? (Xt.current = c, !1) : !0;
|
|
1058
1213
|
},
|
|
1059
|
-
[
|
|
1060
|
-
),
|
|
1214
|
+
[et, ee]
|
|
1215
|
+
), wt = p(
|
|
1061
1216
|
({
|
|
1062
1217
|
chrome: t,
|
|
1063
1218
|
pointerId: e = null,
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1219
|
+
selectionArbitration: a = !1,
|
|
1220
|
+
source: c,
|
|
1221
|
+
startX: s = 0,
|
|
1222
|
+
startY: u,
|
|
1223
|
+
touchId: d = null
|
|
1068
1224
|
}) => {
|
|
1069
|
-
const { startTranslate:
|
|
1070
|
-
|
|
1225
|
+
const { startTranslate: f, startTranslatePoint: g } = de(), m = Z();
|
|
1226
|
+
M.current = {
|
|
1071
1227
|
dragging: !0,
|
|
1072
1228
|
allowed: !1,
|
|
1073
1229
|
chrome: t,
|
|
1230
|
+
selectionArbitration: a,
|
|
1074
1231
|
closeAllowed: null,
|
|
1075
1232
|
started: !1,
|
|
1076
|
-
source:
|
|
1077
|
-
startX:
|
|
1078
|
-
startY:
|
|
1079
|
-
lastX:
|
|
1080
|
-
lastY:
|
|
1233
|
+
source: c,
|
|
1234
|
+
startX: s,
|
|
1235
|
+
startY: u,
|
|
1236
|
+
lastX: s,
|
|
1237
|
+
lastY: u,
|
|
1081
1238
|
startTranslateX: g.x,
|
|
1082
|
-
startTranslate:
|
|
1239
|
+
startTranslate: f,
|
|
1083
1240
|
lastTranslateX: g.x,
|
|
1084
|
-
lastTranslate:
|
|
1241
|
+
lastTranslate: f,
|
|
1085
1242
|
startTime: m,
|
|
1086
1243
|
samples: [
|
|
1087
1244
|
{
|
|
1088
1245
|
time: m,
|
|
1089
|
-
pageX:
|
|
1090
|
-
pageY:
|
|
1246
|
+
pageX: s,
|
|
1247
|
+
pageY: u,
|
|
1091
1248
|
translateX: g.x,
|
|
1092
|
-
translateY:
|
|
1249
|
+
translateY: f
|
|
1093
1250
|
}
|
|
1094
1251
|
],
|
|
1095
1252
|
pointerId: e,
|
|
1096
|
-
touchId:
|
|
1253
|
+
touchId: d
|
|
1097
1254
|
};
|
|
1098
1255
|
},
|
|
1099
|
-
[
|
|
1100
|
-
),
|
|
1256
|
+
[de]
|
|
1257
|
+
), mt = p(
|
|
1101
1258
|
(t) => {
|
|
1102
|
-
t.source === "touch" ?
|
|
1259
|
+
t.source === "touch" ? it(!1) : t.source === "pointer" && W(!1), t.dragging = !1, t.allowed = !1, t.closeAllowed = null, t.started = !1, t.source = null, t.startX = 0, t.startY = 0, t.lastX = 0, t.lastY = 0, t.startTranslateX = 0, t.startTranslate = 0, t.lastTranslateX = 0, t.lastTranslate = 0, t.pointerId = null, t.touchId = null;
|
|
1103
1260
|
},
|
|
1104
|
-
[
|
|
1105
|
-
),
|
|
1261
|
+
[W, it]
|
|
1262
|
+
), Te = p(
|
|
1106
1263
|
(t, e) => {
|
|
1107
|
-
const
|
|
1108
|
-
t.startX = e.x, t.startY = e.y, t.lastX = e.x, t.lastY = e.y, t.startTranslateX = c.x, t.startTranslate =
|
|
1264
|
+
const a = lt(), c = ct();
|
|
1265
|
+
t.startX = e.x, t.startY = e.y, t.lastX = e.x, t.lastY = e.y, t.startTranslateX = c.x, t.startTranslate = a, t.lastTranslateX = c.x, t.lastTranslate = a, t.startTime = Z(), t.samples = [
|
|
1109
1266
|
{
|
|
1110
1267
|
time: t.startTime,
|
|
1111
1268
|
pageX: e.x,
|
|
1112
1269
|
pageY: e.y,
|
|
1113
1270
|
translateX: c.x,
|
|
1114
|
-
translateY:
|
|
1271
|
+
translateY: a
|
|
1115
1272
|
}
|
|
1116
1273
|
];
|
|
1117
1274
|
},
|
|
1118
|
-
[
|
|
1119
|
-
),
|
|
1275
|
+
[lt, ct]
|
|
1276
|
+
), xe = p(
|
|
1120
1277
|
({
|
|
1121
1278
|
currentTranslate: t,
|
|
1122
1279
|
dismissible: e,
|
|
1123
|
-
releaseVelocity:
|
|
1280
|
+
releaseVelocity: a,
|
|
1124
1281
|
deltaY: c,
|
|
1125
1282
|
startTranslate: s
|
|
1126
1283
|
}) => {
|
|
1127
|
-
const u =
|
|
1128
|
-
|
|
1129
|
-
(u -
|
|
1130
|
-
),
|
|
1131
|
-
(
|
|
1132
|
-
),
|
|
1133
|
-
|
|
1134
|
-
),
|
|
1284
|
+
const u = I(), d = G(), f = d > 0, g = u, m = Math.max(
|
|
1285
|
+
F.dismissal.minDistancePx,
|
|
1286
|
+
(u - d) * Tt
|
|
1287
|
+
), Y = D.map(
|
|
1288
|
+
(Q) => A(u - Q, 0, u)
|
|
1289
|
+
), C = Me(
|
|
1290
|
+
Y.length ? Y : [0]
|
|
1291
|
+
), x = yr({
|
|
1135
1292
|
currentTranslate: t,
|
|
1136
|
-
releaseVelocity:
|
|
1293
|
+
releaseVelocity: a
|
|
1137
1294
|
});
|
|
1138
|
-
|
|
1139
|
-
const
|
|
1140
|
-
return e && !
|
|
1141
|
-
|
|
1295
|
+
f && C.push(d);
|
|
1296
|
+
const P = Me(C);
|
|
1297
|
+
return e && !f && c > 0 && t >= d + m ? g : xr(a) ? P.length > 1 ? pr(
|
|
1298
|
+
P,
|
|
1142
1299
|
s,
|
|
1143
1300
|
t,
|
|
1144
1301
|
c > 0 ? "down" : "up",
|
|
1145
|
-
|
|
1146
|
-
) : 0 : e && t > u *
|
|
1302
|
+
x
|
|
1303
|
+
) : 0 : e && t > u * Tt && !f ? g : ur(P, t);
|
|
1147
1304
|
},
|
|
1148
|
-
[
|
|
1149
|
-
),
|
|
1305
|
+
[Tt, G, I, D]
|
|
1306
|
+
), Pe = p(
|
|
1150
1307
|
(t) => {
|
|
1151
|
-
|
|
1308
|
+
const e = b ?? I();
|
|
1309
|
+
Mt.current = sr({
|
|
1310
|
+
defaultTranslate: S,
|
|
1311
|
+
sheetHeight: e,
|
|
1312
|
+
snapHeights: D,
|
|
1313
|
+
translate: t
|
|
1314
|
+
});
|
|
1315
|
+
},
|
|
1316
|
+
[I, b, D, S]
|
|
1317
|
+
), je = p(
|
|
1318
|
+
(t) => {
|
|
1319
|
+
if (!r || o !== "bottom" && !E || n === !1 || t.pointerType === "touch") return;
|
|
1152
1320
|
let e = !1;
|
|
1153
|
-
if (n === "handle" &&
|
|
1321
|
+
if (n === "handle" && ke(t.target))
|
|
1154
1322
|
e = !0;
|
|
1155
1323
|
else if (n === "handle")
|
|
1156
1324
|
return;
|
|
1157
|
-
if (!e &&
|
|
1325
|
+
if (!e && Wt(t.target)) return;
|
|
1326
|
+
if (n === "content" && (e = Le(t.target), !mr(t, e))) {
|
|
1327
|
+
o === "bottom" && !rr({
|
|
1328
|
+
target: t.target,
|
|
1329
|
+
boundary: z.current
|
|
1330
|
+
}) && wt({
|
|
1331
|
+
chrome: !1,
|
|
1332
|
+
pointerId: t.pointerId,
|
|
1333
|
+
selectionArbitration: !0,
|
|
1334
|
+
source: "pointer",
|
|
1335
|
+
startX: t.pageX,
|
|
1336
|
+
startY: t.pageY
|
|
1337
|
+
});
|
|
1158
1338
|
return;
|
|
1159
|
-
|
|
1160
|
-
|
|
1339
|
+
}
|
|
1340
|
+
const a = gr(t.target);
|
|
1341
|
+
wt({
|
|
1161
1342
|
chrome: e,
|
|
1162
1343
|
pointerId: t.pointerId,
|
|
1163
1344
|
source: "pointer",
|
|
1164
1345
|
startX: t.pageX,
|
|
1165
1346
|
startY: t.pageY
|
|
1166
|
-
}),
|
|
1347
|
+
}), fr(t.target) || t.preventDefault(), W(!0), !a && typeof t.currentTarget.setPointerCapture == "function" && t.currentTarget.setPointerCapture(t.pointerId);
|
|
1167
1348
|
},
|
|
1168
1349
|
[
|
|
1169
|
-
|
|
1350
|
+
wt,
|
|
1170
1351
|
n,
|
|
1171
1352
|
r,
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1353
|
+
o,
|
|
1354
|
+
E,
|
|
1355
|
+
W
|
|
1175
1356
|
]
|
|
1176
|
-
),
|
|
1357
|
+
), ht = p(
|
|
1177
1358
|
(t, e) => {
|
|
1178
|
-
if (!
|
|
1359
|
+
if (!H) return !1;
|
|
1179
1360
|
if (e <= 0) return !0;
|
|
1180
1361
|
if (t.closeAllowed !== null) return t.closeAllowed;
|
|
1181
|
-
const
|
|
1182
|
-
return t.closeAllowed =
|
|
1362
|
+
const a = Zt({ reason: "drag-dismiss" });
|
|
1363
|
+
return t.closeAllowed = a, a;
|
|
1183
1364
|
},
|
|
1184
|
-
[
|
|
1185
|
-
),
|
|
1365
|
+
[Zt, H]
|
|
1366
|
+
), Ft = p(
|
|
1186
1367
|
({
|
|
1187
1368
|
closeAllowed: t,
|
|
1188
1369
|
currentTranslate: e,
|
|
1189
|
-
deltaY:
|
|
1370
|
+
deltaY: a,
|
|
1190
1371
|
releaseVelocity: c,
|
|
1191
1372
|
startTranslate: s
|
|
1192
1373
|
}) => {
|
|
1193
|
-
const
|
|
1374
|
+
const d = xe({
|
|
1194
1375
|
currentTranslate: e,
|
|
1195
|
-
dismissible:
|
|
1376
|
+
dismissible: H && t !== !1,
|
|
1196
1377
|
releaseVelocity: c,
|
|
1197
|
-
deltaY:
|
|
1378
|
+
deltaY: a,
|
|
1198
1379
|
startTranslate: s
|
|
1199
|
-
}),
|
|
1200
|
-
if (
|
|
1201
|
-
|
|
1380
|
+
}), f = I(), g = G();
|
|
1381
|
+
if (d >= f - 1) {
|
|
1382
|
+
at({ reason: "drag-dismiss" }, { commit: !1 }) ? he(d, {
|
|
1202
1383
|
from: e,
|
|
1203
1384
|
initialVelocity: c
|
|
1204
|
-
}) :
|
|
1385
|
+
}) : O(s, {
|
|
1205
1386
|
from: e,
|
|
1206
1387
|
initialVelocity: c
|
|
1207
1388
|
});
|
|
1208
1389
|
return;
|
|
1209
1390
|
}
|
|
1210
|
-
|
|
1211
|
-
presentationState:
|
|
1212
|
-
releaseTranslate:
|
|
1213
|
-
visibleTranslate:
|
|
1214
|
-
}) && (
|
|
1391
|
+
g > 0 && d >= g - 1 ? Nt("peeked") : (Yr({
|
|
1392
|
+
presentationState: V,
|
|
1393
|
+
releaseTranslate: d,
|
|
1394
|
+
visibleTranslate: S
|
|
1395
|
+
}) && (Vt.current = !0), Nt("visible"), Pe(d)), O(d, {
|
|
1215
1396
|
from: e,
|
|
1216
1397
|
initialVelocity: c
|
|
1217
1398
|
});
|
|
1218
1399
|
},
|
|
1219
1400
|
[
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
k,
|
|
1226
|
-
q,
|
|
1227
|
-
bt,
|
|
1401
|
+
he,
|
|
1402
|
+
Pe,
|
|
1403
|
+
H,
|
|
1404
|
+
G,
|
|
1405
|
+
xe,
|
|
1228
1406
|
I,
|
|
1229
|
-
|
|
1407
|
+
V,
|
|
1408
|
+
at,
|
|
1409
|
+
Nt,
|
|
1410
|
+
O,
|
|
1411
|
+
S
|
|
1230
1412
|
]
|
|
1231
|
-
),
|
|
1413
|
+
), At = p(
|
|
1232
1414
|
({
|
|
1233
1415
|
currentTranslate: t,
|
|
1234
1416
|
releaseDelta: e,
|
|
1235
|
-
releaseTranslate:
|
|
1417
|
+
releaseTranslate: a,
|
|
1236
1418
|
releaseVelocity: c
|
|
1237
1419
|
}) => {
|
|
1238
|
-
const s =
|
|
1420
|
+
const s = ut();
|
|
1239
1421
|
if (!s) return;
|
|
1240
|
-
const u =
|
|
1241
|
-
currentTranslate:
|
|
1422
|
+
const u = vr({
|
|
1423
|
+
currentTranslate: a,
|
|
1242
1424
|
releaseVelocity: c,
|
|
1243
1425
|
targets: s.targets
|
|
1244
|
-
}),
|
|
1245
|
-
(
|
|
1246
|
-
) ?? s.defaultTarget,
|
|
1247
|
-
x:
|
|
1248
|
-
y:
|
|
1426
|
+
}), d = s.targets.find(
|
|
1427
|
+
(Y) => Y.key === U.current
|
|
1428
|
+
) ?? s.defaultTarget, g = l.current?.getBoundingClientRect(), m = {
|
|
1429
|
+
x: d.x + e.x,
|
|
1430
|
+
y: d.y + e.y
|
|
1249
1431
|
};
|
|
1250
|
-
if (
|
|
1251
|
-
closeThreshold:
|
|
1252
|
-
currentTarget:
|
|
1253
|
-
currentTranslate:
|
|
1432
|
+
if (H && g && Xr({
|
|
1433
|
+
closeThreshold: Tt,
|
|
1434
|
+
currentTarget: d,
|
|
1435
|
+
currentTranslate: m,
|
|
1254
1436
|
releaseTarget: u,
|
|
1255
1437
|
surfaceSize: {
|
|
1256
|
-
height:
|
|
1257
|
-
width:
|
|
1438
|
+
height: g.height,
|
|
1439
|
+
width: g.width
|
|
1258
1440
|
},
|
|
1259
1441
|
targets: s.targets
|
|
1260
|
-
}) &&
|
|
1261
|
-
|
|
1442
|
+
}) && at({ reason: "drag-dismiss" })) {
|
|
1443
|
+
K(), v();
|
|
1262
1444
|
return;
|
|
1263
1445
|
}
|
|
1264
|
-
if (
|
|
1265
|
-
|
|
1446
|
+
if (U.current = u.key, _.current) {
|
|
1447
|
+
Ct(u);
|
|
1266
1448
|
return;
|
|
1267
1449
|
}
|
|
1268
|
-
|
|
1450
|
+
J(u, {
|
|
1269
1451
|
from: t,
|
|
1270
1452
|
initialVelocity: c
|
|
1271
1453
|
});
|
|
1272
1454
|
},
|
|
1273
1455
|
[
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1456
|
+
K,
|
|
1457
|
+
Tt,
|
|
1458
|
+
H,
|
|
1459
|
+
v,
|
|
1460
|
+
ut,
|
|
1278
1461
|
at,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
U,
|
|
1462
|
+
Ct,
|
|
1463
|
+
J,
|
|
1282
1464
|
l
|
|
1283
1465
|
]
|
|
1284
|
-
),
|
|
1466
|
+
), ze = p(
|
|
1285
1467
|
(t) => {
|
|
1286
|
-
const e =
|
|
1287
|
-
if (!e.dragging || e.source !== "pointer" || !r ||
|
|
1468
|
+
const e = M.current;
|
|
1469
|
+
if (!e.dragging || e.source !== "pointer" || !r || o !== "bottom" && !E)
|
|
1288
1470
|
return;
|
|
1289
|
-
const
|
|
1290
|
-
if (!(!e.started &&
|
|
1471
|
+
const a = t.pageX - e.startX, c = t.pageY - e.startY, s = t.pointerType === "touch" ? F.dragStartThresholdPx.touch : F.dragStartThresholdPx.mouse;
|
|
1472
|
+
if (!(!e.started && Ee({ deltaX: a, deltaY: c, placement: o }) < s)) {
|
|
1473
|
+
if (e.selectionArbitration && !e.allowed) {
|
|
1474
|
+
const u = Math.abs(a), d = Math.abs(c), f = F.selectionArbitrationThresholdPx;
|
|
1475
|
+
if (u >= f && u >= d) {
|
|
1476
|
+
e.dragging = !1;
|
|
1477
|
+
return;
|
|
1478
|
+
}
|
|
1479
|
+
if (d < f || d <= u)
|
|
1480
|
+
return;
|
|
1481
|
+
window.getSelection?.()?.removeAllRanges(), W(!0);
|
|
1482
|
+
}
|
|
1291
1483
|
if (!e.allowed) {
|
|
1292
|
-
if (
|
|
1484
|
+
if (o === "bottom" && !ye(t.target, c, e.chrome))
|
|
1293
1485
|
return;
|
|
1294
1486
|
e.allowed = !0, e.started = !0;
|
|
1295
1487
|
const u = t.currentTarget;
|
|
1296
1488
|
e.pointerId !== null && typeof u.hasPointerCapture == "function" && typeof u.setPointerCapture == "function" && !u.hasPointerCapture(e.pointerId) && u.setPointerCapture(e.pointerId);
|
|
1297
1489
|
}
|
|
1298
|
-
if (t.preventDefault(), e.lastX = t.pageX, e.lastY = t.pageY,
|
|
1299
|
-
|
|
1490
|
+
if (t.preventDefault(), e.lastX = t.pageX, e.lastY = t.pageY, o === "popup")
|
|
1491
|
+
ft(e, t), Be(e, t);
|
|
1300
1492
|
else {
|
|
1301
|
-
const u = e.startTranslate + c,
|
|
1302
|
-
|
|
1493
|
+
const u = e.startTranslate + c, d = ht(e, c);
|
|
1494
|
+
dt(u, d), St(e, {
|
|
1303
1495
|
pageX: t.pageX,
|
|
1304
1496
|
pageY: t.pageY,
|
|
1305
1497
|
translateX: e.lastTranslateX,
|
|
@@ -1310,151 +1502,152 @@ function mr({
|
|
|
1310
1502
|
},
|
|
1311
1503
|
[
|
|
1312
1504
|
r,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1505
|
+
ft,
|
|
1506
|
+
ht,
|
|
1507
|
+
o,
|
|
1508
|
+
E,
|
|
1509
|
+
W,
|
|
1510
|
+
dt,
|
|
1511
|
+
ye
|
|
1319
1512
|
]
|
|
1320
|
-
),
|
|
1513
|
+
), rt = p(
|
|
1321
1514
|
({
|
|
1322
1515
|
currentTarget: t,
|
|
1323
1516
|
pageX: e,
|
|
1324
|
-
pageY:
|
|
1517
|
+
pageY: a,
|
|
1325
1518
|
releaseCapture: c = !0
|
|
1326
1519
|
}) => {
|
|
1327
|
-
const s =
|
|
1328
|
-
if (!s.dragging || s.source !== "pointer" || !r ||
|
|
1520
|
+
const s = M.current;
|
|
1521
|
+
if (!s.dragging || s.source !== "pointer" || !r || o !== "bottom" && !E)
|
|
1329
1522
|
return;
|
|
1330
|
-
const u = s.started,
|
|
1331
|
-
let
|
|
1523
|
+
const u = s.started, d = Number.isFinite(e) ? e : s.lastX, f = Number.isFinite(a) ? a : s.lastY, g = d - s.startX, m = f - s.startY, Y = Math.max(Z() - s.startTime, 1);
|
|
1524
|
+
let C = {
|
|
1332
1525
|
x: s.lastTranslateX,
|
|
1333
1526
|
y: s.lastTranslate
|
|
1334
|
-
},
|
|
1335
|
-
const
|
|
1527
|
+
}, x = C;
|
|
1528
|
+
const P = s.startTranslate;
|
|
1336
1529
|
if (u)
|
|
1337
|
-
if (
|
|
1338
|
-
|
|
1339
|
-
pageX:
|
|
1340
|
-
pageY:
|
|
1341
|
-
}),
|
|
1530
|
+
if (o === "popup")
|
|
1531
|
+
ft(s, {
|
|
1532
|
+
pageX: d,
|
|
1533
|
+
pageY: f
|
|
1534
|
+
}), C = {
|
|
1342
1535
|
x: s.lastTranslateX,
|
|
1343
1536
|
y: s.lastTranslate
|
|
1344
|
-
},
|
|
1345
|
-
pageX:
|
|
1346
|
-
pageY:
|
|
1537
|
+
}, x = Ot(s, {
|
|
1538
|
+
pageX: d,
|
|
1539
|
+
pageY: f
|
|
1347
1540
|
});
|
|
1348
1541
|
else {
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1542
|
+
const N = s.startTranslate + m, Dt = ht(s, m);
|
|
1543
|
+
dt(N, Dt), C = {
|
|
1351
1544
|
x: s.lastTranslateX,
|
|
1352
1545
|
y: s.lastTranslate
|
|
1353
1546
|
};
|
|
1354
1547
|
}
|
|
1355
|
-
const
|
|
1548
|
+
const Q = s.closeAllowed;
|
|
1356
1549
|
if (c && t && s.pointerId !== null && t.hasPointerCapture(s.pointerId) && t.releasePointerCapture(s.pointerId), u) {
|
|
1357
|
-
const
|
|
1550
|
+
const N = o === "popup" ? x : {
|
|
1358
1551
|
x: s.lastTranslateX,
|
|
1359
1552
|
y: s.lastTranslate
|
|
1360
1553
|
};
|
|
1361
|
-
|
|
1362
|
-
pageX:
|
|
1363
|
-
pageY:
|
|
1364
|
-
translateX:
|
|
1365
|
-
translateY:
|
|
1554
|
+
St(s, {
|
|
1555
|
+
pageX: d,
|
|
1556
|
+
pageY: f,
|
|
1557
|
+
translateX: N.x,
|
|
1558
|
+
translateY: N.y
|
|
1366
1559
|
});
|
|
1367
1560
|
}
|
|
1368
|
-
if (
|
|
1369
|
-
if (
|
|
1370
|
-
const
|
|
1561
|
+
if (mt(s), !!u)
|
|
1562
|
+
if (xt.current = Z() + 500, o === "popup") {
|
|
1563
|
+
const N = Oe({
|
|
1371
1564
|
session: s,
|
|
1372
|
-
fallbackDelta: { x:
|
|
1373
|
-
fallbackElapsed:
|
|
1565
|
+
fallbackDelta: { x: g, y: m },
|
|
1566
|
+
fallbackElapsed: Y
|
|
1374
1567
|
});
|
|
1375
|
-
|
|
1376
|
-
currentTranslate:
|
|
1377
|
-
releaseDelta: { x:
|
|
1378
|
-
releaseTranslate:
|
|
1379
|
-
releaseVelocity:
|
|
1568
|
+
At({
|
|
1569
|
+
currentTranslate: C,
|
|
1570
|
+
releaseDelta: { x: g, y: m },
|
|
1571
|
+
releaseTranslate: x,
|
|
1572
|
+
releaseVelocity: N
|
|
1380
1573
|
});
|
|
1381
1574
|
} else {
|
|
1382
|
-
const
|
|
1575
|
+
const N = Ie({
|
|
1383
1576
|
session: s,
|
|
1384
|
-
fallbackDeltaY:
|
|
1385
|
-
fallbackElapsed:
|
|
1577
|
+
fallbackDeltaY: m,
|
|
1578
|
+
fallbackElapsed: Y
|
|
1386
1579
|
});
|
|
1387
|
-
|
|
1388
|
-
closeAllowed:
|
|
1389
|
-
currentTranslate:
|
|
1390
|
-
deltaY:
|
|
1391
|
-
releaseVelocity:
|
|
1392
|
-
startTranslate:
|
|
1580
|
+
Ft({
|
|
1581
|
+
closeAllowed: Q,
|
|
1582
|
+
currentTranslate: C.y,
|
|
1583
|
+
deltaY: m,
|
|
1584
|
+
releaseVelocity: N,
|
|
1585
|
+
startTranslate: P
|
|
1393
1586
|
});
|
|
1394
1587
|
}
|
|
1395
1588
|
},
|
|
1396
1589
|
[
|
|
1397
|
-
|
|
1398
|
-
|
|
1590
|
+
Ft,
|
|
1591
|
+
At,
|
|
1399
1592
|
r,
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1593
|
+
ft,
|
|
1594
|
+
ht,
|
|
1595
|
+
o,
|
|
1596
|
+
E,
|
|
1597
|
+
mt,
|
|
1598
|
+
dt
|
|
1406
1599
|
]
|
|
1407
|
-
),
|
|
1600
|
+
), ve = p(
|
|
1408
1601
|
(t) => {
|
|
1409
|
-
|
|
1602
|
+
rt({
|
|
1410
1603
|
currentTarget: t.currentTarget,
|
|
1411
1604
|
pageX: t.pageX,
|
|
1412
1605
|
pageY: t.pageY
|
|
1413
1606
|
});
|
|
1414
1607
|
},
|
|
1415
|
-
[
|
|
1416
|
-
),
|
|
1608
|
+
[rt]
|
|
1609
|
+
), Ue = p(
|
|
1417
1610
|
(t) => {
|
|
1418
|
-
const e =
|
|
1419
|
-
e.pointerId !== null && t.pointerId !== e.pointerId ||
|
|
1611
|
+
const e = M.current;
|
|
1612
|
+
e.pointerId !== null && t.pointerId !== e.pointerId || rt({
|
|
1420
1613
|
pageX: t.pageX,
|
|
1421
1614
|
pageY: t.pageY,
|
|
1422
1615
|
releaseCapture: !1
|
|
1423
1616
|
});
|
|
1424
1617
|
},
|
|
1425
|
-
[
|
|
1618
|
+
[rt]
|
|
1426
1619
|
);
|
|
1427
|
-
|
|
1620
|
+
It(() => {
|
|
1428
1621
|
if (!r) return;
|
|
1429
1622
|
const t = (s) => {
|
|
1430
|
-
const u =
|
|
1431
|
-
!u.dragging || u.source !== "pointer" || "pointerId" in s && u.pointerId !== null && s.pointerId !== u.pointerId ||
|
|
1623
|
+
const u = M.current;
|
|
1624
|
+
!u.dragging || u.source !== "pointer" || "pointerId" in s && u.pointerId !== null && s.pointerId !== u.pointerId || rt({
|
|
1432
1625
|
pageX: s.pageX,
|
|
1433
1626
|
pageY: s.pageY,
|
|
1434
1627
|
releaseCapture: !1
|
|
1435
1628
|
});
|
|
1436
1629
|
}, e = () => {
|
|
1437
|
-
const s =
|
|
1438
|
-
!s.dragging || s.source !== "pointer" ||
|
|
1630
|
+
const s = M.current;
|
|
1631
|
+
!s.dragging || s.source !== "pointer" || rt({
|
|
1439
1632
|
pageX: s.lastX,
|
|
1440
1633
|
pageY: s.lastY,
|
|
1441
1634
|
releaseCapture: !1
|
|
1442
1635
|
});
|
|
1443
|
-
},
|
|
1444
|
-
const u =
|
|
1636
|
+
}, a = (s) => {
|
|
1637
|
+
const u = M.current;
|
|
1445
1638
|
!u.dragging || u.source !== "pointer" || s.relatedTarget === null && t(s);
|
|
1446
1639
|
}, c = (s) => {
|
|
1447
|
-
const u =
|
|
1640
|
+
const u = M.current;
|
|
1448
1641
|
!u.dragging || u.source !== "pointer" || s.relatedTarget === null && t(s);
|
|
1449
1642
|
};
|
|
1450
|
-
return document.addEventListener("pointerout",
|
|
1643
|
+
return document.addEventListener("pointerout", a, !0), document.addEventListener("mouseout", c, !0), window.addEventListener("pointerup", t, !0), window.addEventListener(
|
|
1451
1644
|
"pointercancel",
|
|
1452
1645
|
t,
|
|
1453
1646
|
!0
|
|
1454
1647
|
), window.addEventListener("blur", e), () => {
|
|
1455
1648
|
document.removeEventListener(
|
|
1456
1649
|
"pointerout",
|
|
1457
|
-
|
|
1650
|
+
a,
|
|
1458
1651
|
!0
|
|
1459
1652
|
), document.removeEventListener("mouseout", c, !0), window.removeEventListener(
|
|
1460
1653
|
"pointerup",
|
|
@@ -1466,94 +1659,95 @@ function mr({
|
|
|
1466
1659
|
!0
|
|
1467
1660
|
), window.removeEventListener("blur", e);
|
|
1468
1661
|
};
|
|
1469
|
-
}, [
|
|
1662
|
+
}, [rt, r]), It(() => {
|
|
1470
1663
|
if (!r) return;
|
|
1471
1664
|
const t = (e) => {
|
|
1472
|
-
const
|
|
1473
|
-
if (
|
|
1474
|
-
if (
|
|
1475
|
-
|
|
1665
|
+
const a = xt.current;
|
|
1666
|
+
if (a <= 0) return;
|
|
1667
|
+
if (Z() > a) {
|
|
1668
|
+
xt.current = 0;
|
|
1476
1669
|
return;
|
|
1477
1670
|
}
|
|
1478
1671
|
const c = l.current;
|
|
1479
|
-
c && e.target instanceof Node && c.contains(e.target) && (
|
|
1672
|
+
c && e.target instanceof Node && c.contains(e.target) && (xt.current = 0, e.preventDefault(), e.stopPropagation());
|
|
1480
1673
|
};
|
|
1481
1674
|
return document.addEventListener("click", t, !0), () => {
|
|
1482
1675
|
document.removeEventListener("click", t, !0);
|
|
1483
1676
|
};
|
|
1484
1677
|
}, [r, l]);
|
|
1485
|
-
const
|
|
1486
|
-
const e =
|
|
1487
|
-
return e.touchId !== null ?
|
|
1488
|
-
}, []),
|
|
1678
|
+
const Bt = p((t) => {
|
|
1679
|
+
const e = M.current;
|
|
1680
|
+
return e.touchId !== null ? Fe(t.changedTouches, e.touchId) ?? Fe(t.touches, e.touchId) : t.touches[0] ?? t.changedTouches[0] ?? null;
|
|
1681
|
+
}, []), We = p(
|
|
1489
1682
|
(t) => {
|
|
1490
|
-
if (!r ||
|
|
1683
|
+
if (!r || o !== "bottom" && !E || n === !1 || t.touches.length !== 1) return;
|
|
1491
1684
|
let e = !1;
|
|
1492
|
-
if (n === "handle" &&
|
|
1685
|
+
if (n === "handle" && ke(t.target))
|
|
1493
1686
|
e = !0;
|
|
1494
1687
|
else if (n === "handle")
|
|
1495
1688
|
return;
|
|
1496
|
-
if (!e &&
|
|
1497
|
-
n === "content" && (e =
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1689
|
+
if (!e && Wt(t.target)) return;
|
|
1690
|
+
n === "content" && (e = Le(t.target));
|
|
1691
|
+
const a = t.touches[0];
|
|
1692
|
+
o === "bottom" && bt({
|
|
1500
1693
|
target: t.target,
|
|
1501
1694
|
chrome: e
|
|
1502
|
-
}),
|
|
1695
|
+
}), wt({
|
|
1503
1696
|
chrome: e,
|
|
1504
1697
|
source: "touch",
|
|
1505
|
-
startX:
|
|
1506
|
-
startY:
|
|
1507
|
-
touchId:
|
|
1698
|
+
startX: a.pageX,
|
|
1699
|
+
startY: a.pageY,
|
|
1700
|
+
touchId: a.identifier
|
|
1508
1701
|
});
|
|
1509
1702
|
},
|
|
1510
1703
|
[
|
|
1511
|
-
|
|
1704
|
+
wt,
|
|
1512
1705
|
n,
|
|
1513
1706
|
r,
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1707
|
+
o,
|
|
1708
|
+
E,
|
|
1709
|
+
bt
|
|
1517
1710
|
]
|
|
1518
|
-
),
|
|
1711
|
+
), we = p(
|
|
1519
1712
|
(t) => {
|
|
1520
|
-
const e =
|
|
1521
|
-
if (!e.dragging || e.source !== "touch" || !r ||
|
|
1713
|
+
const e = M.current;
|
|
1714
|
+
if (!e.dragging || e.source !== "touch" || !r || o !== "bottom" && !E)
|
|
1522
1715
|
return;
|
|
1523
|
-
const
|
|
1524
|
-
if (!
|
|
1525
|
-
const c =
|
|
1716
|
+
const a = Bt(t);
|
|
1717
|
+
if (!a) return;
|
|
1718
|
+
const c = a.pageX - e.startX, s = a.pageY - e.startY, u = Ee({
|
|
1526
1719
|
deltaX: c,
|
|
1527
1720
|
deltaY: s,
|
|
1528
|
-
placement:
|
|
1529
|
-
}),
|
|
1721
|
+
placement: o
|
|
1722
|
+
}), d = F.dragStartThresholdPx.touch, f = o === "bottom" ? nr({
|
|
1530
1723
|
target: t.target,
|
|
1531
1724
|
deltaY: s,
|
|
1532
1725
|
chrome: e.chrome,
|
|
1533
|
-
bodyNode:
|
|
1534
|
-
|
|
1726
|
+
bodyNode: z.current,
|
|
1727
|
+
canExpand: lt() > 1
|
|
1728
|
+
}) : or({
|
|
1535
1729
|
target: t.target,
|
|
1536
|
-
bodyNode:
|
|
1730
|
+
bodyNode: z.current
|
|
1537
1731
|
});
|
|
1538
|
-
if (
|
|
1539
|
-
const
|
|
1540
|
-
!
|
|
1732
|
+
if (f.preventDefault) {
|
|
1733
|
+
const m = o === "bottom" && Math.abs(c) > Math.abs(s) && Math.abs(s) < d && !e.started && u < d;
|
|
1734
|
+
!m && o === "bottom" && bt({
|
|
1541
1735
|
target: t.target,
|
|
1542
1736
|
chrome: e.chrome
|
|
1543
|
-
}),
|
|
1737
|
+
}), m || Ye(t);
|
|
1544
1738
|
}
|
|
1545
|
-
if (
|
|
1546
|
-
|
|
1739
|
+
if (f.resetAnchor) {
|
|
1740
|
+
it(!1), Te(e, { x: a.pageX, y: a.pageY });
|
|
1547
1741
|
return;
|
|
1548
1742
|
}
|
|
1549
|
-
if (
|
|
1550
|
-
if (e.allowed || (e.allowed = !0, e.started = !0),
|
|
1551
|
-
|
|
1743
|
+
if (f.allowDrag && !(!e.started && u < d))
|
|
1744
|
+
if (e.allowed || (e.allowed = !0, e.started = !0), f.preventDefault || Ye(t), e.lastX = a.pageX, e.lastY = a.pageY, o === "popup")
|
|
1745
|
+
ft(e, a), Be(e, a);
|
|
1552
1746
|
else {
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1555
|
-
pageX:
|
|
1556
|
-
pageY:
|
|
1747
|
+
const g = e.startTranslate + s, m = ht(e, s);
|
|
1748
|
+
dt(g, m), St(e, {
|
|
1749
|
+
pageX: a.pageX,
|
|
1750
|
+
pageY: a.pageY,
|
|
1557
1751
|
translateX: e.lastTranslateX,
|
|
1558
1752
|
translateY: e.lastTranslate
|
|
1559
1753
|
});
|
|
@@ -1561,21 +1755,22 @@ function mr({
|
|
|
1561
1755
|
},
|
|
1562
1756
|
[
|
|
1563
1757
|
r,
|
|
1758
|
+
ft,
|
|
1759
|
+
ht,
|
|
1760
|
+
lt,
|
|
1761
|
+
Bt,
|
|
1762
|
+
o,
|
|
1763
|
+
E,
|
|
1764
|
+
Te,
|
|
1564
1765
|
it,
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
a,
|
|
1568
|
-
v,
|
|
1569
|
-
ae,
|
|
1570
|
-
et,
|
|
1571
|
-
ot,
|
|
1572
|
-
xt
|
|
1766
|
+
dt,
|
|
1767
|
+
bt
|
|
1573
1768
|
]
|
|
1574
1769
|
);
|
|
1575
|
-
|
|
1576
|
-
if (!i || !r ||
|
|
1770
|
+
It(() => {
|
|
1771
|
+
if (!i || !r || o !== "bottom" && !E || n === !1 || typeof window > "u") return;
|
|
1577
1772
|
const t = (e) => {
|
|
1578
|
-
|
|
1773
|
+
we(e);
|
|
1579
1774
|
};
|
|
1580
1775
|
return window.addEventListener("touchmove", t, {
|
|
1581
1776
|
capture: !0,
|
|
@@ -1583,108 +1778,108 @@ function mr({
|
|
|
1583
1778
|
}), () => {
|
|
1584
1779
|
window.removeEventListener("touchmove", t, !0);
|
|
1585
1780
|
};
|
|
1586
|
-
}, [n, r,
|
|
1587
|
-
const
|
|
1781
|
+
}, [n, r, we, i, o, E]);
|
|
1782
|
+
const Ge = p(
|
|
1588
1783
|
(t) => {
|
|
1589
|
-
const e =
|
|
1590
|
-
if (!e.dragging || e.source !== "touch" || !r ||
|
|
1784
|
+
const e = M.current;
|
|
1785
|
+
if (!e.dragging || e.source !== "touch" || !r || o !== "bottom" && !E)
|
|
1591
1786
|
return;
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
const
|
|
1787
|
+
const a = Bt(t), c = a?.pageX ?? e.lastX, s = a?.pageY ?? e.lastY, u = e.started, d = e.closeAllowed, f = c - e.startX, g = s - e.startY, m = Math.max(Z() - e.startTime, 1);
|
|
1788
|
+
o === "popup" && pt();
|
|
1789
|
+
const Y = {
|
|
1595
1790
|
x: e.lastTranslateX,
|
|
1596
1791
|
y: e.lastTranslate
|
|
1597
1792
|
};
|
|
1598
|
-
let
|
|
1599
|
-
const
|
|
1793
|
+
let C = Y;
|
|
1794
|
+
const x = e.startTranslate;
|
|
1600
1795
|
if (u) {
|
|
1601
|
-
const
|
|
1796
|
+
const P = o === "popup" ? Ot(e, {
|
|
1602
1797
|
pageX: c,
|
|
1603
1798
|
pageY: s
|
|
1604
1799
|
}) : {
|
|
1605
1800
|
x: e.lastTranslateX,
|
|
1606
1801
|
y: e.lastTranslate
|
|
1607
1802
|
};
|
|
1608
|
-
|
|
1803
|
+
C = P, St(e, {
|
|
1609
1804
|
pageX: c,
|
|
1610
1805
|
pageY: s,
|
|
1611
|
-
translateX:
|
|
1612
|
-
translateY:
|
|
1806
|
+
translateX: P.x,
|
|
1807
|
+
translateY: P.y
|
|
1613
1808
|
});
|
|
1614
1809
|
}
|
|
1615
|
-
if (
|
|
1616
|
-
if (
|
|
1617
|
-
const
|
|
1810
|
+
if (mt(e), !!u)
|
|
1811
|
+
if (xt.current = Z() + 500, o === "popup") {
|
|
1812
|
+
const P = Oe({
|
|
1618
1813
|
session: e,
|
|
1619
|
-
fallbackDelta: { x:
|
|
1620
|
-
fallbackElapsed:
|
|
1814
|
+
fallbackDelta: { x: f, y: g },
|
|
1815
|
+
fallbackElapsed: m
|
|
1621
1816
|
});
|
|
1622
|
-
|
|
1623
|
-
currentTranslate:
|
|
1624
|
-
releaseDelta: { x:
|
|
1625
|
-
releaseTranslate:
|
|
1626
|
-
releaseVelocity:
|
|
1817
|
+
At({
|
|
1818
|
+
currentTranslate: Y,
|
|
1819
|
+
releaseDelta: { x: f, y: g },
|
|
1820
|
+
releaseTranslate: C,
|
|
1821
|
+
releaseVelocity: P
|
|
1627
1822
|
});
|
|
1628
1823
|
} else {
|
|
1629
|
-
const
|
|
1824
|
+
const P = Ie({
|
|
1630
1825
|
session: e,
|
|
1631
|
-
fallbackDeltaY:
|
|
1632
|
-
fallbackElapsed:
|
|
1826
|
+
fallbackDeltaY: g,
|
|
1827
|
+
fallbackElapsed: m
|
|
1633
1828
|
});
|
|
1634
|
-
|
|
1635
|
-
closeAllowed:
|
|
1636
|
-
currentTranslate:
|
|
1637
|
-
deltaY:
|
|
1638
|
-
releaseVelocity:
|
|
1639
|
-
startTranslate:
|
|
1829
|
+
Ft({
|
|
1830
|
+
closeAllowed: d,
|
|
1831
|
+
currentTranslate: Y.y,
|
|
1832
|
+
deltaY: g,
|
|
1833
|
+
releaseVelocity: P,
|
|
1834
|
+
startTranslate: x
|
|
1640
1835
|
});
|
|
1641
1836
|
}
|
|
1642
1837
|
},
|
|
1643
1838
|
[
|
|
1644
|
-
|
|
1645
|
-
|
|
1839
|
+
Ft,
|
|
1840
|
+
At,
|
|
1646
1841
|
r,
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1842
|
+
Bt,
|
|
1843
|
+
o,
|
|
1844
|
+
E,
|
|
1845
|
+
mt,
|
|
1846
|
+
pt
|
|
1652
1847
|
]
|
|
1653
|
-
),
|
|
1654
|
-
const t =
|
|
1848
|
+
), Ke = p(() => {
|
|
1849
|
+
const t = M.current;
|
|
1655
1850
|
if (!t.dragging || t.source !== "touch") return;
|
|
1656
|
-
const e = t.started,
|
|
1851
|
+
const e = t.started, a = t.startTranslate, c = t.lastTranslate, s = {
|
|
1657
1852
|
x: t.startTranslateX,
|
|
1658
1853
|
y: t.startTranslate
|
|
1659
1854
|
}, u = {
|
|
1660
1855
|
x: t.lastTranslateX,
|
|
1661
1856
|
y: t.lastTranslate
|
|
1662
|
-
},
|
|
1663
|
-
if (
|
|
1664
|
-
if (
|
|
1665
|
-
|
|
1857
|
+
}, d = o;
|
|
1858
|
+
if (mt(t), !!e) {
|
|
1859
|
+
if (d === "popup") {
|
|
1860
|
+
_.current ? Ct(s) : J(s, { from: u });
|
|
1666
1861
|
return;
|
|
1667
1862
|
}
|
|
1668
|
-
|
|
1863
|
+
O(a, { from: c });
|
|
1669
1864
|
}
|
|
1670
1865
|
}, [
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1866
|
+
o,
|
|
1867
|
+
mt,
|
|
1868
|
+
Ct,
|
|
1869
|
+
J,
|
|
1870
|
+
O
|
|
1676
1871
|
]);
|
|
1677
1872
|
return {
|
|
1678
|
-
onPointerDown:
|
|
1679
|
-
onPointerMove:
|
|
1680
|
-
onPointerUp:
|
|
1681
|
-
onPointerCancel:
|
|
1682
|
-
onLostPointerCapture:
|
|
1683
|
-
onTouchStart:
|
|
1684
|
-
onTouchEnd:
|
|
1685
|
-
onTouchCancel:
|
|
1873
|
+
onPointerDown: je,
|
|
1874
|
+
onPointerMove: ze,
|
|
1875
|
+
onPointerUp: ve,
|
|
1876
|
+
onPointerCancel: ve,
|
|
1877
|
+
onLostPointerCapture: Ue,
|
|
1878
|
+
onTouchStart: We,
|
|
1879
|
+
onTouchEnd: Ge,
|
|
1880
|
+
onTouchCancel: Ke
|
|
1686
1881
|
};
|
|
1687
1882
|
}
|
|
1688
1883
|
export {
|
|
1689
|
-
|
|
1884
|
+
Nr as useModalDrag
|
|
1690
1885
|
};
|