{"version":3,"file":"Container.mjs","sources":["../../../../../../../../web/src/ui/b2c/Container.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\n\nimport Logo from '../components/atoms/Logo';\nimport MainContainer from '../components/molecules/MainContainer';\nimport { usePresentation } from '../components/PresentationConfig';\nimport { useIsOnlyFloatingOneTap } from '../hooks/useIsOnlyFloatingOneTap';\nimport { AppScreens, useConfig, useGlobalReducer } from './GlobalContextProvider';\nimport { MainScreen } from './screens/Main';\nimport { useProductComponents } from './utils';\n\nconst AppContainer: () => null | ReactNode = () => {\n  const [state] = useGlobalReducer();\n  const config = useConfig();\n  const { displayWatermark, theme, options } = usePresentation();\n  const isOnlyFloatingOneTap = useIsOnlyFloatingOneTap(config);\n  const currentScreen = state.screen;\n\n  const screenComponentMap = useProductComponents(config.products, 'screens');\n\n  if (isOnlyFloatingOneTap) {\n    const { FloatingOneTap } = screenComponentMap;\n    return <FloatingOneTap />;\n  }\n\n  // MainScreen is omitted from StytchProduct since it's used by everything\n  const ScreenComponent = currentScreen === AppScreens.Main ? MainScreen : screenComponentMap[currentScreen];\n  return (\n    <MainContainer theme={theme} displayWatermark={displayWatermark}>\n      {options.logo && <Logo appLogo={options.logo} />}\n\n      <ScreenComponent />\n    </MainContainer>\n  );\n};\n\nexport default AppContainer;\n"],"names":["AppContainer","state","useGlobalReducer","config","useConfig","displayWatermark","theme","options","usePresentation","isOnlyFloatingOneTap","useIsOnlyFloatingOneTap","currentScreen","screen","screenComponentMap","useProductComponents","products","FloatingOneTap","React","ScreenComponent","AppScreens","Main","MainScreen","MainContainer","logo","Logo","appLogo"],"mappings":";;;;;;;;;AAUA,MAAMA,cAAAA,GAAuC,IAAA;IAC3C,MAAM,CAACC,MAAM,GAAGC,gBAAAA,EAAAA;AAChB,IAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;AACf,IAAA,MAAM,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,OAAO,EAAE,GAAGC,eAAAA,EAAAA;AAC7C,IAAA,MAAMC,uBAAuBC,uBAAAA,CAAwBP,MAAAA,CAAAA;IACrD,MAAMQ,aAAAA,GAAgBV,MAAMW,MAAM;AAElC,IAAA,MAAMC,kBAAAA,GAAqBC,oBAAAA,CAAqBX,MAAAA,CAAOY,QAAQ,EAAE,SAAA,CAAA;AAEjE,IAAA,IAAIN,oBAAAA,EAAsB;QACxB,MAAM,EAAEO,cAAc,EAAE,GAAGH,kBAAAA;AAC3B,QAAA,qBAAOI,EAAA,CAAA,aAAA,CAACD,cAAAA,EAAAA,IAAAA,CAAAA;AACV,IAAA;;IAGA,MAAME,eAAAA,GAAkBP,kBAAkBQ,UAAAA,CAAWC,IAAI,GAAGC,UAAAA,GAAaR,kBAAkB,CAACF,aAAAA,CAAc;AAC1G,IAAA,qBACEM,EAAA,CAAA,aAAA,CAACK,aAAAA,EAAAA;QAAchB,KAAAA,EAAOA,KAAAA;QAAOD,gBAAAA,EAAkBA;OAC5CE,OAAAA,CAAQgB,IAAI,kBAAIN,EAAA,CAAA,aAAA,CAACO,IAAAA,EAAAA;AAAKC,QAAAA,OAAAA,EAASlB,QAAQgB;sBAExCN,EAAA,CAAA,aAAA,CAACC,eAAAA,EAAAA,IAAAA,CAAAA,CAAAA;AAGP;;;;"}