@getcredify/credify-insurance-widget 1.40.0 → 1.41.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.
Files changed (58) hide show
  1. package/README.md +69 -3
  2. package/dist/api-RBpxlUxA.js +51 -0
  3. package/dist/components/ProductChooser.d.ts +5 -0
  4. package/dist/components/ScreenShareButton.d.ts +4 -0
  5. package/dist/components/Widget.d.ts +13 -0
  6. package/dist/components/WidgetErrorFallback.d.ts +11 -0
  7. package/dist/components/index.d.ts +9 -0
  8. package/dist/credify-insurance-widget.css +1 -1
  9. package/dist/dob-calendar-RIJ5S6YU-CPTnehH2.js +2933 -0
  10. package/dist/fixtures-ijbZ16Zg-CD1k11fg.js +276 -0
  11. package/dist/iframe/assets/dob-calendar-RIJ5S6YU-D1-0B2xV.css +1 -0
  12. package/dist/iframe/assets/dob-calendar-RIJ5S6YU-DkeMmMY0.js +1 -0
  13. package/dist/iframe/assets/fixtures-ijbZ16Zg-Bj-DhqkB.js +1 -0
  14. package/dist/iframe/assets/iframe-CfQAC0Hv.js +494 -0
  15. package/dist/iframe/assets/iframe-DFqQdMHv.css +1 -0
  16. package/dist/iframe/assets/mockJump-CL8w249w-D4zKPVys.js +1 -0
  17. package/dist/iframe/assets/zipCities-CU_i9iT--B1AIvNRh.js +1 -0
  18. package/dist/iframe/iframe.html +2 -2
  19. package/dist/index.d.ts +76 -0
  20. package/dist/index.es.js +6 -26321
  21. package/dist/index.umd.js +436 -107
  22. package/dist/internal/IframeWidgetController.d.ts +6 -0
  23. package/dist/internal/WidgetController.d.ts +6 -0
  24. package/dist/internal/configureKit.d.ts +4 -0
  25. package/dist/internal/ensureFont.d.ts +2 -0
  26. package/dist/mock/config.d.ts +30 -0
  27. package/dist/mock/installMockFetch.d.ts +6 -0
  28. package/dist/mockJump-CL8w249w-KvYoZQMN.js +19 -0
  29. package/dist/utils/api.d.ts +24 -0
  30. package/dist/utils/events.d.ts +126 -0
  31. package/dist/utils/har/recorder.d.ts +32 -0
  32. package/dist/utils/har/types.d.ts +70 -0
  33. package/dist/utils/product.d.ts +30 -0
  34. package/dist/utils/resumeLink.d.ts +35 -0
  35. package/dist/utils/sentry/devEnvironment.d.ts +10 -0
  36. package/dist/utils/sentry/init.d.ts +33 -0
  37. package/dist/utils/sentry/redact.d.ts +50 -0
  38. package/dist/utils/sentry/reportQuoteFailure.d.ts +31 -0
  39. package/dist/utils/sentry/reportSideEffectFailure.d.ts +2 -0
  40. package/dist/utils/storage.d.ts +8 -0
  41. package/dist/utils/support/bland.d.ts +50 -0
  42. package/dist/utils/support/cobrowse.d.ts +37 -0
  43. package/dist/utils/support/config.d.ts +34 -0
  44. package/dist/utils/support/index.d.ts +27 -0
  45. package/dist/utils/support/loader.d.ts +13 -0
  46. package/dist/utils/testMode.d.ts +11 -0
  47. package/dist/widget-BEY4lY4B.js +27319 -0
  48. package/dist/zipCities-CU_i9iT--DNeFQLgu.js +3330 -0
  49. package/package.json +8 -4
  50. package/dist/backend-xPum4ql0.js +0 -387
  51. package/dist/backend-xPum4ql0.js.map +0 -1
  52. package/dist/iframe/assets/backend-CY4n4nTm.js +0 -2
  53. package/dist/iframe/assets/backend-CY4n4nTm.js.map +0 -1
  54. package/dist/iframe/assets/iframe--qj6NOS3.js +0 -164
  55. package/dist/iframe/assets/iframe--qj6NOS3.js.map +0 -1
  56. package/dist/iframe/assets/iframe-m4vqnMx_.css +0 -1
  57. package/dist/index.es.js.map +0 -1
  58. package/dist/index.umd.js.map +0 -1
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Resolves the live-support configuration for the widget.
3
+ *
4
+ * Mirrors the Sentry config pattern (see ../sentry/init.ts): values are baked
5
+ * at build time via the Vite `define` global `__CREDIFY_SUPPORT__` (from the
6
+ * VITE_BLAND_WIDGET_ID / VITE_COBROWSE_LICENSE env vars) and can be overridden
7
+ * at runtime through `CredifyInsuranceWidget.init({ support })`.
8
+ *
9
+ * Support is intentionally self-contained inside the widget bundle so it works
10
+ * across every embed mode (UMD script, ESM, cross-origin iframe) with zero
11
+ * integration work on the host page.
12
+ */
13
+ export interface WidgetSupportOptions {
14
+ /** Explicitly disable support even when keys are configured. Default: enabled when a key is present. */
15
+ enabled?: boolean;
16
+ /** Bland web-chat widget ID. Enables live chat when set. */
17
+ blandWidgetId?: string;
18
+ /** Cobrowse.io license key. Enables screen sharing when set. */
19
+ cobrowseLicense?: string;
20
+ /**
21
+ * Auto-open the Bland Messenger when a quote submission fails.
22
+ * Default: true. Set false for teams that prefer manual-only support.
23
+ */
24
+ proactiveOnError?: boolean;
25
+ }
26
+ export interface ResolvedSupportConfig {
27
+ enabled: boolean;
28
+ blandWidgetId?: string;
29
+ cobrowseLicense?: string;
30
+ proactiveOnError: boolean;
31
+ }
32
+ /** Merge runtime options over build-time env. Support is on only when a key exists. */
33
+ export declare function resolveSupportConfig(options?: WidgetSupportOptions): ResolvedSupportConfig;
34
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Live-support orchestrator: wires the widget's event emitter to Bland (chat)
3
+ * and Cobrowse (screen share).
4
+ *
5
+ * Detection of a stuck prospect is driven entirely client-side off the typed
6
+ * `submissionFailed` event, so proactive help needs no server-side automation.
7
+ * Everything is lazy: SDKs load only when support is actually invoked.
8
+ */
9
+ import { type WidgetSupportOptions } from './config';
10
+ import { loadBland, hostBlandPresent } from './bland';
11
+ /** (Re)initialise support from resolved config. Idempotent — tears down first. */
12
+ export declare function initSupport(options?: WidgetSupportOptions): void;
13
+ /**
14
+ * Open live chat (loads Bland on first call unless the host page already runs it).
15
+ * Resolves false when chat isn't configured or the Messenger never mounted, so
16
+ * callers can offer the phone fallback.
17
+ */
18
+ export declare function openChat(): Promise<boolean>;
19
+ /** Start screen sharing; resolves to a 6-digit code for the agent, or null. */
20
+ export declare function startScreenShare(): Promise<string | null>;
21
+ export declare function isChatEnabled(): boolean;
22
+ export declare function isScreenShareEnabled(): boolean;
23
+ /** Remove listeners and shut down SDKs. Safe to call when never initialised. */
24
+ export declare function teardownSupport(): void;
25
+ export { loadBland, hostBlandPresent };
26
+ export type { WidgetSupportOptions } from './config';
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Idempotent, lazy third-party script loader.
3
+ *
4
+ * Support SDKs (Bland, Cobrowse) are loaded on first use rather than bundled,
5
+ * so the widget stays light for the majority of prospects who never need help.
6
+ * Each unique `src` is injected at most once; concurrent callers share one promise.
7
+ * The DOM is checked too, so a script the host page already loaded is reused
8
+ * rather than duplicated.
9
+ */
10
+ export declare function loadScript(src: string): Promise<void>;
11
+ /** Test seam: forget cached loads so each test starts from a clean document. */
12
+ export declare function __resetScriptCache(): void;
13
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Reads the internal-testing flag (?credify_test=1) from the host page URL and
3
+ * strips it via history.replaceState so it doesn't linger in the address bar or
4
+ * get shared. Persists to sessionStorage so the flag survives reloads for the
5
+ * whole session (createQuote runs a few stages in, after init). Call once at
6
+ * widget init, before any rendering — alongside captureResumeTokenFromUrl().
7
+ */
8
+ export declare function captureTestModeFromUrl(): void;
9
+ /** Whether this session is flagged as internal testing (excluded from stats). */
10
+ export declare function isTestMode(): boolean;
11
+ //# sourceMappingURL=testMode.d.ts.map