This commit is contained in:
Rene Haas
2022-08-11 02:08:25 +02:00
parent 0b65f2aadf
commit 8a62dbf622
12 changed files with 828 additions and 820 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
@@ -638,9 +638,9 @@ const OverlayScrollbars = function(t) {
}));
return o;
};
const x = "os-environment";
const $ = `${x}-flexbox-glue`;
const C = `${$}-max`;
const $ = "os-environment";
const x = `${$}-flexbox-glue`;
const C = `${x}-max`;
const O = "data-overlayscrollbars";
const T = `${O}-overflow-x`;
const E = `${O}-overflow-y`;
@@ -656,9 +656,9 @@ const OverlayScrollbars = function(t) {
const k = "os-size-observer";
const B = `${k}-appear`;
const V = `${k}-listener`;
const j = `${V}-scroll`;
const Y = `${V}-item`;
const q = `${Y}-final`;
const Y = `${V}-scroll`;
const j = `${V}-item`;
const q = `${j}-final`;
const F = "os-trinsic-observer";
const G = "os-scrollbar";
const N = `${G}-rtl`;
@@ -728,9 +728,9 @@ const OverlayScrollbars = function(t) {
const pt = /* @__PURE__ */ (() => ({
[wt]: {
O: (t, n, o) => {
const s = createDOM(`<div class="${Y}" dir="ltr"><div class="${Y}"><div class="${q}"></div></div><div class="${Y}"><div class="${q}" style="width: 200%; height: 200%"></div></div></div>`);
const s = createDOM(`<div class="${j}" dir="ltr"><div class="${j}"><div class="${q}"></div></div><div class="${j}"><div class="${q}" style="width: 200%; height: 200%"></div></div></div>`);
appendChildren(t, s);
addClass(t, j);
addClass(t, Y);
const e = s[0];
const c = e.lastChild;
const r = e.firstChild;
@@ -789,7 +789,7 @@ const OverlayScrollbars = function(t) {
return !(o === s || o + 1 === s || o - 1 === s);
};
const St = "__osScrollbarsHidingPlugin";
const xt = /* @__PURE__ */ (() => ({
const $t = /* @__PURE__ */ (() => ({
[St]: {
T: t => {
const {A: n, I: o, L: s} = t;
@@ -912,7 +912,7 @@ const OverlayScrollbars = function(t) {
}
}
}))();
let $t;
let xt;
const getNativeScrollbarSize = (t, n, o, s) => {
appendChildren(t, n);
const e = clientSize(n);
@@ -951,7 +951,7 @@ const OverlayScrollbars = function(t) {
};
};
const getFlexboxGlue = (t, n) => {
const o = addClass(t, $);
const o = addClass(t, x);
const s = getBoundingClientRect(t);
const e = getBoundingClientRect(n);
const c = equalBCRWH(e, s, true);
@@ -965,7 +965,7 @@ const OverlayScrollbars = function(t) {
};
const createEnvironment = () => {
const {body: t} = document;
const n = createDOM(`<div class="${x}"><div></div></div>`);
const n = createDOM(`<div class="${$}"><div></div></div>`);
const o = n[0];
const s = o.firstChild;
const [e, , c] = createEventListenerHub();
@@ -1002,8 +1002,8 @@ const OverlayScrollbars = function(t) {
L: "-1" === style(o, "zIndex"),
B: getRtlScrollBehavior(o, s),
V: getFlexboxGlue(o, s),
j: t => e("_", t),
Y: assignDeep.bind(0, {}, d),
Y: t => e("_", t),
j: assignDeep.bind(0, {}, d),
q(t) {
assignDeep(d, t);
},
@@ -1027,10 +1027,10 @@ const OverlayScrollbars = function(t) {
return _;
};
const getEnvironment = () => {
if (!$t) {
$t = createEnvironment();
if (!xt) {
xt = createEnvironment();
}
return $t;
return xt;
};
const resolveInitialization = (t, n) => isFunction(t) ? t.apply(0, n) : t;
const staticInitializationElement = (t, n, o, s) => {
@@ -1046,7 +1046,7 @@ const OverlayScrollbars = function(t) {
const cancelInitialization = (t, n) => {
const {nativeScrollbarsOverlaid: o, body: s} = t || {};
const {U: e} = n;
const {Y: c, I: r, A: l} = getEnvironment();
const {j: c, I: r, A: l} = getEnvironment();
const {nativeScrollbarsOverlaid: i, body: a} = c().cancel;
const u = null != o ? o : i;
const d = isUndefined(s) ? a : s;
@@ -1082,7 +1082,7 @@ const OverlayScrollbars = function(t) {
};
const createStructureSetupElements = t => {
const n = getEnvironment();
const {Y: o, A: s} = n;
const {j: o, A: s} = n;
const e = getPlugins()[St];
const c = e && e.T;
const {elements: r} = o();
@@ -1096,19 +1096,19 @@ const OverlayScrollbars = function(t) {
const m = p.ownerDocument;
const y = p === m.body;
const S = m.defaultView;
const x = staticInitializationElement.bind(0, [ p ]);
const $ = dynamicInitializationElement.bind(0, [ p ]);
const C = x(Tt, i, v);
const $ = staticInitializationElement.bind(0, [ p ]);
const x = dynamicInitializationElement.bind(0, [ p ]);
const C = $(Tt, i, v);
const A = C === p;
const z = A && y;
const I = m.activeElement;
const M = !A && S.top === S && I === p;
const R = {
W: p,
J: b ? x(Tt, l, h) : p,
J: b ? $(Tt, l, h) : p,
K: C,
Z: !A && $(Tt, a, g),
tt: !A && $(Tt, u, w),
Z: !A && x(Tt, a, g),
tt: !A && x(Tt, u, w),
nt: !A && !s && c && c(n),
ot: z ? m.documentElement : C,
st: z ? m : C,
@@ -1126,15 +1126,15 @@ const OverlayScrollbars = function(t) {
return push(t, o && !parent(o) ? o : false);
}), []);
const elementIsGenerated = t => t ? indexOf(k, t) > -1 : null;
const {W: B, J: V, Z: j, K: Y, tt: q, nt: F} = R;
const {W: B, J: V, Z: Y, K: j, tt: q, nt: F} = R;
const G = [];
const N = b && elementIsGenerated(V);
let X = b ? B : contents([ q, Y, j, V, B ].find((t => false === elementIsGenerated(t))));
const U = q || Y;
let X = b ? B : contents([ q, j, Y, V, B ].find((t => false === elementIsGenerated(t))));
const U = q || j;
const appendElements = () => {
const t = addDataAttrHost(V, A ? "viewport" : "host");
const n = addClass(j, L);
const o = addClass(Y, !A && H);
const n = addClass(Y, L);
const o = addClass(j, !A && H);
const e = addClass(q, P);
const c = y ? addClass(parent(p), D) : noop;
if (N) {
@@ -1145,40 +1145,40 @@ const OverlayScrollbars = function(t) {
}));
}
appendChildren(U, X);
appendChildren(V, j);
appendChildren(j || V, !A && Y);
appendChildren(Y, q);
appendChildren(V, Y);
appendChildren(Y || V, !A && j);
appendChildren(j, q);
push(G, (() => {
c();
t();
removeAttr(Y, T);
removeAttr(Y, E);
removeAttr(j, T);
removeAttr(j, E);
if (elementIsGenerated(q)) {
unwrap(q);
}
if (elementIsGenerated(Y)) {
unwrap(Y);
}
if (elementIsGenerated(j)) {
unwrap(j);
}
if (elementIsGenerated(Y)) {
unwrap(Y);
}
n();
o();
e();
}));
if (s && !A) {
push(G, removeClass.bind(0, Y, D));
push(G, removeClass.bind(0, j, D));
}
if (F) {
insertBefore(Y, F);
insertBefore(j, F);
push(G, removeElements.bind(0, F));
}
if (M) {
const t = attr(Y, Ot);
attr(Y, Ot, "-1");
Y.focus();
const t = attr(j, Ot);
attr(j, Ot, "-1");
j.focus();
const n = on(m, "pointerdown keydown", (() => {
t ? attr(Y, Ot, t) : removeAttr(Y, Ot);
t ? attr(j, Ot, t) : removeAttr(j, Ot);
n();
}));
} else if (I && I.focus) {
@@ -1298,7 +1298,7 @@ const OverlayScrollbars = function(t) {
const p = u && i;
const [b, m] = createCache(Ht, fractionalSize.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 [L] = createCache(Mt);
const fixFlexboxGlue = (t, n) => {
@@ -1332,7 +1332,7 @@ const OverlayScrollbars = function(t) {
const [s, e, c, l] = getStatePerAxis("overflowX", g.x, f.x);
const [i, a, u, d] = getStatePerAxis("overflowY", g.y, f.y);
return {
xt: {
$t: {
x: s,
y: i
},
@@ -1383,28 +1383,28 @@ const OverlayScrollbars = function(t) {
};
const [H, M] = v ? v.H(w, _, r, l, o, getViewportOverflowState, hideNativeScrollbars) : [ () => w, () => [ noop ] ];
return (t, n, l) => {
const {ht: u, $t: f, gt: v, yt: w, _t: P, wt: k} = t;
const {ht: u, xt: f, gt: v, yt: w, _t: P, wt: k} = t;
const {ft: B, vt: V} = o();
const [j, Y] = n("showNativeOverlaidScrollbars");
const [Y, j] = n("showNativeOverlaidScrollbars");
const [q, F] = n("overflow");
const G = j && g.x && g.y;
const N = !i && !_ && (u || v || f || Y || P);
const G = Y && g.x && g.y;
const N = !i && !_ && (u || v || f || j || P);
const X = overflowIsVisible(q.x);
const U = overflowIsVisible(q.y);
const W = X || U;
let J = m(l);
let K = S(l);
let Z = $(l);
let Z = x(l);
let Q = I(l);
let tt;
if (Y && h) {
if (j && h) {
a(D, z, !G);
}
if (N) {
tt = getViewportOverflowState(G);
fixFlexboxGlue(tt, B);
}
if (u || w || v || k || Y) {
if (u || w || v || k || j) {
if (W) {
a(R, A, false);
}
@@ -1415,7 +1415,7 @@ const OverlayScrollbars = function(t) {
let u = e;
let f = i;
t();
if ((c || s || Y) && n && !G && H(n, e, o, V)) {
if ((c || s || j) && n && !G && H(n, e, o, V)) {
f = clientSize(r);
u = scrollSize(r);
}
@@ -1428,7 +1428,7 @@ const OverlayScrollbars = function(t) {
h: At(p ? d.innerHeight : f.h + At(i.h - e.h) + o.h)
};
Q = C(h);
Z = x(getOverflowAmount(_, h), l);
Z = $(getOverflowAmount(_, h), l);
}
const [nt, ot] = Q;
const [st, et] = Z;
@@ -1439,7 +1439,7 @@ const OverlayScrollbars = function(t) {
y: st.h > 0
};
const ut = X && U && (at.x || at.y) || X && at.x && !at.y || U && at.y && !at.x;
if (w || k || it || rt || ot || et || F || Y || N) {
if (w || k || it || rt || ot || et || F || j || N) {
const t = {
marginRight: 0,
marginBottom: 0,
@@ -1466,9 +1466,9 @@ const OverlayScrollbars = function(t) {
attrClass(e, O, A, ut);
conditionalClass(c, R, ut);
!i && conditionalClass(r, R, W);
const [dt, ft] = L(getViewportOverflowState(G).xt);
const [dt, ft] = L(getViewportOverflowState(G).$t);
s({
xt: dt,
$t: dt,
Ct: {
x: nt.w,
y: nt.h
@@ -1511,7 +1511,7 @@ const OverlayScrollbars = function(t) {
At: false,
zt: false,
Et: false,
$t: false,
xt: false,
gt: false
}, n), {}, r);
const d = a || !i;
@@ -1752,10 +1752,10 @@ const OverlayScrollbars = function(t) {
const m = t === c;
const y = p && isString(e) ? attr(c, e) : 0;
const S = 0 !== y && d !== y;
const x = indexOf(v, e) > -1 && S;
const $ = indexOf(v, e) > -1 && S;
if (n && !m) {
const n = !p;
const a = p && x;
const a = p && $;
const u = a && i && is(c, i);
const _ = u ? !r(c, e, d, y) : n || a;
const v = _ && !l(o, !!u, t, s);
@@ -1765,7 +1765,7 @@ const OverlayScrollbars = function(t) {
}
if (!n && m && S && !r(c, e, d, y)) {
push(a, e);
_ = _ || x;
_ = _ || $;
}
}));
if (w && !isEmptyArray(f)) {
@@ -1910,7 +1910,7 @@ const OverlayScrollbars = function(t) {
};
const onHostMutation = (t, n, o) => {
const s = {
$t: n
xt: n
};
if (n) {
!o && p(s);
@@ -1920,11 +1920,11 @@ const OverlayScrollbars = function(t) {
return s;
};
const [b, m, y] = a || !g ? createTrinsicObserver(l, onTrinsicChanged) : [ noop, noop, noop ];
const [S, x] = !f ? createSizeObserver(l, onSizeChanged, {
const [S, $] = !f ? createSizeObserver(l, onSizeChanged, {
Lt: true,
It: true
}) : [ noop, noop ];
const [$, C] = createDOMObserver(l, false, onHostMutation, {
const [x, C] = createDOMObserver(l, false, onHostMutation, {
Pt: Vt,
Mt: Vt.concat(kt)
});
@@ -1938,9 +1938,9 @@ const OverlayScrollbars = function(t) {
S();
c && c[0]();
O && O.disconnect();
$();
}, () => {
x();
}, () => {
$();
m();
}, () => {
const t = {};
@@ -1998,11 +1998,11 @@ const OverlayScrollbars = function(t) {
}
} ];
};
const jt = {
const Yt = {
x: 0,
y: 0
};
const Yt = {
const jt = {
Z: {
t: 0,
r: 0,
@@ -2019,9 +2019,9 @@ const OverlayScrollbars = function(t) {
paddingBottom: 0,
paddingLeft: 0
},
Ct: jt,
Ot: jt,
xt: {
Ct: Yt,
Ot: Yt,
$t: {
x: "hidden",
y: "hidden"
},
@@ -2034,7 +2034,7 @@ const OverlayScrollbars = function(t) {
};
const createStructureSetup = (t, n) => {
const o = createOptionCheck(n, {});
const s = createState(Yt);
const s = createState(jt);
const [e, c, r] = createEventListenerHub();
const [l] = s;
const [i, a, u] = createStructureSetupElements(t);
@@ -2052,7 +2052,7 @@ const OverlayScrollbars = function(t) {
v.Vt = t => {
e("u", t);
};
v.jt = () => {
v.Yt = () => {
const {W: t, K: n} = i;
const o = scrollLeft(t);
const s = scrollTop(t);
@@ -2061,7 +2061,7 @@ const OverlayScrollbars = function(t) {
scrollLeft(n, o);
scrollTop(n, s);
};
v.Yt = i;
v.jt = i;
return [ (t, o) => {
const s = createOptionCheck(n, t, o);
g(s);
@@ -2114,15 +2114,17 @@ const OverlayScrollbars = function(t) {
const {B: r} = getEnvironment();
const {qt: l, Ft: i, Gt: a} = o;
const u = `scroll${c ? "Left" : "Top"}`;
const d = c ? "width" : "height";
const f = c ? "w" : "h";
const _ = c ? "x" : "y";
const d = `client${c ? "X" : "Y"}`;
const f = c ? "width" : "height";
const _ = c ? "left" : "top";
const h = c ? "w" : "h";
const g = c ? "x" : "y";
const getHandleOffset = (t, n) => t[_] - n[_];
const createRelativeHandleMove = (t, n) => o => {
const {Ot: d} = e();
const h = offsetSize(i)[f] - offsetSize(l)[f];
const g = n * o / h;
const v = g * d[_];
const f = offsetSize(i)[h] - offsetSize(l)[h];
const _ = n * o / f;
const v = _ * d[g];
const w = directionIsRTL(a);
const p = w && c ? r.n || r.i ? 1 : -1 : 1;
s[u] = t + v * p;
@@ -2131,33 +2133,33 @@ const OverlayScrollbars = function(t) {
const e = closest(o.target, `.${J}`) === l;
if (continuePointerDown(o, t, e)) {
const t = !e && o.shiftKey;
const c = createRelativeHandleMove(s[u] || 0, 1 / getScale(s)[_]);
const r = o[_];
const c = createRelativeHandleMove(s[u] || 0, 1 / getScale(s)[g]);
const r = o[d];
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)), {
const h = getBoundingClientRect(i);
const v = a[f];
const w = getHandleOffset(a, h) + v / 2;
const p = r - h[_];
const b = e ? 0 : p - w;
const m = [ on(n, "selectstart", (t => preventDefault(t)), {
S: false
}), on(i, "pointermove", (n => {
const o = n[_] - r;
const o = n[d] - r;
if (e || t) {
c(w + o);
c(b + o);
}
})) ];
if (t) {
c(w);
c(b);
} else if (!e) {
let t = 0;
let n = noop;
const animateClickScroll = o => {
n = animateNumber(o, o + h * Gt(w), 133, ((o, s) => {
n = animateNumber(o, o + v * Gt(b), 133, ((o, s) => {
c(o);
const e = getHandleOffset(getBoundingClientRect(l), f);
const r = e + h;
const i = v >= e && v <= r;
const e = getHandleOffset(getBoundingClientRect(l), h);
const r = e + v;
const i = p >= e && p <= r;
if (s && !i) {
if (t) {
animateClickScroll(o);
@@ -2174,10 +2176,10 @@ const OverlayScrollbars = function(t) {
}));
};
animateClickScroll(0);
push(p, (() => n()));
push(m, (() => n()));
}
on(i, "pointerup", (t => {
runEachAndClear(p);
runEachAndClear(m);
i.releasePointerCapture(t.pointerId);
}), {
C: true
@@ -2245,7 +2247,7 @@ const OverlayScrollbars = function(t) {
return 1 / v * (1 - v) * g;
};
const createScrollbarsSetupElements = (t, n, o) => {
const {Y: s} = getEnvironment();
const {j: s} = getEnvironment();
const {scrollbars: e} = s();
const {slot: c} = e;
const {ct: r, W: l, J: i, K: a, lt: u, ot: d} = n;
@@ -2360,8 +2362,8 @@ const OverlayScrollbars = function(t) {
const [g, v] = selfCancelTimeout(100);
const [w, p] = selfCancelTimeout(100);
const [b, m] = selfCancelTimeout((() => i));
const [y, S, x] = createScrollbarsSetupElements(t, o.Yt, createScrollbarsSetupEvents(n, o));
const {J: $, K: C, ot: O, st: T, it: E, U: A} = o.Yt;
const [y, S, $] = createScrollbarsSetupElements(t, o.jt, createScrollbarsSetupEvents(n, o));
const {J: x, K: C, ot: O, st: T, it: E, U: A} = o.jt;
const {Wt: z, Qt: I, Ut: L, Nt: H, Xt: M} = y;
const {Zt: P} = z;
const {Zt: D} = I;
@@ -2389,12 +2391,12 @@ const OverlayScrollbars = function(t) {
r = e;
r && manageScrollbarsAutoHide(true);
};
const R = [ v, m, p, h, f, x, on($, "pointerover", onHostMouseEnter, {
const R = [ v, m, p, h, f, $, on(x, "pointerover", onHostMouseEnter, {
C: true
}), on($, "pointerenter", onHostMouseEnter), on($, "pointerleave", (() => {
}), on(x, "pointerenter", onHostMouseEnter), on(x, "pointerleave", (() => {
r = false;
e && manageScrollbarsAutoHide(false);
})), on($, "pointermove", (() => {
})), on(x, "pointermove", (() => {
s && d((() => {
v();
manageScrollbarsAutoHide(true);
@@ -2414,16 +2416,16 @@ const OverlayScrollbars = function(t) {
E && D(styleScrollbarPosition);
})) ];
const k = u.bind(0);
k.Yt = y;
k.jt = S;
k.jt = y;
k.Yt = S;
return [ (t, r, a) => {
const {At: u, zt: d, Et: f, wt: _} = a;
const h = createOptionCheck(n, t, r);
const g = o();
const {Ot: v, xt: w, vt: p} = g;
const {Ot: v, $t: w, vt: p} = g;
const [b, m] = h("scrollbars.theme");
const [y, S] = h("scrollbars.visibility");
const [x, $] = h("scrollbars.autoHide");
const [$, x] = h("scrollbars.autoHide");
const [C] = h("scrollbars.autoHideDelay");
const [O, T] = h("scrollbars.dragScroll");
const [E, z] = h("scrollbars.clickScroll");
@@ -2440,10 +2442,10 @@ const OverlayScrollbars = function(t) {
L(b, true);
l = b;
}
if ($) {
s = "move" === x;
e = "leave" === x;
c = "never" !== x;
if (x) {
s = "move" === $;
e = "leave" === $;
c = "never" !== $;
manageScrollbarsAutoHide(!c, true);
}
if (T) {
@@ -2468,7 +2470,7 @@ const OverlayScrollbars = function(t) {
}, k, runEachAndClear.bind(0, R) ];
};
const OverlayScrollbars = (t, n, o) => {
const {F: s, j: e} = getEnvironment();
const {F: s, Y: e} = getEnvironment();
const c = getPlugins();
const r = isHTMLElement(t);
const l = r ? t : t.target;
@@ -2514,7 +2516,7 @@ const OverlayScrollbars = function(t) {
t && n && f(t, n);
},
state() {
const {Ct: t, Ot: n, xt: o, Tt: s, Z: e, bt: c, vt: r} = g();
const {Ct: t, Ot: n, $t: o, Tt: s, Z: e, bt: c, vt: r} = g();
return assignDeep({}, {
overflowEdge: t,
overflowAmount: n,
@@ -2527,8 +2529,8 @@ const OverlayScrollbars = function(t) {
});
},
elements() {
const {W: t, J: n, Z: o, K: s, tt: e, ot: c, st: r} = g.Yt;
const {Wt: l, Qt: i} = p.Yt;
const {W: t, J: n, Z: o, K: s, tt: e, ot: c, st: r} = g.jt;
const {Wt: l, Qt: i} = p.jt;
const translateScrollbarStructure = t => {
const {qt: n, Ft: o, Gt: s} = t;
return {
@@ -2575,16 +2577,16 @@ const OverlayScrollbars = function(t) {
n(OverlayScrollbars, y);
}
}));
if (cancelInitialization(!r && t.cancel, g.Yt)) {
if (cancelInitialization(!r && t.cancel, g.jt)) {
destroy(true);
return y;
}
g.jt();
p.jt();
g.Yt();
p.Yt();
addInstance(l, y);
_("initialized", [ y ]);
g.Vt(((t, n, o) => {
const {ht: s, wt: e, _t: c, At: r, zt: l, Et: i, gt: a, $t: u} = t;
const {ht: s, wt: e, _t: c, At: r, zt: l, Et: i, gt: a, xt: u} = t;
_("updated", [ y, {
updateHints: {
sizeChanged: s,
@@ -2611,7 +2613,7 @@ const OverlayScrollbars = function(t) {
return isPlainObject(o) && !!getInstance(o.target);
};
OverlayScrollbars.env = () => {
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();
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({}, {
scrollbarsSize: t,
scrollbarsOverlaid: n,
@@ -2628,7 +2630,7 @@ const OverlayScrollbars = function(t) {
});
};
t.OverlayScrollbars = OverlayScrollbars;
t.scrollbarsHidingPlugin = xt;
t.scrollbarsHidingPlugin = $t;
t.sizeObserverPlugin = pt;
Object.defineProperties(t, {
tn: {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+75 -73
View File
@@ -791,9 +791,9 @@ const B = `${R}-listener`;
const V = `${B}-scroll`;
const j = `${B}-item`;
const Y = `${B}-item`;
const Y = `${j}-final`;
const j = `${Y}-final`;
const q = "os-trinsic-observer";
@@ -895,7 +895,7 @@ const vt = "__osSizeObserverPlugin";
const wt = /* @__PURE__ */ (() => ({
[vt]: {
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="${Y}" dir="ltr"><div class="${Y}"><div class="${j}"></div></div><div class="${Y}"><div class="${j}" style="width: 200%; height: 200%"></div></div></div>`);
appendChildren(t, s);
addClass(t, V);
const e = s[0];
@@ -1180,8 +1180,8 @@ const createEnvironment = () => {
I: a,
H: "-1" === style(o, "zIndex"),
V: getRtlScrollBehavior(o, s),
j: getFlexboxGlue(o, s),
Y: t => e("_", t),
Y: getFlexboxGlue(o, s),
j: t => e("_", t),
q: assignDeep.bind(0, {}, d),
F(t) {
assignDeep(d, t);
@@ -1322,15 +1322,15 @@ const createStructureSetupElements = t => {
return push(t, o && !parent(o) ? o : false);
}), []);
const elementIsGenerated = t => t ? indexOf(k, t) > -1 : null;
const {J: B, K: V, tt: j, Z: Y, nt: q, ot: F} = R;
const {J: B, K: V, tt: Y, Z: j, nt: q, ot: F} = R;
const G = [];
const N = b && elementIsGenerated(V);
let X = b ? B : contents([ q, Y, j, V, B ].find((t => false === elementIsGenerated(t))));
const U = q || Y;
let X = b ? B : contents([ q, j, Y, V, B ].find((t => false === elementIsGenerated(t))));
const U = q || j;
const appendElements = () => {
const t = addDataAttrHost(V, A ? "viewport" : "host");
const n = addClass(j, I);
const o = addClass(Y, !A && L);
const n = addClass(Y, I);
const o = addClass(j, !A && L);
const e = addClass(q, M);
const c = y ? addClass(parent(p), P) : noop;
if (N) {
@@ -1341,40 +1341,40 @@ const createStructureSetupElements = t => {
}));
}
appendChildren(U, X);
appendChildren(V, j);
appendChildren(j || V, !A && Y);
appendChildren(Y, q);
appendChildren(V, Y);
appendChildren(Y || V, !A && j);
appendChildren(j, q);
push(G, (() => {
c();
t();
removeAttr(Y, O);
removeAttr(Y, T);
removeAttr(j, O);
removeAttr(j, T);
if (elementIsGenerated(q)) {
unwrap(q);
}
if (elementIsGenerated(Y)) {
unwrap(Y);
}
if (elementIsGenerated(j)) {
unwrap(j);
}
if (elementIsGenerated(Y)) {
unwrap(Y);
}
n();
o();
e();
}));
if (s && !A) {
push(G, removeClass.bind(0, Y, P));
push(G, removeClass.bind(0, j, P));
}
if (F) {
insertBefore(Y, F);
insertBefore(j, F);
push(G, removeElements.bind(0, F));
}
if (D) {
const t = attr(Y, Ct);
attr(Y, Ct, "-1");
Y.focus();
const t = attr(j, Ct);
attr(j, Ct, "-1");
j.focus();
const n = on(m, "pointerdown keydown", (() => {
t ? attr(Y, Ct, t) : removeAttr(Y, Ct);
t ? attr(j, Ct, t) : removeAttr(j, Ct);
n();
}));
} else if (H && H.focus) {
@@ -1389,7 +1389,7 @@ const createTrinsicUpdateSegment = (t, n) => {
const {nt: o} = t;
const [s] = n;
return t => {
const {j: n} = getEnvironment();
const {Y: n} = getEnvironment();
const {_t: e} = s();
const {ht: c} = t;
const r = (o || !n) && c;
@@ -1414,7 +1414,7 @@ const createPaddingUpdateSegment = (t, n) => {
}, topRightBottomLeft.bind(0, e, "padding", ""));
return (t, n, e) => {
let [u, d] = a(e);
const {I: f, j: _} = getEnvironment();
const {I: f, Y: _} = getEnvironment();
const {wt: h} = o();
const {gt: g, vt: v, bt: w} = t;
const [p, b] = n("paddingAbsolute");
@@ -1501,7 +1501,7 @@ const overflowIsVisible = t => 0 === t.indexOf(At);
const createOverflowUpdateSegment = (t, n) => {
const [o, s] = n;
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, Y: _, I: h, L: g} = getEnvironment();
const v = getPlugins()[yt];
const w = !i && !h && (g.x || g.y);
const p = u && i;
@@ -1594,10 +1594,10 @@ const createOverflowUpdateSegment = (t, n) => {
return (t, n, l) => {
const {gt: u, Ct: f, vt: v, St: w, ht: R, bt: k} = t;
const {_t: B, wt: V} = o();
const [j, Y] = n("showNativeOverlaidScrollbars");
const [Y, j] = n("showNativeOverlaidScrollbars");
const [q, F] = n("overflow");
const G = j && g.x && g.y;
const N = !i && !_ && (u || v || f || Y || R);
const G = Y && g.x && g.y;
const N = !i && !_ && (u || v || f || j || R);
const X = overflowIsVisible(q.x);
const U = overflowIsVisible(q.y);
const W = X || U;
@@ -1606,14 +1606,14 @@ const createOverflowUpdateSegment = (t, n) => {
let Z = $(l);
let Q = I(l);
let tt;
if (Y && h) {
if (j && h) {
a(P, A, !G);
}
if (N) {
tt = getViewportOverflowState(G);
fixFlexboxGlue(tt, B);
}
if (u || w || v || k || Y) {
if (u || w || v || k || j) {
if (W) {
a(D, E, false);
}
@@ -1624,7 +1624,7 @@ const createOverflowUpdateSegment = (t, n) => {
let u = e;
let f = i;
t();
if ((c || s || Y) && n && !G && H(n, e, o, V)) {
if ((c || s || j) && n && !G && H(n, e, o, V)) {
f = clientSize(r);
u = scrollSize(r);
}
@@ -1648,7 +1648,7 @@ const createOverflowUpdateSegment = (t, n) => {
y: st.h > 0
};
const ut = X && U && (at.x || at.y) || X && at.x && !at.y || U && at.y && !at.x;
if (w || k || it || rt || ot || et || F || Y || N) {
if (w || k || it || rt || ot || et || F || j || N) {
const t = {
marginRight: 0,
marginBottom: 0,
@@ -1710,7 +1710,7 @@ const prepareUpdateHints = (t, n, o) => {
const createStructureSetupUpdate = (t, n) => {
const {J: o, Z: s, ft: e, ut: c} = t;
const {I: r, L: l, j: i} = getEnvironment();
const {I: r, L: l, Y: i} = getEnvironment();
const a = !r && (l.x || l.y);
const u = [ createTrinsicUpdateSegment(t, n), createPaddingUpdateSegment(t, n), createOverflowUpdateSegment(t, n) ];
return (t, n, r) => {
@@ -2042,7 +2042,7 @@ const createStructureSetupObservers = (t, n, o) => {
let c;
const [, r] = n;
const {K: l, Z: i, nt: a, lt: d, ut: f, dt: _, ft: h} = t;
const {j: g} = getEnvironment();
const {Y: g} = getEnvironment();
const [v] = createCache({
_: equalWH,
u: {
@@ -2228,7 +2228,7 @@ const Vt = {
y: 0
};
const jt = {
const Yt = {
tt: {
t: 0,
r: 0,
@@ -2261,7 +2261,7 @@ const jt = {
const createStructureSetup = (t, n) => {
const o = createOptionCheck(n, {});
const s = createState(jt);
const s = createState(Yt);
const [e, c, r] = createEventListenerHub();
const [l] = s;
const [i, a, u] = createStructureSetupElements(t);
@@ -2276,10 +2276,10 @@ const createStructureSetup = (t, n) => {
triggerUpdateEvent(d(o, t), {}, false);
}));
const v = l.bind(0);
v.jt = t => {
v.Yt = t => {
e("u", t);
};
v.Yt = () => {
v.jt = () => {
const {J: t, Z: n} = i;
const o = scrollLeft(t);
const s = scrollTop(t);
@@ -2300,7 +2300,7 @@ const createStructureSetup = (t, n) => {
} ];
};
const {round: Yt, max: qt, sign: Ft} = Math;
const {round: jt, max: qt, sign: Ft} = Math;
const animationCurrentTime = () => performance.now();
@@ -2325,8 +2325,8 @@ const getScale = t => {
const {width: n, height: o} = getBoundingClientRect(t);
const {w: s, h: e} = offsetSize(t);
return {
x: Yt(n) / s || 1,
y: Yt(o) / e || 1
x: jt(n) / s || 1,
y: jt(o) / e || 1
};
};
@@ -2348,15 +2348,17 @@ const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
const {V: r} = getEnvironment();
const {Ft: l, Gt: i, Nt: a} = o;
const u = `scroll${c ? "Left" : "Top"}`;
const d = c ? "width" : "height";
const f = c ? "w" : "h";
const _ = c ? "x" : "y";
const d = `client${c ? "X" : "Y"}`;
const f = c ? "width" : "height";
const _ = c ? "left" : "top";
const h = c ? "w" : "h";
const g = c ? "x" : "y";
const getHandleOffset = (t, n) => t[_] - n[_];
const createRelativeHandleMove = (t, n) => o => {
const {Tt: d} = e();
const h = offsetSize(i)[f] - offsetSize(l)[f];
const g = n * o / h;
const v = g * d[_];
const f = offsetSize(i)[h] - offsetSize(l)[h];
const _ = n * o / f;
const v = _ * d[g];
const w = directionIsRTL(a);
const p = w && c ? r.n || r.i ? 1 : -1 : 1;
s[u] = t + v * p;
@@ -2365,33 +2367,33 @@ const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
const e = closest(o.target, `.${W}`) === l;
if (continuePointerDown(o, t, e)) {
const t = !e && o.shiftKey;
const c = createRelativeHandleMove(s[u] || 0, 1 / getScale(s)[_]);
const r = o[_];
const c = createRelativeHandleMove(s[u] || 0, 1 / getScale(s)[g]);
const r = o[d];
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)), {
const h = getBoundingClientRect(i);
const v = a[f];
const w = getHandleOffset(a, h) + v / 2;
const p = r - h[_];
const b = e ? 0 : p - w;
const m = [ on(n, "selectstart", (t => preventDefault(t)), {
$: false
}), on(i, "pointermove", (n => {
const o = n[_] - r;
const o = n[d] - r;
if (e || t) {
c(w + o);
c(b + o);
}
})) ];
if (t) {
c(w);
c(b);
} else if (!e) {
let t = 0;
let n = noop;
const animateClickScroll = o => {
n = animateNumber(o, o + h * Ft(w), 133, ((o, s) => {
n = animateNumber(o, o + v * Ft(b), 133, ((o, s) => {
c(o);
const e = getHandleOffset(getBoundingClientRect(l), f);
const r = e + h;
const i = v >= e && v <= r;
const e = getHandleOffset(getBoundingClientRect(l), h);
const r = e + v;
const i = p >= e && p <= r;
if (s && !i) {
if (t) {
animateClickScroll(o);
@@ -2408,10 +2410,10 @@ const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
}));
};
animateClickScroll(0);
push(p, (() => n()));
push(m, (() => n()));
}
on(i, "pointerup", (t => {
runEachAndClear(p);
runEachAndClear(m);
i.releasePointerCapture(t.pointerId);
}), {
O: true
@@ -2655,7 +2657,7 @@ const createScrollbarsSetup = (t, n, o) => {
})) ];
const k = u.bind(0);
k.qt = y;
k.Yt = S;
k.jt = S;
return [ (t, r, a) => {
const {zt: u, It: d, At: f, bt: _} = a;
const h = createOptionCheck(n, t, r);
@@ -2709,7 +2711,7 @@ const createScrollbarsSetup = (t, n, o) => {
};
const OverlayScrollbars = (t, n, o) => {
const {G: s, Y: e} = getEnvironment();
const {G: s, j: e} = getEnvironment();
const c = getPlugins();
const r = isHTMLElement(t);
const l = r ? t : t.target;
@@ -2807,7 +2809,7 @@ const OverlayScrollbars = (t, n, o) => {
},
destroy: destroy.bind(0)
};
g.jt(((t, n, o) => {
g.Yt(((t, n, o) => {
w(n, o, t);
}));
each(keys(c), (t => {
@@ -2820,11 +2822,11 @@ const OverlayScrollbars = (t, n, o) => {
destroy(true);
return y;
}
g.Yt();
p.Yt();
g.jt();
p.jt();
addInstance(l, y);
_("initialized", [ y ]);
g.jt(((t, n, o) => {
g.Yt(((t, n, o) => {
const {gt: s, bt: e, ht: c, zt: r, It: l, At: i, vt: a, Ct: u} = t;
_("updated", [ y, {
updateHints: {
@@ -2855,7 +2857,7 @@ OverlayScrollbars.valid = t => {
};
OverlayScrollbars.env = () => {
const {B: t, L: n, I: o, V: s, j: e, H: c, X: r, U: l, q: i, F: a, G: u, N: d} = getEnvironment();
const {B: t, L: n, I: o, V: s, Y: e, H: c, X: r, U: l, q: i, F: a, G: u, N: d} = getEnvironment();
return assignDeep({}, {
scrollbarsSize: t,
scrollbarsOverlaid: n,
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+173 -171
View File
@@ -379,9 +379,9 @@ const a = jsAPI("IntersectionObserver");
const u = jsAPI("ResizeObserver");
const d = jsAPI("cancelAnimationFrame");
const f = jsAPI("cancelAnimationFrame");
const f = jsAPI("requestAnimationFrame");
const d = jsAPI("requestAnimationFrame");
const _ = window.setTimeout;
@@ -442,8 +442,8 @@ const noop = () => {};
const selfCancelTimeout = t => {
let n;
const o = t ? _ : f;
const s = t ? h : d;
const o = t ? _ : d;
const s = t ? h : f;
return [ e => {
s(n);
n = o(e, isFunction(t) ? t() : t);
@@ -476,8 +476,8 @@ const debounce = (t, n) => {
if (i) {
const r = isFunction(l) ? l() : l;
const i = isNumber(r) && r >= 0;
const u = n > 0 ? _ : f;
const g = n > 0 ? h : d;
const u = n > 0 ? _ : d;
const g = n > 0 ? h : f;
const v = mergeParms(t);
const w = v || t;
const p = a.bind(0, w);
@@ -845,9 +845,9 @@ const at = [ rt.array, rt.null ];
const ut = "hidden scroll visible visible-hidden";
const dt = "visible hidden auto";
const ft = "visible hidden auto";
const ft = "never scroll leavemove";
const dt = "never scroll leavemove";
({
paddingAbsolute: it,
@@ -864,8 +864,8 @@ const ft = "never scroll leavemove";
},
scrollbars: {
theme: [ rt.string, rt.null ],
visibility: dt,
autoHide: ft,
visibility: ft,
autoHide: dt,
autoHideDelay: lt,
dragScroll: it,
clickScroll: it,
@@ -914,8 +914,8 @@ const wt = /* @__PURE__ */ (() => ({
if (t) {
stopPropagation(t);
if (u && !_) {
d(_);
_ = f(onResized);
f(_);
_ = d(onResized);
}
} else {
onResized(false === t);
@@ -927,7 +927,7 @@ const wt = /* @__PURE__ */ (() => ({
width: ht,
height: ht
});
f(reset);
d(reset);
return [ o ? onScroll.bind(0, false) : reset, h ];
}
}
@@ -968,16 +968,16 @@ const St = /* @__PURE__ */ (() => ({
if (t) {
const {P: t} = e();
const {D: i, M: a} = n;
const {x: u, y: d} = a;
const {x: f, y: _} = i;
const {x: u, y: f} = a;
const {x: d, y: _} = i;
const h = l ? "paddingRight" : "paddingLeft";
const g = t[h];
const v = t.paddingTop;
const w = c.w + r.w;
const p = c.h + r.h;
const b = {
w: _ && d ? `${_ + w - g}px` : "",
h: f && u ? `${f + p - v}px` : ""
w: _ && f ? `${_ + w - g}px` : "",
h: d && u ? `${d + p - v}px` : ""
};
if (s) {
const {sheet: t} = s;
@@ -1005,13 +1005,13 @@ const St = /* @__PURE__ */ (() => ({
if (t) {
const a = i || c(s);
const {P: u} = e();
const {M: d} = a;
const {x: f, y: _} = d;
const {M: f} = a;
const {x: d, y: _} = f;
const h = {};
const assignProps = t => each(t.split(" "), (t => {
h[t] = u[t];
}));
if (f) {
if (d) {
assignProps("marginBottom paddingTop paddingBottom");
}
if (_) {
@@ -1058,9 +1058,9 @@ const St = /* @__PURE__ */ (() => ({
};
const a = getWindowDPR();
const u = l.w > 2 && l.h > 2;
const d = !diffBiggerThanOne(i.w, i.h);
const f = a !== n && a > 0;
const _ = u && d && f;
const f = !diffBiggerThanOne(i.w, i.h);
const d = a !== n && a > 0;
const _ = u && f && d;
if (_) {
const [t, n] = s();
assignDeep(o.k, t);
@@ -1147,7 +1147,7 @@ const createEnvironment = () => {
x: 0 === i.x,
y: 0 === i.y
};
const d = {
const f = {
elements: {
host: null,
padding: !a,
@@ -1162,7 +1162,7 @@ const createEnvironment = () => {
body: null
}
};
const f = assignDeep({}, y);
const d = assignDeep({}, y);
const _ = {
k: i,
I: u,
@@ -1171,16 +1171,16 @@ const createEnvironment = () => {
B: getRtlScrollBehavior(o, s),
V: getFlexboxGlue(o, s),
Y: t => e("_", t),
j: assignDeep.bind(0, {}, d),
j: assignDeep.bind(0, {}, f),
q(t) {
assignDeep(d, t);
},
F: assignDeep.bind(0, {}, f),
G(t) {
assignDeep(f, t);
},
N: assignDeep({}, d),
X: assignDeep({}, f)
F: assignDeep.bind(0, {}, d),
G(t) {
assignDeep(d, t);
},
N: assignDeep({}, f),
X: assignDeep({}, d)
};
removeAttr(o, "style");
removeElements(o);
@@ -1222,10 +1222,10 @@ const cancelInitialization = (t, n) => {
const {j: c, I: r, A: l} = getEnvironment();
const {nativeScrollbarsOverlaid: i, body: a} = c().cancel;
const u = null != o ? o : i;
const d = isUndefined(s) ? a : s;
const f = (r.x || r.y) && u;
const _ = e && (isNull(d) ? !l : d);
return !!f || !!_;
const f = isUndefined(s) ? a : s;
const d = (r.x || r.y) && u;
const _ = e && (isNull(f) ? !l : f);
return !!d || !!_;
};
const $t = new WeakMap;
@@ -1272,11 +1272,11 @@ const createStructureSetupElements = t => {
const c = e && e.T;
const {elements: r} = o();
const {host: l, viewport: i, padding: a, content: u} = r;
const d = isHTMLElement(t);
const f = d ? {} : t;
const {elements: _} = f;
const f = isHTMLElement(t);
const d = f ? {} : t;
const {elements: _} = d;
const {host: h, padding: g, viewport: v, content: w} = _ || {};
const p = d ? t : f.target;
const p = f ? t : d.target;
const b = is(p, "textarea");
const m = p.ownerDocument;
const y = p === m.body;
@@ -1301,10 +1301,10 @@ const createStructureSetupElements = t => {
ct: m,
rt: b,
U: y,
lt: d,
lt: f,
it: A,
ut: (t, n) => A ? hasAttrClass(E, C, n) : hasClass(E, t),
dt: (t, n, o) => A ? attrClass(E, C, n, o) : (o ? addClass : removeClass)(E, t)
ft: (t, n, o) => A ? attrClass(E, C, n, o) : (o ? addClass : removeClass)(E, t)
};
const k = keys(R).reduce(((t, n) => {
const o = R[n];
@@ -1379,7 +1379,7 @@ const createTrinsicUpdateSegment = (t, n) => {
const [s] = n;
return t => {
const {V: n} = getEnvironment();
const {ft: e} = s();
const {dt: e} = s();
const {_t: c} = t;
const r = (o || !n) && c;
if (r) {
@@ -1402,18 +1402,18 @@ const createPaddingUpdateSegment = (t, n) => {
o: topRightBottomLeft()
}, topRightBottomLeft.bind(0, e, "padding", ""));
return (t, n, e) => {
let [u, d] = a(e);
const {A: f, V: _} = getEnvironment();
let [u, f] = a(e);
const {A: d, V: _} = getEnvironment();
const {vt: h} = o();
const {ht: g, gt: v, wt: w} = t;
const [p, b] = n("paddingAbsolute");
const m = !_ && v;
if (g || d || m) {
[u, d] = i(e);
if (g || f || m) {
[u, f] = i(e);
}
const y = !l && (b || w || d);
const y = !l && (b || w || f);
if (y) {
const t = !p || !c && !f;
const t = !p || !c && !d;
const n = u.r + u.l;
const o = u.t + u.b;
const e = {
@@ -1489,8 +1489,8 @@ const overflowIsVisible = t => 0 === t.indexOf(At);
const createOverflowUpdateSegment = (t, n) => {
const [o, s] = n;
const {J: e, Z: c, K: r, nt: l, it: i, dt: a, U: u, et: d} = t;
const {k: f, V: _, A: h, I: g} = getEnvironment();
const {J: e, Z: c, K: r, nt: l, it: i, ft: a, U: u, et: f} = t;
const {k: d, V: _, A: h, I: g} = getEnvironment();
const v = getPlugins()[yt];
const w = !i && !h && (g.x || g.y);
const p = u && i;
@@ -1509,10 +1509,10 @@ const createOverflowUpdateSegment = (t, n) => {
const i = fractionalSize(e);
const a = clientSize(e);
const u = "content-box" === style(r, "boxSizing");
const d = n || u ? s.b + s.t : 0;
const f = !(g.x && u);
const f = n || u ? s.b + s.t : 0;
const d = !(g.x && u);
style(r, {
height: a.h + i.h + (c.x && f ? l.x : 0) - d
height: a.h + i.h + (c.x && d ? l.x : 0) - f
});
}
};
@@ -1524,11 +1524,11 @@ const createOverflowUpdateSegment = (t, n) => {
const i = "scroll" === l;
const a = s ? o : e;
const u = i && !h ? a : 0;
const d = s && !!o;
return [ c, i, u, d ];
const f = s && !!o;
return [ c, i, u, f ];
};
const [s, e, c, l] = getStatePerAxis("overflowX", g.x, f.x);
const [i, a, u, d] = getStatePerAxis("overflowY", g.y, f.y);
const [s, e, c, l] = getStatePerAxis("overflowX", g.x, d.x);
const [i, a, u, f] = getStatePerAxis("overflowY", g.y, d.y);
return {
xt: {
x: s,
@@ -1544,7 +1544,7 @@ const createOverflowUpdateSegment = (t, n) => {
},
M: {
x: l,
y: d
y: f
}
};
};
@@ -1564,15 +1564,15 @@ const createOverflowUpdateSegment = (t, n) => {
const {D: c, M: r} = t;
const {x: l, y: i} = r;
const {x: a, y: u} = c;
const {P: d} = o();
const f = n ? "marginLeft" : "marginRight";
const {P: f} = o();
const d = n ? "marginLeft" : "marginRight";
const _ = n ? "paddingLeft" : "paddingRight";
const h = d[f];
const g = d.marginBottom;
const v = d[_];
const w = d.paddingBottom;
const h = f[d];
const g = f.marginBottom;
const v = f[_];
const w = f.paddingBottom;
e.width = `calc(100% + ${u + -1 * h}px)`;
e[f] = -u + h;
e[d] = -u + h;
e.marginBottom = -a + g;
if (s) {
e[_] = v + (i ? u : 0);
@@ -1581,12 +1581,12 @@ const createOverflowUpdateSegment = (t, n) => {
};
const [H, P] = v ? v.H(w, _, r, l, o, getViewportOverflowState, hideNativeScrollbars) : [ () => w, () => [ noop ] ];
return (t, n, l) => {
const {ht: u, $t: f, gt: v, yt: w, _t: R, wt: k} = t;
const {ft: B, vt: V} = o();
const {ht: u, $t: d, gt: v, yt: w, _t: R, wt: k} = t;
const {dt: B, vt: V} = o();
const [Y, j] = n("showNativeOverlaidScrollbars");
const [q, F] = n("overflow");
const G = Y && g.x && g.y;
const N = !i && !_ && (u || v || f || j || R);
const N = !i && !_ && (u || v || d || j || R);
const X = overflowIsVisible(q.x);
const U = overflowIsVisible(q.y);
const W = X || U;
@@ -1611,10 +1611,10 @@ const createOverflowUpdateSegment = (t, n) => {
const [e, c] = K = y(l);
const i = clientSize(r);
let u = e;
let f = i;
let d = i;
t();
if ((c || s || j) && n && !G && H(n, e, o, V)) {
f = clientSize(r);
d = clientSize(r);
u = scrollSize(r);
}
const _ = {
@@ -1622,8 +1622,8 @@ const createOverflowUpdateSegment = (t, n) => {
h: Et(Tt(e.h, u.h) + o.h)
};
const h = {
w: Et(p ? d.innerWidth : f.w + Et(i.w - e.w) + o.w),
h: Et(p ? d.innerHeight : f.h + Et(i.h - e.h) + o.h)
w: Et(p ? f.innerWidth : d.w + Et(i.w - e.w) + o.w),
h: Et(p ? f.innerHeight : d.h + Et(i.h - e.h) + o.h)
};
Q = z(h);
Z = x(getOverflowAmount(_, h), l);
@@ -1664,9 +1664,9 @@ const createOverflowUpdateSegment = (t, n) => {
attrClass(e, C, E, ut);
conditionalClass(c, M, ut);
!i && conditionalClass(r, M, W);
const [dt, ft] = L(getViewportOverflowState(G).xt);
const [ft, dt] = L(getViewportOverflowState(G).xt);
s({
xt: dt,
xt: ft,
Ct: {
x: nt.w,
y: nt.h
@@ -1678,7 +1678,7 @@ const createOverflowUpdateSegment = (t, n) => {
Tt: at
});
return {
Et: ft,
Et: dt,
At: ot,
zt: et
};
@@ -1698,7 +1698,7 @@ const prepareUpdateHints = (t, n, o) => {
};
const createStructureSetupUpdate = (t, n) => {
const {W: o, K: s, dt: e, it: c} = t;
const {W: o, K: s, ft: e, it: c} = t;
const {A: r, I: l, V: i} = getEnvironment();
const a = !r && (l.x || l.y);
const u = [ createTrinsicUpdateSegment(t, n), createPaddingUpdateSegment(t, n), createOverflowUpdateSegment(t, n) ];
@@ -1714,15 +1714,15 @@ const createStructureSetupUpdate = (t, n) => {
$t: false,
gt: false
}, n), {}, r);
const d = a || !i;
const f = d && scrollLeft(s);
const _ = d && scrollTop(s);
const f = a || !i;
const d = f && scrollLeft(s);
const _ = f && scrollTop(s);
e("", z, true);
let h = l;
each(u, (n => {
h = prepareUpdateHints(h, n(h, t, !!r) || {}, r);
}));
scrollLeft(s, f);
scrollLeft(s, d);
scrollTop(s, _);
e("", z);
if (!c) {
@@ -1744,8 +1744,8 @@ const createSizeObserver = (t, n, o) => {
const l = createDOM(`<div class="${R}"><div class="${B}"></div></div>`);
const i = l[0];
const a = i.firstChild;
const d = directionIsRTL.bind(0, t);
const [f] = createCache({
const f = directionIsRTL.bind(0, t);
const [d] = createCache({
o: void 0,
_: true,
u: (t, n) => !(!t || !domRectHasDimensions(t) && domRectHasDimensions(n))
@@ -1757,7 +1757,7 @@ const createSizeObserver = (t, n, o) => {
let l = false;
let a = true;
if (o) {
const [n, , o] = f(t.pop().contentRect);
const [n, , o] = d(t.pop().contentRect);
const s = domRectHasDimensions(n);
const e = domRectHasDimensions(o);
c = !o || !s;
@@ -1800,8 +1800,8 @@ const createSizeObserver = (t, n, o) => {
}
if (s) {
const [t] = createCache({
o: !d()
}, d);
o: !f()
}, f);
push(_, on(i, "scroll", (n => {
const o = t();
const [s, e] = o;
@@ -1931,8 +1931,8 @@ const createEventContentChange = (t, n, o) => {
const createDOMObserver = (t, n, o, s) => {
let e = false;
const {Pt: c, Dt: r, Mt: l, Rt: a, kt: u, Bt: d} = s || {};
const f = debounce((() => {
const {Pt: c, Dt: r, Mt: l, Rt: a, kt: u, Bt: f} = s || {};
const d = debounce((() => {
if (e) {
o(true);
}
@@ -1940,43 +1940,43 @@ const createDOMObserver = (t, n, o, s) => {
g: 33,
v: 99
});
const [_, h] = createEventContentChange(t, f, l);
const [_, h] = createEventContentChange(t, d, l);
const g = c || [];
const v = r || [];
const w = g.concat(v);
const observerCallback = (e, c) => {
const r = u || noop;
const l = d || noop;
const l = f || noop;
const i = [];
const f = [];
const d = [];
let _ = false;
let g = false;
let w = false;
each(e, (o => {
const {attributeName: e, target: c, type: u, oldValue: d, addedNodes: h} = o;
const {attributeName: e, target: c, type: u, oldValue: f, addedNodes: h} = o;
const p = "attributes" === u;
const b = "childList" === u;
const m = t === c;
const y = p && isString(e) ? attr(c, e) : 0;
const S = 0 !== y && d !== y;
const S = 0 !== y && f !== y;
const x = indexOf(v, e) > -1 && S;
if (n && !m) {
const n = !p;
const i = p && x;
const u = i && a && is(c, a);
const _ = u ? !r(c, e, d, y) : n || i;
const _ = u ? !r(c, e, f, y) : n || i;
const v = _ && !l(o, !!u, t, s);
push(f, h);
push(d, h);
g = g || v;
w = w || b;
}
if (!n && m && S && !r(c, e, d, y)) {
if (!n && m && S && !r(c, e, f, y)) {
push(i, e);
_ = _ || x;
}
}));
if (w && !isEmptyArray(f)) {
h((t => f.reduce(((n, o) => {
if (w && !isEmptyArray(d)) {
h((t => d.reduce(((n, o) => {
push(n, find(t, o));
return is(o, t) ? push(n, o) : n;
}), [])));
@@ -2008,7 +2008,7 @@ const createDOMObserver = (t, n, o, s) => {
}
}, () => {
if (e) {
f.m();
d.m();
const t = p.takeRecords();
return !isEmptyArray(t) && observerCallback(t, true);
}
@@ -2030,7 +2030,7 @@ const createStructureSetupObservers = (t, n, o) => {
let e;
let c;
const [, r] = n;
const {J: l, K: i, tt: a, rt: d, it: f, ut: _, dt: h} = t;
const {J: l, K: i, tt: a, rt: f, it: d, ut: _, ft: h} = t;
const {V: g} = getEnvironment();
const [v] = createCache({
u: equalWH,
@@ -2059,7 +2059,7 @@ const createStructureSetupObservers = (t, n, o) => {
h: c.h + e.h + r.h
};
}));
const w = d ? kt : Bt.concat(kt);
const w = f ? kt : Bt.concat(kt);
const p = debounce(o, {
g: () => s,
v: () => e,
@@ -2090,7 +2090,7 @@ const createStructureSetupObservers = (t, n, o) => {
_t: e
};
r({
ft: s
dt: s
});
!n && o(c);
return c;
@@ -2127,13 +2127,13 @@ const createStructureSetupObservers = (t, n, o) => {
};
if (n) {
!o && p(s);
} else if (!f) {
} else if (!d) {
updateViewportAttrsFromHost(t);
}
return s;
};
const [b, m, y] = a || !g ? createTrinsicObserver(l, onTrinsicChanged) : [ noop, noop, noop ];
const [S, x] = !f ? createSizeObserver(l, onSizeChanged, {
const [S, x] = !d ? createSizeObserver(l, onSizeChanged, {
Lt: true,
It: true
}) : [ noop, noop ];
@@ -2141,7 +2141,7 @@ const createStructureSetupObservers = (t, n, o) => {
Dt: Bt,
Pt: Bt.concat(Rt)
});
const O = f && u && new u(onSizeChanged.bind(0, {
const O = d && u && new u(onSizeChanged.bind(0, {
ht: true
}));
O && O.observe(l);
@@ -2174,7 +2174,7 @@ const createStructureSetupObservers = (t, n, o) => {
const [n] = t("update.ignoreMutation");
const [o, r] = t("update.attributes");
const [l, u] = t("update.elementEvents");
const [d, _] = t("update.debounce");
const [f, _] = t("update.debounce");
const h = u || r;
const ignoreMutationFromOptions = t => isFunction(n) && n(t);
if (h) {
@@ -2189,20 +2189,20 @@ const createStructureSetupObservers = (t, n, o) => {
Rt: Dt,
Bt: (t, n) => {
const {target: o, attributeName: s} = t;
const e = !n && s && !f ? liesBetween(o, Dt, Mt) : false;
const e = !n && s && !d ? liesBetween(o, Dt, Mt) : false;
return e || !!closest(o, `.${F}`) || !!ignoreMutationFromOptions(t);
}
});
}
if (_) {
p.m();
if (isArray(d)) {
const t = d[0];
const n = d[1];
if (isArray(f)) {
const t = f[0];
const n = f[1];
s = isNumber(t) && t;
e = isNumber(n) && n;
} else if (isNumber(d)) {
s = d;
} else if (isNumber(f)) {
s = f;
e = false;
} else {
s = false;
@@ -2244,7 +2244,7 @@ const Yt = {
x: false,
y: false
},
ft: false,
dt: false,
vt: false
};
@@ -2254,15 +2254,15 @@ const createStructureSetup = (t, n) => {
const [e, c, r] = createEventListenerHub();
const [l] = s;
const [i, a, u] = createStructureSetupElements(t);
const d = createStructureSetupUpdate(i, s);
const f = createStructureSetupUpdate(i, s);
const triggerUpdateEvent = (t, n, o) => {
const s = keys(t).some((n => t[n]));
if (s || !isEmptyObject(n) || o) {
r("u", [ t, n, o ]);
}
};
const [f, _, h, g] = createStructureSetupObservers(i, s, (t => {
triggerUpdateEvent(d(o, t), {}, false);
const [d, _, h, g] = createStructureSetupObservers(i, s, (t => {
triggerUpdateEvent(f(o, t), {}, false);
}));
const v = l.bind(0);
v.Vt = t => {
@@ -2281,10 +2281,10 @@ const createStructureSetup = (t, n) => {
return [ (t, o) => {
const s = createOptionCheck(n, t, o);
g(s);
triggerUpdateEvent(d(s, h(), o), t, !!o);
triggerUpdateEvent(f(s, h(), o), t, !!o);
}, v, () => {
c();
f();
d();
u();
} ];
};
@@ -2302,12 +2302,12 @@ const animateNumber = (t, n, o, s) => {
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);
const f = i || 1 === a;
s(u, f);
e = f ? 0 : d(frame);
};
frame();
return () => d(e);
return () => f(e);
};
const getScale = t => {
@@ -2337,15 +2337,17 @@ const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
const {B: r} = getEnvironment();
const {qt: l, Ft: i, Gt: a} = o;
const u = `scroll${c ? "Left" : "Top"}`;
const f = `client${c ? "X" : "Y"}`;
const d = c ? "width" : "height";
const f = c ? "w" : "h";
const _ = c ? "x" : "y";
const _ = c ? "left" : "top";
const h = c ? "w" : "h";
const g = c ? "x" : "y";
const getHandleOffset = (t, n) => t[_] - n[_];
const createRelativeHandleMove = (t, n) => o => {
const {Ot: d} = e();
const h = offsetSize(i)[f] - offsetSize(l)[f];
const g = n * o / h;
const v = g * d[_];
const {Ot: f} = e();
const d = offsetSize(i)[h] - offsetSize(l)[h];
const _ = n * o / d;
const v = _ * f[g];
const w = directionIsRTL(a);
const p = w && c ? r.n || r.i ? 1 : -1 : 1;
s[u] = t + v * p;
@@ -2354,33 +2356,33 @@ const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
const e = closest(o.target, `.${W}`) === l;
if (continuePointerDown(o, t, e)) {
const t = !e && o.shiftKey;
const c = createRelativeHandleMove(s[u] || 0, 1 / getScale(s)[_]);
const r = o[_];
const c = createRelativeHandleMove(s[u] || 0, 1 / getScale(s)[g]);
const r = o[f];
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)), {
const h = getBoundingClientRect(i);
const v = a[d];
const w = getHandleOffset(a, h) + v / 2;
const p = r - h[_];
const b = e ? 0 : p - w;
const m = [ on(n, "selectstart", (t => preventDefault(t)), {
S: false
}), on(i, "pointermove", (n => {
const o = n[_] - r;
const o = n[f] - r;
if (e || t) {
c(w + o);
c(b + o);
}
})) ];
if (t) {
c(w);
c(b);
} else if (!e) {
let t = 0;
let n = noop;
const animateClickScroll = o => {
n = animateNumber(o, o + h * Ft(w), 133, ((o, s) => {
n = animateNumber(o, o + v * Ft(b), 133, ((o, s) => {
c(o);
const e = getHandleOffset(getBoundingClientRect(l), f);
const r = e + h;
const i = v >= e && v <= r;
const e = getHandleOffset(getBoundingClientRect(l), h);
const r = e + v;
const i = p >= e && p <= r;
if (s && !i) {
if (t) {
animateClickScroll(o);
@@ -2397,10 +2399,10 @@ const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
}));
};
animateClickScroll(0);
push(p, (() => n()));
push(m, (() => n()));
}
on(i, "pointerup", (t => {
runEachAndClear(p);
runEachAndClear(m);
i.releasePointerCapture(t.pointerId);
}), {
C: true
@@ -2413,25 +2415,25 @@ const createInteractiveScrollEvents = (t, n, o, s, e, c) => {
const createScrollbarsSetupEvents = (t, n) => (o, s, e, c, r, l) => {
const {Gt: i} = o;
const [a, u] = selfCancelTimeout(333);
const d = !!r.scrollBy;
let f = true;
const f = !!r.scrollBy;
let d = true;
return runEachAndClear.bind(0, [ on(i, "pointerenter", (() => {
s(Q, true);
})), on(i, "pointerleave pointercancel", (() => {
s(Q);
})), on(i, "wheel", (t => {
const {deltaX: n, deltaY: o, deltaMode: e} = t;
if (d && f && 0 === e && parent(i) === c) {
if (f && d && 0 === e && parent(i) === c) {
r.scrollBy({
left: n,
top: o,
behavior: "smooth"
});
}
f = false;
d = false;
s(ot, true);
a((() => {
f = true;
d = true;
s(ot);
}));
preventDefault(t);
@@ -2463,10 +2465,10 @@ const getScrollbarHandleOffsetRatio = (t, n, o, s, e, c) => {
const i = c ? "Left" : "Top";
const {Ot: a} = s;
const u = Ut(a[l]);
const d = Xt(o[`scroll${i}`]);
const f = c && e;
const _ = r.i ? d : u - d;
const h = f ? _ : d;
const f = Xt(o[`scroll${i}`]);
const d = c && e;
const _ = r.i ? f : u - f;
const h = d ? _ : f;
const g = Gt(1, h / u);
const v = getScrollbarHandleLengthRatio(t, n, c);
return 1 / v * (1 - v) * g;
@@ -2476,9 +2478,9 @@ const createScrollbarsSetupElements = (t, n, o) => {
const {j: s} = getEnvironment();
const {scrollbars: e} = s();
const {slot: c} = e;
const {ct: r, W: l, J: i, K: a, lt: u, ot: d} = n;
const {scrollbars: f} = u ? {} : t;
const {slot: h} = f || {};
const {ct: r, W: l, J: i, K: a, lt: u, ot: f} = n;
const {scrollbars: d} = u ? {} : t;
const {slot: h} = d || {};
const g = dynamicInitializationElement([ l, i, a ], (() => i), c, h);
const scrollbarStructureAddRemoveClass = (t, n, o) => {
const s = o ? addClass : removeClass;
@@ -2504,7 +2506,7 @@ const createScrollbarsSetupElements = (t, n, o) => {
const s = o ? "X" : "Y";
scrollbarsHandleStyle(t, (t => {
const {qt: e, Ft: c, Gt: r} = t;
const l = getScrollbarHandleOffsetRatio(e, c, d, n, directionIsRTL(r), o);
const l = getScrollbarHandleOffsetRatio(e, c, f, n, directionIsRTL(r), o);
const i = l === l;
return [ e, {
transform: i ? `translate${s}(${(100 * l).toFixed(3)}%)` : ""
@@ -2544,7 +2546,7 @@ const createScrollbarsSetupElements = (t, n, o) => {
appendChildren(c, l);
appendChildren(l, a);
push(s, u);
push(v, [ removeElements.bind(0, c), o(u, scrollbarsAddRemoveClass, r, i, d, t) ]);
push(v, [ removeElements.bind(0, c), o(u, scrollbarsAddRemoveClass, r, i, f, t) ]);
return u;
};
const b = generateScrollbarDOM.bind(0, true);
@@ -2584,7 +2586,7 @@ const createScrollbarsSetup = (t, n, o) => {
let i = 0;
const a = createState({});
const [u] = a;
const [d, f] = selfCancelTimeout();
const [f, d] = selfCancelTimeout();
const [_, h] = selfCancelTimeout();
const [g, v] = selfCancelTimeout(100);
const [w, p] = selfCancelTimeout(100);
@@ -2618,13 +2620,13 @@ const createScrollbarsSetup = (t, n, o) => {
r = e;
r && manageScrollbarsAutoHide(true);
};
const R = [ v, m, p, h, f, x, on($, "pointerover", onHostMouseEnter, {
const R = [ v, m, p, h, d, x, on($, "pointerover", onHostMouseEnter, {
C: true
}), on($, "pointerenter", onHostMouseEnter), on($, "pointerleave", (() => {
r = false;
e && manageScrollbarsAutoHide(false);
})), on($, "pointermove", (() => {
s && d((() => {
s && f((() => {
v();
manageScrollbarsAutoHide(true);
w((() => {
@@ -2646,7 +2648,7 @@ const createScrollbarsSetup = (t, n, o) => {
k.jt = y;
k.Yt = S;
return [ (t, r, a) => {
const {At: u, zt: d, Et: f, wt: _} = a;
const {At: u, zt: f, Et: d, wt: _} = a;
const h = createOptionCheck(n, t, r);
const g = o();
const {Ot: v, xt: w, vt: p} = g;
@@ -2656,8 +2658,8 @@ const createScrollbarsSetup = (t, n, o) => {
const [C] = h("scrollbars.autoHideDelay");
const [O, T] = h("scrollbars.dragScroll");
const [E, z] = h("scrollbars.clickScroll");
const I = u || d || _ || r;
const D = f || S || r;
const I = u || f || _ || r;
const D = d || S || r;
const setScrollbarVisibility = (t, n) => {
const o = "visible" === y || "auto" === y && "scroll" === t;
L(J, o, n);
@@ -2712,7 +2714,7 @@ const OverlayScrollbars = (t, n, o) => {
return o ? o(n, true) : n;
};
const u = assignDeep({}, s(), validateOptions(n));
const [d, f, _] = createEventListenerHub(o);
const [f, d, _] = createEventListenerHub(o);
const [h, g, v] = createStructureSetup(t, u);
const [w, p, b] = createScrollbarsSetup(t, u, g);
const update = (t, n) => {
@@ -2726,7 +2728,7 @@ const OverlayScrollbars = (t, n, o) => {
v();
i = true;
_("destroyed", [ y, !!t ]);
f();
d();
};
const y = {
options(t) {
@@ -2739,9 +2741,9 @@ const OverlayScrollbars = (t, n, o) => {
}
return assignDeep({}, u);
},
on: d,
on: f,
off: (t, n) => {
t && n && f(t, n);
t && n && d(t, n);
},
state() {
const {Ct: t, Ot: n, xt: o, Tt: s, Z: e, bt: c, vt: r} = g();
@@ -2844,7 +2846,7 @@ OverlayScrollbars.valid = t => {
};
OverlayScrollbars.env = () => {
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();
const {k: t, I: n, A: o, B: s, V: e, L: c, N: r, X: l, j: i, q: a, F: u, G: f} = getEnvironment();
return assignDeep({}, {
scrollbarsSize: t,
scrollbarsOverlaid: n,
@@ -2857,7 +2859,7 @@ OverlayScrollbars.env = () => {
getDefaultInitialization: i,
setDefaultInitialization: a,
getDefaultOptions: u,
setDefaultOptions: d
setDefaultOptions: f
});
};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long