import{c as e,i as t}from"./preload-helper-B45gAKPr.js";import{pn as n}from"./iframe-NOj5DEP4.js";function r(e){if(typeof window>`u`||typeof document>`u`)return T;let t=e??document.documentElement,n=window.getComputedStyle(t).fontSize,r=Number.parseFloat(n);return!Number.isFinite(r)||r<=0?T:r}function i(e){return typeof e!=`object`||!e?!1:`mobile`in e||`tablet`in e||`laptop`in e||`desktop`in e}function a(e,t){if(e!==void 0)return i(e)?t===`mobile`?e.mobile??e.tablet??e.laptop:t===`tablet`?e.tablet??e.mobile??e.laptop:e.laptop??e.tablet??e.mobile:e}function o(e,t,n){let r={...e};for(let e of n)r[e]=a(r[e],t);return r}function s(e,t){return`addEventListener`in e?(e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)):(e.addListener(t),()=>e.removeListener(t))}function c(e){let t=t=>t*e,n=t(w.mobileMax),r=t(w.tabletMin),i=t(w.tabletMax),a=t(w.laptopMin);return{mobile:`(width <= ${n}px)`,tablet:`(width >= ${r}px) and (width <= ${i}px)`,laptop:`(width >= ${a}px)`}}function l(e){return e.mobile?`mobile`:e.tablet?`tablet`:`laptop`}function u(e,t){return e.mobile===t.mobile&&e.tablet===t.tablet&&e.laptop===t.laptop}function d(e){u(k.matches,e)||(k={matches:e,activeBreakpoint:l(e)},R.forEach(e=>e()))}function f(){A&&d({mobile:A.mobile.matches,tablet:A.tablet.matches,laptop:A.laptop.matches})}function p(){j.forEach(e=>e()),j=[]}function m(e=!1){if(typeof window>`u`||typeof document>`u`)return;let t=r();if(!e&&A&&Math.abs(t-M)<D)return;M=t,p();let n=c(t);A={mobile:window.matchMedia(n.mobile),tablet:window.matchMedia(n.tablet),laptop:window.matchMedia(n.laptop)},j=Object.keys(A).map(e=>s(A[e],f)),f()}function h(){L&&clearTimeout(L),L=setTimeout(()=>{L=null,m()},O)}function g(){typeof window>`u`||typeof document>`u`||(P=new MutationObserver(h),P.observe(document.documentElement,{attributes:!0,attributeFilter:[`style`,`class`,`data-font-size`]}),!(typeof ResizeObserver>`u`)&&(I=document.createElement(`div`),I.style.position=`absolute`,I.style.visibility=`hidden`,I.style.pointerEvents=`none`,I.style.width=`1em`,I.style.height=`1px`,I.style.overflow=`hidden`,I.setAttribute(`aria-hidden`,`true`),(document.body??document.documentElement).appendChild(I),F=new ResizeObserver(h),F.observe(I)))}function _(){p(),A=null,L&&=(clearTimeout(L),null),P&&=(P.disconnect(),null),F&&=(F.disconnect(),null),I?.parentNode&&I.parentNode.removeChild(I),I=null,N=!1}function v(){N||typeof window>`u`||typeof document>`u`||(N=!0,m(!0),g())}function y(e){return typeof window>`u`||typeof document>`u`?()=>{}:(R.add(e),v(),()=>{R.delete(e),R.size===0&&_()})}function b(){return k}function x(){return E}function S(){return(0,C.useSyncExternalStore)(y,b,x)}var C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z=t((()=>{C=e(n(),1),w={mobileMax:767.98/16,tabletMin:768/16,tabletMax:1151.98/16,laptopMin:1152/16},T=16,E={matches:{mobile:!1,tablet:!1,laptop:!1},activeBreakpoint:`laptop`},D=.25,O=80,k=E,A=null,j=[],M=0,N=!1,P=null,F=null,I=null,L=null,R=new Set}));export{a as i,o as n,z as r,S as t};