import wn from '../../../../../node_modules/preact/compat/dist/compat.module.mjs';
import { messages } from '../../messages/en.mjs';
import { readB2CInternals } from '../../utils/internal.mjs';
import { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper.mjs';
import { IDPContextProvider } from '../components/organisms/IDPContextProvider.mjs';
import { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig.mjs';
import { GlobalContextProvider, DEFAULT_STATE } from './GlobalContextProvider.mjs';
import { IDPConsentScreen } from './screens/IdentityProvider/IDPConsent.mjs';
import { useEffect as p } from '../../../../../node_modules/preact/hooks/dist/hooks.module.mjs';

const IDPContainer = ({ client, presentation, callbacks, strings, styles, getIDPConsentManifest, authTokenParams })=>{
    const presentationValue = usePresentationWithDefault(presentation, false, {
        products: []
    });
    p(()=>{
        readB2CInternals(client).bootstrap.getAsync().then((data)=>{
            readB2CInternals(client).networkClient.logEvent({
                name: 'render_idp_screen',
                details: {
                    bootstrap: data
                }
            });
        });
    }, [
        client
    ]);
    return /*#__PURE__*/ wn.createElement(GlobalContextProvider, {
        client: client,
        config: {},
        callbacks: callbacks,
        initialState: DEFAULT_STATE
    }, /*#__PURE__*/ wn.createElement(IDPContextProvider, {
        consentManifestGenerator: getIDPConsentManifest,
        authTokenParams: authTokenParams
    }, /*#__PURE__*/ wn.createElement(PresentationContext.Provider, {
        value: presentationValue
    }, /*#__PURE__*/ wn.createElement(I18nProviderWrapper, {
        messages: messages,
        overrides: strings
    }, /*#__PURE__*/ wn.createElement(IDPConsentScreen, null)))));
};

export { IDPContainer };
//# sourceMappingURL=IDPContainer.mjs.map
