109 lines
3.3 KiB
JavaScript
109 lines
3.3 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 2cd465e94e439d21.d295534e06.js
|
|
* Module id: 254119
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
var t = e.i(358379);
|
|
let r = (e) => {
|
|
let t,
|
|
r =
|
|
((t = navigator.userAgent.toLowerCase()),
|
|
{
|
|
isAndroid: /android/.test(t),
|
|
isIOS: /iphone|ipad|ipod/.test(t),
|
|
isWindows: /windows phone/.test(t),
|
|
isMobileUA:
|
|
/mobile|android|iphone|ipod|blackberry|iemobile|opera mini/.test(
|
|
t,
|
|
),
|
|
isTabletUA:
|
|
/ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone))/.test(
|
|
t,
|
|
),
|
|
}),
|
|
o =
|
|
"ontouchstart" in window ||
|
|
navigator.maxTouchPoints > 0 ||
|
|
navigator.msMaxTouchPoints > 0;
|
|
return r.isMobileUA
|
|
? {
|
|
isMobile: !0,
|
|
isTablet: !1,
|
|
isDesktop: !1,
|
|
screenWidth: e,
|
|
isTouchDevice: o,
|
|
userAgent: navigator.userAgent,
|
|
breakpoint: "mobile",
|
|
}
|
|
: r.isTabletUA
|
|
? {
|
|
isMobile: !1,
|
|
isTablet: !0,
|
|
isDesktop: !1,
|
|
screenWidth: e,
|
|
isTouchDevice: o,
|
|
userAgent: navigator.userAgent,
|
|
breakpoint: "tablet",
|
|
}
|
|
: e < 768
|
|
? {
|
|
isMobile: !0,
|
|
isTablet: !1,
|
|
isDesktop: !1,
|
|
screenWidth: e,
|
|
isTouchDevice: o,
|
|
userAgent: navigator.userAgent,
|
|
breakpoint: "mobile",
|
|
}
|
|
: e < 1024
|
|
? {
|
|
isMobile: !1,
|
|
isTablet: !0,
|
|
isDesktop: !1,
|
|
screenWidth: e,
|
|
isTouchDevice: o,
|
|
userAgent: navigator.userAgent,
|
|
breakpoint: "tablet",
|
|
}
|
|
: {
|
|
isMobile: !1,
|
|
isTablet: !1,
|
|
isDesktop: !0,
|
|
screenWidth: e,
|
|
isTouchDevice: o,
|
|
userAgent: navigator.userAgent,
|
|
breakpoint: "desktop",
|
|
};
|
|
},
|
|
o = () => {
|
|
let [e, o] = (0, t.useState)(() => r(window.innerWidth));
|
|
return (
|
|
(0, t.useEffect)(() => {
|
|
let e,
|
|
t = () => {
|
|
o(r(window.innerWidth));
|
|
},
|
|
n = () => {
|
|
clearTimeout(e), (e = setTimeout(t, 100));
|
|
};
|
|
return (
|
|
window.addEventListener("resize", n),
|
|
window.addEventListener("orientationchange", t),
|
|
() => {
|
|
window.removeEventListener("resize", n),
|
|
window.removeEventListener("orientationchange", t),
|
|
clearTimeout(e);
|
|
}
|
|
);
|
|
}, []),
|
|
e
|
|
);
|
|
};
|
|
e.s(["useIsMobile", 0, o, "useIsMobileSimple", 0, () => o().isMobile]);
|
|
};
|
|
|
|
export default moduleFactory;
|