img-viewer-react
Version:
image viewer for react
1,540 lines (1,534 loc) • 201 kB
JavaScript
import rr, { useRef as _, useState as kt, useEffect as Re } from "react";
import He from "react-dom";
var ye = { exports: {} }, Dt = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Fe;
function xr() {
if (Fe)
return Dt;
Fe = 1;
var o = rr, t = Symbol.for("react.element"), e = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
function n(a, c, l) {
var u, p = {}, g = null, y = null;
l !== void 0 && (g = "" + l), c.key !== void 0 && (g = "" + c.key), c.ref !== void 0 && (y = c.ref);
for (u in c)
r.call(c, u) && !s.hasOwnProperty(u) && (p[u] = c[u]);
if (a && a.defaultProps)
for (u in c = a.defaultProps, c)
p[u] === void 0 && (p[u] = c[u]);
return { $$typeof: t, type: a, key: g, ref: y, props: p, _owner: i.current };
}
return Dt.Fragment = e, Dt.jsx = n, Dt.jsxs = n, Dt;
}
var Xt = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ze;
function Ar() {
return ze || (ze = 1, process.env.NODE_ENV !== "production" && function() {
var o = rr, t = Symbol.for("react.element"), e = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), n = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), m = Symbol.iterator, R = "@@iterator";
function w(h) {
if (h === null || typeof h != "object")
return null;
var f = m && h[m] || h[R];
return typeof f == "function" ? f : null;
}
var U = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function A(h) {
{
for (var f = arguments.length, v = new Array(f > 1 ? f - 1 : 0), T = 1; T < f; T++)
v[T - 1] = arguments[T];
nt("error", h, v);
}
}
function nt(h, f, v) {
{
var T = U.ReactDebugCurrentFrame, P = T.getStackAddendum();
P !== "" && (f += "%s", v = v.concat([P]));
var E = v.map(function(b) {
return String(b);
});
E.unshift("Warning: " + f), Function.prototype.apply.call(console[h], console, E);
}
}
var xt = !1, Ee = !1, _t = !1, $t = !1, j = !1, At;
At = Symbol.for("react.module.reference");
function V(h) {
return !!(typeof h == "string" || typeof h == "function" || h === r || h === s || j || h === i || h === l || h === u || $t || h === y || xt || Ee || _t || typeof h == "object" && h !== null && (h.$$typeof === g || h.$$typeof === p || h.$$typeof === n || h.$$typeof === a || h.$$typeof === c || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
h.$$typeof === At || h.getModuleId !== void 0));
}
function te(h, f, v) {
var T = h.displayName;
if (T)
return T;
var P = f.displayName || f.name || "";
return P !== "" ? v + "(" + P + ")" : v;
}
function Mt(h) {
return h.displayName || "Context";
}
function K(h) {
if (h == null)
return null;
if (typeof h.tag == "number" && A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof h == "function")
return h.displayName || h.name || null;
if (typeof h == "string")
return h;
switch (h) {
case r:
return "Fragment";
case e:
return "Portal";
case s:
return "Profiler";
case i:
return "StrictMode";
case l:
return "Suspense";
case u:
return "SuspenseList";
}
if (typeof h == "object")
switch (h.$$typeof) {
case a:
var f = h;
return Mt(f) + ".Consumer";
case n:
var v = h;
return Mt(v._context) + ".Provider";
case c:
return te(h, h.render, "ForwardRef");
case p:
var T = h.displayName || null;
return T !== null ? T : K(h.type) || "Memo";
case g: {
var P = h, E = P._payload, b = P._init;
try {
return K(b(E));
} catch {
return null;
}
}
}
return null;
}
var tt = Object.assign, at = 0, Ct, lt, Ot, Yt, It, Z, ht;
function ct() {
}
ct.__reactDisabledLog = !0;
function ee() {
{
if (at === 0) {
Ct = console.log, lt = console.info, Ot = console.warn, Yt = console.error, It = console.group, Z = console.groupCollapsed, ht = console.groupEnd;
var h = {
configurable: !0,
enumerable: !0,
value: ct,
writable: !0
};
Object.defineProperties(console, {
info: h,
log: h,
warn: h,
error: h,
group: h,
groupCollapsed: h,
groupEnd: h
});
}
at++;
}
}
function M() {
{
if (at--, at === 0) {
var h = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: tt({}, h, {
value: Ct
}),
info: tt({}, h, {
value: lt
}),
warn: tt({}, h, {
value: Ot
}),
error: tt({}, h, {
value: Yt
}),
group: tt({}, h, {
value: It
}),
groupCollapsed: tt({}, h, {
value: Z
}),
groupEnd: tt({}, h, {
value: ht
})
});
}
at < 0 && A("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var J = U.ReactCurrentDispatcher, yt;
function ut(h, f, v) {
{
if (yt === void 0)
try {
throw Error();
} catch (P) {
var T = P.stack.trim().match(/\n( *(at )?)/);
yt = T && T[1] || "";
}
return `
` + yt + h;
}
}
var pt = !1, mt;
{
var re = typeof WeakMap == "function" ? WeakMap : Map;
mt = new re();
}
function Rt(h, f) {
if (!h || pt)
return "";
{
var v = mt.get(h);
if (v !== void 0)
return v;
}
var T;
pt = !0;
var P = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var E;
E = J.current, J.current = null, ee();
try {
if (f) {
var b = function() {
throw Error();
};
if (Object.defineProperty(b.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(b, []);
} catch (et) {
T = et;
}
Reflect.construct(h, [], b);
} else {
try {
b.call();
} catch (et) {
T = et;
}
h.call(b.prototype);
}
} else {
try {
throw Error();
} catch (et) {
T = et;
}
h();
}
} catch (et) {
if (et && T && typeof et.stack == "string") {
for (var k = et.stack.split(`
`), z = T.stack.split(`
`), Y = k.length - 1, C = z.length - 1; Y >= 1 && C >= 0 && k[Y] !== z[C]; )
C--;
for (; Y >= 1 && C >= 0; Y--, C--)
if (k[Y] !== z[C]) {
if (Y !== 1 || C !== 1)
do
if (Y--, C--, C < 0 || k[Y] !== z[C]) {
var q = `
` + k[Y].replace(" at new ", " at ");
return h.displayName && q.includes("<anonymous>") && (q = q.replace("<anonymous>", h.displayName)), typeof h == "function" && mt.set(h, q), q;
}
while (Y >= 1 && C >= 0);
break;
}
}
} finally {
pt = !1, J.current = E, M(), Error.prepareStackTrace = P;
}
var St = h ? h.displayName || h.name : "", Ie = St ? ut(St) : "";
return typeof h == "function" && mt.set(h, Ie), Ie;
}
function oe(h, f, v) {
return Rt(h, !1);
}
function ie(h) {
var f = h.prototype;
return !!(f && f.isReactComponent);
}
function ft(h, f, v) {
if (h == null)
return "";
if (typeof h == "function")
return Rt(h, ie(h));
if (typeof h == "string")
return ut(h);
switch (h) {
case l:
return ut("Suspense");
case u:
return ut("SuspenseList");
}
if (typeof h == "object")
switch (h.$$typeof) {
case c:
return oe(h.render);
case p:
return ft(h.type, f, v);
case g: {
var T = h, P = T._payload, E = T._init;
try {
return ft(E(P), f, v);
} catch {
}
}
}
return "";
}
var dt = Object.prototype.hasOwnProperty, d = {}, S = U.ReactDebugCurrentFrame;
function B(h) {
if (h) {
var f = h._owner, v = ft(h.type, h._source, f ? f.type : null);
S.setExtraStackFrame(v);
} else
S.setExtraStackFrame(null);
}
function D(h, f, v, T, P) {
{
var E = Function.call.bind(dt);
for (var b in h)
if (E(h, b)) {
var k = void 0;
try {
if (typeof h[b] != "function") {
var z = Error((T || "React class") + ": " + v + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw z.name = "Invariant Violation", z;
}
k = h[b](f, b, T, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (Y) {
k = Y;
}
k && !(k instanceof Error) && (B(P), A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", T || "React class", v, b, typeof k), B(null)), k instanceof Error && !(k.message in d) && (d[k.message] = !0, B(P), A("Failed %s type: %s", v, k.message), B(null));
}
}
}
var L = Array.isArray;
function X(h) {
return L(h);
}
function Ht(h) {
{
var f = typeof Symbol == "function" && Symbol.toStringTag, v = f && h[Symbol.toStringTag] || h.constructor.name || "Object";
return v;
}
}
function Ft(h) {
try {
return we(h), !1;
} catch {
return !0;
}
}
function we(h) {
return "" + h;
}
function xe(h) {
if (Ft(h))
return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ht(h)), we(h);
}
var Bt = U.ReactCurrentOwner, cr = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Ae, Me, se;
se = {};
function ur(h) {
if (dt.call(h, "ref")) {
var f = Object.getOwnPropertyDescriptor(h, "ref").get;
if (f && f.isReactWarning)
return !1;
}
return h.ref !== void 0;
}
function pr(h) {
if (dt.call(h, "key")) {
var f = Object.getOwnPropertyDescriptor(h, "key").get;
if (f && f.isReactWarning)
return !1;
}
return h.key !== void 0;
}
function fr(h, f) {
if (typeof h.ref == "string" && Bt.current && f && Bt.current.stateNode !== f) {
var v = K(Bt.current.type);
se[v] || (A('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', K(Bt.current.type), h.ref), se[v] = !0);
}
}
function dr(h, f) {
{
var v = function() {
Ae || (Ae = !0, A("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
};
v.isReactWarning = !0, Object.defineProperty(h, "key", {
get: v,
configurable: !0
});
}
}
function vr(h, f) {
{
var v = function() {
Me || (Me = !0, A("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
};
v.isReactWarning = !0, Object.defineProperty(h, "ref", {
get: v,
configurable: !0
});
}
}
var gr = function(h, f, v, T, P, E, b) {
var k = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: t,
// Built-in properties that belong on the element
type: h,
key: f,
ref: v,
props: b,
// Record the component responsible for creating this element.
_owner: E
};
return k._store = {}, Object.defineProperty(k._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(k, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: T
}), Object.defineProperty(k, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: P
}), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
};
function yr(h, f, v, T, P) {
{
var E, b = {}, k = null, z = null;
v !== void 0 && (xe(v), k = "" + v), pr(f) && (xe(f.key), k = "" + f.key), ur(f) && (z = f.ref, fr(f, P));
for (E in f)
dt.call(f, E) && !cr.hasOwnProperty(E) && (b[E] = f[E]);
if (h && h.defaultProps) {
var Y = h.defaultProps;
for (E in Y)
b[E] === void 0 && (b[E] = Y[E]);
}
if (k || z) {
var C = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
k && dr(b, C), z && vr(b, C);
}
return gr(h, k, z, P, T, Bt.current, b);
}
}
var ne = U.ReactCurrentOwner, Ye = U.ReactDebugCurrentFrame;
function Tt(h) {
if (h) {
var f = h._owner, v = ft(h.type, h._source, f ? f.type : null);
Ye.setExtraStackFrame(v);
} else
Ye.setExtraStackFrame(null);
}
var ae;
ae = !1;
function le(h) {
return typeof h == "object" && h !== null && h.$$typeof === t;
}
function Be() {
{
if (ne.current) {
var h = K(ne.current.type);
if (h)
return `
Check the render method of \`` + h + "`.";
}
return "";
}
}
function mr(h) {
{
if (h !== void 0) {
var f = h.fileName.replace(/^.*[\\\/]/, ""), v = h.lineNumber;
return `
Check your code at ` + f + ":" + v + ".";
}
return "";
}
}
var De = {};
function Tr(h) {
{
var f = Be();
if (!f) {
var v = typeof h == "string" ? h : h.displayName || h.name;
v && (f = `
Check the top-level render call using <` + v + ">.");
}
return f;
}
}
function Xe(h, f) {
{
if (!h._store || h._store.validated || h.key != null)
return;
h._store.validated = !0;
var v = Tr(f);
if (De[v])
return;
De[v] = !0;
var T = "";
h && h._owner && h._owner !== ne.current && (T = " It was passed a child from " + K(h._owner.type) + "."), Tt(h), A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, T), Tt(null);
}
}
function Ce(h, f) {
{
if (typeof h != "object")
return;
if (X(h))
for (var v = 0; v < h.length; v++) {
var T = h[v];
le(T) && Xe(T, f);
}
else if (le(h))
h._store && (h._store.validated = !0);
else if (h) {
var P = w(h);
if (typeof P == "function" && P !== h.entries)
for (var E = P.call(h), b; !(b = E.next()).done; )
le(b.value) && Xe(b.value, f);
}
}
}
function Sr(h) {
{
var f = h.type;
if (f == null || typeof f == "string")
return;
var v;
if (typeof f == "function")
v = f.propTypes;
else if (typeof f == "object" && (f.$$typeof === c || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
f.$$typeof === p))
v = f.propTypes;
else
return;
if (v) {
var T = K(f);
D(v, h.props, "prop", T, h);
} else if (f.PropTypes !== void 0 && !ae) {
ae = !0;
var P = K(f);
A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", P || "Unknown");
}
typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function kr(h) {
{
for (var f = Object.keys(h.props), v = 0; v < f.length; v++) {
var T = f[v];
if (T !== "children" && T !== "key") {
Tt(h), A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", T), Tt(null);
break;
}
}
h.ref !== null && (Tt(h), A("Invalid attribute `ref` supplied to `React.Fragment`."), Tt(null));
}
}
function Oe(h, f, v, T, P, E) {
{
var b = V(h);
if (!b) {
var k = "";
(h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var z = mr(P);
z ? k += z : k += Be();
var Y;
h === null ? Y = "null" : X(h) ? Y = "array" : h !== void 0 && h.$$typeof === t ? (Y = "<" + (K(h.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : Y = typeof h, A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Y, k);
}
var C = yr(h, f, v, P, E);
if (C == null)
return C;
if (b) {
var q = f.children;
if (q !== void 0)
if (T)
if (X(q)) {
for (var St = 0; St < q.length; St++)
Ce(q[St], h);
Object.freeze && Object.freeze(q);
} else
A("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
Ce(q, h);
}
return h === r ? kr(C) : Sr(C), C;
}
}
function br(h, f, v) {
return Oe(h, f, v, !0);
}
function Pr(h, f, v) {
return Oe(h, f, v, !1);
}
var Er = Pr, wr = br;
Xt.Fragment = r, Xt.jsx = Er, Xt.jsxs = wr;
}()), Xt;
}
process.env.NODE_ENV === "production" ? ye.exports = xr() : ye.exports = Ar();
var O = ye.exports;
/*!
* better-scroll / better-scroll
* (c) 2016-2023 ustbhuangyi
* Released under the MIT License.
*/
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var me = function(o, t) {
return me = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
e.__proto__ = r;
} || function(e, r) {
for (var i in r)
Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
}, me(o, t);
};
function Qt(o, t) {
me(o, t);
function e() {
this.constructor = o;
}
o.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
}
var Q = function() {
return Q = Object.assign || function(t) {
for (var e, r = 1, i = arguments.length; r < i; r++) {
e = arguments[r];
for (var s in e)
Object.prototype.hasOwnProperty.call(e, s) && (t[s] = e[s]);
}
return t;
}, Q.apply(this, arguments);
};
function he(o, t, e, r) {
function i(s) {
return s instanceof e ? s : new e(function(n) {
n(s);
});
}
return new (e || (e = Promise))(function(s, n) {
function a(u) {
try {
l(r.next(u));
} catch (p) {
n(p);
}
}
function c(u) {
try {
l(r.throw(u));
} catch (p) {
n(p);
}
}
function l(u) {
u.done ? s(u.value) : i(u.value).then(a, c);
}
l((r = r.apply(o, t || [])).next());
});
}
function ce(o, t) {
var e = { label: 0, sent: function() {
if (s[0] & 1)
throw s[1];
return s[1];
}, trys: [], ops: [] }, r, i, s, n;
return n = { next: a(0), throw: a(1), return: a(2) }, typeof Symbol == "function" && (n[Symbol.iterator] = function() {
return this;
}), n;
function a(l) {
return function(u) {
return c([l, u]);
};
}
function c(l) {
if (r)
throw new TypeError("Generator is already executing.");
for (; e; )
try {
if (r = 1, i && (s = l[0] & 2 ? i.return : l[0] ? i.throw || ((s = i.return) && s.call(i), 0) : i.next) && !(s = s.call(i, l[1])).done)
return s;
switch (i = 0, s && (l = [l[0] & 2, s.value]), l[0]) {
case 0:
case 1:
s = l;
break;
case 4:
return e.label++, { value: l[1], done: !1 };
case 5:
e.label++, i = l[1], l = [0];
continue;
case 7:
l = e.ops.pop(), e.trys.pop();
continue;
default:
if (s = e.trys, !(s = s.length > 0 && s[s.length - 1]) && (l[0] === 6 || l[0] === 2)) {
e = 0;
continue;
}
if (l[0] === 3 && (!s || l[1] > s[0] && l[1] < s[3])) {
e.label = l[1];
break;
}
if (l[0] === 6 && e.label < s[1]) {
e.label = s[1], s = l;
break;
}
if (s && e.label < s[2]) {
e.label = s[2], e.ops.push(l);
break;
}
s[2] && e.ops.pop(), e.trys.pop();
continue;
}
l = t.call(o, e);
} catch (u) {
l = [6, u], i = 0;
} finally {
r = s = 0;
}
if (l[0] & 5)
throw l[1];
return { value: l[0] ? l[1] : void 0, done: !0 };
}
}
function Gt() {
for (var o = 0, t = 0, e = arguments.length; t < e; t++)
o += arguments[t].length;
for (var r = Array(o), i = 0, t = 0; t < e; t++)
for (var s = arguments[t], n = 0, a = s.length; n < a; n++, i++)
r[i] = s[n];
return r;
}
var Mr = [
{
sourceKey: "scroller.scrollBehaviorX.currentPos",
key: "x"
},
{
sourceKey: "scroller.scrollBehaviorY.currentPos",
key: "y"
},
{
sourceKey: "scroller.scrollBehaviorX.hasScroll",
key: "hasHorizontalScroll"
},
{
sourceKey: "scroller.scrollBehaviorY.hasScroll",
key: "hasVerticalScroll"
},
{
sourceKey: "scroller.scrollBehaviorX.contentSize",
key: "scrollerWidth"
},
{
sourceKey: "scroller.scrollBehaviorY.contentSize",
key: "scrollerHeight"
},
{
sourceKey: "scroller.scrollBehaviorX.maxScrollPos",
key: "maxScrollX"
},
{
sourceKey: "scroller.scrollBehaviorY.maxScrollPos",
key: "maxScrollY"
},
{
sourceKey: "scroller.scrollBehaviorX.minScrollPos",
key: "minScrollX"
},
{
sourceKey: "scroller.scrollBehaviorY.minScrollPos",
key: "minScrollY"
},
{
sourceKey: "scroller.scrollBehaviorX.movingDirection",
key: "movingDirectionX"
},
{
sourceKey: "scroller.scrollBehaviorY.movingDirection",
key: "movingDirectionY"
},
{
sourceKey: "scroller.scrollBehaviorX.direction",
key: "directionX"
},
{
sourceKey: "scroller.scrollBehaviorY.direction",
key: "directionY"
},
{
sourceKey: "scroller.actions.enabled",
key: "enabled"
},
{
sourceKey: "scroller.animater.pending",
key: "pending"
},
{
sourceKey: "scroller.animater.stop",
key: "stop"
},
{
sourceKey: "scroller.scrollTo",
key: "scrollTo"
},
{
sourceKey: "scroller.scrollBy",
key: "scrollBy"
},
{
sourceKey: "scroller.scrollToElement",
key: "scrollToElement"
},
{
sourceKey: "scroller.resetPosition",
key: "resetPosition"
}
];
function G(o) {
console.error("[BScroll warn]: " + o);
}
function Le(o, t) {
if (!o)
throw new Error("[BScroll] " + t);
}
var $ = typeof window < "u", Et = $ && navigator.userAgent.toLowerCase(), Yr = !!(Et && /wechatdevtools/.test(Et)), Br = Et && Et.indexOf("android") > 0, Dr = function() {
if (typeof Et == "string") {
var o = /os (\d\d?_\d(_\d)?)/, t = o.exec(Et);
if (!t)
return !1;
var e = t[1].split("_").map(function(r) {
return parseInt(r, 10);
});
return e[0] === 13 && e[1] >= 4;
}
return !1;
}(), or = !1;
if ($) {
var Xr = "test-passive";
try {
var Ne = {};
Object.defineProperty(Ne, "passive", {
get: function() {
or = !0;
}
}), window.addEventListener(Xr, function() {
}, Ne);
} catch {
}
}
function W() {
return window.performance && window.performance.now && window.performance.timing ? window.performance.now() + window.performance.timing.navigationStart : +/* @__PURE__ */ new Date();
}
var F = function(o, t) {
for (var e in t)
o[e] = t[e];
return o;
};
function Te(o) {
return o == null;
}
function Cr(o, t) {
return Math.sqrt(o * o + t * t);
}
function I(o, t, e) {
return o < t ? t : o > e ? e : o;
}
function bt(o, t) {
if (o.findIndex)
return o.findIndex(t);
var e = -1;
return o.some(function(r, i, s) {
var n = t(r, i, s);
if (n)
return e = i, n;
}), e;
}
var be = $ && document.createElement("div").style, Pt = function() {
if (!$)
return !1;
for (var o = [
{
key: "standard",
value: "transform"
},
{
key: "webkit",
value: "webkitTransform"
},
{
key: "Moz",
value: "MozTransform"
},
{
key: "O",
value: "OTransform"
},
{
key: "ms",
value: "msTransform"
}
], t = 0, e = o; t < e.length; t++) {
var r = e[t];
if (be[r.value] !== void 0)
return r.key;
}
return !1;
}();
function rt(o) {
return Pt === !1 ? o : Pt === "standard" ? o === "transitionEnd" ? "transitionend" : o : Pt + o.charAt(0).toUpperCase() + o.substr(1);
}
function ir(o) {
return typeof o == "string" ? document.querySelector(o) : o;
}
function Or(o, t, e, r) {
var i = or ? {
passive: !1,
capture: !!r
} : !!r;
o.addEventListener(t, e, i);
}
function Ir(o, t, e, r) {
o.removeEventListener(t, e, {
capture: !!r
});
}
function vt(o) {
o.cancelable && o.preventDefault();
}
function We(o) {
for (var t = 0, e = 0; o; )
t -= o.offsetLeft, e -= o.offsetTop, o = o.offsetParent;
return {
left: t,
top: e
};
}
function Rr(o) {
var t = o.getBoundingClientRect();
return {
left: -(t.left + window.pageXOffset),
top: -(t.top + window.pageYOffset)
};
}
var Hr = Pt && Pt !== "standard" ? "-" + Pt.toLowerCase() + "-" : "", Fr = rt("transform"), sr = rt("transition"), zr = $ && rt("perspective") in be, Ue = $ && ("ontouchstart" in window || Yr), Lr = $ && sr in be, x = {
transform: Fr,
transition: sr,
transitionTimingFunction: rt("transitionTimingFunction"),
transitionDuration: rt("transitionDuration"),
transitionDelay: rt("transitionDelay"),
transformOrigin: rt("transformOrigin"),
transitionEnd: rt("transitionEnd"),
transitionProperty: rt("transitionProperty")
}, ue = {
touchstart: 1,
touchmove: 1,
touchend: 1,
touchcancel: 1,
mousedown: 2,
mousemove: 2,
mouseup: 2
};
function gt(o) {
if (o instanceof window.SVGElement) {
var t = o.getBoundingClientRect();
return {
top: t.top,
left: t.left,
width: t.width,
height: t.height
};
} else
return {
top: o.offsetTop,
left: o.offsetLeft,
width: o.offsetWidth,
height: o.offsetHeight
};
}
function wt(o, t) {
for (var e in t)
if (t[e].test(o[e]))
return !0;
return !1;
}
var Nr = wt;
function Wr(o, t) {
var e = document.createEvent("Event");
e.initEvent(t, !0, !0), e.pageX = o.pageX, e.pageY = o.pageY, o.target.dispatchEvent(e);
}
function nr(o, t) {
t === void 0 && (t = "click");
var e;
o.type === "mouseup" ? e = o : (o.type === "touchend" || o.type === "touchcancel") && (e = o.changedTouches[0]);
var r = {};
e && (r.screenX = e.screenX || 0, r.screenY = e.screenY || 0, r.clientX = e.clientX || 0, r.clientY = e.clientY || 0);
var i, s = !0, n = !0, a = o.ctrlKey, c = o.shiftKey, l = o.altKey, u = o.metaKey, p = {
ctrlKey: a,
shiftKey: c,
altKey: l,
metaKey: u
};
if (typeof MouseEvent < "u")
try {
i = new MouseEvent(t, F(Q({
bubbles: s,
cancelable: n
}, p), r));
} catch {
g();
}
else
g();
function g() {
i = document.createEvent("Event"), i.initEvent(t, s, n), F(i, r);
}
i.forwardedTouchEvent = !0, i._constructed = !0, o.target.dispatchEvent(i);
}
function Ur(o) {
nr(o, "dblclick");
}
function jr(o, t) {
var e = t.firstChild;
e ? Vr(o, e) : t.appendChild(o);
}
function Vr(o, t) {
var e = t.parentNode;
e.insertBefore(o, t);
}
function qr(o, t) {
o.removeChild(t);
}
function zt(o, t) {
var e = new RegExp("(^|\\s)" + t + "(\\s|$)");
return e.test(o.className);
}
function Kr(o) {
return Array.prototype.slice.call(o, 0);
}
function Gr(o) {
return {
width: o.clientWidth,
height: o.clientHeight
};
}
var H = {
// easeOutQuint
swipe: {
style: "cubic-bezier(0.23, 1, 0.32, 1)",
fn: function(o) {
return 1 + --o * o * o * o * o;
}
},
// easeOutQuard
swipeBounce: {
style: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
fn: function(o) {
return o * (2 - o);
}
},
// easeOutQuart
bounce: {
style: "cubic-bezier(0.165, 0.84, 0.44, 1)",
fn: function(o) {
return 1 - --o * o * o * o;
}
}
}, Qr = 1e3 / 60, it = $ && window;
function ar() {
}
var Pe = function() {
return $ ? it.requestAnimationFrame || it.webkitRequestAnimationFrame || it.mozRequestAnimationFrame || it.oRequestAnimationFrame || // if all else fails, use setTimeout
function(o) {
return window.setTimeout(o, o.interval || Qr);
} : ar;
}(), st = function() {
return $ ? it.cancelAnimationFrame || it.webkitCancelAnimationFrame || it.mozCancelAnimationFrame || it.oCancelAnimationFrame || function(o) {
window.clearTimeout(o);
} : ar;
}(), je = function(o) {
}, pe = {
enumerable: !0,
configurable: !0,
get: je,
set: je
}, Zr = function(o, t) {
for (var e = t.split("."), r = 0; r < e.length - 1; r++)
if (o = o[e[r]], typeof o != "object" || !o)
return;
var i = e.pop();
return typeof o[i] == "function" ? function() {
return o[i].apply(o, arguments);
} : o[i];
}, Jr = function(o, t, e) {
for (var r = t.split("."), i, s = 0; s < r.length - 1; s++)
i = r[s], o[i] || (o[i] = {}), o = o[i];
o[r.pop()] = e;
};
function _r(o, t, e) {
pe.get = function() {
return Zr(this, t);
}, pe.set = function(i) {
Jr(this, t, i);
}, Object.defineProperty(o, e, pe);
}
var ot = (
/** @class */
function() {
function o(t) {
this.events = {}, this.eventTypes = {}, this.registerType(t);
}
return o.prototype.on = function(t, e, r) {
return r === void 0 && (r = this), this.hasType(t), this.events[t] || (this.events[t] = []), this.events[t].push([e, r]), this;
}, o.prototype.once = function(t, e, r) {
var i = this;
r === void 0 && (r = this), this.hasType(t);
var s = function() {
for (var n = [], a = 0; a < arguments.length; a++)
n[a] = arguments[a];
i.off(t, s);
var c = e.apply(r, n);
if (c === !0)
return c;
};
return s.fn = e, this.on(t, s), this;
}, o.prototype.off = function(t, e) {
if (!t && !e)
return this.events = {}, this;
if (t) {
if (this.hasType(t), !e)
return this.events[t] = [], this;
var r = this.events[t];
if (!r)
return this;
for (var i = r.length; i--; )
(r[i][0] === e || r[i][0] && r[i][0].fn === e) && r.splice(i, 1);
return this;
}
}, o.prototype.trigger = function(t) {
for (var e = [], r = 1; r < arguments.length; r++)
e[r - 1] = arguments[r];
this.hasType(t);
var i = this.events[t];
if (i)
for (var s = i.length, n = Gt(i), a, c = 0; c < s; c++) {
var l = n[c], u = l[0], p = l[1];
if (u && (a = u.apply(p, e), a === !0))
return a;
}
}, o.prototype.registerType = function(t) {
var e = this;
t.forEach(function(r) {
e.eventTypes[r] = r;
});
}, o.prototype.destroy = function() {
this.events = {}, this.eventTypes = {};
}, o.prototype.hasType = function(t) {
var e = this.eventTypes, r = e[t] === t;
r || G('EventEmitter has used unknown event type: "' + t + '", should be oneof [' + ("" + Object.keys(e).map(function(i) {
return JSON.stringify(i);
})) + "]");
}, o;
}()
), N = (
/** @class */
function() {
function o(t, e) {
this.wrapper = t, this.events = e, this.addDOMEvents();
}
return o.prototype.destroy = function() {
this.removeDOMEvents(), this.events = [];
}, o.prototype.addDOMEvents = function() {
this.handleDOMEvents(Or);
}, o.prototype.removeDOMEvents = function() {
this.handleDOMEvents(Ir);
}, o.prototype.handleDOMEvents = function(t) {
var e = this, r = this.wrapper;
this.events.forEach(function(i) {
t(r, i.name, e, !!i.capture);
});
}, o.prototype.handleEvent = function(t) {
var e = t.type;
this.events.some(function(r) {
return r.name === e ? (r.handler(t), !0) : !1;
});
}, o;
}()
), $r = (
/** @class */
/* @__PURE__ */ function() {
function o() {
}
return o;
}()
), to = (
/** @class */
function(o) {
Qt(t, o);
function t() {
var e = o.call(this) || this;
return e.startX = 0, e.startY = 0, e.scrollX = !1, e.scrollY = !0, e.freeScroll = !1, e.directionLockThreshold = 0, e.eventPassthrough = "", e.click = !1, e.dblclick = !1, e.tap = "", e.bounce = {
top: !0,
bottom: !0,
left: !0,
right: !0
}, e.bounceTime = 800, e.momentum = !0, e.momentumLimitTime = 300, e.momentumLimitDistance = 15, e.swipeTime = 2500, e.swipeBounceTime = 500, e.deceleration = 15e-4, e.flickLimitTime = 200, e.flickLimitDistance = 100, e.resizePolling = 60, e.probeType = 0, e.stopPropagation = !1, e.preventDefault = !0, e.preventDefaultException = {
tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/
}, e.tagException = {
tagName: /^TEXTAREA$/
}, e.HWCompositing = !0, e.useTransition = !0, e.bindToWrapper = !1, e.bindToTarget = !1, e.disableMouse = Ue, e.disableTouch = !Ue, e.autoBlur = !0, e.autoEndDistance = 5, e.outOfBoundaryDampingFactor = 1 / 3, e.specifiedIndexAsContent = 0, e.quadrant = 1, e;
}
return t.prototype.merge = function(e) {
if (!e)
return this;
for (var r in e) {
if (r === "bounce") {
this.bounce = this.resolveBounce(e[r]);
continue;
}
this[r] = e[r];
}
return this;
}, t.prototype.process = function() {
return this.translateZ = this.HWCompositing && zr ? " translateZ(1px)" : "", this.useTransition = this.useTransition && Lr, this.preventDefault = !this.eventPassthrough && this.preventDefault, this.scrollX = this.eventPassthrough === "horizontal" ? !1 : this.scrollX, this.scrollY = this.eventPassthrough === "vertical" ? !1 : this.scrollY, this.freeScroll = this.freeScroll && !this.eventPassthrough, this.scrollX = this.freeScroll ? !0 : this.scrollX, this.scrollY = this.freeScroll ? !0 : this.scrollY, this.directionLockThreshold = this.eventPassthrough ? 0 : this.directionLockThreshold, this;
}, t.prototype.resolveBounce = function(e) {
var r = {
top: !0,
right: !0,
bottom: !0,
left: !0
}, i = {
top: !1,
right: !1,
bottom: !1,
left: !1
}, s;
return typeof e == "object" ? s = F(r, e) : s = e ? r : i, s;
}, t;
}($r)
), eo = (
/** @class */
function() {
function o(t, e) {
this.wrapper = t, this.options = e, this.hooks = new ot([
"beforeStart",
"start",
"move",
"end",
"click"
]), this.handleDOMEvents();
}
return o.prototype.handleDOMEvents = function() {
var t = this.options, e = t.bindToWrapper, r = t.disableMouse, i = t.disableTouch, s = t.click, n = this.wrapper, a = e ? n : window, c = [], l = [], u = !i, p = !r;
s && c.push({
name: "click",
handler: this.click.bind(this),
capture: !0
}), u && (c.push({
name: "touchstart",
handler: this.start.bind(this)
}), l.push({
name: "touchmove",
handler: this.move.bind(this)
}, {
name: "touchend",
handler: this.end.bind(this)
}, {
name: "touchcancel",
handler: this.end.bind(this)
})), p && (c.push({
name: "mousedown",
handler: this.start.bind(this)
}), l.push({
name: "mousemove",
handler: this.move.bind(this)
}, {
name: "mouseup",
handler: this.end.bind(this)
})), this.wrapperEventRegister = new N(n, c), this.targetEventRegister = new N(a, l);
}, o.prototype.beforeHandler = function(t, e) {
var r = this.options, i = r.preventDefault, s = r.stopPropagation, n = r.preventDefaultException, a = {
start: function() {
return i && !wt(t.target, n);
},
end: function() {
return i && !wt(t.target, n);
},
move: function() {
return i;
}
};
a[e]() && t.preventDefault(), s && t.stopPropagation();
}, o.prototype.setInitiated = function(t) {
t === void 0 && (t = 0), this.initiated = t;
}, o.prototype.start = function(t) {
var e = ue[t.type];
if (!(this.initiated && this.initiated !== e)) {
if (this.setInitiated(e), Nr(t.target, this.options.tagException)) {
this.setInitiated();
return;
}
if (!(e === 2 && t.button !== 0) && !this.hooks.trigger(this.hooks.eventTypes.beforeStart, t)) {
this.beforeHandler(t, "start");
var r = t.touches ? t.touches[0] : t;
this.pointX = r.pageX, this.pointY = r.pageY, this.hooks.trigger(this.hooks.eventTypes.start, t);
}
}
}, o.prototype.move = function(t) {
if (ue[t.type] === this.initiated) {
this.beforeHandler(t, "move");
var e = t.touches ? t.touches[0] : t, r = e.pageX - this.pointX, i = e.pageY - this.pointY;
if (this.pointX = e.pageX, this.pointY = e.pageY, !this.hooks.trigger(this.hooks.eventTypes.move, {
deltaX: r,
deltaY: i,
e: t
})) {
var s = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft, n = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop, a = this.pointX - s, c = this.pointY - n, l = this.options.autoEndDistance;
(a > document.documentElement.clientWidth - l || c > document.documentElement.clientHeight - l || a < l || c < l) && this.end(t);
}
}
}, o.prototype.end = function(t) {
ue[t.type] === this.initiated && (this.setInitiated(), this.beforeHandler(t, "end"), this.hooks.trigger(this.hooks.eventTypes.end, t));
}, o.prototype.click = function(t) {
this.hooks.trigger(this.hooks.eventTypes.click, t);
}, o.prototype.setContent = function(t) {
t !== this.wrapper && (this.wrapper = t, this.rebindDOMEvents());
}, o.prototype.rebindDOMEvents = function() {
this.wrapperEventRegister.destroy(), this.targetEventRegister.destroy(), this.handleDOMEvents();
}, o.prototype.destroy = function() {
this.wrapperEventRegister.destroy(), this.targetEventRegister.destroy(), this.hooks.destroy();
}, o;
}()
), fe = {
x: ["translateX", "px"],
y: ["translateY", "px"]
}, ro = (
/** @class */
function() {
function o(t) {
this.setContent(t), this.hooks = new ot(["beforeTranslate", "translate"]);
}
return o.prototype.getComputedPosition = function() {
var t = window.getComputedStyle(this.content, null), e = t[x.transform].split(")")[0].split(", "), r = +(e[12] || e[4]) || 0, i = +(e[13] || e[5]) || 0;
return {
x: r,
y: i
};
}, o.prototype.translate = function(t) {
var e = [];
Object.keys(t).forEach(function(r) {
if (fe[r]) {
var i = fe[r][0];
if (i) {
var s = fe[r][1], n = t[r];
e.push(i + "(" + n + s + ")");
}
}
}), this.hooks.trigger(this.hooks.eventTypes.beforeTranslate, e, t), this.style[x.transform] = e.join(" "), this.hooks.trigger(this.hooks.eventTypes.translate, t);
}, o.prototype.setContent = function(t) {
this.content !== t && (this.content = t, this.style = t.style);
}, o.prototype.destroy = function() {
this.hooks.destroy();
}, o;
}()
), lr = (
/** @class */
function() {
function o(t, e, r) {
this.translater = e, this.options = r, this.timer = 0, this.hooks = new ot([
"move",
"end",
"beforeForceStop",
"forceStop",
"callStop",
"time",
"timeFunction"
]), this.setContent(t);
}
return o.prototype.translate = function(t) {
this.translater.translate(t);
}, o.prototype.setPending = function(t) {
this.pending = t;
}, o.prototype.setForceStopped = function(t) {
this.forceStopped = t;
}, o.prototype.setCallStop = function(t) {
this.callStopWhenPending = t;
}, o.prototype.setContent = function(t) {
this.content !== t && (this.content = t, this.style = t.style, this.stop());
}, o.prototype.clearTimer = function() {
this.timer && (st(this.timer), this.timer = 0);
}, o.prototype.destroy = function() {
this.hooks.destroy(), st(this.timer);
}, o;
}()
), oo = function(o, t, e, r) {
var i = function(l, u) {
var p = l - u, g = p > 0 ? -1 : p < 0 ? 1 : 0;
return g;
}, s = i(t.x, o.x), n = i(t.y, o.y), a = e.x - r.x, c = e.y - r.y;
return s * a <= 0 && n * c <= 0;
}, io = (
/** @class */
function(o) {
Qt(t, o);
function t() {
return o !== null && o.apply(this, arguments) || this;
}
return t.prototype.startProbe = function(e, r) {
var i = this, s = e, n = function() {
var a = i.translater.getComputedPosition();
oo(e, r, a, s) && i.hooks.trigger(i.hooks.eventTypes.move, a), i.pending || (i.callStopWhenPending ? i.callStopWhenPending = !1 : i.hooks.trigger(i.hooks.eventTypes.end, a)), s = a, i.pending && (i.timer = Pe(n));
};
this.callStopWhenPending && this.setCallStop(!1), st(this.timer), n();
}, t.prototype.transitionTime = function(e) {
e === void 0 && (e = 0), this.style[x.transitionDuration] = e + "ms", this.hooks.trigger(this.hooks.eventTypes.time, e);
}, t.prototype.transitionTimingFunction = function(e) {
this.style[x.transitionTimingFunction] = e, this.hooks.trigger(this.hooks.eventTypes.timeFunction, e);
}, t.prototype.transitionProperty = function() {
this.style[x.transitionProperty] = x.transform;
}, t.prototype.move = function(e, r, i, s) {
this.setPending(i > 0), this.transitionTimingFunction(s), this.transitionProperty(), this.transitionTime(i), this.translate(r);
var n = this.options.probeType === 3;
i && n && this.startProbe(e, r), i || (this._reflow = this.content.offsetHeight, n && this.hooks.trigger(this.hooks.eventTypes.move, r), this.hooks.trigger(this.hooks.eventTypes.end, r));
}, t.prototype.doStop = function() {
var e = this.pending;
if (this.setForceStopped(!1), this.setCallStop(!1), e) {
this.setPending(!1), st(this.timer);
var r = this.translater.getComputedPosition(), i = r.x, s = r.y;
this.transitionTime(), this.translate({ x: i, y: s }), this.setForceStopped(!0), this.setCallStop(!0), this.hooks.trigger(this.hooks.eventTypes.forceStop, { x: i, y: s });
}
return e;
}, t.prototype.stop = function() {
var e = this.doStop();
e && this.hooks.trigger(this.hooks.eventTypes.callStop);
}, t;
}(lr)
), so = (
/** @class */
function(o) {
Qt(t, o);
function t() {
return o !== null && o.apply(this, arguments) || this;
}
return t.prototype.move = function(e, r, i, s) {
if (!i) {
this.translate(r), this.options.probeType === 3 && this.hooks.trigger(this.hooks.eventTypes.move, r), this.hooks.trigger(this.hooks.eventTypes.end, r);
return;
}
this.animate(e, r, i, s);
}, t.prototype.animate = function(e, r, i, s) {
var n = this, a = W(), c = a + i, l = this.options.probeType === 3, u = function() {
var p = W();
if (p >= c) {
n.translate(r), l && n.hooks.trigger(n.hooks.eventTypes.move, r), n.hooks.trigger(n.hooks.eventTypes.end, r);
return;
}
p = (p - a) / i;
var g = s(p), y = {};
Object.keys(r).forEach(function(m) {
var R = e[m], w = r[m];
y[m] = (w - R) * g + R;
}), n.translate(y), l && n.hooks.trigger(n.hooks.eventTypes.move, y), n.pending && (n.timer = Pe(u)), n.pending || (n.callStopWhenPending ? n.callStopWhenPending = !1 : n.hooks.trigger(n.hooks.eventTypes.end, r));
};
this.setPending(!0), this.callStopWhenPending && this.setCallStop(!1), st(this.timer), u();
}, t.prototype.doStop = function() {
var e = this.pending;
if (this.setForceStopped(!1), this.setCallStop(!1), e) {
this.setPending(!1), st(this.timer);
var r = this.translater.getComputedPosition();
this.setForceStopped(!0), this.setCallStop(!0), this.hooks.trigger(this.hooks.eventTypes.forceStop, r);
}
return e;
}, t.prototype.stop = function() {
var e = this.doStop();
e && this.hooks.trigger(this.hooks.eventTypes.callStop);
}, t;
}(lr)
);
function no(o, t, e) {
var r = e.useTransition, i = {};
return Object.defineProperty(i, "probeType", {
enumerable: !0,
configurable: !1,
get: function() {
return e.probeType;
}
}), r ? new io(o, t, i) : new so(o, t, i);
}
var Ve = (
/** @class */
function() {
function o(t, e, r) {
this.wrapper = t, this.options = r, this.hooks = new ot([
"beforeComputeBoundary",
"computeBoundary",
"momentum",
"end",
"ignoreHasScroll"