import{cH as E,bj as N}from"./index-DR3HTfO6.js";var c={},t={},p;function z(){if(p)return t;p=1,Object.defineProperty(t,"__esModule",{value:!0}),t.isNavigator=t.isBrowser=t.off=t.on=t.noop=void 0;var i=function(){};t.noop=i;function s(e){for(var a=[],r=1;r<arguments.length;r++)a[r-1]=arguments[r];e&&e.addEventListener&&e.addEventListener.apply(e,a)}t.on=s;function g(e){for(var a=[],r=1;r<arguments.length;r++)a[r-1]=arguments[r];e&&e.removeEventListener&&e.removeEventListener.apply(e,a)}return t.off=g,t.isBrowser=typeof window<"u",t.isNavigator=typeof navigator<"u",t}var y;function q(){if(y)return c;y=1,Object.defineProperty(c,"__esModule",{value:!0});var i=E(),s=z(),g=function(e,a,r){if(!s.isBrowser)return[a,s.noop,s.noop];if(!e)throw new Error("useLocalStorage key may not be falsy");var v=r?r.raw?function(o){return o}:r.deserializer:JSON.parse,l=i.useRef(function(o){try{var f=r?r.raw?String:r.serializer:JSON.stringify,n=localStorage.getItem(o);return n!==null?v(n):(a&&localStorage.setItem(o,f(a)),a)}catch{return a}}),d=i.useState(function(){return l.current(e)}),m=d[0],u=d[1];i.useLayoutEffect(function(){return u(l.current(e))},[e]);var L=i.useCallback(function(o){try{var f=typeof o=="function"?o(m):o;if(typeof f>"u")return;var n=void 0;r?r.raw?typeof f=="string"?n=f:n=JSON.stringify(f):r.serializer?n=r.serializer(f):n=JSON.stringify(f):n=JSON.stringify(f),localStorage.setItem(e,n),u(v(n))}catch{}},[e,u]),S=i.useCallback(function(){try{localStorage.removeItem(e),u(void 0)}catch{}},[e,u]);return[m,L,S]};return c.default=g,c}var J=q();const w=N(J);export{w as u};
