@outmarket-ai/react-sdk 0.6.0 → 0.7.0-alpha.0
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/README.md +179 -7
- package/dist/index.d.ts +26 -2
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -89,12 +89,52 @@ Using the SDK requires Outmarket's approval. See the `LICENSE` file in the packa
|
|
|
89
89
|
|
|
90
90
|
Mount it once and put the components inside it.
|
|
91
91
|
|
|
92
|
-
| Prop | Type | Description
|
|
93
|
-
| ----------- | ------------------------------------------- |
|
|
94
|
-
| `session` | `OutmarketSession` | Required. The `201` body from step 4, unchanged.
|
|
95
|
-
| `onReady` | `({ workflowsByModule, features }) => void` | Called once the user's workflows have loaded, and again if they change. `workflowsByModule`: the workflows the components can show, grouped by module, minus any your plan doesn't include. `features.vault`: whether the user can open the Vault. |
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
92
|
+
| Prop | Type | Description |
|
|
93
|
+
| ----------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
94
|
+
| `session` | `OutmarketSession` | Required. The `201` body from step 4, unchanged. |
|
|
95
|
+
| `onReady` | `({ workflowsByModule, features }) => void` | Called once the user's workflows have loaded, and again if they change. `workflowsByModule`: the workflows the components can show, grouped by module, minus any your plan doesn't include. `features.vault`: whether the user can open the Vault. `features.events`: whether the loaded components call `onEvent`. |
|
|
96
|
+
| `onEvent` | `(event: OutmarketEvent) => void` | Called once for each usage event. See [Usage events](#usage-events). |
|
|
97
|
+
| `colorMode` | `'light' \| 'dark' \| 'system'` | Color mode of the components. |
|
|
98
|
+
| `theme` | `{ primary?: string }` | Your brand color, as hex. |
|
|
99
|
+
|
|
100
|
+
### Usage events
|
|
101
|
+
|
|
102
|
+
Pass `onEvent` to `<OutmarketProvider>` to receive what users do in the components, for your
|
|
103
|
+
own analytics. Each event is a small object:
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
interface OutmarketEvent {
|
|
107
|
+
name: string; // e.g. 'workflow_run_started'
|
|
108
|
+
timestamp: number; // epoch milliseconds, browser clock
|
|
109
|
+
properties: Readonly<Record<string, string | number | boolean | readonly string[]>>;
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
- Only allow-listed events arrive. New event names and new properties can arrive with a
|
|
114
|
+
component update, with no new npm version: ignore names and keys you do not know. A
|
|
115
|
+
shipped event never loses or renames a property.
|
|
116
|
+
- Properties hold only ids of conversations (`conversation_id`), workflow codes
|
|
117
|
+
(`workflow_code`: a module code, or `custom_workflow` for a workflow your account made),
|
|
118
|
+
enums, counts, durations (`_ms`) and booleans. Never a user id, an email, a name, a file or
|
|
119
|
+
folder name, a path or message text: your page already knows who is signed in.
|
|
120
|
+
- `onEvent` is called in order, and synchronously once the user has loaded. Events sent before
|
|
121
|
+
that wait, then arrive in order. Keep it fast and queue slow work. A throw, or a
|
|
122
|
+
rejected promise from an async `onEvent`, is caught and logged once; the components keep working and the next event still arrives.
|
|
123
|
+
- One page has one event stream. With several providers, the newest mounted provider that
|
|
124
|
+
has `onEvent` gets the events of every component on the page. When it unmounts, the
|
|
125
|
+
provider mounted before it gets them again.
|
|
126
|
+
- A run's start and end events pair through `conversation_id`. A run can have no end
|
|
127
|
+
event, for example when the page reloads during the run.
|
|
128
|
+
- An older component version ignores `onEvent`. Check `features.events` in `onReady`.
|
|
129
|
+
- This is data minimisation, not a security boundary: the components run in your page.
|
|
130
|
+
- The SDK runtime reads Outmarket's PostHog key from Outmarket's CDN, published by CI from Secret
|
|
131
|
+
Manager. With a key, the embed sends each plan event to Outmarket's PostHog and to `onEvent`. It sends to PostHog also when you pass no `onEvent`. That PostHog is internal to
|
|
132
|
+
Outmarket: you never read it, and you get the events only through `onEvent`. It keeps its state
|
|
133
|
+
in memory only (no cookie, no `localStorage`), sends no browser page view, click or URL of your
|
|
134
|
+
page (the only views are the component screen events in the event list), uses its own
|
|
135
|
+
PostHog instance (never `window.posthog`), and sends nothing while a user is impersonated.
|
|
136
|
+
If your page blocks PostHog, the components and `onEvent` keep working.
|
|
137
|
+
The events and their properties are in [Event list](#event-list).
|
|
98
138
|
|
|
99
139
|
### Components
|
|
100
140
|
|
|
@@ -102,7 +142,7 @@ Mount it once and put the components inside it.
|
|
|
102
142
|
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
143
|
| `OutmarketWorkflowsList` | `module`: `'commercial_lines'`, `'personal_lines'` or `'benefits'`. `onSelectWorkflow(workflowId)`: called when the user picks a workflow. |
|
|
104
144
|
| `OutmarketWorkflowForm` | `workflowId`. `onConversationCreated(conversationId)`: called when the user runs the workflow. |
|
|
105
|
-
| `OutmarketWorkflowConversation` | `conversationId`.
|
|
145
|
+
| `OutmarketWorkflowConversation` | `conversationId`. `onRunStateChange(state, conversationId)`: called when the run starts (`'running'`), completes (`'complete'`) or fails (`'failed'`); on change only. |
|
|
106
146
|
| `OutmarketWorkflowHistory` | One scope: `workflowId` for one workflow's past runs, `module` (`'commercial_lines'`, `'personal_lines'` or `'benefits'`) for the runs of that module's workflows, or `vault` for the user's past Vault chats (see [Past chats](#past-chats)). Without one it shows "History unavailable". `onSelectConversation(conversationId)`: called when the user opens a past run or chat. |
|
|
107
147
|
| `OutmarketVault` | All optional. `location`: `{ tab: 'my' \| 'shared' \| 'team', path }`. `onLocationChange(location)`: called when the user opens a folder or switches tab. `onOpenConversation(conversationId)`: called when the user starts a chat. See [The Vault](#the-vault). |
|
|
108
148
|
|
|
@@ -242,6 +282,138 @@ Word, PowerPoint and `.xls` files preview in an iframe from Microsoft's Office v
|
|
|
242
282
|
`https://view.officeapps.live.com`, whose servers load the file from a link to show it. Other files,
|
|
243
283
|
`.xlsx` included, preview without it.
|
|
244
284
|
|
|
285
|
+
### Event list
|
|
286
|
+
|
|
287
|
+
The events that reach `onEvent`, with the component that sends each one. [Usage events](#usage-events) has the rules every event follows.
|
|
288
|
+
|
|
289
|
+
| Event | Component | Properties |
|
|
290
|
+
| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
291
|
+
| `workflow_selected` | `OutmarketWorkflowsList` | `workflow_code`, `was_search_active` (optional), `is_favorite` (optional) |
|
|
292
|
+
| `workflow_favorite_set` | `OutmarketWorkflowsList` | `workflow_code`, `is_favorite`, `favorites_count` |
|
|
293
|
+
| `workflow_start_mode_selected` | `OutmarketWorkflowForm` | `workflow_code`, `start_mode` (`documents`, `benefitpoint`, `market`) |
|
|
294
|
+
| `workflow_run_started` | `OutmarketWorkflowForm` | `conversation_id`, `workflow_code`, `start_mode` (`documents`, `benefitpoint`, `market`, `coi_single`, `coi_bulk`) (optional), `documents_count` (optional), `vault_documents_count` (optional), `file_kinds` (optional), `filled_fields_count` (optional), `has_additional_context` (optional), `was_saved_prompt_used` (optional), `was_prefilled` (optional), `plans_count` (optional), `launch_surface` (`workflow_page`, `first_run_guide`, `account`) (optional), `pages_count` (optional) |
|
|
295
|
+
| `workflow_run_start_failed` | `OutmarketWorkflowForm` | `workflow_code`, `failure_kind` |
|
|
296
|
+
| `workflow_input_document_added` | `OutmarketWorkflowForm` | `workflow_code`, `file_source` (`computer`, `vault`, `ams`, `cloud_drive`, `mixed`, `epic`, `imageright`, `nexsure`, `hawksoft`, `ams360`, `sagitta`, `qqcatalyst`, `google_drive`, `onedrive`), `vault_tab` (`my`, `shared`, `team`) (optional), `add_method` (`drop`, `browse`, `picker`) (optional), `documents_count`, `file_kinds`, `is_required_input` |
|
|
297
|
+
| `workflow_input_document_removed` | `OutmarketWorkflowForm` | `workflow_code`, `documents_count`, `removed_via` (`file_list`, `vault_picker`, `delete_all`, `failed_files`) |
|
|
298
|
+
| `workflow_input_document_blocked` | `OutmarketWorkflowForm` | `workflow_code`, `block_reason` (`file_type_unsupported`, `file_limit_reached`, `page_budget_exceeded`), `documents_count` |
|
|
299
|
+
| `workflow_input_duplicate_selected` | `OutmarketWorkflowForm` | `workflow_code`, `duplicate_choice` |
|
|
300
|
+
| `workflow_input_pdf_pages_selected` | `OutmarketWorkflowForm` | `workflow_code`, `pages_count` |
|
|
301
|
+
| `workflow_input_preference_applied` | `OutmarketWorkflowForm` | `workflow_code`, `preference_level` |
|
|
302
|
+
| `workflow_input_extraction_completed` | `OutmarketWorkflowForm` | `workflow_code` |
|
|
303
|
+
| `workflow_input_extraction_failed` | `OutmarketWorkflowForm` | `workflow_code`, `failure_kind` |
|
|
304
|
+
| `saved_prompt_applied` | `OutmarketWorkflowForm`, `OutmarketWorkflowConversation` | `surface`, `apply_source`, `prompt_level`, `workflow_code` (optional), `conversation_id` (optional) |
|
|
305
|
+
| `saved_prompt_library_opened` | `OutmarketWorkflowForm`, `OutmarketWorkflowConversation` | `surface` (`workflow_form`, `chat_composer`), `workflow_code` (optional), `conversation_id` (optional) |
|
|
306
|
+
| `saved_prompt_created` | `OutmarketWorkflowForm`, `OutmarketWorkflowConversation` | `create_source`, `prompt_level`, `tags_count`, `locations_count` |
|
|
307
|
+
| `saved_prompt_updated` | `OutmarketWorkflowForm`, `OutmarketWorkflowConversation` | `prompt_level` (`user`, `org`, `team`), `tags_count` |
|
|
308
|
+
| `saved_prompt_deleted` | `OutmarketWorkflowForm`, `OutmarketWorkflowConversation` | `prompt_levels`, `deleted_count` |
|
|
309
|
+
| `saved_prompt_shared` | `OutmarketWorkflowForm`, `OutmarketWorkflowConversation` | `recipients_count` |
|
|
310
|
+
| `workflow_artifact_exported` | `OutmarketWorkflowConversation` | `conversation_id` (optional), `conversation_kind` (`workflow`, `vault_chat`) (optional), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `export_format` (optional), `export_destination`, `export_scope` (`artifact`, `section`, `all`) (optional), `excel_mode` (`single`, `separate`) (optional), `exported_formats` (optional), `artifacts_count` (optional), `skipped_count` (optional), `attachments_count` (optional), `orientation_mode` (`auto`, `portrait`, `landscape`) (optional), `artifact_kind` (optional), `artifact_version_count` (optional), `is_latest_version` (optional), `has_cover_page` (optional), `surface` (`workflow_export_dialog`, `workflow_artifact_html_viewer`) (optional), `pages_count` (optional), `slides_count` (optional), `has_table_of_contents` (optional), `has_header_footer` (optional), `page_issues_count` (optional), `wait_ms` (optional), `custom_view` (`benefit_cost_analysis`, `self_funded_cost_analysis`, `contribution_analysis`, `renewal_planning`, `bill_reconciliation`, `bill_audit`, `census_comparison`, `sov_comparison`, `quote_comparer`) (optional) |
|
|
311
|
+
| `workflow_artifact_export_failed` | `OutmarketWorkflowConversation` | `conversation_id` (optional), `conversation_kind` (`workflow`, `vault_chat`) (optional), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `artifact_kind` (optional), `export_format`, `export_destination` (optional), `export_scope` (`artifact`, `section`, `all`) (optional), `surface` (optional), `failure_kind`, `wait_ms` (optional), `custom_view` (`benefit_cost_analysis`, `self_funded_cost_analysis`, `contribution_analysis`, `renewal_planning`, `bill_reconciliation`, `bill_audit`, `census_comparison`, `sov_comparison`, `quote_comparer`) (optional) |
|
|
312
|
+
| `workflow_artifact_selected` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `artifact_kind`, `open_via` (`chat_card`, `artifacts_list`, `tab`, `auto`), `artifacts_count`, `artifact_version_count` (optional), `is_latest_version` (optional) |
|
|
313
|
+
| `workflow_artifact_email_sent` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `recipients_count`, `has_cc`, `attachments_count` |
|
|
314
|
+
| `workflow_artifact_email_send_failed` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `failure_kind` |
|
|
315
|
+
| `workflow_artifact_export_started` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `export_format` (`pdf`, `docx`, `html`, `pptx`, `xlsx`, `csv`, `zip`) (optional), `export_destination` (`download`, `email`, `vault`, `epic`, `ams`, `google_drive`, `onedrive`, `template`, `account`, `imageright`, `nexsure`, `hawksoft`, `ams360`, `sagitta`, `qqcatalyst`), `export_scope` (`artifact`, `section`, `all`, `message`) (optional), `artifact_kind` (`markdown`, `html`, `file`, `email`, `dashboard`, `benefits_model`, `comparison`, `insights_report`, `acord_form`) (optional), `custom_view` (`benefit_cost_analysis`, `self_funded_cost_analysis`, `contribution_analysis`, `renewal_planning`, `bill_reconciliation`, `bill_audit`, `census_comparison`, `sov_comparison`, `quote_comparer`) (optional) |
|
|
316
|
+
| `workflow_artifact_export_opened` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `open_mode` (`download`, `preview`) |
|
|
317
|
+
| `workflow_artifact_feedback_submitted` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `artifact_kind` (optional), `feedback_kind` (`like`, `dislike`), `reasons_count`, `feedback_reasons` (optional), `has_comment` |
|
|
318
|
+
| `workflow_artifact_copied` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `artifact_kind` (optional), `copy_scope` (`artifact`, `section`) (optional), `custom_view` (`benefit_cost_analysis`, `self_funded_cost_analysis`, `contribution_analysis`, `renewal_planning`, `bill_reconciliation`, `bill_audit`, `census_comparison`, `sov_comparison`, `quote_comparer`) (optional), `plans_count` (optional) |
|
|
319
|
+
| `workflow_coi_decision_set` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `decision` (`approve`, `override`, `block`) |
|
|
320
|
+
| `workflow_coi_certificate_created` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional) |
|
|
321
|
+
| `workflow_run_completed` | `OutmarketWorkflowConversation` | `conversation_id`, `workflow_code`, `duration_ms` (optional) |
|
|
322
|
+
| `workflow_run_failed` | `OutmarketWorkflowConversation` | `conversation_id`, `workflow_code`, `failure_kind`, `duration_ms` (optional), `failure_stage` (`input_processing`, `extraction`, `generation`, `unknown`) (optional) |
|
|
323
|
+
| `workflow_run_cancelled` | `OutmarketWorkflowConversation` | `conversation_id`, `workflow_code` |
|
|
324
|
+
| `workflow_run_input_failed` | `OutmarketWorkflowConversation` | `conversation_id`, `workflow_code`, `failure_kind`, `failed_count` |
|
|
325
|
+
| `workflow_run_retry_started` | `OutmarketWorkflowConversation` | `conversation_id`, `workflow_code` |
|
|
326
|
+
| `workflow_conversation_opened` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional) |
|
|
327
|
+
| `workflow_conversation_message_added` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `prompt_origin` (optional), `attachments_count` (optional), `mentions_count` (optional), `was_dictated` (optional), `message_length` (optional), `is_first_message` (optional), `suggestion_position` (optional), `suggestions_count` (optional), `citations_count` (optional), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `conversation_age_days` (optional) |
|
|
328
|
+
| `workflow_conversation_message_cancelled` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `is_first_turn` |
|
|
329
|
+
| `workflow_conversation_message_failed` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `failure_kind` |
|
|
330
|
+
| `workflow_conversation_files_added` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `conversation_age_days` (optional), `file_source` (`computer`, `vault`, `ams`, `cloud_drive`, `mixed`, `epic`, `imageright`, `nexsure`, `hawksoft`, `ams360`, `sagitta`, `qqcatalyst`, `google_drive`, `onedrive`), `vault_tab` (`my`, `shared`, `team`) (optional), `add_method` (`drop`, `browse`, `paste`, `picker`), `files_count`, `file_kinds` |
|
|
331
|
+
| `workflow_conversation_message_copied` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional) |
|
|
332
|
+
| `workflow_conversation_message_feedback_submitted` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `feedback_kind` (`like`, `dislike`), `reasons_count`, `feedback_reasons` (optional), `has_comment` |
|
|
333
|
+
| `workflow_conversation_message_exported` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `export_format` (`pdf`, `docx`, `xlsx`), `export_destination` (`download`) |
|
|
334
|
+
| `workflow_panel_resized` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `panel` (`chat`), `width_bucket` (`narrow`, `medium`, `wide`) |
|
|
335
|
+
| `workflow_citation_opened` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `citation_surface` (`chat_message`, `artifact`, `html_artifact`), `source_kind`, `has_page`, `was_converted` |
|
|
336
|
+
| `workflow_citation_open_failed` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `citation_surface` (`chat_message`, `artifact`, `html_artifact`), `failure_kind` |
|
|
337
|
+
| `workflow_draft_created` | `OutmarketWorkflowConversation` | `conversation_id`, `draft_source` |
|
|
338
|
+
| `workflow_draft_create_failed` | `OutmarketWorkflowConversation` | `conversation_id`, `draft_source`, `failure_kind` |
|
|
339
|
+
| `workflow_source_file_exported` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `export_format` (`pdf`) |
|
|
340
|
+
| `workflow_conversation_selected` | `OutmarketWorkflowHistory` | `conversation_id`, `workflow_code` (optional) |
|
|
341
|
+
| `workflow_conversation_deleted` | `OutmarketWorkflowHistory` | `conversation_id`, `was_running` (optional) |
|
|
342
|
+
| `workflow_conversation_renamed` | `OutmarketWorkflowHistory` | `conversation_id` |
|
|
343
|
+
| `workflow_conversation_rename_failed` | `OutmarketWorkflowHistory` | `conversation_id`, `failure_kind` |
|
|
344
|
+
| `workflow_conversation_delete_failed` | `OutmarketWorkflowHistory` | `conversation_id`, `failure_kind` |
|
|
345
|
+
| `workflow_conversation_shared` | `OutmarketWorkflowHistory` | `conversation_id`, `recipients_added_count`, `edit_recipients_count`, `view_recipients_count` (optional), `team_recipients_count` (optional) |
|
|
346
|
+
| `workflow_conversation_share_blocked` | `OutmarketWorkflowHistory` | `conversation_id`, `block_reason` (`plan_missing_teams`) |
|
|
347
|
+
| `workflow_conversation_owner_set` | `OutmarketWorkflowHistory` | `conversation_id` |
|
|
348
|
+
| `workflow_history_empty_shown` | `OutmarketWorkflowHistory` | `history_scope` (`workflow`, `module`, `vault`), `duration_ms` |
|
|
349
|
+
| `workflow_history_load_failed` | `OutmarketWorkflowHistory` | `history_scope` (`workflow`, `module`, `vault`), `failure_kind` |
|
|
350
|
+
| `workflow_conversation_created` | `OutmarketVault` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `documents_count` (optional), `folders_count` (optional) |
|
|
351
|
+
| `workflow_conversation_create_failed` | `OutmarketVault` | `conversation_kind` (`workflow`, `vault_chat`), `failure_kind` |
|
|
352
|
+
| `workflow_artifact_opened` | `OutmarketWorkflowConversation` | `artifact_kind` (`markdown`, `html`, `file`, `email`, `dashboard`, `benefits_model`, `comparison`, `insights_report`, `acord_form`), `viewer_host` (`policy_checking`, `workflows`, `agent_tool`, `coi`, `extraction`, `assistant`, `risk_ai`, `document_builder`, `experts`, `insights_reports`, `vault`, `unknown`), `was_streamed`, `has_page_style`, `is_latest_version` (optional), `can_edit` |
|
|
353
|
+
| `workflow_artifact_edit_started` | `OutmarketWorkflowConversation` | `artifact_kind` (`markdown`, `html`, `file`, `email`, `dashboard`, `benefits_model`, `comparison`, `insights_report`, `acord_form`), `stored_changes_count` |
|
|
354
|
+
| `workflow_artifact_ai_edit_started` | `OutmarketWorkflowConversation` | `artifact_kind` (`markdown`, `html`, `file`, `email`, `dashboard`, `benefits_model`, `comparison`, `insights_report`, `acord_form`), `attachments_count`, `attachment_kinds` (`artifact_element`, `artifact_section`, `artifact_elements`, `artifact_text`, `artifact_table_part`, `artifact_document`) |
|
|
355
|
+
| `workflow_artifact_ai_edit_completed` | `OutmarketWorkflowConversation` | `artifact_kind` (`markdown`, `html`, `file`, `email`, `dashboard`, `benefits_model`, `comparison`, `insights_report`, `acord_form`), `ai_changes_count`, `ai_changes_received_count`, `was_deferred`, `wait_ms` (optional) |
|
|
356
|
+
| `workflow_artifact_ai_edit_failed` | `OutmarketWorkflowConversation` | `artifact_kind` (`markdown`, `html`, `file`, `email`, `dashboard`, `benefits_model`, `comparison`, `insights_report`, `acord_form`), `failure_kind` (`network`, `http_4xx`, `http_5xx`, `timeout`, `validation`, `rejected`, `unknown`, `invalid_result`) |
|
|
357
|
+
| `workflow_artifact_ai_edit_applied` | `OutmarketWorkflowConversation` | `artifact_kind` (`markdown`, `html`, `file`, `email`, `dashboard`, `benefits_model`, `comparison`, `insights_report`, `acord_form`), `ai_changes_count`, `pending_ai_changes_count`, `was_accept_all` |
|
|
358
|
+
| `workflow_artifact_ai_edit_apply_failed` | `OutmarketWorkflowConversation` | `artifact_kind` (`markdown`, `html`, `file`, `email`, `dashboard`, `benefits_model`, `comparison`, `insights_report`, `acord_form`), `ai_changes_count`, `was_accept_all`, `failure_kind` (`network`, `http_4xx`, `http_5xx`, `timeout`, `validation`, `rejected`, `unknown`, `cant_apply_together`, `check_crashed`, `refused`, `apply_crashed`) |
|
|
359
|
+
| `workflow_artifact_ai_edit_dismissed` | `OutmarketWorkflowConversation` | `artifact_kind` (`markdown`, `html`, `file`, `email`, `dashboard`, `benefits_model`, `comparison`, `insights_report`, `acord_form`), `ai_changes_count`, `pending_ai_changes_count`, `was_dismiss_all` |
|
|
360
|
+
| `workflow_conversation_message_export_failed` | `OutmarketWorkflowConversation` | `conversation_id`, `conversation_kind` (`workflow`, `vault_chat`), `workflow_code` (optional), `access_role` (`owner`, `shared_edit`, `shared_view`) (optional), `export_format` (`pdf`, `docx`, `xlsx`), `export_destination` (`download`), `failure_kind` (`network`, `http_4xx`, `http_5xx`, `timeout`, `validation`, `rejected`, `unknown`) |
|
|
361
|
+
| `workflow_conversation_share_failed` | `OutmarketWorkflowHistory` | `conversation_id`, `failure_kind` (`network`, `http_4xx`, `http_5xx`, `timeout`, `validation`, `rejected`, `unknown`) |
|
|
362
|
+
| `workflow_processed_data_opened` | `OutmarketWorkflowConversation`, `OutmarketVault` | `via` (`input_panel`, `exports_list`, `search_tool_row`, `vault`), `processed_tab` (`text`, `metadata`), `conversation_id` (optional), `conversation_kind` (`workflow`, `vault_chat`) (optional) |
|
|
363
|
+
| `workflow_processed_data_copied` | `OutmarketWorkflowConversation` | `via` (`input_panel`, `exports_list`, `search_tool_row`), `processed_tab` (`text`, `metadata`), `conversation_id` (optional), `conversation_kind` (`workflow`, `vault_chat`) (optional) |
|
|
364
|
+
| `vault_folder_opened` | `OutmarketVault` | `vault_tab` |
|
|
365
|
+
| `vault_folder_created` | `OutmarketVault` | `vault_tab`, `is_from_template` (optional), `create_via` (optional) |
|
|
366
|
+
| `vault_folder_load_failed` | `OutmarketVault` | `load_part`, `vault_tab`, `failure_kind` |
|
|
367
|
+
| `vault_folder_load_retry_started` | `OutmarketVault` | `load_part`, `vault_tab` |
|
|
368
|
+
| `vault_document_opened` | `OutmarketVault` | `vault_tab`, `open_mode` (`existing_preview`, `new_preview`), `file_kind` (optional) |
|
|
369
|
+
| `vault_document_added` | `OutmarketVault` | `documents_count`, `failed_count`, `file_kinds`, `vault_tab`, `upload_via` (optional) |
|
|
370
|
+
| `vault_document_upload_failed` | `OutmarketVault` | `failed_count`, `file_kinds`, `vault_tab`, `failure_kind` |
|
|
371
|
+
| `vault_document_upload_skipped` | `OutmarketVault` | `documents_count`, `skip_reason`, `vault_tab` |
|
|
372
|
+
| `vault_document_retry_started` | `OutmarketVault` | `vault_tab` |
|
|
373
|
+
| `vault_document_exported` | `OutmarketVault` | `documents_count`, `folders_count`, `vault_tab`, `export_via` (optional), `export_scope` (optional) |
|
|
374
|
+
| `vault_document_export_started` | `OutmarketVault` | `documents_count`, `folders_count`, `vault_tab` (`myAssets`, `sharedAssets`, `teamAssets`, `myEpic`, `ams`, `googleDrive`, `oneDrive`), `export_via` (`row_action`, `context_menu`, `selection_bar`) (optional) |
|
|
375
|
+
| `vault_document_export_failed` | `OutmarketVault` | `documents_count`, `folders_count`, `vault_tab`, `failure_kind` |
|
|
376
|
+
| `vault_asset_deleted` | `OutmarketVault` | `documents_count`, `folders_count`, `vault_tab` |
|
|
377
|
+
| `vault_asset_delete_failed` | `OutmarketVault` | `documents_count`, `folders_count`, `vault_tab`, `failed_count`, `failure_kind` |
|
|
378
|
+
| `vault_asset_moved` | `OutmarketVault` | `documents_count`, `folders_count`, `vault_tab`, `move_via` (optional) |
|
|
379
|
+
| `vault_asset_move_failed` | `OutmarketVault` | `documents_count`, `folders_count`, `vault_tab`, `failure_kind` |
|
|
380
|
+
| `vault_asset_renamed` | `OutmarketVault` | `asset_kind`, `vault_tab` |
|
|
381
|
+
| `vault_asset_rename_failed` | `OutmarketVault` | `asset_kind` (`file`, `folder`), `vault_tab` (`myAssets`, `sharedAssets`, `teamAssets`, `myEpic`, `ams`, `googleDrive`, `oneDrive`), `failure_kind` (`network`, `http_4xx`, `http_5xx`, `timeout`, `validation`, `rejected`, `unknown`) |
|
|
382
|
+
| `search_performed` | `OutmarketWorkflowsList`, `OutmarketWorkflowForm`, `OutmarketWorkflowConversation`, `OutmarketWorkflowHistory`, `OutmarketVault` | `surface` (`workflow_list`, `workflow_history`, `vault_assets`, …), `query_length`, `results_count` |
|
|
383
|
+
| `screen_viewed` | `OutmarketWorkflowsList`, `OutmarketWorkflowForm`, `OutmarketWorkflowConversation`, `OutmarketWorkflowHistory`, `OutmarketVault` | `screen` (`sdk_surface.workflows_list`, `sdk_surface.workflow_form`, `sdk_surface.workflow_conversation`, `sdk_surface.workflow_history`, `sdk_surface.vault`, `sdk_surface.vault_preview`, …) |
|
|
384
|
+
| `screen_left` | `OutmarketWorkflowsList`, `OutmarketWorkflowForm`, `OutmarketWorkflowConversation`, `OutmarketWorkflowHistory`, `OutmarketVault` | `screen`, `active_ms`, `visible_ms`, `wall_ms` |
|
|
385
|
+
| `sdk_surface_unavailable_shown` | `OutmarketWorkflowForm`, `OutmarketWorkflowConversation`, `OutmarketWorkflowHistory`, `OutmarketVault` | `unavailable_reason` (`no_scope`, `not_embeddable`, `not_in_plan`, `missing`, `module_not_enabled`, `not_found`, `access_denied`) |
|
|
386
|
+
|
|
387
|
+
- The same events fire in Outmarket's own app, so a component and the app page it wraps count
|
|
388
|
+
alike. The exception is `workflow_history_empty_shown`: it fires only in a component. In a component, only a workflow run or a Vault chat sends conversation events.
|
|
389
|
+
- A run's end event fires only when this page started the run (in `OutmarketWorkflowForm` or a
|
|
390
|
+
picker it shows) and an `OutmarketWorkflowConversation` shows it.
|
|
391
|
+
- `workflow_conversation_message_added` fires once per message the server took, when its reply
|
|
392
|
+
stream ends, not at the click. `prompt_origin` says where the text came from: typed, a saved
|
|
393
|
+
prompt, a suggestion chip, the answer to a question the workflow asked, a retry or a restored
|
|
394
|
+
draft. It carries `message_length` (the number of characters), never the text. A send the
|
|
395
|
+
server refuses fires only `workflow_conversation_message_failed`.
|
|
396
|
+
- `workflow_run_cancelled` fires when the user stops a run this page started and the server
|
|
397
|
+
accepts the stop. That run then gets no `workflow_run_completed` or `workflow_run_failed`. A
|
|
398
|
+
stop of the first turn also fires `workflow_conversation_message_cancelled`: never add the two.
|
|
399
|
+
- `*_failed` events carry `failure_kind`; an event may add its own values after the common ones.
|
|
400
|
+
- `search_performed` fires once per query, after the user stops typing and the results arrive.
|
|
401
|
+
It never carries the query text, only its length.
|
|
402
|
+
- `sdk_surface_unavailable_shown` fires once when a component shows its unavailable state.
|
|
403
|
+
- `workflow_artifact_export_started` fires once when the user confirms an export, before the file exists.
|
|
404
|
+
Its outcome event follows (for a text answer of the chat, `workflow_conversation_message_exported` or its
|
|
405
|
+
failure); a cancel after the confirm sends only the start.
|
|
406
|
+
- `workflow_processed_data_opened` fires when the user opens the processed data of a file, and again
|
|
407
|
+
each time the user changes its tab. It never carries the file name or the text.
|
|
408
|
+
- `screen_viewed` fires when a component mounts, and again when its view changes without a
|
|
409
|
+
remount: another conversation, a history of another scope, or a Vault file preview coming in
|
|
410
|
+
front of the listing or closing. `screen_left` fires for the view it replaces and when the
|
|
411
|
+
component unmounts, with the time spent (`active_ms` counts only time with the tab visible and
|
|
412
|
+
the user active). A component inside another one, such as an artifact viewer, can send its own
|
|
413
|
+
screen events in between.
|
|
414
|
+
- `vault_asset_deleted` fires only when every selected item was deleted; a partial delete fires
|
|
415
|
+
`vault_asset_delete_failed` with `failure_kind` `partial`.
|
|
416
|
+
|
|
245
417
|
### `signOut()`
|
|
246
418
|
|
|
247
419
|
Call it in your own logout, then discard the session you passed. It clears the session from your
|
package/dist/index.d.ts
CHANGED
|
@@ -18,8 +18,23 @@ export interface OutmarketWorkflowInfo {
|
|
|
18
18
|
* components can render, minus the plan-locked ones, grouped by module. */
|
|
19
19
|
export interface OutmarketReadyPayload {
|
|
20
20
|
workflowsByModule: Record<OutmarketModule, OutmarketWorkflowInfo[]>;
|
|
21
|
-
/** What else the session can open. `vault`: the user has the Vault and the plan includes it.
|
|
22
|
-
|
|
21
|
+
/** What else the session can open. `vault`: the user has the Vault and the plan includes it.
|
|
22
|
+
* `events`: the loaded runtime calls `onEvent`. False for a runtime from before events. */
|
|
23
|
+
features: { vault: boolean; events: boolean };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** One allow-listed usage event from an Outmarket component. */
|
|
27
|
+
export interface OutmarketEvent {
|
|
28
|
+
/** Tracking-plan event name, e.g. 'workflow_run_started'. New names can arrive through
|
|
29
|
+
* the CDN with no npm release. Ignore names you do not know. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** Epoch milliseconds (browser clock) when the action happened. */
|
|
32
|
+
timestamp: number;
|
|
33
|
+
/** Only these kinds: conversation_id, workflow_code (a module code, or 'custom_workflow'),
|
|
34
|
+
* enums, counts, durations (_ms), booleans. Never the Outmarket user id, email, instance id
|
|
35
|
+
* or name, file or folder names, paths, workflow titles, custom workflow names or message
|
|
36
|
+
* text. Null values are left out. Ignore keys you do not know. */
|
|
37
|
+
properties: Readonly<Record<string, string | number | boolean | readonly string[]>>;
|
|
23
38
|
}
|
|
24
39
|
|
|
25
40
|
/** Friendly title for each module. */
|
|
@@ -138,6 +153,13 @@ export interface OutmarketProviderProps {
|
|
|
138
153
|
/** Fires once bootstrap and the user resolve, with the workflows the components
|
|
139
154
|
* can render, minus the plan-locked ones, grouped by module; again if they change. */
|
|
140
155
|
onReady?: (payload: OutmarketReadyPayload) => void;
|
|
156
|
+
/** Called once for each allow-listed usage event, in order: synchronously, except that
|
|
157
|
+
* events sent before the user loads wait until it does.
|
|
158
|
+
* Keep it fast. A throw or a rejected promise is caught and never breaks a component.
|
|
159
|
+
* One page has one event stream: the newest mounted provider with onEvent gets the events
|
|
160
|
+
* of every surface on the page, and an older one gets them again when the newer one unmounts.
|
|
161
|
+
* An older runtime ignores this prop: check `features.events` in onReady. */
|
|
162
|
+
onEvent?: (event: OutmarketEvent) => void;
|
|
141
163
|
children?: ReactNode;
|
|
142
164
|
}
|
|
143
165
|
|
|
@@ -191,6 +213,8 @@ export declare function OutmarketWorkflowForm(props: OutmarketWorkflowFormProps)
|
|
|
191
213
|
/** The full conversation surface (chat, charts, artifacts, citations, PDF/source). */
|
|
192
214
|
export interface OutmarketWorkflowConversationProps {
|
|
193
215
|
conversationId: string;
|
|
216
|
+
/** Fires with this conversation's id when the run starts, completes or fails; on change only. */
|
|
217
|
+
onRunStateChange?: (state: 'running' | 'complete' | 'failed', conversationId: string) => void;
|
|
194
218
|
}
|
|
195
219
|
|
|
196
220
|
export declare function OutmarketWorkflowConversation(props: OutmarketWorkflowConversationProps): ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as tt,jsx as u}from"react/jsx-runtime";import{lazy as et,useState as rt,useLayoutEffect as P,useSyncExternalStore as nt,Suspense as O,useRef as ot,useCallback as it}from"react";const g="production",R=["production","qa","staging"],N={api:"NEXT_PUBLIC_API_BASE_URL",nexus:"NEXT_PUBLIC_NEXUS_BASE_URL",gateway:"NEXT_PUBLIC_GATEWAY_BASE_URL"},C={NODE_ENV:"production",NEXT_PUBLIC_PDF_WORKER_URL:"https://cdn.jsdelivr.net/npm/pdfjs-dist@4.10.38/build/pdf.worker.min.mjs"},w={production:{NEXT_PUBLIC_APP_ENV:"production",NEXT_PUBLIC_API_BASE_URL:"https://api.prod.outmarket.ai/v1",NEXT_PUBLIC_NEXUS_BASE_URL:"https://nexus.prod.outmarket.ai/api/v1",NEXT_PUBLIC_GATEWAY_BASE_URL:"https://gateway.outmarket.ai/api/v1",NEXT_PUBLIC_USE_OPTIMUS:"true",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX:"@outmarket",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY:"OYgxUAznYZZjedB08lRQ9i7BR5QaTRVF",NEXT_PUBLIC_STATSIG_CLIENT_KEY:"client-acTBiSi4StL0uGJe2dzAwS306PfF0hNLrMbYSmm3K2W"},qa:{NEXT_PUBLIC_APP_ENV:"qa",NEXT_PUBLIC_API_BASE_URL:"https://api-qa.outmarket.ai/v1",NEXT_PUBLIC_NEXUS_BASE_URL:"https://nexus-qa.outmarket.ai/api/v1",NEXT_PUBLIC_GATEWAY_BASE_URL:"https://gateway.stage.outmarket.ai/api/v1",NEXT_PUBLIC_USE_OPTIMUS:"true",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX:"@outmarket",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY:"OYgxUAznYZZjedB08lRQ9i7BR5QaTRVF",NEXT_PUBLIC_STATSIG_CLIENT_KEY:"client-acTBiSi4StL0uGJe2dzAwS306PfF0hNLrMbYSmm3K2W"},staging:{NEXT_PUBLIC_APP_ENV:"staging",NEXT_PUBLIC_API_BASE_URL:"https://api-g.stage.outmarket.ai/v1",NEXT_PUBLIC_NEXUS_BASE_URL:"https://nexus.stage.outmarket.ai/api/v1",NEXT_PUBLIC_GATEWAY_BASE_URL:"https://gateway.stage.outmarket.ai/api/v1",NEXT_PUBLIC_USE_OPTIMUS:"true",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX:"@outmarket",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY:"OYgxUAznYZZjedB08lRQ9i7BR5QaTRVF",NEXT_PUBLIC_STATSIG_CLIENT_KEY:"client-acTBiSi4StL0uGJe2dzAwS306PfF0hNLrMbYSmm3K2W"}},at={production:{...C,...w.production}},st=at.production,E="[@outmarket-ai/react-sdk]",y='an absolute http(s) URL ("https://host/path") or a root-relative path ("/path")',B="http://root-relative.invalid",ut=t=>typeof t=="string"&&R.includes(t),ct=Object.keys(N),lt=t=>ct.includes(t),b=t=>typeof t=="string"?JSON.stringify(t):t===null?"null":typeof t;function dt(t,e){try{return new URL(t,e)}catch{return null}}function ft(t){if(typeof t!="string")return{error:`expected a string, got ${b(t)}`};const e=t.trim();if(!e)return{error:"it is empty"};const r=e.startsWith("/"),o=dt(e,r?B:void 0);if(!o)return{error:`expected ${y}`};if(r&&o.origin!==B)return{error:`a path must start with a single "/" (a value starting "//" points at another host); expected ${y}`};if(!r&&o.protocol!=="http:"&&o.protocol!=="https:")return{error:`only http and https are supported; expected ${y}`};if(o.username||o.password)return{error:"it must not carry credentials"};if(e.includes("?")||e.includes("#"))return{error:"it must not carry a query or fragment"};const n=(r?e:o.href).replace(/\/+$/,"");return n?{url:n}:{error:'a bare "/" is not a base URL; include the path, e.g. "/proxy/api/v1"'}}function mt(t,e){return t===void 0||ut(t)?t??g:(e(`${E} Ignoring environment ${b(t)}: expected ${R.map(r=>`'${r}'`).join(", ")}. Using '${g}'.`),g)}function _t(t,e,r){if(t===void 0)return{};if(t===null||typeof t!="object"||Array.isArray(t))return r(`${E} Ignoring apiUrls: expected an object such as { nexus: 'https://\u2026' }.`),{};const o={};for(const[n,i]of Object.entries(t)){if(!lt(n)){r(`${E} Ignoring apiUrls.${n}: not an Outmarket API (expected api, nexus or gateway).`);continue}if(i===void 0)continue;const a=N[n],s=ft(i);if(s.url!==void 0){o[a]=s.url;continue}r(`${E} Ignoring apiUrls.${n}: ${s.error}. Using the '${e}' URL instead: ${w[e][a]}.`)}return o}function pt(t){return t===void 0?!1:t===null||typeof t!="object"||Array.isArray(t)?!0:Object.values(t).some(e=>e!==void 0)}function ht(t,e){const{environment:r,apiUrls:o}=t;if(r===void 0&&!pt(o))return{};const n=mt(r,e);return{...w[n],..._t(o,n,e)}}const v="__OM_EMBED_CONFIG__",Et="[@outmarket-ai/react-sdk]";function S(){const t=globalThis;return t[v]||(t[v]={}),t[v]}function X(){if(typeof globalThis>"u")return;const t=S();for(const[e,r]of Object.entries(st))t[e]===void 0&&r!==void 0&&(t[e]=r)}let m=null,M=!1;const x=new Set;function Ut(t){x.has(t)||(x.add(t),console.error(t))}function j(t){return JSON.stringify(Object.keys(t).sort().map(e=>[e,t[e]]))}function Lt(t){M||(M=!0,console.warn(`${Et} OutmarketProvider got an environment or apiUrls that differs from the configuration this page already uses. The SDK applies its configuration once per page load (when the first OutmarketProvider mounts, or on the first signOut() if that came first); reload the page to use the new one. Still using api ${t.NEXT_PUBLIC_API_BASE_URL}, nexus ${t.NEXT_PUBLIC_NEXUS_BASE_URL}, gateway ${t.NEXT_PUBLIC_GATEWAY_BASE_URL}.`))}function T(t){const e=ht(t,Ut),r=S();if(m===null){X();const o={...r};Object.assign(r,e),m={base:o,signature:j(r)};return}j({...m.base,...e})!==m.signature&&Lt(r)}function gt(){m===null&&T({})}X();const wt="245 84% 64%",W="14 100% 57%",A=`hsl(var(--om-primary, ${wt}))`,yt=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function vt({colorMode:t="light",theme:e}={}){var r;const o=(r=e==null?void 0:e.primary)==null?void 0:r.trim(),n=o?yt.exec(o):null;return n?`#${n[1]}`:t==="dark"?`hsl(${W})`:t==="system"?`light-dark(${A}, hsl(${W}))`:A}const Y={flex:1,minHeight:320,display:"flex",alignItems:"center",justifyContent:"center"},St={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},F=40,Tt="light dark";function G({color:t=A}){return tt("div",{role:"status","aria-live":"polite","data-testid":"om-embed-loading",style:Y,children:[u("span",{style:St,children:"Loading\u2026"}),u("svg",{"aria-hidden":"true","data-testid":"om-embed-loading-spinner",width:F,height:F,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{color:t,colorScheme:Tt},children:u("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",children:u("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"360 12 12",dur:"1s",repeatCount:"indefinite"})})})]})}function At(){return u("div",{role:"alert","data-testid":"om-embed-load-failed",style:{...Y,padding:16,textAlign:"center"},children:"Outmarket could not load. Check your connection and reload the page."})}const K="OM_SDK_RUNTIME_CDN_URL",kt="OM_SDK_RUNTIME_VERSION",k="https://embed.outmarket.ai/react-sdk",$t=new Set(["localhost","127.0.0.1"]);function It(t){if(typeof t!="string")return null;let e;try{e=new URL(t)}catch{return null}return!(e.protocol==="https:"||e.protocol==="http:"&&$t.has(e.hostname))||e.username||e.password||e.search||e.hash?null:`${e.origin}${e.pathname.replace(/\/+$/,"")}`}function Pt(t,e){if(t===void 0||t==="")return k;const r=It(t);return r!==null?r:(e(`[@outmarket-ai/react-sdk] Ignoring ${K} ${JSON.stringify(t)}: expected an https: URL (or http: on localhost / 127.0.0.1) without credentials, query or fragment. Using ${k}.`),k)}function Ot(t,e=console.error){const r=t[kt];return{base:Pt(t[K],e),pin:r===void 0||r===""?void 0:String(r),appEnv:t.NEXT_PUBLIC_APP_ENV}}async function D(t,{timeoutMs:e,cache:r,fetchImpl:o=globalThis.fetch}){const n=new AbortController,i=setTimeout(()=>n.abort(),e);try{let a;try{a=await o(t,{cache:r,credentials:"omit",signal:n.signal})}catch(s){throw new Error(n.signal.aborted?`${t} did not answer within ${e} ms`:`${t} could not be fetched: ${String(s)}`)}if(!a.ok)throw new Error(`${t} answered HTTP ${a.status}`);try{return await a.json()}catch{throw new Error(n.signal.aborted?`${t} did not answer within ${e} ms`:`${t} is not JSON`)}}finally{clearTimeout(i)}}async function Rt(){const[t,e,r,o,n]=await Promise.all([import("react"),import("react/jsx-runtime"),import("react-dom"),import("react-dom/client"),import("react-dom/server")]);return{react:t,"react/jsx-runtime":e,"react-dom":r,"react-dom/client":o,"react-dom/server":n}}function Nt(t){return import(/* webpackIgnore: true */ /* turbopackIgnore: true */ /* @vite-ignore */ t)}const Ct=/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/,Bt=1e4;function bt(t){return t==="staging"?"alpha":t==="qa"?"beta":"stable"}function V(t,e){if(typeof t=="string"&&Ct.test(t))return t;throw new Error(`${e} is ${JSON.stringify(t)??String(t)}, not a runtime version`)}async function Xt({base:t,pin:e,appEnv:r,fetchImpl:o,timeoutMs:n=Bt}){if(e!==void 0)return V(e,"OM_SDK_RUNTIME_VERSION");const i=`${t}/versions.json`,a=await D(i,{cache:"no-cache",timeoutMs:n,fetchImpl:o});if(a===null||typeof a!="object"||Array.isArray(a))throw new Error(`${i} is not an object of versions`);const s=bt(r);return V(a[s],`${i} "${s}"`)}const H="data-om-embed-runtime",U=Symbol.for("outmarket.embed.stylesheetWaiters");function Mt(t,e){return[...e.querySelectorAll(`link[${H}]`)].find(r=>r.getAttribute("href")===t)}function xt(t,e,r){const o=Mt(t,r);if(o!=null&&o.sheet)return Promise.resolve();const n=o??r.createElement("link");return n[U]=(n[U]??0)+1,new Promise((i,a)=>{const s=l=>{clearTimeout(h),n.removeEventListener("load",d),n.removeEventListener("error",c);const f=(n[U]??1)-1;if(n[U]=f,l==="load"){i();return}(l==="error"||f===0)&&n.remove(),a(new Error(l==="error"?`${t} could not be loaded`:`${t} did not load within ${e} ms`))},d=()=>s("load"),c=()=>s("error"),h=setTimeout(()=>s("timeout"),e);n.addEventListener("load",d),n.addEventListener("error",c),o||(n.rel="stylesheet",n.href=t,n.setAttribute(H,""),r.head.appendChild(n))})}async function jt(t,e,r=document){await Promise.all(t.map(o=>xt(o,e,r)))}const z=1,Wt=()=>({fetchImpl:globalThis.fetch,loadHostReact:Rt,importModule:Nt,document,timeouts:{versionsMs:1e4,manifestMs:1e4,cssMs:3e4,entryMs:3e4}});let L;const Yt=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/,$=t=>typeof t=="string"&&t.split("/").every(e=>Yt.test(e));function Ft(t,e,r){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${r} is not a runtime manifest`);const o=t;if(o.version!==e)throw new Error(`${r} is for version ${JSON.stringify(o.version)}, not ${e}`);const{entry:n,worker:i,css:a}=o;if(!$(n))throw new Error(`${r} has no valid "entry"`);if(!$(i))throw new Error(`${r} has no valid "worker"`);if(!Array.isArray(a)||!a.every($))throw new Error(`${r} has no valid "css"`);return{version:e,entry:n,worker:i,css:a}}async function Gt(t,e,r,o){const n=t==null?void 0:t.boot;if(typeof n!="function")throw new Error(`${e} does not export boot()`);const i=await n(r);if((i==null?void 0:i.contractVersion)!==z)throw new Error(`the CDN runtime ${o} implements runtime contract ${String(i==null?void 0:i.contractVersion)}; this SDK needs ${z}`);return i}async function Kt(t,e,r){const[o,n]=await Promise.all([t.loadHostReact(),t.importModule(e)]);return Gt(n,e,o,r)}function Dt(t,e,r){let o;const n=new Promise((i,a)=>{o=setTimeout(()=>a(new Error(r)),e)});return Promise.race([t,n]).finally(()=>clearTimeout(o))}async function Vt(t,e,r={}){const o={...Wt(),...r},{fetchImpl:n,timeouts:i}=o,a=await Xt({...t,fetchImpl:n,timeoutMs:i.versionsMs}),s=`${t.base}/${a}`,d=`${s}/manifest.json`,c=Ft(await D(d,{timeoutMs:i.manifestMs,fetchImpl:n}),a,d),h=jt(c.css.map(Q=>`${s}/${Q}`),i.cssMs,o.document);h.catch(()=>{});const l=e.NEXT_PUBLIC_PDF_WORKER_URL;(l===C.NEXT_PUBLIC_PDF_WORKER_URL||L!==void 0&&l===L)&&(L=`${s}/${c.worker}`,e.NEXT_PUBLIC_PDF_WORKER_URL=L);const f=`${s}/${c.entry}`,Z=await Dt(Kt(o,f,a),i.entryMs,`${f} did not load within ${i.entryMs} ms`);return await h,globalThis.__OM_EMBED__={source:"cdn",base:t.base,version:a},Z}let _=null,I=null;function q(){if(_===null){gt();const t=S();I??(I=Ot(t));const e=Vt(I,t);e.catch(()=>{_===e&&(_=null)}),_=e}return _}function J(t){return et(async()=>{try{return{default:await t(await q())}}catch(e){return console.error("[@outmarket-ai/react-sdk] Could not load the Outmarket components.",e),{default:At}}})}const Ht={vault:!1};function zt(t){return{...t,features:{...Ht,...t.features}}}function qt(t,e){const[r,o]=rt(!1);return P(()=>{T({environment:t,apiUrls:e}),o(!0)},[t,e]),r}const Jt=J(t=>t.OutmarketProviderTree),Zt=()=>()=>{},Qt=()=>!0,te=()=>!1;function ee(t){const e=ot(t);P(()=>{e.current=t});const r=it(o=>{var n;return(n=e.current)==null?void 0:n.call(e,zt(o))},[]);return t?r:void 0}function re({environment:t,apiUrls:e,...r}){const o=ee(r.onReady),n=nt(Zt,Qt,te),i=qt(t,e),a=u(G,{color:vt(r)});return!n||!i?a:u(O,{fallback:a,children:u(Jt,{...r,onReady:o})})}async function ne(t){typeof window>"u"||(t&&T({environment:t.environment,apiUrls:t.apiUrls}),await(await q()).signOut())}function p(t,e){const r=J(n=>e(n.surfaces));function o(n){return u(O,{fallback:u(G,{}),children:u(r,{...n})})}return o.displayName=t,o}const oe=p("OutmarketWorkflowsList",t=>t.OutmarketWorkflowsList()),ie=p("OutmarketWorkflowForm",t=>t.OutmarketWorkflowForm()),ae=p("OutmarketWorkflowConversation",t=>t.OutmarketWorkflowConversation()),se=p("OutmarketWorkflowHistory",t=>t.OutmarketWorkflowHistory()),ue=p("OutmarketVault",t=>t.OutmarketVault()),ce={commercial_lines:"Commercial Insurance",personal_lines:"Personal Lines",benefits:"Employee Benefits"};export{ce as MODULE_TITLE,re as OutmarketProvider,ue as OutmarketVault,ae as OutmarketWorkflowConversation,ie as OutmarketWorkflowForm,se as OutmarketWorkflowHistory,oe as OutmarketWorkflowsList,ne as signOut};
|
|
1
|
+
import{jsxs as tt,jsx as u}from"react/jsx-runtime";import{lazy as et,useState as rt,useLayoutEffect as P,useSyncExternalStore as nt,Suspense as O,useRef as ot,useCallback as it}from"react";const g="production",R=["production","qa","staging"],N={api:"NEXT_PUBLIC_API_BASE_URL",nexus:"NEXT_PUBLIC_NEXUS_BASE_URL",gateway:"NEXT_PUBLIC_GATEWAY_BASE_URL"},C={NODE_ENV:"production",NEXT_PUBLIC_PDF_WORKER_URL:"https://cdn.jsdelivr.net/npm/pdfjs-dist@4.10.38/build/pdf.worker.min.mjs"},w={production:{NEXT_PUBLIC_APP_ENV:"production",NEXT_PUBLIC_API_BASE_URL:"https://api.prod.outmarket.ai/v1",NEXT_PUBLIC_NEXUS_BASE_URL:"https://nexus.prod.outmarket.ai/api/v1",NEXT_PUBLIC_GATEWAY_BASE_URL:"https://gateway.outmarket.ai/api/v1",NEXT_PUBLIC_USE_OPTIMUS:"true",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX:"@outmarket",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY:"OYgxUAznYZZjedB08lRQ9i7BR5QaTRVF",NEXT_PUBLIC_STATSIG_CLIENT_KEY:"client-acTBiSi4StL0uGJe2dzAwS306PfF0hNLrMbYSmm3K2W"},qa:{NEXT_PUBLIC_APP_ENV:"qa",NEXT_PUBLIC_API_BASE_URL:"https://api-qa.outmarket.ai/v1",NEXT_PUBLIC_NEXUS_BASE_URL:"https://nexus-qa.outmarket.ai/api/v1",NEXT_PUBLIC_GATEWAY_BASE_URL:"https://gateway.stage.outmarket.ai/api/v1",NEXT_PUBLIC_USE_OPTIMUS:"true",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX:"@outmarket",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY:"OYgxUAznYZZjedB08lRQ9i7BR5QaTRVF",NEXT_PUBLIC_STATSIG_CLIENT_KEY:"client-acTBiSi4StL0uGJe2dzAwS306PfF0hNLrMbYSmm3K2W"},staging:{NEXT_PUBLIC_APP_ENV:"staging",NEXT_PUBLIC_API_BASE_URL:"https://api-g.stage.outmarket.ai/v1",NEXT_PUBLIC_NEXUS_BASE_URL:"https://nexus.stage.outmarket.ai/api/v1",NEXT_PUBLIC_GATEWAY_BASE_URL:"https://gateway.stage.outmarket.ai/api/v1",NEXT_PUBLIC_USE_OPTIMUS:"true",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX:"@outmarket",NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY:"OYgxUAznYZZjedB08lRQ9i7BR5QaTRVF",NEXT_PUBLIC_STATSIG_CLIENT_KEY:"client-acTBiSi4StL0uGJe2dzAwS306PfF0hNLrMbYSmm3K2W"}},at={production:{...C,...w.production}},st=at.production,E="[@outmarket-ai/react-sdk]",y='an absolute http(s) URL ("https://host/path") or a root-relative path ("/path")',B="http://root-relative.invalid",ut=t=>typeof t=="string"&&R.includes(t),ct=Object.keys(N),lt=t=>ct.includes(t),b=t=>typeof t=="string"?JSON.stringify(t):t===null?"null":typeof t;function dt(t,e){try{return new URL(t,e)}catch{return null}}function ft(t){if(typeof t!="string")return{error:`expected a string, got ${b(t)}`};const e=t.trim();if(!e)return{error:"it is empty"};const r=e.startsWith("/"),o=dt(e,r?B:void 0);if(!o)return{error:`expected ${y}`};if(r&&o.origin!==B)return{error:`a path must start with a single "/" (a value starting "//" points at another host); expected ${y}`};if(!r&&o.protocol!=="http:"&&o.protocol!=="https:")return{error:`only http and https are supported; expected ${y}`};if(o.username||o.password)return{error:"it must not carry credentials"};if(e.includes("?")||e.includes("#"))return{error:"it must not carry a query or fragment"};const n=(r?e:o.href).replace(/\/+$/,"");return n?{url:n}:{error:'a bare "/" is not a base URL; include the path, e.g. "/proxy/api/v1"'}}function mt(t,e){return t===void 0||ut(t)?t??g:(e(`${E} Ignoring environment ${b(t)}: expected ${R.map(r=>`'${r}'`).join(", ")}. Using '${g}'.`),g)}function _t(t,e,r){if(t===void 0)return{};if(t===null||typeof t!="object"||Array.isArray(t))return r(`${E} Ignoring apiUrls: expected an object such as { nexus: 'https://\u2026' }.`),{};const o={};for(const[n,i]of Object.entries(t)){if(!lt(n)){r(`${E} Ignoring apiUrls.${n}: not an Outmarket API (expected api, nexus or gateway).`);continue}if(i===void 0)continue;const a=N[n],s=ft(i);if(s.url!==void 0){o[a]=s.url;continue}r(`${E} Ignoring apiUrls.${n}: ${s.error}. Using the '${e}' URL instead: ${w[e][a]}.`)}return o}function pt(t){return t===void 0?!1:t===null||typeof t!="object"||Array.isArray(t)?!0:Object.values(t).some(e=>e!==void 0)}function ht(t,e){const{environment:r,apiUrls:o}=t;if(r===void 0&&!pt(o))return{};const n=mt(r,e);return{...w[n],..._t(o,n,e)}}const v="__OM_EMBED_CONFIG__",Et="[@outmarket-ai/react-sdk]";function S(){const t=globalThis;return t[v]||(t[v]={}),t[v]}function X(){if(typeof globalThis>"u")return;const t=S();for(const[e,r]of Object.entries(st))t[e]===void 0&&r!==void 0&&(t[e]=r)}let m=null,M=!1;const x=new Set;function Ut(t){x.has(t)||(x.add(t),console.error(t))}function j(t){return JSON.stringify(Object.keys(t).sort().map(e=>[e,t[e]]))}function Lt(t){M||(M=!0,console.warn(`${Et} OutmarketProvider got an environment or apiUrls that differs from the configuration this page already uses. The SDK applies its configuration once per page load (when the first OutmarketProvider mounts, or on the first signOut() if that came first); reload the page to use the new one. Still using api ${t.NEXT_PUBLIC_API_BASE_URL}, nexus ${t.NEXT_PUBLIC_NEXUS_BASE_URL}, gateway ${t.NEXT_PUBLIC_GATEWAY_BASE_URL}.`))}function T(t){const e=ht(t,Ut),r=S();if(m===null){X();const o={...r};Object.assign(r,e),m={base:o,signature:j(r)};return}j({...m.base,...e})!==m.signature&&Lt(r)}function gt(){m===null&&T({})}X();const wt="245 84% 64%",W="14 100% 57%",A=`hsl(var(--om-primary, ${wt}))`,yt=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function vt({colorMode:t="light",theme:e}={}){var r;const o=(r=e==null?void 0:e.primary)==null?void 0:r.trim(),n=o?yt.exec(o):null;return n?`#${n[1]}`:t==="dark"?`hsl(${W})`:t==="system"?`light-dark(${A}, hsl(${W}))`:A}const Y={flex:1,minHeight:320,display:"flex",alignItems:"center",justifyContent:"center"},St={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},F=40,Tt="light dark";function G({color:t=A}){return tt("div",{role:"status","aria-live":"polite","data-testid":"om-embed-loading",style:Y,children:[u("span",{style:St,children:"Loading\u2026"}),u("svg",{"aria-hidden":"true","data-testid":"om-embed-loading-spinner",width:F,height:F,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{color:t,colorScheme:Tt},children:u("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",children:u("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"360 12 12",dur:"1s",repeatCount:"indefinite"})})})]})}function At(){return u("div",{role:"alert","data-testid":"om-embed-load-failed",style:{...Y,padding:16,textAlign:"center"},children:"Outmarket could not load. Check your connection and reload the page."})}const K="OM_SDK_RUNTIME_CDN_URL",kt="OM_SDK_RUNTIME_VERSION",k="https://embed.outmarket.ai/react-sdk",$t=new Set(["localhost","127.0.0.1"]);function It(t){if(typeof t!="string")return null;let e;try{e=new URL(t)}catch{return null}return!(e.protocol==="https:"||e.protocol==="http:"&&$t.has(e.hostname))||e.username||e.password||e.search||e.hash?null:`${e.origin}${e.pathname.replace(/\/+$/,"")}`}function Pt(t,e){if(t===void 0||t==="")return k;const r=It(t);return r!==null?r:(e(`[@outmarket-ai/react-sdk] Ignoring ${K} ${JSON.stringify(t)}: expected an https: URL (or http: on localhost / 127.0.0.1) without credentials, query or fragment. Using ${k}.`),k)}function Ot(t,e=console.error){const r=t[kt];return{base:Pt(t[K],e),pin:r===void 0||r===""?void 0:String(r),appEnv:t.NEXT_PUBLIC_APP_ENV}}async function D(t,{timeoutMs:e,cache:r,fetchImpl:o=globalThis.fetch}){const n=new AbortController,i=setTimeout(()=>n.abort(),e);try{let a;try{a=await o(t,{cache:r,credentials:"omit",signal:n.signal})}catch(s){throw new Error(n.signal.aborted?`${t} did not answer within ${e} ms`:`${t} could not be fetched: ${String(s)}`)}if(!a.ok)throw new Error(`${t} answered HTTP ${a.status}`);try{return await a.json()}catch{throw new Error(n.signal.aborted?`${t} did not answer within ${e} ms`:`${t} is not JSON`)}}finally{clearTimeout(i)}}async function Rt(){const[t,e,r,o,n]=await Promise.all([import("react"),import("react/jsx-runtime"),import("react-dom"),import("react-dom/client"),import("react-dom/server")]);return{react:t,"react/jsx-runtime":e,"react-dom":r,"react-dom/client":o,"react-dom/server":n}}function Nt(t){return import(/* webpackIgnore: true */ /* turbopackIgnore: true */ /* @vite-ignore */ t)}const Ct=/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/,Bt=1e4;function bt(t){return t==="staging"?"alpha":t==="qa"?"beta":"stable"}function V(t,e){if(typeof t=="string"&&Ct.test(t))return t;throw new Error(`${e} is ${JSON.stringify(t)??String(t)}, not a runtime version`)}async function Xt({base:t,pin:e,appEnv:r,fetchImpl:o,timeoutMs:n=Bt}){if(e!==void 0)return V(e,"OM_SDK_RUNTIME_VERSION");const i=`${t}/versions.json`,a=await D(i,{cache:"no-cache",timeoutMs:n,fetchImpl:o});if(a===null||typeof a!="object"||Array.isArray(a))throw new Error(`${i} is not an object of versions`);const s=bt(r);return V(a[s],`${i} "${s}"`)}const H="data-om-embed-runtime",U=Symbol.for("outmarket.embed.stylesheetWaiters");function Mt(t,e){return[...e.querySelectorAll(`link[${H}]`)].find(r=>r.getAttribute("href")===t)}function xt(t,e,r){const o=Mt(t,r);if(o!=null&&o.sheet)return Promise.resolve();const n=o??r.createElement("link");return n[U]=(n[U]??0)+1,new Promise((i,a)=>{const s=l=>{clearTimeout(h),n.removeEventListener("load",d),n.removeEventListener("error",c);const f=(n[U]??1)-1;if(n[U]=f,l==="load"){i();return}(l==="error"||f===0)&&n.remove(),a(new Error(l==="error"?`${t} could not be loaded`:`${t} did not load within ${e} ms`))},d=()=>s("load"),c=()=>s("error"),h=setTimeout(()=>s("timeout"),e);n.addEventListener("load",d),n.addEventListener("error",c),o||(n.rel="stylesheet",n.href=t,n.setAttribute(H,""),r.head.appendChild(n))})}async function jt(t,e,r=document){await Promise.all(t.map(o=>xt(o,e,r)))}const z=1,Wt=()=>({fetchImpl:globalThis.fetch,loadHostReact:Rt,importModule:Nt,document,timeouts:{versionsMs:1e4,manifestMs:1e4,cssMs:3e4,entryMs:3e4}});let L;const Yt=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/,$=t=>typeof t=="string"&&t.split("/").every(e=>Yt.test(e));function Ft(t,e,r){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${r} is not a runtime manifest`);const o=t;if(o.version!==e)throw new Error(`${r} is for version ${JSON.stringify(o.version)}, not ${e}`);const{entry:n,worker:i,css:a}=o;if(!$(n))throw new Error(`${r} has no valid "entry"`);if(!$(i))throw new Error(`${r} has no valid "worker"`);if(!Array.isArray(a)||!a.every($))throw new Error(`${r} has no valid "css"`);return{version:e,entry:n,worker:i,css:a}}async function Gt(t,e,r,o){const n=t==null?void 0:t.boot;if(typeof n!="function")throw new Error(`${e} does not export boot()`);const i=await n(r);if((i==null?void 0:i.contractVersion)!==z)throw new Error(`the CDN runtime ${o} implements runtime contract ${String(i==null?void 0:i.contractVersion)}; this SDK needs ${z}`);return i}async function Kt(t,e,r){const[o,n]=await Promise.all([t.loadHostReact(),t.importModule(e)]);return Gt(n,e,o,r)}function Dt(t,e,r){let o;const n=new Promise((i,a)=>{o=setTimeout(()=>a(new Error(r)),e)});return Promise.race([t,n]).finally(()=>clearTimeout(o))}async function Vt(t,e,r={}){const o={...Wt(),...r},{fetchImpl:n,timeouts:i}=o,a=await Xt({...t,fetchImpl:n,timeoutMs:i.versionsMs}),s=`${t.base}/${a}`,d=`${s}/manifest.json`,c=Ft(await D(d,{timeoutMs:i.manifestMs,fetchImpl:n}),a,d),h=jt(c.css.map(Q=>`${s}/${Q}`),i.cssMs,o.document);h.catch(()=>{});const l=e.NEXT_PUBLIC_PDF_WORKER_URL;(l===C.NEXT_PUBLIC_PDF_WORKER_URL||L!==void 0&&l===L)&&(L=`${s}/${c.worker}`,e.NEXT_PUBLIC_PDF_WORKER_URL=L);const f=`${s}/${c.entry}`,Z=await Dt(Kt(o,f,a),i.entryMs,`${f} did not load within ${i.entryMs} ms`);return await h,globalThis.__OM_EMBED__={source:"cdn",base:t.base,version:a},Z}let _=null,I=null;function q(){if(_===null){gt();const t=S();I??(I=Ot(t));const e=Vt(I,t);e.catch(()=>{_===e&&(_=null)}),_=e}return _}function J(t){return et(async()=>{try{return{default:await t(await q())}}catch(e){return console.error("[@outmarket-ai/react-sdk] Could not load the Outmarket components.",e),{default:At}}})}const Ht={vault:!1,events:!1};function zt(t){return{...t,features:{...Ht,...t.features}}}function qt(t,e){const[r,o]=rt(!1);return P(()=>{T({environment:t,apiUrls:e}),o(!0)},[t,e]),r}const Jt=J(t=>t.OutmarketProviderTree),Zt=()=>()=>{},Qt=()=>!0,te=()=>!1;function ee(t){const e=ot(t);P(()=>{e.current=t});const r=it(o=>{var n;return(n=e.current)==null?void 0:n.call(e,zt(o))},[]);return t?r:void 0}function re({environment:t,apiUrls:e,...r}){const o=ee(r.onReady),n=nt(Zt,Qt,te),i=qt(t,e),a=u(G,{color:vt(r)});return!n||!i?a:u(O,{fallback:a,children:u(Jt,{...r,onReady:o})})}async function ne(t){typeof window>"u"||(t&&T({environment:t.environment,apiUrls:t.apiUrls}),await(await q()).signOut())}function p(t,e){const r=J(n=>e(n.surfaces));function o(n){return u(O,{fallback:u(G,{}),children:u(r,{...n})})}return o.displayName=t,o}const oe=p("OutmarketWorkflowsList",t=>t.OutmarketWorkflowsList()),ie=p("OutmarketWorkflowForm",t=>t.OutmarketWorkflowForm()),ae=p("OutmarketWorkflowConversation",t=>t.OutmarketWorkflowConversation()),se=p("OutmarketWorkflowHistory",t=>t.OutmarketWorkflowHistory()),ue=p("OutmarketVault",t=>t.OutmarketVault()),ce={commercial_lines:"Commercial Insurance",personal_lines:"Personal Lines",benefits:"Employee Benefits"};export{ce as MODULE_TITLE,re as OutmarketProvider,ue as OutmarketVault,ae as OutmarketWorkflowConversation,ie as OutmarketWorkflowForm,se as OutmarketWorkflowHistory,oe as OutmarketWorkflowsList,ne as signOut};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outmarket-ai/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-alpha.0",
|
|
4
4
|
"description": "Embed the real Outmarket workflows and Vault in any React app.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"url": "git+https://github.com/Outmarket-AI/outmarket-monorepo.git",
|
|
63
63
|
"directory": "apps/product-frontend/packages/outmarket-react-sdk"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "8ca1393b76c3758cb06764f6ff99f7b30b35ce7e"
|
|
66
66
|
}
|