{"version":3,"file":"composables.cjs","sources":["../src/composables.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { PopupContext, RedirectContext, NativeContext } from './types';\n\nexport const STRIVACITY_SDK = createContext<PopupContext | RedirectContext | NativeContext>(null!);\n\n/**\n * Hook to access the Strivacity SDK context\n *\n * @template T Extends either PopupContext, RedirectContext or NativeContext.\n *\n * @returns {T} The current Strivacity SDK context.\n *\n * @throws {Error} If the context is not provided by an AuthProvider.\n */\nexport const useStrivacity = <T extends PopupContext | RedirectContext | NativeContext>() => {\n\tconst context = useContext(STRIVACITY_SDK);\n\n\tif (!context) {\n\t\tthrow new Error('Missing Strivacity SDK context');\n\t}\n\n\treturn context as T;\n};\n"],"names":["STRIVACITY_SDK","createContext","useStrivacity","context","useContext"],"mappings":"yGAGaA,EAAiBC,EAAAA,cAA8D,IAAK,EAWpFC,EAAgB,IAAgE,CAC5F,MAAMC,EAAUC,EAAAA,WAAWJ,CAAc,EAEzC,GAAI,CAACG,EACJ,MAAM,IAAI,MAAM,gCAAgC,EAGjD,OAAOA,CACR"}