This commit is contained in:
Rene Haas
2022-08-11 00:37:56 +02:00
parent 865b74aab3
commit 00f53367d4
15 changed files with 1104 additions and 870 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -487,19 +487,19 @@ const OverlayScrollbars = function(t) {
}; };
}; };
const getBoundingClientRect = t => t.getBoundingClientRect(); const getBoundingClientRect = t => t.getBoundingClientRect();
let y; let m;
const supportPassiveEvents = () => { const supportPassiveEvents = () => {
if (isUndefined(y)) { if (isUndefined(m)) {
y = false; m = false;
try { try {
window.addEventListener("test", null, Object.defineProperty({}, "passive", { window.addEventListener("test", null, Object.defineProperty({}, "passive", {
get() { get() {
y = true; m = true;
} }
})); }));
} catch (t) {} } catch (t) {}
} }
return y; return m;
}; };
const splitEventNames = t => t.split(" "); const splitEventNames = t => t.split(" ");
const off = (t, n, o, s) => { const off = (t, n, o, s) => {
@@ -530,7 +530,7 @@ const OverlayScrollbars = function(t) {
}; };
const stopPropagation = t => t.stopPropagation(); const stopPropagation = t => t.stopPropagation();
const preventDefault = t => t.preventDefault(); const preventDefault = t => t.preventDefault();
const m = { const y = {
x: 0, x: 0,
y: 0 y: 0
}; };
@@ -539,7 +539,7 @@ const OverlayScrollbars = function(t) {
return n ? { return n ? {
x: n.left + window.pageYOffset, x: n.left + window.pageYOffset,
y: n.top + window.pageXOffset y: n.top + window.pageXOffset
} : m; } : y;
}; };
const manageListener = (t, n) => { const manageListener = (t, n) => {
each(isArray(n) ? n : [ n ], t); each(isArray(n) ? n : [ n ], t);
@@ -638,13 +638,13 @@ const OverlayScrollbars = function(t) {
})); }));
return o; return o;
}; };
const $ = "os-environment"; const x = "os-environment";
const x = `${$}-flexbox-glue`; const $ = `${x}-flexbox-glue`;
const C = `${x}-max`; const C = `${$}-max`;
const O = "data-overlayscrollbars"; const O = "data-overlayscrollbars";
const E = `${O}-overflow-x`; const T = `${O}-overflow-x`;
const A = `${O}-overflow-y`; const E = `${O}-overflow-y`;
const T = "overflowVisible"; const A = "overflowVisible";
const z = "scrollbarHidden"; const z = "scrollbarHidden";
const I = "updating"; const I = "updating";
const L = "os-padding"; const L = "os-padding";
@@ -777,22 +777,22 @@ const OverlayScrollbars = function(t) {
} }
}))(); }))();
let bt = 0; let bt = 0;
const {round: yt, abs: mt} = Math; const {round: mt, abs: yt} = Math;
const getWindowDPR = () => { const getWindowDPR = () => {
const t = window.screen.deviceXDPI || 0; const t = window.screen.deviceXDPI || 0;
const n = window.screen.logicalXDPI || 1; const n = window.screen.logicalXDPI || 1;
return window.devicePixelRatio || t / n; return window.devicePixelRatio || t / n;
}; };
const diffBiggerThanOne = (t, n) => { const diffBiggerThanOne = (t, n) => {
const o = mt(t); const o = yt(t);
const s = mt(n); const s = yt(n);
return !(o === s || o + 1 === s || o - 1 === s); return !(o === s || o + 1 === s || o - 1 === s);
}; };
const St = "__osScrollbarsHidingPlugin"; const St = "__osScrollbarsHidingPlugin";
const $t = /* @__PURE__ */ (() => ({ const xt = /* @__PURE__ */ (() => ({
[St]: { [St]: {
A: t => { T: t => {
const {T: n, I: o, L: s} = t; const {A: n, I: o, L: s} = t;
const e = !s && !n && (o.x || o.y); const e = !s && !n && (o.x || o.y);
const c = e ? document.createElement("style") : false; const c = e ? document.createElement("style") : false;
if (c) { if (c) {
@@ -887,12 +887,12 @@ const OverlayScrollbars = function(t) {
return; return;
} }
const l = { const l = {
w: mt(r.w), w: yt(r.w),
h: mt(r.h) h: yt(r.h)
}; };
const i = { const i = {
w: mt(yt(c.w / (t.w / 100))), w: yt(mt(c.w / (t.w / 100))),
h: mt(yt(c.h / (t.h / 100))) h: yt(mt(c.h / (t.h / 100)))
}; };
const a = getWindowDPR(); const a = getWindowDPR();
const u = l.w > 2 && l.h > 2; const u = l.w > 2 && l.h > 2;
@@ -912,7 +912,7 @@ const OverlayScrollbars = function(t) {
} }
} }
}))(); }))();
let xt; let $t;
const getNativeScrollbarSize = (t, n, o, s) => { const getNativeScrollbarSize = (t, n, o, s) => {
appendChildren(t, n); appendChildren(t, n);
const e = clientSize(n); const e = clientSize(n);
@@ -951,7 +951,7 @@ const OverlayScrollbars = function(t) {
}; };
}; };
const getFlexboxGlue = (t, n) => { const getFlexboxGlue = (t, n) => {
const o = addClass(t, x); const o = addClass(t, $);
const s = getBoundingClientRect(t); const s = getBoundingClientRect(t);
const e = getBoundingClientRect(n); const e = getBoundingClientRect(n);
const c = equalBCRWH(e, s, true); const c = equalBCRWH(e, s, true);
@@ -965,7 +965,7 @@ const OverlayScrollbars = function(t) {
}; };
const createEnvironment = () => { const createEnvironment = () => {
const {body: t} = document; const {body: t} = document;
const n = createDOM(`<div class="${$}"><div></div></div>`); const n = createDOM(`<div class="${x}"><div></div></div>`);
const o = n[0]; const o = n[0];
const s = o.firstChild; const s = o.firstChild;
const [e, , c] = createEventListenerHub(); const [e, , c] = createEventListenerHub();
@@ -998,7 +998,7 @@ const OverlayScrollbars = function(t) {
const _ = { const _ = {
k: i, k: i,
I: u, I: u,
T: a, A: a,
L: "-1" === style(o, "zIndex"), L: "-1" === style(o, "zIndex"),
B: getRtlScrollBehavior(o, s), B: getRtlScrollBehavior(o, s),
V: getFlexboxGlue(o, s), V: getFlexboxGlue(o, s),
@@ -1027,10 +1027,10 @@ const OverlayScrollbars = function(t) {
return _; return _;
}; };
const getEnvironment = () => { const getEnvironment = () => {
if (!xt) { if (!$t) {
xt = createEnvironment(); $t = createEnvironment();
} }
return xt; return $t;
}; };
const resolveInitialization = (t, n) => isFunction(t) ? t.apply(0, n) : t; const resolveInitialization = (t, n) => isFunction(t) ? t.apply(0, n) : t;
const staticInitializationElement = (t, n, o, s) => { const staticInitializationElement = (t, n, o, s) => {
@@ -1046,7 +1046,7 @@ const OverlayScrollbars = function(t) {
const cancelInitialization = (t, n) => { const cancelInitialization = (t, n) => {
const {nativeScrollbarsOverlaid: o, body: s} = t || {}; const {nativeScrollbarsOverlaid: o, body: s} = t || {};
const {U: e} = n; const {U: e} = n;
const {Y: c, I: r, T: l} = getEnvironment(); const {Y: c, I: r, A: l} = getEnvironment();
const {nativeScrollbarsOverlaid: i, body: a} = c().cancel; const {nativeScrollbarsOverlaid: i, body: a} = c().cancel;
const u = null != o ? o : i; const u = null != o ? o : i;
const d = isUndefined(s) ? a : s; const d = isUndefined(s) ? a : s;
@@ -1071,7 +1071,7 @@ const OverlayScrollbars = function(t) {
} ]; } ];
}; };
const Ot = "tabindex"; const Ot = "tabindex";
const Et = createDiv.bind(0, ""); const Tt = createDiv.bind(0, "");
const unwrap = t => { const unwrap = t => {
appendChildren(parent(t), contents(t)); appendChildren(parent(t), contents(t));
removeElements(t); removeElements(t);
@@ -1082,9 +1082,9 @@ const OverlayScrollbars = function(t) {
}; };
const createStructureSetupElements = t => { const createStructureSetupElements = t => {
const n = getEnvironment(); const n = getEnvironment();
const {Y: o, T: s} = n; const {Y: o, A: s} = n;
const e = getPlugins()[St]; const e = getPlugins()[St];
const c = e && e.A; const c = e && e.T;
const {elements: r} = o(); const {elements: r} = o();
const {host: l, viewport: i, padding: a, content: u} = r; const {host: l, viewport: i, padding: a, content: u} = r;
const d = isHTMLElement(t); const d = isHTMLElement(t);
@@ -1093,33 +1093,33 @@ const OverlayScrollbars = function(t) {
const {host: h, padding: g, viewport: v, content: w} = _ || {}; const {host: h, padding: g, viewport: v, content: w} = _ || {};
const p = d ? t : f.target; const p = d ? t : f.target;
const b = is(p, "textarea"); const b = is(p, "textarea");
const y = p.ownerDocument; const m = p.ownerDocument;
const m = p === y.body; const y = p === m.body;
const S = y.defaultView; const S = m.defaultView;
const $ = staticInitializationElement.bind(0, [ p ]); const x = staticInitializationElement.bind(0, [ p ]);
const x = dynamicInitializationElement.bind(0, [ p ]); const $ = dynamicInitializationElement.bind(0, [ p ]);
const C = $(Et, i, v); const C = x(Tt, i, v);
const T = C === p; const A = C === p;
const z = T && m; const z = A && y;
const I = y.activeElement; const I = m.activeElement;
const M = !T && S.top === S && I === p; const M = !A && S.top === S && I === p;
const R = { const R = {
W: p, W: p,
J: b ? $(Et, l, h) : p, J: b ? x(Tt, l, h) : p,
K: C, K: C,
Z: !T && x(Et, a, g), Z: !A && $(Tt, a, g),
tt: !T && x(Et, u, w), tt: !A && $(Tt, u, w),
nt: !T && !s && c && c(n), nt: !A && !s && c && c(n),
ot: z ? y.documentElement : C, ot: z ? m.documentElement : C,
st: z ? y : C, st: z ? m : C,
et: S, et: S,
ct: y, ct: m,
rt: b, rt: b,
U: m, U: y,
lt: d, lt: d,
it: T, it: A,
ut: (t, n) => T ? hasAttrClass(C, O, n) : hasClass(C, t), ut: (t, n) => A ? hasAttrClass(C, O, n) : hasClass(C, t),
dt: (t, n, o) => T ? attrClass(C, O, n, o) : (o ? addClass : removeClass)(C, t) dt: (t, n, o) => A ? attrClass(C, O, n, o) : (o ? addClass : removeClass)(C, t)
}; };
const k = keys(R).reduce(((t, n) => { const k = keys(R).reduce(((t, n) => {
const o = R[n]; const o = R[n];
@@ -1132,11 +1132,11 @@ const OverlayScrollbars = function(t) {
let X = b ? B : contents([ q, Y, j, V, B ].find((t => false === elementIsGenerated(t)))); let X = b ? B : contents([ q, Y, j, V, B ].find((t => false === elementIsGenerated(t))));
const U = q || Y; const U = q || Y;
const appendElements = () => { const appendElements = () => {
const t = addDataAttrHost(V, T ? "viewport" : "host"); const t = addDataAttrHost(V, A ? "viewport" : "host");
const n = addClass(j, L); const n = addClass(j, L);
const o = addClass(Y, !T && H); const o = addClass(Y, !A && H);
const e = addClass(q, P); const e = addClass(q, P);
const c = m ? addClass(parent(p), D) : noop; const c = y ? addClass(parent(p), D) : noop;
if (N) { if (N) {
insertAfter(B, V); insertAfter(B, V);
push(G, (() => { push(G, (() => {
@@ -1146,13 +1146,13 @@ const OverlayScrollbars = function(t) {
} }
appendChildren(U, X); appendChildren(U, X);
appendChildren(V, j); appendChildren(V, j);
appendChildren(j || V, !T && Y); appendChildren(j || V, !A && Y);
appendChildren(Y, q); appendChildren(Y, q);
push(G, (() => { push(G, (() => {
c(); c();
t(); t();
removeAttr(Y, T);
removeAttr(Y, E); removeAttr(Y, E);
removeAttr(Y, A);
if (elementIsGenerated(q)) { if (elementIsGenerated(q)) {
unwrap(q); unwrap(q);
} }
@@ -1166,7 +1166,7 @@ const OverlayScrollbars = function(t) {
o(); o();
e(); e();
})); }));
if (s && !T) { if (s && !A) {
push(G, removeClass.bind(0, Y, D)); push(G, removeClass.bind(0, Y, D));
} }
if (F) { if (F) {
@@ -1177,7 +1177,7 @@ const OverlayScrollbars = function(t) {
const t = attr(Y, Ot); const t = attr(Y, Ot);
attr(Y, Ot, "-1"); attr(Y, Ot, "-1");
Y.focus(); Y.focus();
const n = on(y, "pointerdown keydown", (() => { const n = on(m, "pointerdown keydown", (() => {
t ? attr(Y, Ot, t) : removeAttr(Y, Ot); t ? attr(Y, Ot, t) : removeAttr(Y, Ot);
n(); n();
})); }));
@@ -1216,16 +1216,16 @@ const OverlayScrollbars = function(t) {
}, topRightBottomLeft.bind(0, e, "padding", "")); }, topRightBottomLeft.bind(0, e, "padding", ""));
return (t, n, e) => { return (t, n, e) => {
let [u, d] = a(e); let [u, d] = a(e);
const {T: f, V: _} = getEnvironment(); const {A: f, V: _} = getEnvironment();
const {vt: h} = o(); const {vt: h} = o();
const {ht: g, gt: v, wt: w} = t; const {ht: g, gt: v, wt: w} = t;
const [p, b] = n("paddingAbsolute"); const [p, b] = n("paddingAbsolute");
const y = !_ && v; const m = !_ && v;
if (g || d || y) { if (g || d || m) {
[u, d] = i(e); [u, d] = i(e);
} }
const m = !l && (b || w || d); const y = !l && (b || w || d);
if (m) { if (y) {
const t = !p || !c && !f; const t = !p || !c && !f;
const n = u.r + u.l; const n = u.r + u.l;
const o = u.t + u.b; const o = u.t + u.b;
@@ -1253,12 +1253,12 @@ const OverlayScrollbars = function(t) {
}); });
} }
return { return {
yt: m yt: y
}; };
}; };
}; };
const {max: At} = Math; const {max: Et} = Math;
const Tt = At.bind(0, 0); const At = Et.bind(0, 0);
const zt = "visible"; const zt = "visible";
const It = "hidden"; const It = "hidden";
const Lt = 42; const Lt = 42;
@@ -1279,8 +1279,8 @@ const OverlayScrollbars = function(t) {
const getOverflowAmount = (t, n) => { const getOverflowAmount = (t, n) => {
const o = window.devicePixelRatio % 1 !== 0 ? 1 : 0; const o = window.devicePixelRatio % 1 !== 0 ? 1 : 0;
const s = { const s = {
w: Tt(t.w - n.w), w: At(t.w - n.w),
h: Tt(t.h - n.h) h: At(t.h - n.h)
}; };
return { return {
w: s.w > o ? s.w : 0, w: s.w > o ? s.w : 0,
@@ -1292,13 +1292,13 @@ const OverlayScrollbars = function(t) {
const createOverflowUpdateSegment = (t, n) => { const createOverflowUpdateSegment = (t, n) => {
const [o, s] = n; const [o, s] = n;
const {J: e, Z: c, K: r, nt: l, it: i, dt: a, U: u, et: d} = t; const {J: e, Z: c, K: r, nt: l, it: i, dt: a, U: u, et: d} = t;
const {k: f, V: _, T: h, I: g} = getEnvironment(); const {k: f, V: _, A: h, I: g} = getEnvironment();
const v = getPlugins()[St]; const v = getPlugins()[St];
const w = !i && !h && (g.x || g.y); const w = !i && !h && (g.x || g.y);
const p = u && i; const p = u && i;
const [b, y] = createCache(Ht, fractionalSize.bind(0, r)); const [b, m] = createCache(Ht, fractionalSize.bind(0, r));
const [m, S] = createCache(Ht, scrollSize.bind(0, r)); const [y, S] = createCache(Ht, scrollSize.bind(0, r));
const [$, x] = createCache(Ht); const [x, $] = createCache(Ht);
const [C, I] = createCache(Ht); const [C, I] = createCache(Ht);
const [L] = createCache(Mt); const [L] = createCache(Mt);
const fixFlexboxGlue = (t, n) => { const fixFlexboxGlue = (t, n) => {
@@ -1332,7 +1332,7 @@ const OverlayScrollbars = function(t) {
const [s, e, c, l] = getStatePerAxis("overflowX", g.x, f.x); const [s, e, c, l] = getStatePerAxis("overflowX", g.x, f.x);
const [i, a, u, d] = getStatePerAxis("overflowY", g.y, f.y); const [i, a, u, d] = getStatePerAxis("overflowY", g.y, f.y);
return { return {
$t: { xt: {
x: s, x: s,
y: i y: i
}, },
@@ -1383,7 +1383,7 @@ const OverlayScrollbars = function(t) {
}; };
const [H, M] = v ? v.H(w, _, r, l, o, getViewportOverflowState, hideNativeScrollbars) : [ () => w, () => [ noop ] ]; const [H, M] = v ? v.H(w, _, r, l, o, getViewportOverflowState, hideNativeScrollbars) : [ () => w, () => [ noop ] ];
return (t, n, l) => { return (t, n, l) => {
const {ht: u, xt: f, gt: v, yt: w, _t: P, wt: k} = t; const {ht: u, $t: f, gt: v, yt: w, _t: P, wt: k} = t;
const {ft: B, vt: V} = o(); const {ft: B, vt: V} = o();
const [j, Y] = n("showNativeOverlaidScrollbars"); const [j, Y] = n("showNativeOverlaidScrollbars");
const [q, F] = n("overflow"); const [q, F] = n("overflow");
@@ -1392,9 +1392,9 @@ const OverlayScrollbars = function(t) {
const X = overflowIsVisible(q.x); const X = overflowIsVisible(q.x);
const U = overflowIsVisible(q.y); const U = overflowIsVisible(q.y);
const W = X || U; const W = X || U;
let J = y(l); let J = m(l);
let K = S(l); let K = S(l);
let Z = x(l); let Z = $(l);
let Q = I(l); let Q = I(l);
let tt; let tt;
if (Y && h) { if (Y && h) {
@@ -1406,11 +1406,11 @@ const OverlayScrollbars = function(t) {
} }
if (u || w || v || k || Y) { if (u || w || v || k || Y) {
if (W) { if (W) {
a(R, T, false); a(R, A, false);
} }
const [t, n] = M(G, V, tt); const [t, n] = M(G, V, tt);
const [o, s] = J = b(l); const [o, s] = J = b(l);
const [e, c] = K = m(l); const [e, c] = K = y(l);
const i = clientSize(r); const i = clientSize(r);
let u = e; let u = e;
let f = i; let f = i;
@@ -1420,15 +1420,15 @@ const OverlayScrollbars = function(t) {
u = scrollSize(r); u = scrollSize(r);
} }
const _ = { const _ = {
w: Tt(At(e.w, u.w) + o.w), w: At(Et(e.w, u.w) + o.w),
h: Tt(At(e.h, u.h) + o.h) h: At(Et(e.h, u.h) + o.h)
}; };
const h = { const h = {
w: Tt(p ? d.innerWidth : f.w + Tt(i.w - e.w) + o.w), w: At(p ? d.innerWidth : f.w + At(i.w - e.w) + o.w),
h: Tt(p ? d.innerHeight : f.h + Tt(i.h - e.h) + o.h) h: At(p ? d.innerHeight : f.h + At(i.h - e.h) + o.h)
}; };
Q = C(h); Q = C(h);
Z = $(getOverflowAmount(_, h), l); Z = x(getOverflowAmount(_, h), l);
} }
const [nt, ot] = Q; const [nt, ot] = Q;
const [st, et] = Z; const [st, et] = Z;
@@ -1457,18 +1457,18 @@ const OverlayScrollbars = function(t) {
fixFlexboxGlue(n, B); fixFlexboxGlue(n, B);
} }
if (i) { if (i) {
attr(e, E, t.overflowX); attr(e, T, t.overflowX);
attr(e, A, t.overflowY); attr(e, E, t.overflowY);
} else { } else {
style(r, t); style(r, t);
} }
} }
attrClass(e, O, T, ut); attrClass(e, O, A, ut);
conditionalClass(c, R, ut); conditionalClass(c, R, ut);
!i && conditionalClass(r, R, W); !i && conditionalClass(r, R, W);
const [dt, ft] = L(getViewportOverflowState(G).$t); const [dt, ft] = L(getViewportOverflowState(G).xt);
s({ s({
$t: dt, xt: dt,
Ct: { Ct: {
x: nt.w, x: nt.w,
y: nt.h y: nt.h
@@ -1477,11 +1477,11 @@ const OverlayScrollbars = function(t) {
x: st.w, x: st.w,
y: st.h y: st.h
}, },
Et: at Tt: at
}); });
return { return {
At: ft, Et: ft,
Tt: ot, At: ot,
zt: et zt: et
}; };
}; };
@@ -1499,7 +1499,7 @@ const OverlayScrollbars = function(t) {
}; };
const createStructureSetupUpdate = (t, n) => { const createStructureSetupUpdate = (t, n) => {
const {W: o, K: s, dt: e, it: c} = t; const {W: o, K: s, dt: e, it: c} = t;
const {T: r, I: l, V: i} = getEnvironment(); const {A: r, I: l, V: i} = getEnvironment();
const a = !r && (l.x || l.y); const a = !r && (l.x || l.y);
const u = [ createTrinsicUpdateSegment(t, n), createPaddingUpdateSegment(t, n), createOverflowUpdateSegment(t, n) ]; const u = [ createTrinsicUpdateSegment(t, n), createPaddingUpdateSegment(t, n), createOverflowUpdateSegment(t, n) ];
return (t, n, r) => { return (t, n, r) => {
@@ -1508,10 +1508,10 @@ const OverlayScrollbars = function(t) {
yt: false, yt: false,
wt: false, wt: false,
_t: false, _t: false,
Tt: false,
zt: false,
At: false, At: false,
xt: false, zt: false,
Et: false,
$t: false,
gt: false gt: false
}, n), {}, r); }, n), {}, r);
const d = a || !i; const d = a || !i;
@@ -1749,23 +1749,23 @@ const OverlayScrollbars = function(t) {
const {attributeName: e, target: c, type: u, oldValue: d, addedNodes: h} = o; const {attributeName: e, target: c, type: u, oldValue: d, addedNodes: h} = o;
const p = "attributes" === u; const p = "attributes" === u;
const b = "childList" === u; const b = "childList" === u;
const y = t === c; const m = t === c;
const m = p && isString(e) ? attr(c, e) : 0; const y = p && isString(e) ? attr(c, e) : 0;
const S = 0 !== m && d !== m; const S = 0 !== y && d !== y;
const $ = indexOf(v, e) > -1 && S; const x = indexOf(v, e) > -1 && S;
if (n && !y) { if (n && !m) {
const n = !p; const n = !p;
const a = p && $; const a = p && x;
const u = a && i && is(c, i); const u = a && i && is(c, i);
const _ = u ? !r(c, e, d, m) : n || a; const _ = u ? !r(c, e, d, y) : n || a;
const v = _ && !l(o, !!u, t, s); const v = _ && !l(o, !!u, t, s);
push(f, h); push(f, h);
g = g || v; g = g || v;
w = w || b; w = w || b;
} }
if (!n && y && S && !r(c, e, d, m)) { if (!n && m && S && !r(c, e, d, y)) {
push(a, e); push(a, e);
_ = _ || $; _ = _ || x;
} }
})); }));
if (w && !isEmptyArray(f)) { if (w && !isEmptyArray(f)) {
@@ -1826,17 +1826,17 @@ const OverlayScrollbars = function(t) {
h: 0 h: 0
} }
}, (() => { }, (() => {
const t = _(R, T); const t = _(R, A);
const n = _(M, ""); const n = _(M, "");
const o = n && scrollLeft(i); const o = n && scrollLeft(i);
const s = n && scrollTop(i); const s = n && scrollTop(i);
h(R, T); h(R, A);
h(M, ""); h(M, "");
h("", I, true); h("", I, true);
const e = scrollSize(a); const e = scrollSize(a);
const c = scrollSize(i); const c = scrollSize(i);
const r = fractionalSize(i); const r = fractionalSize(i);
h(R, T, t); h(R, A, t);
h(M, "", n); h(M, "", n);
h("", I); h("", I);
scrollLeft(i, o); scrollLeft(i, o);
@@ -1910,7 +1910,7 @@ const OverlayScrollbars = function(t) {
}; };
const onHostMutation = (t, n, o) => { const onHostMutation = (t, n, o) => {
const s = { const s = {
xt: n $t: n
}; };
if (n) { if (n) {
!o && p(s); !o && p(s);
@@ -1919,12 +1919,12 @@ const OverlayScrollbars = function(t) {
} }
return s; return s;
}; };
const [b, y, m] = a || !g ? createTrinsicObserver(l, onTrinsicChanged) : [ noop, noop, noop ]; const [b, m, y] = a || !g ? createTrinsicObserver(l, onTrinsicChanged) : [ noop, noop, noop ];
const [S, $] = !f ? createSizeObserver(l, onSizeChanged, { const [S, x] = !f ? createSizeObserver(l, onSizeChanged, {
Lt: true, Lt: true,
It: true It: true
}) : [ noop, noop ]; }) : [ noop, noop ];
const [x, C] = createDOMObserver(l, false, onHostMutation, { const [$, C] = createDOMObserver(l, false, onHostMutation, {
Pt: Vt, Pt: Vt,
Mt: Vt.concat(kt) Mt: Vt.concat(kt)
}); });
@@ -1938,14 +1938,14 @@ const OverlayScrollbars = function(t) {
S(); S();
c && c[0](); c && c[0]();
O && O.disconnect(); O && O.disconnect();
x();
}, () => {
$(); $();
y(); }, () => {
x();
m();
}, () => { }, () => {
const t = {}; const t = {};
const n = C(); const n = C();
const o = m(); const o = y();
const s = c && c[1](); const s = c && c[1]();
if (n) { if (n) {
assignDeep(t, onHostMutation.apply(0, push(n, true))); assignDeep(t, onHostMutation.apply(0, push(n, true)));
@@ -2021,11 +2021,11 @@ const OverlayScrollbars = function(t) {
}, },
Ct: jt, Ct: jt,
Ot: jt, Ot: jt,
$t: { xt: {
x: "hidden", x: "hidden",
y: "hidden" y: "hidden"
}, },
Et: { Tt: {
x: false, x: false,
y: false y: false
}, },
@@ -2072,11 +2072,24 @@ const OverlayScrollbars = function(t) {
u(); u();
} ]; } ];
}; };
const {round: qt} = Math; const {round: qt, max: Ft, sign: Gt} = Math;
const getClientOffset = t => ({ const animationCurrentTime = () => performance.now();
x: t.clientX, const animateNumber = (t, n, o, s) => {
y: t.clientY let e = 0;
}); const c = animationCurrentTime();
const frame = () => {
const r = animationCurrentTime();
const l = r - c;
const i = l >= o;
const a = 1 - (Ft(0, c + o - r) / o || 0);
const u = (n - t) * a + t;
const d = i || 1 === a;
s(u, d);
e = d ? 0 : _(frame);
};
frame();
return () => f(e);
};
const getScale = t => { const getScale = t => {
const {width: n, height: o} = getBoundingClientRect(t); const {width: n, height: o} = getBoundingClientRect(t);
const {w: s, h: e} = offsetSize(t); const {w: s, h: e} = offsetSize(t);
@@ -2089,7 +2102,7 @@ const OverlayScrollbars = function(t) {
const s = n.scrollbars; const s = n.scrollbars;
const {button: e, isPrimary: c, pointerType: r} = t; const {button: e, isPrimary: c, pointerType: r} = t;
const {pointers: l} = s; const {pointers: l} = s;
return 0 === e && c && s[o] && (l || []).includes(r); return 0 === e && c && s[o ? "dragScroll" : "clickScroll"] && (l || []).includes(r);
}; };
const createRootClickStopPropagationEvents = (t, n) => on(t, "mousedown", on.bind(0, n, "click", stopPropagation, { const createRootClickStopPropagationEvents = (t, n) => on(t, "mousedown", on.bind(0, n, "click", stopPropagation, {
C: true, C: true,
@@ -2097,36 +2110,79 @@ const OverlayScrollbars = function(t) {
}), { }), {
$: true $: true
}); });
const createDragScrollingEvents = (t, n, o, s, e, c) => { const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
const {B: r} = getEnvironment(); const {B: r} = getEnvironment();
const {qt: l, Ft: i, Gt: a} = o; const {qt: l, Ft: i, Gt: a} = o;
const u = `scroll${c ? "Left" : "Top"}`; const u = `scroll${c ? "Left" : "Top"}`;
const d = `${c ? "x" : "y"}`; const d = c ? "width" : "height";
const f = `${c ? "w" : "h"}`; const f = c ? "w" : "h";
const createOnPointerMoveHandler = (t, n, o) => _ => { const _ = c ? "x" : "y";
const {Ot: h} = e(); const getHandleOffset = (t, n) => t[_] - n[_];
const g = (getClientOffset(_)[d] - n) * o; const createRelativeHandleMove = (t, n) => o => {
const v = offsetSize(i)[f] - offsetSize(l)[f]; const {Ot: d} = e();
const w = g / v; const h = offsetSize(i)[f] - offsetSize(l)[f];
const p = w * h[d]; const g = n * o / h;
const b = directionIsRTL(a); const v = g * d[_];
const y = b && c ? r.n || r.i ? 1 : -1 : 1; const w = directionIsRTL(a);
s[u] = t + p * y; const p = w && c ? r.n || r.i ? 1 : -1 : 1;
s[u] = t + v * p;
}; };
return on(l, "pointerdown", (o => { return on(i, "pointerdown", (o => {
if (continuePointerDown(o, t, "dragScroll")) { const e = closest(o.target, `.${J}`) === l;
const t = on(n, "selectstart", (t => preventDefault(t)), { if (continuePointerDown(o, t, e)) {
const t = !e && o.shiftKey;
const c = createRelativeHandleMove(s[u] || 0, 1 / getScale(s)[_]);
const r = o[_];
const a = getBoundingClientRect(l);
const f = getBoundingClientRect(i);
const h = a[d];
const g = getHandleOffset(a, f) + h / 2;
const v = r - f[_];
const w = e ? 0 : v - g;
const p = [ on(n, "selectstart", (t => preventDefault(t)), {
S: false S: false
}); }), on(i, "pointermove", (n => {
const e = on(l, "pointermove", createOnPointerMoveHandler(s[u] || 0, getClientOffset(o)[d], 1 / getScale(s)[d])); const o = n[_] - r;
on(l, "pointerup", (n => { if (e || t) {
t(); c(w + o);
e(); }
l.releasePointerCapture(n.pointerId); })) ];
if (t) {
c(w);
} else if (!e) {
let t = 0;
let n = noop;
const animateClickScroll = o => {
n = animateNumber(o, o + h * Gt(w), 133, ((o, s) => {
c(o);
const e = getHandleOffset(getBoundingClientRect(l), f);
const r = e + h;
const i = v >= e && v <= r;
if (s && !i) {
if (t) {
animateClickScroll(o);
} else {
const t = setTimeout((() => {
animateClickScroll(o);
}), 222);
n = () => {
clearTimeout(t);
};
}
t++;
}
}));
};
animateClickScroll(0);
push(p, (() => n()));
}
on(i, "pointerup", (t => {
runEachAndClear(p);
i.releasePointerCapture(t.pointerId);
}), { }), {
C: true C: true
}); });
l.setPointerCapture(o.pointerId); i.setPointerCapture(o.pointerId);
} }
})); }));
}; };
@@ -2158,33 +2214,33 @@ const OverlayScrollbars = function(t) {
}), { }), {
S: false, S: false,
$: true $: true
}), createRootClickStopPropagationEvents(i, e), createDragScrollingEvents(t, e, o, r, n, l), u ]); }), createRootClickStopPropagationEvents(i, e), createInteractiveScrollEvents(t, e, o, r, n, l), u ]);
}; };
const {min: Ft, max: Gt, abs: Nt, round: Xt} = Math; const {min: Nt, max: Xt, abs: Ut, round: Wt} = Math;
const getScrollbarHandleLengthRatio = (t, n, o, s) => { const getScrollbarHandleLengthRatio = (t, n, o, s) => {
if (s) { if (s) {
const t = o ? "x" : "y"; const t = o ? "x" : "y";
const {Ot: n, Ct: e} = s; const {Ot: n, Ct: e} = s;
const c = e[t]; const c = e[t];
const r = n[t]; const r = n[t];
return Gt(0, Ft(1, c / (c + r))); return Xt(0, Nt(1, c / (c + r)));
} }
const e = o ? "w" : "h"; const e = o ? "w" : "h";
const c = offsetSize(t)[e]; const c = offsetSize(t)[e];
const r = offsetSize(n)[e]; const r = offsetSize(n)[e];
return Gt(0, Ft(1, c / r)); return Xt(0, Nt(1, c / r));
}; };
const getScrollbarHandleOffsetRatio = (t, n, o, s, e, c) => { const getScrollbarHandleOffsetRatio = (t, n, o, s, e, c) => {
const {B: r} = getEnvironment(); const {B: r} = getEnvironment();
const l = c ? "x" : "y"; const l = c ? "x" : "y";
const i = c ? "Left" : "Top"; const i = c ? "Left" : "Top";
const {Ot: a} = s; const {Ot: a} = s;
const u = Xt(a[l]); const u = Wt(a[l]);
const d = Nt(o[`scroll${i}`]); const d = Ut(o[`scroll${i}`]);
const f = c && e; const f = c && e;
const _ = r.i ? d : u - d; const _ = r.i ? d : u - d;
const h = f ? _ : d; const h = f ? _ : d;
const g = Ft(1, h / u); const g = Nt(1, h / u);
const v = getScrollbarHandleLengthRatio(t, n, c); const v = getScrollbarHandleLengthRatio(t, n, c);
return 1 / v * (1 - v) * g; return 1 / v * (1 - v) * g;
}; };
@@ -2264,7 +2320,7 @@ const OverlayScrollbars = function(t) {
return u; return u;
}; };
const b = generateScrollbarDOM.bind(0, true); const b = generateScrollbarDOM.bind(0, true);
const y = generateScrollbarDOM.bind(0, false); const m = generateScrollbarDOM.bind(0, false);
const appendElements = () => { const appendElements = () => {
appendChildren(g, w[0].Gt); appendChildren(g, w[0].Gt);
appendChildren(g, p[0].Gt); appendChildren(g, p[0].Gt);
@@ -2273,7 +2329,7 @@ const OverlayScrollbars = function(t) {
}), 300); }), 300);
}; };
b(); b();
y(); m();
return [ { return [ {
Nt: refreshScrollbarsHandleLength, Nt: refreshScrollbarsHandleLength,
Xt: refreshScrollbarsHandleOffset, Xt: refreshScrollbarsHandleOffset,
@@ -2285,7 +2341,7 @@ const OverlayScrollbars = function(t) {
}, },
Qt: { Qt: {
Jt: p, Jt: p,
Kt: y, Kt: m,
Zt: scrollbarsHandleStyle.bind(0, p) Zt: scrollbarsHandleStyle.bind(0, p)
} }
}, appendElements, runEachAndClear.bind(0, v) ]; }, appendElements, runEachAndClear.bind(0, v) ];
@@ -2303,21 +2359,21 @@ const OverlayScrollbars = function(t) {
const [_, h] = selfCancelTimeout(); const [_, h] = selfCancelTimeout();
const [g, v] = selfCancelTimeout(100); const [g, v] = selfCancelTimeout(100);
const [w, p] = selfCancelTimeout(100); const [w, p] = selfCancelTimeout(100);
const [b, y] = selfCancelTimeout((() => i)); const [b, m] = selfCancelTimeout((() => i));
const [m, S, $] = createScrollbarsSetupElements(t, o.Yt, createScrollbarsSetupEvents(n, o)); const [y, S, x] = createScrollbarsSetupElements(t, o.Yt, createScrollbarsSetupEvents(n, o));
const {J: x, K: C, ot: O, st: E, it: A, U: T} = o.Yt; const {J: $, K: C, ot: O, st: T, it: E, U: A} = o.Yt;
const {Wt: z, Qt: I, Ut: L, Nt: H, Xt: M} = m; const {Wt: z, Qt: I, Ut: L, Nt: H, Xt: M} = y;
const {Zt: P} = z; const {Zt: P} = z;
const {Zt: D} = I; const {Zt: D} = I;
const styleScrollbarPosition = t => { const styleScrollbarPosition = t => {
const {Gt: n} = t; const {Gt: n} = t;
const o = A && !T && parent(n) === C && n; const o = E && !A && parent(n) === C && n;
return [ o, { return [ o, {
transform: o ? `translate(${scrollLeft(O)}px, ${scrollTop(O)}px)` : "" transform: o ? `translate(${scrollLeft(O)}px, ${scrollTop(O)}px)` : ""
} ]; } ];
}; };
const manageScrollbarsAutoHide = (t, n) => { const manageScrollbarsAutoHide = (t, n) => {
y(); m();
if (t) { if (t) {
L(ot); L(ot);
} else { } else {
@@ -2333,12 +2389,12 @@ const OverlayScrollbars = function(t) {
r = e; r = e;
r && manageScrollbarsAutoHide(true); r && manageScrollbarsAutoHide(true);
}; };
const R = [ v, y, p, h, f, $, on(x, "pointerover", onHostMouseEnter, { const R = [ v, m, p, h, f, x, on($, "pointerover", onHostMouseEnter, {
C: true C: true
}), on(x, "pointerenter", onHostMouseEnter), on(x, "pointerleave", (() => { }), on($, "pointerenter", onHostMouseEnter), on($, "pointerleave", (() => {
r = false; r = false;
e && manageScrollbarsAutoHide(false); e && manageScrollbarsAutoHide(false);
})), on(x, "pointermove", (() => { })), on($, "pointermove", (() => {
s && d((() => { s && d((() => {
v(); v();
manageScrollbarsAutoHide(true); manageScrollbarsAutoHide(true);
@@ -2346,7 +2402,7 @@ const OverlayScrollbars = function(t) {
s && manageScrollbarsAutoHide(false); s && manageScrollbarsAutoHide(false);
})); }));
})); }));
})), on(E, "scroll", (() => { })), on(T, "scroll", (() => {
_((() => { _((() => {
M(o()); M(o());
c && manageScrollbarsAutoHide(true); c && manageScrollbarsAutoHide(true);
@@ -2354,47 +2410,47 @@ const OverlayScrollbars = function(t) {
c && !r && manageScrollbarsAutoHide(false); c && !r && manageScrollbarsAutoHide(false);
})); }));
})); }));
A && P(styleScrollbarPosition); E && P(styleScrollbarPosition);
A && D(styleScrollbarPosition); E && D(styleScrollbarPosition);
})) ]; })) ];
const k = u.bind(0); const k = u.bind(0);
k.Yt = m; k.Yt = y;
k.jt = S; k.jt = S;
return [ (t, r, a) => { return [ (t, r, a) => {
const {Tt: u, zt: d, At: f, wt: _} = a; const {At: u, zt: d, Et: f, wt: _} = a;
const h = createOptionCheck(n, t, r); const h = createOptionCheck(n, t, r);
const g = o(); const g = o();
const {Ot: v, $t: w, vt: p} = g; const {Ot: v, xt: w, vt: p} = g;
const [b, y] = h("scrollbars.theme"); const [b, m] = h("scrollbars.theme");
const [m, S] = h("scrollbars.visibility"); const [y, S] = h("scrollbars.visibility");
const [$, x] = h("scrollbars.autoHide"); const [x, $] = h("scrollbars.autoHide");
const [C] = h("scrollbars.autoHideDelay"); const [C] = h("scrollbars.autoHideDelay");
const [O, E] = h("scrollbars.dragScroll"); const [O, T] = h("scrollbars.dragScroll");
const [A, z] = h("scrollbars.clickScroll"); const [E, z] = h("scrollbars.clickScroll");
const I = u || d || _ || r; const I = u || d || _ || r;
const P = f || S || r; const P = f || S || r;
const setScrollbarVisibility = (t, n) => { const setScrollbarVisibility = (t, n) => {
const o = "visible" === m || "auto" === m && "scroll" === t; const o = "visible" === y || "auto" === y && "scroll" === t;
L(K, o, n); L(K, o, n);
return o; return o;
}; };
i = C; i = C;
if (y) { if (m) {
L(l); L(l);
L(b, true); L(b, true);
l = b; l = b;
} }
if (x) { if ($) {
s = "move" === $; s = "move" === x;
e = "leave" === $; e = "leave" === x;
c = "never" !== $; c = "never" !== x;
manageScrollbarsAutoHide(!c, true); manageScrollbarsAutoHide(!c, true);
} }
if (E) { if (T) {
L(ct, O); L(ct, O);
} }
if (z) { if (z) {
L(et, A); L(et, E);
} }
if (P) { if (P) {
const t = setScrollbarVisibility(w.x, true); const t = setScrollbarVisibility(w.x, true);
@@ -2407,7 +2463,7 @@ const OverlayScrollbars = function(t) {
M(g); M(g);
L(nt, !v.x, true); L(nt, !v.x, true);
L(nt, !v.y, false); L(nt, !v.y, false);
L(N, p && !T); L(N, p && !A);
} }
}, k, runEachAndClear.bind(0, R) ]; }, k, runEachAndClear.bind(0, R) ];
}; };
@@ -2432,17 +2488,17 @@ const OverlayScrollbars = function(t) {
const update = (t, n) => { const update = (t, n) => {
h(t, !!n); h(t, !!n);
}; };
const y = e(update.bind(0, {}, true)); const m = e(update.bind(0, {}, true));
const destroy = t => { const destroy = t => {
removeInstance(l); removeInstance(l);
y(); m();
b(); b();
v(); v();
i = true; i = true;
_("destroyed", [ m, !!t ]); _("destroyed", [ y, !!t ]);
f(); f();
}; };
const m = { const y = {
options(t) { options(t) {
if (t) { if (t) {
const n = getOptionsDiff(u, validateOptions(t)); const n = getOptionsDiff(u, validateOptions(t));
@@ -2458,7 +2514,7 @@ const OverlayScrollbars = function(t) {
t && n && f(t, n); t && n && f(t, n);
}, },
state() { state() {
const {Ct: t, Ot: n, $t: o, Et: s, Z: e, bt: c, vt: r} = g(); const {Ct: t, Ot: n, xt: o, Tt: s, Z: e, bt: c, vt: r} = g();
return assignDeep({}, { return assignDeep({}, {
overflowEdge: t, overflowEdge: t,
overflowAmount: n, overflowAmount: n,
@@ -2506,7 +2562,7 @@ const OverlayScrollbars = function(t) {
}, },
update(t) { update(t) {
update({}, t); update({}, t);
return m; return y;
}, },
destroy: destroy.bind(0) destroy: destroy.bind(0)
}; };
@@ -2516,20 +2572,20 @@ const OverlayScrollbars = function(t) {
each(keys(c), (t => { each(keys(c), (t => {
const n = c[t]; const n = c[t];
if (isFunction(n)) { if (isFunction(n)) {
n(OverlayScrollbars, m); n(OverlayScrollbars, y);
} }
})); }));
if (cancelInitialization(!r && t.cancel, g.Yt)) { if (cancelInitialization(!r && t.cancel, g.Yt)) {
destroy(true); destroy(true);
return m; return y;
} }
g.jt(); g.jt();
p.jt(); p.jt();
addInstance(l, m); addInstance(l, y);
_("initialized", [ m ]); _("initialized", [ y ]);
g.Vt(((t, n, o) => { g.Vt(((t, n, o) => {
const {ht: s, wt: e, _t: c, Tt: r, zt: l, At: i, gt: a, xt: u} = t; const {ht: s, wt: e, _t: c, At: r, zt: l, Et: i, gt: a, $t: u} = t;
_("updated", [ m, { _("updated", [ y, {
updateHints: { updateHints: {
sizeChanged: s, sizeChanged: s,
directionChanged: e, directionChanged: e,
@@ -2544,7 +2600,7 @@ const OverlayScrollbars = function(t) {
force: o force: o
} ]); } ]);
})); }));
return m.update(true); return y.update(true);
} }
return i; return i;
}; };
@@ -2555,7 +2611,7 @@ const OverlayScrollbars = function(t) {
return isPlainObject(o) && !!getInstance(o.target); return isPlainObject(o) && !!getInstance(o.target);
}; };
OverlayScrollbars.env = () => { OverlayScrollbars.env = () => {
const {k: t, I: n, T: o, B: s, V: e, L: c, N: r, X: l, Y: i, q: a, F: u, G: d} = getEnvironment(); const {k: t, I: n, A: o, B: s, V: e, L: c, N: r, X: l, Y: i, q: a, F: u, G: d} = getEnvironment();
return assignDeep({}, { return assignDeep({}, {
scrollbarsSize: t, scrollbarsSize: t,
scrollbarsOverlaid: n, scrollbarsOverlaid: n,
@@ -2572,7 +2628,7 @@ const OverlayScrollbars = function(t) {
}); });
}; };
t.OverlayScrollbars = OverlayScrollbars; t.OverlayScrollbars = OverlayScrollbars;
t.scrollbarsHidingPlugin = $t; t.scrollbarsHidingPlugin = xt;
t.sizeObserverPlugin = pt; t.sizeObserverPlugin = pt;
Object.defineProperties(t, { Object.defineProperties(t, {
tn: { tn: {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+224 -167
View File
@@ -638,7 +638,7 @@ const stopPropagation = t => t.stopPropagation();
const preventDefault = t => t.preventDefault(); const preventDefault = t => t.preventDefault();
const y = { const m = {
x: 0, x: 0,
y: 0 y: 0
}; };
@@ -648,7 +648,7 @@ const absoluteCoordinates = t => {
return n ? { return n ? {
x: n.left + window.pageYOffset, x: n.left + window.pageYOffset,
y: n.top + window.pageXOffset y: n.top + window.pageXOffset
} : y; } : m;
}; };
const manageListener = (t, n) => { const manageListener = (t, n) => {
@@ -704,7 +704,7 @@ const opsStringify = t => JSON.stringify(t, ((t, n) => {
return n; return n;
})); }));
const m = { const y = {
paddingAbsolute: false, paddingAbsolute: false,
showNativeOverlaidScrollbars: false, showNativeOverlaidScrollbars: false,
update: { update: {
@@ -763,11 +763,11 @@ const C = "data-overlayscrollbars";
const O = `${C}-overflow-x`; const O = `${C}-overflow-x`;
const E = `${C}-overflow-y`; const T = `${C}-overflow-y`;
const A = "overflowVisible"; const E = "overflowVisible";
const T = "scrollbarHidden"; const A = "scrollbarHidden";
const z = "updating"; const z = "updating";
@@ -894,7 +894,7 @@ const vt = "__osSizeObserverPlugin";
const wt = /* @__PURE__ */ (() => ({ const wt = /* @__PURE__ */ (() => ({
[vt]: { [vt]: {
A: (t, n, o) => { T: (t, n, o) => {
const s = createDOM(`<div class="${j}" dir="ltr"><div class="${j}"><div class="${Y}"></div></div><div class="${j}"><div class="${Y}" style="width: 200%; height: 200%"></div></div></div>`); const s = createDOM(`<div class="${j}" dir="ltr"><div class="${j}"><div class="${Y}"></div></div><div class="${j}"><div class="${Y}" style="width: 200%; height: 200%"></div></div></div>`);
appendChildren(t, s); appendChildren(t, s);
addClass(t, V); addClass(t, V);
@@ -946,7 +946,7 @@ const wt = /* @__PURE__ */ (() => ({
let pt = 0; let pt = 0;
const {round: bt, abs: yt} = Math; const {round: bt, abs: mt} = Math;
const getWindowDPR = () => { const getWindowDPR = () => {
const t = window.screen.deviceXDPI || 0; const t = window.screen.deviceXDPI || 0;
@@ -955,16 +955,16 @@ const getWindowDPR = () => {
}; };
const diffBiggerThanOne = (t, n) => { const diffBiggerThanOne = (t, n) => {
const o = yt(t); const o = mt(t);
const s = yt(n); const s = mt(n);
return !(o === s || o + 1 === s || o - 1 === s); return !(o === s || o + 1 === s || o - 1 === s);
}; };
const mt = "__osScrollbarsHidingPlugin"; const yt = "__osScrollbarsHidingPlugin";
const St = /* @__PURE__ */ (() => ({ const St = /* @__PURE__ */ (() => ({
[mt]: { [yt]: {
T: t => { A: t => {
const {I: n, L: o, H: s} = t; const {I: n, L: o, H: s} = t;
const e = !s && !n && (o.x || o.y); const e = !s && !n && (o.x || o.y);
const c = e ? document.createElement("style") : false; const c = e ? document.createElement("style") : false;
@@ -1060,12 +1060,12 @@ const St = /* @__PURE__ */ (() => ({
return; return;
} }
const l = { const l = {
w: yt(r.w), w: mt(r.w),
h: yt(r.h) h: mt(r.h)
}; };
const i = { const i = {
w: yt(bt(c.w / (t.w / 100))), w: mt(bt(c.w / (t.w / 100))),
h: yt(bt(c.h / (t.h / 100))) h: mt(bt(c.h / (t.h / 100)))
}; };
const a = getWindowDPR(); const a = getWindowDPR();
const u = l.w > 2 && l.h > 2; const u = l.w > 2 && l.h > 2;
@@ -1173,7 +1173,7 @@ const createEnvironment = () => {
body: null body: null
} }
}; };
const f = assignDeep({}, m); const f = assignDeep({}, y);
const _ = { const _ = {
B: i, B: i,
L: u, L: u,
@@ -1198,7 +1198,7 @@ const createEnvironment = () => {
if (!a && (!u.x || !u.y)) { if (!a && (!u.x || !u.y)) {
let t; let t;
window.addEventListener("resize", (() => { window.addEventListener("resize", (() => {
const n = getPlugins()[mt]; const n = getPlugins()[yt];
t = t || n && n.k(); t = t || n && n.k();
t && t(_, r, c.bind(0, "_")); t && t(_, r, c.bind(0, "_"));
})); }));
@@ -1279,8 +1279,8 @@ const addDataAttrHost = (t, n) => {
const createStructureSetupElements = t => { const createStructureSetupElements = t => {
const n = getEnvironment(); const n = getEnvironment();
const {q: o, I: s} = n; const {q: o, I: s} = n;
const e = getPlugins()[mt]; const e = getPlugins()[yt];
const c = e && e.T; const c = e && e.A;
const {elements: r} = o(); const {elements: r} = o();
const {host: l, viewport: i, padding: a, content: u} = r; const {host: l, viewport: i, padding: a, content: u} = r;
const d = isHTMLElement(t); const d = isHTMLElement(t);
@@ -1289,33 +1289,33 @@ const createStructureSetupElements = t => {
const {host: h, padding: g, viewport: v, content: w} = _ || {}; const {host: h, padding: g, viewport: v, content: w} = _ || {};
const p = d ? t : f.target; const p = d ? t : f.target;
const b = is(p, "textarea"); const b = is(p, "textarea");
const y = p.ownerDocument; const m = p.ownerDocument;
const m = p === y.body; const y = p === m.body;
const S = y.defaultView; const S = m.defaultView;
const x = staticInitializationElement.bind(0, [ p ]); const x = staticInitializationElement.bind(0, [ p ]);
const $ = dynamicInitializationElement.bind(0, [ p ]); const $ = dynamicInitializationElement.bind(0, [ p ]);
const A = x(Ot, i, v); const E = x(Ot, i, v);
const T = A === p; const A = E === p;
const z = T && m; const z = A && y;
const H = y.activeElement; const H = m.activeElement;
const D = !T && S.top === S && H === p; const D = !A && S.top === S && H === p;
const R = { const R = {
J: p, J: p,
K: b ? x(Ot, l, h) : p, K: b ? x(Ot, l, h) : p,
Z: A, Z: E,
tt: !T && $(Ot, a, g), tt: !A && $(Ot, a, g),
nt: !T && $(Ot, u, w), nt: !A && $(Ot, u, w),
ot: !T && !s && c && c(n), ot: !A && !s && c && c(n),
st: z ? y.documentElement : A, st: z ? m.documentElement : E,
et: z ? y : A, et: z ? m : E,
ct: S, ct: S,
rt: y, rt: m,
lt: b, lt: b,
W: m, W: y,
it: d, it: d,
ut: T, ut: A,
dt: (t, n) => T ? hasAttrClass(A, C, n) : hasClass(A, t), dt: (t, n) => A ? hasAttrClass(E, C, n) : hasClass(E, t),
ft: (t, n, o) => T ? attrClass(A, C, n, o) : (o ? addClass : removeClass)(A, t) ft: (t, n, o) => A ? attrClass(E, C, n, o) : (o ? addClass : removeClass)(E, t)
}; };
const k = keys(R).reduce(((t, n) => { const k = keys(R).reduce(((t, n) => {
const o = R[n]; const o = R[n];
@@ -1328,11 +1328,11 @@ const createStructureSetupElements = t => {
let X = b ? B : contents([ q, Y, j, V, B ].find((t => false === elementIsGenerated(t)))); let X = b ? B : contents([ q, Y, j, V, B ].find((t => false === elementIsGenerated(t))));
const U = q || Y; const U = q || Y;
const appendElements = () => { const appendElements = () => {
const t = addDataAttrHost(V, T ? "viewport" : "host"); const t = addDataAttrHost(V, A ? "viewport" : "host");
const n = addClass(j, I); const n = addClass(j, I);
const o = addClass(Y, !T && L); const o = addClass(Y, !A && L);
const e = addClass(q, M); const e = addClass(q, M);
const c = m ? addClass(parent(p), P) : noop; const c = y ? addClass(parent(p), P) : noop;
if (N) { if (N) {
insertAfter(B, V); insertAfter(B, V);
push(G, (() => { push(G, (() => {
@@ -1342,13 +1342,13 @@ const createStructureSetupElements = t => {
} }
appendChildren(U, X); appendChildren(U, X);
appendChildren(V, j); appendChildren(V, j);
appendChildren(j || V, !T && Y); appendChildren(j || V, !A && Y);
appendChildren(Y, q); appendChildren(Y, q);
push(G, (() => { push(G, (() => {
c(); c();
t(); t();
removeAttr(Y, O); removeAttr(Y, O);
removeAttr(Y, E); removeAttr(Y, T);
if (elementIsGenerated(q)) { if (elementIsGenerated(q)) {
unwrap(q); unwrap(q);
} }
@@ -1362,7 +1362,7 @@ const createStructureSetupElements = t => {
o(); o();
e(); e();
})); }));
if (s && !T) { if (s && !A) {
push(G, removeClass.bind(0, Y, P)); push(G, removeClass.bind(0, Y, P));
} }
if (F) { if (F) {
@@ -1373,7 +1373,7 @@ const createStructureSetupElements = t => {
const t = attr(Y, Ct); const t = attr(Y, Ct);
attr(Y, Ct, "-1"); attr(Y, Ct, "-1");
Y.focus(); Y.focus();
const n = on(y, "pointerdown keydown", (() => { const n = on(m, "pointerdown keydown", (() => {
t ? attr(Y, Ct, t) : removeAttr(Y, Ct); t ? attr(Y, Ct, t) : removeAttr(Y, Ct);
n(); n();
})); }));
@@ -1418,12 +1418,12 @@ const createPaddingUpdateSegment = (t, n) => {
const {wt: h} = o(); const {wt: h} = o();
const {gt: g, vt: v, bt: w} = t; const {gt: g, vt: v, bt: w} = t;
const [p, b] = n("paddingAbsolute"); const [p, b] = n("paddingAbsolute");
const y = !_ && v; const m = !_ && v;
if (g || d || y) { if (g || d || m) {
[u, d] = i(e); [u, d] = i(e);
} }
const m = !l && (b || w || d); const y = !l && (b || w || d);
if (m) { if (y) {
const t = !p || !c && !f; const t = !p || !c && !f;
const n = u.r + u.l; const n = u.r + u.l;
const o = u.t + u.b; const o = u.t + u.b;
@@ -1451,16 +1451,16 @@ const createPaddingUpdateSegment = (t, n) => {
}); });
} }
return { return {
St: m St: y
}; };
}; };
}; };
const {max: Et} = Math; const {max: Tt} = Math;
const At = Et.bind(0, 0); const Et = Tt.bind(0, 0);
const Tt = "visible"; const At = "visible";
const zt = "hidden"; const zt = "hidden";
@@ -1485,8 +1485,8 @@ const Ht = {
const getOverflowAmount = (t, n) => { const getOverflowAmount = (t, n) => {
const o = window.devicePixelRatio % 1 !== 0 ? 1 : 0; const o = window.devicePixelRatio % 1 !== 0 ? 1 : 0;
const s = { const s = {
w: At(t.w - n.w), w: Et(t.w - n.w),
h: At(t.h - n.h) h: Et(t.h - n.h)
}; };
return { return {
w: s.w > o ? s.w : 0, w: s.w > o ? s.w : 0,
@@ -1496,17 +1496,17 @@ const getOverflowAmount = (t, n) => {
const conditionalClass = (t, n, o) => o ? addClass(t, n) : removeClass(t, n); const conditionalClass = (t, n, o) => o ? addClass(t, n) : removeClass(t, n);
const overflowIsVisible = t => 0 === t.indexOf(Tt); const overflowIsVisible = t => 0 === t.indexOf(At);
const createOverflowUpdateSegment = (t, n) => { const createOverflowUpdateSegment = (t, n) => {
const [o, s] = n; const [o, s] = n;
const {K: e, tt: c, Z: r, ot: l, ut: i, ft: a, W: u, ct: d} = t; const {K: e, tt: c, Z: r, ot: l, ut: i, ft: a, W: u, ct: d} = t;
const {B: f, j: _, I: h, L: g} = getEnvironment(); const {B: f, j: _, I: h, L: g} = getEnvironment();
const v = getPlugins()[mt]; const v = getPlugins()[yt];
const w = !i && !h && (g.x || g.y); const w = !i && !h && (g.x || g.y);
const p = u && i; const p = u && i;
const [b, y] = createCache(Lt, fractionalSize.bind(0, r)); const [b, m] = createCache(Lt, fractionalSize.bind(0, r));
const [m, S] = createCache(Lt, scrollSize.bind(0, r)); const [y, S] = createCache(Lt, scrollSize.bind(0, r));
const [x, $] = createCache(Lt); const [x, $] = createCache(Lt);
const [z, I] = createCache(Lt); const [z, I] = createCache(Lt);
const [L] = createCache(Ht); const [L] = createCache(Ht);
@@ -1562,7 +1562,7 @@ const createOverflowUpdateSegment = (t, n) => {
const setViewportOverflowState = (t, n, o, s) => { const setViewportOverflowState = (t, n, o, s) => {
const setAxisOverflowStyle = (t, n) => { const setAxisOverflowStyle = (t, n) => {
const o = overflowIsVisible(t); const o = overflowIsVisible(t);
const s = n && o && t.replace(`${Tt}-`, "") || ""; const s = n && o && t.replace(`${At}-`, "") || "";
return [ n && !o ? t : "", overflowIsVisible(s) ? "hidden" : s ]; return [ n && !o ? t : "", overflowIsVisible(s) ? "hidden" : s ];
}; };
const [e, c] = setAxisOverflowStyle(o.x, n.x); const [e, c] = setAxisOverflowStyle(o.x, n.x);
@@ -1601,13 +1601,13 @@ const createOverflowUpdateSegment = (t, n) => {
const X = overflowIsVisible(q.x); const X = overflowIsVisible(q.x);
const U = overflowIsVisible(q.y); const U = overflowIsVisible(q.y);
const W = X || U; const W = X || U;
let J = y(l); let J = m(l);
let K = S(l); let K = S(l);
let Z = $(l); let Z = $(l);
let Q = I(l); let Q = I(l);
let tt; let tt;
if (Y && h) { if (Y && h) {
a(P, T, !G); a(P, A, !G);
} }
if (N) { if (N) {
tt = getViewportOverflowState(G); tt = getViewportOverflowState(G);
@@ -1615,11 +1615,11 @@ const createOverflowUpdateSegment = (t, n) => {
} }
if (u || w || v || k || Y) { if (u || w || v || k || Y) {
if (W) { if (W) {
a(D, A, false); a(D, E, false);
} }
const [t, n] = M(G, V, tt); const [t, n] = M(G, V, tt);
const [o, s] = J = b(l); const [o, s] = J = b(l);
const [e, c] = K = m(l); const [e, c] = K = y(l);
const i = clientSize(r); const i = clientSize(r);
let u = e; let u = e;
let f = i; let f = i;
@@ -1629,12 +1629,12 @@ const createOverflowUpdateSegment = (t, n) => {
u = scrollSize(r); u = scrollSize(r);
} }
const _ = { const _ = {
w: At(Et(e.w, u.w) + o.w), w: Et(Tt(e.w, u.w) + o.w),
h: At(Et(e.h, u.h) + o.h) h: Et(Tt(e.h, u.h) + o.h)
}; };
const h = { const h = {
w: At(p ? d.innerWidth : f.w + At(i.w - e.w) + o.w), w: Et(p ? d.innerWidth : f.w + Et(i.w - e.w) + o.w),
h: At(p ? d.innerHeight : f.h + At(i.h - e.h) + o.h) h: Et(p ? d.innerHeight : f.h + Et(i.h - e.h) + o.h)
}; };
Q = z(h); Q = z(h);
Z = x(getOverflowAmount(_, h), l); Z = x(getOverflowAmount(_, h), l);
@@ -1667,12 +1667,12 @@ const createOverflowUpdateSegment = (t, n) => {
} }
if (i) { if (i) {
attr(e, O, t.overflowX); attr(e, O, t.overflowX);
attr(e, E, t.overflowY); attr(e, T, t.overflowY);
} else { } else {
style(r, t); style(r, t);
} }
} }
attrClass(e, C, A, ut); attrClass(e, C, E, ut);
conditionalClass(c, D, ut); conditionalClass(c, D, ut);
!i && conditionalClass(r, D, W); !i && conditionalClass(r, D, W);
const [dt, ft] = L(getViewportOverflowState(G).$t); const [dt, ft] = L(getViewportOverflowState(G).$t);
@@ -1682,14 +1682,14 @@ const createOverflowUpdateSegment = (t, n) => {
x: nt.w, x: nt.w,
y: nt.h y: nt.h
}, },
Et: { Tt: {
x: st.w, x: st.w,
y: st.h y: st.h
}, },
At: at Et: at
}); });
return { return {
Tt: ft, At: ft,
zt: ot, zt: ot,
It: et It: et
}; };
@@ -1721,7 +1721,7 @@ const createStructureSetupUpdate = (t, n) => {
ht: false, ht: false,
zt: false, zt: false,
It: false, It: false,
Tt: false, At: false,
Ct: false, Ct: false,
vt: false vt: false
}, n), {}, r); }, n), {}, r);
@@ -1805,7 +1805,7 @@ const createSizeObserver = (t, n, o) => {
t.disconnect(); t.disconnect();
})); }));
} else if (c) { } else if (c) {
const [t, n] = c.A(a, onSizeChangedCallbackProxy, e); const [t, n] = c.T(a, onSizeChangedCallbackProxy, e);
h = t; h = t;
push(_, n); push(_, n);
} }
@@ -1967,21 +1967,21 @@ const createDOMObserver = (t, n, o, s) => {
const {attributeName: e, target: c, type: u, oldValue: d, addedNodes: h} = o; const {attributeName: e, target: c, type: u, oldValue: d, addedNodes: h} = o;
const p = "attributes" === u; const p = "attributes" === u;
const b = "childList" === u; const b = "childList" === u;
const y = t === c; const m = t === c;
const m = p && isString(e) ? attr(c, e) : 0; const y = p && isString(e) ? attr(c, e) : 0;
const S = 0 !== m && d !== m; const S = 0 !== y && d !== y;
const x = indexOf(v, e) > -1 && S; const x = indexOf(v, e) > -1 && S;
if (n && !y) { if (n && !m) {
const n = !p; const n = !p;
const i = p && x; const i = p && x;
const u = i && a && is(c, a); const u = i && a && is(c, a);
const _ = u ? !r(c, e, d, m) : n || i; const _ = u ? !r(c, e, d, y) : n || i;
const v = _ && !l(o, !!u, t, s); const v = _ && !l(o, !!u, t, s);
push(f, h); push(f, h);
g = g || v; g = g || v;
w = w || b; w = w || b;
} }
if (!n && y && S && !r(c, e, d, m)) { if (!n && m && S && !r(c, e, d, y)) {
push(i, e); push(i, e);
_ = _ || x; _ = _ || x;
} }
@@ -2050,17 +2050,17 @@ const createStructureSetupObservers = (t, n, o) => {
h: 0 h: 0
} }
}, (() => { }, (() => {
const t = _(D, A); const t = _(D, E);
const n = _(H, ""); const n = _(H, "");
const o = n && scrollLeft(i); const o = n && scrollLeft(i);
const s = n && scrollTop(i); const s = n && scrollTop(i);
h(D, A); h(D, E);
h(H, ""); h(H, "");
h("", z, true); h("", z, true);
const e = scrollSize(a); const e = scrollSize(a);
const c = scrollSize(i); const c = scrollSize(i);
const r = fractionalSize(i); const r = fractionalSize(i);
h(D, A, t); h(D, E, t);
h(H, "", n); h(H, "", n);
h("", z); h("", z);
scrollLeft(i, o); scrollLeft(i, o);
@@ -2143,7 +2143,7 @@ const createStructureSetupObservers = (t, n, o) => {
} }
return s; return s;
}; };
const [b, y, m] = a || !g ? createTrinsicObserver(l, onTrinsicChanged) : [ noop, noop, noop ]; const [b, m, y] = a || !g ? createTrinsicObserver(l, onTrinsicChanged) : [ noop, noop, noop ];
const [S, x] = !f ? createSizeObserver(l, onSizeChanged, { const [S, x] = !f ? createSizeObserver(l, onSizeChanged, {
Ht: true, Ht: true,
Lt: true Lt: true
@@ -2165,11 +2165,11 @@ const createStructureSetupObservers = (t, n, o) => {
$(); $();
}, () => { }, () => {
x(); x();
y(); m();
}, () => { }, () => {
const t = {}; const t = {};
const n = C(); const n = C();
const o = m(); const o = y();
const s = c && c[1](); const s = c && c[1]();
if (n) { if (n) {
assignDeep(t, onHostMutation.apply(0, push(n, true))); assignDeep(t, onHostMutation.apply(0, push(n, true)));
@@ -2246,12 +2246,12 @@ const jt = {
paddingLeft: 0 paddingLeft: 0
}, },
Ot: Vt, Ot: Vt,
Et: Vt, Tt: Vt,
$t: { $t: {
x: "hidden", x: "hidden",
y: "hidden" y: "hidden"
}, },
At: { Et: {
x: false, x: false,
y: false y: false
}, },
@@ -2300,12 +2300,26 @@ const createStructureSetup = (t, n) => {
} ]; } ];
}; };
const {round: Yt} = Math; const {round: Yt, max: qt, sign: Ft} = Math;
const getClientOffset = t => ({ const animationCurrentTime = () => performance.now();
x: t.clientX,
y: t.clientY const animateNumber = (t, n, o, s) => {
}); let e = 0;
const c = animationCurrentTime();
const frame = () => {
const r = animationCurrentTime();
const l = r - c;
const i = l >= o;
const a = 1 - (qt(0, c + o - r) / o || 0);
const u = (n - t) * a + t;
const d = i || 1 === a;
s(u, d);
e = d ? 0 : f(frame);
};
frame();
return () => d(e);
};
const getScale = t => { const getScale = t => {
const {width: n, height: o} = getBoundingClientRect(t); const {width: n, height: o} = getBoundingClientRect(t);
@@ -2320,7 +2334,7 @@ const continuePointerDown = (t, n, o) => {
const s = n.scrollbars; const s = n.scrollbars;
const {button: e, isPrimary: c, pointerType: r} = t; const {button: e, isPrimary: c, pointerType: r} = t;
const {pointers: l} = s; const {pointers: l} = s;
return 0 === e && c && s[o] && (l || []).includes(r); return 0 === e && c && s[o ? "dragScroll" : "clickScroll"] && (l || []).includes(r);
}; };
const createRootClickStopPropagationEvents = (t, n) => on(t, "mousedown", on.bind(0, n, "click", stopPropagation, { const createRootClickStopPropagationEvents = (t, n) => on(t, "mousedown", on.bind(0, n, "click", stopPropagation, {
@@ -2330,36 +2344,79 @@ const createRootClickStopPropagationEvents = (t, n) => on(t, "mousedown", on.bin
C: true C: true
}); });
const createDragScrollingEvents = (t, n, o, s, e, c) => { const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
const {V: r} = getEnvironment(); const {V: r} = getEnvironment();
const {Ft: l, Gt: i, Nt: a} = o; const {Ft: l, Gt: i, Nt: a} = o;
const u = `scroll${c ? "Left" : "Top"}`; const u = `scroll${c ? "Left" : "Top"}`;
const d = `${c ? "x" : "y"}`; const d = c ? "width" : "height";
const f = `${c ? "w" : "h"}`; const f = c ? "w" : "h";
const createOnPointerMoveHandler = (t, n, o) => _ => { const _ = c ? "x" : "y";
const {Et: h} = e(); const getHandleOffset = (t, n) => t[_] - n[_];
const g = (getClientOffset(_)[d] - n) * o; const createRelativeHandleMove = (t, n) => o => {
const v = offsetSize(i)[f] - offsetSize(l)[f]; const {Tt: d} = e();
const w = g / v; const h = offsetSize(i)[f] - offsetSize(l)[f];
const p = w * h[d]; const g = n * o / h;
const b = directionIsRTL(a); const v = g * d[_];
const y = b && c ? r.n || r.i ? 1 : -1 : 1; const w = directionIsRTL(a);
s[u] = t + p * y; const p = w && c ? r.n || r.i ? 1 : -1 : 1;
s[u] = t + v * p;
}; };
return on(l, "pointerdown", (o => { return on(i, "pointerdown", (o => {
if (continuePointerDown(o, t, "dragScroll")) { const e = closest(o.target, `.${W}`) === l;
const t = on(n, "selectstart", (t => preventDefault(t)), { if (continuePointerDown(o, t, e)) {
const t = !e && o.shiftKey;
const c = createRelativeHandleMove(s[u] || 0, 1 / getScale(s)[_]);
const r = o[_];
const a = getBoundingClientRect(l);
const f = getBoundingClientRect(i);
const h = a[d];
const g = getHandleOffset(a, f) + h / 2;
const v = r - f[_];
const w = e ? 0 : v - g;
const p = [ on(n, "selectstart", (t => preventDefault(t)), {
$: false $: false
}); }), on(i, "pointermove", (n => {
const e = on(l, "pointermove", createOnPointerMoveHandler(s[u] || 0, getClientOffset(o)[d], 1 / getScale(s)[d])); const o = n[_] - r;
on(l, "pointerup", (n => { if (e || t) {
t(); c(w + o);
e(); }
l.releasePointerCapture(n.pointerId); })) ];
if (t) {
c(w);
} else if (!e) {
let t = 0;
let n = noop;
const animateClickScroll = o => {
n = animateNumber(o, o + h * Ft(w), 133, ((o, s) => {
c(o);
const e = getHandleOffset(getBoundingClientRect(l), f);
const r = e + h;
const i = v >= e && v <= r;
if (s && !i) {
if (t) {
animateClickScroll(o);
} else {
const t = setTimeout((() => {
animateClickScroll(o);
}), 222);
n = () => {
clearTimeout(t);
};
}
t++;
}
}));
};
animateClickScroll(0);
push(p, (() => n()));
}
on(i, "pointerup", (t => {
runEachAndClear(p);
i.releasePointerCapture(t.pointerId);
}), { }), {
O: true O: true
}); });
l.setPointerCapture(o.pointerId); i.setPointerCapture(o.pointerId);
} }
})); }));
}; };
@@ -2392,36 +2449,36 @@ const createScrollbarsSetupEvents = (t, n) => (o, s, e, c, r, l) => {
}), { }), {
$: false, $: false,
C: true C: true
}), createRootClickStopPropagationEvents(i, e), createDragScrollingEvents(t, e, o, r, n, l), u ]); }), createRootClickStopPropagationEvents(i, e), createInteractiveScrollEvents(t, e, o, r, n, l), u ]);
}; };
const {min: qt, max: Ft, abs: Gt, round: Nt} = Math; const {min: Gt, max: Nt, abs: Xt, round: Ut} = Math;
const getScrollbarHandleLengthRatio = (t, n, o, s) => { const getScrollbarHandleLengthRatio = (t, n, o, s) => {
if (s) { if (s) {
const t = o ? "x" : "y"; const t = o ? "x" : "y";
const {Et: n, Ot: e} = s; const {Tt: n, Ot: e} = s;
const c = e[t]; const c = e[t];
const r = n[t]; const r = n[t];
return Ft(0, qt(1, c / (c + r))); return Nt(0, Gt(1, c / (c + r)));
} }
const e = o ? "w" : "h"; const e = o ? "w" : "h";
const c = offsetSize(t)[e]; const c = offsetSize(t)[e];
const r = offsetSize(n)[e]; const r = offsetSize(n)[e];
return Ft(0, qt(1, c / r)); return Nt(0, Gt(1, c / r));
}; };
const getScrollbarHandleOffsetRatio = (t, n, o, s, e, c) => { const getScrollbarHandleOffsetRatio = (t, n, o, s, e, c) => {
const {V: r} = getEnvironment(); const {V: r} = getEnvironment();
const l = c ? "x" : "y"; const l = c ? "x" : "y";
const i = c ? "Left" : "Top"; const i = c ? "Left" : "Top";
const {Et: a} = s; const {Tt: a} = s;
const u = Nt(a[l]); const u = Ut(a[l]);
const d = Gt(o[`scroll${i}`]); const d = Xt(o[`scroll${i}`]);
const f = c && e; const f = c && e;
const _ = r.i ? d : u - d; const _ = r.i ? d : u - d;
const h = f ? _ : d; const h = f ? _ : d;
const g = qt(1, h / u); const g = Gt(1, h / u);
const v = getScrollbarHandleLengthRatio(t, n, c); const v = getScrollbarHandleLengthRatio(t, n, c);
return 1 / v * (1 - v) * g; return 1 / v * (1 - v) * g;
}; };
@@ -2502,7 +2559,7 @@ const createScrollbarsSetupElements = (t, n, o) => {
return u; return u;
}; };
const b = generateScrollbarDOM.bind(0, true); const b = generateScrollbarDOM.bind(0, true);
const y = generateScrollbarDOM.bind(0, false); const m = generateScrollbarDOM.bind(0, false);
const appendElements = () => { const appendElements = () => {
appendChildren(g, w[0].Nt); appendChildren(g, w[0].Nt);
appendChildren(g, p[0].Nt); appendChildren(g, p[0].Nt);
@@ -2511,7 +2568,7 @@ const createScrollbarsSetupElements = (t, n, o) => {
}), 300); }), 300);
}; };
b(); b();
y(); m();
return [ { return [ {
Xt: refreshScrollbarsHandleLength, Xt: refreshScrollbarsHandleLength,
Ut: refreshScrollbarsHandleOffset, Ut: refreshScrollbarsHandleOffset,
@@ -2523,7 +2580,7 @@ const createScrollbarsSetupElements = (t, n, o) => {
}, },
tn: { tn: {
Kt: p, Kt: p,
Zt: y, Zt: m,
Qt: scrollbarsHandleStyle.bind(0, p) Qt: scrollbarsHandleStyle.bind(0, p)
} }
}, appendElements, runEachAndClear.bind(0, v) ]; }, appendElements, runEachAndClear.bind(0, v) ];
@@ -2542,21 +2599,21 @@ const createScrollbarsSetup = (t, n, o) => {
const [_, h] = selfCancelTimeout(); const [_, h] = selfCancelTimeout();
const [g, v] = selfCancelTimeout(100); const [g, v] = selfCancelTimeout(100);
const [w, p] = selfCancelTimeout(100); const [w, p] = selfCancelTimeout(100);
const [b, y] = selfCancelTimeout((() => i)); const [b, m] = selfCancelTimeout((() => i));
const [m, S, x] = createScrollbarsSetupElements(t, o.qt, createScrollbarsSetupEvents(n, o)); const [y, S, x] = createScrollbarsSetupElements(t, o.qt, createScrollbarsSetupEvents(n, o));
const {K: $, Z: C, st: O, et: E, ut: A, W: T} = o.qt; const {K: $, Z: C, st: O, et: T, ut: E, W: A} = o.qt;
const {Jt: z, tn: I, Wt: L, Xt: H, Ut: M} = m; const {Jt: z, tn: I, Wt: L, Xt: H, Ut: M} = y;
const {Qt: P} = z; const {Qt: P} = z;
const {Qt: D} = I; const {Qt: D} = I;
const styleScrollbarPosition = t => { const styleScrollbarPosition = t => {
const {Nt: n} = t; const {Nt: n} = t;
const o = A && !T && parent(n) === C && n; const o = E && !A && parent(n) === C && n;
return [ o, { return [ o, {
transform: o ? `translate(${scrollLeft(O)}px, ${scrollTop(O)}px)` : "" transform: o ? `translate(${scrollLeft(O)}px, ${scrollTop(O)}px)` : ""
} ]; } ];
}; };
const manageScrollbarsAutoHide = (t, n) => { const manageScrollbarsAutoHide = (t, n) => {
y(); m();
if (t) { if (t) {
L(nt); L(nt);
} else { } else {
@@ -2572,7 +2629,7 @@ const createScrollbarsSetup = (t, n, o) => {
r = e; r = e;
r && manageScrollbarsAutoHide(true); r && manageScrollbarsAutoHide(true);
}; };
const R = [ v, y, p, h, f, x, on($, "pointerover", onHostMouseEnter, { const R = [ v, m, p, h, f, x, on($, "pointerover", onHostMouseEnter, {
O: true O: true
}), on($, "pointerenter", onHostMouseEnter), on($, "pointerleave", (() => { }), on($, "pointerenter", onHostMouseEnter), on($, "pointerleave", (() => {
r = false; r = false;
@@ -2585,7 +2642,7 @@ const createScrollbarsSetup = (t, n, o) => {
s && manageScrollbarsAutoHide(false); s && manageScrollbarsAutoHide(false);
})); }));
})); }));
})), on(E, "scroll", (() => { })), on(T, "scroll", (() => {
_((() => { _((() => {
M(o()); M(o());
c && manageScrollbarsAutoHide(true); c && manageScrollbarsAutoHide(true);
@@ -2593,32 +2650,32 @@ const createScrollbarsSetup = (t, n, o) => {
c && !r && manageScrollbarsAutoHide(false); c && !r && manageScrollbarsAutoHide(false);
})); }));
})); }));
A && P(styleScrollbarPosition); E && P(styleScrollbarPosition);
A && D(styleScrollbarPosition); E && D(styleScrollbarPosition);
})) ]; })) ];
const k = u.bind(0); const k = u.bind(0);
k.qt = m; k.qt = y;
k.Yt = S; k.Yt = S;
return [ (t, r, a) => { return [ (t, r, a) => {
const {zt: u, It: d, Tt: f, bt: _} = a; const {zt: u, It: d, At: f, bt: _} = a;
const h = createOptionCheck(n, t, r); const h = createOptionCheck(n, t, r);
const g = o(); const g = o();
const {Et: v, $t: w, wt: p} = g; const {Tt: v, $t: w, wt: p} = g;
const [b, y] = h("scrollbars.theme"); const [b, m] = h("scrollbars.theme");
const [m, S] = h("scrollbars.visibility"); const [y, S] = h("scrollbars.visibility");
const [x, $] = h("scrollbars.autoHide"); const [x, $] = h("scrollbars.autoHide");
const [C] = h("scrollbars.autoHideDelay"); const [C] = h("scrollbars.autoHideDelay");
const [O, E] = h("scrollbars.dragScroll"); const [O, T] = h("scrollbars.dragScroll");
const [A, z] = h("scrollbars.clickScroll"); const [E, z] = h("scrollbars.clickScroll");
const I = u || d || _ || r; const I = u || d || _ || r;
const P = f || S || r; const P = f || S || r;
const setScrollbarVisibility = (t, n) => { const setScrollbarVisibility = (t, n) => {
const o = "visible" === m || "auto" === m && "scroll" === t; const o = "visible" === y || "auto" === y && "scroll" === t;
L(J, o, n); L(J, o, n);
return o; return o;
}; };
i = C; i = C;
if (y) { if (m) {
L(l); L(l);
L(b, true); L(b, true);
l = b; l = b;
@@ -2629,11 +2686,11 @@ const createScrollbarsSetup = (t, n, o) => {
c = "never" !== x; c = "never" !== x;
manageScrollbarsAutoHide(!c, true); manageScrollbarsAutoHide(!c, true);
} }
if (E) { if (T) {
L(et, O); L(et, O);
} }
if (z) { if (z) {
L(st, A); L(st, E);
} }
if (P) { if (P) {
const t = setScrollbarVisibility(w.x, true); const t = setScrollbarVisibility(w.x, true);
@@ -2646,7 +2703,7 @@ const createScrollbarsSetup = (t, n, o) => {
M(g); M(g);
L(tt, !v.x, true); L(tt, !v.x, true);
L(tt, !v.y, false); L(tt, !v.y, false);
L(G, p && !T); L(G, p && !A);
} }
}, k, runEachAndClear.bind(0, R) ]; }, k, runEachAndClear.bind(0, R) ];
}; };
@@ -2662,7 +2719,7 @@ const OverlayScrollbars = (t, n, o) => {
const a = c[_t]; const a = c[_t];
const validateOptions = t => { const validateOptions = t => {
const n = t || {}; const n = t || {};
const o = a && a.A; const o = a && a.T;
return o ? o(n, true) : n; return o ? o(n, true) : n;
}; };
const u = assignDeep({}, s(), validateOptions(n)); const u = assignDeep({}, s(), validateOptions(n));
@@ -2672,17 +2729,17 @@ const OverlayScrollbars = (t, n, o) => {
const update = (t, n) => { const update = (t, n) => {
h(t, !!n); h(t, !!n);
}; };
const y = e(update.bind(0, {}, true)); const m = e(update.bind(0, {}, true));
const destroy = t => { const destroy = t => {
removeInstance(l); removeInstance(l);
y(); m();
b(); b();
v(); v();
i = true; i = true;
_("destroyed", [ m, !!t ]); _("destroyed", [ y, !!t ]);
f(); f();
}; };
const m = { const y = {
options(t) { options(t) {
if (t) { if (t) {
const n = getOptionsDiff(u, validateOptions(t)); const n = getOptionsDiff(u, validateOptions(t));
@@ -2698,7 +2755,7 @@ const OverlayScrollbars = (t, n, o) => {
t && n && f(t, n); t && n && f(t, n);
}, },
state() { state() {
const {Ot: t, Et: n, $t: o, At: s, tt: e, yt: c, wt: r} = g(); const {Ot: t, Tt: n, $t: o, Et: s, tt: e, yt: c, wt: r} = g();
return assignDeep({}, { return assignDeep({}, {
overflowEdge: t, overflowEdge: t,
overflowAmount: n, overflowAmount: n,
@@ -2746,7 +2803,7 @@ const OverlayScrollbars = (t, n, o) => {
}, },
update(t) { update(t) {
update({}, t); update({}, t);
return m; return y;
}, },
destroy: destroy.bind(0) destroy: destroy.bind(0)
}; };
@@ -2756,20 +2813,20 @@ const OverlayScrollbars = (t, n, o) => {
each(keys(c), (t => { each(keys(c), (t => {
const n = c[t]; const n = c[t];
if (isFunction(n)) { if (isFunction(n)) {
n(OverlayScrollbars, m); n(OverlayScrollbars, y);
} }
})); }));
if (cancelInitialization(!r && t.cancel, g.qt)) { if (cancelInitialization(!r && t.cancel, g.qt)) {
destroy(true); destroy(true);
return m; return y;
} }
g.Yt(); g.Yt();
p.Yt(); p.Yt();
addInstance(l, m); addInstance(l, y);
_("initialized", [ m ]); _("initialized", [ y ]);
g.jt(((t, n, o) => { g.jt(((t, n, o) => {
const {gt: s, bt: e, ht: c, zt: r, It: l, Tt: i, vt: a, Ct: u} = t; const {gt: s, bt: e, ht: c, zt: r, It: l, At: i, vt: a, Ct: u} = t;
_("updated", [ m, { _("updated", [ y, {
updateHints: { updateHints: {
sizeChanged: s, sizeChanged: s,
directionChanged: e, directionChanged: e,
@@ -2784,7 +2841,7 @@ const OverlayScrollbars = (t, n, o) => {
force: o force: o
} ]); } ]);
})); }));
return m.update(true); return y.update(true);
} }
return i; return i;
}; };
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+226 -169
View File
@@ -627,7 +627,7 @@ const stopPropagation = t => t.stopPropagation();
const preventDefault = t => t.preventDefault(); const preventDefault = t => t.preventDefault();
const y = { const m = {
x: 0, x: 0,
y: 0 y: 0
}; };
@@ -637,7 +637,7 @@ const absoluteCoordinates = t => {
return n ? { return n ? {
x: n.left + window.pageYOffset, x: n.left + window.pageYOffset,
y: n.top + window.pageXOffset y: n.top + window.pageXOffset
} : y; } : m;
}; };
const manageListener = (t, n) => { const manageListener = (t, n) => {
@@ -693,7 +693,7 @@ const opsStringify = t => JSON.stringify(t, ((t, n) => {
return n; return n;
})); }));
const m = { const y = {
paddingAbsolute: false, paddingAbsolute: false,
showNativeOverlaidScrollbars: false, showNativeOverlaidScrollbars: false,
update: { update: {
@@ -752,11 +752,11 @@ const C = "data-overlayscrollbars";
const O = `${C}-overflow-x`; const O = `${C}-overflow-x`;
const E = `${C}-overflow-y`; const T = `${C}-overflow-y`;
const A = "overflowVisible"; const E = "overflowVisible";
const T = "scrollbarHidden"; const A = "scrollbarHidden";
const z = "updating"; const z = "updating";
@@ -935,7 +935,7 @@ const wt = /* @__PURE__ */ (() => ({
let pt = 0; let pt = 0;
const {round: bt, abs: yt} = Math; const {round: bt, abs: mt} = Math;
const getWindowDPR = () => { const getWindowDPR = () => {
const t = window.screen.deviceXDPI || 0; const t = window.screen.deviceXDPI || 0;
@@ -944,17 +944,17 @@ const getWindowDPR = () => {
}; };
const diffBiggerThanOne = (t, n) => { const diffBiggerThanOne = (t, n) => {
const o = yt(t); const o = mt(t);
const s = yt(n); const s = mt(n);
return !(o === s || o + 1 === s || o - 1 === s); return !(o === s || o + 1 === s || o - 1 === s);
}; };
const mt = "__osScrollbarsHidingPlugin"; const yt = "__osScrollbarsHidingPlugin";
const St = /* @__PURE__ */ (() => ({ const St = /* @__PURE__ */ (() => ({
[mt]: { [yt]: {
A: t => { T: t => {
const {T: n, I: o, L: s} = t; const {A: n, I: o, L: s} = t;
const e = !s && !n && (o.x || o.y); const e = !s && !n && (o.x || o.y);
const c = e ? document.createElement("style") : false; const c = e ? document.createElement("style") : false;
if (c) { if (c) {
@@ -1049,12 +1049,12 @@ const St = /* @__PURE__ */ (() => ({
return; return;
} }
const l = { const l = {
w: yt(r.w), w: mt(r.w),
h: yt(r.h) h: mt(r.h)
}; };
const i = { const i = {
w: yt(bt(c.w / (t.w / 100))), w: mt(bt(c.w / (t.w / 100))),
h: yt(bt(c.h / (t.h / 100))) h: mt(bt(c.h / (t.h / 100)))
}; };
const a = getWindowDPR(); const a = getWindowDPR();
const u = l.w > 2 && l.h > 2; const u = l.w > 2 && l.h > 2;
@@ -1162,11 +1162,11 @@ const createEnvironment = () => {
body: null body: null
} }
}; };
const f = assignDeep({}, m); const f = assignDeep({}, y);
const _ = { const _ = {
k: i, k: i,
I: u, I: u,
T: a, A: a,
L: "-1" === style(o, "zIndex"), L: "-1" === style(o, "zIndex"),
B: getRtlScrollBehavior(o, s), B: getRtlScrollBehavior(o, s),
V: getFlexboxGlue(o, s), V: getFlexboxGlue(o, s),
@@ -1187,7 +1187,7 @@ const createEnvironment = () => {
if (!a && (!u.x || !u.y)) { if (!a && (!u.x || !u.y)) {
let t; let t;
window.addEventListener("resize", (() => { window.addEventListener("resize", (() => {
const n = getPlugins()[mt]; const n = getPlugins()[yt];
t = t || n && n.R(); t = t || n && n.R();
t && t(_, r, c.bind(0, "_")); t && t(_, r, c.bind(0, "_"));
})); }));
@@ -1219,7 +1219,7 @@ const dynamicInitializationElement = (t, n, o, s) => {
const cancelInitialization = (t, n) => { const cancelInitialization = (t, n) => {
const {nativeScrollbarsOverlaid: o, body: s} = t || {}; const {nativeScrollbarsOverlaid: o, body: s} = t || {};
const {U: e} = n; const {U: e} = n;
const {j: c, I: r, T: l} = getEnvironment(); const {j: c, I: r, A: l} = getEnvironment();
const {nativeScrollbarsOverlaid: i, body: a} = c().cancel; const {nativeScrollbarsOverlaid: i, body: a} = c().cancel;
const u = null != o ? o : i; const u = null != o ? o : i;
const d = isUndefined(s) ? a : s; const d = isUndefined(s) ? a : s;
@@ -1267,9 +1267,9 @@ const addDataAttrHost = (t, n) => {
const createStructureSetupElements = t => { const createStructureSetupElements = t => {
const n = getEnvironment(); const n = getEnvironment();
const {j: o, T: s} = n; const {j: o, A: s} = n;
const e = getPlugins()[mt]; const e = getPlugins()[yt];
const c = e && e.A; const c = e && e.T;
const {elements: r} = o(); const {elements: r} = o();
const {host: l, viewport: i, padding: a, content: u} = r; const {host: l, viewport: i, padding: a, content: u} = r;
const d = isHTMLElement(t); const d = isHTMLElement(t);
@@ -1278,33 +1278,33 @@ const createStructureSetupElements = t => {
const {host: h, padding: g, viewport: v, content: w} = _ || {}; const {host: h, padding: g, viewport: v, content: w} = _ || {};
const p = d ? t : f.target; const p = d ? t : f.target;
const b = is(p, "textarea"); const b = is(p, "textarea");
const y = p.ownerDocument; const m = p.ownerDocument;
const m = p === y.body; const y = p === m.body;
const S = y.defaultView; const S = m.defaultView;
const x = staticInitializationElement.bind(0, [ p ]); const x = staticInitializationElement.bind(0, [ p ]);
const $ = dynamicInitializationElement.bind(0, [ p ]); const $ = dynamicInitializationElement.bind(0, [ p ]);
const A = x(Ot, i, v); const E = x(Ot, i, v);
const T = A === p; const A = E === p;
const z = T && m; const z = A && y;
const H = y.activeElement; const H = m.activeElement;
const M = !T && S.top === S && H === p; const M = !A && S.top === S && H === p;
const R = { const R = {
W: p, W: p,
J: b ? x(Ot, l, h) : p, J: b ? x(Ot, l, h) : p,
K: A, K: E,
Z: !T && $(Ot, a, g), Z: !A && $(Ot, a, g),
tt: !T && $(Ot, u, w), tt: !A && $(Ot, u, w),
nt: !T && !s && c && c(n), nt: !A && !s && c && c(n),
ot: z ? y.documentElement : A, ot: z ? m.documentElement : E,
st: z ? y : A, st: z ? m : E,
et: S, et: S,
ct: y, ct: m,
rt: b, rt: b,
U: m, U: y,
lt: d, lt: d,
it: T, it: A,
ut: (t, n) => T ? hasAttrClass(A, C, n) : hasClass(A, t), ut: (t, n) => A ? hasAttrClass(E, C, n) : hasClass(E, t),
dt: (t, n, o) => T ? attrClass(A, C, n, o) : (o ? addClass : removeClass)(A, t) dt: (t, n, o) => A ? attrClass(E, C, n, o) : (o ? addClass : removeClass)(E, t)
}; };
const k = keys(R).reduce(((t, n) => { const k = keys(R).reduce(((t, n) => {
const o = R[n]; const o = R[n];
@@ -1317,11 +1317,11 @@ const createStructureSetupElements = t => {
let X = b ? B : contents([ q, j, Y, V, B ].find((t => false === elementIsGenerated(t)))); let X = b ? B : contents([ q, j, Y, V, B ].find((t => false === elementIsGenerated(t))));
const U = q || j; const U = q || j;
const appendElements = () => { const appendElements = () => {
const t = addDataAttrHost(V, T ? "viewport" : "host"); const t = addDataAttrHost(V, A ? "viewport" : "host");
const n = addClass(Y, I); const n = addClass(Y, I);
const o = addClass(j, !T && L); const o = addClass(j, !A && L);
const e = addClass(q, P); const e = addClass(q, P);
const c = m ? addClass(parent(p), D) : noop; const c = y ? addClass(parent(p), D) : noop;
if (N) { if (N) {
insertAfter(B, V); insertAfter(B, V);
push(G, (() => { push(G, (() => {
@@ -1331,13 +1331,13 @@ const createStructureSetupElements = t => {
} }
appendChildren(U, X); appendChildren(U, X);
appendChildren(V, Y); appendChildren(V, Y);
appendChildren(Y || V, !T && j); appendChildren(Y || V, !A && j);
appendChildren(j, q); appendChildren(j, q);
push(G, (() => { push(G, (() => {
c(); c();
t(); t();
removeAttr(j, O); removeAttr(j, O);
removeAttr(j, E); removeAttr(j, T);
if (elementIsGenerated(q)) { if (elementIsGenerated(q)) {
unwrap(q); unwrap(q);
} }
@@ -1351,7 +1351,7 @@ const createStructureSetupElements = t => {
o(); o();
e(); e();
})); }));
if (s && !T) { if (s && !A) {
push(G, removeClass.bind(0, j, D)); push(G, removeClass.bind(0, j, D));
} }
if (F) { if (F) {
@@ -1362,7 +1362,7 @@ const createStructureSetupElements = t => {
const t = attr(j, Ct); const t = attr(j, Ct);
attr(j, Ct, "-1"); attr(j, Ct, "-1");
j.focus(); j.focus();
const n = on(y, "pointerdown keydown", (() => { const n = on(m, "pointerdown keydown", (() => {
t ? attr(j, Ct, t) : removeAttr(j, Ct); t ? attr(j, Ct, t) : removeAttr(j, Ct);
n(); n();
})); }));
@@ -1403,16 +1403,16 @@ const createPaddingUpdateSegment = (t, n) => {
}, topRightBottomLeft.bind(0, e, "padding", "")); }, topRightBottomLeft.bind(0, e, "padding", ""));
return (t, n, e) => { return (t, n, e) => {
let [u, d] = a(e); let [u, d] = a(e);
const {T: f, V: _} = getEnvironment(); const {A: f, V: _} = getEnvironment();
const {vt: h} = o(); const {vt: h} = o();
const {ht: g, gt: v, wt: w} = t; const {ht: g, gt: v, wt: w} = t;
const [p, b] = n("paddingAbsolute"); const [p, b] = n("paddingAbsolute");
const y = !_ && v; const m = !_ && v;
if (g || d || y) { if (g || d || m) {
[u, d] = i(e); [u, d] = i(e);
} }
const m = !l && (b || w || d); const y = !l && (b || w || d);
if (m) { if (y) {
const t = !p || !c && !f; const t = !p || !c && !f;
const n = u.r + u.l; const n = u.r + u.l;
const o = u.t + u.b; const o = u.t + u.b;
@@ -1440,16 +1440,16 @@ const createPaddingUpdateSegment = (t, n) => {
}); });
} }
return { return {
yt: m yt: y
}; };
}; };
}; };
const {max: Et} = Math; const {max: Tt} = Math;
const At = Et.bind(0, 0); const Et = Tt.bind(0, 0);
const Tt = "visible"; const At = "visible";
const zt = "hidden"; const zt = "hidden";
@@ -1474,8 +1474,8 @@ const Ht = {
const getOverflowAmount = (t, n) => { const getOverflowAmount = (t, n) => {
const o = window.devicePixelRatio % 1 !== 0 ? 1 : 0; const o = window.devicePixelRatio % 1 !== 0 ? 1 : 0;
const s = { const s = {
w: At(t.w - n.w), w: Et(t.w - n.w),
h: At(t.h - n.h) h: Et(t.h - n.h)
}; };
return { return {
w: s.w > o ? s.w : 0, w: s.w > o ? s.w : 0,
@@ -1485,17 +1485,17 @@ const getOverflowAmount = (t, n) => {
const conditionalClass = (t, n, o) => o ? addClass(t, n) : removeClass(t, n); const conditionalClass = (t, n, o) => o ? addClass(t, n) : removeClass(t, n);
const overflowIsVisible = t => 0 === t.indexOf(Tt); const overflowIsVisible = t => 0 === t.indexOf(At);
const createOverflowUpdateSegment = (t, n) => { const createOverflowUpdateSegment = (t, n) => {
const [o, s] = n; const [o, s] = n;
const {J: e, Z: c, K: r, nt: l, it: i, dt: a, U: u, et: d} = t; const {J: e, Z: c, K: r, nt: l, it: i, dt: a, U: u, et: d} = t;
const {k: f, V: _, T: h, I: g} = getEnvironment(); const {k: f, V: _, A: h, I: g} = getEnvironment();
const v = getPlugins()[mt]; const v = getPlugins()[yt];
const w = !i && !h && (g.x || g.y); const w = !i && !h && (g.x || g.y);
const p = u && i; const p = u && i;
const [b, y] = createCache(Lt, fractionalSize.bind(0, r)); const [b, m] = createCache(Lt, fractionalSize.bind(0, r));
const [m, S] = createCache(Lt, scrollSize.bind(0, r)); const [y, S] = createCache(Lt, scrollSize.bind(0, r));
const [x, $] = createCache(Lt); const [x, $] = createCache(Lt);
const [z, I] = createCache(Lt); const [z, I] = createCache(Lt);
const [L] = createCache(Ht); const [L] = createCache(Ht);
@@ -1551,7 +1551,7 @@ const createOverflowUpdateSegment = (t, n) => {
const setViewportOverflowState = (t, n, o, s) => { const setViewportOverflowState = (t, n, o, s) => {
const setAxisOverflowStyle = (t, n) => { const setAxisOverflowStyle = (t, n) => {
const o = overflowIsVisible(t); const o = overflowIsVisible(t);
const s = n && o && t.replace(`${Tt}-`, "") || ""; const s = n && o && t.replace(`${At}-`, "") || "";
return [ n && !o ? t : "", overflowIsVisible(s) ? "hidden" : s ]; return [ n && !o ? t : "", overflowIsVisible(s) ? "hidden" : s ];
}; };
const [e, c] = setAxisOverflowStyle(o.x, n.x); const [e, c] = setAxisOverflowStyle(o.x, n.x);
@@ -1590,13 +1590,13 @@ const createOverflowUpdateSegment = (t, n) => {
const X = overflowIsVisible(q.x); const X = overflowIsVisible(q.x);
const U = overflowIsVisible(q.y); const U = overflowIsVisible(q.y);
const W = X || U; const W = X || U;
let J = y(l); let J = m(l);
let K = S(l); let K = S(l);
let Z = $(l); let Z = $(l);
let Q = I(l); let Q = I(l);
let tt; let tt;
if (j && h) { if (j && h) {
a(D, T, !G); a(D, A, !G);
} }
if (N) { if (N) {
tt = getViewportOverflowState(G); tt = getViewportOverflowState(G);
@@ -1604,11 +1604,11 @@ const createOverflowUpdateSegment = (t, n) => {
} }
if (u || w || v || k || j) { if (u || w || v || k || j) {
if (W) { if (W) {
a(M, A, false); a(M, E, false);
} }
const [t, n] = P(G, V, tt); const [t, n] = P(G, V, tt);
const [o, s] = J = b(l); const [o, s] = J = b(l);
const [e, c] = K = m(l); const [e, c] = K = y(l);
const i = clientSize(r); const i = clientSize(r);
let u = e; let u = e;
let f = i; let f = i;
@@ -1618,12 +1618,12 @@ const createOverflowUpdateSegment = (t, n) => {
u = scrollSize(r); u = scrollSize(r);
} }
const _ = { const _ = {
w: At(Et(e.w, u.w) + o.w), w: Et(Tt(e.w, u.w) + o.w),
h: At(Et(e.h, u.h) + o.h) h: Et(Tt(e.h, u.h) + o.h)
}; };
const h = { const h = {
w: At(p ? d.innerWidth : f.w + At(i.w - e.w) + o.w), w: Et(p ? d.innerWidth : f.w + Et(i.w - e.w) + o.w),
h: At(p ? d.innerHeight : f.h + At(i.h - e.h) + o.h) h: Et(p ? d.innerHeight : f.h + Et(i.h - e.h) + o.h)
}; };
Q = z(h); Q = z(h);
Z = x(getOverflowAmount(_, h), l); Z = x(getOverflowAmount(_, h), l);
@@ -1656,12 +1656,12 @@ const createOverflowUpdateSegment = (t, n) => {
} }
if (i) { if (i) {
attr(e, O, t.overflowX); attr(e, O, t.overflowX);
attr(e, E, t.overflowY); attr(e, T, t.overflowY);
} else { } else {
style(r, t); style(r, t);
} }
} }
attrClass(e, C, A, ut); attrClass(e, C, E, ut);
conditionalClass(c, M, ut); conditionalClass(c, M, ut);
!i && conditionalClass(r, M, W); !i && conditionalClass(r, M, W);
const [dt, ft] = L(getViewportOverflowState(G).xt); const [dt, ft] = L(getViewportOverflowState(G).xt);
@@ -1675,11 +1675,11 @@ const createOverflowUpdateSegment = (t, n) => {
x: st.w, x: st.w,
y: st.h y: st.h
}, },
Et: at Tt: at
}); });
return { return {
At: ft, Et: ft,
Tt: ot, At: ot,
zt: et zt: et
}; };
}; };
@@ -1699,7 +1699,7 @@ const prepareUpdateHints = (t, n, o) => {
const createStructureSetupUpdate = (t, n) => { const createStructureSetupUpdate = (t, n) => {
const {W: o, K: s, dt: e, it: c} = t; const {W: o, K: s, dt: e, it: c} = t;
const {T: r, I: l, V: i} = getEnvironment(); const {A: r, I: l, V: i} = getEnvironment();
const a = !r && (l.x || l.y); const a = !r && (l.x || l.y);
const u = [ createTrinsicUpdateSegment(t, n), createPaddingUpdateSegment(t, n), createOverflowUpdateSegment(t, n) ]; const u = [ createTrinsicUpdateSegment(t, n), createPaddingUpdateSegment(t, n), createOverflowUpdateSegment(t, n) ];
return (t, n, r) => { return (t, n, r) => {
@@ -1708,9 +1708,9 @@ const createStructureSetupUpdate = (t, n) => {
yt: false, yt: false,
wt: false, wt: false,
_t: false, _t: false,
Tt: false,
zt: false,
At: false, At: false,
zt: false,
Et: false,
$t: false, $t: false,
gt: false gt: false
}, n), {}, r); }, n), {}, r);
@@ -1956,21 +1956,21 @@ const createDOMObserver = (t, n, o, s) => {
const {attributeName: e, target: c, type: u, oldValue: d, addedNodes: h} = o; const {attributeName: e, target: c, type: u, oldValue: d, addedNodes: h} = o;
const p = "attributes" === u; const p = "attributes" === u;
const b = "childList" === u; const b = "childList" === u;
const y = t === c; const m = t === c;
const m = p && isString(e) ? attr(c, e) : 0; const y = p && isString(e) ? attr(c, e) : 0;
const S = 0 !== m && d !== m; const S = 0 !== y && d !== y;
const x = indexOf(v, e) > -1 && S; const x = indexOf(v, e) > -1 && S;
if (n && !y) { if (n && !m) {
const n = !p; const n = !p;
const i = p && x; const i = p && x;
const u = i && a && is(c, a); const u = i && a && is(c, a);
const _ = u ? !r(c, e, d, m) : n || i; const _ = u ? !r(c, e, d, y) : n || i;
const v = _ && !l(o, !!u, t, s); const v = _ && !l(o, !!u, t, s);
push(f, h); push(f, h);
g = g || v; g = g || v;
w = w || b; w = w || b;
} }
if (!n && y && S && !r(c, e, d, m)) { if (!n && m && S && !r(c, e, d, y)) {
push(i, e); push(i, e);
_ = _ || x; _ = _ || x;
} }
@@ -2039,17 +2039,17 @@ const createStructureSetupObservers = (t, n, o) => {
h: 0 h: 0
} }
}, (() => { }, (() => {
const t = _(M, A); const t = _(M, E);
const n = _(H, ""); const n = _(H, "");
const o = n && scrollLeft(i); const o = n && scrollLeft(i);
const s = n && scrollTop(i); const s = n && scrollTop(i);
h(M, A); h(M, E);
h(H, ""); h(H, "");
h("", z, true); h("", z, true);
const e = scrollSize(a); const e = scrollSize(a);
const c = scrollSize(i); const c = scrollSize(i);
const r = fractionalSize(i); const r = fractionalSize(i);
h(M, A, t); h(M, E, t);
h(H, "", n); h(H, "", n);
h("", z); h("", z);
scrollLeft(i, o); scrollLeft(i, o);
@@ -2132,7 +2132,7 @@ const createStructureSetupObservers = (t, n, o) => {
} }
return s; return s;
}; };
const [b, y, m] = a || !g ? createTrinsicObserver(l, onTrinsicChanged) : [ noop, noop, noop ]; const [b, m, y] = a || !g ? createTrinsicObserver(l, onTrinsicChanged) : [ noop, noop, noop ];
const [S, x] = !f ? createSizeObserver(l, onSizeChanged, { const [S, x] = !f ? createSizeObserver(l, onSizeChanged, {
Lt: true, Lt: true,
It: true It: true
@@ -2154,11 +2154,11 @@ const createStructureSetupObservers = (t, n, o) => {
$(); $();
}, () => { }, () => {
x(); x();
y(); m();
}, () => { }, () => {
const t = {}; const t = {};
const n = C(); const n = C();
const o = m(); const o = y();
const s = c && c[1](); const s = c && c[1]();
if (n) { if (n) {
assignDeep(t, onHostMutation.apply(0, push(n, true))); assignDeep(t, onHostMutation.apply(0, push(n, true)));
@@ -2240,7 +2240,7 @@ const Yt = {
x: "hidden", x: "hidden",
y: "hidden" y: "hidden"
}, },
Et: { Tt: {
x: false, x: false,
y: false y: false
}, },
@@ -2289,12 +2289,26 @@ const createStructureSetup = (t, n) => {
} ]; } ];
}; };
const {round: jt} = Math; const {round: jt, max: qt, sign: Ft} = Math;
const getClientOffset = t => ({ const animationCurrentTime = () => performance.now();
x: t.clientX,
y: t.clientY const animateNumber = (t, n, o, s) => {
}); let e = 0;
const c = animationCurrentTime();
const frame = () => {
const r = animationCurrentTime();
const l = r - c;
const i = l >= o;
const a = 1 - (qt(0, c + o - r) / o || 0);
const u = (n - t) * a + t;
const d = i || 1 === a;
s(u, d);
e = d ? 0 : f(frame);
};
frame();
return () => d(e);
};
const getScale = t => { const getScale = t => {
const {width: n, height: o} = getBoundingClientRect(t); const {width: n, height: o} = getBoundingClientRect(t);
@@ -2309,7 +2323,7 @@ const continuePointerDown = (t, n, o) => {
const s = n.scrollbars; const s = n.scrollbars;
const {button: e, isPrimary: c, pointerType: r} = t; const {button: e, isPrimary: c, pointerType: r} = t;
const {pointers: l} = s; const {pointers: l} = s;
return 0 === e && c && s[o] && (l || []).includes(r); return 0 === e && c && s[o ? "dragScroll" : "clickScroll"] && (l || []).includes(r);
}; };
const createRootClickStopPropagationEvents = (t, n) => on(t, "mousedown", on.bind(0, n, "click", stopPropagation, { const createRootClickStopPropagationEvents = (t, n) => on(t, "mousedown", on.bind(0, n, "click", stopPropagation, {
@@ -2319,36 +2333,79 @@ const createRootClickStopPropagationEvents = (t, n) => on(t, "mousedown", on.bin
$: true $: true
}); });
const createDragScrollingEvents = (t, n, o, s, e, c) => { const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
const {B: r} = getEnvironment(); const {B: r} = getEnvironment();
const {qt: l, Ft: i, Gt: a} = o; const {qt: l, Ft: i, Gt: a} = o;
const u = `scroll${c ? "Left" : "Top"}`; const u = `scroll${c ? "Left" : "Top"}`;
const d = `${c ? "x" : "y"}`; const d = c ? "width" : "height";
const f = `${c ? "w" : "h"}`; const f = c ? "w" : "h";
const createOnPointerMoveHandler = (t, n, o) => _ => { const _ = c ? "x" : "y";
const {Ot: h} = e(); const getHandleOffset = (t, n) => t[_] - n[_];
const g = (getClientOffset(_)[d] - n) * o; const createRelativeHandleMove = (t, n) => o => {
const v = offsetSize(i)[f] - offsetSize(l)[f]; const {Ot: d} = e();
const w = g / v; const h = offsetSize(i)[f] - offsetSize(l)[f];
const p = w * h[d]; const g = n * o / h;
const b = directionIsRTL(a); const v = g * d[_];
const y = b && c ? r.n || r.i ? 1 : -1 : 1; const w = directionIsRTL(a);
s[u] = t + p * y; const p = w && c ? r.n || r.i ? 1 : -1 : 1;
s[u] = t + v * p;
}; };
return on(l, "pointerdown", (o => { return on(i, "pointerdown", (o => {
if (continuePointerDown(o, t, "dragScroll")) { const e = closest(o.target, `.${W}`) === l;
const t = on(n, "selectstart", (t => preventDefault(t)), { if (continuePointerDown(o, t, e)) {
const t = !e && o.shiftKey;
const c = createRelativeHandleMove(s[u] || 0, 1 / getScale(s)[_]);
const r = o[_];
const a = getBoundingClientRect(l);
const f = getBoundingClientRect(i);
const h = a[d];
const g = getHandleOffset(a, f) + h / 2;
const v = r - f[_];
const w = e ? 0 : v - g;
const p = [ on(n, "selectstart", (t => preventDefault(t)), {
S: false S: false
}); }), on(i, "pointermove", (n => {
const e = on(l, "pointermove", createOnPointerMoveHandler(s[u] || 0, getClientOffset(o)[d], 1 / getScale(s)[d])); const o = n[_] - r;
on(l, "pointerup", (n => { if (e || t) {
t(); c(w + o);
e(); }
l.releasePointerCapture(n.pointerId); })) ];
if (t) {
c(w);
} else if (!e) {
let t = 0;
let n = noop;
const animateClickScroll = o => {
n = animateNumber(o, o + h * Ft(w), 133, ((o, s) => {
c(o);
const e = getHandleOffset(getBoundingClientRect(l), f);
const r = e + h;
const i = v >= e && v <= r;
if (s && !i) {
if (t) {
animateClickScroll(o);
} else {
const t = setTimeout((() => {
animateClickScroll(o);
}), 222);
n = () => {
clearTimeout(t);
};
}
t++;
}
}));
};
animateClickScroll(0);
push(p, (() => n()));
}
on(i, "pointerup", (t => {
runEachAndClear(p);
i.releasePointerCapture(t.pointerId);
}), { }), {
C: true C: true
}); });
l.setPointerCapture(o.pointerId); i.setPointerCapture(o.pointerId);
} }
})); }));
}; };
@@ -2381,10 +2438,10 @@ const createScrollbarsSetupEvents = (t, n) => (o, s, e, c, r, l) => {
}), { }), {
S: false, S: false,
$: true $: true
}), createRootClickStopPropagationEvents(i, e), createDragScrollingEvents(t, e, o, r, n, l), u ]); }), createRootClickStopPropagationEvents(i, e), createInteractiveScrollEvents(t, e, o, r, n, l), u ]);
}; };
const {min: qt, max: Ft, abs: Gt, round: Nt} = Math; const {min: Gt, max: Nt, abs: Xt, round: Ut} = Math;
const getScrollbarHandleLengthRatio = (t, n, o, s) => { const getScrollbarHandleLengthRatio = (t, n, o, s) => {
if (s) { if (s) {
@@ -2392,12 +2449,12 @@ const getScrollbarHandleLengthRatio = (t, n, o, s) => {
const {Ot: n, Ct: e} = s; const {Ot: n, Ct: e} = s;
const c = e[t]; const c = e[t];
const r = n[t]; const r = n[t];
return Ft(0, qt(1, c / (c + r))); return Nt(0, Gt(1, c / (c + r)));
} }
const e = o ? "w" : "h"; const e = o ? "w" : "h";
const c = offsetSize(t)[e]; const c = offsetSize(t)[e];
const r = offsetSize(n)[e]; const r = offsetSize(n)[e];
return Ft(0, qt(1, c / r)); return Nt(0, Gt(1, c / r));
}; };
const getScrollbarHandleOffsetRatio = (t, n, o, s, e, c) => { const getScrollbarHandleOffsetRatio = (t, n, o, s, e, c) => {
@@ -2405,12 +2462,12 @@ const getScrollbarHandleOffsetRatio = (t, n, o, s, e, c) => {
const l = c ? "x" : "y"; const l = c ? "x" : "y";
const i = c ? "Left" : "Top"; const i = c ? "Left" : "Top";
const {Ot: a} = s; const {Ot: a} = s;
const u = Nt(a[l]); const u = Ut(a[l]);
const d = Gt(o[`scroll${i}`]); const d = Xt(o[`scroll${i}`]);
const f = c && e; const f = c && e;
const _ = r.i ? d : u - d; const _ = r.i ? d : u - d;
const h = f ? _ : d; const h = f ? _ : d;
const g = qt(1, h / u); const g = Gt(1, h / u);
const v = getScrollbarHandleLengthRatio(t, n, c); const v = getScrollbarHandleLengthRatio(t, n, c);
return 1 / v * (1 - v) * g; return 1 / v * (1 - v) * g;
}; };
@@ -2491,7 +2548,7 @@ const createScrollbarsSetupElements = (t, n, o) => {
return u; return u;
}; };
const b = generateScrollbarDOM.bind(0, true); const b = generateScrollbarDOM.bind(0, true);
const y = generateScrollbarDOM.bind(0, false); const m = generateScrollbarDOM.bind(0, false);
const appendElements = () => { const appendElements = () => {
appendChildren(g, w[0].Gt); appendChildren(g, w[0].Gt);
appendChildren(g, p[0].Gt); appendChildren(g, p[0].Gt);
@@ -2500,7 +2557,7 @@ const createScrollbarsSetupElements = (t, n, o) => {
}), 300); }), 300);
}; };
b(); b();
y(); m();
return [ { return [ {
Nt: refreshScrollbarsHandleLength, Nt: refreshScrollbarsHandleLength,
Xt: refreshScrollbarsHandleOffset, Xt: refreshScrollbarsHandleOffset,
@@ -2512,7 +2569,7 @@ const createScrollbarsSetupElements = (t, n, o) => {
}, },
Qt: { Qt: {
Jt: p, Jt: p,
Kt: y, Kt: m,
Zt: scrollbarsHandleStyle.bind(0, p) Zt: scrollbarsHandleStyle.bind(0, p)
} }
}, appendElements, runEachAndClear.bind(0, v) ]; }, appendElements, runEachAndClear.bind(0, v) ];
@@ -2531,21 +2588,21 @@ const createScrollbarsSetup = (t, n, o) => {
const [_, h] = selfCancelTimeout(); const [_, h] = selfCancelTimeout();
const [g, v] = selfCancelTimeout(100); const [g, v] = selfCancelTimeout(100);
const [w, p] = selfCancelTimeout(100); const [w, p] = selfCancelTimeout(100);
const [b, y] = selfCancelTimeout((() => i)); const [b, m] = selfCancelTimeout((() => i));
const [m, S, x] = createScrollbarsSetupElements(t, o.jt, createScrollbarsSetupEvents(n, o)); const [y, S, x] = createScrollbarsSetupElements(t, o.jt, createScrollbarsSetupEvents(n, o));
const {J: $, K: C, ot: O, st: E, it: A, U: T} = o.jt; const {J: $, K: C, ot: O, st: T, it: E, U: A} = o.jt;
const {Wt: z, Qt: I, Ut: L, Nt: H, Xt: P} = m; const {Wt: z, Qt: I, Ut: L, Nt: H, Xt: P} = y;
const {Zt: D} = z; const {Zt: D} = z;
const {Zt: M} = I; const {Zt: M} = I;
const styleScrollbarPosition = t => { const styleScrollbarPosition = t => {
const {Gt: n} = t; const {Gt: n} = t;
const o = A && !T && parent(n) === C && n; const o = E && !A && parent(n) === C && n;
return [ o, { return [ o, {
transform: o ? `translate(${scrollLeft(O)}px, ${scrollTop(O)}px)` : "" transform: o ? `translate(${scrollLeft(O)}px, ${scrollTop(O)}px)` : ""
} ]; } ];
}; };
const manageScrollbarsAutoHide = (t, n) => { const manageScrollbarsAutoHide = (t, n) => {
y(); m();
if (t) { if (t) {
L(nt); L(nt);
} else { } else {
@@ -2561,7 +2618,7 @@ const createScrollbarsSetup = (t, n, o) => {
r = e; r = e;
r && manageScrollbarsAutoHide(true); r && manageScrollbarsAutoHide(true);
}; };
const R = [ v, y, p, h, f, x, on($, "pointerover", onHostMouseEnter, { const R = [ v, m, p, h, f, x, on($, "pointerover", onHostMouseEnter, {
C: true C: true
}), on($, "pointerenter", onHostMouseEnter), on($, "pointerleave", (() => { }), on($, "pointerenter", onHostMouseEnter), on($, "pointerleave", (() => {
r = false; r = false;
@@ -2574,7 +2631,7 @@ const createScrollbarsSetup = (t, n, o) => {
s && manageScrollbarsAutoHide(false); s && manageScrollbarsAutoHide(false);
})); }));
})); }));
})), on(E, "scroll", (() => { })), on(T, "scroll", (() => {
_((() => { _((() => {
P(o()); P(o());
c && manageScrollbarsAutoHide(true); c && manageScrollbarsAutoHide(true);
@@ -2582,32 +2639,32 @@ const createScrollbarsSetup = (t, n, o) => {
c && !r && manageScrollbarsAutoHide(false); c && !r && manageScrollbarsAutoHide(false);
})); }));
})); }));
A && D(styleScrollbarPosition); E && D(styleScrollbarPosition);
A && M(styleScrollbarPosition); E && M(styleScrollbarPosition);
})) ]; })) ];
const k = u.bind(0); const k = u.bind(0);
k.jt = m; k.jt = y;
k.Yt = S; k.Yt = S;
return [ (t, r, a) => { return [ (t, r, a) => {
const {Tt: u, zt: d, At: f, wt: _} = a; const {At: u, zt: d, Et: f, wt: _} = a;
const h = createOptionCheck(n, t, r); const h = createOptionCheck(n, t, r);
const g = o(); const g = o();
const {Ot: v, xt: w, vt: p} = g; const {Ot: v, xt: w, vt: p} = g;
const [b, y] = h("scrollbars.theme"); const [b, m] = h("scrollbars.theme");
const [m, S] = h("scrollbars.visibility"); const [y, S] = h("scrollbars.visibility");
const [x, $] = h("scrollbars.autoHide"); const [x, $] = h("scrollbars.autoHide");
const [C] = h("scrollbars.autoHideDelay"); const [C] = h("scrollbars.autoHideDelay");
const [O, E] = h("scrollbars.dragScroll"); const [O, T] = h("scrollbars.dragScroll");
const [A, z] = h("scrollbars.clickScroll"); const [E, z] = h("scrollbars.clickScroll");
const I = u || d || _ || r; const I = u || d || _ || r;
const D = f || S || r; const D = f || S || r;
const setScrollbarVisibility = (t, n) => { const setScrollbarVisibility = (t, n) => {
const o = "visible" === m || "auto" === m && "scroll" === t; const o = "visible" === y || "auto" === y && "scroll" === t;
L(J, o, n); L(J, o, n);
return o; return o;
}; };
i = C; i = C;
if (y) { if (m) {
L(l); L(l);
L(b, true); L(b, true);
l = b; l = b;
@@ -2618,11 +2675,11 @@ const createScrollbarsSetup = (t, n, o) => {
c = "never" !== x; c = "never" !== x;
manageScrollbarsAutoHide(!c, true); manageScrollbarsAutoHide(!c, true);
} }
if (E) { if (T) {
L(et, O); L(et, O);
} }
if (z) { if (z) {
L(st, A); L(st, E);
} }
if (D) { if (D) {
const t = setScrollbarVisibility(w.x, true); const t = setScrollbarVisibility(w.x, true);
@@ -2635,7 +2692,7 @@ const createScrollbarsSetup = (t, n, o) => {
P(g); P(g);
L(tt, !v.x, true); L(tt, !v.x, true);
L(tt, !v.y, false); L(tt, !v.y, false);
L(G, p && !T); L(G, p && !A);
} }
}, k, runEachAndClear.bind(0, R) ]; }, k, runEachAndClear.bind(0, R) ];
}; };
@@ -2661,17 +2718,17 @@ const OverlayScrollbars = (t, n, o) => {
const update = (t, n) => { const update = (t, n) => {
h(t, !!n); h(t, !!n);
}; };
const y = e(update.bind(0, {}, true)); const m = e(update.bind(0, {}, true));
const destroy = t => { const destroy = t => {
removeInstance(l); removeInstance(l);
y(); m();
b(); b();
v(); v();
i = true; i = true;
_("destroyed", [ m, !!t ]); _("destroyed", [ y, !!t ]);
f(); f();
}; };
const m = { const y = {
options(t) { options(t) {
if (t) { if (t) {
const n = getOptionsDiff(u, validateOptions(t)); const n = getOptionsDiff(u, validateOptions(t));
@@ -2687,7 +2744,7 @@ const OverlayScrollbars = (t, n, o) => {
t && n && f(t, n); t && n && f(t, n);
}, },
state() { state() {
const {Ct: t, Ot: n, xt: o, Et: s, Z: e, bt: c, vt: r} = g(); const {Ct: t, Ot: n, xt: o, Tt: s, Z: e, bt: c, vt: r} = g();
return assignDeep({}, { return assignDeep({}, {
overflowEdge: t, overflowEdge: t,
overflowAmount: n, overflowAmount: n,
@@ -2735,7 +2792,7 @@ const OverlayScrollbars = (t, n, o) => {
}, },
update(t) { update(t) {
update({}, t); update({}, t);
return m; return y;
}, },
destroy: destroy.bind(0) destroy: destroy.bind(0)
}; };
@@ -2745,20 +2802,20 @@ const OverlayScrollbars = (t, n, o) => {
each(keys(c), (t => { each(keys(c), (t => {
const n = c[t]; const n = c[t];
if (isFunction(n)) { if (isFunction(n)) {
n(OverlayScrollbars, m); n(OverlayScrollbars, y);
} }
})); }));
if (cancelInitialization(!r && t.cancel, g.jt)) { if (cancelInitialization(!r && t.cancel, g.jt)) {
destroy(true); destroy(true);
return m; return y;
} }
g.Yt(); g.Yt();
p.Yt(); p.Yt();
addInstance(l, m); addInstance(l, y);
_("initialized", [ m ]); _("initialized", [ y ]);
g.Vt(((t, n, o) => { g.Vt(((t, n, o) => {
const {ht: s, wt: e, _t: c, Tt: r, zt: l, At: i, gt: a, $t: u} = t; const {ht: s, wt: e, _t: c, At: r, zt: l, Et: i, gt: a, $t: u} = t;
_("updated", [ m, { _("updated", [ y, {
updateHints: { updateHints: {
sizeChanged: s, sizeChanged: s,
directionChanged: e, directionChanged: e,
@@ -2773,7 +2830,7 @@ const OverlayScrollbars = (t, n, o) => {
force: o force: o
} ]); } ]);
})); }));
return m.update(true); return y.update(true);
} }
return i; return i;
}; };
@@ -2787,7 +2844,7 @@ OverlayScrollbars.valid = t => {
}; };
OverlayScrollbars.env = () => { OverlayScrollbars.env = () => {
const {k: t, I: n, T: o, B: s, V: e, L: c, N: r, X: l, j: i, q: a, F: u, G: d} = getEnvironment(); const {k: t, I: n, A: o, B: s, V: e, L: c, N: r, X: l, j: i, q: a, F: u, G: d} = getEnvironment();
return assignDeep({}, { return assignDeep({}, {
scrollbarsSize: t, scrollbarsSize: t,
scrollbarsOverlaid: n, scrollbarsOverlaid: n,
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -391,12 +391,14 @@ body > .os-scrollbar {
opacity: 0 !important; opacity: 0 !important;
} }
.os-scrollbar.os-scrollbar-horizontal.os-scrollbar-cornerless { .os-scrollbar.os-scrollbar-horizontal.os-scrollbar-cornerless,
.os-scrollbar.os-scrollbar-horizontal.os-scrollbar-cornerless.os-scrollbar-rtl {
left: 0; left: 0;
right: 0; right: 0;
} }
.os-scrollbar.os-scrollbar-vertical.os-scrollbar-cornerless { .os-scrollbar.os-scrollbar-vertical.os-scrollbar-cornerless,
.os-scrollbar.os-scrollbar-vertical.os-scrollbar-cornerless.os-scrollbar-rtl {
top: 0; top: 0;
bottom: 0; bottom: 0;
} }
@@ -1 +1 @@
{"version":3,"sources":["../stdin","../../src/styles/sizeobserver.scss","../overlayscrollbars.css","../../src/styles/trinsicobserver.scss","../../src/styles/structure.scss","../../src/styles/scrollbars.scss"],"names":[],"mappings":"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","file":"overlayscrollbars.css"} {"version":3,"sources":["../stdin","../../src/styles/sizeobserver.scss","../overlayscrollbars.css","../../src/styles/trinsicobserver.scss","../../src/styles/structure.scss","../../src/styles/scrollbars.scss"],"names":[],"mappings":"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","file":"overlayscrollbars.css"}
File diff suppressed because one or more lines are too long