@dereekb/dbx-analytics 13.43.0 → 14.0.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.
@@ -1,7 +1,7 @@
1
1
  import { SubscriptionObject, filterMaybe } from '@dereekb/rxjs';
2
2
  import { BehaviorSubject, shareReplay, switchMap, Subject, of, first, distinctUntilChanged, tap, merge, combineLatest } from 'rxjs';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, Injectable, input, Directive, NgModule, Injector, makeEnvironmentProviders, InjectionToken } from '@angular/core';
4
+ import { inject, Injectable, input, Directive, Injector, makeEnvironmentProviders, InjectionToken, Service } from '@angular/core';
5
5
  import { DbxActionContextStoreSourceInstance, cleanSubscriptionWithLockSet } from '@dereekb/dbx-core';
6
6
  import { safeCompareEquality, poll } from '@dereekb/util';
7
7
  import { toObservable } from '@angular/core/rxjs-interop';
@@ -458,10 +458,10 @@ class DbxAnalyticsService {
458
458
  this._userIdEventSub.destroy();
459
459
  this._loggerSub.destroy();
460
460
  }
461
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
462
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsService });
461
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
462
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsService });
463
463
  }
464
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsService, decorators: [{
464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsService, decorators: [{
465
465
  type: Injectable
466
466
  }], ctorParameters: () => [] });
467
467
 
@@ -509,33 +509,16 @@ class DbxActionAnalyticsDirective {
509
509
  .subscribe()
510
510
  });
511
511
  }
512
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxActionAnalyticsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
513
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.11", type: DbxActionAnalyticsDirective, isStandalone: true, selector: "[dbxActionAnalytics]", inputs: { config: { classPropertyName: "config", publicName: "dbxActionAnalytics", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
512
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxActionAnalyticsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
513
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: DbxActionAnalyticsDirective, isStandalone: true, selector: "[dbxActionAnalytics]", inputs: { config: { classPropertyName: "config", publicName: "dbxActionAnalytics", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
514
514
  }
515
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxActionAnalyticsDirective, decorators: [{
515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxActionAnalyticsDirective, decorators: [{
516
516
  type: Directive,
517
517
  args: [{
518
- selector: '[dbxActionAnalytics]',
519
- standalone: true
518
+ selector: '[dbxActionAnalytics]'
520
519
  }]
521
520
  }], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "dbxActionAnalytics", required: false }] }] } });
522
521
 
523
- /**
524
- * @deprecated The exported DbxActionAnalyticsDirective is now a standalone component. Import that instead.
525
- */
526
- class DbxAnalyticsActionModule {
527
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
528
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsActionModule, imports: [DbxActionAnalyticsDirective], exports: [DbxActionAnalyticsDirective] });
529
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsActionModule });
530
- }
531
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsActionModule, decorators: [{
532
- type: NgModule,
533
- args: [{
534
- imports: [DbxActionAnalyticsDirective],
535
- exports: [DbxActionAnalyticsDirective]
536
- }]
537
- }] });
538
-
539
522
  /**
540
523
  * Creates Angular environment providers that register {@link DbxAnalyticsService} and its configuration.
541
524
  *
@@ -634,10 +617,10 @@ class DbxAnalyticsMixpanelApiService extends AbstractAsyncWindowLoadedService {
634
617
  get config() {
635
618
  return this._config;
636
619
  }
637
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsMixpanelApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
638
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsMixpanelApiService });
620
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsMixpanelApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
621
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsMixpanelApiService });
639
622
  }
640
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsMixpanelApiService, decorators: [{
623
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsMixpanelApiService, decorators: [{
641
624
  type: Injectable
642
625
  }], ctorParameters: () => [] });
643
626
 
@@ -705,14 +688,11 @@ class DbxAnalyticsMixpanelServiceListener extends AbstractDbxAnalyticsServiceLis
705
688
  break;
706
689
  }
707
690
  }
708
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsMixpanelServiceListener, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
709
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsMixpanelServiceListener, providedIn: 'root' });
691
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsMixpanelServiceListener, deps: [], target: i0.ɵɵFactoryTarget.Service });
692
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsMixpanelServiceListener });
710
693
  }
711
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsMixpanelServiceListener, decorators: [{
712
- type: Injectable,
713
- args: [{
714
- providedIn: 'root'
715
- }]
694
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsMixpanelServiceListener, decorators: [{
695
+ type: Service
716
696
  }], ctorParameters: () => [] });
717
697
 
718
698
  /**
@@ -851,10 +831,10 @@ class DbxAnalyticsSegmentApiService extends AbstractAsyncWindowLoadedService {
851
831
  }
852
832
  });
853
833
  }
854
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsSegmentApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
855
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsSegmentApiService });
834
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsSegmentApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
835
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsSegmentApiService });
856
836
  }
857
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsSegmentApiService, decorators: [{
837
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsSegmentApiService, decorators: [{
858
838
  type: Injectable
859
839
  }], ctorParameters: () => [] });
860
840
 
@@ -997,14 +977,11 @@ class DbxAnalyticsSegmentServiceListener extends AbstractDbxAnalyticsServiceList
997
977
  api.reset();
998
978
  }
999
979
  }
1000
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsSegmentServiceListener, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1001
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsSegmentServiceListener, providedIn: 'root' });
980
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsSegmentServiceListener, deps: [], target: i0.ɵɵFactoryTarget.Service });
981
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsSegmentServiceListener });
1002
982
  }
1003
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxAnalyticsSegmentServiceListener, decorators: [{
1004
- type: Injectable,
1005
- args: [{
1006
- providedIn: 'root'
1007
- }]
983
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DbxAnalyticsSegmentServiceListener, decorators: [{
984
+ type: Service
1008
985
  }], ctorParameters: () => [] });
1009
986
 
1010
987
  /**
@@ -1065,5 +1042,5 @@ function provideDbxAnalyticsSegmentApiService(config) {
1065
1042
  * Generated bundle index. Do not edit.
1066
1043
  */
1067
1044
 
