@luciodale/swipe-bar 1.3.4 → 1.3.5

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