# @morgan-and-morgan/intake-agent

Load the widget with a script tag, pinning an exact version:

```html
<script
  src="https://cdn.jsdelivr.net/npm/@morgan-and-morgan/intake-agent@<version>/dist/mm-intake-widget.js"
  data-chat-url="https://example.com/chat"
></script>
```

## Versions

semantic-release publishes on every merge that touches this package and picks
the version from the commit messages, so the `version` in `package.json` is a
placeholder, don't bump it by hand.

| Branch | Version | dist-tag |
| --- | --- | --- |
| `develop` | `x.y.z-alpha.N` | `alpha` |
| `release/**` | `x.y.z-beta.N` | `beta` |
| `main` | `x.y.z` | `latest` |

Each bundle also carries its matching chat environment: development for
`alpha`, UAT for `beta`, and production for `latest`. `data-chat-url` remains
an explicit override.

`fix:` bumps the patch, `feat:` the minor, a `BREAKING CHANGE:` footer the
major. Every release is tagged `intake-agent-vx.y.z`.

## Attributes

| Attribute | Default | Purpose |
| --- | --- | --- |
| `data-chat-url` | Release environment URL | Chat iframe target |
| `data-auto-open` | `false` | Open the chat immediately after mount |

The consultation modal reads `window.drupalSettings.mxPopup`, falling back to
`window.mxChatbotSettings.mxPopup` when the Drupal field is absent. Only the
boolean `false` suppresses the modal, including calls to `showPrompt()`.
Missing settings preserve the usual display rules. Settings are read when the
modal is about to appear; the launcher and chat remain available.
