@xapp/chat-widget 1.97.0 → 1.97.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -321,13 +321,14 @@ const color_1 = color;
321
321
  /** Fallback when a crawl found no branding. Deliberately neutral. */
322
322
  const DEFAULT_PRIMARY = "#1AA7DC";
323
323
  function buildChatWidgetChannel(props) {
324
+ var _a;
324
325
  const { appId, apiUrl, mcpUrl, formWidgetKey, phoneNumber } = props;
326
+ const businessName = (_a = props.businessName) === null || _a === void 0 ? void 0 : _a.trim();
325
327
  // Only a colour whose contrast can actually be computed, so the background
326
328
  // and the text on it are always a matched pair rather than one scraped
327
329
  // value and one guess.
328
330
  const primaryColor = (0, color_1.usableColorOr)(props.primaryColor, DEFAULT_PRIMARY);
329
- return {
330
- type: "chat-widget",
331
+ return Object.assign({ type: "chat-widget",
331
332
  // MCP by default. The widget runs on a public page, so homeowner mode
332
333
  // — which is unauthenticated and carries the appId in the url — is the
333
334
  // only one that can work there; business_owner needs a token, and a
@@ -338,10 +339,7 @@ function buildChatWidgetChannel(props) {
338
339
  mcp: {
339
340
  mode: "homeowner"
340
341
  }
341
- },
342
- theme: buildChatTheme(primaryColor, props.secondaryColor),
343
- actionBar: buildActionBar({ apiUrl, formWidgetKey, phoneNumber })
344
- };
342
+ }, theme: buildChatTheme(primaryColor, props.secondaryColor), actionBar: buildActionBar({ apiUrl, formWidgetKey, phoneNumber }) }, (businessName ? { botName: businessName } : {}));
345
343
  }
346
344
  /**
347
345
  * The dock of buttons that replaces the plain chat bubble.