@luciodale/swipe-bar 1.3.2 → 1.3.3

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