1068
- export { AbstractDbxAnalyticsServiceListener, DbxActionAnalyticsDirective, DbxAnalyticsActionModule, DbxAnalyticsEventEmitterService, DbxAnalyticsEventStreamService, DbxAnalyticsMixpanelApiService, DbxAnalyticsMixpanelApiServiceConfig, DbxAnalyticsMixpanelServiceListener, DbxAnalyticsSegmentApiService, DbxAnalyticsSegmentApiServiceConfig, DbxAnalyticsSegmentServiceListener, DbxAnalyticsService, DbxAnalyticsServiceConfiguration, DbxAnalyticsServiceListener, DbxAnalyticsStreamEventType, DbxAnalyticsUserSource, PRELOAD_MIXPANEL_TOKEN, PRELOAD_SEGMENT_TOKEN, dbxAnalyticsStreamEventAnalyticsEventWrapper, provideDbxAnalyticsMixpanelApiService, provideDbxAnalyticsSegmentApiService, provideDbxAnalyticsService };
1045
+ export { AbstractDbxAnalyticsServiceListener, DbxActionAnalyticsDirective, DbxAnalyticsEventEmitterService, DbxAnalyticsEventStreamService, DbxAnalyticsMixpanelApiService, DbxAnalyticsMixpanelApiServiceConfig, DbxAnalyticsMixpanelServiceListener, DbxAnalyticsSegmentApiService, DbxAnalyticsSegmentApiServiceConfig, DbxAnalyticsSegmentServiceListener, DbxAnalyticsService, DbxAnalyticsServiceConfiguration, DbxAnalyticsServiceListener, DbxAnalyticsStreamEventType, DbxAnalyticsUserSource, PRELOAD_MIXPANEL_TOKEN, PRELOAD_SEGMENT_TOKEN, dbxAnalyticsStreamEventAnalyticsEventWrapper, provideDbxAnalyticsMixpanelApiService, provideDbxAnalyticsSegmentApiService, provideDbxAnalyticsService };
1069
1046
  //# sourceMappingURL=dereekb-dbx-analytics.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dereekb-dbx-analytics.mjs","sources":["../../../../packages/dbx-analytics/src/lib/analytics/analytics.stream.ts","../../../../packages/dbx-analytics/src/lib/analytics/analytics.service.ts","../../../../packages/dbx-analytics/src/lib/action/analytics.action.directive.ts","../../../../packages/dbx-analytics/src/lib/action/analytics.module.ts","../../../../packages/dbx-analytics/src/lib/analytics/analytics.providers.ts","../../../../packages/dbx-analytics/src/lib/providers/mixpanel/mixpanel.service.ts","../../../../packages/dbx-analytics/src/lib/providers/mixpanel/mixpanel.listener.service.ts","../../../../packages/dbx-analytics/src/lib/providers/mixpanel/mixpanel.providers.ts","../../../../packages/dbx-analytics/src/lib/providers/segment/segment.service.ts","../../../../packages/dbx-analytics/src/lib/providers/segment/segment.listener.service.ts","../../../../packages/dbx-analytics/src/lib/providers/segment/segment.providers.ts","../../../../packages/dbx-analytics/src/dereekb-dbx-analytics.ts"],"sourcesContent":["import { type Maybe } from '@dereekb/util';\nimport { type AnalyticsUser, type UserAnalyticsEvent, type AnalyticsUserId } from './analytics';\n\n/**\n * Categorizes the kind of analytics stream event emitted by {@link DbxAnalyticsService}.\n *\n * Listeners use this type to route events to the appropriate analytics provider method\n * (e.g., Segment `track()`, `identify()`, `page()`).\n */\nexport enum DbxAnalyticsStreamEventType {\n /**\n * A page/screen view event, typically sent on route transitions.\n */\n PageView,\n /**\n * Emitted any time the user value changes, including when transitioning from defined to undefined.\n *\n * Used by listeners to update the identified user in analytics providers.\n */\n UserChange,\n /**\n * Emitted only when the user's unique ID changes, filtering out property-only updates.\n *\n * Useful for triggering identity calls without redundant updates when only traits change.\n */\n UserIdChange,\n\n // User Events\n /**\n * A new user registration event.\n */\n NewUserEvent,\n /**\n * A returning user login event.\n */\n UserLoginEvent,\n /**\n * A user logout event.\n */\n UserLogoutEvent,\n /**\n * An update to user profile properties/traits.\n */\n UserPropertiesEvent,\n\n // Events\n /**\n * A generic custom analytics event.\n */\n Event,\n\n // Session Replay\n /**\n * Request to start session replay recording.\n */\n StartSessionRecording,\n /**\n * Request to stop session replay recording.\n */\n StopSessionRecording,\n /**\n * Request to pause an active session replay recording without clearing it.\n */\n PauseSessionRecording,\n /**\n * Request to resume a previously paused session replay recording.\n */\n ResumeSessionRecording\n}\n\n/**\n * Represents a single event in the analytics stream, combining the event type, payload, and user context.\n *\n * Emitted by {@link DbxAnalyticsService} and consumed by {@link DbxAnalyticsServiceListener} implementations\n * (e.g., {@link DbxAnalyticsSegmentServiceListener}) to forward events to external analytics providers.\n *\n * @example\n * ```ts\n * // Subscribe to the analytics event stream\n * analyticsService.events$.subscribe((streamEvent: DbxAnalyticsStreamEvent) => {\n * console.log(streamEvent.type, streamEvent.event?.name, streamEvent.userId);\n * });\n * ```\n */\nexport interface DbxAnalyticsStreamEvent {\n readonly type: DbxAnalyticsStreamEventType;\n readonly user?: Maybe<AnalyticsUser>;\n readonly event?: UserAnalyticsEvent;\n readonly userId?: AnalyticsUserId;\n}\n","import { type Observable, Subject, BehaviorSubject, of, type Subscription, first, shareReplay, switchMap, distinctUntilChanged } from 'rxjs';\nimport { Injectable, inject } from '@angular/core';\nimport { SubscriptionObject, filterMaybe } from '@dereekb/rxjs';\nimport { type AnalyticsEvent, type AnalyticsEventData, type AnalyticsEventName, type AnalyticsUser, type NewUserAnalyticsEventData, type UserAnalyticsEvent } from './analytics';\nimport { type DbxAnalyticsStreamEvent, DbxAnalyticsStreamEventType } from './analytics.stream';\nimport { type Maybe, type Destroyable, safeCompareEquality } from '@dereekb/util';\n\n/**\n * Abstract emitter interface for sending analytics events.\n *\n * Implemented by {@link DbxAnalyticsService} as the primary concrete implementation.\n * Components and services use this to fire analytics events without coupling to a specific provider.\n *\n * @example\n * ```ts\n * // Inject and send a custom event\n * const emitter = inject(DbxAnalyticsEventEmitterService);\n * emitter.sendEventData('Button Clicked', { buttonId: 'save' });\n * ```\n */\nexport abstract class DbxAnalyticsEventEmitterService {\n abstract sendNewUserEvent(user: AnalyticsUser, data: NewUserAnalyticsEventData): void;\n abstract sendUserLoginEvent(user: AnalyticsUser, data?: AnalyticsEventData): void;\n abstract sendUserLogoutEvent(data?: AnalyticsEventData): void;\n abstract sendUserPropertiesEvent(user: AnalyticsUser, data?: AnalyticsEventData): void;\n /**\n * @deprecated When sending an event with no data, use {@link sendEventType} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n abstract sendEventData(name: AnalyticsEventName): void;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n abstract sendEventData(name: AnalyticsEventName, data: AnalyticsEventData): void;\n abstract sendEvent(event: AnalyticsEvent): void;\n abstract sendPageView(page?: string): void;\n abstract startSessionRecording(): void;\n abstract stopSessionRecording(): void;\n abstract pauseSessionRecording(): void;\n abstract resumeSessionRecording(): void;\n}\n\n/**\n * Abstract interface exposing the analytics event stream as an observable.\n *\n * Implemented by {@link DbxAnalyticsService}. Listeners subscribe to `events$` to forward events to external providers.\n */\nexport abstract class DbxAnalyticsEventStreamService {\n abstract readonly events$: Observable<DbxAnalyticsStreamEvent>;\n}\n\n/**\n * Abstract source for the current analytics user identity.\n *\n * Provide an implementation to automatically associate a user with all emitted analytics events.\n * Typically backed by the auth system (e.g., {@link DbxFirebaseAnalyticsUserSource}).\n *\n * @example\n * ```ts\n * // Provide a static user source\n * const userSource: DbxAnalyticsUserSource = {\n * analyticsUser$: of({ user: 'uid_abc123', properties: { role: 'admin' } })\n * };\n * ```\n */\nexport abstract class DbxAnalyticsUserSource {\n abstract readonly analyticsUser$: Observable<Maybe<AnalyticsUser>>;\n}\n\n/**\n * Abstract listener that receives analytics events from {@link DbxAnalyticsService}.\n *\n * Implement this to forward events to an external analytics provider (e.g., Segment, Mixpanel).\n * Register listeners via {@link DbxAnalyticsServiceConfiguration.listeners}.\n */\nexport abstract class DbxAnalyticsServiceListener {\n public abstract listenToService(service: DbxAnalyticsService): void;\n}\n\n/**\n * Base class for analytics service listeners that manages subscription lifecycle and provides\n * reactive access to the analytics service and its event stream.\n *\n * Subclasses implement {@link _initializeServiceSubscription} to subscribe to events and forward them\n * to an external analytics provider.\n *\n * @example\n * ```ts\n * class MyAnalyticsListener extends AbstractDbxAnalyticsServiceListener {\n * protected _initializeServiceSubscription(): Subscription | false {\n * return this.analyticsEvents$.subscribe((event) => {\n * console.log('Event:', event.type, event.event?.name);\n * });\n * }\n * }\n * ```\n */\nexport abstract class AbstractDbxAnalyticsServiceListener implements DbxAnalyticsServiceListener, Destroyable {\n private _sub = new SubscriptionObject();\n protected _analytics = new BehaviorSubject<Maybe<DbxAnalyticsService>>(undefined);\n\n readonly analytics$ = this._analytics.pipe(filterMaybe(), shareReplay(1));\n readonly analyticsEvents$ = this.analytics$.pipe(\n switchMap((x) => x.events$),\n shareReplay(1)\n );\n\n // MARK: AnalyticsServiceListener\n listenToService(service: DbxAnalyticsService): void {\n this._analytics.next(service);\n const sub = this._initializeServiceSubscription();\n\n if (sub !== false) {\n this._sub.subscription = sub;\n }\n }\n\n protected abstract _initializeServiceSubscription(): Subscription | false;\n\n // MARK: Destroy\n destroy(): void {\n this._analytics.complete();\n this._sub.destroy();\n }\n}\n\n/**\n * Configuration for {@link DbxAnalyticsService}, controlling which listeners receive events,\n * whether analytics runs in production mode, and optionally providing a user source.\n *\n * In non-production mode, listeners are not initialized and all events are logged to the console instead.\n * Provide via {@link provideDbxAnalyticsService} using a factory function.\n *\n * @example\n * ```ts\n * const config: DbxAnalyticsServiceConfiguration = {\n * isProduction: environment.production,\n * logEvents: !environment.production,\n * listeners: [segmentListener],\n * userSource: firebaseAnalyticsUserSource\n * };\n * ```\n */\nexport abstract class DbxAnalyticsServiceConfiguration {\n readonly listeners: DbxAnalyticsServiceListener[] = [];\n readonly isProduction?: boolean;\n readonly logEvents?: boolean;\n readonly userSource?: DbxAnalyticsUserSource;\n}\n\n/**\n * A fully resolved analytics stream event that includes the event payload, type, user context, and extracted user ID.\n *\n * Created by {@link dbxAnalyticsStreamEventAnalyticsEventWrapper} and emitted through the analytics event stream.\n */\nexport interface DbxAnalyticsStreamEventAnalyticsEventWrapper extends DbxAnalyticsStreamEvent {\n readonly event: UserAnalyticsEvent;\n readonly type: DbxAnalyticsStreamEventType;\n readonly user: Maybe<AnalyticsUser>;\n readonly userId: string | undefined;\n}\n\n/**\n * Wraps a {@link UserAnalyticsEvent} into a {@link DbxAnalyticsStreamEventAnalyticsEventWrapper},\n * extracting the user ID for convenient access by listeners.\n *\n * @param event - The analytics event with optional user context.\n * @param type - The stream event type classification; defaults to `Event`\n * @returns A wrapper combining the event, type, user, and extracted userId.\n *\n * @example\n * ```ts\n * const wrapper = dbxAnalyticsStreamEventAnalyticsEventWrapper(\n * { name: 'Button Clicked', user: { user: 'uid_123' } },\n * DbxAnalyticsStreamEventType.Event\n * );\n * // wrapper.userId === 'uid_123'\n * ```\n */\nexport function dbxAnalyticsStreamEventAnalyticsEventWrapper(event: UserAnalyticsEvent, type: DbxAnalyticsStreamEventType = DbxAnalyticsStreamEventType.Event) {\n const { user } = event;\n const userId = user ? user.user : undefined;\n\n return {\n event,\n type,\n user,\n userId\n };\n}\n\n/**\n * Central analytics service that emits typed analytics events for consumption by registered listeners.\n *\n * Acts as both the event emitter (components call methods like {@link sendEventData}, {@link sendPageView})\n * and the event stream source (listeners subscribe to {@link events$}).\n *\n * In production mode, registered {@link DbxAnalyticsServiceListener} instances (e.g., Segment) receive all events.\n * In non-production mode, events are logged to the console for debugging.\n *\n * Provided via {@link provideDbxAnalyticsService} with a {@link DbxAnalyticsServiceConfiguration} factory.\n *\n * @example\n * ```ts\n * // Send a custom event from a component\n * const analytics = inject(DbxAnalyticsService);\n * analytics.sendEventData('Interview Started', { candidateId: 'abc123' });\n *\n * // Send a page view on route transitions\n * transitionService.onSuccess({}, () => {\n * analytics.sendPageView();\n * });\n * ```\n */\n@Injectable()\nexport class DbxAnalyticsService implements DbxAnalyticsEventStreamService, DbxAnalyticsEventEmitterService, Destroyable {\n private readonly _config = inject(DbxAnalyticsServiceConfiguration);\n\n // TODO: Make these configurable.\n static readonly USER_REGISTRATION_EVENT_NAME = 'User Registered';\n static readonly USER_LOGIN_EVENT_NAME = 'User Login';\n static readonly USER_LOGOUT_EVENT_NAME = 'User Logout';\n static readonly USER_PROPERTIES_EVENT_NAME = 'User Properties';\n\n private _subject = new Subject<DbxAnalyticsStreamEvent>();\n readonly events$ = this._subject.asObservable();\n\n private _userSource = new BehaviorSubject<Maybe<DbxAnalyticsUserSource>>(undefined);\n\n readonly user$ = this._userSource.pipe(\n switchMap((x) => (x ? x.analyticsUser$ : of(undefined))),\n shareReplay(1)\n );\n\n private _userSourceSub = new SubscriptionObject();\n private _userIdEventSub = new SubscriptionObject();\n private _loggerSub = new SubscriptionObject();\n\n constructor() {\n this._init();\n let userSource: Maybe<DbxAnalyticsUserSource> = inject(DbxAnalyticsUserSource, { optional: true });\n userSource = userSource || this._config.userSource;\n\n if (userSource) {\n this.setUserSource(userSource);\n }\n }\n\n // MARK: Source\n /**\n * Sets the analytics user directly, overriding any configured {@link DbxAnalyticsUserSource}.\n *\n * Pass `undefined` to clear the current user (e.g., on logout).\n *\n * @param user - The user to identify, or undefined to clear.\n */\n public setUser(user: Maybe<AnalyticsUser>): void {\n let source: Maybe<DbxAnalyticsUserSource>;\n\n if (user) {\n source = { analyticsUser$: of(user) };\n }\n\n this._userSource.next(source);\n\n if (this._userSource.value) {\n console.warn('DbxAnalyticsService has a userSource that is set. Source is now overridden by setUser() value.');\n }\n }\n\n /**\n * Sets the reactive user source that automatically updates the analytics user as auth state changes.\n *\n * @param source - The user source providing an observable of the current analytics user.\n */\n public setUserSource(source: DbxAnalyticsUserSource): void {\n this._userSource.next(source);\n }\n\n // MARK: DbxAnalyticsEventEmitterService\n /**\n * Emits a new user registration event, typically sent once after account creation.\n *\n * @param user - The newly registered user.\n * @param data - Registration-specific data including the signup method.\n */\n public sendNewUserEvent(user: AnalyticsUser, data: NewUserAnalyticsEventData): void {\n this.sendNextEvent(\n {\n name: DbxAnalyticsService.USER_REGISTRATION_EVENT_NAME,\n data\n },\n DbxAnalyticsStreamEventType.NewUserEvent,\n user\n );\n }\n\n /**\n * Emits a user login event, identifying the user in analytics providers.\n *\n * @param user - The user who logged in.\n * @param data - Optional additional event data.\n */\n public sendUserLoginEvent(user: AnalyticsUser, data?: AnalyticsEventData): void {\n this.sendNextEvent(\n {\n name: DbxAnalyticsService.USER_LOGIN_EVENT_NAME,\n data\n },\n DbxAnalyticsStreamEventType.UserLoginEvent,\n user\n );\n }\n\n /**\n * Emits a user logout event and optionally clears the current analytics user.\n *\n * @param data - Optional additional event data.\n * @param clearUser - Whether to reset the analytics user identity; defaults to `true`\n */\n public sendUserLogoutEvent(data?: AnalyticsEventData, clearUser = true): void {\n this.sendNextEvent(\n {\n name: DbxAnalyticsService.USER_LOGOUT_EVENT_NAME,\n data\n },\n DbxAnalyticsStreamEventType.UserLogoutEvent\n );\n\n if (clearUser) {\n this.setUser(undefined);\n }\n }\n\n /**\n * Emits a user properties update event, used to sync user traits to analytics providers.\n *\n * @param user - The user whose properties are being updated.\n * @param data - Optional additional event data.\n */\n public sendUserPropertiesEvent(user: AnalyticsUser, data?: AnalyticsEventData): void {\n this.sendNextEvent(\n {\n name: DbxAnalyticsService.USER_PROPERTIES_EVENT_NAME,\n data\n },\n DbxAnalyticsStreamEventType.UserPropertiesEvent,\n user\n );\n }\n\n /**\n * @deprecated When sending an event with no data, use {@link sendEventType} instead.\n */\n public sendEventData(name: AnalyticsEventName): void;\n /**\n * Sends a named analytics event with a data payload.\n *\n * This is the primary method for tracking custom events with associated properties.\n *\n * @param name - The event name (e.g., `'Interview Ended'`)\n * @param data - Key-value data attached to the event.\n *\n * @example\n * ```ts\n * analytics.sendEventData('Interview Ended', {\n * seconds: 120,\n * endedDueToTime: 'true'\n * });\n * ```\n */\n public sendEventData(name: AnalyticsEventName, data: AnalyticsEventData): void;\n public sendEventData(name: AnalyticsEventName, data?: AnalyticsEventData): void {\n return this.sendEvent({\n name,\n data\n });\n }\n\n /**\n * Sends a named event with no additional data, useful for simple occurrence tracking.\n *\n * @param eventType - The event name to track.\n *\n * @example\n * ```ts\n * analytics.sendEventType('Finish Account Setup');\n * ```\n */\n public sendEventType(eventType: AnalyticsEventName): void {\n this.sendNextEvent(\n {\n name: eventType\n },\n DbxAnalyticsStreamEventType.Event\n );\n }\n\n /**\n * Sends a fully constructed analytics event object.\n *\n * @param event - The event containing name, optional value, and data.\n */\n public sendEvent(event: AnalyticsEvent): void {\n this.sendNextEvent(event, DbxAnalyticsStreamEventType.Event);\n }\n\n /**\n * Sends a page view event, typically called on successful route transitions.\n *\n * @param page - Optional page name/path override; if omitted, the provider determines the current page.\n *\n * @example\n * ```ts\n * // In a router config function\n * transitionService.onSuccess({}, () => {\n * analyticsService.sendPageView();\n * });\n * ```\n */\n public sendPageView(page?: string): void {\n this.sendNextEvent(\n {\n name: page\n },\n DbxAnalyticsStreamEventType.PageView\n );\n }\n\n /**\n * Requests that opt-in listeners (e.g. Mixpanel) start session replay recording.\n *\n * Forwarded as a {@link DbxAnalyticsStreamEventType.StartSessionRecording} event. Listeners\n * that don't handle session replay (e.g. Segment) ignore it.\n */\n public startSessionRecording(): void {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.StartSessionRecording);\n }\n\n /**\n * Requests that opt-in listeners stop session replay recording.\n *\n * Forwarded as a {@link DbxAnalyticsStreamEventType.StopSessionRecording} event.\n */\n public stopSessionRecording(): void {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.StopSessionRecording);\n }\n\n /**\n * Requests that opt-in listeners pause active session replay recording without clearing it.\n *\n * Forwarded as a {@link DbxAnalyticsStreamEventType.PauseSessionRecording} event.\n */\n public pauseSessionRecording(): void {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.PauseSessionRecording);\n }\n\n /**\n * Requests that opt-in listeners resume previously paused session replay recording.\n *\n * Forwarded as a {@link DbxAnalyticsStreamEventType.ResumeSessionRecording} event.\n */\n public resumeSessionRecording(): void {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.ResumeSessionRecording);\n }\n\n /**\n * Sends the next event.\n *\n * @param event\n * @param type\n * @param userOverride - Uses this user if set as null or an override value. If undefined the current analytics user is used.\n */\n protected sendNextEvent(event: AnalyticsEvent = {}, type: DbxAnalyticsStreamEventType, userOverride?: Maybe<AnalyticsUser>): void {\n this.user$.pipe(first()).subscribe((analyticsUser) => {\n const user: Maybe<AnalyticsUser> = userOverride === undefined ? analyticsUser : userOverride;\n const analyticsEvent: UserAnalyticsEvent = { ...event, user };\n this.nextEvent(analyticsEvent, type);\n });\n }\n\n protected nextEvent(event: UserAnalyticsEvent, type: DbxAnalyticsStreamEventType): void {\n const wrapper = dbxAnalyticsStreamEventAnalyticsEventWrapper(event, type);\n this._subject.next(wrapper);\n }\n\n // MARK: Internal\n private _init(): void {\n if (this._config.isProduction) {\n // Initialize listeners.\n this._config.listeners.forEach((listener) => {\n listener.listenToService(this);\n });\n } else {\n console.warn('AnalyticsService: Analytics not in production mode. All analytics events are ignored.');\n }\n\n if (this._config.logEvents || !this._config.isProduction) {\n console.log('AnalyticsService: Log analytics events enabled.');\n\n // Create a new subscription\n this._loggerSub.subscription = this._subject.subscribe((x) => {\n console.log(`AnalyticsService: Analytics Event - ${DbxAnalyticsStreamEventType[x.type]} | User: ${x.userId} | Data: ${JSON.stringify(x.event)}.`);\n });\n }\n\n this._userSourceSub.subscription = this.user$.subscribe((user) => {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.UserChange, user ?? null);\n });\n\n this._userIdEventSub.subscription = this.user$.pipe(distinctUntilChanged((a, b) => safeCompareEquality(a, b, (x, y) => x.user === y.user))).subscribe((user) => {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.UserIdChange, user ?? null);\n });\n }\n\n destroy() {\n this._subject.complete();\n this._userSource.complete();\n this._userSourceSub.destroy();\n this._userIdEventSub.destroy();\n this._loggerSub.destroy();\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { switchMap, tap, shareReplay, merge, type Observable, of } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { DbxActionContextStoreSourceInstance, cleanSubscriptionWithLockSet } from '@dereekb/dbx-core';\nimport { DbxAnalyticsService } from '../analytics/analytics.service';\nimport { type Maybe, type ReadableError } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Configuration for {@link DbxActionAnalyticsDirective} that maps action lifecycle events to analytics calls.\n *\n * Each callback receives the {@link DbxAnalyticsService} and relevant action data, allowing you to\n * send targeted analytics events at each stage of an action's lifecycle (trigger, ready, success, error).\n *\n * @example\n * ```ts\n * // In a component, define analytics config for a form submit action\n * readonly submitAnalytics: DbxActionAnalyticsConfig<MyFormValue, MyResult> = {\n * onReady: (service, value) => {\n * service.sendEventData('Form Submitted', { formType: 'onboard' });\n * },\n * onSuccess: (service, result, value) => {\n * service.sendEventType('Onboarding Complete');\n * },\n * onError: (service, error) => {\n * service.sendEventData('Form Submit Failed', { code: error?.code ?? 'unknown' });\n * }\n * };\n *\n * // In the template\n * // <button dbxAction [dbxActionAnalytics]=\"submitAnalytics\">Submit</button>\n * ```\n */\nexport interface DbxActionAnalyticsConfig<T = unknown, O = unknown> {\n /**\n * Called when the action is triggered (button pressed).\n */\n readonly onTriggered?: (service: DbxAnalyticsService) => void;\n /**\n * Called when the action value is ready and about to be processed.\n */\n readonly onReady?: (service: DbxAnalyticsService, value: T) => void;\n /**\n * Called when the action completes successfully.\n */\n readonly onSuccess?: (service: DbxAnalyticsService, result: Maybe<O>, value: T) => void;\n /**\n * Called when the action encounters an error.\n */\n readonly onError?: (service: DbxAnalyticsService, error: Maybe<ReadableError>) => void;\n}\n\n/**\n * Standalone directive that listens to a host {@link DbxActionDirective} and fires analytics events\n * based on the action's lifecycle (triggered, ready, success, error).\n *\n * Attach to any element that has a `dbxAction` directive and pass a {@link DbxActionAnalyticsConfig}\n * to define which events to send at each lifecycle stage.\n *\n * @example\n * ```html\n * <button dbxAction\n * [dbxActionHandler]=\"handleSave\"\n * [dbxActionAnalytics]=\"saveAnalytics\">\n * Save\n * </button>\n * ```\n */\n@Directive({\n selector: '[dbxActionAnalytics]',\n standalone: true\n})\nexport class DbxActionAnalyticsDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n readonly analyticsService = inject(DbxAnalyticsService);\n\n readonly config = input<Maybe<DbxActionAnalyticsConfig<T, O>>>(undefined, { alias: 'dbxActionAnalytics' });\n readonly config$ = toObservable(this.config).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.config$\n .pipe(\n switchMap(({ onTriggered, onReady, onSuccess, onError }) => {\n const triggerObs: Observable<unknown>[] = [];\n\n if (onTriggered) {\n triggerObs.push(this.source.triggered$.pipe(tap(() => onTriggered(this.analyticsService))));\n }\n\n if (onReady) {\n triggerObs.push(this.source.valueReady$.pipe(tap((value) => onReady(this.analyticsService, value))));\n }\n\n if (onSuccess) {\n triggerObs.push(this.source.successPair$.pipe(tap(({ result, value }) => onSuccess(this.analyticsService, result, value))));\n }\n\n if (onError) {\n triggerObs.push(\n this.source.error$.pipe(\n filterMaybe(),\n tap((error) => onError(this.analyticsService, error))\n )\n );\n }\n\n return triggerObs.length ? merge(...triggerObs) : of();\n })\n )\n .subscribe()\n });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxActionAnalyticsDirective } from './analytics.action.directive';\n\n/**\n * @deprecated The exported DbxActionAnalyticsDirective is now a standalone component. Import that instead.\n */\n@NgModule({\n imports: [DbxActionAnalyticsDirective],\n exports: [DbxActionAnalyticsDirective]\n})\nexport class DbxAnalyticsActionModule {}\n","import { type EnvironmentProviders, Injector, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxAnalyticsServiceConfiguration, DbxAnalyticsService } from './analytics.service';\n\n/**\n * Factory function that creates a {@link DbxAnalyticsServiceConfiguration} using the Angular injector.\n *\n * Used by {@link provideDbxAnalyticsService} to defer configuration resolution to runtime.\n */\nexport type DbxAnalyticsServiceConfigurationFactory = (injector: Injector) => DbxAnalyticsServiceConfiguration;\n\n/**\n * Configuration for {@link provideDbxAnalyticsService}.\n */\nexport interface ProvideDbxAnalyticsConfig {\n readonly dbxAnalyticsServiceConfigurationFactory: DbxAnalyticsServiceConfigurationFactory;\n}\n\n/**\n * Creates Angular environment providers that register {@link DbxAnalyticsService} and its configuration.\n *\n * Call this in your application's `providers` array to set up analytics with a custom configuration factory\n * that resolves listeners, user sources, and environment flags at runtime.\n *\n * @param config - Contains the factory function that produces a {@link DbxAnalyticsServiceConfiguration}\n * @returns Environment providers for the analytics service.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDbxAnalyticsService({\n * dbxAnalyticsServiceConfigurationFactory: (injector: Injector) => ({\n * isProduction: environment.production,\n * logEvents: !environment.production,\n * listeners: [injector.get(DbxAnalyticsSegmentServiceListener)],\n * userSource: injector.get(DbxFirebaseAnalyticsUserSource)\n * })\n * })\n * ]\n * };\n * ```\n *\n * @__NO_SIDE_EFFECTS__\n */\nexport function provideDbxAnalyticsService(config: ProvideDbxAnalyticsConfig): EnvironmentProviders {\n const { dbxAnalyticsServiceConfigurationFactory } = config;\n\n const providers: Provider[] = [\n // configuration\n {\n provide: DbxAnalyticsServiceConfiguration,\n useFactory: dbxAnalyticsServiceConfigurationFactory,\n deps: [Injector]\n },\n // service\n DbxAnalyticsService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { AbstractAsyncWindowLoadedService } from '@dereekb/browser';\n\n/**\n * Injection token for optionally preloading the Mixpanel SDK on the page.\n *\n * In typical setups Mixpanel is loaded by Segment device mode, so this token is rarely needed.\n */\nexport const PRELOAD_MIXPANEL_TOKEN = new InjectionToken<string>('DbxAnalyticsMixpanelApiServicePreload');\n\n/**\n * Minimal subset of the Mixpanel JS SDK surface used by the Mixpanel listener.\n *\n * Avoids taking a runtime dependency on `mixpanel-browser` since the SDK is loaded on the page\n * by Segment's Mixpanel (Actions) device-mode destination. Widen this interface if more\n * Mixpanel APIs are needed.\n */\nexport interface MixpanelLike {\n start_session_recording(): void;\n stop_session_recording(): void;\n pause_session_recording(): void;\n resume_session_recording(): void;\n}\n\n/**\n * Configuration for the Mixpanel analytics integration.\n *\n * Unlike {@link DbxAnalyticsSegmentApiServiceConfig}, this config does not take a write key —\n * Mixpanel is initialized by Segment device mode. The `active` and `logging` flags exist for\n * parity with the Segment config and to gate listener behavior.\n *\n * @example\n * ```ts\n * const config = new DbxAnalyticsMixpanelApiServiceConfig();\n * config.active = environment.production;\n * config.logging = !environment.production;\n * ```\n */\nexport class DbxAnalyticsMixpanelApiServiceConfig {\n logging = true;\n active = true;\n}\n\n/**\n * Service that manages async access to the Mixpanel JS SDK exposed on `window.mixpanel`.\n *\n * The Mixpanel SDK is typically loaded by Segment's Mixpanel (Actions) device-mode destination,\n * so this service waits for `window.mixpanel` to exist using the inherited window-loading polling.\n * The resolved SDK instance is available via the inherited `service$` observable.\n *\n * Provided via {@link provideDbxAnalyticsMixpanelApiService}.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * provideDbxAnalyticsMixpanelApiService({\n * dbxAnalyticsMixpanelApiServiceConfigFactory: () => {\n * const config = new DbxAnalyticsMixpanelApiServiceConfig();\n * config.active = environment.production;\n * return config;\n * }\n * })\n * ```\n */\n@Injectable()\nexport class DbxAnalyticsMixpanelApiService extends AbstractAsyncWindowLoadedService<MixpanelLike> {\n private readonly _config = inject(DbxAnalyticsMixpanelApiServiceConfig);\n\n static readonly MIXPANEL_API_WINDOW_KEY = 'mixpanel';\n\n constructor() {\n const preload = inject(PRELOAD_MIXPANEL_TOKEN, { optional: true });\n super(DbxAnalyticsMixpanelApiService.MIXPANEL_API_WINDOW_KEY, undefined, 'Mixpanel', preload);\n }\n\n get config(): DbxAnalyticsMixpanelApiServiceConfig {\n return this._config;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { combineLatest } from 'rxjs';\nimport { AbstractDbxAnalyticsServiceListener, type DbxAnalyticsStreamEvent, DbxAnalyticsStreamEventType } from '../../analytics';\nimport { DbxAnalyticsMixpanelApiService, type MixpanelLike } from './mixpanel.service';\n\n/**\n * Analytics listener that forwards session-replay control events to the Mixpanel SDK.\n *\n * Handles only the four session-replay event types — track/identify/page events are intentionally\n * not forwarded here because Segment's Mixpanel (Actions) device-mode destination already routes\n * them to Mixpanel. Forwarding them again would produce duplicate events.\n *\n * - {@link DbxAnalyticsStreamEventType.StartSessionRecording} -> `mixpanel.start_session_recording()`\n * - {@link DbxAnalyticsStreamEventType.StopSessionRecording} -> `mixpanel.stop_session_recording()`\n * - {@link DbxAnalyticsStreamEventType.PauseSessionRecording} -> `mixpanel.pause_session_recording()`\n * - {@link DbxAnalyticsStreamEventType.ResumeSessionRecording} -> `mixpanel.resume_session_recording()`\n *\n * Events are only sent when the Mixpanel configuration is marked as `active`.\n * Provided at root level and registered as a listener via {@link DbxAnalyticsServiceConfiguration.listeners}.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAnalyticsMixpanelServiceListener extends AbstractDbxAnalyticsServiceListener {\n private readonly _mixpanelApi = inject(DbxAnalyticsMixpanelApiService);\n\n constructor() {\n super();\n\n if (this._mixpanelApi.config.logging) {\n console.log('MixpanelAnalyticsListenerService: Mixpanel is logging events.');\n }\n\n if (!this._mixpanelApi.config.active) {\n console.log('MixpanelAnalyticsListenerService: Mixpanel is disabled from sending events to the server.');\n }\n }\n\n protected _initializeServiceSubscription() {\n return combineLatest([this._mixpanelApi.service$, this.analyticsEvents$]).subscribe(([mixpanel, streamEvent]: [MixpanelLike, DbxAnalyticsStreamEvent]) => {\n if (this._mixpanelApi.config.logging) {\n console.log('Mixpanel Listener Logging Event: ', streamEvent);\n }\n\n if (this._mixpanelApi.config.active) {\n this.handleStreamEvent(mixpanel, streamEvent);\n }\n });\n }\n\n /**\n * Routes a session-replay control event to the corresponding Mixpanel SDK method.\n *\n * Non-session-replay events are intentionally ignored — Segment's device-mode integration\n * already forwards track/identify/page to Mixpanel.\n *\n * @param api - The loaded Mixpanel SDK instance.\n * @param streamEvent - The analytics event to process.\n */\n protected handleStreamEvent(api: MixpanelLike, streamEvent: DbxAnalyticsStreamEvent): void {\n switch (streamEvent.type) {\n case DbxAnalyticsStreamEventType.StartSessionRecording:\n api.start_session_recording();\n break;\n case DbxAnalyticsStreamEventType.StopSessionRecording:\n api.stop_session_recording();\n break;\n case DbxAnalyticsStreamEventType.PauseSessionRecording:\n api.pause_session_recording();\n break;\n case DbxAnalyticsStreamEventType.ResumeSessionRecording:\n api.resume_session_recording();\n break;\n default:\n // All other event types are routed to Mixpanel by Segment's device-mode destination.\n break;\n }\n }\n}\n","import { type EnvironmentProviders, Injector, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxAnalyticsMixpanelApiService, DbxAnalyticsMixpanelApiServiceConfig, PRELOAD_MIXPANEL_TOKEN } from './mixpanel.service';\n\n/**\n * Factory function that creates a {@link DbxAnalyticsMixpanelApiServiceConfig} using the Angular injector.\n *\n * Used by {@link provideDbxAnalyticsMixpanelApiService} to defer Mixpanel configuration to runtime.\n */\nexport type DbxAnalyticsMixpanelApiServiceConfigFactory = (injector: Injector) => DbxAnalyticsMixpanelApiServiceConfig;\n\n/**\n * Configuration for {@link provideDbxAnalyticsMixpanelApiService}.\n */\nexport interface ProvideDbxAnalyticsMixpanelModuleConfig {\n /**\n * Whether to preload the Mixpanel script token.\n *\n * Rarely needed — Mixpanel is typically loaded by Segment's device-mode destination.\n */\n readonly preloadMixpanelToken?: boolean;\n /**\n * Factory function that produces the Mixpanel API service configuration.\n */\n readonly dbxAnalyticsMixpanelApiServiceConfigFactory: DbxAnalyticsMixpanelApiServiceConfigFactory;\n}\n\n/**\n * Creates Angular environment providers that register {@link DbxAnalyticsMixpanelApiService} for Mixpanel session-replay control.\n *\n * Use alongside {@link provideDbxAnalyticsService} to wire Mixpanel as an analytics listener that\n * handles session-replay start/stop/pause/resume events.\n *\n * @param config - Mixpanel-specific configuration.\n * @returns Environment providers for Mixpanel analytics.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDbxAnalyticsMixpanelApiService({\n * dbxAnalyticsMixpanelApiServiceConfigFactory: () => {\n * const config = new DbxAnalyticsMixpanelApiServiceConfig();\n * config.active = environment.production;\n * return config;\n * }\n * }),\n * provideDbxAnalyticsService({\n * dbxAnalyticsServiceConfigurationFactory: (injector) => ({\n * isProduction: environment.production,\n * listeners: [\n * injector.get(DbxAnalyticsSegmentServiceListener),\n * injector.get(DbxAnalyticsMixpanelServiceListener)\n * ]\n * })\n * })\n * ]\n * };\n * ```\n *\n * @__NO_SIDE_EFFECTS__\n */\nexport function provideDbxAnalyticsMixpanelApiService(config: ProvideDbxAnalyticsMixpanelModuleConfig): EnvironmentProviders {\n const { preloadMixpanelToken, dbxAnalyticsMixpanelApiServiceConfigFactory } = config;\n\n const providers: Provider[] = [\n // configuration\n {\n provide: DbxAnalyticsMixpanelApiServiceConfig,\n useFactory: dbxAnalyticsMixpanelApiServiceConfigFactory,\n deps: [Injector]\n },\n // service\n DbxAnalyticsMixpanelApiService\n ];\n\n if (preloadMixpanelToken) {\n providers.push({\n provide: PRELOAD_MIXPANEL_TOKEN,\n useValue: preloadMixpanelToken\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { AbstractAsyncWindowLoadedService } from '@dereekb/browser';\nimport { poll } from '@dereekb/util';\n\n/**\n * Injection token for optionally preloading the Segment analytics script.\n */\nexport const PRELOAD_SEGMENT_TOKEN = new InjectionToken<string>('DbxAnalyticsSegmentApiServicePreload');\n\n/**\n * Configuration for the Segment analytics integration.\n *\n * @example\n * ```ts\n * const config = new DbxAnalyticsSegmentApiServiceConfig('your-segment-write-key');\n * config.active = environment.production;\n * config.logging = !environment.production;\n * ```\n */\nexport class DbxAnalyticsSegmentApiServiceConfig {\n writeKey: string;\n logging = true;\n active = true;\n constructor(writeKey: string) {\n this.writeKey = writeKey;\n }\n}\n\n/**\n * Extended Segment analytics type that includes the `invoked` flag set after the snippet initializes.\n */\ntype SegmentAnalyticsInvoked = SegmentAnalytics.AnalyticsJS & { invoked?: boolean };\n\n/**\n * Service that manages the async loading and initialization of the Segment analytics SDK from `window.analytics`.\n *\n * Polls for the Segment snippet to be invoked, then calls `analytics.load()` with the configured write key.\n * Once Segment reports ready, the resolved SDK instance is available via the inherited `service$` observable.\n *\n * Requires the Segment analytics snippet to be included in `index.html`.\n *\n * Provided via {@link provideDbxAnalyticsSegmentApiService}.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * provideDbxAnalyticsSegmentApiService({\n * dbxAnalyticsSegmentApiServiceConfigFactory: (injector) => {\n * const config = new DbxAnalyticsSegmentApiServiceConfig(environment.analytics.segment);\n * config.active = environment.production;\n * return config;\n * }\n * })\n * ```\n */\n@Injectable()\nexport class DbxAnalyticsSegmentApiService extends AbstractAsyncWindowLoadedService<SegmentAnalytics.AnalyticsJS> {\n private readonly _config = inject(DbxAnalyticsSegmentApiServiceConfig);\n\n static readonly SEGMENT_API_WINDOW_KEY = 'analytics';\n static readonly SEGMENT_READY_KEY = 'SegmentReady';\n\n constructor() {\n const preload = inject(PRELOAD_SEGMENT_TOKEN, { optional: true });\n super(DbxAnalyticsSegmentApiService.SEGMENT_API_WINDOW_KEY, undefined, 'Segment', preload);\n }\n\n get config(): DbxAnalyticsSegmentApiServiceConfig {\n return this._config;\n }\n\n protected override _prepareCompleteLoadingService(): Promise<void> {\n return poll({\n // poll until analytics.invoked is true.\n check: () => Boolean((window.analytics as SegmentAnalyticsInvoked).invoked),\n timesToGiveup: 100\n });\n }\n\n protected override _initService(service: SegmentAnalytics.AnalyticsJS): Promise<SegmentAnalytics.AnalyticsJS> {\n return new Promise((resolve, reject) => {\n try {\n service.load(this._config.writeKey); // Initialize Segment\n\n // Wait for the service to ready itself.\n service.ready(() => {\n // Segment changes itself or rather the target, and the previous initial target is ignored after.\n const segment: SegmentAnalytics.AnalyticsJS = window[DbxAnalyticsSegmentApiService.SEGMENT_API_WINDOW_KEY];\n resolve(segment);\n });\n } catch (e) {\n console.log('Failed to init segment: ' + e);\n reject(e);\n }\n });\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest } from 'rxjs';\nimport { AbstractDbxAnalyticsServiceListener, type DbxAnalyticsStreamEvent, DbxAnalyticsStreamEventType, type AnalyticsUser } from '../../analytics';\nimport { DbxAnalyticsSegmentApiService } from './segment.service';\n\n/**\n * Analytics listener that forwards {@link DbxAnalyticsStreamEvent} events to the Segment SDK.\n *\n * Automatically maps event types to the appropriate Segment methods:\n * - {@link DbxAnalyticsStreamEventType.Event} / {@link DbxAnalyticsStreamEventType.UserLoginEvent} -> `track()`\n * - {@link DbxAnalyticsStreamEventType.UserChange} / {@link DbxAnalyticsStreamEventType.NewUserEvent} -> `identify()`\n * - {@link DbxAnalyticsStreamEventType.UserLogoutEvent} -> `reset()`\n * - {@link DbxAnalyticsStreamEventType.PageView} -> `page()`\n *\n * Events are only sent when the Segment configuration is marked as `active`.\n * Provided at root level and registered as a listener via {@link DbxAnalyticsServiceConfiguration.listeners}.\n *\n * @example\n * ```ts\n * // Register in analytics configuration factory\n * function analyticsConfigFactory(injector: Injector): DbxAnalyticsServiceConfiguration {\n * const segmentListener = injector.get(DbxAnalyticsSegmentServiceListener);\n * return {\n * isProduction: true,\n * listeners: [segmentListener]\n * };\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAnalyticsSegmentServiceListener extends AbstractDbxAnalyticsServiceListener {\n private readonly _segmentApi = inject(DbxAnalyticsSegmentApiService);\n\n constructor() {\n super();\n\n if (this._segmentApi.config.logging) {\n console.log('SegmentAnalyticsListenerService: Segment is logging events.');\n }\n\n if (!this._segmentApi.config.active) {\n console.log('SegmentAnalyticsListenerService: Segment is disabled from sending events to the server.');\n }\n }\n\n /**\n * Subscribes to the Segment API service and analytics event stream, forwarding events to the Segment SDK.\n *\n * Events are only sent when the Segment configuration is marked as active.\n *\n * @returns Subscription to the combined Segment API and analytics event stream.\n */\n protected _initializeServiceSubscription() {\n return combineLatest([this._segmentApi.service$, this.analyticsEvents$]).subscribe(([segment, streamEvent]: [SegmentAnalytics.AnalyticsJS, DbxAnalyticsStreamEvent]) => {\n if (this._segmentApi.config.logging) {\n console.log('Segment Listener Logging Event: ', streamEvent);\n }\n\n if (this._segmentApi.config.active) {\n this.handleStreamEvent(segment, streamEvent);\n }\n });\n }\n\n /**\n * Routes an analytics stream event to the appropriate Segment API method based on event type.\n *\n * @param api - The Segment analytics SDK instance.\n * @param streamEvent - The analytics event to process.\n */\n protected handleStreamEvent(api: SegmentAnalytics.AnalyticsJS, streamEvent: DbxAnalyticsStreamEvent): void {\n switch (streamEvent.type) {\n case DbxAnalyticsStreamEventType.NewUserEvent:\n this.updateWithNewUserEvent(api, streamEvent);\n break;\n case DbxAnalyticsStreamEventType.UserLoginEvent:\n this.changeUser(api, streamEvent.user);\n this.updateWithEvent(api, streamEvent);\n break;\n case DbxAnalyticsStreamEventType.Event:\n this.updateWithEvent(api, streamEvent);\n break;\n case DbxAnalyticsStreamEventType.UserLogoutEvent:\n this.changeUser(api, undefined);\n break;\n case DbxAnalyticsStreamEventType.PageView:\n api.page();\n break;\n case DbxAnalyticsStreamEventType.UserChange:\n this.changeUser(api, streamEvent.user);\n break;\n case DbxAnalyticsStreamEventType.UserIdChange:\n case DbxAnalyticsStreamEventType.UserPropertiesEvent:\n case DbxAnalyticsStreamEventType.StartSessionRecording:\n case DbxAnalyticsStreamEventType.StopSessionRecording:\n case DbxAnalyticsStreamEventType.PauseSessionRecording:\n case DbxAnalyticsStreamEventType.ResumeSessionRecording:\n // These event types are not forwarded to Segment.\n break;\n }\n }\n\n /**\n * Handles a new user registration event by identifying the user in Segment.\n *\n * @param api - The Segment analytics SDK instance.\n * @param streamEvent - The event containing the new user data.\n */\n protected updateWithNewUserEvent(api: SegmentAnalytics.AnalyticsJS, streamEvent: DbxAnalyticsStreamEvent): void {\n this.changeUser(api, streamEvent.user);\n }\n\n /**\n * Sends a track event to Segment with the event name, value, and additional data properties.\n *\n * @param api - The Segment analytics SDK instance.\n * @param streamEvent - The analytics event containing name, value, and data.\n * @param name - Optional override for the event name.\n */\n protected updateWithEvent(api: SegmentAnalytics.AnalyticsJS, streamEvent: DbxAnalyticsStreamEvent, name?: string): void {\n const event = streamEvent.event;\n const eventName = name || event?.name;\n\n if (eventName) {\n const value = event?.value;\n const data = event?.data;\n\n api.track(\n eventName,\n {\n ...(value == null\n ? undefined\n : {\n value\n }),\n ...data\n },\n {},\n () => {\n if (this._segmentApi.config.logging) {\n console.log('Segment track success.');\n }\n }\n );\n }\n }\n\n private changeUser(api: SegmentAnalytics.AnalyticsJS, user: Maybe<AnalyticsUser>): void {\n if (user?.user) {\n api.identify(\n user.user,\n {\n ...user.properties\n },\n {},\n () => {\n if (this._segmentApi.config.logging) {\n console.log('Segment identify success.');\n }\n }\n );\n } else {\n api.reset();\n }\n }\n}\n","import { type EnvironmentProviders, Injector, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxAnalyticsSegmentApiService, DbxAnalyticsSegmentApiServiceConfig, PRELOAD_SEGMENT_TOKEN } from './segment.service';\n\n/**\n * Factory function that creates a {@link DbxAnalyticsSegmentApiServiceConfig} using the Angular injector.\n *\n * Used by {@link provideDbxAnalyticsSegmentApiService} to defer Segment configuration to runtime.\n */\nexport type DbxAnalyticsSegmentApiServiceConfigFactory = (injector: Injector) => DbxAnalyticsSegmentApiServiceConfig;\n\n/**\n * Configuration for {@link provideDbxAnalyticsSegmentApiService}.\n */\nexport interface ProvideDbxAnalyticsSegmentModuleConfig {\n /**\n * Whether to preload the Segment script token.\n */\n readonly preloadSegmentToken?: boolean;\n /**\n * Factory function that produces the Segment API service configuration.\n */\n readonly dbxAnalyticsSegmentApiServiceConfigFactory: DbxAnalyticsSegmentApiServiceConfigFactory;\n}\n\n/**\n * Creates Angular environment providers that register {@link DbxAnalyticsSegmentApiService} for Segment analytics integration.\n *\n * Use alongside {@link provideDbxAnalyticsService} to wire Segment as an analytics listener.\n *\n * @param config - Segment-specific configuration including the write key factory.\n * @returns Environment providers for Segment analytics.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDbxAnalyticsSegmentApiService({\n * dbxAnalyticsSegmentApiServiceConfigFactory: (injector) => {\n * const config = new DbxAnalyticsSegmentApiServiceConfig(environment.analytics.segment);\n * config.active = environment.production;\n * config.logging = !environment.production;\n * return config;\n * }\n * }),\n * provideDbxAnalyticsService({\n * dbxAnalyticsServiceConfigurationFactory: (injector) => ({\n * isProduction: environment.production,\n * listeners: [injector.get(DbxAnalyticsSegmentServiceListener)]\n * })\n * })\n * ]\n * };\n * ```\n *\n * @__NO_SIDE_EFFECTS__\n */\nexport function provideDbxAnalyticsSegmentApiService(config: ProvideDbxAnalyticsSegmentModuleConfig): EnvironmentProviders {\n const { preloadSegmentToken, dbxAnalyticsSegmentApiServiceConfigFactory } = config;\n\n const providers: Provider[] = [\n // configuration\n {\n provide: DbxAnalyticsSegmentApiServiceConfig,\n useFactory: dbxAnalyticsSegmentApiServiceConfigFactory,\n deps: [Injector]\n },\n // service\n DbxAnalyticsSegmentApiService\n ];\n\n if (preloadSegmentToken) {\n providers.push({\n provide: PRELOAD_SEGMENT_TOKEN,\n useValue: preloadSegmentToken\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAGA;;;;;AAKG;IACS;AAAZ,CAAA,UAAY,2BAA2B,EAAA;AACrC;;AAEG;AACH,IAAA,2BAAA,CAAA,2BAAA,CAA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G,SAAU,oCAAoC,CAAC,MAA8C,EAAA;AACjG,IAAA,MAAM,EAAE,mBAAmB,EAAE,0CAA0C,EAAE,GAAG,MAAM;AAElF,IAAA,MAAM,SAAS,GAAe;;AAE5B,QAAA;AACE,YAAA,OAAO,EAAE,mCAAmC;AAC5C,YAAA,UAAU,EAAE,0CAA0C;YACtD,IAAI,EAAE,CAAC,QAAQ;AAChB,SAAA;;QAED;KACD;IAED,IAAI,mBAAmB,EAAE;QACvB,SAAS,CAAC,IAAI,CAAC;AACb,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE;AACX,SAAA,CAAC;IACJ;AAEA,IAAA,OAAO,wBAAwB,CAAC,SAAS,CAAC;AAC5C;;AC/EA;;AAEG;;;;"}
