{"version":3,"file":"touch-provider.NUe7-Ki0.js","sources":["../../../src/components/context/touch-provider.tsx"],"sourcesContent":["import { createContext, useSyncExternalStore, type PropsWithChildren } from 'react'\n\nexport const TouchContext = createContext(false)\n\nconst getClientSnapshot = () => {\n if (typeof window === 'undefined') return false\n return window.matchMedia('(pointer: coarse)').matches\n}\n\nexport const TouchProvider = ({ children }: PropsWithChildren) => {\n const isTouch = useSyncExternalStore(\n (subscribe) => {\n const mediaQuery = window.matchMedia('(pointer: coarse)')\n mediaQuery.addEventListener('change', subscribe)\n return () => mediaQuery.removeEventListener('change', subscribe)\n },\n // Client-side snapshot\n getClientSnapshot,\n // Server-side snapshot\n () => false\n )\n\n return {children}\n}\n"],"names":["TouchContext","createContext","getClientSnapshot","TouchProvider","children","isTouch","useSyncExternalStore","subscribe","mediaQuery"],"mappings":"0bAEa,MAAAA,EAAeC,gBAAuB,EAAK,EAElDC,EAAoB,IACpB,OAAO,OAAW,IAAoB,GACnC,OAAO,WAAW,mBAAmB,EAAE,QAGnCC,EAAgB,CAAC,CAAE,SAAAC,KAAkC,CAChE,MAAMC,EAAUC,EAAA,qBACbC,GAAc,CACP,MAAAC,EAAa,OAAO,WAAW,mBAAmB,EAC7C,OAAAA,EAAA,iBAAiB,SAAUD,CAAS,EACxC,IAAMC,EAAW,oBAAoB,SAAUD,CAAS,CACjE,EAEAL,EAEA,IAAM,EAAA,EAGR,aAAQF,EAAa,SAAb,CAAsB,MAAOK,EAAU,SAAAD,CAAS,CAAA,CAC1D"}