ext_libraries loader fetches botframework-webchat from CDN.
WebChatConfig.getBotPreferences() calls GET <apiUrl>/public/bot-deployments/<deploymentId> on hbf-core (up to 3 retries). The response is deep-merged with defaultBotProperties.
App() injects CSS custom properties from botPreferences.styleSetOptions via css-vars-ponyfill.
new BubbleWidget(...) is constructed. It finds or creates the host <div>, renders the floating button HTML, and optionally starts PreChatManager.
When the user first clicks the button, CoreWidget.setUpWebchat() fetches a Direct Line token from tokenURL, calls createDirectLine(token), registers all middlewares, and calls renderWebChat().
The webchat is now live. Subsequent messages flow over the Direct Line WebSocket to hbf-bot.
If botPreferences.widgetStyleSet.advancedChatPromptBubble.enable is true, BubbleWidget creates a PreChatManager instance before rendering the floating button.
PreChatManager renders a form collecting required user fields (name, email, etc.) inside the chat panel area.
On completion, PreChatManager.onComplete() calls BubbleWidget.onPreStepsComplete(), which calls setUpBubbleWebchat() and opens the Direct Line connection with the collected data passed as channel data on the greeting activity.