126 lines
3.3 KiB
JavaScript
126 lines
3.3 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 5d5b47876e53e564.da1ba52a93.js
|
|
* Module id: 377393
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
var t,
|
|
r = e.i(824627),
|
|
n = e.i(358379),
|
|
o = e.i(779800),
|
|
a = e.i(457864),
|
|
i = e.i(369965);
|
|
function l(e, t) {
|
|
if (i.default)
|
|
return e
|
|
? (0, a.isFunction)(e)
|
|
? e()
|
|
: "current" in e
|
|
? e.current
|
|
: e
|
|
: t;
|
|
}
|
|
var s = e.i(587119),
|
|
c = e.i(500208),
|
|
u =
|
|
((t = n.useEffect),
|
|
function (e, r, o) {
|
|
var a = (0, n.useRef)(!1),
|
|
i = (0, n.useRef)([]),
|
|
u = (0, n.useRef)([]),
|
|
d = (0, n.useRef)(void 0);
|
|
t(function () {
|
|
var t,
|
|
n = (Array.isArray(o) ? o : [o]).map(function (e) {
|
|
return l(e);
|
|
});
|
|
if (!a.current) {
|
|
(a.current = !0),
|
|
(i.current = n),
|
|
(u.current = r),
|
|
(d.current = e());
|
|
return;
|
|
}
|
|
(n.length === i.current.length &&
|
|
(0, c.default)(i.current, n) &&
|
|
(0, c.default)(u.current, r)) ||
|
|
(null == (t = d.current) || t.call(d),
|
|
(i.current = n),
|
|
(u.current = r),
|
|
(d.current = e()));
|
|
}),
|
|
(0, s.default)(function () {
|
|
var e;
|
|
null == (e = d.current) || e.call(d), (a.current = !1);
|
|
});
|
|
});
|
|
let d = function (e, t, r) {
|
|
void 0 === r && (r = {});
|
|
var n = r.enable,
|
|
a = void 0 === n || n,
|
|
i = (0, o.default)(t);
|
|
u(
|
|
function () {
|
|
if (a) {
|
|
var t = l(r.target, window);
|
|
if (null == t ? void 0 : t.addEventListener) {
|
|
var n = function (e) {
|
|
return i.current(e);
|
|
},
|
|
o = Array.isArray(e) ? e : [e];
|
|
return (
|
|
o.forEach(function (e) {
|
|
t.addEventListener(e, n, {
|
|
capture: r.capture,
|
|
once: r.once,
|
|
passive: r.passive,
|
|
});
|
|
}),
|
|
function () {
|
|
o.forEach(function (e) {
|
|
t.removeEventListener(e, n, { capture: r.capture });
|
|
});
|
|
}
|
|
);
|
|
}
|
|
}
|
|
},
|
|
[e, r.capture, r.once, r.passive, a],
|
|
r.target,
|
|
);
|
|
};
|
|
var f = function () {
|
|
return i.default ? document.visibilityState : "visible";
|
|
};
|
|
e.s(
|
|
[
|
|
"useDocumentVisibility",
|
|
0,
|
|
function () {
|
|
var e = (0, r.__read)((0, n.useState)(f), 2),
|
|
t = e[0],
|
|
o = e[1];
|
|
return (
|
|
d(
|
|
"visibilitychange",
|
|
function () {
|
|
o(f());
|
|
},
|
|
{
|
|
target: function () {
|
|
return document;
|
|
},
|
|
},
|
|
),
|
|
t
|
|
);
|
|
},
|
|
],
|
|
377393,
|
|
);
|
|
};
|
|
|
|
export default moduleFactory;
|