@luciodale/swipe-bar 1.3.4 → 1.3.6
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/SwipeBarProvider.d.ts +26 -12
- package/dist/SwipeBarProvider.d.ts.map +1 -1
- package/dist/ToggleLeft.d.ts +4 -2
- package/dist/ToggleLeft.d.ts.map +1 -1
- package/dist/ToggleRight.d.ts +4 -2
- package/dist/ToggleRight.d.ts.map +1 -1
- package/dist/components/SwipeBarBottom.d.ts +1 -1
- package/dist/components/SwipeBarBottom.d.ts.map +1 -1
- package/dist/components/SwipeBarLeft.d.ts +1 -1
- package/dist/components/SwipeBarLeft.d.ts.map +1 -1
- package/dist/components/SwipeBarRight.d.ts +1 -1
- package/dist/components/SwipeBarRight.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/swipe-bar.es.js +1526 -1271
- package/dist/swipe-bar.umd.js +2 -18
- package/dist/swipeSidebarShared.d.ts +8 -0
- package/dist/swipeSidebarShared.d.ts.map +1 -1
- package/dist/test-utils.d.ts +8 -8
- package/dist/useDefaultOpen.d.ts +10 -0
- package/dist/useDefaultOpen.d.ts.map +1 -0
- package/dist/useFocusTrap.d.ts.map +1 -1
- package/dist/useSwipeBarContext.d.ts +38 -4
- package/dist/useSwipeBarContext.d.ts.map +1 -1
- package/dist/useSwipeLeftSidebar.d.ts +1 -1
- package/dist/useSwipeLeftSidebar.d.ts.map +1 -1
- package/dist/useSwipeRightSidebar.d.ts +1 -1
- package/dist/useSwipeRightSidebar.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/swipe-bar.es.js
CHANGED
|
@@ -1,701 +1,805 @@
|
|
|
1
|
-
import
|
|
2
|
-
var Re = { exports: {} },
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
17
|
-
function r(i, c, o) {
|
|
18
|
-
var u = null;
|
|
19
|
-
if (o !== void 0 && (u = "" + o), c.key !== void 0 && (u = "" + c.key), "key" in c) {
|
|
20
|
-
o = {};
|
|
21
|
-
for (var f in c)
|
|
22
|
-
f !== "key" && (o[f] = c[f]);
|
|
23
|
-
} else o = c;
|
|
24
|
-
return c = o.ref, {
|
|
1
|
+
import or, { createContext as sr, useState as te, useRef as L, useMemo as Te, useCallback as E, useEffect as q, useContext as ar, useLayoutEffect as cr } from "react";
|
|
2
|
+
var Re = { exports: {} }, ye = {};
|
|
3
|
+
var qe;
|
|
4
|
+
function lr() {
|
|
5
|
+
if (qe) return ye;
|
|
6
|
+
qe = 1;
|
|
7
|
+
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function r(n, l, c) {
|
|
9
|
+
var d = null;
|
|
10
|
+
if (c !== void 0 && (d = "" + c), l.key !== void 0 && (d = "" + l.key), "key" in l) {
|
|
11
|
+
c = {};
|
|
12
|
+
for (var h in l)
|
|
13
|
+
h !== "key" && (c[h] = l[h]);
|
|
14
|
+
} else c = l;
|
|
15
|
+
return l = c.ref, {
|
|
25
16
|
$$typeof: e,
|
|
26
|
-
type:
|
|
27
|
-
key:
|
|
28
|
-
ref:
|
|
29
|
-
props:
|
|
17
|
+
type: n,
|
|
18
|
+
key: d,
|
|
19
|
+
ref: l !== void 0 ? l : null,
|
|
20
|
+
props: c
|
|
30
21
|
};
|
|
31
22
|
}
|
|
32
|
-
return
|
|
23
|
+
return ye.Fragment = t, ye.jsx = r, ye.jsxs = r, ye;
|
|
33
24
|
}
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
function At() {
|
|
46
|
-
return We || (We = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
-
function e(n) {
|
|
48
|
-
if (n == null) return null;
|
|
49
|
-
if (typeof n == "function")
|
|
50
|
-
return n.$$typeof === q ? null : n.displayName || n.name || null;
|
|
51
|
-
if (typeof n == "string") return n;
|
|
52
|
-
switch (n) {
|
|
53
|
-
case P:
|
|
25
|
+
var ve = {};
|
|
26
|
+
var Qe;
|
|
27
|
+
function ur() {
|
|
28
|
+
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
|
+
function e(a) {
|
|
30
|
+
if (a == null) return null;
|
|
31
|
+
if (typeof a == "function")
|
|
32
|
+
return a.$$typeof === Q ? null : a.displayName || a.name || null;
|
|
33
|
+
if (typeof a == "string") return a;
|
|
34
|
+
switch (a) {
|
|
35
|
+
case w:
|
|
54
36
|
return "Fragment";
|
|
55
|
-
case
|
|
37
|
+
case _:
|
|
56
38
|
return "Profiler";
|
|
57
|
-
case
|
|
39
|
+
case x:
|
|
58
40
|
return "StrictMode";
|
|
59
41
|
case k:
|
|
60
42
|
return "Suspense";
|
|
61
|
-
case
|
|
43
|
+
case W:
|
|
62
44
|
return "SuspenseList";
|
|
63
|
-
case
|
|
45
|
+
case j:
|
|
64
46
|
return "Activity";
|
|
65
47
|
}
|
|
66
|
-
if (typeof
|
|
67
|
-
switch (typeof
|
|
48
|
+
if (typeof a == "object")
|
|
49
|
+
switch (typeof a.tag == "number" && console.error(
|
|
68
50
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
-
),
|
|
70
|
-
case
|
|
51
|
+
), a.$$typeof) {
|
|
52
|
+
case u:
|
|
71
53
|
return "Portal";
|
|
72
|
-
case
|
|
73
|
-
return
|
|
74
|
-
case $:
|
|
75
|
-
return (n._context.displayName || "Context") + ".Consumer";
|
|
54
|
+
case Y:
|
|
55
|
+
return a.displayName || "Context";
|
|
76
56
|
case B:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return
|
|
81
|
-
case
|
|
82
|
-
|
|
57
|
+
return (a._context.displayName || "Context") + ".Consumer";
|
|
58
|
+
case H:
|
|
59
|
+
var y = a.render;
|
|
60
|
+
return a = a.displayName, a || (a = y.displayName || y.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
|
|
61
|
+
case X:
|
|
62
|
+
return y = a.displayName || null, y !== null ? y : e(a.type) || "Memo";
|
|
63
|
+
case V:
|
|
64
|
+
y = a._payload, a = a._init;
|
|
83
65
|
try {
|
|
84
|
-
return e(
|
|
66
|
+
return e(a(y));
|
|
85
67
|
} catch {
|
|
86
68
|
}
|
|
87
69
|
}
|
|
88
70
|
return null;
|
|
89
71
|
}
|
|
90
|
-
function t(
|
|
91
|
-
return "" +
|
|
72
|
+
function t(a) {
|
|
73
|
+
return "" + a;
|
|
92
74
|
}
|
|
93
|
-
function r(
|
|
75
|
+
function r(a) {
|
|
94
76
|
try {
|
|
95
|
-
t(
|
|
96
|
-
var
|
|
77
|
+
t(a);
|
|
78
|
+
var y = !1;
|
|
97
79
|
} catch {
|
|
98
|
-
|
|
80
|
+
y = !0;
|
|
99
81
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
return
|
|
104
|
-
|
|
82
|
+
if (y) {
|
|
83
|
+
y = console;
|
|
84
|
+
var $ = y.error, D = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
85
|
+
return $.call(
|
|
86
|
+
y,
|
|
105
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
107
|
-
), t(
|
|
88
|
+
D
|
|
89
|
+
), t(a);
|
|
108
90
|
}
|
|
109
91
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
112
|
-
if (typeof
|
|
92
|
+
function n(a) {
|
|
93
|
+
if (a === w) return "<>";
|
|
94
|
+
if (typeof a == "object" && a !== null && a.$$typeof === V)
|
|
113
95
|
return "<...>";
|
|
114
96
|
try {
|
|
115
|
-
var
|
|
116
|
-
return
|
|
97
|
+
var y = e(a);
|
|
98
|
+
return y ? "<" + y + ">" : "<...>";
|
|
117
99
|
} catch {
|
|
118
100
|
return "<...>";
|
|
119
101
|
}
|
|
120
102
|
}
|
|
121
|
-
function
|
|
122
|
-
var
|
|
123
|
-
return
|
|
103
|
+
function l() {
|
|
104
|
+
var a = G.A;
|
|
105
|
+
return a === null ? null : a.getOwner();
|
|
124
106
|
}
|
|
125
|
-
function
|
|
107
|
+
function c() {
|
|
126
108
|
return Error("react-stack-top-frame");
|
|
127
109
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
110
|
+
function d(a) {
|
|
111
|
+
if (b.call(a, "key")) {
|
|
112
|
+
var y = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
113
|
+
if (y && y.isReactWarning) return !1;
|
|
132
114
|
}
|
|
133
|
-
return
|
|
115
|
+
return a.key !== void 0;
|
|
134
116
|
}
|
|
135
|
-
function
|
|
136
|
-
function
|
|
137
|
-
|
|
117
|
+
function h(a, y) {
|
|
118
|
+
function $() {
|
|
119
|
+
F || (F = !0, console.error(
|
|
138
120
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
-
|
|
121
|
+
y
|
|
140
122
|
));
|
|
141
123
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
124
|
+
$.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
125
|
+
get: $,
|
|
144
126
|
configurable: !0
|
|
145
127
|
});
|
|
146
128
|
}
|
|
147
|
-
function
|
|
148
|
-
var
|
|
149
|
-
return
|
|
129
|
+
function g() {
|
|
130
|
+
var a = e(this.type);
|
|
131
|
+
return U[a] || (U[a] = !0, console.error(
|
|
150
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
-
)),
|
|
133
|
+
)), a = this.props.ref, a !== void 0 ? a : null;
|
|
152
134
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
155
|
-
return
|
|
135
|
+
function p(a, y, $, D, ce, oe) {
|
|
136
|
+
var N = $.ref;
|
|
137
|
+
return a = {
|
|
156
138
|
$$typeof: C,
|
|
157
|
-
type:
|
|
158
|
-
key:
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
139
|
+
type: a,
|
|
140
|
+
key: y,
|
|
141
|
+
props: $,
|
|
142
|
+
_owner: D
|
|
143
|
+
}, (N !== void 0 ? N : null) !== null ? Object.defineProperty(a, "ref", {
|
|
162
144
|
enumerable: !1,
|
|
163
|
-
get:
|
|
164
|
-
}) : Object.defineProperty(
|
|
145
|
+
get: g
|
|
146
|
+
}) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
165
147
|
configurable: !1,
|
|
166
148
|
enumerable: !1,
|
|
167
149
|
writable: !0,
|
|
168
150
|
value: 0
|
|
169
|
-
}), Object.defineProperty(
|
|
151
|
+
}), Object.defineProperty(a, "_debugInfo", {
|
|
170
152
|
configurable: !1,
|
|
171
153
|
enumerable: !1,
|
|
172
154
|
writable: !0,
|
|
173
155
|
value: null
|
|
174
|
-
}), Object.defineProperty(
|
|
156
|
+
}), Object.defineProperty(a, "_debugStack", {
|
|
175
157
|
configurable: !1,
|
|
176
158
|
enumerable: !1,
|
|
177
159
|
writable: !0,
|
|
178
|
-
value:
|
|
179
|
-
}), Object.defineProperty(
|
|
160
|
+
value: ce
|
|
161
|
+
}), Object.defineProperty(a, "_debugTask", {
|
|
180
162
|
configurable: !1,
|
|
181
163
|
enumerable: !1,
|
|
182
164
|
writable: !0,
|
|
183
|
-
value:
|
|
184
|
-
}), Object.freeze && (Object.freeze(
|
|
165
|
+
value: oe
|
|
166
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
185
167
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
for (
|
|
192
|
-
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
168
|
+
function S(a, y, $, D, ce, oe) {
|
|
169
|
+
var N = y.children;
|
|
170
|
+
if (N !== void 0)
|
|
171
|
+
if (D)
|
|
172
|
+
if (M(N)) {
|
|
173
|
+
for (D = 0; D < N.length; D++)
|
|
174
|
+
R(N[D]);
|
|
175
|
+
Object.freeze && Object.freeze(N);
|
|
194
176
|
} else
|
|
195
177
|
console.error(
|
|
196
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
179
|
);
|
|
198
|
-
else
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var
|
|
180
|
+
else R(N);
|
|
181
|
+
if (b.call(y, "key")) {
|
|
182
|
+
N = e(a);
|
|
183
|
+
var re = Object.keys(y).filter(function(Se) {
|
|
202
184
|
return Se !== "key";
|
|
203
185
|
});
|
|
204
|
-
|
|
186
|
+
D = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", Z[N + D] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
188
|
let props = %s;
|
|
207
189
|
<%s {...props} />
|
|
208
190
|
React keys must be passed directly to JSX without using spread:
|
|
209
191
|
let props = %s;
|
|
210
192
|
<%s key={someKey} {...props} />`,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
),
|
|
193
|
+
D,
|
|
194
|
+
N,
|
|
195
|
+
re,
|
|
196
|
+
N
|
|
197
|
+
), Z[N + D] = !0);
|
|
216
198
|
}
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
for (var
|
|
220
|
-
|
|
221
|
-
} else
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
typeof
|
|
225
|
-
),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
199
|
+
if (N = null, $ !== void 0 && (r($), N = "" + $), d(y) && (r(y.key), N = "" + y.key), "key" in y) {
|
|
200
|
+
$ = {};
|
|
201
|
+
for (var le in y)
|
|
202
|
+
le !== "key" && ($[le] = y[le]);
|
|
203
|
+
} else $ = y;
|
|
204
|
+
return N && h(
|
|
205
|
+
$,
|
|
206
|
+
typeof a == "function" ? a.displayName || a.name || "Unknown" : a
|
|
207
|
+
), p(
|
|
208
|
+
a,
|
|
209
|
+
N,
|
|
210
|
+
$,
|
|
211
|
+
l(),
|
|
212
|
+
ce,
|
|
213
|
+
oe
|
|
232
214
|
);
|
|
233
215
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
216
|
+
function R(a) {
|
|
217
|
+
m(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === V && (a._payload.status === "fulfilled" ? m(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
|
|
236
218
|
}
|
|
237
|
-
function
|
|
238
|
-
return typeof
|
|
219
|
+
function m(a) {
|
|
220
|
+
return typeof a == "object" && a !== null && a.$$typeof === C;
|
|
239
221
|
}
|
|
240
|
-
var
|
|
222
|
+
var T = or, C = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), x = /* @__PURE__ */ Symbol.for("react.strict_mode"), _ = /* @__PURE__ */ Symbol.for("react.profiler"), B = /* @__PURE__ */ Symbol.for("react.consumer"), Y = /* @__PURE__ */ Symbol.for("react.context"), H = /* @__PURE__ */ Symbol.for("react.forward_ref"), k = /* @__PURE__ */ Symbol.for("react.suspense"), W = /* @__PURE__ */ Symbol.for("react.suspense_list"), X = /* @__PURE__ */ Symbol.for("react.memo"), V = /* @__PURE__ */ Symbol.for("react.lazy"), j = /* @__PURE__ */ Symbol.for("react.activity"), Q = /* @__PURE__ */ Symbol.for("react.client.reference"), G = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, b = Object.prototype.hasOwnProperty, M = Array.isArray, P = console.createTask ? console.createTask : function() {
|
|
241
223
|
return null;
|
|
242
224
|
};
|
|
243
|
-
|
|
244
|
-
react_stack_bottom_frame: function(
|
|
245
|
-
return
|
|
225
|
+
T = {
|
|
226
|
+
react_stack_bottom_frame: function(a) {
|
|
227
|
+
return a();
|
|
246
228
|
}
|
|
247
229
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
|
|
253
|
-
var
|
|
254
|
-
return
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
230
|
+
var F, U = {}, ie = T.react_stack_bottom_frame.bind(
|
|
231
|
+
T,
|
|
232
|
+
c
|
|
233
|
+
)(), A = P(n(c)), Z = {};
|
|
234
|
+
ve.Fragment = w, ve.jsx = function(a, y, $) {
|
|
235
|
+
var D = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return S(
|
|
237
|
+
a,
|
|
238
|
+
y,
|
|
239
|
+
$,
|
|
258
240
|
!1,
|
|
259
|
-
|
|
260
|
-
|
|
241
|
+
D ? Error("react-stack-top-frame") : ie,
|
|
242
|
+
D ? P(n(a)) : A
|
|
261
243
|
);
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
244
|
+
}, ve.jsxs = function(a, y, $) {
|
|
245
|
+
var D = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return S(
|
|
247
|
+
a,
|
|
248
|
+
y,
|
|
249
|
+
$,
|
|
268
250
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
251
|
+
D ? Error("react-stack-top-frame") : ie,
|
|
252
|
+
D ? P(n(a)) : A
|
|
271
253
|
);
|
|
272
254
|
};
|
|
273
|
-
}()),
|
|
255
|
+
})()), ve;
|
|
274
256
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
257
|
+
var Je;
|
|
258
|
+
function dr() {
|
|
259
|
+
return Je || (Je = 1, process.env.NODE_ENV === "production" ? Re.exports = lr() : Re.exports = ur()), Re.exports;
|
|
260
|
+
}
|
|
261
|
+
var I = dr();
|
|
262
|
+
const mt = sr(null), Ae = (e) => {
|
|
278
263
|
throw new Error(`Unhandled sidebar side: ${e}`);
|
|
279
|
-
},
|
|
264
|
+
}, de = {
|
|
265
|
+
isOpen: !1,
|
|
266
|
+
meta: null
|
|
267
|
+
}, Oe = {
|
|
280
268
|
isOpen: !1,
|
|
281
269
|
anchorState: "closed",
|
|
282
270
|
meta: null
|
|
283
|
-
},
|
|
271
|
+
}, tn = ({
|
|
284
272
|
children: e,
|
|
285
273
|
sidebarWidthPx: t,
|
|
286
274
|
transitionMs: r,
|
|
287
|
-
edgeActivationWidthPx:
|
|
288
|
-
dragActivationDeltaPx:
|
|
289
|
-
showOverlay:
|
|
290
|
-
isAbsolute:
|
|
291
|
-
overlayBackgroundColor:
|
|
292
|
-
toggleIconColor:
|
|
293
|
-
toggleIconSizePx:
|
|
294
|
-
toggleIconEdgeDistancePx:
|
|
295
|
-
showToggle:
|
|
296
|
-
mediaQueryWidth:
|
|
297
|
-
swipeBarZIndex:
|
|
275
|
+
edgeActivationWidthPx: n,
|
|
276
|
+
dragActivationDeltaPx: l,
|
|
277
|
+
showOverlay: c,
|
|
278
|
+
isAbsolute: d,
|
|
279
|
+
overlayBackgroundColor: h,
|
|
280
|
+
toggleIconColor: g,
|
|
281
|
+
toggleIconSizePx: p,
|
|
282
|
+
toggleIconEdgeDistancePx: S,
|
|
283
|
+
showToggle: R,
|
|
284
|
+
mediaQueryWidth: m,
|
|
285
|
+
swipeBarZIndex: T,
|
|
298
286
|
toggleZIndex: C,
|
|
299
|
-
overlayZIndex:
|
|
300
|
-
fadeContent:
|
|
301
|
-
fadeContentTransitionMs:
|
|
302
|
-
closeSidebarOnOverlayClick:
|
|
303
|
-
resetMetaOnClose:
|
|
287
|
+
overlayZIndex: u,
|
|
288
|
+
fadeContent: w,
|
|
289
|
+
fadeContentTransitionMs: x,
|
|
290
|
+
closeSidebarOnOverlayClick: _,
|
|
291
|
+
resetMetaOnClose: B
|
|
304
292
|
}) => {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
293
|
+
const [Y, H] = te(null), [k, W] = te({}), [X, V] = te({}), j = L(/* @__PURE__ */ new Map()), Q = L(null), G = L([]), [b, M] = te({}), [P, F] = te({}), U = L(/* @__PURE__ */ new Map()), ie = L(null), A = L([]), [Z, a] = te({}), [y, $] = te({}), D = L(/* @__PURE__ */ new Map()), ce = L(null), oe = L([]), N = k.primary?.isOpen ?? !1, re = k.primary?.meta ?? null, le = Te(
|
|
294
|
+
() => Object.values(k).some((o) => o.isOpen),
|
|
295
|
+
[k]
|
|
296
|
+
), Se = j.current.get("primary"), Rt = Se?.sidebarRef ?? { current: null }, Ot = Se?.toggleRef ?? { current: null }, Tt = X.primary ?? {}, Et = b.primary?.isOpen ?? !1, At = b.primary?.meta ?? null, ke = Te(
|
|
297
|
+
() => Object.values(b).some((o) => o.isOpen),
|
|
298
|
+
[b]
|
|
299
|
+
), We = U.current.get("primary"), Pt = We?.sidebarRef ?? { current: null }, Mt = We?.toggleRef ?? { current: null }, It = P.primary ?? {}, Ct = Z.primary?.isOpen ?? !1, _t = Z.primary?.anchorState ?? "closed", je = Te(
|
|
300
|
+
() => Object.values(Z).some((o) => o.isOpen),
|
|
301
|
+
[Z]
|
|
302
|
+
), Fe = D.current.get("primary"), Lt = Fe?.sidebarRef ?? { current: null }, Dt = Fe?.toggleRef ?? { current: null }, Yt = y.primary ?? {}, [Xt, $t] = te({
|
|
303
|
+
sidebarWidthPx: t ?? mr,
|
|
304
|
+
sidebarHeightPx: Ke,
|
|
305
|
+
transitionMs: r ?? fr,
|
|
306
|
+
edgeActivationWidthPx: n ?? gr,
|
|
307
|
+
dragActivationDeltaPx: l ?? hr,
|
|
308
|
+
showOverlay: c ?? pr,
|
|
309
|
+
isAbsolute: d ?? yr,
|
|
310
|
+
overlayBackgroundColor: h ?? pt,
|
|
311
|
+
toggleIconColor: g ?? vr,
|
|
312
|
+
toggleIconSizePx: p ?? Sr,
|
|
313
|
+
toggleIconEdgeDistancePx: S ?? wr,
|
|
314
|
+
showToggle: R ?? xr,
|
|
315
|
+
mediaQueryWidth: m ?? Me,
|
|
316
|
+
swipeBarZIndex: T ?? Rr,
|
|
317
|
+
toggleZIndex: C ?? Or,
|
|
318
|
+
overlayZIndex: u ?? Tr,
|
|
319
|
+
fadeContent: w ?? Pr,
|
|
320
|
+
fadeContentTransitionMs: x ?? Ar,
|
|
321
|
+
swipeToOpen: Mr,
|
|
322
|
+
swipeToClose: Ir,
|
|
323
|
+
midAnchorPoint: Cr,
|
|
324
|
+
midAnchorPointPx: Ke / 3,
|
|
332
325
|
disabled: !1,
|
|
333
|
-
closeSidebarOnOverlayClick:
|
|
334
|
-
resetMetaOnClose:
|
|
335
|
-
}),
|
|
336
|
-
|
|
337
|
-
}, []),
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
return delete
|
|
341
|
-
}),
|
|
342
|
-
const
|
|
343
|
-
return delete
|
|
326
|
+
closeSidebarOnOverlayClick: _ ?? br,
|
|
327
|
+
resetMetaOnClose: B ?? !1
|
|
328
|
+
}), Bt = E((o, s) => {
|
|
329
|
+
j.current.set(o, s), W((i) => i[o] ? i : { ...i, [o]: { ...de } });
|
|
330
|
+
}, []), kt = E((o) => {
|
|
331
|
+
j.current.delete(o), W((s) => {
|
|
332
|
+
const i = { ...s };
|
|
333
|
+
return delete i[o], i;
|
|
334
|
+
}), V((s) => {
|
|
335
|
+
const i = { ...s };
|
|
336
|
+
return delete i[o], i;
|
|
344
337
|
});
|
|
345
|
-
}, []),
|
|
346
|
-
(
|
|
347
|
-
|
|
338
|
+
}, []), Wt = E((o) => j.current.get(o), []), jt = E(
|
|
339
|
+
(o, s) => {
|
|
340
|
+
V((i) => i[o] === s ? i : { ...i, [o]: s });
|
|
348
341
|
},
|
|
349
342
|
[]
|
|
350
|
-
),
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
343
|
+
), Ft = E((o, s) => {
|
|
344
|
+
U.current.set(o, s), M((i) => i[o] ? i : { ...i, [o]: { ...de } });
|
|
345
|
+
}, []), Nt = E((o) => {
|
|
346
|
+
U.current.delete(o), M((s) => {
|
|
347
|
+
const i = { ...s };
|
|
348
|
+
return delete i[o], i;
|
|
349
|
+
}), F((s) => {
|
|
350
|
+
const i = { ...s };
|
|
351
|
+
return delete i[o], i;
|
|
352
|
+
});
|
|
353
|
+
}, []), Ht = E((o) => U.current.get(o), []), Gt = E(
|
|
354
|
+
(o, s) => {
|
|
355
|
+
F((i) => i[o] === s ? i : { ...i, [o]: s });
|
|
356
|
+
},
|
|
357
|
+
[]
|
|
358
|
+
), Ut = E((o, s) => {
|
|
359
|
+
D.current.set(o, s), a((i) => i[o] ? i : { ...i, [o]: { ...Oe } });
|
|
360
|
+
}, []), Zt = E((o) => {
|
|
361
|
+
D.current.delete(o), a((s) => {
|
|
362
|
+
const i = { ...s };
|
|
363
|
+
return delete i[o], i;
|
|
364
|
+
}), $((s) => {
|
|
365
|
+
const i = { ...s };
|
|
366
|
+
return delete i[o], i;
|
|
367
|
+
});
|
|
368
|
+
}, []), zt = E((o) => D.current.get(o), []), Vt = E(
|
|
369
|
+
(o, s) => {
|
|
370
|
+
$((i) => i[o] === s ? i : { ...i, [o]: s });
|
|
371
|
+
},
|
|
372
|
+
[]
|
|
373
|
+
), we = E((o, s) => {
|
|
374
|
+
W((i) => {
|
|
375
|
+
const f = i[o] ?? de;
|
|
376
|
+
return f.isOpen === s ? i : { ...i, [o]: { ...f, isOpen: s } };
|
|
377
|
+
});
|
|
378
|
+
}, []), me = E((o, s) => {
|
|
379
|
+
W((i) => {
|
|
380
|
+
const f = i[o] ?? de;
|
|
381
|
+
return f.meta === s ? i : { ...i, [o]: { ...f, meta: s } };
|
|
382
|
+
});
|
|
383
|
+
}, []), xe = E((o, s) => {
|
|
384
|
+
M((i) => {
|
|
385
|
+
const f = i[o] ?? de;
|
|
386
|
+
return f.isOpen === s ? i : { ...i, [o]: { ...f, isOpen: s } };
|
|
354
387
|
});
|
|
355
|
-
}, []),
|
|
356
|
-
(
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
388
|
+
}, []), pe = E((o, s) => {
|
|
389
|
+
M((i) => {
|
|
390
|
+
const f = i[o] ?? de;
|
|
391
|
+
return f.meta === s ? i : { ...i, [o]: { ...f, meta: s } };
|
|
392
|
+
});
|
|
393
|
+
}, []), K = E((o, s) => {
|
|
394
|
+
a((i) => {
|
|
395
|
+
const f = i[o] ?? Oe;
|
|
396
|
+
return f.isOpen === s ? i : { ...i, [o]: { ...f, isOpen: s } };
|
|
397
|
+
});
|
|
398
|
+
}, []), ee = E(
|
|
399
|
+
(o, s) => {
|
|
400
|
+
a((i) => {
|
|
401
|
+
const f = i[o] ?? Oe;
|
|
402
|
+
return f.anchorState === s ? i : { ...i, [o]: { ...f, anchorState: s } };
|
|
360
403
|
});
|
|
361
404
|
},
|
|
362
405
|
[]
|
|
363
|
-
),
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
return
|
|
406
|
+
), be = E((o, s) => {
|
|
407
|
+
a((i) => {
|
|
408
|
+
const f = i[o] ?? Oe;
|
|
409
|
+
return f.meta === s ? i : { ...i, [o]: { ...f, meta: s } };
|
|
367
410
|
});
|
|
368
411
|
}, []);
|
|
369
|
-
|
|
412
|
+
q(() => (le || ke || je ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
370
413
|
document.body.style.overflow = "";
|
|
371
|
-
}), [
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}, [
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
}, [D.fadeContent]), G(() => {
|
|
384
|
-
var d;
|
|
385
|
-
for (const [a, g] of Object.entries(R))
|
|
386
|
-
if (g.fadeContent === !1) {
|
|
387
|
-
const b = F.current.get(a), A = (d = b == null ? void 0 : b.sidebarRef.current) == null ? void 0 : d.firstElementChild;
|
|
388
|
-
A && (A.style.opacity = "1");
|
|
414
|
+
}), [le, ke, je]), q(() => {
|
|
415
|
+
for (const [o, s] of Object.entries(X))
|
|
416
|
+
if (s.fadeContent === !1) {
|
|
417
|
+
const f = j.current.get(o)?.sidebarRef.current?.firstElementChild;
|
|
418
|
+
f && (f.style.opacity = "1");
|
|
419
|
+
}
|
|
420
|
+
}, [X]), q(() => {
|
|
421
|
+
for (const [o, s] of Object.entries(P))
|
|
422
|
+
if (s.fadeContent === !1) {
|
|
423
|
+
const f = U.current.get(o)?.sidebarRef.current?.firstElementChild;
|
|
424
|
+
f && (f.style.opacity = "1");
|
|
389
425
|
}
|
|
390
|
-
}, [
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}, [])
|
|
397
|
-
|
|
398
|
-
|
|
426
|
+
}, [P]), q(() => {
|
|
427
|
+
for (const [o, s] of Object.entries(y))
|
|
428
|
+
if (s.fadeContent === !1) {
|
|
429
|
+
const f = D.current.get(o)?.sidebarRef.current?.firstElementChild;
|
|
430
|
+
f && (f.style.opacity = "1");
|
|
431
|
+
}
|
|
432
|
+
}, [y]);
|
|
433
|
+
const qt = E((o) => {
|
|
434
|
+
$t((s) => ({ ...s, ...o }));
|
|
435
|
+
}, []), ue = E(
|
|
436
|
+
(o, s, i) => {
|
|
437
|
+
const f = o === "left" ? me : pe;
|
|
438
|
+
i?.resetMeta ? f(s, null) : i?.meta !== void 0 && f(s, i.meta);
|
|
439
|
+
},
|
|
440
|
+
[me, pe]
|
|
441
|
+
), ne = E(
|
|
442
|
+
(o, s) => {
|
|
443
|
+
s?.resetMeta ? be(o, null) : s?.meta !== void 0 && be(o, s.meta);
|
|
399
444
|
},
|
|
400
|
-
[
|
|
401
|
-
),
|
|
402
|
-
(
|
|
403
|
-
if (
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
445
|
+
[be]
|
|
446
|
+
), Qt = E(
|
|
447
|
+
(o, s) => {
|
|
448
|
+
if (o === "left") {
|
|
449
|
+
const i = s;
|
|
450
|
+
i && typeof i == "object" && "id" in i ? me(i.id ?? "primary", i.meta) : me("primary", s);
|
|
451
|
+
} else if (o === "right") {
|
|
452
|
+
const i = s;
|
|
453
|
+
i && typeof i == "object" && "id" in i ? pe(i.id ?? "primary", i.meta) : pe("primary", s);
|
|
454
|
+
} else {
|
|
455
|
+
const i = s;
|
|
456
|
+
be(i.id, i.meta);
|
|
410
457
|
}
|
|
411
458
|
},
|
|
412
|
-
[
|
|
413
|
-
),
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
}, []),
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
}, []),
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
459
|
+
[me, pe, be]
|
|
460
|
+
), Ne = E((o) => {
|
|
461
|
+
const s = G.current, i = s.indexOf(o);
|
|
462
|
+
i !== -1 && s.splice(i, 1), s.push(o), H("left");
|
|
463
|
+
}, []), He = E((o) => {
|
|
464
|
+
const s = G.current, i = s.indexOf(o);
|
|
465
|
+
i !== -1 && s.splice(i, 1), W((f) => (Object.entries(f).some(([O, z]) => O !== o && z.isOpen) || H(null), f));
|
|
466
|
+
}, []), Ge = E((o) => {
|
|
467
|
+
const s = A.current, i = s.indexOf(o);
|
|
468
|
+
i !== -1 && s.splice(i, 1), s.push(o), H("right");
|
|
469
|
+
}, []), Ue = E((o) => {
|
|
470
|
+
const s = A.current, i = s.indexOf(o);
|
|
471
|
+
i !== -1 && s.splice(i, 1), M((f) => (Object.entries(f).some(([O, z]) => O !== o && z.isOpen) || H(null), f));
|
|
472
|
+
}, []), se = E((o) => {
|
|
473
|
+
const s = oe.current, i = s.indexOf(o);
|
|
474
|
+
i !== -1 && s.splice(i, 1), s.push(o), H("bottom");
|
|
475
|
+
}, []), Ze = E((o) => {
|
|
476
|
+
const s = oe.current, i = s.indexOf(o);
|
|
477
|
+
i !== -1 && s.splice(i, 1), a((f) => (Object.entries(f).some(([O, z]) => O !== o && z.isOpen) || H(null), f));
|
|
478
|
+
}, []), Jt = E(
|
|
479
|
+
(o, s) => {
|
|
480
|
+
const i = s?.skipTransition ? tt : rt, f = s?.skipTransition ? Nr : nt;
|
|
481
|
+
if (o === "left") {
|
|
482
|
+
const v = s?.id ?? "primary", O = X[v], z = j.current.get(v);
|
|
483
|
+
if (!O || !z || O.disabled) return;
|
|
484
|
+
ue("left", v, s), i({
|
|
485
|
+
side: o,
|
|
486
|
+
ref: z.sidebarRef,
|
|
487
|
+
options: O,
|
|
488
|
+
toggleRef: z.toggleRef,
|
|
489
|
+
afterApply: () => {
|
|
490
|
+
we(v, !0), Ne(v);
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
} else if (o === "right") {
|
|
494
|
+
const v = s?.id ?? "primary", O = P[v], z = U.current.get(v);
|
|
495
|
+
if (!O || !z || O.disabled) return;
|
|
496
|
+
ue("right", v, s), i({
|
|
497
|
+
side: o,
|
|
498
|
+
ref: z.sidebarRef,
|
|
499
|
+
options: O,
|
|
500
|
+
toggleRef: z.toggleRef,
|
|
427
501
|
afterApply: () => {
|
|
428
|
-
|
|
502
|
+
xe(v, !0), Ge(v);
|
|
429
503
|
}
|
|
430
504
|
});
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
if (
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (!A || !W || A.disabled) return;
|
|
441
|
-
ie(b, a);
|
|
442
|
-
const K = A.sidebarHeightPx ?? 0, yt = A.mediaQueryWidth ?? 640, $e = window.innerWidth < yt, xt = $e ? A.midAnchorPointPx ?? 0 : K;
|
|
443
|
-
$e && A.midAnchorPoint && !A.swipeToOpen && xt < K ? Ne({
|
|
444
|
-
ref: W.sidebarRef,
|
|
445
|
-
options: A,
|
|
446
|
-
toggleRef: W.toggleRef,
|
|
505
|
+
} else if (o === "bottom") {
|
|
506
|
+
const v = s?.id ?? "primary", O = y[v], z = D.current.get(v);
|
|
507
|
+
if (!O || !z || O.disabled) return;
|
|
508
|
+
ne(v, s);
|
|
509
|
+
const ze = O.sidebarHeightPx ?? 0, nr = O.mediaQueryWidth ?? 640, Ve = window.innerWidth < nr, ir = Ve ? O.midAnchorPointPx ?? 0 : ze;
|
|
510
|
+
Ve && O.midAnchorPoint && !O.swipeToOpen && ir < ze ? f({
|
|
511
|
+
ref: z.sidebarRef,
|
|
512
|
+
options: O,
|
|
513
|
+
toggleRef: z.toggleRef,
|
|
447
514
|
afterApply: () => {
|
|
448
|
-
|
|
515
|
+
K(v, !0), ee(v, "midAnchor"), se(v);
|
|
449
516
|
}
|
|
450
|
-
}) :
|
|
451
|
-
side:
|
|
452
|
-
ref:
|
|
453
|
-
options:
|
|
454
|
-
toggleRef:
|
|
517
|
+
}) : i({
|
|
518
|
+
side: o,
|
|
519
|
+
ref: z.sidebarRef,
|
|
520
|
+
options: O,
|
|
521
|
+
toggleRef: z.toggleRef,
|
|
455
522
|
afterApply: () => {
|
|
456
|
-
|
|
523
|
+
K(v, !0), ee(v, "open"), se(v);
|
|
457
524
|
}
|
|
458
525
|
});
|
|
459
526
|
} else
|
|
460
|
-
|
|
527
|
+
Ae(o);
|
|
461
528
|
},
|
|
462
529
|
[
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
530
|
+
X,
|
|
531
|
+
P,
|
|
532
|
+
y,
|
|
533
|
+
we,
|
|
534
|
+
xe,
|
|
535
|
+
K,
|
|
536
|
+
ee,
|
|
537
|
+
Ne,
|
|
538
|
+
Ge,
|
|
468
539
|
se,
|
|
469
|
-
|
|
470
|
-
|
|
540
|
+
ue,
|
|
541
|
+
ne
|
|
471
542
|
]
|
|
472
|
-
),
|
|
473
|
-
(
|
|
474
|
-
if (
|
|
475
|
-
const
|
|
476
|
-
!
|
|
477
|
-
ref:
|
|
478
|
-
options:
|
|
479
|
-
toggleRef:
|
|
543
|
+
), Kt = E(
|
|
544
|
+
(o, s) => {
|
|
545
|
+
if (o !== "bottom") return;
|
|
546
|
+
const i = s?.id ?? "primary", f = y[i], v = D.current.get(i);
|
|
547
|
+
!f || !v || f.disabled || (ne(i, s), nt({
|
|
548
|
+
ref: v.sidebarRef,
|
|
549
|
+
options: f,
|
|
550
|
+
toggleRef: v.toggleRef,
|
|
480
551
|
afterApply: () => {
|
|
481
|
-
|
|
552
|
+
K(i, !0), ee(i, "midAnchor"), se(i);
|
|
482
553
|
}
|
|
483
554
|
}));
|
|
484
555
|
},
|
|
485
556
|
[
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
557
|
+
y,
|
|
558
|
+
K,
|
|
559
|
+
ee,
|
|
489
560
|
se,
|
|
490
|
-
|
|
561
|
+
ne
|
|
491
562
|
]
|
|
492
|
-
),
|
|
493
|
-
(
|
|
494
|
-
if (
|
|
495
|
-
const
|
|
496
|
-
!
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
563
|
+
), er = E(
|
|
564
|
+
(o, s) => {
|
|
565
|
+
if (o !== "bottom") return;
|
|
566
|
+
const i = s?.id ?? "primary", f = y[i], v = D.current.get(i);
|
|
567
|
+
if (!f || !v || f.disabled) return;
|
|
568
|
+
ne(i, s), (s?.skipTransition ? tt : rt)({
|
|
569
|
+
side: o,
|
|
570
|
+
ref: v.sidebarRef,
|
|
571
|
+
options: f,
|
|
572
|
+
toggleRef: v.toggleRef,
|
|
501
573
|
afterApply: () => {
|
|
502
|
-
|
|
574
|
+
K(i, !0), ee(i, "open"), se(i);
|
|
503
575
|
}
|
|
504
|
-
})
|
|
576
|
+
});
|
|
505
577
|
},
|
|
506
578
|
[
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
579
|
+
y,
|
|
580
|
+
K,
|
|
581
|
+
ee,
|
|
510
582
|
se,
|
|
511
|
-
|
|
583
|
+
ne
|
|
512
584
|
]
|
|
513
|
-
),
|
|
514
|
-
(
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
585
|
+
), tr = E(
|
|
586
|
+
(o, s) => {
|
|
587
|
+
if (o === "left") {
|
|
588
|
+
const i = s?.id ?? "primary", f = X[i], v = j.current.get(i);
|
|
589
|
+
if (!f || !v || f.disabled) return;
|
|
590
|
+
const O = f.resetMetaOnClose && s?.meta === void 0 && s?.resetMeta === void 0 ? { ...s, resetMeta: !0 } : s;
|
|
591
|
+
ue("left", i, O), Pe({
|
|
592
|
+
ref: v.sidebarRef,
|
|
593
|
+
options: f,
|
|
594
|
+
toggleRef: v.toggleRef,
|
|
595
|
+
side: o,
|
|
521
596
|
afterApply: () => {
|
|
522
|
-
|
|
597
|
+
we(i, !1), He(i);
|
|
523
598
|
}
|
|
524
599
|
});
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
} else if (d === "bottom") {
|
|
535
|
-
const b = (a == null ? void 0 : a.id) ?? "primary", A = R[b], W = F.current.get(b);
|
|
536
|
-
if (!A || !W || A.disabled) return;
|
|
537
|
-
const K = A.resetMetaOnClose && (a == null ? void 0 : a.meta) === void 0 && (a == null ? void 0 : a.resetMeta) === void 0 ? { ...a, resetMeta: !0 } : a;
|
|
538
|
-
ie(b, K), Fe({
|
|
539
|
-
ref: W.sidebarRef,
|
|
540
|
-
options: A,
|
|
541
|
-
toggleRef: W.toggleRef,
|
|
542
|
-
side: d,
|
|
600
|
+
} else if (o === "right") {
|
|
601
|
+
const i = s?.id ?? "primary", f = P[i], v = U.current.get(i);
|
|
602
|
+
if (!f || !v || f.disabled) return;
|
|
603
|
+
const O = f.resetMetaOnClose && s?.meta === void 0 && s?.resetMeta === void 0 ? { ...s, resetMeta: !0 } : s;
|
|
604
|
+
ue("right", i, O), Pe({
|
|
605
|
+
ref: v.sidebarRef,
|
|
606
|
+
options: f,
|
|
607
|
+
toggleRef: v.toggleRef,
|
|
608
|
+
side: o,
|
|
543
609
|
afterApply: () => {
|
|
544
|
-
|
|
610
|
+
xe(i, !1), Ue(i);
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
} else if (o === "bottom") {
|
|
614
|
+
const i = s?.id ?? "primary", f = y[i], v = D.current.get(i);
|
|
615
|
+
if (!f || !v || f.disabled) return;
|
|
616
|
+
const O = f.resetMetaOnClose && s?.meta === void 0 && s?.resetMeta === void 0 ? { ...s, resetMeta: !0 } : s;
|
|
617
|
+
ne(i, O), Pe({
|
|
618
|
+
ref: v.sidebarRef,
|
|
619
|
+
options: f,
|
|
620
|
+
toggleRef: v.toggleRef,
|
|
621
|
+
side: o,
|
|
622
|
+
afterApply: () => {
|
|
623
|
+
K(i, !1), ee(i, "closed"), Ze(i);
|
|
545
624
|
}
|
|
546
625
|
});
|
|
547
626
|
} else
|
|
548
|
-
|
|
627
|
+
Ae(o);
|
|
549
628
|
},
|
|
550
629
|
[
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
630
|
+
X,
|
|
631
|
+
P,
|
|
632
|
+
y,
|
|
633
|
+
we,
|
|
634
|
+
xe,
|
|
635
|
+
K,
|
|
636
|
+
ee,
|
|
637
|
+
He,
|
|
638
|
+
Ue,
|
|
639
|
+
Ze,
|
|
640
|
+
ue,
|
|
641
|
+
ne
|
|
559
642
|
]
|
|
560
|
-
),
|
|
561
|
-
(
|
|
562
|
-
if (
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
643
|
+
), rr = E(
|
|
644
|
+
(o, s, i) => {
|
|
645
|
+
if (o === "left") {
|
|
646
|
+
const f = i?.id ?? "primary", v = X[f], O = j.current.get(f);
|
|
647
|
+
if (!v || !O) return;
|
|
648
|
+
it({
|
|
649
|
+
ref: O.sidebarRef,
|
|
650
|
+
toggleRef: O.toggleRef,
|
|
651
|
+
options: v,
|
|
652
|
+
translateX: s
|
|
568
653
|
});
|
|
569
|
-
else if (
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
654
|
+
} else if (o === "right") {
|
|
655
|
+
const f = i?.id ?? "primary", v = P[f], O = U.current.get(f);
|
|
656
|
+
if (!v || !O) return;
|
|
657
|
+
it({
|
|
658
|
+
ref: O.sidebarRef,
|
|
659
|
+
toggleRef: O.toggleRef,
|
|
660
|
+
options: v,
|
|
661
|
+
translateX: s
|
|
575
662
|
});
|
|
576
|
-
else if (
|
|
577
|
-
const
|
|
578
|
-
if (!
|
|
579
|
-
|
|
580
|
-
ref:
|
|
581
|
-
toggleRef:
|
|
582
|
-
options:
|
|
583
|
-
translateY:
|
|
663
|
+
} else if (o === "bottom") {
|
|
664
|
+
const f = i?.id ?? "primary", v = y[f], O = D.current.get(f);
|
|
665
|
+
if (!v || !O) return;
|
|
666
|
+
Hr({
|
|
667
|
+
ref: O.sidebarRef,
|
|
668
|
+
toggleRef: O.toggleRef,
|
|
669
|
+
options: v,
|
|
670
|
+
translateY: s
|
|
584
671
|
});
|
|
585
672
|
} else
|
|
586
|
-
|
|
673
|
+
Ae(o);
|
|
587
674
|
},
|
|
588
|
-
[
|
|
675
|
+
[X, P, y]
|
|
589
676
|
);
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
|
|
677
|
+
return /* @__PURE__ */ I.jsx(
|
|
678
|
+
mt.Provider,
|
|
592
679
|
{
|
|
593
680
|
value: {
|
|
594
|
-
lockedSidebar:
|
|
595
|
-
setLockedSidebar:
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
681
|
+
lockedSidebar: Y,
|
|
682
|
+
setLockedSidebar: H,
|
|
683
|
+
// Backwards-compat aliases for primary left
|
|
684
|
+
leftSidebarRef: Rt,
|
|
685
|
+
rightSidebarRef: Pt,
|
|
686
|
+
isLeftOpen: N,
|
|
687
|
+
isRightOpen: Et,
|
|
688
|
+
leftSidebarOptions: Tt,
|
|
689
|
+
rightSidebarOptions: It,
|
|
690
|
+
leftToggleRef: Ot,
|
|
691
|
+
rightToggleRef: Mt,
|
|
692
|
+
leftMeta: re,
|
|
693
|
+
rightMeta: At,
|
|
694
|
+
// Multi-instance left sidebar
|
|
695
|
+
leftSidebars: k,
|
|
696
|
+
leftSidebarOptionsMap: X,
|
|
697
|
+
registerLeftSidebar: Bt,
|
|
698
|
+
unregisterLeftSidebar: kt,
|
|
699
|
+
getLeftSidebarRefs: Wt,
|
|
700
|
+
activeLeftDragIdRef: Q,
|
|
701
|
+
leftFocusStackRef: G,
|
|
702
|
+
// Multi-instance right sidebar
|
|
703
|
+
rightSidebars: b,
|
|
704
|
+
rightSidebarOptionsMap: P,
|
|
705
|
+
registerRightSidebar: Ft,
|
|
706
|
+
unregisterRightSidebar: Nt,
|
|
707
|
+
getRightSidebarRefs: Ht,
|
|
708
|
+
activeRightDragIdRef: ie,
|
|
709
|
+
rightFocusStackRef: A,
|
|
600
710
|
// Backwards-compat aliases for primary bottom sidebar
|
|
601
|
-
isBottomOpen:
|
|
602
|
-
bottomAnchorState:
|
|
603
|
-
bottomSidebarRef:
|
|
604
|
-
bottomToggleRef:
|
|
605
|
-
bottomSidebarOptions:
|
|
711
|
+
isBottomOpen: Ct,
|
|
712
|
+
bottomAnchorState: _t,
|
|
713
|
+
bottomSidebarRef: Lt,
|
|
714
|
+
bottomToggleRef: Dt,
|
|
715
|
+
bottomSidebarOptions: Yt,
|
|
606
716
|
// Multi-instance bottom sidebar
|
|
607
|
-
bottomSidebars:
|
|
608
|
-
bottomSidebarOptionsMap:
|
|
609
|
-
registerBottomSidebar:
|
|
610
|
-
unregisterBottomSidebar:
|
|
611
|
-
getBottomSidebarRefs:
|
|
612
|
-
activeBottomDragIdRef:
|
|
613
|
-
bottomFocusStackRef:
|
|
717
|
+
bottomSidebars: Z,
|
|
718
|
+
bottomSidebarOptionsMap: y,
|
|
719
|
+
registerBottomSidebar: Ut,
|
|
720
|
+
unregisterBottomSidebar: Zt,
|
|
721
|
+
getBottomSidebarRefs: zt,
|
|
722
|
+
activeBottomDragIdRef: ce,
|
|
723
|
+
bottomFocusStackRef: oe,
|
|
614
724
|
// Functions
|
|
615
|
-
openSidebar:
|
|
616
|
-
openSidebarFully:
|
|
617
|
-
openSidebarToMidAnchor:
|
|
618
|
-
closeSidebar:
|
|
619
|
-
dragSidebar:
|
|
620
|
-
globalOptions:
|
|
621
|
-
setGlobalOptions:
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
setBottomSidebarOptionsById: gt,
|
|
627
|
-
leftToggleRef: N,
|
|
628
|
-
rightToggleRef: Z,
|
|
629
|
-
leftMeta: oe,
|
|
630
|
-
rightMeta: ae,
|
|
631
|
-
setMeta: mt
|
|
725
|
+
openSidebar: Jt,
|
|
726
|
+
openSidebarFully: er,
|
|
727
|
+
openSidebarToMidAnchor: Kt,
|
|
728
|
+
closeSidebar: tr,
|
|
729
|
+
dragSidebar: rr,
|
|
730
|
+
globalOptions: Xt,
|
|
731
|
+
setGlobalOptions: qt,
|
|
732
|
+
setLeftSidebarOptionsById: jt,
|
|
733
|
+
setRightSidebarOptionsById: Gt,
|
|
734
|
+
setBottomSidebarOptionsById: Vt,
|
|
735
|
+
setMeta: Qt
|
|
632
736
|
},
|
|
633
737
|
children: e
|
|
634
738
|
}
|
|
635
739
|
);
|
|
636
740
|
};
|
|
637
|
-
function
|
|
638
|
-
const e =
|
|
741
|
+
function J() {
|
|
742
|
+
const e = ar(mt);
|
|
639
743
|
if (!e)
|
|
640
744
|
throw new Error("useSwipeBarContext must be used within SwipeBarProvider");
|
|
641
745
|
return e;
|
|
642
746
|
}
|
|
643
|
-
const
|
|
747
|
+
const fr = 300, gr = 40, hr = 20, mr = 320, Ke = window.innerHeight, pr = !0, br = !0, yr = !1, pt = "rgba(0, 0, 0, 0.5)", Ie = "rgb(36,36,36)", vr = "white", Sr = 40, wr = 40, xr = !0, Me = 640, Rr = 30, Or = 15, Tr = 20, et = 0.6, Er = 200, Ar = 100, Pr = !1, Mr = !0, Ir = !0, Cr = !1, fe = "cubic-bezier(0.22, 1, 0.36, 1)", bt = {
|
|
644
748
|
width: 0,
|
|
645
749
|
top: 0,
|
|
646
750
|
bottom: 0,
|
|
647
751
|
flexShrink: 0,
|
|
648
752
|
overflowX: "hidden",
|
|
649
753
|
willChange: "transform"
|
|
650
|
-
},
|
|
754
|
+
}, _r = {
|
|
651
755
|
transform: "translateX(-100%)"
|
|
652
|
-
},
|
|
756
|
+
}, Lr = {
|
|
653
757
|
transform: "translateX(100%)"
|
|
654
|
-
},
|
|
758
|
+
}, Dr = {
|
|
655
759
|
position: "fixed",
|
|
656
760
|
left: 0,
|
|
657
761
|
top: 0,
|
|
658
762
|
bottom: 0
|
|
659
|
-
},
|
|
763
|
+
}, Yr = {
|
|
660
764
|
position: "fixed",
|
|
661
765
|
right: 0,
|
|
662
766
|
top: 0,
|
|
663
767
|
bottom: 0
|
|
664
|
-
},
|
|
768
|
+
}, Xr = {
|
|
665
769
|
height: 0,
|
|
666
770
|
left: 0,
|
|
667
771
|
right: 0,
|
|
668
772
|
flexShrink: 0,
|
|
669
773
|
overflowY: "hidden",
|
|
670
774
|
willChange: "transform"
|
|
671
|
-
},
|
|
775
|
+
}, $r = {
|
|
672
776
|
transform: "translateY(100%)"
|
|
673
|
-
},
|
|
777
|
+
}, Br = {
|
|
674
778
|
position: "fixed",
|
|
675
779
|
bottom: 0,
|
|
676
780
|
left: 0,
|
|
677
781
|
right: 0
|
|
678
|
-
},
|
|
782
|
+
}, kr = {
|
|
679
783
|
position: "fixed",
|
|
680
784
|
top: 0,
|
|
681
785
|
left: 0,
|
|
682
786
|
width: "100%",
|
|
683
787
|
height: "100%",
|
|
684
|
-
backgroundColor:
|
|
788
|
+
backgroundColor: pt,
|
|
685
789
|
transitionProperty: "opacity",
|
|
686
790
|
pointerEvents: "none",
|
|
687
791
|
opacity: 0
|
|
688
|
-
},
|
|
792
|
+
}, Wr = {
|
|
689
793
|
opacity: 1,
|
|
690
794
|
pointerEvents: "auto"
|
|
691
|
-
},
|
|
795
|
+
}, yt = {
|
|
692
796
|
position: "fixed",
|
|
693
797
|
top: "50%",
|
|
694
798
|
transform: "translateY(-50%)",
|
|
695
799
|
width: "1px",
|
|
696
800
|
display: "flex",
|
|
697
801
|
justifyContent: "center"
|
|
698
|
-
},
|
|
802
|
+
}, jr = {
|
|
699
803
|
position: "fixed",
|
|
700
804
|
bottom: 0,
|
|
701
805
|
left: "50%",
|
|
@@ -703,147 +807,170 @@ const Pt = 300, Mt = 40, Ct = 20, It = 320, je = window.innerHeight, _t = !0, Lt
|
|
|
703
807
|
height: "1px",
|
|
704
808
|
display: "flex",
|
|
705
809
|
alignItems: "center"
|
|
706
|
-
},
|
|
810
|
+
}, Fr = {
|
|
707
811
|
position: "relative",
|
|
708
812
|
cursor: "pointer",
|
|
709
813
|
display: "flex",
|
|
710
814
|
height: "72px",
|
|
711
815
|
alignItems: "center",
|
|
712
816
|
justifyContent: "center"
|
|
713
|
-
},
|
|
817
|
+
}, Ce = (e) => {
|
|
714
818
|
throw new Error(`Unhandled sidebar side: ${e}`);
|
|
715
|
-
},
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
819
|
+
}, ae = (e) => e.current?.firstElementChild, vt = (e, t) => e === "left" || e === "right" ? { dimension: "width", sizePx: t.sidebarWidthPx } : e === "bottom" ? { dimension: "height", sizePx: t.sidebarHeightPx } : Ce(e), St = (e, t, r) => {
|
|
820
|
+
!e.current || !r || (e.current.style.opacity = "1", t === "left" ? e.current.style.transform = `translateY(-50%) translateX(${r}px)` : t === "right" ? e.current.style.transform = `translateY(-50%) translateX(-${r}px)` : t === "bottom" && (e.current.style.transform = `translateX(-50%) translateY(-${r}px)`));
|
|
821
|
+
}, tt = ({
|
|
822
|
+
ref: e,
|
|
823
|
+
side: t,
|
|
824
|
+
options: r,
|
|
825
|
+
toggleRef: n,
|
|
826
|
+
afterApply: l
|
|
827
|
+
}) => {
|
|
828
|
+
if (!e.current) return;
|
|
829
|
+
const c = ae(e), { dimension: d, sizePx: h } = vt(t, r);
|
|
830
|
+
c && h && (c.style[t === "bottom" ? "minHeight" : "minWidth"] = `${h}px`), e.current.style.transition = "none", e.current.style.transform = t === "bottom" ? "translateY(0px)" : "translateX(0px)", e.current.style[d] = `${h}px`, c && (c.style.opacity = "1"), St(n, t, h), l();
|
|
831
|
+
}, rt = ({
|
|
719
832
|
ref: e,
|
|
720
833
|
side: t,
|
|
721
834
|
options: r,
|
|
722
|
-
toggleRef:
|
|
723
|
-
afterApply:
|
|
835
|
+
toggleRef: n,
|
|
836
|
+
afterApply: l
|
|
724
837
|
}) => {
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
838
|
+
const c = ae(e), { dimension: d, sizePx: h } = vt(t, r);
|
|
839
|
+
c && h && (c.style[t === "bottom" ? "minHeight" : "minWidth"] = `${h}px`);
|
|
840
|
+
const g = r.transitionMs ? r.transitionMs / 2 : 0;
|
|
841
|
+
c && r.fadeContent && (c.style.opacity = "0"), requestAnimationFrame(() => {
|
|
729
842
|
if (!e.current) return;
|
|
730
|
-
const
|
|
731
|
-
e.current.style.transition = `${
|
|
843
|
+
const p = `transform ${r.transitionMs}ms ${fe}`, S = r.isAbsolute ? "" : `, ${d} ${r.transitionMs}ms ${fe}`;
|
|
844
|
+
e.current.style.transition = `${p}${S}`, c && r.fadeContent && (c.style.transition = `opacity ${r.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
732
845
|
if (e.current) {
|
|
733
846
|
if (e.current.style.transform = t === "bottom" ? "translateY(0px)" : "translateX(0px)", !r.isAbsolute)
|
|
734
|
-
e.current.style[
|
|
735
|
-
else if (e.current.style[
|
|
736
|
-
const
|
|
737
|
-
e.current.style.transition =
|
|
847
|
+
e.current.style[d] = `${h}px`;
|
|
848
|
+
else if (e.current.style[d] !== `${h}px`) {
|
|
849
|
+
const R = e.current.style.transition;
|
|
850
|
+
e.current.style.transition = p, e.current.style[d] = `${h}px`, e.current.style.transition = R;
|
|
738
851
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
},
|
|
852
|
+
St(n, t, h), c && r.fadeContent && setTimeout(() => {
|
|
853
|
+
c.style.opacity = "1";
|
|
854
|
+
}, g), l();
|
|
742
855
|
}
|
|
743
856
|
});
|
|
744
857
|
}), setTimeout(() => {
|
|
745
858
|
}, 0);
|
|
746
|
-
},
|
|
859
|
+
}, Pe = ({
|
|
747
860
|
ref: e,
|
|
748
861
|
options: t,
|
|
749
862
|
side: r,
|
|
750
|
-
toggleRef:
|
|
751
|
-
afterApply:
|
|
863
|
+
toggleRef: n,
|
|
864
|
+
afterApply: l
|
|
752
865
|
}) => {
|
|
753
|
-
const
|
|
754
|
-
let
|
|
755
|
-
r === "left" || r === "right" ? (
|
|
866
|
+
const c = ae(e);
|
|
867
|
+
let d;
|
|
868
|
+
r === "left" || r === "right" ? (d = "width", c && t.sidebarWidthPx && (c.style.minWidth = `${t.sidebarWidthPx}px`)) : r === "bottom" ? (d = "height", c && t.sidebarHeightPx && (c.style.minHeight = `${t.sidebarHeightPx}px`)) : Ce(r), requestAnimationFrame(() => {
|
|
756
869
|
if (!e.current) return;
|
|
757
|
-
const
|
|
758
|
-
e.current.style.transition = `${
|
|
759
|
-
e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")),
|
|
870
|
+
const h = `transform ${t.transitionMs}ms ${fe}`, g = t.isAbsolute ? "" : `, ${d} ${t.transitionMs}ms ${fe}`;
|
|
871
|
+
e.current.style.transition = `${h}${g}`, c && t.fadeContent && (c.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
872
|
+
e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), n.current && (n.current.style.opacity = "1", r === "left" || r === "right" ? n.current.style.transform = "translateY(-50%)" : r === "bottom" && (n.current.style.transform = "translateX(-50%)")), c && t.fadeContent && (c.style.opacity = "0"), l());
|
|
760
873
|
});
|
|
761
874
|
});
|
|
762
|
-
},
|
|
875
|
+
}, wt = (e) => {
|
|
876
|
+
const t = e.midAnchorPointPx ?? 0, r = e.sidebarHeightPx ?? 0;
|
|
877
|
+
return { midAnchorPx: t, sidebarHeightPx: r, translateY: r - t };
|
|
878
|
+
}, Nr = ({
|
|
879
|
+
ref: e,
|
|
880
|
+
options: t,
|
|
881
|
+
toggleRef: r,
|
|
882
|
+
afterApply: n
|
|
883
|
+
}) => {
|
|
884
|
+
if (!e.current) return;
|
|
885
|
+
const l = ae(e), { midAnchorPx: c, sidebarHeightPx: d, translateY: h } = wt(t);
|
|
886
|
+
l && t.midAnchorPointPx && (l.style.minHeight = `${d}px`), e.current.style.transition = "none", e.current.style.transform = `translateY(${h}px)`, e.current.style.height = `${d}px`, l && (l.style.opacity = "1"), r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${c}px)`), n();
|
|
887
|
+
}, nt = ({
|
|
763
888
|
ref: e,
|
|
764
889
|
options: t,
|
|
765
890
|
toggleRef: r,
|
|
766
|
-
afterApply:
|
|
891
|
+
afterApply: n
|
|
767
892
|
}) => {
|
|
768
|
-
const
|
|
769
|
-
|
|
893
|
+
const l = ae(e), { midAnchorPx: c, sidebarHeightPx: d, translateY: h } = wt(t);
|
|
894
|
+
l && t.midAnchorPointPx && (l.style.minHeight = `${d}px`);
|
|
895
|
+
const g = t.transitionMs ? t.transitionMs / 2 : 0;
|
|
896
|
+
l && t.fadeContent && (l.style.opacity = "0"), requestAnimationFrame(() => {
|
|
770
897
|
if (!e.current) return;
|
|
771
|
-
const
|
|
772
|
-
e.current.style.transition = `${
|
|
773
|
-
if (
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
e.current.style.height
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
898
|
+
const p = `transform ${t.transitionMs}ms ${fe}`, S = t.isAbsolute ? "" : `, height ${t.transitionMs}ms ${fe}`;
|
|
899
|
+
e.current.style.transition = `${p}${S}`, l && t.fadeContent && (l.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
900
|
+
if (e.current) {
|
|
901
|
+
if (e.current.style.transform = `translateY(${h}px)`, !t.isAbsolute)
|
|
902
|
+
e.current.style.height = `${d}px`;
|
|
903
|
+
else if (e.current.style.height !== `${d}px`) {
|
|
904
|
+
const R = e.current.style.transition;
|
|
905
|
+
e.current.style.transition = p, e.current.style.height = `${d}px`, e.current.style.transition = R;
|
|
906
|
+
}
|
|
907
|
+
r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${c}px)`), l && t.fadeContent && setTimeout(() => {
|
|
908
|
+
l.style.opacity = "1";
|
|
909
|
+
}, g), n();
|
|
780
910
|
}
|
|
781
|
-
r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${l}px)`), c && t.fadeContent && setTimeout(() => {
|
|
782
|
-
c.style.opacity = "1";
|
|
783
|
-
}, o), i();
|
|
784
911
|
});
|
|
785
912
|
}), setTimeout(() => {
|
|
786
913
|
}, 0);
|
|
787
|
-
},
|
|
914
|
+
}, it = ({
|
|
788
915
|
ref: e,
|
|
789
916
|
toggleRef: t,
|
|
790
917
|
options: r,
|
|
791
|
-
translateX:
|
|
918
|
+
translateX: n
|
|
792
919
|
}) => {
|
|
793
|
-
!e.current ||
|
|
794
|
-
const
|
|
920
|
+
!e.current || n === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
|
|
921
|
+
const l = ae(e);
|
|
795
922
|
if (e.current) {
|
|
796
|
-
if (
|
|
797
|
-
const
|
|
798
|
-
e.current.style.width !==
|
|
923
|
+
if (l && r.fadeContent && (l.style.opacity = "0"), l && r.sidebarWidthPx && (l.style.minWidth = `${r.sidebarWidthPx}px`), !r.isAbsolute) {
|
|
924
|
+
const c = `${r.sidebarWidthPx}px`;
|
|
925
|
+
e.current.style.width !== c && (e.current.style.width = c);
|
|
799
926
|
}
|
|
800
|
-
e.current.style.transform = `translateX(${
|
|
927
|
+
e.current.style.transform = `translateX(${n}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateY(-50%) translateX(${n}px)`);
|
|
801
928
|
}
|
|
802
929
|
}));
|
|
803
|
-
},
|
|
930
|
+
}, Hr = ({
|
|
804
931
|
ref: e,
|
|
805
932
|
toggleRef: t,
|
|
806
933
|
options: r,
|
|
807
|
-
translateY:
|
|
934
|
+
translateY: n
|
|
808
935
|
}) => {
|
|
809
|
-
!e.current ||
|
|
810
|
-
const
|
|
936
|
+
!e.current || n === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
|
|
937
|
+
const l = ae(e);
|
|
811
938
|
if (e.current) {
|
|
812
|
-
if (
|
|
813
|
-
const
|
|
814
|
-
e.current.style.height !==
|
|
939
|
+
if (l && r.fadeContent && (l.style.opacity = "0"), l && r.sidebarHeightPx && (l.style.minHeight = `${r.sidebarHeightPx}px`), !r.isAbsolute) {
|
|
940
|
+
const c = `${r.sidebarHeightPx}px`;
|
|
941
|
+
e.current.style.height !== c && (e.current.style.height = c);
|
|
815
942
|
}
|
|
816
|
-
e.current.style.transform = `translateY(${
|
|
943
|
+
e.current.style.transform = `translateY(${n}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateX(-50%) translateY(${n}px)`);
|
|
817
944
|
}
|
|
818
945
|
}));
|
|
819
|
-
},
|
|
946
|
+
}, Ee = ({ refs: e, clientX: t, clientY: r, touchId: n, isMouse: l }) => {
|
|
820
947
|
e.draggingRef.current = {
|
|
821
948
|
startX: t,
|
|
822
949
|
startY: r,
|
|
823
|
-
activeTouchId:
|
|
824
|
-
isMouse:
|
|
950
|
+
activeTouchId: n,
|
|
951
|
+
isMouse: l,
|
|
825
952
|
isActivated: !1
|
|
826
953
|
}, e.currentXRef.current = t, e.prevXRef.current = t;
|
|
827
|
-
},
|
|
954
|
+
}, ot = ({
|
|
828
955
|
refs: e,
|
|
829
956
|
clientX: t,
|
|
830
957
|
clientY: r,
|
|
831
|
-
touchId:
|
|
832
|
-
isMouse:
|
|
958
|
+
touchId: n,
|
|
959
|
+
isMouse: l
|
|
833
960
|
}) => {
|
|
834
961
|
e.draggingRef.current = {
|
|
835
962
|
startX: t,
|
|
836
963
|
startY: r,
|
|
837
|
-
activeTouchId:
|
|
838
|
-
isMouse:
|
|
964
|
+
activeTouchId: n,
|
|
965
|
+
isMouse: l,
|
|
839
966
|
isActivated: !1
|
|
840
967
|
}, e.currentYRef.current = r, e.prevYRef.current = r;
|
|
841
|
-
},
|
|
968
|
+
}, xt = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
|
|
842
969
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null, t(null), r();
|
|
843
|
-
},
|
|
970
|
+
}, Gr = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
|
|
844
971
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, t(null);
|
|
845
|
-
},
|
|
846
|
-
function
|
|
972
|
+
}, ge = (e) => e instanceof Element ? !!e.closest("input, textarea, [contenteditable='true']") : !1;
|
|
973
|
+
function st(e) {
|
|
847
974
|
let t = e instanceof HTMLElement ? e : null;
|
|
848
975
|
for (; t; ) {
|
|
849
976
|
const r = getComputedStyle(t);
|
|
@@ -853,164 +980,164 @@ function Ue(e) {
|
|
|
853
980
|
}
|
|
854
981
|
return null;
|
|
855
982
|
}
|
|
856
|
-
const
|
|
983
|
+
const _e = (e, t) => {
|
|
857
984
|
for (let r = 0; r < e.length; r++) {
|
|
858
|
-
const
|
|
859
|
-
if (t == null ||
|
|
860
|
-
return
|
|
985
|
+
const n = e[r];
|
|
986
|
+
if (t == null || n.identifier === t)
|
|
987
|
+
return n;
|
|
861
988
|
}
|
|
862
989
|
return null;
|
|
863
|
-
},
|
|
990
|
+
}, Le = (e, t) => {
|
|
864
991
|
for (let r = 0; r < e.length; r++)
|
|
865
992
|
if (e[r].identifier === t)
|
|
866
993
|
return !0;
|
|
867
994
|
return !1;
|
|
868
|
-
},
|
|
995
|
+
}, De = (e, t, r) => {
|
|
869
996
|
const {
|
|
870
|
-
globalOptions:
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
setBottomSidebarOptionsById:
|
|
874
|
-
} =
|
|
875
|
-
sidebarWidthPx:
|
|
876
|
-
sidebarHeightPx:
|
|
877
|
-
transitionMs:
|
|
878
|
-
edgeActivationWidthPx:
|
|
879
|
-
dragActivationDeltaPx:
|
|
880
|
-
showOverlay:
|
|
881
|
-
isAbsolute:
|
|
997
|
+
globalOptions: n,
|
|
998
|
+
setLeftSidebarOptionsById: l,
|
|
999
|
+
setRightSidebarOptionsById: c,
|
|
1000
|
+
setBottomSidebarOptionsById: d
|
|
1001
|
+
} = J(), {
|
|
1002
|
+
sidebarWidthPx: h,
|
|
1003
|
+
sidebarHeightPx: g,
|
|
1004
|
+
transitionMs: p,
|
|
1005
|
+
edgeActivationWidthPx: S,
|
|
1006
|
+
dragActivationDeltaPx: R,
|
|
1007
|
+
showOverlay: m,
|
|
1008
|
+
isAbsolute: T,
|
|
882
1009
|
overlayBackgroundColor: C,
|
|
883
|
-
toggleIconColor:
|
|
884
|
-
toggleIconSizePx:
|
|
885
|
-
toggleIconEdgeDistancePx:
|
|
886
|
-
showToggle:
|
|
887
|
-
mediaQueryWidth:
|
|
888
|
-
swipeBarZIndex:
|
|
889
|
-
toggleZIndex:
|
|
1010
|
+
toggleIconColor: u,
|
|
1011
|
+
toggleIconSizePx: w,
|
|
1012
|
+
toggleIconEdgeDistancePx: x,
|
|
1013
|
+
showToggle: _,
|
|
1014
|
+
mediaQueryWidth: B,
|
|
1015
|
+
swipeBarZIndex: Y,
|
|
1016
|
+
toggleZIndex: H,
|
|
890
1017
|
overlayZIndex: k,
|
|
891
|
-
fadeContent:
|
|
892
|
-
fadeContentTransitionMs:
|
|
893
|
-
swipeToOpen:
|
|
894
|
-
swipeToClose:
|
|
895
|
-
midAnchorPoint:
|
|
896
|
-
midAnchorPointPx:
|
|
897
|
-
disabled:
|
|
898
|
-
closeSidebarOnOverlayClick:
|
|
899
|
-
resetMetaOnClose:
|
|
900
|
-
} = t,
|
|
901
|
-
const
|
|
1018
|
+
fadeContent: W,
|
|
1019
|
+
fadeContentTransitionMs: X,
|
|
1020
|
+
swipeToOpen: V,
|
|
1021
|
+
swipeToClose: j,
|
|
1022
|
+
midAnchorPoint: Q,
|
|
1023
|
+
midAnchorPointPx: G,
|
|
1024
|
+
disabled: b,
|
|
1025
|
+
closeSidebarOnOverlayClick: M,
|
|
1026
|
+
resetMetaOnClose: P
|
|
1027
|
+
} = t, F = Te(() => {
|
|
1028
|
+
const U = g ?? n.sidebarHeightPx;
|
|
902
1029
|
return {
|
|
903
|
-
sidebarWidthPx:
|
|
904
|
-
sidebarHeightPx:
|
|
905
|
-
transitionMs:
|
|
906
|
-
edgeActivationWidthPx:
|
|
907
|
-
dragActivationDeltaPx:
|
|
908
|
-
showOverlay:
|
|
909
|
-
isAbsolute:
|
|
910
|
-
overlayBackgroundColor: C ??
|
|
911
|
-
toggleIconColor:
|
|
912
|
-
toggleIconSizePx:
|
|
913
|
-
toggleIconEdgeDistancePx:
|
|
914
|
-
showToggle:
|
|
915
|
-
mediaQueryWidth:
|
|
916
|
-
swipeBarZIndex:
|
|
917
|
-
toggleZIndex:
|
|
918
|
-
overlayZIndex: k ??
|
|
919
|
-
fadeContent:
|
|
920
|
-
fadeContentTransitionMs:
|
|
921
|
-
swipeToOpen:
|
|
922
|
-
swipeToClose:
|
|
923
|
-
midAnchorPoint:
|
|
924
|
-
midAnchorPointPx:
|
|
925
|
-
disabled:
|
|
926
|
-
closeSidebarOnOverlayClick:
|
|
927
|
-
resetMetaOnClose:
|
|
1030
|
+
sidebarWidthPx: h ?? n.sidebarWidthPx,
|
|
1031
|
+
sidebarHeightPx: U,
|
|
1032
|
+
transitionMs: p ?? n.transitionMs,
|
|
1033
|
+
edgeActivationWidthPx: S ?? n.edgeActivationWidthPx,
|
|
1034
|
+
dragActivationDeltaPx: R ?? n.dragActivationDeltaPx,
|
|
1035
|
+
showOverlay: m ?? n.showOverlay,
|
|
1036
|
+
isAbsolute: T ?? n.isAbsolute,
|
|
1037
|
+
overlayBackgroundColor: C ?? n.overlayBackgroundColor,
|
|
1038
|
+
toggleIconColor: u ?? n.toggleIconColor,
|
|
1039
|
+
toggleIconSizePx: w ?? n.toggleIconSizePx,
|
|
1040
|
+
toggleIconEdgeDistancePx: x ?? n.toggleIconEdgeDistancePx,
|
|
1041
|
+
showToggle: _ ?? n.showToggle,
|
|
1042
|
+
mediaQueryWidth: B ?? n.mediaQueryWidth,
|
|
1043
|
+
swipeBarZIndex: Y ?? n.swipeBarZIndex,
|
|
1044
|
+
toggleZIndex: H ?? n.toggleZIndex,
|
|
1045
|
+
overlayZIndex: k ?? n.overlayZIndex,
|
|
1046
|
+
fadeContent: W ?? n.fadeContent,
|
|
1047
|
+
fadeContentTransitionMs: X ?? n.fadeContentTransitionMs,
|
|
1048
|
+
swipeToOpen: V ?? n.swipeToOpen,
|
|
1049
|
+
swipeToClose: j ?? n.swipeToClose,
|
|
1050
|
+
midAnchorPoint: Q ?? n.midAnchorPoint,
|
|
1051
|
+
midAnchorPointPx: G ?? n.midAnchorPointPx ?? Math.floor(U / 3),
|
|
1052
|
+
disabled: b ?? n.disabled,
|
|
1053
|
+
closeSidebarOnOverlayClick: M ?? n.closeSidebarOnOverlayClick,
|
|
1054
|
+
resetMetaOnClose: P ?? n.resetMetaOnClose
|
|
928
1055
|
};
|
|
929
1056
|
}, [
|
|
930
|
-
f,
|
|
931
|
-
l,
|
|
932
|
-
s,
|
|
933
|
-
w,
|
|
934
|
-
y,
|
|
935
1057
|
h,
|
|
1058
|
+
g,
|
|
1059
|
+
p,
|
|
936
1060
|
S,
|
|
1061
|
+
R,
|
|
1062
|
+
m,
|
|
1063
|
+
T,
|
|
937
1064
|
C,
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
$,
|
|
944
|
-
j,
|
|
1065
|
+
u,
|
|
1066
|
+
w,
|
|
1067
|
+
x,
|
|
1068
|
+
_,
|
|
1069
|
+
n,
|
|
945
1070
|
B,
|
|
1071
|
+
Y,
|
|
1072
|
+
H,
|
|
946
1073
|
k,
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
E,
|
|
950
|
-
M,
|
|
951
|
-
q,
|
|
952
|
-
D,
|
|
1074
|
+
W,
|
|
1075
|
+
X,
|
|
953
1076
|
V,
|
|
954
|
-
|
|
955
|
-
|
|
1077
|
+
j,
|
|
1078
|
+
Q,
|
|
1079
|
+
G,
|
|
1080
|
+
b,
|
|
1081
|
+
M,
|
|
1082
|
+
P
|
|
956
1083
|
]);
|
|
957
|
-
return
|
|
958
|
-
e === "left" ?
|
|
1084
|
+
return q(() => {
|
|
1085
|
+
e === "left" ? l(r ?? "primary", F) : e === "right" ? c(r ?? "primary", F) : e === "bottom" ? d(r ?? "primary", F) : Ce(e);
|
|
959
1086
|
}, [
|
|
960
1087
|
e,
|
|
961
1088
|
r,
|
|
962
|
-
|
|
1089
|
+
F,
|
|
1090
|
+
l,
|
|
963
1091
|
c,
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
]), N;
|
|
1092
|
+
d
|
|
1093
|
+
]), F;
|
|
967
1094
|
};
|
|
968
|
-
function
|
|
1095
|
+
function Ye({
|
|
969
1096
|
isCollapsed: e,
|
|
970
1097
|
setCollapsed: t,
|
|
971
1098
|
closeSidebarOnClick: r = !0,
|
|
972
|
-
transitionMs:
|
|
973
|
-
overlayBackgroundColor:
|
|
974
|
-
overlayZIndex:
|
|
1099
|
+
transitionMs: n,
|
|
1100
|
+
overlayBackgroundColor: l,
|
|
1101
|
+
overlayZIndex: c
|
|
975
1102
|
}) {
|
|
976
|
-
return /* @__PURE__ */
|
|
1103
|
+
return /* @__PURE__ */ I.jsx(
|
|
977
1104
|
"div",
|
|
978
1105
|
{
|
|
979
1106
|
"aria-hidden": "true",
|
|
980
1107
|
style: {
|
|
981
|
-
transitionDuration: `${
|
|
982
|
-
...
|
|
983
|
-
...e ? {} :
|
|
984
|
-
...
|
|
985
|
-
zIndex:
|
|
1108
|
+
transitionDuration: `${n}ms`,
|
|
1109
|
+
...kr,
|
|
1110
|
+
...e ? {} : Wr,
|
|
1111
|
+
...l ? { backgroundColor: l } : {},
|
|
1112
|
+
zIndex: c
|
|
986
1113
|
},
|
|
987
|
-
onMouseDown: (
|
|
988
|
-
r && (
|
|
1114
|
+
onMouseDown: (d) => {
|
|
1115
|
+
r && (d.stopPropagation(), t());
|
|
989
1116
|
}
|
|
990
1117
|
}
|
|
991
1118
|
);
|
|
992
1119
|
}
|
|
993
|
-
function
|
|
994
|
-
const r =
|
|
995
|
-
return
|
|
996
|
-
const
|
|
1120
|
+
function Xe({ size: e, color: t }) {
|
|
1121
|
+
const r = L(null);
|
|
1122
|
+
return q(() => {
|
|
1123
|
+
const n = () => {
|
|
997
1124
|
r.current && (r.current.style.opacity = "1");
|
|
998
|
-
},
|
|
999
|
-
r.current && (r.current.style.opacity = `${
|
|
1125
|
+
}, l = () => {
|
|
1126
|
+
r.current && (r.current.style.opacity = `${et}`);
|
|
1000
1127
|
};
|
|
1001
|
-
r.current && (r.current.addEventListener("mouseenter",
|
|
1002
|
-
}, []), /* @__PURE__ */
|
|
1128
|
+
r.current && (r.current.addEventListener("mouseenter", n), r.current.addEventListener("mouseleave", l));
|
|
1129
|
+
}, []), /* @__PURE__ */ I.jsx(
|
|
1003
1130
|
"div",
|
|
1004
1131
|
{
|
|
1005
1132
|
style: {
|
|
1006
|
-
...
|
|
1133
|
+
...Fr
|
|
1007
1134
|
},
|
|
1008
|
-
children: /* @__PURE__ */
|
|
1135
|
+
children: /* @__PURE__ */ I.jsxs(
|
|
1009
1136
|
"svg",
|
|
1010
1137
|
{
|
|
1011
1138
|
style: {
|
|
1012
|
-
transition: `opacity ${
|
|
1013
|
-
opacity: `${
|
|
1139
|
+
transition: `opacity ${Er}ms ease`,
|
|
1140
|
+
opacity: `${et}`
|
|
1014
1141
|
},
|
|
1015
1142
|
ref: r,
|
|
1016
1143
|
"aria-hidden": "true",
|
|
@@ -1019,8 +1146,8 @@ function Ie({ size: e, color: t }) {
|
|
|
1019
1146
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1020
1147
|
width: e,
|
|
1021
1148
|
children: [
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */
|
|
1149
|
+
/* @__PURE__ */ I.jsx("g", { strokeWidth: "0" }),
|
|
1150
|
+
/* @__PURE__ */ I.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ I.jsx("g", { children: /* @__PURE__ */ I.jsx(
|
|
1024
1151
|
"path",
|
|
1025
1152
|
{
|
|
1026
1153
|
clipRule: "evenodd",
|
|
@@ -1035,426 +1162,446 @@ function Ie({ size: e, color: t }) {
|
|
|
1035
1162
|
}
|
|
1036
1163
|
);
|
|
1037
1164
|
}
|
|
1038
|
-
function
|
|
1165
|
+
function Ur({
|
|
1039
1166
|
id: e,
|
|
1040
1167
|
toggleRef: t,
|
|
1041
1168
|
options: r,
|
|
1042
|
-
showToggle:
|
|
1043
|
-
ToggleComponent:
|
|
1169
|
+
showToggle: n = !0,
|
|
1170
|
+
ToggleComponent: l
|
|
1044
1171
|
}) {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
return i ? /* @__PURE__ */ O.jsx(
|
|
1172
|
+
const { openSidebar: c, closeSidebar: d, bottomSidebars: h } = J(), g = h[e]?.isOpen ?? !1;
|
|
1173
|
+
return n ? /* @__PURE__ */ I.jsx(
|
|
1048
1174
|
"div",
|
|
1049
1175
|
{
|
|
1050
1176
|
ref: t,
|
|
1051
1177
|
style: {
|
|
1052
|
-
...
|
|
1178
|
+
...jr,
|
|
1053
1179
|
transition: `transform ${r.transitionMs}ms ease, opacity ${r.transitionMs}ms ease`,
|
|
1054
1180
|
zIndex: r.toggleZIndex
|
|
1055
1181
|
},
|
|
1056
|
-
children: (!
|
|
1182
|
+
children: (!g || g && !r.showOverlay) && /* @__PURE__ */ I.jsx(
|
|
1057
1183
|
"button",
|
|
1058
1184
|
{
|
|
1059
1185
|
type: "button",
|
|
1060
|
-
"aria-expanded":
|
|
1186
|
+
"aria-expanded": g,
|
|
1061
1187
|
"aria-controls": `swipebar-bottom-${e}`,
|
|
1062
|
-
"aria-label":
|
|
1188
|
+
"aria-label": g ? "Close bottom sidebar" : "Open bottom sidebar",
|
|
1063
1189
|
onClick: () => {
|
|
1064
|
-
r.disabled || (
|
|
1190
|
+
r.disabled || (g ? d("bottom", { id: e }) : c("bottom", { id: e }));
|
|
1065
1191
|
},
|
|
1066
1192
|
disabled: r.disabled,
|
|
1067
1193
|
style: {
|
|
1068
1194
|
marginBottom: `${r.toggleIconEdgeDistancePx}px`,
|
|
1069
1195
|
// Rotate icon: -90deg points up when closed, 90deg points down when open
|
|
1070
|
-
transform:
|
|
1196
|
+
transform: g ? "rotate(90deg)" : "rotate(-90deg)"
|
|
1071
1197
|
},
|
|
1072
|
-
children:
|
|
1198
|
+
children: l ?? /* @__PURE__ */ I.jsx(Xe, { size: r.toggleIconSizePx, color: r.toggleIconColor })
|
|
1073
1199
|
}
|
|
1074
1200
|
)
|
|
1075
1201
|
}
|
|
1076
1202
|
) : null;
|
|
1077
1203
|
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
return
|
|
1204
|
+
function $e({ defaultOpen: e, optionsReady: t, onOpen: r }) {
|
|
1205
|
+
const n = L(!1);
|
|
1206
|
+
return cr(() => {
|
|
1207
|
+
e && (document.body.style.overflow = "hidden");
|
|
1208
|
+
}, [e]), q(() => {
|
|
1209
|
+
e && !n.current && t && (n.current = !0, r());
|
|
1210
|
+
}, [e, r, t]), { forceOverlayVisible: !!e && !n.current };
|
|
1211
|
+
}
|
|
1212
|
+
const Zr = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])', at = { preventScroll: !0, focusVisible: !1 };
|
|
1213
|
+
function ct(e) {
|
|
1214
|
+
return Array.from(e.querySelectorAll(Zr)).filter(
|
|
1081
1215
|
(t) => !t.closest("[inert]")
|
|
1082
1216
|
);
|
|
1083
1217
|
}
|
|
1084
|
-
function
|
|
1218
|
+
function Be({
|
|
1085
1219
|
sidebarRef: e,
|
|
1086
1220
|
triggerRef: t,
|
|
1087
1221
|
isOpen: r,
|
|
1088
|
-
onClose:
|
|
1089
|
-
transitionMs:
|
|
1222
|
+
onClose: n,
|
|
1223
|
+
transitionMs: l
|
|
1090
1224
|
}) {
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
var f;
|
|
1225
|
+
const c = L(null);
|
|
1226
|
+
q(() => {
|
|
1094
1227
|
if (r) {
|
|
1095
|
-
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1228
|
+
c.current = document.activeElement;
|
|
1229
|
+
const h = setTimeout(() => {
|
|
1230
|
+
if (!e.current) return;
|
|
1231
|
+
const g = at, p = ct(e.current);
|
|
1232
|
+
p.length > 0 ? p[0].focus(g) : (e.current.setAttribute("tabindex", "-1"), e.current.focus(g));
|
|
1233
|
+
}, l);
|
|
1234
|
+
return () => clearTimeout(h);
|
|
1100
1235
|
}
|
|
1101
|
-
const
|
|
1102
|
-
if (
|
|
1103
|
-
const
|
|
1236
|
+
const d = c.current;
|
|
1237
|
+
if (d) {
|
|
1238
|
+
const h = t.current?.querySelector("button") ?? d;
|
|
1104
1239
|
requestAnimationFrame(() => {
|
|
1105
|
-
|
|
1106
|
-
}),
|
|
1240
|
+
h.focus(at);
|
|
1241
|
+
}), c.current = null;
|
|
1107
1242
|
}
|
|
1108
|
-
}, [r, e, t,
|
|
1243
|
+
}, [r, e, t, l]), q(() => {
|
|
1109
1244
|
if (!r) return;
|
|
1110
|
-
function
|
|
1111
|
-
if (
|
|
1245
|
+
function d(h) {
|
|
1246
|
+
if (h.key === "Escape") {
|
|
1112
1247
|
if (!e.current) return;
|
|
1113
|
-
e.current.contains(document.activeElement) && (
|
|
1248
|
+
e.current.contains(document.activeElement) && (h.preventDefault(), n());
|
|
1114
1249
|
return;
|
|
1115
1250
|
}
|
|
1116
|
-
if (
|
|
1117
|
-
const
|
|
1118
|
-
if (
|
|
1119
|
-
const
|
|
1120
|
-
|
|
1251
|
+
if (h.key !== "Tab" || !e.current) return;
|
|
1252
|
+
const g = ct(e.current);
|
|
1253
|
+
if (g.length === 0) return;
|
|
1254
|
+
const p = g[0], S = g[g.length - 1];
|
|
1255
|
+
h.shiftKey ? document.activeElement === p && (h.preventDefault(), S.focus()) : document.activeElement === S && (h.preventDefault(), p.focus());
|
|
1121
1256
|
}
|
|
1122
|
-
return document.addEventListener("keydown",
|
|
1123
|
-
}, [r, e,
|
|
1257
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
1258
|
+
}, [r, e, n]);
|
|
1124
1259
|
}
|
|
1125
|
-
function
|
|
1126
|
-
const t = `(max-width: ${Math.min(e,
|
|
1127
|
-
return
|
|
1260
|
+
function he(e = Me) {
|
|
1261
|
+
const t = `(max-width: ${Math.min(e, Me)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [n, l] = te(r);
|
|
1262
|
+
return q(() => {
|
|
1128
1263
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
1129
1264
|
return;
|
|
1130
|
-
const
|
|
1131
|
-
return
|
|
1132
|
-
}, [t]),
|
|
1265
|
+
const c = window.matchMedia(t), d = () => l(c.matches);
|
|
1266
|
+
return d(), c.addEventListener("change", d), () => c.removeEventListener("change", d);
|
|
1267
|
+
}, [t]), n;
|
|
1133
1268
|
}
|
|
1134
|
-
const
|
|
1269
|
+
const lt = ({
|
|
1135
1270
|
refs: e,
|
|
1136
1271
|
callbacks: t,
|
|
1137
1272
|
currentY: r,
|
|
1138
|
-
preventDefault:
|
|
1139
|
-
lockPane:
|
|
1140
|
-
options:
|
|
1141
|
-
scrollableAncestor:
|
|
1142
|
-
initialScrollTop:
|
|
1273
|
+
preventDefault: n,
|
|
1274
|
+
lockPane: l,
|
|
1275
|
+
options: c,
|
|
1276
|
+
scrollableAncestor: d,
|
|
1277
|
+
initialScrollTop: h
|
|
1143
1278
|
}) => {
|
|
1144
1279
|
if (!e.draggingRef.current) return;
|
|
1145
|
-
const
|
|
1146
|
-
if (!e.draggingRef.current.isActivated && Math.abs(
|
|
1147
|
-
if (
|
|
1148
|
-
if (
|
|
1280
|
+
const g = r - e.draggingRef.current.startY;
|
|
1281
|
+
if (!e.draggingRef.current.isActivated && Math.abs(g) >= c.dragActivationDeltaPx) {
|
|
1282
|
+
if (d && t.getIsOpen()) {
|
|
1283
|
+
if (d.scrollTop !== h) {
|
|
1149
1284
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1150
1285
|
return;
|
|
1151
1286
|
}
|
|
1152
|
-
const { scrollTop:
|
|
1153
|
-
if (
|
|
1287
|
+
const { scrollTop: u, scrollHeight: w, clientHeight: x } = d, _ = u > 1, B = u + x < w - 1;
|
|
1288
|
+
if (g > 0 && _ || g < 0 && B) {
|
|
1154
1289
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1155
1290
|
return;
|
|
1156
1291
|
}
|
|
1157
1292
|
}
|
|
1158
|
-
e.draggingRef.current.isActivated = !0,
|
|
1293
|
+
e.draggingRef.current.isActivated = !0, l();
|
|
1159
1294
|
}
|
|
1160
1295
|
if (!e.draggingRef.current.isActivated) return;
|
|
1161
1296
|
e.prevYRef.current = e.currentYRef.current, e.currentYRef.current = r;
|
|
1162
|
-
const
|
|
1163
|
-
let
|
|
1164
|
-
if ((
|
|
1297
|
+
const p = t.getIsOpen(), S = window.innerHeight;
|
|
1298
|
+
let R = !1;
|
|
1299
|
+
if ((p || e.draggingRef.current.startY >= S - c.edgeActivationWidthPx) && (R = !0), !R) {
|
|
1165
1300
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1166
1301
|
return;
|
|
1167
1302
|
}
|
|
1168
|
-
|
|
1169
|
-
const
|
|
1170
|
-
if (
|
|
1303
|
+
n();
|
|
1304
|
+
const m = c.sidebarHeightPx, T = c.midAnchorPointPx, C = c.midAnchorPoint && !c.swipeToOpen && T < m;
|
|
1305
|
+
if (p)
|
|
1171
1306
|
if (C) {
|
|
1172
|
-
const
|
|
1173
|
-
if (
|
|
1174
|
-
const
|
|
1307
|
+
const u = t.getBottomAnchorState();
|
|
1308
|
+
if (u === "open") {
|
|
1309
|
+
const w = Math.max(
|
|
1175
1310
|
0,
|
|
1176
|
-
Math.min(
|
|
1311
|
+
Math.min(m, g - c.dragActivationDeltaPx)
|
|
1177
1312
|
);
|
|
1178
|
-
t.dragSidebar(
|
|
1179
|
-
} else if (
|
|
1180
|
-
const
|
|
1313
|
+
t.dragSidebar(w);
|
|
1314
|
+
} else if (u === "midAnchor") {
|
|
1315
|
+
const w = m - T, x = Math.max(
|
|
1181
1316
|
0,
|
|
1182
1317
|
Math.min(
|
|
1183
|
-
|
|
1184
|
-
|
|
1318
|
+
m,
|
|
1319
|
+
w + g - c.dragActivationDeltaPx
|
|
1185
1320
|
)
|
|
1186
1321
|
);
|
|
1187
|
-
t.dragSidebar(
|
|
1322
|
+
t.dragSidebar(x);
|
|
1188
1323
|
}
|
|
1189
1324
|
} else {
|
|
1190
|
-
const
|
|
1325
|
+
const u = Math.max(
|
|
1191
1326
|
0,
|
|
1192
|
-
Math.min(
|
|
1327
|
+
Math.min(m, g - c.dragActivationDeltaPx)
|
|
1193
1328
|
);
|
|
1194
|
-
t.dragSidebar(
|
|
1329
|
+
t.dragSidebar(u);
|
|
1195
1330
|
}
|
|
1196
|
-
else if (e.draggingRef.current.startY >=
|
|
1331
|
+
else if (e.draggingRef.current.startY >= S - c.edgeActivationWidthPx)
|
|
1197
1332
|
if (C) {
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1333
|
+
const u = m - T, w = Math.max(
|
|
1334
|
+
u,
|
|
1200
1335
|
Math.min(
|
|
1201
|
-
|
|
1202
|
-
|
|
1336
|
+
m,
|
|
1337
|
+
m + g + c.dragActivationDeltaPx
|
|
1203
1338
|
)
|
|
1204
1339
|
);
|
|
1205
|
-
t.dragSidebar(
|
|
1340
|
+
t.dragSidebar(w);
|
|
1206
1341
|
} else {
|
|
1207
|
-
const
|
|
1342
|
+
const u = Math.max(
|
|
1208
1343
|
0,
|
|
1209
1344
|
Math.min(
|
|
1210
|
-
|
|
1211
|
-
|
|
1345
|
+
m,
|
|
1346
|
+
m + g + c.dragActivationDeltaPx
|
|
1212
1347
|
)
|
|
1213
1348
|
);
|
|
1214
|
-
t.dragSidebar(
|
|
1349
|
+
t.dragSidebar(u);
|
|
1215
1350
|
}
|
|
1216
|
-
},
|
|
1351
|
+
}, ut = ({
|
|
1217
1352
|
refs: e,
|
|
1218
1353
|
callbacks: t,
|
|
1219
1354
|
options: r,
|
|
1220
|
-
onDragEnd:
|
|
1355
|
+
onDragEnd: n
|
|
1221
1356
|
}) => {
|
|
1222
1357
|
if (!e.draggingRef.current) return;
|
|
1223
1358
|
if (!e.draggingRef.current.isActivated) {
|
|
1224
1359
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null;
|
|
1225
1360
|
return;
|
|
1226
1361
|
}
|
|
1227
|
-
const
|
|
1228
|
-
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null,
|
|
1229
|
-
const
|
|
1230
|
-
if (
|
|
1362
|
+
const l = e.currentYRef.current ?? e.draggingRef.current.startY, c = e.prevYRef.current ?? e.draggingRef.current.startY, d = e.draggingRef.current.startY, h = t.getIsOpen(), g = window.innerHeight;
|
|
1363
|
+
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, n();
|
|
1364
|
+
const p = l < c, S = l >= c, R = d >= g - r.edgeActivationWidthPx, m = r.midAnchorPointPx, T = r.sidebarHeightPx, C = r.midAnchorPoint && !r.swipeToOpen && m < T;
|
|
1365
|
+
if (h)
|
|
1231
1366
|
if (C) {
|
|
1232
|
-
const
|
|
1233
|
-
if (
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1236
|
-
} else if (
|
|
1237
|
-
const
|
|
1367
|
+
const u = t.getBottomAnchorState(), w = T - m;
|
|
1368
|
+
if (u === "open") {
|
|
1369
|
+
const x = Math.max(0, l - d);
|
|
1370
|
+
S ? x > w ? t.closeSidebar() : t.openToMidAnchor() : x < w ? t.openSidebarFully() : t.closeSidebar(), t.dragSidebar(null);
|
|
1371
|
+
} else if (u === "midAnchor") {
|
|
1372
|
+
const x = T - m, _ = Math.max(
|
|
1238
1373
|
0,
|
|
1239
|
-
Math.min(
|
|
1374
|
+
Math.min(T, x + (l - d))
|
|
1240
1375
|
);
|
|
1241
|
-
|
|
1376
|
+
p ? _ < w ? t.openSidebarFully() : t.openToMidAnchor() : t.closeSidebar(), t.dragSidebar(null);
|
|
1242
1377
|
}
|
|
1243
1378
|
} else
|
|
1244
|
-
|
|
1245
|
-
else
|
|
1379
|
+
S ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null);
|
|
1380
|
+
else R && p ? (C ? t.openToMidAnchor() : t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1246
1381
|
};
|
|
1247
|
-
function
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
p.current = null;
|
|
1382
|
+
function zr(e, t) {
|
|
1383
|
+
const r = he(e.mediaQueryWidth), {
|
|
1384
|
+
lockedSidebar: n,
|
|
1385
|
+
setLockedSidebar: l,
|
|
1386
|
+
bottomSidebars: c,
|
|
1387
|
+
openSidebar: d,
|
|
1388
|
+
openSidebarFully: h,
|
|
1389
|
+
closeSidebar: g,
|
|
1390
|
+
dragSidebar: p,
|
|
1391
|
+
openSidebarToMidAnchor: S,
|
|
1392
|
+
activeBottomDragIdRef: R,
|
|
1393
|
+
bottomFocusStackRef: m
|
|
1394
|
+
} = J(), T = c[t]?.isOpen ?? !1, C = c[t]?.anchorState ?? "closed", u = L(null), w = L(null), x = L(null), _ = L(null), B = L(0), Y = L(null), H = L(C);
|
|
1395
|
+
q(() => {
|
|
1396
|
+
H.current = C;
|
|
1397
|
+
}, [C]), q(() => {
|
|
1398
|
+
if (!r || n && n !== "bottom" || e.disabled) return;
|
|
1399
|
+
const k = {
|
|
1400
|
+
getIsOpen: () => T,
|
|
1401
|
+
openSidebar: () => d("bottom", { id: t }),
|
|
1402
|
+
openSidebarFully: () => h("bottom", { id: t }),
|
|
1403
|
+
closeSidebar: () => g("bottom", { id: t }),
|
|
1404
|
+
dragSidebar: (A) => p("bottom", A, { id: t }),
|
|
1405
|
+
getBottomAnchorState: () => H.current,
|
|
1406
|
+
openToMidAnchor: () => S("bottom", { id: t })
|
|
1407
|
+
}, W = {
|
|
1408
|
+
draggingRef: u,
|
|
1409
|
+
currentYRef: w,
|
|
1410
|
+
prevYRef: x
|
|
1411
|
+
}, X = () => R.current !== null && R.current !== t, V = () => {
|
|
1412
|
+
const A = m.current;
|
|
1413
|
+
return A.length === 0 ? !0 : A[A.length - 1] === t;
|
|
1414
|
+
}, j = () => {
|
|
1415
|
+
if (X()) {
|
|
1416
|
+
u.current = null;
|
|
1283
1417
|
return;
|
|
1284
1418
|
}
|
|
1285
|
-
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1288
|
-
},
|
|
1289
|
-
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1419
|
+
R.current = t, l("bottom");
|
|
1420
|
+
const A = _.current;
|
|
1421
|
+
A && (Y.current = A.style.overflowY, A.style.overflowY = "hidden");
|
|
1422
|
+
}, Q = () => {
|
|
1423
|
+
R.current === t && (R.current = null);
|
|
1424
|
+
const A = _.current;
|
|
1425
|
+
A && Y.current !== null && (A.style.overflowY = Y.current, Y.current = null);
|
|
1292
1426
|
};
|
|
1293
|
-
function
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
touchId: m.identifier,
|
|
1427
|
+
function G(A) {
|
|
1428
|
+
if (n && n !== "bottom" || X() || !V() || ge(A.target) || A.changedTouches.length === 0) return;
|
|
1429
|
+
const Z = A.changedTouches[0], a = window.innerHeight, y = k.getIsOpen(), $ = Z.clientY >= a - e.edgeActivationWidthPx;
|
|
1430
|
+
y && !e.swipeToClose || !y && !e.swipeToOpen || (y || $) && (_.current = st(A.target), B.current = _.current?.scrollTop ?? 0, ot({
|
|
1431
|
+
refs: W,
|
|
1432
|
+
clientX: Z.clientX,
|
|
1433
|
+
clientY: Z.clientY,
|
|
1434
|
+
touchId: Z.identifier,
|
|
1302
1435
|
isMouse: !1
|
|
1303
1436
|
}));
|
|
1304
1437
|
}
|
|
1305
|
-
function
|
|
1306
|
-
if (
|
|
1307
|
-
if (
|
|
1308
|
-
|
|
1438
|
+
function b(A) {
|
|
1439
|
+
if (n && n !== "bottom") return;
|
|
1440
|
+
if (X()) {
|
|
1441
|
+
u.current = null;
|
|
1309
1442
|
return;
|
|
1310
1443
|
}
|
|
1311
|
-
if (!
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1314
|
-
refs:
|
|
1315
|
-
callbacks:
|
|
1316
|
-
currentY:
|
|
1317
|
-
preventDefault: () =>
|
|
1318
|
-
lockPane:
|
|
1444
|
+
if (!u.current || u.current.isMouse) return;
|
|
1445
|
+
const Z = u.current.activeTouchId, a = _e(A.changedTouches, Z);
|
|
1446
|
+
a && lt({
|
|
1447
|
+
refs: W,
|
|
1448
|
+
callbacks: k,
|
|
1449
|
+
currentY: a.clientY,
|
|
1450
|
+
preventDefault: () => A.preventDefault(),
|
|
1451
|
+
lockPane: j,
|
|
1319
1452
|
options: e,
|
|
1320
|
-
scrollableAncestor:
|
|
1321
|
-
initialScrollTop:
|
|
1453
|
+
scrollableAncestor: _.current,
|
|
1454
|
+
initialScrollTop: B.current
|
|
1322
1455
|
});
|
|
1323
1456
|
}
|
|
1324
|
-
function
|
|
1325
|
-
if (
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1328
|
-
refs:
|
|
1329
|
-
callbacks:
|
|
1457
|
+
function M(A) {
|
|
1458
|
+
if (n && n !== "bottom" || !u.current || u.current.isMouse) return;
|
|
1459
|
+
const Z = u.current.activeTouchId;
|
|
1460
|
+
Le(A.changedTouches, Z) && ut({
|
|
1461
|
+
refs: W,
|
|
1462
|
+
callbacks: k,
|
|
1330
1463
|
options: e,
|
|
1331
|
-
onDragEnd:
|
|
1464
|
+
onDragEnd: Q
|
|
1332
1465
|
});
|
|
1333
1466
|
}
|
|
1334
|
-
function
|
|
1335
|
-
|
|
1336
|
-
refs:
|
|
1337
|
-
dragSidebar:
|
|
1467
|
+
function P() {
|
|
1468
|
+
n && n !== "bottom" || !u.current || u.current.isMouse || (Q(), Gr({
|
|
1469
|
+
refs: W,
|
|
1470
|
+
dragSidebar: k.dragSidebar,
|
|
1338
1471
|
onDeactivate: () => {
|
|
1339
1472
|
}
|
|
1340
1473
|
}));
|
|
1341
1474
|
}
|
|
1342
|
-
function
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
clientY: n.clientY,
|
|
1475
|
+
function F(A) {
|
|
1476
|
+
if (n && n !== "bottom" || X() || !V() || ge(A.target) || A.button !== 0) return;
|
|
1477
|
+
const Z = window.innerHeight, a = k.getIsOpen(), y = A.clientY >= Z - e.edgeActivationWidthPx;
|
|
1478
|
+
a && !e.swipeToClose || !a && !e.swipeToOpen || (a || y) && (_.current = st(A.target), B.current = _.current?.scrollTop ?? 0, ot({
|
|
1479
|
+
refs: W,
|
|
1480
|
+
clientX: A.clientX,
|
|
1481
|
+
clientY: A.clientY,
|
|
1350
1482
|
touchId: null,
|
|
1351
1483
|
isMouse: !0
|
|
1352
1484
|
}));
|
|
1353
1485
|
}
|
|
1354
|
-
function
|
|
1355
|
-
if (!(
|
|
1356
|
-
if (
|
|
1357
|
-
|
|
1486
|
+
function U(A) {
|
|
1487
|
+
if (!(n && n !== "bottom")) {
|
|
1488
|
+
if (X()) {
|
|
1489
|
+
u.current = null;
|
|
1358
1490
|
return;
|
|
1359
1491
|
}
|
|
1360
|
-
!
|
|
1361
|
-
refs:
|
|
1362
|
-
callbacks:
|
|
1363
|
-
currentY:
|
|
1364
|
-
preventDefault: () =>
|
|
1365
|
-
lockPane:
|
|
1492
|
+
!u.current || !u.current.isMouse || lt({
|
|
1493
|
+
refs: W,
|
|
1494
|
+
callbacks: k,
|
|
1495
|
+
currentY: A.clientY,
|
|
1496
|
+
preventDefault: () => A.preventDefault(),
|
|
1497
|
+
lockPane: j,
|
|
1366
1498
|
options: e,
|
|
1367
|
-
scrollableAncestor:
|
|
1368
|
-
initialScrollTop:
|
|
1499
|
+
scrollableAncestor: _.current,
|
|
1500
|
+
initialScrollTop: B.current
|
|
1369
1501
|
});
|
|
1370
1502
|
}
|
|
1371
1503
|
}
|
|
1372
|
-
function
|
|
1373
|
-
|
|
1374
|
-
refs:
|
|
1375
|
-
callbacks:
|
|
1504
|
+
function ie() {
|
|
1505
|
+
n && n !== "bottom" || !u.current || !u.current.isMouse || ut({
|
|
1506
|
+
refs: W,
|
|
1507
|
+
callbacks: k,
|
|
1376
1508
|
options: e,
|
|
1377
|
-
onDragEnd:
|
|
1509
|
+
onDragEnd: Q
|
|
1378
1510
|
});
|
|
1379
1511
|
}
|
|
1380
|
-
return window.addEventListener("touchstart",
|
|
1381
|
-
window.removeEventListener("touchstart",
|
|
1512
|
+
return window.addEventListener("touchstart", G, { passive: !0 }), window.addEventListener("touchmove", b, { passive: !1 }), window.addEventListener("touchend", M, { passive: !0 }), window.addEventListener("touchcancel", P, { passive: !0 }), window.addEventListener("mousedown", F, { passive: !0 }), window.addEventListener("mousemove", U, { passive: !1 }), window.addEventListener("mouseup", ie, { passive: !0 }), () => {
|
|
1513
|
+
window.removeEventListener("touchstart", G), window.removeEventListener("touchmove", b), window.removeEventListener("touchend", M), window.removeEventListener("touchcancel", P), window.removeEventListener("mousedown", F), window.removeEventListener("mousemove", U), window.removeEventListener("mouseup", ie);
|
|
1382
1514
|
};
|
|
1383
1515
|
}, [
|
|
1384
1516
|
t,
|
|
1385
1517
|
r,
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1518
|
+
T,
|
|
1519
|
+
d,
|
|
1520
|
+
h,
|
|
1521
|
+
g,
|
|
1522
|
+
p,
|
|
1523
|
+
n,
|
|
1389
1524
|
l,
|
|
1390
|
-
s,
|
|
1391
|
-
i,
|
|
1392
|
-
c,
|
|
1393
1525
|
e,
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1526
|
+
S,
|
|
1527
|
+
R,
|
|
1528
|
+
m
|
|
1397
1529
|
]);
|
|
1398
1530
|
}
|
|
1399
|
-
function
|
|
1531
|
+
function rn({
|
|
1400
1532
|
id: e = "primary",
|
|
1401
1533
|
className: t,
|
|
1402
1534
|
children: r,
|
|
1403
|
-
ToggleComponent:
|
|
1404
|
-
ariaLabel:
|
|
1405
|
-
|
|
1535
|
+
ToggleComponent: n,
|
|
1536
|
+
ariaLabel: l,
|
|
1537
|
+
defaultOpen: c,
|
|
1538
|
+
...d
|
|
1406
1539
|
}) {
|
|
1407
|
-
|
|
1408
|
-
if ((r == null ? void 0 : r.type) === O.Fragment)
|
|
1540
|
+
if (r?.type === I.Fragment)
|
|
1409
1541
|
throw new Error("Fragments is not allowed in SwipeBarBottom");
|
|
1410
|
-
const {
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1542
|
+
const {
|
|
1543
|
+
bottomSidebars: h,
|
|
1544
|
+
bottomSidebarOptionsMap: g,
|
|
1545
|
+
closeSidebar: p,
|
|
1546
|
+
openSidebarFully: S,
|
|
1547
|
+
registerBottomSidebar: R,
|
|
1548
|
+
unregisterBottomSidebar: m
|
|
1549
|
+
} = J(), T = L(null), C = L(null);
|
|
1550
|
+
q(() => (R(e, { sidebarRef: T, toggleRef: C }), () => m(e)), [e, R, m]);
|
|
1551
|
+
const u = De("bottom", d, e), w = he(u.mediaQueryWidth);
|
|
1552
|
+
zr(u, e);
|
|
1553
|
+
const x = h[e]?.isOpen ?? !1, _ = E(
|
|
1554
|
+
() => S("bottom", { id: e, skipTransition: !0 }),
|
|
1555
|
+
[S, e]
|
|
1556
|
+
), { forceOverlayVisible: B } = $e({
|
|
1557
|
+
defaultOpen: c,
|
|
1558
|
+
optionsReady: !!g[e],
|
|
1559
|
+
onOpen: _
|
|
1560
|
+
}), Y = E(() => p("bottom", { id: e }), [p, e]);
|
|
1561
|
+
return Be({
|
|
1562
|
+
sidebarRef: T,
|
|
1563
|
+
triggerRef: C,
|
|
1564
|
+
isOpen: x,
|
|
1565
|
+
onClose: Y,
|
|
1566
|
+
transitionMs: u.transitionMs
|
|
1567
|
+
}), /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
|
|
1568
|
+
u.showOverlay && /* @__PURE__ */ I.jsx(
|
|
1569
|
+
Ye,
|
|
1424
1570
|
{
|
|
1425
|
-
isCollapsed: !
|
|
1426
|
-
setCollapsed: () =>
|
|
1427
|
-
closeSidebarOnClick:
|
|
1428
|
-
transitionMs:
|
|
1429
|
-
overlayBackgroundColor:
|
|
1430
|
-
overlayZIndex:
|
|
1571
|
+
isCollapsed: !x && !B,
|
|
1572
|
+
setCollapsed: () => p("bottom", { id: e }),
|
|
1573
|
+
closeSidebarOnClick: u.closeSidebarOnOverlayClick,
|
|
1574
|
+
transitionMs: u.transitionMs,
|
|
1575
|
+
overlayBackgroundColor: u.overlayBackgroundColor,
|
|
1576
|
+
overlayZIndex: u.overlayZIndex
|
|
1431
1577
|
}
|
|
1432
1578
|
),
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
|
|
1579
|
+
/* @__PURE__ */ I.jsx(
|
|
1580
|
+
Ur,
|
|
1435
1581
|
{
|
|
1436
1582
|
id: e,
|
|
1437
|
-
toggleRef:
|
|
1438
|
-
options:
|
|
1439
|
-
showToggle:
|
|
1440
|
-
ToggleComponent:
|
|
1583
|
+
toggleRef: C,
|
|
1584
|
+
options: u,
|
|
1585
|
+
showToggle: u.showToggle,
|
|
1586
|
+
ToggleComponent: n
|
|
1441
1587
|
}
|
|
1442
1588
|
),
|
|
1443
|
-
/* @__PURE__ */
|
|
1589
|
+
/* @__PURE__ */ I.jsx(
|
|
1444
1590
|
"div",
|
|
1445
1591
|
{
|
|
1446
|
-
ref:
|
|
1592
|
+
ref: T,
|
|
1447
1593
|
id: `swipebar-bottom-${e}`,
|
|
1448
1594
|
role: "dialog",
|
|
1449
|
-
"aria-modal":
|
|
1450
|
-
"aria-label":
|
|
1451
|
-
inert: !
|
|
1595
|
+
"aria-modal": x,
|
|
1596
|
+
"aria-label": l ?? "Bottom sidebar",
|
|
1597
|
+
inert: !x,
|
|
1452
1598
|
style: {
|
|
1453
|
-
...
|
|
1454
|
-
|
|
1455
|
-
...
|
|
1456
|
-
...t ? {} : { backgroundColor:
|
|
1457
|
-
zIndex:
|
|
1599
|
+
...Xr,
|
|
1600
|
+
...$r,
|
|
1601
|
+
...u.isAbsolute || w ? Br : {},
|
|
1602
|
+
...t ? {} : { backgroundColor: Ie },
|
|
1603
|
+
zIndex: u.swipeBarZIndex,
|
|
1604
|
+
...c ? { transform: "translateY(0px)", height: `${u.sidebarHeightPx}px` } : {}
|
|
1458
1605
|
},
|
|
1459
1606
|
className: t,
|
|
1460
1607
|
children: r
|
|
@@ -1462,507 +1609,615 @@ function wr({
|
|
|
1462
1609
|
)
|
|
1463
1610
|
] });
|
|
1464
1611
|
}
|
|
1465
|
-
function
|
|
1466
|
-
|
|
1467
|
-
|
|
1612
|
+
function Vr({
|
|
1613
|
+
id: e,
|
|
1614
|
+
toggleRef: t,
|
|
1615
|
+
options: r,
|
|
1616
|
+
showToggle: n = !0,
|
|
1617
|
+
ToggleComponent: l
|
|
1618
|
+
}) {
|
|
1619
|
+
const { openSidebar: c, closeSidebar: d, leftSidebars: h } = J(), g = h[e]?.isOpen ?? !1;
|
|
1620
|
+
return n ? /* @__PURE__ */ I.jsx(
|
|
1468
1621
|
"div",
|
|
1469
1622
|
{
|
|
1470
|
-
ref:
|
|
1623
|
+
ref: t,
|
|
1471
1624
|
style: {
|
|
1472
|
-
...
|
|
1473
|
-
transition: `transform ${
|
|
1625
|
+
...yt,
|
|
1626
|
+
transition: `transform ${r.transitionMs}ms ease, opacity ${r.transitionMs}ms ease`,
|
|
1474
1627
|
left: 0,
|
|
1475
|
-
zIndex:
|
|
1628
|
+
zIndex: r.toggleZIndex
|
|
1476
1629
|
},
|
|
1477
|
-
children: (!
|
|
1630
|
+
children: (!g || g && !r.showOverlay) && /* @__PURE__ */ I.jsx(
|
|
1478
1631
|
"button",
|
|
1479
1632
|
{
|
|
1480
1633
|
type: "button",
|
|
1481
|
-
"aria-expanded":
|
|
1482
|
-
"aria-controls":
|
|
1483
|
-
"aria-label":
|
|
1634
|
+
"aria-expanded": g,
|
|
1635
|
+
"aria-controls": `swipebar-left-${e}`,
|
|
1636
|
+
"aria-label": g ? "Close left sidebar" : "Open left sidebar",
|
|
1484
1637
|
onClick: () => {
|
|
1485
|
-
|
|
1638
|
+
r.disabled || (g ? d("left", { id: e }) : c("left", { id: e }));
|
|
1486
1639
|
},
|
|
1487
|
-
disabled:
|
|
1640
|
+
disabled: r.disabled,
|
|
1488
1641
|
style: {
|
|
1489
|
-
marginLeft: `${
|
|
1490
|
-
...
|
|
1642
|
+
marginLeft: `${r.toggleIconEdgeDistancePx}px`,
|
|
1643
|
+
...g ? { transform: "rotate(180deg)" } : {}
|
|
1491
1644
|
},
|
|
1492
|
-
children:
|
|
1645
|
+
children: l ?? /* @__PURE__ */ I.jsx(Xe, { size: r.toggleIconSizePx, color: r.toggleIconColor })
|
|
1493
1646
|
}
|
|
1494
1647
|
)
|
|
1495
1648
|
}
|
|
1496
1649
|
) : null;
|
|
1497
1650
|
}
|
|
1498
|
-
const
|
|
1651
|
+
const dt = ({
|
|
1499
1652
|
refs: e,
|
|
1500
1653
|
callbacks: t,
|
|
1501
1654
|
currentX: r,
|
|
1502
|
-
preventDefault:
|
|
1503
|
-
lockPane:
|
|
1504
|
-
options:
|
|
1655
|
+
preventDefault: n,
|
|
1656
|
+
lockPane: l,
|
|
1657
|
+
options: c
|
|
1505
1658
|
}) => {
|
|
1506
1659
|
if (!e.draggingRef.current) return;
|
|
1507
|
-
const
|
|
1508
|
-
if (!e.draggingRef.current.isActivated && Math.abs(
|
|
1660
|
+
const d = r - e.draggingRef.current.startX;
|
|
1661
|
+
if (!e.draggingRef.current.isActivated && Math.abs(d) >= c.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, l()), !e.draggingRef.current.isActivated) return;
|
|
1509
1662
|
e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
|
|
1510
|
-
const
|
|
1511
|
-
let
|
|
1512
|
-
if ((
|
|
1663
|
+
const h = t.getIsOpen();
|
|
1664
|
+
let g = !1;
|
|
1665
|
+
if ((h || e.draggingRef.current.startX <= c.edgeActivationWidthPx) && (g = !0), !g) {
|
|
1513
1666
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1514
1667
|
return;
|
|
1515
1668
|
}
|
|
1516
|
-
|
|
1517
|
-
const
|
|
1518
|
-
if (
|
|
1519
|
-
const
|
|
1669
|
+
n();
|
|
1670
|
+
const p = c.sidebarWidthPx;
|
|
1671
|
+
if (h) {
|
|
1672
|
+
const S = Math.min(
|
|
1520
1673
|
0,
|
|
1521
|
-
Math.max(-
|
|
1674
|
+
Math.max(-p, d + c.dragActivationDeltaPx)
|
|
1522
1675
|
);
|
|
1523
|
-
t.dragSidebar(
|
|
1524
|
-
} else if (e.draggingRef.current.startX <=
|
|
1525
|
-
const
|
|
1676
|
+
t.dragSidebar(S);
|
|
1677
|
+
} else if (e.draggingRef.current.startX <= c.edgeActivationWidthPx) {
|
|
1678
|
+
const S = Math.min(
|
|
1526
1679
|
0,
|
|
1527
1680
|
Math.max(
|
|
1528
|
-
-
|
|
1529
|
-
-
|
|
1681
|
+
-p,
|
|
1682
|
+
-p + d - c.dragActivationDeltaPx
|
|
1530
1683
|
)
|
|
1531
1684
|
);
|
|
1532
|
-
t.dragSidebar(
|
|
1685
|
+
t.dragSidebar(S);
|
|
1533
1686
|
}
|
|
1534
|
-
},
|
|
1687
|
+
}, ft = ({ refs: e, callbacks: t, options: r }) => {
|
|
1535
1688
|
if (!e.draggingRef.current) return;
|
|
1536
1689
|
if (!e.draggingRef.current.isActivated) {
|
|
1537
1690
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1538
1691
|
return;
|
|
1539
1692
|
}
|
|
1540
|
-
const
|
|
1693
|
+
const n = e.currentXRef.current ?? e.draggingRef.current.startX, l = e.prevXRef.current ?? e.draggingRef.current.startX, c = e.draggingRef.current.startX, d = t.getIsOpen();
|
|
1541
1694
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1695
|
+
const h = n >= l, g = n < l, p = c <= r.edgeActivationWidthPx;
|
|
1696
|
+
d ? (g ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : p && h ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1544
1697
|
};
|
|
1545
|
-
function
|
|
1546
|
-
const
|
|
1547
|
-
lockedSidebar:
|
|
1548
|
-
setLockedSidebar:
|
|
1549
|
-
|
|
1550
|
-
openSidebar:
|
|
1551
|
-
closeSidebar:
|
|
1552
|
-
dragSidebar:
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1698
|
+
function qr(e, t) {
|
|
1699
|
+
const r = he(e.mediaQueryWidth), {
|
|
1700
|
+
lockedSidebar: n,
|
|
1701
|
+
setLockedSidebar: l,
|
|
1702
|
+
leftSidebars: c,
|
|
1703
|
+
openSidebar: d,
|
|
1704
|
+
closeSidebar: h,
|
|
1705
|
+
dragSidebar: g,
|
|
1706
|
+
activeLeftDragIdRef: p,
|
|
1707
|
+
leftFocusStackRef: S
|
|
1708
|
+
} = J(), R = c[t]?.isOpen ?? !1, m = L(null), T = L(null), C = L(null);
|
|
1709
|
+
q(() => {
|
|
1710
|
+
if (!r || n && n !== "left" || e.disabled) return;
|
|
1711
|
+
const u = {
|
|
1712
|
+
getIsOpen: () => R,
|
|
1713
|
+
openSidebar: () => d("left", { id: t }),
|
|
1714
|
+
closeSidebar: () => h("left", { id: t }),
|
|
1715
|
+
dragSidebar: (b) => g("left", b, { id: t })
|
|
1716
|
+
}, w = {
|
|
1717
|
+
draggingRef: m,
|
|
1718
|
+
currentXRef: T,
|
|
1719
|
+
prevXRef: C
|
|
1720
|
+
}, x = () => p.current !== null && p.current !== t, _ = () => {
|
|
1721
|
+
const b = S.current;
|
|
1722
|
+
return b.length === 0 ? !0 : b[b.length - 1] === t;
|
|
1723
|
+
}, B = () => {
|
|
1724
|
+
if (x()) {
|
|
1725
|
+
m.current = null;
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
p.current = t, l("left");
|
|
1729
|
+
}, Y = () => {
|
|
1730
|
+
p.current === t && (p.current = null);
|
|
1731
|
+
}, H = () => {
|
|
1732
|
+
Y(), l(null);
|
|
1733
|
+
};
|
|
1734
|
+
function k(b) {
|
|
1735
|
+
if (n && n !== "left" || x() || !_() || ge(b.target) || b.changedTouches.length === 0) return;
|
|
1736
|
+
const M = b.changedTouches[0], P = u.getIsOpen(), F = M.clientX <= e.edgeActivationWidthPx;
|
|
1737
|
+
P && !e.swipeToClose || !P && !e.swipeToOpen || (P || F) && Ee({
|
|
1738
|
+
refs: w,
|
|
1739
|
+
clientX: M.clientX,
|
|
1740
|
+
clientY: M.clientY,
|
|
1741
|
+
touchId: M.identifier,
|
|
1575
1742
|
isMouse: !1
|
|
1576
1743
|
});
|
|
1577
1744
|
}
|
|
1578
|
-
function
|
|
1579
|
-
if (
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1745
|
+
function W(b) {
|
|
1746
|
+
if (n && n !== "left") return;
|
|
1747
|
+
if (x()) {
|
|
1748
|
+
m.current = null;
|
|
1749
|
+
return;
|
|
1750
|
+
}
|
|
1751
|
+
if (!m.current || m.current.isMouse) return;
|
|
1752
|
+
const M = m.current.activeTouchId, P = _e(b.changedTouches, M);
|
|
1753
|
+
P && dt({
|
|
1754
|
+
refs: w,
|
|
1755
|
+
callbacks: u,
|
|
1756
|
+
currentX: P.clientX,
|
|
1757
|
+
preventDefault: () => b.preventDefault(),
|
|
1758
|
+
lockPane: B,
|
|
1587
1759
|
options: e
|
|
1588
1760
|
});
|
|
1589
1761
|
}
|
|
1590
|
-
function
|
|
1591
|
-
if (
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
refs:
|
|
1595
|
-
callbacks:
|
|
1762
|
+
function X(b) {
|
|
1763
|
+
if (n && n !== "left" || !m.current || m.current.isMouse) return;
|
|
1764
|
+
const M = m.current.activeTouchId;
|
|
1765
|
+
Le(b.changedTouches, M) && (Y(), ft({
|
|
1766
|
+
refs: w,
|
|
1767
|
+
callbacks: u,
|
|
1596
1768
|
options: e
|
|
1597
|
-
});
|
|
1769
|
+
}));
|
|
1598
1770
|
}
|
|
1599
|
-
function
|
|
1600
|
-
|
|
1601
|
-
refs:
|
|
1602
|
-
dragSidebar:
|
|
1603
|
-
onDeactivate:
|
|
1604
|
-
});
|
|
1771
|
+
function V() {
|
|
1772
|
+
n && n !== "left" || !m.current || m.current.isMouse || (Y(), xt({
|
|
1773
|
+
refs: w,
|
|
1774
|
+
dragSidebar: u.dragSidebar,
|
|
1775
|
+
onDeactivate: H
|
|
1776
|
+
}));
|
|
1605
1777
|
}
|
|
1606
|
-
function j(
|
|
1607
|
-
if (
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1610
|
-
refs:
|
|
1611
|
-
clientX:
|
|
1612
|
-
clientY:
|
|
1778
|
+
function j(b) {
|
|
1779
|
+
if (n && n !== "left" || x() || !_() || ge(b.target) || b.button !== 0) return;
|
|
1780
|
+
const M = u.getIsOpen(), P = b.clientX <= e.edgeActivationWidthPx;
|
|
1781
|
+
M && !e.swipeToClose || !M && !e.swipeToOpen || (M || P) && Ee({
|
|
1782
|
+
refs: w,
|
|
1783
|
+
clientX: b.clientX,
|
|
1784
|
+
clientY: b.clientY,
|
|
1613
1785
|
touchId: null,
|
|
1614
1786
|
isMouse: !0
|
|
1615
1787
|
});
|
|
1616
1788
|
}
|
|
1617
|
-
function
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1789
|
+
function Q(b) {
|
|
1790
|
+
if (!(n && n !== "left")) {
|
|
1791
|
+
if (x()) {
|
|
1792
|
+
m.current = null;
|
|
1793
|
+
return;
|
|
1794
|
+
}
|
|
1795
|
+
!m.current || !m.current.isMouse || dt({
|
|
1796
|
+
refs: w,
|
|
1797
|
+
callbacks: u,
|
|
1798
|
+
currentX: b.clientX,
|
|
1799
|
+
preventDefault: () => b.preventDefault(),
|
|
1800
|
+
lockPane: B,
|
|
1801
|
+
options: e
|
|
1802
|
+
});
|
|
1803
|
+
}
|
|
1626
1804
|
}
|
|
1627
|
-
function
|
|
1628
|
-
|
|
1629
|
-
refs:
|
|
1630
|
-
callbacks:
|
|
1805
|
+
function G() {
|
|
1806
|
+
n && n !== "left" || !m.current || !m.current.isMouse || (Y(), ft({
|
|
1807
|
+
refs: w,
|
|
1808
|
+
callbacks: u,
|
|
1631
1809
|
options: e
|
|
1632
|
-
});
|
|
1810
|
+
}));
|
|
1633
1811
|
}
|
|
1634
|
-
return window.addEventListener("touchstart",
|
|
1635
|
-
window.removeEventListener("touchstart",
|
|
1812
|
+
return window.addEventListener("touchstart", k, { passive: !0 }), window.addEventListener("touchmove", W, { passive: !1 }), window.addEventListener("touchend", X, { passive: !0 }), window.addEventListener("touchcancel", V, { passive: !0 }), window.addEventListener("mousedown", j, { passive: !0 }), window.addEventListener("mousemove", Q, { passive: !1 }), window.addEventListener("mouseup", G, { passive: !0 }), () => {
|
|
1813
|
+
window.removeEventListener("touchstart", k), window.removeEventListener("touchmove", W), window.removeEventListener("touchend", X), window.removeEventListener("touchcancel", V), window.removeEventListener("mousedown", j), window.removeEventListener("mousemove", Q), window.removeEventListener("mouseup", G);
|
|
1636
1814
|
};
|
|
1637
1815
|
}, [
|
|
1638
1816
|
t,
|
|
1639
|
-
c,
|
|
1640
|
-
o,
|
|
1641
|
-
u,
|
|
1642
|
-
f,
|
|
1643
1817
|
r,
|
|
1644
|
-
|
|
1818
|
+
R,
|
|
1819
|
+
d,
|
|
1820
|
+
h,
|
|
1821
|
+
g,
|
|
1822
|
+
n,
|
|
1645
1823
|
l,
|
|
1646
|
-
e
|
|
1824
|
+
e,
|
|
1825
|
+
p,
|
|
1826
|
+
S
|
|
1647
1827
|
]);
|
|
1648
1828
|
}
|
|
1649
|
-
function
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1829
|
+
function nn({
|
|
1830
|
+
id: e = "primary",
|
|
1831
|
+
className: t,
|
|
1832
|
+
children: r,
|
|
1833
|
+
ToggleComponent: n,
|
|
1834
|
+
ariaLabel: l,
|
|
1835
|
+
defaultOpen: c,
|
|
1836
|
+
...d
|
|
1655
1837
|
}) {
|
|
1656
|
-
if (
|
|
1838
|
+
if (r?.type === I.Fragment)
|
|
1657
1839
|
throw new Error("Fragments is not allowed in SwipeBarLeft");
|
|
1658
|
-
const {
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1840
|
+
const {
|
|
1841
|
+
leftSidebars: h,
|
|
1842
|
+
leftSidebarOptionsMap: g,
|
|
1843
|
+
closeSidebar: p,
|
|
1844
|
+
openSidebar: S,
|
|
1845
|
+
registerLeftSidebar: R,
|
|
1846
|
+
unregisterLeftSidebar: m
|
|
1847
|
+
} = J(), T = L(null), C = L(null);
|
|
1848
|
+
q(() => (R(e, { sidebarRef: T, toggleRef: C }), () => m(e)), [e, R, m]);
|
|
1849
|
+
const u = De("left", d, e), w = he(u.mediaQueryWidth);
|
|
1850
|
+
qr(u, e);
|
|
1851
|
+
const x = h[e]?.isOpen ?? !1, _ = E(
|
|
1852
|
+
() => S("left", { id: e, skipTransition: !0 }),
|
|
1853
|
+
[S, e]
|
|
1854
|
+
), { forceOverlayVisible: B } = $e({
|
|
1855
|
+
defaultOpen: c,
|
|
1856
|
+
optionsReady: !!g[e],
|
|
1857
|
+
onOpen: _
|
|
1858
|
+
}), Y = E(() => p("left", { id: e }), [p, e]);
|
|
1859
|
+
return Be({
|
|
1860
|
+
sidebarRef: T,
|
|
1861
|
+
triggerRef: C,
|
|
1862
|
+
isOpen: x,
|
|
1863
|
+
onClose: Y,
|
|
1864
|
+
transitionMs: u.transitionMs
|
|
1865
|
+
}), /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
|
|
1866
|
+
u.showOverlay && /* @__PURE__ */ I.jsx(
|
|
1867
|
+
Ye,
|
|
1670
1868
|
{
|
|
1671
|
-
isCollapsed: !
|
|
1672
|
-
setCollapsed: () =>
|
|
1673
|
-
closeSidebarOnClick:
|
|
1674
|
-
transitionMs:
|
|
1675
|
-
overlayBackgroundColor:
|
|
1676
|
-
overlayZIndex:
|
|
1869
|
+
isCollapsed: !x && !B,
|
|
1870
|
+
setCollapsed: () => p("left", { id: e }),
|
|
1871
|
+
closeSidebarOnClick: u.closeSidebarOnOverlayClick,
|
|
1872
|
+
transitionMs: u.transitionMs,
|
|
1873
|
+
overlayBackgroundColor: u.overlayBackgroundColor,
|
|
1874
|
+
overlayZIndex: u.overlayZIndex
|
|
1677
1875
|
}
|
|
1678
1876
|
),
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
|
|
1877
|
+
/* @__PURE__ */ I.jsx(
|
|
1878
|
+
Vr,
|
|
1681
1879
|
{
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1880
|
+
id: e,
|
|
1881
|
+
toggleRef: C,
|
|
1882
|
+
options: u,
|
|
1883
|
+
showToggle: u.showToggle,
|
|
1884
|
+
ToggleComponent: n
|
|
1685
1885
|
}
|
|
1686
1886
|
),
|
|
1687
|
-
/* @__PURE__ */
|
|
1887
|
+
/* @__PURE__ */ I.jsx(
|
|
1688
1888
|
"div",
|
|
1689
1889
|
{
|
|
1690
|
-
ref:
|
|
1691
|
-
id:
|
|
1890
|
+
ref: T,
|
|
1891
|
+
id: `swipebar-left-${e}`,
|
|
1692
1892
|
role: "dialog",
|
|
1693
|
-
"aria-modal":
|
|
1694
|
-
"aria-label":
|
|
1695
|
-
inert: !
|
|
1893
|
+
"aria-modal": x,
|
|
1894
|
+
"aria-label": l ?? "Left sidebar",
|
|
1895
|
+
inert: !x,
|
|
1696
1896
|
style: {
|
|
1697
|
-
...
|
|
1698
|
-
...
|
|
1699
|
-
...
|
|
1700
|
-
...
|
|
1701
|
-
zIndex:
|
|
1897
|
+
...bt,
|
|
1898
|
+
..._r,
|
|
1899
|
+
...u.isAbsolute || w ? Dr : {},
|
|
1900
|
+
...t ? {} : { backgroundColor: Ie },
|
|
1901
|
+
zIndex: u.swipeBarZIndex,
|
|
1902
|
+
...c ? { transform: "translateX(0px)", width: `${u.sidebarWidthPx}px` } : {}
|
|
1702
1903
|
},
|
|
1703
|
-
className:
|
|
1704
|
-
children:
|
|
1904
|
+
className: t,
|
|
1905
|
+
children: r
|
|
1705
1906
|
}
|
|
1706
1907
|
)
|
|
1707
1908
|
] });
|
|
1708
1909
|
}
|
|
1709
|
-
function
|
|
1710
|
-
|
|
1711
|
-
|
|
1910
|
+
function Qr({
|
|
1911
|
+
id: e,
|
|
1912
|
+
toggleRef: t,
|
|
1913
|
+
options: r,
|
|
1914
|
+
showToggle: n = !0,
|
|
1915
|
+
ToggleComponent: l
|
|
1916
|
+
}) {
|
|
1917
|
+
const { openSidebar: c, closeSidebar: d, rightSidebars: h } = J(), g = h[e]?.isOpen ?? !1;
|
|
1918
|
+
return n ? (
|
|
1712
1919
|
// 1px wide container
|
|
1713
|
-
/* @__PURE__ */
|
|
1920
|
+
/* @__PURE__ */ I.jsx(
|
|
1714
1921
|
"div",
|
|
1715
1922
|
{
|
|
1716
|
-
ref:
|
|
1923
|
+
ref: t,
|
|
1717
1924
|
style: {
|
|
1718
|
-
...
|
|
1719
|
-
transition: `transform ${
|
|
1925
|
+
...yt,
|
|
1926
|
+
transition: `transform ${r.transitionMs}ms ease, opacity ${r.transitionMs}ms ease`,
|
|
1720
1927
|
right: 0,
|
|
1721
|
-
zIndex:
|
|
1928
|
+
zIndex: r.toggleZIndex
|
|
1722
1929
|
},
|
|
1723
|
-
children: (!
|
|
1930
|
+
children: (!g || g && !r.showOverlay) && /* @__PURE__ */ I.jsx(
|
|
1724
1931
|
"button",
|
|
1725
1932
|
{
|
|
1726
1933
|
type: "button",
|
|
1727
|
-
"aria-expanded":
|
|
1728
|
-
"aria-controls":
|
|
1729
|
-
"aria-label":
|
|
1934
|
+
"aria-expanded": g,
|
|
1935
|
+
"aria-controls": `swipebar-right-${e}`,
|
|
1936
|
+
"aria-label": g ? "Close right sidebar" : "Open right sidebar",
|
|
1730
1937
|
onClick: () => {
|
|
1731
|
-
|
|
1938
|
+
r.disabled || (g ? d("right", { id: e }) : c("right", { id: e }));
|
|
1732
1939
|
},
|
|
1733
|
-
disabled:
|
|
1940
|
+
disabled: r.disabled,
|
|
1734
1941
|
style: {
|
|
1735
|
-
marginRight: `${
|
|
1942
|
+
marginRight: `${r.toggleIconEdgeDistancePx}px`,
|
|
1736
1943
|
// reverse because we are using the same icon for both left and right
|
|
1737
|
-
...
|
|
1944
|
+
...g ? {} : { transform: "rotate(180deg)" }
|
|
1738
1945
|
},
|
|
1739
|
-
children:
|
|
1946
|
+
children: l ?? /* @__PURE__ */ I.jsx(Xe, { size: r.toggleIconSizePx, color: r.toggleIconColor })
|
|
1740
1947
|
}
|
|
1741
1948
|
)
|
|
1742
1949
|
}
|
|
1743
1950
|
)
|
|
1744
1951
|
) : null;
|
|
1745
1952
|
}
|
|
1746
|
-
const
|
|
1953
|
+
const gt = ({
|
|
1747
1954
|
refs: e,
|
|
1748
1955
|
callbacks: t,
|
|
1749
1956
|
currentX: r,
|
|
1750
|
-
preventDefault:
|
|
1751
|
-
lockPane:
|
|
1752
|
-
options:
|
|
1957
|
+
preventDefault: n,
|
|
1958
|
+
lockPane: l,
|
|
1959
|
+
options: c
|
|
1753
1960
|
}) => {
|
|
1754
1961
|
if (!e.draggingRef.current) return;
|
|
1755
|
-
const
|
|
1756
|
-
if (!
|
|
1962
|
+
const d = window.innerWidth, h = r - e.draggingRef.current.startX, g = e.draggingRef.current.startX >= d - c.edgeActivationWidthPx, p = e.draggingRef.current.isActivated;
|
|
1963
|
+
if (!p && Math.abs(h) >= c.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, l()), !p) return;
|
|
1757
1964
|
e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
|
|
1758
|
-
const
|
|
1759
|
-
let
|
|
1760
|
-
if ((
|
|
1965
|
+
const S = t.getIsOpen();
|
|
1966
|
+
let R = !1;
|
|
1967
|
+
if ((S || g) && (R = !0), !R) {
|
|
1761
1968
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1762
1969
|
return;
|
|
1763
1970
|
}
|
|
1764
|
-
|
|
1765
|
-
const
|
|
1766
|
-
if (
|
|
1767
|
-
const
|
|
1971
|
+
n();
|
|
1972
|
+
const m = c.sidebarWidthPx;
|
|
1973
|
+
if (S) {
|
|
1974
|
+
const T = Math.max(
|
|
1768
1975
|
0,
|
|
1769
|
-
Math.min(
|
|
1976
|
+
Math.min(m, h - c.dragActivationDeltaPx)
|
|
1770
1977
|
);
|
|
1771
|
-
t.dragSidebar(
|
|
1978
|
+
t.dragSidebar(T);
|
|
1772
1979
|
} else {
|
|
1773
|
-
const
|
|
1980
|
+
const T = Math.max(
|
|
1774
1981
|
0,
|
|
1775
1982
|
Math.min(
|
|
1776
|
-
|
|
1777
|
-
|
|
1983
|
+
m,
|
|
1984
|
+
m + h + c.dragActivationDeltaPx
|
|
1778
1985
|
)
|
|
1779
1986
|
);
|
|
1780
|
-
t.dragSidebar(
|
|
1987
|
+
t.dragSidebar(T);
|
|
1781
1988
|
}
|
|
1782
|
-
},
|
|
1989
|
+
}, ht = ({ refs: e, callbacks: t, options: r }) => {
|
|
1783
1990
|
if (!e.draggingRef.current) return;
|
|
1784
1991
|
if (!e.draggingRef.current.isActivated) {
|
|
1785
1992
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1786
1993
|
return;
|
|
1787
1994
|
}
|
|
1788
|
-
const
|
|
1995
|
+
const n = e.currentXRef.current ?? e.draggingRef.current.startX, l = e.prevXRef.current ?? e.draggingRef.current.startX, c = e.draggingRef.current.startX, d = t.getIsOpen(), h = window.innerWidth;
|
|
1789
1996
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1790
|
-
const
|
|
1791
|
-
|
|
1997
|
+
const g = n > l, p = n < l, S = c >= h - r.edgeActivationWidthPx;
|
|
1998
|
+
d ? (g ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : S && p ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1792
1999
|
};
|
|
1793
|
-
function
|
|
1794
|
-
const
|
|
1795
|
-
lockedSidebar:
|
|
1796
|
-
setLockedSidebar:
|
|
1797
|
-
|
|
1798
|
-
openSidebar:
|
|
1799
|
-
closeSidebar:
|
|
1800
|
-
dragSidebar:
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
2000
|
+
function Jr(e, t) {
|
|
2001
|
+
const r = he(e.mediaQueryWidth), {
|
|
2002
|
+
lockedSidebar: n,
|
|
2003
|
+
setLockedSidebar: l,
|
|
2004
|
+
rightSidebars: c,
|
|
2005
|
+
openSidebar: d,
|
|
2006
|
+
closeSidebar: h,
|
|
2007
|
+
dragSidebar: g,
|
|
2008
|
+
activeRightDragIdRef: p,
|
|
2009
|
+
rightFocusStackRef: S
|
|
2010
|
+
} = J(), R = c[t]?.isOpen ?? !1, m = L(null), T = L(null), C = L(null);
|
|
2011
|
+
q(() => {
|
|
2012
|
+
if (!r || n && n !== "right" || e.disabled) return;
|
|
2013
|
+
const u = {
|
|
2014
|
+
getIsOpen: () => R,
|
|
2015
|
+
openSidebar: () => d("right", { id: t }),
|
|
2016
|
+
closeSidebar: () => h("right", { id: t }),
|
|
2017
|
+
dragSidebar: (b) => g("right", b, { id: t })
|
|
2018
|
+
}, w = {
|
|
2019
|
+
draggingRef: m,
|
|
2020
|
+
currentXRef: T,
|
|
2021
|
+
prevXRef: C
|
|
2022
|
+
}, x = () => p.current !== null && p.current !== t, _ = () => {
|
|
2023
|
+
const b = S.current;
|
|
2024
|
+
return b.length === 0 ? !0 : b[b.length - 1] === t;
|
|
2025
|
+
}, B = () => {
|
|
2026
|
+
if (x()) {
|
|
2027
|
+
m.current = null;
|
|
2028
|
+
return;
|
|
2029
|
+
}
|
|
2030
|
+
p.current = t, l("right");
|
|
2031
|
+
}, Y = () => {
|
|
2032
|
+
p.current === t && (p.current = null);
|
|
2033
|
+
}, H = () => {
|
|
2034
|
+
Y(), l(null);
|
|
2035
|
+
};
|
|
2036
|
+
function k(b) {
|
|
2037
|
+
if (n && n !== "right" || x() || !_() || ge(b.target) || b.changedTouches.length === 0) return;
|
|
2038
|
+
const M = b.changedTouches[0], P = window.innerWidth, F = u.getIsOpen(), U = M.clientX >= P - e.edgeActivationWidthPx;
|
|
2039
|
+
F && !e.swipeToClose || !F && !e.swipeToOpen || (F || U) && Ee({
|
|
2040
|
+
refs: w,
|
|
2041
|
+
clientX: M.clientX,
|
|
2042
|
+
clientY: M.clientY,
|
|
2043
|
+
touchId: M.identifier,
|
|
1823
2044
|
isMouse: !1
|
|
1824
2045
|
});
|
|
1825
2046
|
}
|
|
1826
|
-
function
|
|
1827
|
-
if (
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
2047
|
+
function W(b) {
|
|
2048
|
+
if (n && n !== "right") return;
|
|
2049
|
+
if (x()) {
|
|
2050
|
+
m.current = null;
|
|
2051
|
+
return;
|
|
2052
|
+
}
|
|
2053
|
+
if (!m.current || m.current.isMouse) return;
|
|
2054
|
+
const M = m.current.activeTouchId, P = _e(b.changedTouches, M);
|
|
2055
|
+
P && gt({
|
|
2056
|
+
refs: w,
|
|
2057
|
+
callbacks: u,
|
|
2058
|
+
currentX: P.clientX,
|
|
2059
|
+
preventDefault: () => b.preventDefault(),
|
|
2060
|
+
lockPane: B,
|
|
1835
2061
|
options: e
|
|
1836
2062
|
});
|
|
1837
2063
|
}
|
|
1838
|
-
function
|
|
1839
|
-
if (
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1842
|
-
refs:
|
|
1843
|
-
callbacks:
|
|
2064
|
+
function X(b) {
|
|
2065
|
+
if (n && n !== "right" || !m.current || m.current.isMouse) return;
|
|
2066
|
+
const M = m.current.activeTouchId;
|
|
2067
|
+
Le(b.changedTouches, M) && (Y(), ht({
|
|
2068
|
+
refs: w,
|
|
2069
|
+
callbacks: u,
|
|
1844
2070
|
options: e
|
|
1845
|
-
});
|
|
2071
|
+
}));
|
|
1846
2072
|
}
|
|
1847
|
-
function
|
|
1848
|
-
|
|
1849
|
-
refs:
|
|
1850
|
-
dragSidebar:
|
|
1851
|
-
onDeactivate:
|
|
1852
|
-
});
|
|
2073
|
+
function V() {
|
|
2074
|
+
n && n !== "right" || !m.current || m.current.isMouse || (Y(), xt({
|
|
2075
|
+
refs: w,
|
|
2076
|
+
dragSidebar: u.dragSidebar,
|
|
2077
|
+
onDeactivate: H
|
|
2078
|
+
}));
|
|
1853
2079
|
}
|
|
1854
|
-
function j(
|
|
1855
|
-
if (
|
|
1856
|
-
const
|
|
1857
|
-
|
|
1858
|
-
refs:
|
|
1859
|
-
clientX:
|
|
1860
|
-
clientY:
|
|
2080
|
+
function j(b) {
|
|
2081
|
+
if (n && n !== "right" || x() || !_() || ge(b.target) || b.button !== 0) return;
|
|
2082
|
+
const M = window.innerWidth, P = u.getIsOpen(), F = b.clientX >= M - e.edgeActivationWidthPx;
|
|
2083
|
+
P && !e.swipeToClose || !P && !e.swipeToOpen || (P || F) && Ee({
|
|
2084
|
+
refs: w,
|
|
2085
|
+
clientX: b.clientX,
|
|
2086
|
+
clientY: b.clientY,
|
|
1861
2087
|
touchId: null,
|
|
1862
2088
|
isMouse: !0
|
|
1863
2089
|
});
|
|
1864
2090
|
}
|
|
1865
|
-
function
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
2091
|
+
function Q(b) {
|
|
2092
|
+
if (!(n && n !== "right")) {
|
|
2093
|
+
if (x()) {
|
|
2094
|
+
m.current = null;
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2097
|
+
!m.current || !m.current.isMouse || gt({
|
|
2098
|
+
refs: w,
|
|
2099
|
+
callbacks: u,
|
|
2100
|
+
currentX: b.clientX,
|
|
2101
|
+
preventDefault: () => b.preventDefault(),
|
|
2102
|
+
lockPane: B,
|
|
2103
|
+
options: e
|
|
2104
|
+
});
|
|
2105
|
+
}
|
|
1874
2106
|
}
|
|
1875
|
-
function
|
|
1876
|
-
|
|
1877
|
-
refs:
|
|
1878
|
-
callbacks:
|
|
2107
|
+
function G() {
|
|
2108
|
+
n && n !== "right" || !m.current || !m.current.isMouse || (Y(), ht({
|
|
2109
|
+
refs: w,
|
|
2110
|
+
callbacks: u,
|
|
1879
2111
|
options: e
|
|
1880
|
-
});
|
|
2112
|
+
}));
|
|
1881
2113
|
}
|
|
1882
|
-
return window.addEventListener("touchstart",
|
|
1883
|
-
window.removeEventListener("touchstart",
|
|
2114
|
+
return window.addEventListener("touchstart", k, { passive: !0 }), window.addEventListener("touchmove", W, { passive: !1 }), window.addEventListener("touchend", X, { passive: !0 }), window.addEventListener("touchcancel", V, { passive: !0 }), window.addEventListener("mousedown", j, { passive: !0 }), window.addEventListener("mousemove", Q, { passive: !1 }), window.addEventListener("mouseup", G, { passive: !0 }), () => {
|
|
2115
|
+
window.removeEventListener("touchstart", k), window.removeEventListener("touchmove", W), window.removeEventListener("touchend", X), window.removeEventListener("touchcancel", V), window.removeEventListener("mousedown", j), window.removeEventListener("mousemove", Q), window.removeEventListener("mouseup", G);
|
|
1884
2116
|
};
|
|
1885
2117
|
}, [
|
|
1886
2118
|
t,
|
|
1887
|
-
c,
|
|
1888
|
-
o,
|
|
1889
|
-
u,
|
|
1890
|
-
f,
|
|
1891
2119
|
r,
|
|
1892
|
-
|
|
2120
|
+
R,
|
|
2121
|
+
d,
|
|
2122
|
+
h,
|
|
2123
|
+
g,
|
|
2124
|
+
n,
|
|
1893
2125
|
l,
|
|
1894
|
-
e
|
|
2126
|
+
e,
|
|
2127
|
+
p,
|
|
2128
|
+
S
|
|
1895
2129
|
]);
|
|
1896
2130
|
}
|
|
1897
|
-
function
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
2131
|
+
function on({
|
|
2132
|
+
id: e = "primary",
|
|
2133
|
+
className: t,
|
|
2134
|
+
children: r,
|
|
2135
|
+
ToggleComponent: n,
|
|
2136
|
+
ariaLabel: l,
|
|
2137
|
+
defaultOpen: c,
|
|
2138
|
+
...d
|
|
1903
2139
|
}) {
|
|
1904
|
-
if (
|
|
2140
|
+
if (r?.type === I.Fragment)
|
|
1905
2141
|
throw new Error("Fragments is not allowed in SwipeBarRight");
|
|
1906
|
-
const {
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
2142
|
+
const {
|
|
2143
|
+
rightSidebars: h,
|
|
2144
|
+
rightSidebarOptionsMap: g,
|
|
2145
|
+
closeSidebar: p,
|
|
2146
|
+
openSidebar: S,
|
|
2147
|
+
registerRightSidebar: R,
|
|
2148
|
+
unregisterRightSidebar: m
|
|
2149
|
+
} = J(), T = L(null), C = L(null);
|
|
2150
|
+
q(() => (R(e, { sidebarRef: T, toggleRef: C }), () => m(e)), [e, R, m]);
|
|
2151
|
+
const u = De("right", d, e), w = he(u.mediaQueryWidth);
|
|
2152
|
+
Jr(u, e);
|
|
2153
|
+
const x = h[e]?.isOpen ?? !1, _ = E(
|
|
2154
|
+
() => S("right", { id: e, skipTransition: !0 }),
|
|
2155
|
+
[S, e]
|
|
2156
|
+
), { forceOverlayVisible: B } = $e({
|
|
2157
|
+
defaultOpen: c,
|
|
2158
|
+
optionsReady: !!g[e],
|
|
2159
|
+
onOpen: _
|
|
2160
|
+
}), Y = E(() => p("right", { id: e }), [p, e]);
|
|
2161
|
+
return Be({
|
|
2162
|
+
sidebarRef: T,
|
|
2163
|
+
triggerRef: C,
|
|
2164
|
+
isOpen: x,
|
|
2165
|
+
onClose: Y,
|
|
2166
|
+
transitionMs: u.transitionMs
|
|
2167
|
+
}), /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
|
|
2168
|
+
u.showOverlay && /* @__PURE__ */ I.jsx(
|
|
2169
|
+
Ye,
|
|
1918
2170
|
{
|
|
1919
|
-
isCollapsed: !
|
|
1920
|
-
setCollapsed: () =>
|
|
1921
|
-
closeSidebarOnClick:
|
|
1922
|
-
transitionMs:
|
|
1923
|
-
overlayBackgroundColor:
|
|
1924
|
-
overlayZIndex:
|
|
2171
|
+
isCollapsed: !x && !B,
|
|
2172
|
+
setCollapsed: () => p("right", { id: e }),
|
|
2173
|
+
closeSidebarOnClick: u.closeSidebarOnOverlayClick,
|
|
2174
|
+
transitionMs: u.transitionMs,
|
|
2175
|
+
overlayBackgroundColor: u.overlayBackgroundColor,
|
|
2176
|
+
overlayZIndex: u.overlayZIndex
|
|
1925
2177
|
}
|
|
1926
2178
|
),
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
|
|
2179
|
+
/* @__PURE__ */ I.jsx(
|
|
2180
|
+
Qr,
|
|
1929
2181
|
{
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
2182
|
+
id: e,
|
|
2183
|
+
toggleRef: C,
|
|
2184
|
+
options: u,
|
|
2185
|
+
showToggle: u.showToggle,
|
|
2186
|
+
ToggleComponent: n
|
|
1933
2187
|
}
|
|
1934
2188
|
),
|
|
1935
|
-
/* @__PURE__ */
|
|
2189
|
+
/* @__PURE__ */ I.jsx(
|
|
1936
2190
|
"div",
|
|
1937
2191
|
{
|
|
1938
|
-
ref:
|
|
1939
|
-
id:
|
|
2192
|
+
ref: T,
|
|
2193
|
+
id: `swipebar-right-${e}`,
|
|
1940
2194
|
role: "dialog",
|
|
1941
|
-
"aria-modal":
|
|
1942
|
-
"aria-label":
|
|
1943
|
-
inert: !
|
|
2195
|
+
"aria-modal": x,
|
|
2196
|
+
"aria-label": l ?? "Right sidebar",
|
|
2197
|
+
inert: !x,
|
|
1944
2198
|
style: {
|
|
1945
|
-
...
|
|
1946
|
-
...
|
|
1947
|
-
...
|
|
1948
|
-
...
|
|
1949
|
-
zIndex:
|
|
2199
|
+
...bt,
|
|
2200
|
+
...Lr,
|
|
2201
|
+
...u.isAbsolute || w ? Yr : {},
|
|
2202
|
+
...t ? {} : { backgroundColor: Ie },
|
|
2203
|
+
zIndex: u.swipeBarZIndex,
|
|
2204
|
+
...c ? { transform: "translateX(0px)", width: `${u.sidebarWidthPx}px` } : {}
|
|
1950
2205
|
},
|
|
1951
|
-
className:
|
|
1952
|
-
children:
|
|
2206
|
+
className: t,
|
|
2207
|
+
children: r
|
|
1953
2208
|
}
|
|
1954
2209
|
)
|
|
1955
2210
|
] });
|
|
1956
2211
|
}
|
|
1957
2212
|
export {
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
2213
|
+
Ye as Overlay,
|
|
2214
|
+
rn as SwipeBarBottom,
|
|
2215
|
+
nn as SwipeBarLeft,
|
|
2216
|
+
tn as SwipeBarProvider,
|
|
2217
|
+
on as SwipeBarRight,
|
|
2218
|
+
Ur as ToggleBottom,
|
|
2219
|
+
Vr as ToggleLeft,
|
|
2220
|
+
Qr as ToggleRight,
|
|
2221
|
+
he as useMediaQuery,
|
|
2222
|
+
J as useSwipeBarContext
|
|
1968
2223
|
};
|