1
+ {"version":3,"file":"dereekb-dbx-analytics.mjs","sources":["../../../../packages/dbx-analytics/src/lib/analytics/analytics.stream.ts","../../../../packages/dbx-analytics/src/lib/analytics/analytics.service.ts","../../../../packages/dbx-analytics/src/lib/action/analytics.action.directive.ts","../../../../packages/dbx-analytics/src/lib/analytics/analytics.providers.ts","../../../../packages/dbx-analytics/src/lib/providers/mixpanel/mixpanel.service.ts","../../../../packages/dbx-analytics/src/lib/providers/mixpanel/mixpanel.listener.service.ts","../../../../packages/dbx-analytics/src/lib/providers/mixpanel/mixpanel.providers.ts","../../../../packages/dbx-analytics/src/lib/providers/segment/segment.service.ts","../../../../packages/dbx-analytics/src/lib/providers/segment/segment.listener.service.ts","../../../../packages/dbx-analytics/src/lib/providers/segment/segment.providers.ts","../../../../packages/dbx-analytics/src/dereekb-dbx-analytics.ts"],"sourcesContent":["import { type Maybe } from '@dereekb/util';\nimport { type AnalyticsUser, type UserAnalyticsEvent, type AnalyticsUserId } from './analytics';\n\n/**\n * Categorizes the kind of analytics stream event emitted by {@link DbxAnalyticsService}.\n *\n * Listeners use this type to route events to the appropriate analytics provider method\n * (e.g., Segment `track()`, `identify()`, `page()`).\n */\nexport enum DbxAnalyticsStreamEventType {\n /**\n * A page/screen view event, typically sent on route transitions.\n */\n PageView,\n /**\n * Emitted any time the user value changes, including when transitioning from defined to undefined.\n *\n * Used by listeners to update the identified user in analytics providers.\n */\n UserChange,\n /**\n * Emitted only when the user's unique ID changes, filtering out property-only updates.\n *\n * Useful for triggering identity calls without redundant updates when only traits change.\n */\n UserIdChange,\n\n // User Events\n /**\n * A new user registration event.\n */\n NewUserEvent,\n /**\n * A returning user login event.\n */\n UserLoginEvent,\n /**\n * A user logout event.\n */\n UserLogoutEvent,\n /**\n * An update to user profile properties/traits.\n */\n UserPropertiesEvent,\n\n // Events\n /**\n * A generic custom analytics event.\n */\n Event,\n\n // Session Replay\n /**\n * Request to start session replay recording.\n */\n StartSessionRecording,\n /**\n * Request to stop session replay recording.\n */\n StopSessionRecording,\n /**\n * Request to pause an active session replay recording without clearing it.\n */\n PauseSessionRecording,\n /**\n * Request to resume a previously paused session replay recording.\n */\n ResumeSessionRecording\n}\n\n/**\n * Represents a single event in the analytics stream, combining the event type, payload, and user context.\n *\n * Emitted by {@link DbxAnalyticsService} and consumed by {@link DbxAnalyticsServiceListener} implementations\n * (e.g., {@link DbxAnalyticsSegmentServiceListener}) to forward events to external analytics providers.\n *\n * @example\n * ```ts\n * // Subscribe to the analytics event stream\n * analyticsService.events$.subscribe((streamEvent: DbxAnalyticsStreamEvent) => {\n * console.log(streamEvent.type, streamEvent.event?.name, streamEvent.userId);\n * });\n * ```\n */\nexport interface DbxAnalyticsStreamEvent {\n readonly type: DbxAnalyticsStreamEventType;\n readonly user?: Maybe<AnalyticsUser>;\n readonly event?: UserAnalyticsEvent;\n readonly userId?: AnalyticsUserId;\n}\n","import { type Observable, Subject, BehaviorSubject, of, type Subscription, first, shareReplay, switchMap, distinctUntilChanged } from 'rxjs';\nimport { Injectable, inject } from '@angular/core';\nimport { SubscriptionObject, filterMaybe } from '@dereekb/rxjs';\nimport { type AnalyticsEvent, type AnalyticsEventData, type AnalyticsEventName, type AnalyticsUser, type NewUserAnalyticsEventData, type UserAnalyticsEvent } from './analytics';\nimport { type DbxAnalyticsStreamEvent, DbxAnalyticsStreamEventType } from './analytics.stream';\nimport { type Maybe, type Destroyable, safeCompareEquality } from '@dereekb/util';\n\n/**\n * Abstract emitter interface for sending analytics events.\n *\n * Implemented by {@link DbxAnalyticsService} as the primary concrete implementation.\n * Components and services use this to fire analytics events without coupling to a specific provider.\n *\n * @example\n * ```ts\n * // Inject and send a custom event\n * const emitter = inject(DbxAnalyticsEventEmitterService);\n * emitter.sendEventData('Button Clicked', { buttonId: 'save' });\n * ```\n */\nexport abstract class DbxAnalyticsEventEmitterService {\n abstract sendNewUserEvent(user: AnalyticsUser, data: NewUserAnalyticsEventData): void;\n abstract sendUserLoginEvent(user: AnalyticsUser, data?: AnalyticsEventData): void;\n abstract sendUserLogoutEvent(data?: AnalyticsEventData): void;\n abstract sendUserPropertiesEvent(user: AnalyticsUser, data?: AnalyticsEventData): void;\n abstract sendEventData(name: AnalyticsEventName, data: AnalyticsEventData): void;\n abstract sendEvent(event: AnalyticsEvent): void;\n abstract sendPageView(page?: string): void;\n abstract startSessionRecording(): void;\n abstract stopSessionRecording(): void;\n abstract pauseSessionRecording(): void;\n abstract resumeSessionRecording(): void;\n}\n\n/**\n * Abstract interface exposing the analytics event stream as an observable.\n *\n * Implemented by {@link DbxAnalyticsService}. Listeners subscribe to `events$` to forward events to external providers.\n */\nexport abstract class DbxAnalyticsEventStreamService {\n abstract readonly events$: Observable<DbxAnalyticsStreamEvent>;\n}\n\n/**\n * Abstract source for the current analytics user identity.\n *\n * Provide an implementation to automatically associate a user with all emitted analytics events.\n * Typically backed by the auth system (e.g., {@link DbxFirebaseAnalyticsUserSource}).\n *\n * @example\n * ```ts\n * // Provide a static user source\n * const userSource: DbxAnalyticsUserSource = {\n * analyticsUser$: of({ user: 'uid_abc123', properties: { role: 'admin' } })\n * };\n * ```\n */\nexport abstract class DbxAnalyticsUserSource {\n abstract readonly analyticsUser$: Observable<Maybe<AnalyticsUser>>;\n}\n\n/**\n * Abstract listener that receives analytics events from {@link DbxAnalyticsService}.\n *\n * Implement this to forward events to an external analytics provider (e.g., Segment, Mixpanel).\n * Register listeners via {@link DbxAnalyticsServiceConfiguration.listeners}.\n */\nexport abstract class DbxAnalyticsServiceListener {\n public abstract listenToService(service: DbxAnalyticsService): void;\n}\n\n/**\n * Base class for analytics service listeners that manages subscription lifecycle and provides\n * reactive access to the analytics service and its event stream.\n *\n * Subclasses implement {@link _initializeServiceSubscription} to subscribe to events and forward them\n * to an external analytics provider.\n *\n * @example\n * ```ts\n * class MyAnalyticsListener extends AbstractDbxAnalyticsServiceListener {\n * protected _initializeServiceSubscription(): Subscription | false {\n * return this.analyticsEvents$.subscribe((event) => {\n * console.log('Event:', event.type, event.event?.name);\n * });\n * }\n * }\n * ```\n */\nexport abstract class AbstractDbxAnalyticsServiceListener implements DbxAnalyticsServiceListener, Destroyable {\n private _sub = new SubscriptionObject();\n protected _analytics = new BehaviorSubject<Maybe<DbxAnalyticsService>>(undefined);\n\n readonly analytics$ = this._analytics.pipe(filterMaybe(), shareReplay(1));\n readonly analyticsEvents$ = this.analytics$.pipe(\n switchMap((x) => x.events$),\n shareReplay(1)\n );\n\n // MARK: AnalyticsServiceListener\n listenToService(service: DbxAnalyticsService): void {\n this._analytics.next(service);\n const sub = this._initializeServiceSubscription();\n\n if (sub !== false) {\n this._sub.subscription = sub;\n }\n }\n\n protected abstract _initializeServiceSubscription(): Subscription | false;\n\n // MARK: Destroy\n destroy(): void {\n this._analytics.complete();\n this._sub.destroy();\n }\n}\n\n/**\n * Configuration for {@link DbxAnalyticsService}, controlling which listeners receive events,\n * whether analytics runs in production mode, and optionally providing a user source.\n *\n * In non-production mode, listeners are not initialized and all events are logged to the console instead.\n * Provide via {@link provideDbxAnalyticsService} using a factory function.\n *\n * @example\n * ```ts\n * const config: DbxAnalyticsServiceConfiguration = {\n * isProduction: environment.production,\n * logEvents: !environment.production,\n * listeners: [segmentListener],\n * userSource: firebaseAnalyticsUserSource\n * };\n * ```\n */\nexport abstract class DbxAnalyticsServiceConfiguration {\n readonly listeners: DbxAnalyticsServiceListener[] = [];\n readonly isProduction?: boolean;\n readonly logEvents?: boolean;\n readonly userSource?: DbxAnalyticsUserSource;\n}\n\n/**\n * A fully resolved analytics stream event that includes the event payload, type, user context, and extracted user ID.\n *\n * Created by {@link dbxAnalyticsStreamEventAnalyticsEventWrapper} and emitted through the analytics event stream.\n */\nexport interface DbxAnalyticsStreamEventAnalyticsEventWrapper extends DbxAnalyticsStreamEvent {\n readonly event: UserAnalyticsEvent;\n readonly type: DbxAnalyticsStreamEventType;\n readonly user: Maybe<AnalyticsUser>;\n readonly userId: string | undefined;\n}\n\n/**\n * Wraps a {@link UserAnalyticsEvent} into a {@link DbxAnalyticsStreamEventAnalyticsEventWrapper},\n * extracting the user ID for convenient access by listeners.\n *\n * @param event - The analytics event with optional user context.\n * @param type - The stream event type classification; defaults to `Event`\n * @returns A wrapper combining the event, type, user, and extracted userId.\n *\n * @example\n * ```ts\n * const wrapper = dbxAnalyticsStreamEventAnalyticsEventWrapper(\n * { name: 'Button Clicked', user: { user: 'uid_123' } },\n * DbxAnalyticsStreamEventType.Event\n * );\n * // wrapper.userId === 'uid_123'\n * ```\n */\nexport function dbxAnalyticsStreamEventAnalyticsEventWrapper(event: UserAnalyticsEvent, type: DbxAnalyticsStreamEventType = DbxAnalyticsStreamEventType.Event) {\n const { user } = event;\n const userId = user ? user.user : undefined;\n\n return {\n event,\n type,\n user,\n userId\n };\n}\n\n/**\n * Central analytics service that emits typed analytics events for consumption by registered listeners.\n *\n * Acts as both the event emitter (components call methods like {@link sendEventData}, {@link sendPageView})\n * and the event stream source (listeners subscribe to {@link events$}).\n *\n * In production mode, registered {@link DbxAnalyticsServiceListener} instances (e.g., Segment) receive all events.\n * In non-production mode, events are logged to the console for debugging.\n *\n * Provided via {@link provideDbxAnalyticsService} with a {@link DbxAnalyticsServiceConfiguration} factory.\n *\n * @example\n * ```ts\n * // Send a custom event from a component\n * const analytics = inject(DbxAnalyticsService);\n * analytics.sendEventData('Interview Started', { candidateId: 'abc123' });\n *\n * // Send a page view on route transitions\n * transitionService.onSuccess({}, () => {\n * analytics.sendPageView();\n * });\n * ```\n */\n@Injectable()\nexport class DbxAnalyticsService implements DbxAnalyticsEventStreamService, DbxAnalyticsEventEmitterService, Destroyable {\n private readonly _config = inject(DbxAnalyticsServiceConfiguration);\n\n // TODO: Make these configurable.\n static readonly USER_REGISTRATION_EVENT_NAME = 'User Registered';\n static readonly USER_LOGIN_EVENT_NAME = 'User Login';\n static readonly USER_LOGOUT_EVENT_NAME = 'User Logout';\n static readonly USER_PROPERTIES_EVENT_NAME = 'User Properties';\n\n private _subject = new Subject<DbxAnalyticsStreamEvent>();\n readonly events$ = this._subject.asObservable();\n\n private _userSource = new BehaviorSubject<Maybe<DbxAnalyticsUserSource>>(undefined);\n\n readonly user$ = this._userSource.pipe(\n switchMap((x) => (x ? x.analyticsUser$ : of(undefined))),\n shareReplay(1)\n );\n\n private _userSourceSub = new SubscriptionObject();\n private _userIdEventSub = new SubscriptionObject();\n private _loggerSub = new SubscriptionObject();\n\n constructor() {\n this._init();\n let userSource: Maybe<DbxAnalyticsUserSource> = inject(DbxAnalyticsUserSource, { optional: true });\n userSource = userSource || this._config.userSource;\n\n if (userSource) {\n this.setUserSource(userSource);\n }\n }\n\n // MARK: Source\n /**\n * Sets the analytics user directly, overriding any configured {@link DbxAnalyticsUserSource}.\n *\n * Pass `undefined` to clear the current user (e.g., on logout).\n *\n * @param user - The user to identify, or undefined to clear.\n */\n public setUser(user: Maybe<AnalyticsUser>): void {\n let source: Maybe<DbxAnalyticsUserSource>;\n\n if (user) {\n source = { analyticsUser$: of(user) };\n }\n\n this._userSource.next(source);\n\n if (this._userSource.value) {\n console.warn('DbxAnalyticsService has a userSource that is set. Source is now overridden by setUser() value.');\n }\n }\n\n /**\n * Sets the reactive user source that automatically updates the analytics user as auth state changes.\n *\n * @param source - The user source providing an observable of the current analytics user.\n */\n public setUserSource(source: DbxAnalyticsUserSource): void {\n this._userSource.next(source);\n }\n\n // MARK: DbxAnalyticsEventEmitterService\n /**\n * Emits a new user registration event, typically sent once after account creation.\n *\n * @param user - The newly registered user.\n * @param data - Registration-specific data including the signup method.\n */\n public sendNewUserEvent(user: AnalyticsUser, data: NewUserAnalyticsEventData): void {\n this.sendNextEvent(\n {\n name: DbxAnalyticsService.USER_REGISTRATION_EVENT_NAME,\n data\n },\n DbxAnalyticsStreamEventType.NewUserEvent,\n user\n );\n }\n\n /**\n * Emits a user login event, identifying the user in analytics providers.\n *\n * @param user - The user who logged in.\n * @param data - Optional additional event data.\n */\n public sendUserLoginEvent(user: AnalyticsUser, data?: AnalyticsEventData): void {\n this.sendNextEvent(\n {\n name: DbxAnalyticsService.USER_LOGIN_EVENT_NAME,\n data\n },\n DbxAnalyticsStreamEventType.UserLoginEvent,\n user\n );\n }\n\n /**\n * Emits a user logout event and optionally clears the current analytics user.\n *\n * @param data - Optional additional event data.\n * @param clearUser - Whether to reset the analytics user identity; defaults to `true`\n */\n public sendUserLogoutEvent(data?: AnalyticsEventData, clearUser = true): void {\n this.sendNextEvent(\n {\n name: DbxAnalyticsService.USER_LOGOUT_EVENT_NAME,\n data\n },\n DbxAnalyticsStreamEventType.UserLogoutEvent\n );\n\n if (clearUser) {\n this.setUser(undefined);\n }\n }\n\n /**\n * Emits a user properties update event, used to sync user traits to analytics providers.\n *\n * @param user - The user whose properties are being updated.\n * @param data - Optional additional event data.\n */\n public sendUserPropertiesEvent(user: AnalyticsUser, data?: AnalyticsEventData): void {\n this.sendNextEvent(\n {\n name: DbxAnalyticsService.USER_PROPERTIES_EVENT_NAME,\n data\n },\n DbxAnalyticsStreamEventType.UserPropertiesEvent,\n user\n );\n }\n\n /**\n * Sends a named analytics event with a data payload.\n *\n * This is the primary method for tracking custom events with associated properties.\n *\n * @param name - The event name (e.g., `'Interview Ended'`)\n * @param data - Key-value data attached to the event.\n *\n * @example\n * ```ts\n * analytics.sendEventData('Interview Ended', {\n * seconds: 120,\n * endedDueToTime: 'true'\n * });\n * ```\n */\n public sendEventData(name: AnalyticsEventName, data: AnalyticsEventData): void;\n public sendEventData(name: AnalyticsEventName, data?: AnalyticsEventData): void {\n return this.sendEvent({\n name,\n data\n });\n }\n\n /**\n * Sends a named event with no additional data, useful for simple occurrence tracking.\n *\n * @param eventType - The event name to track.\n *\n * @example\n * ```ts\n * analytics.sendEventType('Finish Account Setup');\n * ```\n */\n public sendEventType(eventType: AnalyticsEventName): void {\n this.sendNextEvent(\n {\n name: eventType\n },\n DbxAnalyticsStreamEventType.Event\n );\n }\n\n /**\n * Sends a fully constructed analytics event object.\n *\n * @param event - The event containing name, optional value, and data.\n */\n public sendEvent(event: AnalyticsEvent): void {\n this.sendNextEvent(event, DbxAnalyticsStreamEventType.Event);\n }\n\n /**\n * Sends a page view event, typically called on successful route transitions.\n *\n * @param page - Optional page name/path override; if omitted, the provider determines the current page.\n *\n * @example\n * ```ts\n * // In a router config function\n * transitionService.onSuccess({}, () => {\n * analyticsService.sendPageView();\n * });\n * ```\n */\n public sendPageView(page?: string): void {\n this.sendNextEvent(\n {\n name: page\n },\n DbxAnalyticsStreamEventType.PageView\n );\n }\n\n /**\n * Requests that opt-in listeners (e.g. Mixpanel) start session replay recording.\n *\n * Forwarded as a {@link DbxAnalyticsStreamEventType.StartSessionRecording} event. Listeners\n * that don't handle session replay (e.g. Segment) ignore it.\n */\n public startSessionRecording(): void {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.StartSessionRecording);\n }\n\n /**\n * Requests that opt-in listeners stop session replay recording.\n *\n * Forwarded as a {@link DbxAnalyticsStreamEventType.StopSessionRecording} event.\n */\n public stopSessionRecording(): void {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.StopSessionRecording);\n }\n\n /**\n * Requests that opt-in listeners pause active session replay recording without clearing it.\n *\n * Forwarded as a {@link DbxAnalyticsStreamEventType.PauseSessionRecording} event.\n */\n public pauseSessionRecording(): void {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.PauseSessionRecording);\n }\n\n /**\n * Requests that opt-in listeners resume previously paused session replay recording.\n *\n * Forwarded as a {@link DbxAnalyticsStreamEventType.ResumeSessionRecording} event.\n */\n public resumeSessionRecording(): void {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.ResumeSessionRecording);\n }\n\n /**\n * Sends the next event.\n *\n * @param event\n * @param type\n * @param userOverride - Uses this user if set as null or an override value. If undefined the current analytics user is used.\n */\n protected sendNextEvent(event: AnalyticsEvent = {}, type: DbxAnalyticsStreamEventType, userOverride?: Maybe<AnalyticsUser>): void {\n this.user$.pipe(first()).subscribe((analyticsUser) => {\n const user: Maybe<AnalyticsUser> = userOverride === undefined ? analyticsUser : userOverride;\n const analyticsEvent: UserAnalyticsEvent = { ...event, user };\n this.nextEvent(analyticsEvent, type);\n });\n }\n\n protected nextEvent(event: UserAnalyticsEvent, type: DbxAnalyticsStreamEventType): void {\n const wrapper = dbxAnalyticsStreamEventAnalyticsEventWrapper(event, type);\n this._subject.next(wrapper);\n }\n\n // MARK: Internal\n private _init(): void {\n if (this._config.isProduction) {\n // Initialize listeners.\n this._config.listeners.forEach((listener) => {\n listener.listenToService(this);\n });\n } else {\n console.warn('AnalyticsService: Analytics not in production mode. All analytics events are ignored.');\n }\n\n if (this._config.logEvents || !this._config.isProduction) {\n console.log('AnalyticsService: Log analytics events enabled.');\n\n // Create a new subscription\n this._loggerSub.subscription = this._subject.subscribe((x) => {\n console.log(`AnalyticsService: Analytics Event - ${DbxAnalyticsStreamEventType[x.type]} | User: ${x.userId} | Data: ${JSON.stringify(x.event)}.`);\n });\n }\n\n this._userSourceSub.subscription = this.user$.subscribe((user) => {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.UserChange, user ?? null);\n });\n\n this._userIdEventSub.subscription = this.user$.pipe(distinctUntilChanged((a, b) => safeCompareEquality(a, b, (x, y) => x.user === y.user))).subscribe((user) => {\n this.sendNextEvent({}, DbxAnalyticsStreamEventType.UserIdChange, user ?? null);\n });\n }\n\n destroy() {\n this._subject.complete();\n this._userSource.complete();\n this._userSourceSub.destroy();\n this._userIdEventSub.destroy();\n this._loggerSub.destroy();\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { switchMap, tap, shareReplay, merge, type Observable, of } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { DbxActionContextStoreSourceInstance, cleanSubscriptionWithLockSet } from '@dereekb/dbx-core';\nimport { DbxAnalyticsService } from '../analytics/analytics.service';\nimport { type Maybe, type ReadableError } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Configuration for {@link DbxActionAnalyticsDirective} that maps action lifecycle events to analytics calls.\n *\n * Each callback receives the {@link DbxAnalyticsService} and relevant action data, allowing you to\n * send targeted analytics events at each stage of an action's lifecycle (trigger, ready, success, error).\n *\n * @example\n * ```ts\n * // In a component, define analytics config for a form submit action\n * readonly submitAnalytics: DbxActionAnalyticsConfig<MyFormValue, MyResult> = {\n * onReady: (service, value) => {\n * service.sendEventData('Form Submitted', { formType: 'onboard' });\n * },\n * onSuccess: (service, result, value) => {\n * service.sendEventType('Onboarding Complete');\n * },\n * onError: (service, error) => {\n * service.sendEventData('Form Submit Failed', { code: error?.code ?? 'unknown' });\n * }\n * };\n *\n * // In the template\n * // <button dbxAction [dbxActionAnalytics]=\"submitAnalytics\">Submit</button>\n * ```\n */\nexport interface DbxActionAnalyticsConfig<T = unknown, O = unknown> {\n /**\n * Called when the action is triggered (button pressed).\n */\n readonly onTriggered?: (service: DbxAnalyticsService) => void;\n /**\n * Called when the action value is ready and about to be processed.\n */\n readonly onReady?: (service: DbxAnalyticsService, value: T) => void;\n /**\n * Called when the action completes successfully.\n */\n readonly onSuccess?: (service: DbxAnalyticsService, result: Maybe<O>, value: T) => void;\n /**\n * Called when the action encounters an error.\n */\n readonly onError?: (service: DbxAnalyticsService, error: Maybe<ReadableError>) => void;\n}\n\n/**\n * Standalone directive that listens to a host {@link DbxActionDirective} and fires analytics events\n * based on the action's lifecycle (triggered, ready, success, error).\n *\n * Attach to any element that has a `dbxAction` directive and pass a {@link DbxActionAnalyticsConfig}\n * to define which events to send at each lifecycle stage.\n *\n * @example\n * ```html\n * <button dbxAction\n * [dbxActionHandler]=\"handleSave\"\n * [dbxActionAnalytics]=\"saveAnalytics\">\n * Save\n * </button>\n * ```\n */\n@Directive({\n selector: '[dbxActionAnalytics]'\n})\nexport class DbxActionAnalyticsDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n readonly analyticsService = inject(DbxAnalyticsService);\n\n readonly config = input<Maybe<DbxActionAnalyticsConfig<T, O>>>(undefined, { alias: 'dbxActionAnalytics' });\n readonly config$ = toObservable(this.config).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.config$\n .pipe(\n switchMap(({ onTriggered, onReady, onSuccess, onError }) => {\n const triggerObs: Observable<unknown>[] = [];\n\n if (onTriggered) {\n triggerObs.push(this.source.triggered$.pipe(tap(() => onTriggered(this.analyticsService))));\n }\n\n if (onReady) {\n triggerObs.push(this.source.valueReady$.pipe(tap((value) => onReady(this.analyticsService, value))));\n }\n\n if (onSuccess) {\n triggerObs.push(this.source.successPair$.pipe(tap(({ result, value }) => onSuccess(this.analyticsService, result, value))));\n }\n\n if (onError) {\n triggerObs.push(\n this.source.error$.pipe(\n filterMaybe(),\n tap((error) => onError(this.analyticsService, error))\n )\n );\n }\n\n return triggerObs.length ? merge(...triggerObs) : of();\n })\n )\n .subscribe()\n });\n }\n}\n","import { type EnvironmentProviders, Injector, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxAnalyticsServiceConfiguration, DbxAnalyticsService } from './analytics.service';\n\n/**\n * Factory function that creates a {@link DbxAnalyticsServiceConfiguration} using the Angular injector.\n *\n * Used by {@link provideDbxAnalyticsService} to defer configuration resolution to runtime.\n */\nexport type DbxAnalyticsServiceConfigurationFactory = (injector: Injector) => DbxAnalyticsServiceConfiguration;\n\n/**\n * Configuration for {@link provideDbxAnalyticsService}.\n */\nexport interface ProvideDbxAnalyticsConfig {\n readonly dbxAnalyticsServiceConfigurationFactory: DbxAnalyticsServiceConfigurationFactory;\n}\n\n/**\n * Creates Angular environment providers that register {@link DbxAnalyticsService} and its configuration.\n *\n * Call this in your application's `providers` array to set up analytics with a custom configuration factory\n * that resolves listeners, user sources, and environment flags at runtime.\n *\n * @param config - Contains the factory function that produces a {@link DbxAnalyticsServiceConfiguration}\n * @returns Environment providers for the analytics service.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDbxAnalyticsService({\n * dbxAnalyticsServiceConfigurationFactory: (injector: Injector) => ({\n * isProduction: environment.production,\n * logEvents: !environment.production,\n * listeners: [injector.get(DbxAnalyticsSegmentServiceListener)],\n * userSource: injector.get(DbxFirebaseAnalyticsUserSource)\n * })\n * })\n * ]\n * };\n * ```\n *\n * @__NO_SIDE_EFFECTS__\n */\nexport function provideDbxAnalyticsService(config: ProvideDbxAnalyticsConfig): EnvironmentProviders {\n const { dbxAnalyticsServiceConfigurationFactory } = config;\n\n const providers: Provider[] = [\n // configuration\n {\n provide: DbxAnalyticsServiceConfiguration,\n useFactory: dbxAnalyticsServiceConfigurationFactory,\n deps: [Injector]\n },\n // service\n DbxAnalyticsService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { AbstractAsyncWindowLoadedService } from '@dereekb/browser';\n\n/**\n * Injection token for optionally preloading the Mixpanel SDK on the page.\n *\n * In typical setups Mixpanel is loaded by Segment device mode, so this token is rarely needed.\n */\nexport const PRELOAD_MIXPANEL_TOKEN = new InjectionToken<string>('DbxAnalyticsMixpanelApiServicePreload');\n\n/**\n * Minimal subset of the Mixpanel JS SDK surface used by the Mixpanel listener.\n *\n * Avoids taking a runtime dependency on `mixpanel-browser` since the SDK is loaded on the page\n * by Segment's Mixpanel (Actions) device-mode destination. Widen this interface if more\n * Mixpanel APIs are needed.\n */\nexport interface MixpanelLike {\n start_session_recording(): void;\n stop_session_recording(): void;\n pause_session_recording(): void;\n resume_session_recording(): void;\n}\n\n/**\n * Configuration for the Mixpanel analytics integration.\n *\n * Unlike {@link DbxAnalyticsSegmentApiServiceConfig}, this config does not take a write key —\n * Mixpanel is initialized by Segment device mode. The `active` and `logging` flags exist for\n * parity with the Segment config and to gate listener behavior.\n *\n * @example\n * ```ts\n * const config = new DbxAnalyticsMixpanelApiServiceConfig();\n * config.active = environment.production;\n * config.logging = !environment.production;\n * ```\n */\nexport class DbxAnalyticsMixpanelApiServiceConfig {\n logging = true;\n active = true;\n}\n\n/**\n * Service that manages async access to the Mixpanel JS SDK exposed on `window.mixpanel`.\n *\n * The Mixpanel SDK is typically loaded by Segment's Mixpanel (Actions) device-mode destination,\n * so this service waits for `window.mixpanel` to exist using the inherited window-loading polling.\n * The resolved SDK instance is available via the inherited `service$` observable.\n *\n * Provided via {@link provideDbxAnalyticsMixpanelApiService}.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * provideDbxAnalyticsMixpanelApiService({\n * dbxAnalyticsMixpanelApiServiceConfigFactory: () => {\n * const config = new DbxAnalyticsMixpanelApiServiceConfig();\n * config.active = environment.production;\n * return config;\n * }\n * })\n * ```\n */\n@Injectable()\nexport class DbxAnalyticsMixpanelApiService extends AbstractAsyncWindowLoadedService<MixpanelLike> {\n private readonly _config = inject(DbxAnalyticsMixpanelApiServiceConfig);\n\n static readonly MIXPANEL_API_WINDOW_KEY = 'mixpanel';\n\n constructor() {\n const preload = inject(PRELOAD_MIXPANEL_TOKEN, { optional: true });\n super(DbxAnalyticsMixpanelApiService.MIXPANEL_API_WINDOW_KEY, undefined, 'Mixpanel', preload);\n }\n\n get config(): DbxAnalyticsMixpanelApiServiceConfig {\n return this._config;\n }\n}\n","import { Service, inject } from '@angular/core';\nimport { combineLatest } from 'rxjs';\nimport { AbstractDbxAnalyticsServiceListener, type DbxAnalyticsStreamEvent, DbxAnalyticsStreamEventType } from '../../analytics';\nimport { DbxAnalyticsMixpanelApiService, type MixpanelLike } from './mixpanel.service';\n\n/**\n * Analytics listener that forwards session-replay control events to the Mixpanel SDK.\n *\n * Handles only the four session-replay event types — track/identify/page events are intentionally\n * not forwarded here because Segment's Mixpanel (Actions) device-mode destination already routes\n * them to Mixpanel. Forwarding them again would produce duplicate events.\n *\n * - {@link DbxAnalyticsStreamEventType.StartSessionRecording} -> `mixpanel.start_session_recording()`\n * - {@link DbxAnalyticsStreamEventType.StopSessionRecording} -> `mixpanel.stop_session_recording()`\n * - {@link DbxAnalyticsStreamEventType.PauseSessionRecording} -> `mixpanel.pause_session_recording()`\n * - {@link DbxAnalyticsStreamEventType.ResumeSessionRecording} -> `mixpanel.resume_session_recording()`\n *\n * Events are only sent when the Mixpanel configuration is marked as `active`.\n * Provided at root level and registered as a listener via {@link DbxAnalyticsServiceConfiguration.listeners}.\n */\n@Service()\nexport class DbxAnalyticsMixpanelServiceListener extends AbstractDbxAnalyticsServiceListener {\n private readonly _mixpanelApi = inject(DbxAnalyticsMixpanelApiService);\n\n constructor() {\n super();\n\n if (this._mixpanelApi.config.logging) {\n console.log('MixpanelAnalyticsListenerService: Mixpanel is logging events.');\n }\n\n if (!this._mixpanelApi.config.active) {\n console.log('MixpanelAnalyticsListenerService: Mixpanel is disabled from sending events to the server.');\n }\n }\n\n protected _initializeServiceSubscription() {\n return combineLatest([this._mixpanelApi.service$, this.analyticsEvents$]).subscribe(([mixpanel, streamEvent]: [MixpanelLike, DbxAnalyticsStreamEvent]) => {\n if (this._mixpanelApi.config.logging) {\n console.log('Mixpanel Listener Logging Event: ', streamEvent);\n }\n\n if (this._mixpanelApi.config.active) {\n this.handleStreamEvent(mixpanel, streamEvent);\n }\n });\n }\n\n /**\n * Routes a session-replay control event to the corresponding Mixpanel SDK method.\n *\n * Non-session-replay events are intentionally ignored — Segment's device-mode integration\n * already forwards track/identify/page to Mixpanel.\n *\n * @param api - The loaded Mixpanel SDK instance.\n * @param streamEvent - The analytics event to process.\n */\n protected handleStreamEvent(api: MixpanelLike, streamEvent: DbxAnalyticsStreamEvent): void {\n switch (streamEvent.type) {\n case DbxAnalyticsStreamEventType.StartSessionRecording:\n api.start_session_recording();\n break;\n case DbxAnalyticsStreamEventType.StopSessionRecording:\n api.stop_session_recording();\n break;\n case DbxAnalyticsStreamEventType.PauseSessionRecording:\n api.pause_session_recording();\n break;\n case DbxAnalyticsStreamEventType.ResumeSessionRecording:\n api.resume_session_recording();\n break;\n default:\n // All other event types are routed to Mixpanel by Segment's device-mode destination.\n break;\n }\n }\n}\n","import { type EnvironmentProviders, Injector, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxAnalyticsMixpanelApiService, DbxAnalyticsMixpanelApiServiceConfig, PRELOAD_MIXPANEL_TOKEN } from './mixpanel.service';\n\n/**\n * Factory function that creates a {@link DbxAnalyticsMixpanelApiServiceConfig} using the Angular injector.\n *\n * Used by {@link provideDbxAnalyticsMixpanelApiService} to defer Mixpanel configuration to runtime.\n */\nexport type DbxAnalyticsMixpanelApiServiceConfigFactory = (injector: Injector) => DbxAnalyticsMixpanelApiServiceConfig;\n\n/**\n * Configuration for {@link provideDbxAnalyticsMixpanelApiService}.\n */\nexport interface ProvideDbxAnalyticsMixpanelModuleConfig {\n /**\n * Whether to preload the Mixpanel script token.\n *\n * Rarely needed — Mixpanel is typically loaded by Segment's device-mode destination.\n */\n readonly preloadMixpanelToken?: boolean;\n /**\n * Factory function that produces the Mixpanel API service configuration.\n */\n readonly dbxAnalyticsMixpanelApiServiceConfigFactory: DbxAnalyticsMixpanelApiServiceConfigFactory;\n}\n\n/**\n * Creates Angular environment providers that register {@link DbxAnalyticsMixpanelApiService} for Mixpanel session-replay control.\n *\n * Use alongside {@link provideDbxAnalyticsService} to wire Mixpanel as an analytics listener that\n * handles session-replay start/stop/pause/resume events.\n *\n * @param config - Mixpanel-specific configuration.\n * @returns Environment providers for Mixpanel analytics.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDbxAnalyticsMixpanelApiService({\n * dbxAnalyticsMixpanelApiServiceConfigFactory: () => {\n * const config = new DbxAnalyticsMixpanelApiServiceConfig();\n * config.active = environment.production;\n * return config;\n * }\n * }),\n * provideDbxAnalyticsService({\n * dbxAnalyticsServiceConfigurationFactory: (injector) => ({\n * isProduction: environment.production,\n * listeners: [\n * injector.get(DbxAnalyticsSegmentServiceListener),\n * injector.get(DbxAnalyticsMixpanelServiceListener)\n * ]\n * })\n * })\n * ]\n * };\n * ```\n *\n * @__NO_SIDE_EFFECTS__\n */\nexport function provideDbxAnalyticsMixpanelApiService(config: ProvideDbxAnalyticsMixpanelModuleConfig): EnvironmentProviders {\n const { preloadMixpanelToken, dbxAnalyticsMixpanelApiServiceConfigFactory } = config;\n\n const providers: Provider[] = [\n // configuration\n {\n provide: DbxAnalyticsMixpanelApiServiceConfig,\n useFactory: dbxAnalyticsMixpanelApiServiceConfigFactory,\n deps: [Injector]\n },\n // service\n DbxAnalyticsMixpanelApiService\n ];\n\n if (preloadMixpanelToken) {\n providers.push({\n provide: PRELOAD_MIXPANEL_TOKEN,\n useValue: preloadMixpanelToken\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { AbstractAsyncWindowLoadedService } from '@dereekb/browser';\nimport { poll } from '@dereekb/util';\n\n/**\n * Injection token for optionally preloading the Segment analytics script.\n */\nexport const PRELOAD_SEGMENT_TOKEN = new InjectionToken<string>('DbxAnalyticsSegmentApiServicePreload');\n\n/**\n * Configuration for the Segment analytics integration.\n *\n * @example\n * ```ts\n * const config = new DbxAnalyticsSegmentApiServiceConfig('your-segment-write-key');\n * config.active = environment.production;\n * config.logging = !environment.production;\n * ```\n */\nexport class DbxAnalyticsSegmentApiServiceConfig {\n writeKey: string;\n logging = true;\n active = true;\n constructor(writeKey: string) {\n this.writeKey = writeKey;\n }\n}\n\n/**\n * Extended Segment analytics type that includes the `invoked` flag set after the snippet initializes.\n */\ntype SegmentAnalyticsInvoked = SegmentAnalytics.AnalyticsJS & { invoked?: boolean };\n\n/**\n * Service that manages the async loading and initialization of the Segment analytics SDK from `window.analytics`.\n *\n * Polls for the Segment snippet to be invoked, then calls `analytics.load()` with the configured write key.\n * Once Segment reports ready, the resolved SDK instance is available via the inherited `service$` observable.\n *\n * Requires the Segment analytics snippet to be included in `index.html`.\n *\n * Provided via {@link provideDbxAnalyticsSegmentApiService}.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * provideDbxAnalyticsSegmentApiService({\n * dbxAnalyticsSegmentApiServiceConfigFactory: (injector) => {\n * const config = new DbxAnalyticsSegmentApiServiceConfig(environment.analytics.segment);\n * config.active = environment.production;\n * return config;\n * }\n * })\n * ```\n */\n@Injectable()\nexport class DbxAnalyticsSegmentApiService extends AbstractAsyncWindowLoadedService<SegmentAnalytics.AnalyticsJS> {\n private readonly _config = inject(DbxAnalyticsSegmentApiServiceConfig);\n\n static readonly SEGMENT_API_WINDOW_KEY = 'analytics';\n static readonly SEGMENT_READY_KEY = 'SegmentReady';\n\n constructor() {\n const preload = inject(PRELOAD_SEGMENT_TOKEN, { optional: true });\n super(DbxAnalyticsSegmentApiService.SEGMENT_API_WINDOW_KEY, undefined, 'Segment', preload);\n }\n\n get config(): DbxAnalyticsSegmentApiServiceConfig {\n return this._config;\n }\n\n protected override _prepareCompleteLoadingService(): Promise<void> {\n return poll({\n // poll until analytics.invoked is true.\n check: () => Boolean((window.analytics as SegmentAnalyticsInvoked).invoked),\n timesToGiveup: 100\n });\n }\n\n protected override _initService(service: SegmentAnalytics.AnalyticsJS): Promise<SegmentAnalytics.AnalyticsJS> {\n return new Promise((resolve, reject) => {\n try {\n service.load(this._config.writeKey); // Initialize Segment\n\n // Wait for the service to ready itself.\n service.ready(() => {\n // Segment changes itself or rather the target, and the previous initial target is ignored after.\n const segment: SegmentAnalytics.AnalyticsJS = window[DbxAnalyticsSegmentApiService.SEGMENT_API_WINDOW_KEY];\n resolve(segment);\n });\n } catch (e) {\n console.log('Failed to init segment: ' + e);\n reject(e);\n }\n });\n }\n}\n","import { Service, inject } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest } from 'rxjs';\nimport { AbstractDbxAnalyticsServiceListener, type DbxAnalyticsStreamEvent, DbxAnalyticsStreamEventType, type AnalyticsUser } from '../../analytics';\nimport { DbxAnalyticsSegmentApiService } from './segment.service';\n\n/**\n * Analytics listener that forwards {@link DbxAnalyticsStreamEvent} events to the Segment SDK.\n *\n * Automatically maps event types to the appropriate Segment methods:\n * - {@link DbxAnalyticsStreamEventType.Event} / {@link DbxAnalyticsStreamEventType.UserLoginEvent} -> `track()`\n * - {@link DbxAnalyticsStreamEventType.UserChange} / {@link DbxAnalyticsStreamEventType.NewUserEvent} -> `identify()`\n * - {@link DbxAnalyticsStreamEventType.UserLogoutEvent} -> `reset()`\n * - {@link DbxAnalyticsStreamEventType.PageView} -> `page()`\n *\n * Events are only sent when the Segment configuration is marked as `active`.\n * Provided at root level and registered as a listener via {@link DbxAnalyticsServiceConfiguration.listeners}.\n *\n * @example\n * ```ts\n * // Register in analytics configuration factory\n * function analyticsConfigFactory(injector: Injector): DbxAnalyticsServiceConfiguration {\n * const segmentListener = injector.get(DbxAnalyticsSegmentServiceListener);\n * return {\n * isProduction: true,\n * listeners: [segmentListener]\n * };\n * }\n * ```\n */\n@Service()\nexport class DbxAnalyticsSegmentServiceListener extends AbstractDbxAnalyticsServiceListener {\n private readonly _segmentApi = inject(DbxAnalyticsSegmentApiService);\n\n constructor() {\n super();\n\n if (this._segmentApi.config.logging) {\n console.log('SegmentAnalyticsListenerService: Segment is logging events.');\n }\n\n if (!this._segmentApi.config.active) {\n console.log('SegmentAnalyticsListenerService: Segment is disabled from sending events to the server.');\n }\n }\n\n /**\n * Subscribes to the Segment API service and analytics event stream, forwarding events to the Segment SDK.\n *\n * Events are only sent when the Segment configuration is marked as active.\n *\n * @returns Subscription to the combined Segment API and analytics event stream.\n */\n protected _initializeServiceSubscription() {\n return combineLatest([this._segmentApi.service$, this.analyticsEvents$]).subscribe(([segment, streamEvent]: [SegmentAnalytics.AnalyticsJS, DbxAnalyticsStreamEvent]) => {\n if (this._segmentApi.config.logging) {\n console.log('Segment Listener Logging Event: ', streamEvent);\n }\n\n if (this._segmentApi.config.active) {\n this.handleStreamEvent(segment, streamEvent);\n }\n });\n }\n\n /**\n * Routes an analytics stream event to the appropriate Segment API method based on event type.\n *\n * @param api - The Segment analytics SDK instance.\n * @param streamEvent - The analytics event to process.\n */\n protected handleStreamEvent(api: SegmentAnalytics.AnalyticsJS, streamEvent: DbxAnalyticsStreamEvent): void {\n switch (streamEvent.type) {\n case DbxAnalyticsStreamEventType.NewUserEvent:\n this.updateWithNewUserEvent(api, streamEvent);\n break;\n case DbxAnalyticsStreamEventType.UserLoginEvent:\n this.changeUser(api, streamEvent.user);\n this.updateWithEvent(api, streamEvent);\n break;\n case DbxAnalyticsStreamEventType.Event:\n this.updateWithEvent(api, streamEvent);\n break;\n case DbxAnalyticsStreamEventType.UserLogoutEvent:\n this.changeUser(api, undefined);\n break;\n case DbxAnalyticsStreamEventType.PageView:\n api.page();\n break;\n case DbxAnalyticsStreamEventType.UserChange:\n this.changeUser(api, streamEvent.user);\n break;\n case DbxAnalyticsStreamEventType.UserIdChange:\n case DbxAnalyticsStreamEventType.UserPropertiesEvent:\n case DbxAnalyticsStreamEventType.StartSessionRecording:\n case DbxAnalyticsStreamEventType.StopSessionRecording:\n case DbxAnalyticsStreamEventType.PauseSessionRecording:\n case DbxAnalyticsStreamEventType.ResumeSessionRecording:\n // These event types are not forwarded to Segment.\n break;\n }\n }\n\n /**\n * Handles a new user registration event by identifying the user in Segment.\n *\n * @param api - The Segment analytics SDK instance.\n * @param streamEvent - The event containing the new user data.\n */\n protected updateWithNewUserEvent(api: SegmentAnalytics.AnalyticsJS, streamEvent: DbxAnalyticsStreamEvent): void {\n this.changeUser(api, streamEvent.user);\n }\n\n /**\n * Sends a track event to Segment with the event name, value, and additional data properties.\n *\n * @param api - The Segment analytics SDK instance.\n * @param streamEvent - The analytics event containing name, value, and data.\n * @param name - Optional override for the event name.\n */\n protected updateWithEvent(api: SegmentAnalytics.AnalyticsJS, streamEvent: DbxAnalyticsStreamEvent, name?: string): void {\n const event = streamEvent.event;\n const eventName = name || event?.name;\n\n if (eventName) {\n const value = event?.value;\n const data = event?.data;\n\n api.track(\n eventName,\n {\n ...(value == null\n ? undefined\n : {\n value\n }),\n ...data\n },\n {},\n () => {\n if (this._segmentApi.config.logging) {\n console.log('Segment track success.');\n }\n }\n );\n }\n }\n\n private changeUser(api: SegmentAnalytics.AnalyticsJS, user: Maybe<AnalyticsUser>): void {\n if (user?.user) {\n api.identify(\n user.user,\n {\n ...user.properties\n },\n {},\n () => {\n if (this._segmentApi.config.logging) {\n console.log('Segment identify success.');\n }\n }\n );\n } else {\n api.reset();\n }\n }\n}\n","import { type EnvironmentProviders, Injector, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxAnalyticsSegmentApiService, DbxAnalyticsSegmentApiServiceConfig, PRELOAD_SEGMENT_TOKEN } from './segment.service';\n\n/**\n * Factory function that creates a {@link DbxAnalyticsSegmentApiServiceConfig} using the Angular injector.\n *\n * Used by {@link provideDbxAnalyticsSegmentApiService} to defer Segment configuration to runtime.\n */\nexport type DbxAnalyticsSegmentApiServiceConfigFactory = (injector: Injector) => DbxAnalyticsSegmentApiServiceConfig;\n\n/**\n * Configuration for {@link provideDbxAnalyticsSegmentApiService}.\n */\nexport interface ProvideDbxAnalyticsSegmentModuleConfig {\n /**\n * Whether to preload the Segment script token.\n */\n readonly preloadSegmentToken?: boolean;\n /**\n * Factory function that produces the Segment API service configuration.\n */\n readonly dbxAnalyticsSegmentApiServiceConfigFactory: DbxAnalyticsSegmentApiServiceConfigFactory;\n}\n\n/**\n * Creates Angular environment providers that register {@link DbxAnalyticsSegmentApiService} for Segment analytics integration.\n *\n * Use alongside {@link provideDbxAnalyticsService} to wire Segment as an analytics listener.\n *\n * @param config - Segment-specific configuration including the write key factory.\n * @returns Environment providers for Segment analytics.\n *\n * @example\n * ```ts\n * // In app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDbxAnalyticsSegmentApiService({\n * dbxAnalyticsSegmentApiServiceConfigFactory: (injector) => {\n * const config = new DbxAnalyticsSegmentApiServiceConfig(environment.analytics.segment);\n * config.active = environment.production;\n * config.logging = !environment.production;\n * return config;\n * }\n * }),\n * provideDbxAnalyticsService({\n * dbxAnalyticsServiceConfigurationFactory: (injector) => ({\n * isProduction: environment.production,\n * listeners: [injector.get(DbxAnalyticsSegmentServiceListener)]\n * })\n * })\n * ]\n * };\n * ```\n *\n * @__NO_SIDE_EFFECTS__\n */\nexport function provideDbxAnalyticsSegmentApiService(config: ProvideDbxAnalyticsSegmentModuleConfig): EnvironmentProviders {\n const { preloadSegmentToken, dbxAnalyticsSegmentApiServiceConfigFactory } = config;\n\n const providers: Provider[] = [\n // configuration\n {\n provide: DbxAnalyticsSegmentApiServiceConfig,\n useFactory: dbxAnalyticsSegmentApiServiceConfigFactory,\n deps: [Injector]\n },\n // service\n DbxAnalyticsSegmentApiService\n ];\n\n if (preloadSegmentToken) {\n providers.push({\n provide: PRELOAD_SEGMENT_TOKEN,\n useValue: preloadSegmentToken\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAGA;;;;;AAKG;IACS;AAAZ,CAAA,UAAY,2BAA2B,EAAA;AACrC;;AAEG;AACH,IAAA,2BAAA,CAAA,2BAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ;AACR;;;;AAIG;AACH,IAAA,2BAAA,CAAA,2BAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA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AAA,EAAA,CAAA,eAAA,CAAA,OAAA,EAAA,CAAA;wGAAlC,kCAAkC,EAAA,CAAA;;2FAAlC,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAD9C;;;ACND;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACG,SAAU,oCAAoC,CAAC,MAA8C,EAAA;AACjG,IAAA,MAAM,EAAE,mBAAmB,EAAE,0CAA0C,EAAE,GAAG,MAAM;AAElF,IAAA,MAAM,SAAS,GAAe;;AAE5B,QAAA;AACE,YAAA,OAAO,EAAE,mCAAmC;AAC5C,YAAA,UAAU,EAAE,0CAA0C;YACtD,IAAI,EAAE,CAAC,QAAQ;AAChB,SAAA;;QAED;KACD;IAED,IAAI,mBAAmB,EAAE;QACvB,SAAS,CAAC,IAAI,CAAC;AACb,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE;AACX,SAAA,CAAC;IACJ;AAEA,IAAA,OAAO,wBAAwB,CAAC,SAAS,CAAC;AAC5C;;AC/EA;;AAEG;;"}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-analytics",
3
- "version": "13.43.0",
3
+ "version": "14.0.1",
4
4
  "peerDependencies": {
5
- "@angular/core": "21.2.11",
6
- "@dereekb/analytics": "13.43.0",
7
- "@dereekb/browser": "13.43.0",
8
- "@dereekb/dbx-core": "13.43.0",
9
- "@dereekb/rxjs": "13.43.0",
10
- "@dereekb/util": "13.43.0",
11
- "@dereekb/vitest": "13.43.0",
5
+ "@angular/core": "22.1.4",
6
+ "@dereekb/analytics": "14.0.1",
7
+ "@dereekb/browser": "14.0.1",
8
+ "@dereekb/dbx-core": "14.0.1",
9
+ "@dereekb/rxjs": "14.0.1",
10
+ "@dereekb/util": "14.0.1",
11
+ "@dereekb/vitest": "14.0.1",
12
12
  "rxjs": "^7.8.2"
13
13
  },
14
14
  "dependencies": {
@@ -3,40 +3,11 @@ import { Injector, EnvironmentProviders, InjectionToken } from '@angular/core';
3
3
  import * as rxjs from 'rxjs';
4
4
  import { Observable, BehaviorSubject, Subscription } from 'rxjs';
5
5
  import { DbxActionContextStoreSourceInstance } from '@dereekb/dbx-core';
6
- import { AnalyticsEvent, AnalyticsEventData, AnalyticsEventName, AnalyticsUser, AnalyticsUserId, AnalyticsUserProperties, UserAnalyticsEvent, NewUserAnalyticsEventData } from '@dereekb/analytics';
6
+ import { AnalyticsUser, UserAnalyticsEvent, AnalyticsUserId, NewUserAnalyticsEventData, AnalyticsEventData, AnalyticsEventName, AnalyticsEvent } from '@dereekb/analytics';
7
7
  export { AnalyticsEvent, AnalyticsEventData, AnalyticsEventName, AnalyticsUser, AnalyticsUserId, AnalyticsUserProperties, NewUserAnalyticsEventData, NewUserRegistrationMethod, UserAnalyticsEvent } from '@dereekb/analytics';
8
8
  import { Maybe, Destroyable, ReadableError } from '@dereekb/util';
9
9
  import { AbstractAsyncWindowLoadedService } from '@dereekb/browser';
10
10
 
11
- /**
12
- * @deprecated Use {@link AnalyticsEventName} from `@dereekb/analytics` instead.
13
- */
14
- type DbxAnalyticsEventName = AnalyticsEventName;
15
- /**
16
- * @deprecated Use {@link AnalyticsUserId} from `@dereekb/analytics` instead.
17
- */
18
- type DbxAnalyticsUserId = AnalyticsUserId;
19
- /**
20
- * @deprecated Use {@link AnalyticsUserProperties} from `@dereekb/analytics` instead.
21
- */
22
- type DbxAnalyticsUserProperties = AnalyticsUserProperties;
23
- /**
24
- * @deprecated Use {@link AnalyticsUser} from `@dereekb/analytics` instead.
25
- */
26
- type DbxAnalyticsUser = AnalyticsUser;
27
- /**
28
- * @deprecated Use {@link AnalyticsEventData} from `@dereekb/analytics` instead.
29
- */
30
- type DbxAnalyticsEventData = AnalyticsEventData;
31
- /**
32
- * @deprecated Use {@link AnalyticsEvent} from `@dereekb/analytics` instead.
33
- */
34
- type DbxAnalyticsEvent = AnalyticsEvent;
35
- /**
36
- * @deprecated Use {@link UserAnalyticsEvent} from `@dereekb/analytics` instead.
37
- */
38
- type DbxUserAnalyticsEvent = UserAnalyticsEvent;
39
-
40
11
  /**
41
12
  * Categorizes the kind of analytics stream event emitted by {@link DbxAnalyticsService}.
42
13
  *
@@ -136,10 +107,6 @@ declare abstract class DbxAnalyticsEventEmitterService {
136
107
  abstract sendUserLoginEvent(user: AnalyticsUser, data?: AnalyticsEventData): void;
137
108
  abstract sendUserLogoutEvent(data?: AnalyticsEventData): void;
138
109
  abstract sendUserPropertiesEvent(user: AnalyticsUser, data?: AnalyticsEventData): void;
139
- /**
140
- * @deprecated When sending an event with no data, use {@link sendEventType} instead.
141
- */
142
- abstract sendEventData(name: AnalyticsEventName): void;
143
110
  abstract sendEventData(name: AnalyticsEventName, data: AnalyticsEventData): void;
144
111
  abstract sendEvent(event: AnalyticsEvent): void;
145
112
  abstract sendPageView(page?: string): void;
@@ -345,10 +312,6 @@ declare class DbxAnalyticsService implements DbxAnalyticsEventStreamService, Dbx
345
312
  * @param data - Optional additional event data.
346
313
  */
347
314
  sendUserPropertiesEvent(user: AnalyticsUser, data?: AnalyticsEventData): void;
348
- /**
349
- * @deprecated When sending an event with no data, use {@link sendEventType} instead.
350
- */
351
- sendEventData(name: AnalyticsEventName): void;
352
315
  /**
353
316
  * Sends a named analytics event with a data payload.
354
317
  *
@@ -506,15 +469,6 @@ declare class DbxActionAnalyticsDirective<T, O> {
506
469
  static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionAnalyticsDirective<any, any>, "[dbxActionAnalytics]", never, { "config": { "alias": "dbxActionAnalytics"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
507
470
  }
508
471
 
509
- /**
510
- * @deprecated The exported DbxActionAnalyticsDirective is now a standalone component. Import that instead.
511
- */
512
- declare class DbxAnalyticsActionModule {
513
- static ɵfac: i0.ɵɵFactoryDeclaration<DbxAnalyticsActionModule, never>;
514
- static ɵmod: i0.ɵɵNgModuleDeclaration<DbxAnalyticsActionModule, never, [typeof DbxActionAnalyticsDirective], [typeof DbxActionAnalyticsDirective]>;
515
- static ɵinj: i0.ɵɵInjectorDeclaration<DbxAnalyticsActionModule>;
516
- }
517
-
518
472
  /**
519
473
  * Factory function that creates a {@link DbxAnalyticsServiceConfiguration} using the Angular injector.
520
474
  *
@@ -886,5 +840,5 @@ interface ProvideDbxAnalyticsSegmentModuleConfig {
886
840
  */
887
841
  declare function provideDbxAnalyticsSegmentApiService(config: ProvideDbxAnalyticsSegmentModuleConfig): EnvironmentProviders;
888
842
 
889
- export { AbstractDbxAnalyticsServiceListener, DbxActionAnalyticsDirective, DbxAnalyticsActionModule, DbxAnalyticsEventEmitterService, DbxAnalyticsEventStreamService, DbxAnalyticsMixpanelApiService, DbxAnalyticsMixpanelApiServiceConfig, DbxAnalyticsMixpanelServiceListener, DbxAnalyticsSegmentApiService, DbxAnalyticsSegmentApiServiceConfig, DbxAnalyticsSegmentServiceListener, DbxAnalyticsService, DbxAnalyticsServiceConfiguration, DbxAnalyticsServiceListener, DbxAnalyticsStreamEventType, DbxAnalyticsUserSource, PRELOAD_MIXPANEL_TOKEN, PRELOAD_SEGMENT_TOKEN, dbxAnalyticsStreamEventAnalyticsEventWrapper, provideDbxAnalyticsMixpanelApiService, provideDbxAnalyticsSegmentApiService, provideDbxAnalyticsService };
890
- export type { DbxActionAnalyticsConfig, DbxAnalyticsEvent, DbxAnalyticsEventData, DbxAnalyticsEventName, DbxAnalyticsMixpanelApiServiceConfigFactory, DbxAnalyticsSegmentApiServiceConfigFactory, DbxAnalyticsServiceConfigurationFactory, DbxAnalyticsStreamEvent, DbxAnalyticsStreamEventAnalyticsEventWrapper, DbxAnalyticsUser, DbxAnalyticsUserId, DbxAnalyticsUserProperties, DbxUserAnalyticsEvent, MixpanelLike, ProvideDbxAnalyticsConfig, ProvideDbxAnalyticsMixpanelModuleConfig, ProvideDbxAnalyticsSegmentModuleConfig };
843
+ export { AbstractDbxAnalyticsServiceListener, DbxActionAnalyticsDirective, DbxAnalyticsEventEmitterService, DbxAnalyticsEventStreamService, DbxAnalyticsMixpanelApiService, DbxAnalyticsMixpanelApiServiceConfig, DbxAnalyticsMixpanelServiceListener, DbxAnalyticsSegmentApiService, DbxAnalyticsSegmentApiServiceConfig, DbxAnalyticsSegmentServiceListener, DbxAnalyticsService, DbxAnalyticsServiceConfiguration, DbxAnalyticsServiceListener, DbxAnalyticsStreamEventType, DbxAnalyticsUserSource, PRELOAD_MIXPANEL_TOKEN, PRELOAD_SEGMENT_TOKEN, dbxAnalyticsStreamEventAnalyticsEventWrapper, provideDbxAnalyticsMixpanelApiService, provideDbxAnalyticsSegmentApiService, provideDbxAnalyticsService };
844
+ export type { DbxActionAnalyticsConfig, DbxAnalyticsMixpanelApiServiceConfigFactory, DbxAnalyticsSegmentApiServiceConfigFactory, DbxAnalyticsServiceConfigurationFactory, DbxAnalyticsStreamEvent, DbxAnalyticsStreamEventAnalyticsEventWrapper, MixpanelLike, ProvideDbxAnalyticsConfig, ProvideDbxAnalyticsMixpanelModuleConfig, ProvideDbxAnalyticsSegmentModuleConfig };