{"version":3,"file":"useStytchUser.mjs","sources":["../../../../../../../../web/src/ui/hooks/useStytchUser.ts"],"sourcesContent":["import { User } from '@stytch/core/public';\nimport { useSyncExternalStore } from 'react';\n\nimport { useStytch } from '../b2c/GlobalContextProvider';\n\n// useStytchUser is a very lightweight copy-pasta of the hook from stytch-react\n// If we end up calling this in several places, consider hoisting to global context\nexport const useStytchUser = (): User | null => {\n  const stytch = useStytch();\n  return useSyncExternalStore(stytch.onStateChange, () => stytch.user.getSync());\n};\n"],"names":["useStytchUser","stytch","useStytch","useSyncExternalStore","onStateChange","user","getSync"],"mappings":";;;AAKA;AACA;MACaA,aAAAA,GAAgB,IAAA;AAC3B,IAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;IACf,OAAOC,EAAAA,CAAqBF,OAAOG,aAAa,EAAE,IAAMH,MAAAA,CAAOI,IAAI,CAACC,OAAO,EAAA,CAAA;AAC7E;;;;"}