// @bun
var{defineProperty:I,getOwnPropertyNames:K,getOwnPropertyDescriptor:O}=Object,Q=Object.prototype.hasOwnProperty;function U(q){return this[q]}var Y=(q)=>{var B=(J??=new WeakMap).get(q),D;if(B)return B;if(B=I({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function"){for(var j of K(q))if(!Q.call(B,j))I(B,j,{get:U.bind(q,j),enumerable:!(D=O(q,j))||D.enumerable})}return J.set(q,B),B},J;var W=(q)=>q;function X(q,B){this[q]=W.bind(null,B)}var Z=(q,B)=>{for(var D in B)I(q,D,{get:B[D],enumerable:!0,configurable:!0,set:X.bind(B,D)})};var _=(q,B)=>()=>(q&&(B=q(q=0)),B);var $=import.meta.require;function N(){let q=new Set,B=typeof window<"u",D={width:B?window.innerWidth:0,height:B?window.innerHeight:0};if(B){let j=()=>{D={width:window.innerWidth,height:window.innerHeight};for(let F of q)try{F(D)}catch(G){console.error("[useWindowSize] Subscriber error:",G)}};window.addEventListener("resize",j,{passive:!0})}return{get width(){return D.width},get height(){return D.height},subscribe:(j)=>{return q.add(j),j(D),()=>q.delete(j)}}}function A(){let q=new Set,B=typeof window<"u",D={x:B?window.scrollX:0,y:B?window.scrollY:0};if(B){let j=()=>{D={x:window.scrollX,y:window.scrollY};for(let F of q)try{F(D)}catch(G){console.error("[useScroll] Subscriber error:",G)}};window.addEventListener("scroll",j,{passive:!0})}return{get x(){return D.x},get y(){return D.y},subscribe:(j)=>{return q.add(j),j(D),()=>q.delete(j)},scrollTo:(j,F)=>{if(!B)return;if(typeof j==="number")window.scrollTo(j,F??0);else window.scrollTo(j)},scrollToTop:()=>{if(!B)return;window.scrollTo({top:0,behavior:"smooth"})},scrollToBottom:()=>{if(!B)return;window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})}}}function M(){let q=new Set,B=typeof document<"u",D=B?document.visibilityState==="visible":!0;if(B)document.addEventListener("visibilitychange",()=>{D=document.visibilityState==="visible";for(let j of q)try{j(D)}catch(F){console.error("[useVisibility] Subscriber error:",F)}});return{get isVisible(){return D},subscribe:(j)=>{return q.add(j),j(D),()=>q.delete(j)}}}function R(q){let B=typeof document<"u";if(q&&B)document.title=q;return{get value(){return B?document.title:""},set value(D){if(B)document.title=D},set:(D)=>{if(B)document.title=D}}}function d(q){let B=typeof document<"u",D=()=>{if(!B)return null;let j=document.querySelector('link[rel*="icon"]');if(!j)j=document.createElement("link"),j.rel="icon",document.head.appendChild(j);return j};if(q){let j=D();if(j)j.href=q}return{get value(){return D()?.href||""},set value(j){let F=D();if(F)F.href=j},set:(j)=>{let F=D();if(F)F.href=j}}}export{N as useWindowSize,M as useVisibility,R as useTitle,A as useScroll,d as useFavicon};
