@dereekb/dbx-core 11.0.20 → 11.0.21

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 +1 @@
1
- {"version":3,"file":"dereekb-dbx-core.mjs","sources":["../../../../packages/dbx-core/src/lib/subscription/subscription.directive.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.automodify.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.autotrigger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.stream.directive.ts","../../../../packages/dbx-core/src/lib/action/action.handler.ts","../../../../packages/dbx-core/src/lib/action/action.ts","../../../../packages/dbx-core/src/lib/action/action.store.ts","../../../../packages/dbx-core/src/lib/action/action.holder.ts","../../../../packages/dbx-core/src/lib/action/action.machine.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.provide.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/debug/action.logger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.key.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.working.disable.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disabled.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disableonsuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.directive.ts","../../../../packages/dbx-core/src/lib/view/if.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.presuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.working.component.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.enforce.modified.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.directive.ts","../../../../packages/dbx-core/src/lib/action/action.module.ts","../../../../packages/dbx-core/src/lib/action/action.reference.ts","../../../../packages/dbx-core/src/lib/router/segue.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/redirect.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/auth.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/role.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/state.hook.ts","../../../../packages/dbx-core/src/lib/context/context.ts","../../../../packages/dbx-core/src/lib/context/state/action/data.action.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/data.reducer.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/context/state/effect/index.ts","../../../../packages/dbx-core/src/lib/auth/auth.user.ts","../../../../packages/dbx-core/src/lib/auth/state/action/auth.action.ts","../../../../packages/dbx-core/src/lib/auth/state/action/user.action.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/user.reducer.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.directive.ts","../../../../packages/dbx-core/src/lib/router/anchor/clickable.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/id.hook.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/uid.hook.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.transition.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.directive.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.watcher.directive.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.util.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.go.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.module.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.module.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.reader.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.default.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/state/effect/auth.router.state.effect.ts","../../../../packages/dbx-core/src/lib/auth/router/state/auth.router.state.module.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.module.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.rxjs.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.any.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.has.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.not.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.module.ts","../../../../packages/dbx-core/src/lib/auth/state/effect/auth.effect.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.module.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.service.ts","../../../../packages/dbx-core/src/lib/util/view.ts","../../../../packages/dbx-core/src/lib/button/button.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.trigger.directive.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.directive.ts","../../../../packages/dbx-core/src/lib/button/router/button.segue.directive.ts","../../../../packages/dbx-core/src/lib/button/button.directive.ts","../../../../packages/dbx-core/src/lib/button/button.loading.directive.ts","../../../../packages/dbx-core/src/lib/button/button.module.ts","../../../../packages/dbx-core/src/lib/context/context.service.ts","../../../../packages/dbx-core/src/lib/context/context.directive.ts","../../../../packages/dbx-core/src/lib/context/context.module.ts","../../../../packages/dbx-core/src/lib/environment/service/environment.ts","../../../../packages/dbx-core/src/lib/environment/service/environment.service.ts","../../../../packages/dbx-core/src/lib/pipe/async/asobservable.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/async/async.pipe.module.ts","../../../../packages/dbx-core/src/lib/pipe/date/datefromtoformat.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/minutesstring.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tojsdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tominutes.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatdistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedayrange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedaytimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonly.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonlydistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/targetdatetosystemdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timezoneabbreviation.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/systemdatetotargetdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/daterangedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/date.pipe.module.ts","../../../../packages/dbx-core/src/lib/pipe/misc/prettyjson.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/misc/misc.pipe.module.ts","../../../../packages/dbx-core/src/lib/pipe/value/getvalue.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/dollar.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/value.pipe.module.ts","../../../../packages/dbx-core/src/lib/pipe/pipe.module.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.content.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connect.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.instance.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.preset.ts","../../../../packages/dbx-core/src/lib/filter/filter.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.module.ts","../../../../packages/dbx-core/src/lib/injection/injection.ts","../../../../packages/dbx-core/src/lib/injection/injection.instance.ts","../../../../packages/dbx-core/src/lib/injection/injection.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.array.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.component.module.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.forward.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.rxjs.ts","../../../../packages/dbx-core/src/lib/injection/injector.ts","../../../../packages/dbx-core/src/lib/ngrx/store.lockset.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.string.ts","../../../../packages/dbx-core/src/lib/storage/storage.di.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.factory.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.localstorage.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.memory.ts","../../../../packages/dbx-core/src/lib/storage/storage.module.ts","../../../../packages/dbx-core/src/dereekb-dbx-core.ts"],"sourcesContent":["import { OnDestroy, Directive } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { SubscriptionObject, LockSet } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Abstract component that contains a SubscriptionObject and will clean it up automatically.\n */\n@Directive()\nexport abstract class AbstractSubscriptionDirective implements OnDestroy {\n private readonly _subscriptionObject = new SubscriptionObject();\n\n ngOnDestroy(): void {\n this._subscriptionObject.destroy();\n }\n\n protected set sub(subscription: Maybe<Subscription | undefined>) {\n this._subscriptionObject.subscription = subscription;\n }\n}\n\n/**\n * AbstractSubscriptionDirective extension that prevents the OnDestroy from occuring until the lockset is unlocked.\n */\n@Directive()\nexport abstract class AbstractLockSetSubscriptionDirective extends AbstractSubscriptionDirective implements OnDestroy {\n readonly lockSet = new LockSet();\n\n override ngOnDestroy(): void {\n this.lockSet.onNextUnlock(() => this.onLockSetDestroy());\n }\n\n protected onLockSetDestroy(): void {\n super.ngOnDestroy();\n }\n}\n","import { first, switchMap, Observable, Subscription } from 'rxjs';\nimport { LockSet, filterMaybe, LoadingState, LoadingStateType } from '@dereekb/rxjs';\nimport { Destroyable, Maybe, ReadableError } from '@dereekb/util';\nimport { ActionContextState, ActionContextStore } from './action.store';\nimport { DbxActionDisabledKey, DbxActionState } from './action';\n\n/**\n * Source that provides a ActionContextStore observable.\n */\nexport abstract class ActionContextStoreSource<T = unknown, O = unknown> {\n /**\n * Observable referencing the ActionContextStore.\n *\n * This observable by design is pre-filtered to not return null values.\n */\n abstract readonly store$: Observable<ActionContextStore<T, O>>;\n}\n\n/**\n * Secondary source. Used by DbxActionContextComponent to find secondary sources.\n */\nexport abstract class SecondaryActionContextStoreSource<T = unknown, O = unknown> extends ActionContextStoreSource<T, O> {}\n\nexport function actionContextStoreSourcePipe<T, O>(obs: Observable<Maybe<ActionContextStore<T, O>>>): Observable<ActionContextStore<T, O>> {\n return obs.pipe(filterMaybe());\n}\n\nexport type PipeActionStoreFunction<R, T, O> = (store: ActionContextStore<T, O>) => Observable<R>;\n\nexport function pipeActionStore<R = unknown, T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return source.store$.pipe(switchMap(pipeFn));\n}\n\nexport type UseActionStoreFunction<T, O> = (store: ActionContextStore<T, O>) => void;\n\n/**\n * Convenience function for subscribing to the input source once and using the provided store.\n */\nexport function useActionStore<T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, useFn: UseActionStoreFunction<T, O>): Subscription {\n return source.store$.pipe(first()).subscribe(useFn);\n}\n\n/**\n * Service that wraps a ActionContextStoreSource.\n */\nexport class DbxActionContextStoreSourceInstance<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n readonly lockSet = new LockSet();\n\n private readonly _source: ActionContextStoreSource<T, O>;\n\n constructor(source: ActionContextStoreSource<T, O>) {\n if (!source) {\n throw new Error('Source is required.');\n }\n\n this._source = source;\n }\n\n get source(): ActionContextStoreSource<T, O> {\n return this._source;\n }\n\n public destroy(): void {\n this.lockSet.destroyOnNextUnlock();\n }\n\n // MARK: Store\n get store$(): Observable<ActionContextStore<T, O>> {\n return this.source.store$;\n }\n\n pipeStore<R>(pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return pipeActionStore(this.source, pipeFn);\n }\n\n useStore(useFn: UseActionStoreFunction<T, O>): Subscription {\n return useActionStore(this.source, useFn);\n }\n\n get state$(): Observable<ActionContextState<T, O>> {\n return this.pipeStore((x) => x.state$);\n }\n\n get triggered$(): Observable<boolean> {\n return this.pipeStore((x) => x.triggered$);\n }\n\n get valueReady$(): Observable<T> {\n return this.pipeStore((x) => x.valueReady$);\n }\n\n get success$(): Observable<Maybe<O>> {\n return this.pipeStore((x) => x.success$);\n }\n\n get error$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.error$);\n }\n\n get rejected$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.rejected$);\n }\n\n get isModified$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModified$);\n }\n\n get canTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.canTrigger$);\n }\n\n get isModifiedAndCanTriggerUpdates$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTriggerUpdates$);\n }\n\n get isModifiedAndCanTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTrigger$);\n }\n\n get actionState$(): Observable<DbxActionState> {\n return this.pipeStore((x) => x.actionState$);\n }\n\n get loadingState$(): Observable<LoadingState<O>> {\n return this.pipeStore((x) => x.loadingState$);\n }\n\n get loadingStateType$(): Observable<LoadingStateType> {\n return this.pipeStore((x) => x.loadingStateType$);\n }\n\n get isWorking$(): Observable<boolean> {\n return this.pipeStore((x) => x.isWorking$);\n }\n\n get isSuccess$(): Observable<boolean> {\n return this.pipeStore((x) => x.isSuccess$);\n }\n\n get disabledKeys$(): Observable<string[]> {\n return this.pipeStore((x) => x.disabledKeys$);\n }\n\n get isDisabled$(): Observable<boolean> {\n return this.pipeStore((x) => x.isDisabled$);\n }\n\n get errorCountSinceLastSuccess$(): Observable<number> {\n return this.pipeStore((x) => x.errorCountSinceLastSuccess$);\n }\n\n public enable(key?: DbxActionDisabledKey, enable = true): void {\n this.disable(key, !enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable = true): void {\n this.useStore((x) => (disable ? x.disable(key) : x.enable(key)));\n }\n\n public setIsModified(isModified?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsModified(isModified));\n }\n\n public trigger(): void {\n this.useStore((x) => x.trigger());\n }\n\n public triggerWithValue(value: T | Observable<T>): void {\n this.useStore((x) => {\n x.trigger();\n x.readyValue(value);\n });\n }\n\n public readyValue(value: T | Observable<T>): void {\n this.useStore((x) => x.readyValue(value));\n }\n\n public startWorking(): void {\n this.useStore((x) => x.startWorking());\n }\n\n public reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.useStore((x) => x.reject(error));\n }\n\n public resolve(value: O | Observable<O>): void {\n this.useStore((x) => x.resolve(value));\n }\n\n public reset(): void {\n this.useStore((x) => x.reset());\n }\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { distinctUntilChanged, filter, combineLatest, BehaviorSubject } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { Maybe } from '@dereekb/util';\n\n@Directive({\n selector: '[dbxActionAutoModify]'\n})\nexport class DbxActionAutoModifyDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _autoModifyEnabled = new BehaviorSubject<boolean>(true);\n\n @Input('dbxActionAutoModify')\n get autoModifyEnabled(): boolean {\n return this._autoModifyEnabled.value;\n }\n\n set autoModifyEnabled(autoModifyEnabled: Maybe<boolean | ''>) {\n this._autoModifyEnabled.next(autoModifyEnabled !== false);\n }\n\n ngOnInit(): void {\n const obs = combineLatest([\n this._autoModifyEnabled.pipe(distinctUntilChanged()), // Don't change unless specified otherwise.\n this.source.isModified$.pipe(filter((x) => !x)) // Only when not modified send a value.\n ]);\n\n this.sub = obs.subscribe(([autoModifyEnabled, isModified]) => {\n if (autoModifyEnabled && !isModified) {\n this.source.setIsModified(true);\n }\n });\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._autoModifyEnabled.complete();\n });\n }\n}\n","import { inject, Directive, Input, OnInit, OnDestroy } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { debounce, distinctUntilChanged, exhaustMap, filter, first, map, mergeMap, shareReplay, switchMap, throttle, EMPTY, interval, Subject, combineLatest, Observable, BehaviorSubject } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isDefinedAndNotFalse, Maybe } from '@dereekb/util';\n\nconst DEFAULT_DEBOUNCE_MS = 2 * 1000;\n\nconst DEFAULT_THROTTLE_MS = 10 * 1000;\n\nconst DEFAULT_ERROR_THROTTLE_MS = 3 * 1000;\n\nconst MAX_ERRORS_TO_THROTTLE_ON = 6;\n\n/**\n * Directive that automatically triggers the action periodically when it is in a modified state.\n *\n * When using auto triggers be sure to make sure that the action is not triggering too often due to misconfiguration.\n */\n@Directive({\n selector: 'dbxActionAutoTrigger, [dbxActionAutoTrigger]'\n})\nexport class DbxActionAutoTriggerDirective<T = unknown, O = unknown> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _triggerEnabled = new BehaviorSubject<boolean>(true);\n private readonly _triggerLimit = new BehaviorSubject<number | undefined>(undefined);\n private readonly _trigger = new Subject<number>();\n\n /**\n * How much to throttle the auto-triggering.\n */\n @Input('dbxActionAutoTrigger')\n get triggerEnabled(): boolean {\n return this._triggerEnabled.value;\n }\n\n set triggerEnabled(triggerEnabled: Maybe<boolean> | '') {\n triggerEnabled = triggerEnabled !== false; // Default to true\n\n if (this.triggerEnabled !== triggerEnabled) {\n this._triggerEnabled.next(triggerEnabled);\n }\n }\n\n @Input()\n triggerDebounce = DEFAULT_DEBOUNCE_MS;\n\n @Input()\n triggerThrottle = DEFAULT_THROTTLE_MS;\n\n @Input()\n triggerErrorThrottle = DEFAULT_ERROR_THROTTLE_MS;\n\n maxErrorsForThrottle = MAX_ERRORS_TO_THROTTLE_ON;\n\n /**\n * Optional input to override both triggerDebounce and triggerThrottle.\n *\n * Used in forms that are simple.\n */\n @Input()\n set fastTrigger(fastTrigger: Maybe<boolean> | '') {\n if (isDefinedAndNotFalse(fastTrigger)) {\n this.triggerDebounce = 200;\n this.triggerThrottle = 500;\n }\n }\n\n /**\n * Optional input to override both triggerDebounce and triggerThrottle to be 0.\n *\n * Used in forms that generally return a single value.\n */\n @Input()\n set instantTrigger(instantTrigger: Maybe<boolean> | '') {\n if (isDefinedAndNotFalse(instantTrigger)) {\n this.triggerDebounce = 10;\n this.triggerThrottle = 0;\n }\n }\n\n @Input()\n get triggerLimit(): Maybe<number> {\n return this._triggerLimit.value;\n }\n\n set triggerLimit(triggerLimit: Maybe<number>) {\n triggerLimit = triggerLimit || 0;\n this._triggerLimit.next(triggerLimit);\n }\n\n private _triggerCount = 0;\n\n readonly _errorCount$ = this.source.errorCountSinceLastSuccess$;\n\n readonly _triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(\n filter(() => this.isEnabled),\n filter((x) => x),\n debounce(() => interval(this.triggerDebounce)),\n throttle(\n () =>\n this._errorCount$.pipe(\n first(),\n exhaustMap((count) => interval(this.triggerThrottle + Math.min(count, this.maxErrorsForThrottle) * this.triggerErrorThrottle))\n ),\n { leading: true, trailing: true }\n ),\n // Check again for the \"trailing\" piece.\n filter(() => this.isEnabled),\n mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())),\n filter((x) => x),\n map(() => (this._triggerCount += 1)),\n shareReplay(1)\n );\n\n /**\n * Observable for the trigger mechanism.\n */\n readonly triggerCount$ = this._triggerEnabled.pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this._triggerCount$;\n } else {\n return EMPTY;\n }\n })\n );\n\n private readonly _isTriggerLimited$: Observable<[number, boolean]> = combineLatest([this.triggerCount$, this._triggerLimit]).pipe(\n map(([triggerCount, limit]) => [triggerCount, limit ? triggerCount > limit : false] as [number, boolean]),\n shareReplay(1)\n );\n\n readonly isTriggerLimited$ = this._isTriggerLimited$.pipe(map((x) => x[1]));\n readonly trigger$: Observable<void> = this._isTriggerLimited$.pipe(\n filter((x) => !x[1]),\n distinctUntilChanged((a, b) => a[0] === b[0]), // Only trigger when the count changes.\n map(() => undefined as void)\n );\n\n get isEnabled(): boolean {\n return this.triggerEnabled !== false;\n }\n\n ngOnInit(): void {\n this.sub = this.trigger$.subscribe(() => {\n this.source.trigger();\n });\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._triggerEnabled.complete();\n this._trigger.complete();\n this._triggerLimit.complete();\n });\n }\n}\n","import { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { switchMap, mergeMap, map, withLatestFrom, shareReplay, BehaviorSubject, Observable, of, EMPTY } from 'rxjs';\nimport { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { hasValueOrNotEmpty, Maybe, isDefinedAndNotFalse } from '@dereekb/util';\nimport { IsModifiedFunction, SubscriptionObject } from '@dereekb/rxjs';\n\n/**\n * Directive that watches a value observable for changes and sets the new value and modified states as necessary.\n */\n@Directive({\n selector: '[dbxActionValueStream]'\n})\nexport class dbxActionValueStreamDirective<T, O> implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private _valueObs = new BehaviorSubject<Observable<T>>(EMPTY);\n private _isModifiedFn = new BehaviorSubject<Maybe<IsModifiedFunction<T>>>(undefined);\n\n private _modifiedSub = new SubscriptionObject();\n private _triggerSub = new SubscriptionObject();\n\n @Input()\n set dbxActionValueStream(dbxActionValueStream: Observable<T>) {\n this._valueObs.next(dbxActionValueStream);\n }\n\n @Input()\n set dbxActionValueStreamIsNotEmpty(requireNonEmpty: unknown) {\n if (isDefinedAndNotFalse(requireNonEmpty)) {\n this.dbxActionValueStreamModified = (value) => {\n return of(hasValueOrNotEmpty(value));\n };\n }\n }\n\n @Input()\n set dbxActionValueStreamModified(dbxActionValueStreamModified: IsModifiedFunction<T>) {\n this._isModifiedFn.next(dbxActionValueStreamModified);\n }\n\n readonly modifiedValue$ = this._valueObs.pipe(\n switchMap((obs) =>\n obs.pipe(\n withLatestFrom(this._isModifiedFn),\n mergeMap(([value, dbxActionValueStreamModified]) => {\n let result: Observable<[boolean, T]>;\n\n if (dbxActionValueStreamModified) {\n result = dbxActionValueStreamModified(value).pipe(map((isModified) => [isModified, value] as [boolean, T]));\n } else {\n result = of([true, value]);\n }\n\n return result;\n }),\n shareReplay(1)\n )\n )\n );\n\n ngOnInit(): void {\n // Update Modified value.\n this._modifiedSub.subscription = this.modifiedValue$.subscribe(([isModified]) => {\n this.source.setIsModified(isModified);\n });\n\n // Set the value on triggers.\n this._triggerSub.subscription = this.source.triggered$.pipe(switchMap(() => this.modifiedValue$)).subscribe(([isModified, value]) => {\n if (isModified) {\n this.source.readyValue(value);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._valueObs.complete();\n this._isModifiedFn.complete();\n this._modifiedSub.destroy();\n this._triggerSub.destroy();\n });\n }\n}\n","import { Maybe, ReadableError } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from './action.store.source';\nimport { WorkInstanceDelegate } from '@dereekb/rxjs';\nimport { Observable } from 'rxjs';\n\n/**\n * WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.\n */\nexport class DbxActionWorkInstanceDelegate<T = unknown, O = unknown> implements WorkInstanceDelegate<O> {\n private _source: DbxActionContextStoreSourceInstance<T, O>;\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._source = source;\n }\n\n get source() {\n return this._source;\n }\n\n startWorking(): void {\n this.source.startWorking();\n }\n\n success(result: O): void {\n this.source.resolve(result);\n }\n\n reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.source.reject(error);\n }\n}\n","import { LoadingStateType } from '@dereekb/rxjs';\n\n/**\n * Used by ActionContextState to denote what state the action is in.\n */\nexport enum DbxActionState {\n /**\n * No action in progress. Waiting for the trigger.\n */\n IDLE = 'idle',\n /**\n * Idle state that can be set to show that the source is not yet ready.\n */\n DISABLED = 'disabled',\n /**\n * The action was triggered. We wait (and allow) the value to be updated.\n */\n TRIGGERED = 'triggered',\n /**\n * The trigger was accepted and the value is updated. It should begin working immediately.\n *\n * ValueReady cannot be set until triggered is set.\n */\n VALUE_READY = 'valueReady',\n /**\n * The action is in progress.\n */\n WORKING = 'working',\n /**\n * The trigger, action, or value was rejected due to an error or other issue.\n *\n * An error may be specified optionally.\n */\n REJECTED = 'rejected',\n /**\n * The action resolved without issue.\n */\n RESOLVED = 'resolved'\n}\n\n/**\n * Unique key for disabling/enabling.\n */\nexport type DbxActionDisabledKey = string;\n\nexport const DEFAULT_ACTION_DISABLED_KEY = 'dbx_action_disabled';\n\nexport function isIdleActionState(actionState: DbxActionState): boolean {\n switch (actionState) {\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n case DbxActionState.REJECTED:\n case DbxActionState.RESOLVED:\n return true;\n default:\n return false;\n }\n}\n\nexport function loadingStateTypeForActionState(actionState: DbxActionState): LoadingStateType {\n let loadingStateType: LoadingStateType;\n\n switch (actionState) {\n case DbxActionState.RESOLVED:\n loadingStateType = LoadingStateType.SUCCESS;\n break;\n case DbxActionState.REJECTED:\n loadingStateType = LoadingStateType.ERROR;\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingStateType = LoadingStateType.IDLE;\n break;\n default:\n loadingStateType = LoadingStateType.LOADING;\n break;\n }\n\n return loadingStateType;\n}\n","import { Injectable, OnDestroy } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Observable, distinctUntilChanged, filter, map, shareReplay, switchMap, startWith } from 'rxjs';\nimport { BooleanStringKeyArray, BooleanStringKeyArrayUtility, Maybe, ReadableError } from '@dereekb/util';\nimport { LoadingStateType, idleLoadingState, errorResult, filterMaybe, LoadingState, LockSet, scanCount, successResult, beginLoading } from '@dereekb/rxjs';\nimport { DbxActionDisabledKey, DbxActionState, DEFAULT_ACTION_DISABLED_KEY, isIdleActionState, loadingStateTypeForActionState } from './action';\n\nexport function isActionContextEnabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isFalse(state.disabled);\n}\n\nexport function isActionContextDisabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isTrue(state.disabled);\n}\n\nexport function isDisabledActionContextState(state: ActionContextState): boolean {\n return isIdleActionState(state.actionState) && isActionContextDisabled(state);\n}\n\nexport function isWorkingActionState(actionState: DbxActionState): boolean {\n return !isIdleActionState(actionState);\n}\n\nexport function canTriggerActionState(actionState: DbxActionState): boolean {\n return actionState !== DbxActionState.DISABLED && isIdleActionState(actionState);\n}\n\nexport function canTriggerAction(state: ActionContextState): boolean {\n return isActionContextEnabled(state) && isIdleActionState(state.actionState);\n}\n\nexport function canReadyValue(state: ActionContextState): boolean {\n return state.actionState === DbxActionState.TRIGGERED;\n}\n\nexport function actionContextIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n // console.log('check: ', state, state.isModified, canTriggerAction(state));\n return state.isModified && canTriggerAction(state);\n}\n\nexport function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n return !state.error && actionContextIsModifiedAndCanTrigger(state);\n}\n\nexport function loadingStateForActionContextState<O = unknown>(state: ActionContextState<unknown, O>): LoadingState<O> {\n let loadingState: LoadingState<O>;\n\n switch (state.actionState) {\n case DbxActionState.RESOLVED:\n loadingState = successResult(state.result);\n break;\n case DbxActionState.REJECTED:\n loadingState = errorResult(state.error);\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingState = idleLoadingState();\n break;\n default:\n loadingState = beginLoading();\n break;\n }\n\n return loadingState;\n}\n\nexport function loadingStateTypeForActionContextState(state: ActionContextState): LoadingStateType {\n return loadingStateTypeForActionState(state.actionState);\n}\n\nexport interface ActionContextState<T = unknown, O = unknown> {\n actionState: DbxActionState;\n isModified: boolean;\n /**\n * Value that is set after a triggered action. Not to be confused with result.\n */\n value?: Maybe<T>;\n /**\n * Resolved result value.\n */\n result?: Maybe<O>;\n /**\n * Rejected error, if available.\n */\n error?: Maybe<ReadableError>;\n /**\n * Current disabled state.\n */\n disabled?: BooleanStringKeyArray;\n /**\n * Number of consecutive errors that have occured.\n */\n errorCount?: number;\n}\n\nconst INITIAL_STATE: ActionContextState = {\n isModified: false,\n actionState: DbxActionState.IDLE\n};\n\n@Injectable()\nexport class ActionContextStore<T = unknown, O = unknown> extends ComponentStore<ActionContextState<T, O>> implements OnDestroy {\n readonly lockSet = new LockSet();\n\n constructor() {\n super({ ...INITIAL_STATE } as ActionContextState<T, O>);\n this.lockSet.addLock('working', this.isWorking$);\n }\n\n // MARK: Accessors\n readonly actionState$ = this.state$.pipe(\n map((x) => (isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState)),\n shareReplay(1)\n );\n\n /**\n * Returns the current disabled reasons/keys.\n */\n readonly disabledKeys$ = this.state$.pipe(\n map((x) => [...(x.disabled ?? [])]),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Maps the current state to true or not when the action state changes to/from disabled.\n */\n readonly isDisabled$ = this.state$.pipe(map(isDisabledActionContextState), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipes when idle but modified.\n */\n readonly isModified$ = this.afterDistinctBoolean((x) => x.isModified);\n\n /**\n * Pipes true when triggered.\n */\n readonly triggered$ = this.afterDistinctActionState(DbxActionState.TRIGGERED, () => true);\n\n /**\n * Pipes the readied value on ValueReady.\n */\n readonly valueReady$: Observable<T> = this.afterDistinctActionState(DbxActionState.VALUE_READY, (x) => x.value as T);\n\n /**\n * Pipes the error on the rejection state.\n */\n readonly rejected$ = this.afterDistinctActionState(DbxActionState.REJECTED, (x) => x.error);\n\n /**\n * Pipes the result when the ActionState becomes working.\n */\n readonly working$ = this.afterDistinctActionState(DbxActionState.WORKING, () => true);\n\n /**\n * Whether or not it is currently in a working state.\n */\n readonly isWorking$ = this.afterDistinctBoolean((x) => isWorkingActionState(x.actionState));\n\n /**\n * Pipes the current error.\n */\n readonly error$ = this.state$.pipe(\n map((x) => x.error),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly success$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => x.result);\n\n /**\n * Whether or not it is currently in a success state.\n */\n readonly isSuccess$ = this.afterDistinctBoolean((x) => x.actionState === DbxActionState.RESOLVED);\n\n /**\n * Returns a loading state based on the current state.\n */\n readonly loadingState$ = this.afterDistinctLoadingStateTypeChange().pipe(\n map((x) => loadingStateForActionContextState<O>(x)),\n shareReplay(1)\n );\n\n /**\n * Returns the current LoadingStateType based on the current state.\n */\n readonly loadingStateType$ = this.state$.pipe(\n map((x) => loadingStateTypeForActionContextState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Number of errors since last success.\n */\n readonly errorCountSinceLastSuccess$ = this.isSuccess$.pipe(\n startWith(false),\n distinctUntilChanged(),\n switchMap(() => this.error$.pipe(filterMaybe(), scanCount(), startWith(0))),\n shareReplay(1)\n );\n\n /**\n * Whether or not the state can be triggered.\n */\n readonly canTrigger$ = this.state$.pipe(map(canTriggerAction), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipe that maps whether or not this is modified and can be triggered.\n *\n * Updates every state update instead of when the value changes.\n */\n readonly isModifiedAndCanTriggerUpdates$ = this.state$.pipe(map((x) => actionContextIsModifiedAndCanTrigger(x), shareReplay(1)));\n\n /**\n * Whether or not it can be triggered and modified.\n */\n readonly isModifiedAndCanTrigger$ = this.isModifiedAndCanTriggerUpdates$.pipe(distinctUntilChanged());\n\n readonly hasNoErrorAndIsModifiedAndCanTrigger$ = this.state$.pipe(\n map((x) => actionContextHasNoErrorAndIsModifiedAndCanTrigger(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n /**\n * Adds a disabled reason.\n */\n readonly disable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.insert(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Removes a disabled reason.\n */\n readonly enable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.remove(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Triggers the modified state, if not disabled.\n */\n readonly setIsModified = this.updater((state, isModified: void | boolean) => ({\n ...state,\n actionState: state.actionState === DbxActionState.RESOLVED ? DbxActionState.IDLE : state.actionState, // Set to idle from success.\n isModified: (isModified as boolean) ?? true\n }));\n\n /**\n * Triggers the action if the state is currently not idle. The current state is cleared, but the error is retained (as we may need the error from the previous attempt).\n *\n * Will not fire if the action is disabled.\n */\n readonly trigger = this.updater((state) => (canTriggerAction(state) ? { isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined } : state));\n\n /**\n * Updates the value, setting value ready. The current result is cleared.\n */\n readonly readyValue = this.updater((state, value: T) => (canReadyValue(state) ? { ...state, actionState: DbxActionState.VALUE_READY, value, result: undefined } : state));\n\n /**\n * Notifys the context that the action is in progress.\n */\n readonly startWorking = this.updater((state) => ({ ...state, actionState: DbxActionState.WORKING }));\n\n /**\n * Triggers rejection of the action. The value is cleared.\n */\n readonly reject = this.updater((state, error?: Maybe<ReadableError>) => ({\n isModified: state.isModified,\n actionState: DbxActionState.REJECTED,\n error,\n errorCount: (state.errorCount ?? 0) + 1,\n disabled: state.disabled\n }));\n\n /**\n * Updates the state to success, and optionally sets a result.\n *\n * Clears modified state, and any errors.\n */\n readonly resolve = this.updater((state, result?: Maybe<O>) => ({ isModified: false, actionState: DbxActionState.RESOLVED, value: state.value, result, error: undefined, disabled: state.disabled }));\n\n /**\n * Completely resets the store.\n */\n readonly reset = this.updater(() => ({ ...INITIAL_STATE } as ActionContextState<T, O>));\n\n // MARK: Utility\n afterDistinctBoolean(fromState: (state: ActionContextState<T, O>) => boolean): Observable<boolean> {\n return this.state$.pipe(\n map((x) => fromState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n afterDistinctActionState<X>(actionState: DbxActionState, fromState: (state: ActionContextState<T, O>) => X): Observable<X> {\n return this.afterDistinctActionStateChange().pipe(\n filter((x) => x.actionState === actionState), // Only pipe when the new action state matches.\n map((x) => fromState(x)),\n shareReplay(1)\n );\n }\n\n afterDistinctActionStateChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, x.actionState] as [ActionContextState, DbxActionState]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n afterDistinctLoadingStateTypeChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, loadingStateTypeForActionContextState(x)] as [ActionContextState, LoadingStateType]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the loading state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n }, 2000);\n }\n}\n","import { Observable, of } from 'rxjs';\nimport { Destroyable, Maybe } from '@dereekb/util';\nimport { LockSet } from '@dereekb/rxjs';\nimport { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { ActionContextStore } from './action.store';\nimport { DbxActionDisabledKey } from './action';\n\n/**\n * Abstract class that can either use SecondaryActionContextStoreSource or create it's own.\n */\nexport abstract class DbxActionContextBaseSource<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n private readonly _inputSource: Maybe<SecondaryActionContextStoreSource<T, O>>;\n\n private readonly _store?: ActionContextStore<T, O>;\n private readonly _store$: Observable<ActionContextStore<T, O>>;\n private readonly _instance: DbxActionContextStoreSourceInstance<T, O>;\n\n readonly isModified$: Observable<boolean>;\n readonly triggered$: Observable<boolean>;\n readonly success$: Observable<Maybe<O>>;\n\n constructor(inputSource?: Maybe<SecondaryActionContextStoreSource<T, O>>) {\n this._inputSource = inputSource;\n\n if (inputSource) {\n this._store$ = inputSource.store$;\n } else {\n this._store = new ActionContextStore();\n this._store$ = of(this._store);\n }\n\n this._instance = new DbxActionContextStoreSourceInstance(this);\n this.isModified$ = this._instance.isModified$;\n this.triggered$ = this._instance.triggered$;\n this.success$ = this._instance.success$;\n }\n\n destroy(): void {\n if (this._store) {\n this._store.ngOnDestroy();\n this._instance.destroy();\n }\n }\n\n get inputSource() {\n return this._inputSource;\n }\n\n get lockSet(): LockSet {\n return this._instance.lockSet;\n }\n\n get sourceInstance(): DbxActionContextStoreSourceInstance<T, O> {\n return this._instance;\n }\n\n get store$(): Observable<ActionContextStore<T, O>> {\n return this._store$;\n }\n\n /**\n * Use to trigger the action directly.\n */\n public trigger(): void {\n this._instance.trigger();\n }\n\n public readyValue(value: T | Observable<T>): void {\n this._instance.readyValue(value);\n }\n\n /**\n * Triggers the context and then readies the value.\n * @param value\n */\n public triggerWithValue(value: T | Observable<T>): void {\n this._instance.triggerWithValue(value);\n }\n\n public reset(): void {\n this._instance.reset();\n }\n\n public enable(key?: DbxActionDisabledKey, enable?: boolean): void {\n this._instance.enable(key, enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable?: boolean): void {\n this._instance.disable(key, disable);\n }\n\n public setIsModified(isModified?: boolean): void {\n this._instance.setIsModified(isModified);\n }\n}\n","import { DbxActionContextSourceReference } from './action.reference';\nimport { delay, first } from 'rxjs';\nimport { ActionContextStoreSource } from './action.store.source';\nimport { DbxActionWorkInstanceDelegate } from './action.handler';\nimport { DbxActionContextBaseSource } from './action.holder';\nimport { Destroyable, Maybe } from '@dereekb/util';\nimport { SubscriptionObject, Work, workFactory } from '@dereekb/rxjs';\nimport { Injectable, OnDestroy } from '@angular/core';\n\n/**\n * DbxActionContextMachine configuration.\n */\nexport interface DbxActionContextMachineConfig<T = unknown, O = unknown> {\n /**\n * Whether or not the machine should clean itself up after being triggered once.\n */\n oneTimeUse: boolean;\n /**\n * Function to handle any valueReady events.\n *\n * If false, will not subscribe/handle valueReady$ events.\n */\n handleValueReady: Work<T, O> | false;\n /**\n * Optional function to execute after the action has succeeded.\n */\n onSuccess?: (value: Maybe<O>) => void;\n}\n\n/**\n * Configurable machine that handles components of the ActionContextStore lifecycle.\n *\n * It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.\n */\nexport class DbxActionContextMachine<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> implements DbxActionContextSourceReference<T, O>, Destroyable {\n private _isShutdown = true;\n private readonly _config: DbxActionContextMachineConfig<T, O>;\n private readonly _handleValueReadySub = new SubscriptionObject();\n private readonly _successSub = new SubscriptionObject();\n\n constructor(config: DbxActionContextMachineConfig<T, O>, source?: ActionContextStoreSource<T, O>) {\n super(source);\n this._config = config;\n\n // Handle Value Ready\n if (config.handleValueReady !== false) {\n this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {\n const doWork = workFactory({\n work: config.handleValueReady as Work<T, O>,\n delegate: new DbxActionWorkInstanceDelegate<T, O>(this.sourceInstance)\n });\n\n doWork(value);\n });\n }\n\n // If this is a one-time use, then destroy it after the first success comes through.\n if (config.oneTimeUse) {\n this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {\n this.destroy();\n });\n }\n\n if (config.onSuccess) {\n this._successSub.subscription = this.sourceInstance.success$.subscribe(config.onSuccess);\n }\n }\n\n override destroy(): void {\n super.destroy();\n this._handleValueReadySub.destroy();\n this._successSub.destroy();\n this._isShutdown = true;\n }\n\n get config() {\n return this._config;\n }\n\n get isShutdown(): boolean {\n return this._isShutdown;\n }\n}\n\n/**\n * DbxActionContextMachine that implements OnDestroy and is configured for use as a Service/Injectable.\n */\n@Injectable()\nexport class DbxActionContextMachineAsService<T = unknown, O = unknown> extends DbxActionContextMachine<T, O> implements OnDestroy {\n constructor() {\n super({\n oneTimeUse: false,\n handleValueReady: false\n });\n }\n\n ngOnDestroy(): void {\n this.destroy();\n }\n}\n","import { forwardRef, Provider, Type } from '@angular/core';\nimport { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { DbxActionContextMachineAsService } from './action.machine';\n\nexport const actionContextStoreSourceInstanceFactory = (source: ActionContextStoreSource) => {\n return new DbxActionContextStoreSourceInstance(source);\n};\n\nexport const actionContextStoreSourceMachineFactory = () => {\n return new DbxActionContextMachineAsService();\n};\n\n/**\n * Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.\n */\nexport function provideActionStoreSource<S extends ActionContextStoreSource>(sourceType: Type<S> | null): Provider[] {\n const storeSourceProvider: Provider =\n sourceType != null\n ? {\n provide: ActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n }\n : {\n provide: ActionContextStoreSource,\n useFactory: actionContextStoreSourceMachineFactory\n };\n\n return [\n storeSourceProvider,\n {\n provide: DbxActionContextStoreSourceInstance,\n useFactory: actionContextStoreSourceInstanceFactory,\n deps: [ActionContextStoreSource]\n }\n ];\n}\n\nexport function provideSecondaryActionStoreSource<S extends SecondaryActionContextStoreSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: SecondaryActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideActionStoreSource(sourceType)\n ];\n}\n","import { Directive, OnDestroy, inject } from '@angular/core';\nimport { SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideActionStoreSource } from '../../action.store.source.provide';\nimport { DbxActionContextBaseSource } from '../../action.holder';\n\n/**\n * Provides an DbxActionContext.\n */\n@Directive({\n selector: 'dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]',\n exportAs: 'action,dbxAction',\n providers: provideActionStoreSource(DbxActionDirective)\n})\nexport class DbxActionDirective<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> implements OnDestroy {\n constructor() {\n super(inject(SecondaryActionContextStoreSource<T, O>, { optional: true, host: true }));\n }\n\n ngOnDestroy(): void {\n this.lockSet.destroyOnNextUnlock(() => {\n this.destroy();\n });\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, switchMap } from 'rxjs';\nimport { SecondaryActionContextStoreSource, ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\n\n/**\n * Directive that provides a DbxActionSourceDirective that is passed in.\n */\n@Directive({\n selector: '[dbxActionSource]',\n providers: provideSecondaryActionStoreSource(DbxActionSourceDirective)\n})\nexport class DbxActionSourceDirective implements SecondaryActionContextStoreSource, OnDestroy {\n private _source = new BehaviorSubject<Maybe<ActionContextStoreSource>>(undefined);\n readonly store$ = this._source.pipe(\n filterMaybe(),\n switchMap((x) => actionContextStoreSourcePipe(x.store$))\n );\n\n ngOnDestroy(): void {\n this._source.complete();\n }\n\n @Input('dbxActionSource')\n get source(): Maybe<ActionContextStoreSource> {\n return this._source.value;\n }\n\n set source(source: Maybe<ActionContextStoreSource>) {\n if (source && !source.store$) {\n throw new Error('Invalid source passed to dbxActionSource.');\n }\n\n this._source.next(source);\n }\n}\n","import { Directive, OnInit, inject } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Prints out the current state to the console. Useful for debugging.\n */\n@Directive({\n selector: '[dbxActionLogger],[dbxActionContextLogger]'\n})\nexport class DbxActionContextLoggerDirective extends AbstractSubscriptionDirective implements OnInit {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n ngOnInit(): void {\n this.sub = this.source.state$.subscribe((state) => {\n console.log('dbxActionLogger - state: ', state);\n });\n }\n}\n","import { reduceBooleansWithOrFn } from '@dereekb/util';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, Observable, of, distinctUntilChanged, map, shareReplay, switchMap } from 'rxjs';\nimport { combineLatestFromMapValuesObsFn } from '@dereekb/rxjs';\nimport { ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { ActionContextStore } from '../../action.store';\nimport { ActionContextStoreSourceMap, ActionKey } from './action.map';\n\n/**\n * Context used for providing actions based on the action key.\n *\n * This is useful for passing action contexts around via the providers instead of explicit injection.\n */\n@Directive({\n selector: '[dbxActionContextMap]',\n exportAs: 'actionMap',\n providers: []\n})\nexport class DbxActionContextMapDirective implements ActionContextStoreSourceMap, OnDestroy {\n private readonly _map = new BehaviorSubject<Map<ActionKey, ActionContextStoreSource>>(new Map());\n readonly map$ = this._map.asObservable();\n\n readonly areAnyWorking$ = this.checkAnyAre((x) => x.isWorking$, false);\n\n get map(): Map<ActionKey, ActionContextStoreSource> {\n return this._map.value;\n }\n\n sourceForKey(key: ActionKey): ActionContextStoreSource<unknown, unknown> {\n return new DbxActionContextMapDirectiveSourceInstance(this, key);\n }\n\n addStoreSource(key: ActionKey, source: ActionContextStoreSource): void {\n if (this.map.has(key)) {\n throw new Error(`Key already existed for \"${key}\" in map. Ensure the previous store is removed before setting another.`);\n } else if (!source) {\n throw new Error('addStoreSource requires a source.');\n }\n\n this.map.set(key, source);\n this._map.next(this.map);\n }\n\n removeStore(key: ActionKey): void {\n if (!this.map.delete(key)) {\n console.warn('removeStore called and no value was found.');\n }\n\n this._map.next(this.map);\n }\n\n ngOnDestroy(): void {\n this._map.complete();\n }\n\n // MARK: Utility\n checkAnyAre(mapFn: (input: ActionContextStore) => Observable<boolean>, emptyArrayValue = false): Observable<boolean> {\n return this.reduceFromAllSources(mapFn, reduceBooleansWithOrFn(emptyArrayValue));\n }\n\n reduceFromAllSources<O, R>(mapFn: (input: ActionContextStore) => Observable<O>, reduceFn: (values: O[]) => R): Observable<R> {\n return this.fromAllSources<O>(mapFn).pipe(map(reduceFn));\n }\n\n fromAllSources<O>(mapFn: (input: ActionContextStore) => Observable<O>): Observable<O[]> {\n return this.map$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));\n }\n}\n\nexport class DbxActionContextMapDirectiveSourceInstance implements ActionContextStoreSource {\n private readonly _parent: DbxActionContextMapDirective;\n private readonly _key: ActionKey;\n\n readonly store$: Observable<ActionContextStore>;\n\n constructor(parent: DbxActionContextMapDirective, key: ActionKey) {\n this._parent = parent;\n this._key = key;\n\n const _source$ = parent.map$.pipe(\n map((x) => x.get(key)),\n distinctUntilChanged()\n );\n\n const _store$ = _source$.pipe(\n switchMap((x) => x?.store$ ?? of(undefined)),\n shareReplay(1)\n );\n\n this.store$ = actionContextStoreSourcePipe(_store$);\n }\n\n get parent() {\n return this._parent;\n }\n\n get key() {\n return this._key;\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, switchMap } from 'rxjs';\nimport { ActionKey } from './action.map';\nimport { SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\n\n/**\n * Directive that provides a ActionContextStoreSource using the input key and DbxActionContextMapDirective.\n */\n@Directive({\n selector: '[dbxActionFromMap]',\n providers: provideSecondaryActionStoreSource(DbxActionFromMapDirective)\n})\nexport class DbxActionFromMapDirective implements SecondaryActionContextStoreSource, OnDestroy {\n private readonly _map = inject(DbxActionContextMapDirective);\n private readonly _key = new BehaviorSubject<Maybe<ActionKey>>(undefined);\n\n readonly store$ = this._key.pipe(\n filterMaybe(),\n switchMap((x) => this._map.sourceForKey(x).store$)\n );\n\n ngOnDestroy(): void {\n this._key.complete();\n }\n\n @Input('dbxActionFromMap')\n get key(): Maybe<ActionKey> {\n return this._key.value;\n }\n\n set key(key: Maybe<ActionKey>) {\n this._key.next(key);\n }\n}\n","import { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { ActionContextStoreSource } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { ActionKey } from './action.map';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to the store based on the key.\n */\n@Directive({\n selector: '[dbxActionMapSource]'\n})\nexport class DbxActionMapSourceDirective implements OnDestroy {\n private readonly _map = inject(DbxActionContextMapDirective);\n readonly source = inject(ActionContextStoreSource, { host: true });\n\n private _key: Maybe<ActionKey>;\n\n ngOnDestroy(): void {\n this._removeFromToStore();\n }\n\n @Input('dbxActionMapSource')\n set key(key: ActionKey) {\n if (this._key !== key) {\n this._removeFromToStore();\n }\n\n this._key = key;\n this._addToStore();\n }\n\n private _addToStore(): void {\n if (this._key) {\n this._map.addStoreSource(this._key, this.source);\n }\n }\n\n private _removeFromToStore(): void {\n if (this._key) {\n this._map.removeStore(this._key);\n }\n }\n}\n","import { ActionContextStoreSource } from '../../action.store.source';\n\nexport type ActionKey = string;\n\n/**\n * Map that returns sources for ActionKey values.\n */\nexport abstract class ActionContextStoreSourceMap<T = unknown, O = unknown> {\n /**\n * Returns a ActionContextStoreSource for the input action key.\n *\n * @param key Action key to retrieve the source for.\n */\n abstract sourceForKey(key: ActionKey): ActionContextStoreSource<T, O>;\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { DbxActionDisabledKey } from '../../action';\n\nexport const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = 'action_map_working_disable';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to be disabled if any other element in the map is working.\n */\n@Directive({\n selector: '[dbxActionMapWorkingDisable]'\n})\nexport class DbxActionMapWorkingDisableDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n private readonly _map = inject(DbxActionContextMapDirective);\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n @Input('dbxActionMapWorkingDisable')\n disabledKey: Maybe<DbxActionDisabledKey>;\n\n ngOnInit(): void {\n this.sub = this._map.areAnyWorking$.subscribe((x) => {\n this.source.disable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, x);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this.source.enable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);\n }\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, distinctUntilChanged } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_DISABLED_DIRECTIVE_KEY = 'dbx_action_disabled';\n\n/**\n * Directive that allows disabling an action using the inputs.\n */\n@Directive({\n selector: '[dbxActionDisabled]'\n})\nexport class DbxActionDisabledDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _disabled = new BehaviorSubject<boolean>(false);\n readonly disabled$ = this._disabled.pipe(distinctUntilChanged());\n\n ngOnInit(): void {\n this.sub = this.disabled$.subscribe((x) => {\n this.source.disable(APP_ACTION_DISABLED_DIRECTIVE_KEY, x);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disabled.complete();\n this.source.enable(APP_ACTION_DISABLED_DIRECTIVE_KEY);\n }\n\n @Input('dbxActionDisabled')\n get disabled(): boolean {\n return this._disabled.value;\n }\n\n set disabled(disabled: Maybe<boolean | ''>) {\n this._disabled.next(disabled !== false);\n }\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, distinctUntilChanged, combineLatest } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY = 'dbx_action_disabled_on_success';\n\n/**\n * Directive that will disable the action after the action completes successfully.\n */\n@Directive({\n selector: '[dbxActionDisabledOnSuccess]'\n})\nexport class DbxActionDisabledOnSuccessDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _disableOnSuccess = new BehaviorSubject<boolean>(true);\n readonly disableOnSuccess$ = this._disableOnSuccess.pipe(distinctUntilChanged());\n\n ngOnInit(): void {\n this.sub = combineLatest([this.disableOnSuccess$, this.source.isSuccess$]).subscribe(([disableOnSuccess, success]) => {\n this.source.disable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY, disableOnSuccess && success);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disableOnSuccess.complete();\n this.source.enable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY);\n }\n\n @Input('dbxActionDisabledOnSuccess')\n get disabled(): boolean {\n return this._disableOnSuccess.value;\n }\n\n set disabled(disabled: Maybe<boolean | ''>) {\n this._disableOnSuccess.next(disabled !== false);\n }\n}\n","import { map, shareReplay, switchMap, tap, BehaviorSubject, combineLatest } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionWorkInstanceDelegate } from '../../action.handler';\nimport { Maybe, Destroyable, Initialized, GetterOrValue, asGetter, FactoryWithInput } from '@dereekb/util';\nimport { filterMaybe, SubscriptionObject, Work, workFactory } from '@dereekb/rxjs';\n\nexport const DBX_ACTION_HANDLER_LOCK_KEY = 'dbxActionHandler';\n\n/**\n * Context used for defining a function that performs an action using the input function to handle valueReady$ events from an action context.\n */\nexport class DbxActionHandlerInstance<T = unknown, O = unknown> implements Initialized, Destroyable {\n private readonly _delegate: DbxActionWorkInstanceDelegate<T, O>;\n\n private readonly _sub = new SubscriptionObject();\n private readonly _handlerFunction = new BehaviorSubject<Maybe<Work<T, O>>>(undefined);\n private readonly _handlerValue = new BehaviorSubject<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>(undefined);\n\n readonly handlerFunction$ = combineLatest([this._handlerValue, this._handlerFunction]).pipe(\n map(([handlerValue, handlerFunction]) => {\n let work: Maybe<Work<T, O>>;\n\n if (handlerFunction != null) {\n work = handlerFunction;\n } else if (handlerValue !== undefined) {\n const getter = asGetter(handlerValue) as FactoryWithInput<O, T>;\n\n work = (x, c) => {\n c.performTaskWithReturnValue(() => getter(x));\n };\n }\n\n return work;\n }),\n filterMaybe(),\n shareReplay(1)\n );\n\n get handlerFunction(): Maybe<Work<T, O>> {\n return this._handlerFunction.value;\n }\n\n set handlerFunction(handlerFunction: Maybe<Work<T, O>>) {\n this._handlerFunction.next(handlerFunction);\n }\n\n get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>> {\n return this._handlerValue.value;\n }\n\n set handlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>) {\n this._handlerValue.next(handlerValue);\n }\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._delegate = new DbxActionWorkInstanceDelegate<T, O>(source);\n }\n\n get source(): DbxActionContextStoreSourceInstance<T, O> {\n return this._delegate.source;\n }\n\n init(): void {\n this._sub.subscription = this.handlerFunction$\n .pipe(\n switchMap((work) =>\n this.source.valueReady$.pipe(\n tap((value) => {\n const context = workFactory({ work, delegate: this._delegate })(value);\n\n if (context) {\n // Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.\n this.source.lockSet.addLock(DBX_ACTION_HANDLER_LOCK_KEY, context.isComplete$.pipe(map((x) => !x)));\n }\n })\n )\n )\n )\n .subscribe();\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._sub.destroy();\n this._handlerFunction.complete();\n });\n }\n}\n","import { Directive, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { FactoryWithInput, GetterOrValue, Maybe } from '@dereekb/util';\nimport { DbxActionHandlerInstance } from './action.handler.instance';\nimport { Work } from '@dereekb/rxjs';\n\n/**\n * Abstract directive that wraps and handles a DbxActionHandlerInstance lifecycle.\n */\n@Directive()\nexport abstract class AbstractDbxActionHandlerDirective<T = unknown, O = unknown> implements OnInit, OnDestroy {\n readonly source: DbxActionContextStoreSourceInstance<T, O> = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n protected _dbxActionHandlerInstance = new DbxActionHandlerInstance<T, O>(this.source);\n\n ngOnInit(): void {\n this._dbxActionHandlerInstance.init();\n }\n\n ngOnDestroy(): void {\n this._dbxActionHandlerInstance.destroy();\n }\n}\n\n/**\n * Directive that wraps and controls a DbxActionHandlerInstance.\n */\n@Directive({\n selector: '[dbxActionHandler]'\n})\nexport class DbxActionHandlerDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n @Input('dbxActionHandler')\n get handlerFunction(): Maybe<Work<T, O>> {\n return this._dbxActionHandlerInstance.handlerFunction;\n }\n\n set handlerFunction(handlerFunction: Maybe<Work<T, O>>) {\n this._dbxActionHandlerInstance.handlerFunction = handlerFunction;\n }\n}\n\n/**\n * Directive that passes\n */\n@Directive({\n selector: '[dbxActionHandlerValue]'\n})\nexport class DbxActionHandlerValueDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n @Input('dbxActionHandlerValue')\n get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>> {\n return this._dbxActionHandlerInstance.handlerValue;\n }\n\n set handlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>) {\n this._dbxActionHandlerInstance.handlerValue = handlerValue;\n }\n\n override ngOnInit(): void {\n super.ngOnInit();\n\n if (this.handlerValue === undefined) {\n this.handlerValue = null; // pass a default null value\n }\n }\n}\n","import { Directive, OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { distinctUntilChanged, Observable } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../subscription';\n\n/**\n * Abstract directive class that watches a show$ observable and behaves like *ngIf.\n */\n@Directive()\nexport abstract class AbstractIfDirective extends AbstractSubscriptionDirective implements OnInit {\n private readonly _templateRef = inject(TemplateRef<unknown>);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n /**\n * Observable that is watched for showing/hiding.\n */\n abstract readonly show$: Observable<boolean>;\n\n ngOnInit() {\n this.sub = this.show$.pipe(distinctUntilChanged()).subscribe((show) => {\n if (show) {\n this._viewContainer.createEmbeddedView(this._templateRef);\n } else {\n this._viewContainer.clear();\n }\n });\n }\n}\n","import { Input, Directive, inject } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Structural directive that displays the content before the store has success.\n *\n * Can be configured to hide for a temporary period.\n */\n@Directive({\n selector: '[dbxActionPreSuccess]'\n})\nexport class DbxActionPreSuccessDirective extends AbstractIfDirective {\n @Input('dbxActionPreSuccess')\n hideFor?: Maybe<number> | '';\n\n readonly show$ = inject(DbxActionContextStoreSourceInstance).isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(false, true, this.hideFor || undefined);\n } else {\n return of(true);\n }\n }),\n shareReplay(1)\n );\n}\n","import { OnDestroy, Input, Directive, inject } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Structural directive that displays the content when the store has a success value.\n *\n * Can be configured to show for a temporary period.\n */\n@Directive({\n selector: '[dbxActionHasSuccess]'\n})\nexport class DbxActionHasSuccessDirective extends AbstractIfDirective implements OnDestroy {\n @Input('dbxActionHasSuccess')\n hideAfter?: Maybe<number> | '';\n\n readonly show$ = inject(DbxActionContextStoreSourceInstance).isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(true, false, this.hideAfter || undefined);\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { map, tap, shareReplay, switchMap, BehaviorSubject } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Performs the action on success.\n */\nexport type DbxActionSuccessHandlerFunction<O = unknown> = (value: O) => void;\n\n/**\n * Directive that executes a function on ActionContextStore Success.\n */\n@Directive({\n selector: '[dbxActionSuccessHandler]'\n})\nexport class DbxActionSuccessHandlerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _successFunction = new BehaviorSubject<Maybe<DbxActionSuccessHandlerFunction<O>>>(undefined);\n readonly successFunction$ = this._successFunction.pipe(filterMaybe(), shareReplay(1));\n\n ngOnInit(): void {\n this.sub = this.successFunction$\n .pipe(\n switchMap((successFunction) =>\n this.source.success$.pipe(\n map((x) => [successFunction, x] as [DbxActionSuccessHandlerFunction<O>, O]),\n tap(([successFn, result]) => {\n successFn(result);\n })\n )\n )\n )\n .subscribe();\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._successFunction.complete();\n }\n\n @Input('dbxActionSuccessHandler')\n get successFunction(): Maybe<DbxActionSuccessHandlerFunction<O>> {\n return this._successFunction.value;\n }\n\n set successFunction(successFunction: Maybe<DbxActionSuccessHandlerFunction<O>>) {\n this._successFunction.next(successFunction);\n }\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { getValueFromGetter, Maybe, GetterOrValue } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject, shareReplay, switchMap, tap } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Directive that provides a default value when triggered.\n *\n * No value is required, allowing the directive to automatically call readyValue.\n */\n@Directive({\n selector: '[dbxActionValue]'\n})\nexport class DbxActionValueDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _valueOrFunction = new BehaviorSubject<Maybe<GetterOrValue<T>>>(undefined);\n readonly valueOrFunction$ = this._valueOrFunction.pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.valueOrFunction$\n .pipe(\n switchMap((valueOrFunction) =>\n this.source.triggered$.pipe(\n tap(() => {\n const value: T = getValueFromGetter(valueOrFunction);\n this.source.readyValue(value);\n })\n )\n )\n )\n .subscribe();\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._valueOrFunction.complete();\n });\n }\n\n @Input('dbxActionValue')\n get valueOrFunction(): Maybe<GetterOrValue<T>> {\n return this._valueOrFunction.value;\n }\n\n set valueOrFunction(valueOrFunction: Maybe<GetterOrValue<T>>) {\n this._valueOrFunction.next(valueOrFunction);\n }\n}\n","import { OnDestroy, Input, Directive, inject } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Structural directive that displays the content when the store is working.\n *\n * Can specify a period in milliseconds that shows how long to show up after working for a particular number of seconds.\n */\n@Directive({\n selector: '[dbxActionIsWorking]'\n})\nexport class DbxActionIsWorkingDirective extends AbstractIfDirective implements OnDestroy {\n @Input('dbxActionIsWorking')\n showAfter?: Maybe<number> | '';\n\n readonly show$ = inject(DbxActionContextStoreSourceInstance).isWorking$.pipe(\n exhaustMap((isWorking) => {\n if (isWorking && this.showAfter) {\n return emitDelayObs(false, true, this.showAfter || undefined);\n } else {\n return of(isWorking);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, combineLatest, delay } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY = 'dbx_action_enforce_modified';\n\n/**\n * Directive that toggles disabling an action if the action is not marked modified.\n */\n@Directive({\n selector: '[dbxActionEnforceModified]'\n})\nexport class DbxActionEnforceModifiedDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n private readonly _enabled = new BehaviorSubject<boolean>(true);\n\n ngOnInit(): void {\n this.sub = combineLatest([this.source.isModified$, this._enabled])\n .pipe(delay(0))\n .subscribe(([modified, enableDirective]) => {\n const disable = enableDirective && !modified;\n this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._enabled.complete();\n this.source.enable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY);\n }\n\n @Input('dbxActionEnforceModified')\n get enabled(): boolean {\n return this._enabled.value;\n }\n\n set enabled(enabled: Maybe<boolean | ''>) {\n this._enabled.next(enabled !== false);\n }\n}\n","import { toReadableError, Destroyable, Initialized, Maybe, ReadableError } from '@dereekb/util';\nimport { switchMap, map, catchError, of, BehaviorSubject } from 'rxjs';\nimport { ObservableOrValue, SubscriptionObject, IsModifiedFunction, asObservable, returnIfIs, filterMaybe } from '@dereekb/rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * DbxActionValueOnTriggerInstance function. Returns an ObervableGetter that returns a value.\n */\nexport type DbxActionValueOnTriggerFunction<T> = () => ObservableOrValue<Maybe<T>>;\n\nexport interface DbxActionValueOnTriggerResult<T = unknown> {\n value?: Maybe<T>;\n reject?: Maybe<ReadableError>;\n}\n\n/**\n * DbxActionValueOnTriggerInstance configuration.\n */\nexport interface DbxActionValueOnTriggerInstanceConfig<T> {\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n readonly valueGetter?: Maybe<DbxActionValueOnTriggerFunction<T>>;\n readonly isModifiedFunction?: Maybe<IsModifiedFunction<T>>;\n}\n\n/**\n * Utility class that handles trigger events to retrieve a value.\n */\nexport class DbxActionValueOnTriggerInstance<T> implements Initialized, Destroyable {\n private _valueGetter = new BehaviorSubject<Maybe<DbxActionValueOnTriggerFunction<T>>>(undefined);\n readonly valueGetter$ = this._valueGetter.pipe(filterMaybe());\n\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n\n isModifiedFunction?: Maybe<IsModifiedFunction<T>>;\n\n private _triggeredSub = new SubscriptionObject();\n\n constructor(config: DbxActionValueOnTriggerInstanceConfig<T>) {\n this.source = config.source;\n this._valueGetter.next(config.valueGetter);\n }\n\n get valueGetter(): Maybe<DbxActionValueOnTriggerFunction<T>> {\n return this._valueGetter.value;\n }\n\n set valueGetter(valueGetter: Maybe<DbxActionValueOnTriggerFunction<T>>) {\n this._valueGetter.next(valueGetter);\n }\n\n init(): void {\n // Ready the value after the source is triggered. Do modified check one last time.\n this._triggeredSub.subscription = this.source.triggered$\n .pipe(\n switchMap(() =>\n this.valueGetter$.pipe(switchMap((valueGetter) => asObservable(valueGetter()))).pipe(\n // If the value is not null/undefined and is considered modified, then pass the value.\n switchMap((value) => returnIfIs(this.isModifiedFunction, value, false).pipe(map((value) => ({ value })))),\n // Catch unknown errors and pass them to reject.\n catchError((reject) => of({ reject: toReadableError(reject) }))\n )\n )\n )\n .subscribe((result: DbxActionValueOnTriggerResult<T>) => {\n if (result.value != null) {\n this.source.readyValue(result.value);\n } else {\n this.source.reject(result.reject);\n }\n });\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._triggeredSub.destroy();\n this._valueGetter.complete();\n });\n }\n}\n","import { Directive, ElementRef, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport { IsModifiedFunction, SubscriptionObject } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionValueOnTriggerFunction, DbxActionValueOnTriggerInstance } from './action.value.trigger.instance';\n\n/**\n * Abstract class for directives that may perform an action when trigger is called, and returns a value.\n */\n@Directive()\nexport abstract class AbstractDbxActionValueOnTriggerDirective<T> implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, unknown>);\n\n private readonly _triggerInstance: DbxActionValueOnTriggerInstance<T> = new DbxActionValueOnTriggerInstance<T>({\n source: this.source\n });\n\n private _triggeredSub = new SubscriptionObject();\n\n get valueGetter(): Maybe<DbxActionValueOnTriggerFunction<T>> {\n return this._triggerInstance.valueGetter;\n }\n\n set valueGetter(valueGetter: Maybe<DbxActionValueOnTriggerFunction<T>>) {\n this._triggerInstance.valueGetter = valueGetter;\n }\n\n get isModifiedFunction(): Maybe<IsModifiedFunction<T>> {\n return this._triggerInstance.isModifiedFunction;\n }\n\n set isModifiedFunction(isModifiedFunction: Maybe<IsModifiedFunction<T>>) {\n this._triggerInstance.isModifiedFunction = isModifiedFunction;\n }\n\n ngOnInit(): void {\n this._triggerInstance.init();\n }\n\n ngOnDestroy(): void {\n this._triggerInstance.destroy();\n this._triggeredSub.destroy();\n }\n}\n\n/**\n * Action directive that is used to trigger/display a popover, then watches that popover for a value.\n */\n@Directive({\n exportAs: 'dbxActionValueOnTrigger',\n selector: '[dbxActionValueOnTrigger]'\n})\nexport class DbxActionValueTriggerDirective<T = object> extends AbstractDbxActionValueOnTriggerDirective<T> implements OnInit, OnDestroy {\n readonly elementRef = inject(ElementRef);\n\n @Input()\n set dbxActionValueOnTrigger(dbxActionValueTrigger: Maybe<DbxActionValueOnTriggerFunction<T>>) {\n this.valueGetter = dbxActionValueTrigger;\n }\n\n @Input()\n set dbxActionValueTriggerModified(isModifiedFunction: Maybe<IsModifiedFunction>) {\n this.isModifiedFunction = isModifiedFunction;\n }\n\n constructor() {\n super();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport {\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionDisabledDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n dbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionIsWorkingDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionPreSuccessDirective,\n DbxActionHandlerValueDirective\n} from './directive';\n\nconst declarations = [\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionHandlerValueDirective,\n DbxActionDisabledDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n dbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionPreSuccessDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionIsWorkingDirective\n];\n\n@NgModule({\n imports: [CommonModule],\n declarations,\n exports: declarations\n})\nexport class DbxCoreActionModule {}\n","import { Destroyable } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from './action.store.source';\n\n/**\n * Acts as a reference to a DbxActionContextStoreSourceInstance that can be destroyed.\n *\n * This is used in cases where the action is passed around and the context it is passed to needs to clean up.\n */\nexport interface DbxActionContextSourceReference<T = unknown, O = unknown> extends Destroyable {\n readonly sourceInstance: DbxActionContextStoreSourceInstance<T, O>;\n}\n\nexport function makeDbxActionContextSourceReference<T, O>(sourceInstance: DbxActionContextStoreSourceInstance<T, O>): DbxActionContextSourceReference<T, O> {\n return {\n sourceInstance,\n destroy: () => 0\n };\n}\n","import { ArrayOrValue, hasValueOrNotEmpty, Maybe } from '@dereekb/util';\nimport { map, Observable } from 'rxjs';\n\nexport type SegueRefRouterLink = string | ArrayOrValue<object>;\n\nexport interface SegueRefRawSegueParams {\n [key: string]: unknown;\n}\n\nexport interface SegueRefOptions<O = object> {\n /**\n * Raw parameters\n */\n refParams?: SegueRefRawSegueParams;\n\n /**\n * Custom Transition Options.\n *\n * For UIRouter, this is TransitionOptions.\n */\n refOptions?: O;\n}\n\n/**\n * Represents a segue ref\n */\nexport interface SegueRef<O = object> extends SegueRefOptions<O> {\n /**\n * Ref path value.\n */\n ref: SegueRefRouterLink;\n}\n\n/**\n * A SegueRef object or a different router link representation.\n */\nexport type SegueRefOrSegueRefRouterLink<O = object> = SegueRef<O> | SegueRefRouterLink;\n\nexport function isSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): input is SegueRef<O> {\n return typeof input === 'object' && hasValueOrNotEmpty((input as SegueRef).ref);\n}\n\nexport function asSegueRef<O = object>(input: SegueRefOrSegueRefRouterLink<O>): SegueRef<O>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>> {\n const type = typeof input;\n\n if (type === 'string') {\n return refStringToSegueRef(input as string);\n } else if (isSegueRef(input)) {\n return input as SegueRef<O>;\n } else {\n return undefined;\n }\n}\n\nexport function asSegueRefString<O = object>(input: SegueRefOrSegueRefRouterLink<O> | string): string;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string>;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string> {\n if (typeof input === 'string') {\n return input;\n } else if (isSegueRef(input)) {\n return input.ref as string;\n } else {\n throw new Error(`asSegueRefString() failed to convert the input to a string: ${input}`);\n }\n}\n\nexport function refStringToSegueRef<O = object>(ref: string, options?: SegueRefOptions<O>): SegueRef<O> {\n return { ...options, ref };\n}\n\nexport function mapRefStringObsToSegueRefObs<O = object>(obs: Observable<string>, options?: SegueRefOptions<O>): Observable<SegueRef<O>> {\n return obs.pipe(map((x) => refStringToSegueRef(x, options)));\n}\n","import { Observable } from 'rxjs';\nimport { AuthRoleSet } from '@dereekb/util';\nimport { AuthUserIdentifier, AuthUserState } from '../auth.user';\n\n/**\n * Client auth service used to retrieve info about the current state of client authentication and client roles they may have.\n */\nexport abstract class DbxAuthService {\n /**\n * Whether or not the user is logged in.\n *\n * This will only emit once the authentication has been determined, preventing issues with premature decision making.\n *\n * A user is considered logged in even if there is an anonymous user. For more detailed info, consider using authUserState$.\n */\n abstract readonly isLoggedIn$: Observable<boolean>;\n\n /**\n * Whether or not the user has finished onboarding.\n *\n * This will only emit once the onboarding status has been determined, preventing issues with premature decision making.\n */\n abstract readonly isOnboarded$: Observable<boolean>;\n\n /**\n * Emits an event every time the user logs in.\n */\n abstract readonly onLogIn$: Observable<void>;\n\n /**\n * Emits an event every time the user logs out.\n */\n abstract readonly onLogOut$: Observable<void>;\n\n /**\n * Current state of the user.\n */\n abstract readonly authUserState$: Observable<AuthUserState>;\n\n /**\n * Role set for the current user.\n */\n abstract readonly authRoles$: Observable<AuthRoleSet>;\n\n /**\n * Identifier for the current user.\n */\n abstract readonly userIdentifier$: Observable<AuthUserIdentifier>;\n\n /**\n * Performs the logout action.\n */\n abstract logOut(): Promise<void>;\n}\n","import { TransitionHookFn, Transition, HookResult, StateService, UIInjector, TransitionOptions, RawParams } from '@uirouter/core';\nimport { catchError, map, first, firstValueFrom, Observable, of, switchMap } from 'rxjs';\nimport { asSegueRef, asSegueRefString, SegueRefOrSegueRefRouterLink } from './../../../../router/segue';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { FactoryWithRequiredInput, getValueFromGetter, isGetter, Maybe, Milliseconds } from '@dereekb/util';\nimport { Injector } from '@angular/core';\nimport { timeoutStartWith } from '@dereekb/rxjs';\n\n/**\n * authTransitionHookFn() configuration. The values are handled as:\n * - true: continue to the state.\n * - false: redirect to the login page.\n * - StateOrName: redirect to the target page instead.\n */\nexport type AuthTransitionDecision = true | false | SegueRefOrSegueRefRouterLink;\n\nexport interface AuthTransitionDecisionGetterInput {\n readonly transition: Transition;\n readonly injector: Injector;\n readonly authService: DbxAuthService;\n}\n\nexport type AuthTransitionRedirectTarget = Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\nexport type AuthTransitionRedirectTargetGetter = FactoryWithRequiredInput<AuthTransitionRedirectTarget, AuthTransitionDecisionGetterInput>;\nexport type AuthTransitionRedirectTargetOrGetter = Maybe<SegueRefOrSegueRefRouterLink> | AuthTransitionRedirectTargetGetter;\n\nexport interface AuthTransitionHookOptions {\n /**\n * The state to redirect the user to when their auth fails.\n */\n defaultRedirectTarget: string;\n\n /**\n * The state to redirect the user to. Defaults to defaultRedirectTarget.\n */\n errorRedirectTarget?: string;\n\n /**\n * Timeout time for the decision obs. Defaults to 1000ms.\n */\n timeoutTime?: Milliseconds;\n}\n\nexport interface AuthTransitionHookConfig extends AuthTransitionHookOptions {\n /**\n * Creates the decision observable for the transition that decides whether or not to redirect or continue.\n */\n makeDecisionsObs: (transition: Transition, authService: DbxAuthService, injector: UIInjector) => Observable<AuthTransitionDecision>;\n}\n\nexport interface AuthTransitionStateData {\n /**\n * Optional getter/decision maker when a role needs to be\n */\n redirectTo?: AuthTransitionRedirectTargetOrGetter;\n}\n\n/**\n * This generates a TransitionHookFn that can be used with redirecting routes.\n */\nexport function makeAuthTransitionHook(config: AuthTransitionHookConfig): TransitionHookFn {\n const { defaultRedirectTarget, errorRedirectTarget = defaultRedirectTarget, timeoutTime = 1000 } = config;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertIsAuthenticated: TransitionHookFn = (transition: Transition): HookResult => {\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const $state: StateService = transition.router.stateService;\n const decisionObs = config.makeDecisionsObs(transition, authService, injector);\n\n function redirectOut(): Observable<HookResult> {\n const stateData: AuthTransitionStateData = transition.targetState().state().data;\n const redirectTo = stateData?.redirectTo;\n\n let redirectToObs: Observable<HookResult>;\n\n if (redirectTo) {\n let resultObs: Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\n\n if (isGetter<AuthTransitionRedirectTarget>(redirectTo)) {\n resultObs = getValueFromGetter(redirectTo, { authService, injector, transition } as AuthTransitionDecisionGetterInput);\n } else {\n resultObs = of(redirectTo as SegueRefOrSegueRefRouterLink);\n }\n\n redirectToObs = resultObs.pipe(\n map((inputStateRef: Maybe<SegueRefOrSegueRefRouterLink>) => {\n const stateRef = asSegueRef(inputStateRef);\n\n let redirectTarget;\n let redirectParams;\n\n if (stateRef) {\n redirectTarget = stateRef.ref;\n redirectParams = stateRef.refParams;\n }\n\n if (!redirectTarget) {\n redirectTarget = defaultRedirectTarget;\n }\n\n return $state.target(redirectTarget, redirectParams);\n })\n );\n } else {\n redirectToObs = of($state.target(defaultRedirectTarget));\n }\n\n return redirectToObs;\n }\n\n const resultObs = decisionObs.pipe(\n // after the timeoutTime seconds of no transition working, redirect with a false decision\n timeoutStartWith(false as AuthTransitionDecision, timeoutTime),\n first(),\n switchMap((decision: AuthTransitionDecision): Observable<HookResult> => {\n if (typeof decision === 'boolean') {\n if (decision) {\n return of(true);\n } else {\n return redirectOut();\n }\n } else {\n const segueRef = asSegueRef(decision);\n return of($state.target(asSegueRefString(segueRef.ref), segueRef.refParams as RawParams, segueRef.refOptions as TransitionOptions));\n }\n }),\n catchError((x) => {\n console.warn(`Encountered error in auth transition hook. Attempting redirect to ${errorRedirectTarget}.`, x);\n return of($state.target(errorRedirectTarget, { location: true })); // Redirect to home\n })\n );\n\n return firstValueFrom(resultObs) as HookResult;\n };\n\n return assertIsAuthenticated;\n}\n","import { first, Observable, of, switchMap } from 'rxjs';\nimport { getValueFromGetter, isGetter, Maybe, ObjectMap } from '@dereekb/util';\nimport { AuthTransitionDecisionGetterInput, AuthTransitionRedirectTarget, AuthTransitionRedirectTargetGetter, AuthTransitionRedirectTargetOrGetter } from './hook';\nimport { SegueRefOrSegueRefRouterLink } from '../../../../router/segue';\nimport { AuthUserState } from '../../../auth.user';\n\n/**\n * Creates a AuthTransitionRedirectTargetGetter that can redirect values based on the current authUserState.\n *\n * @param stateMap\n * @returns\n */\nexport function redirectBasedOnAuthUserState(stateMap: ObjectMap<AuthTransitionRedirectTargetOrGetter>): AuthTransitionRedirectTargetGetter {\n return (input: AuthTransitionDecisionGetterInput) => {\n return input.authService.authUserState$.pipe(\n first(),\n switchMap((authUserState: AuthUserState) => {\n const getter = stateMap[authUserState];\n let result: Maybe<Observable<Maybe<SegueRefOrSegueRefRouterLink>>>;\n\n if (getter) {\n if (isGetter<AuthTransitionRedirectTarget>(getter)) {\n result = getValueFromGetter(getter, input);\n } else {\n result = of(getter);\n }\n }\n\n if (!result) {\n result = of(undefined);\n }\n\n return result;\n })\n );\n };\n}\n","import { Observable } from 'rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { TransitionService, TransitionHookFn, Transition, HookMatchCriteria } from '@uirouter/core';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { AuthTransitionDecision, AuthTransitionHookOptions, makeAuthTransitionHook } from './hook';\n\nexport interface IsLoggedInHookConfig {\n options: AuthTransitionHookOptions;\n}\n\n/**\n * UIRouter State data with configuration for the hasAuthRoleHook.\n */\nexport interface IsLoggedInStateData {\n /**\n * Whether or not the user needs to be logged in for this state.\n */\n requiredLogIn: boolean;\n}\n\n/**\n * This hook redirects to the configured default state when a user is not logged in for configured states.\n */\nexport function enableIsLoggedInHook(transitionService: TransitionService, config: IsLoggedInHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<IsLoggedInStateData>>;\n const match = Boolean(data?.requiredLogIn);\n return match;\n }\n };\n\n const assertIsLoggedIn: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n return authService.isLoggedIn$;\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertIsLoggedIn, { priority: 100 });\n}\n","import { map, Observable, OperatorFunction } from 'rxjs';\nimport { AuthRole, SetIncludesMode, ArrayOrValue, Maybe, setIncludes, asArray, AuthRoleSet } from '@dereekb/util';\nimport { TransitionService, TransitionHookFn, Transition, HookMatchCriteria } from '@uirouter/core';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { AuthTransitionDecision, AuthTransitionHookOptions, AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\nexport interface HasAuthRoleHookConfig {\n readonly options: AuthTransitionHookOptions;\n}\n\nexport interface HasAuthRoleStateRoleConfig {\n /**\n * Auth roles marked for this state\n */\n readonly authRoles: ArrayOrValue<AuthRole>;\n /**\n * How to use the above auth roles. This defaults to 'all' by default.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\nexport interface ParsedHasAuthRoleStateRoleConfig {\n /**\n * Auth roles marked for this state\n */\n readonly requiredRoles: Set<AuthRole>;\n /**\n * How to use the above auth roles. This defaults to 'all' by default.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\n/**\n * UIRouter State data with configuration for the hasAuthRoleHook.\n */\nexport interface HasAuthRoleStateData extends AuthTransitionStateData, Pick<HasAuthRoleStateRoleConfig, 'authRolesMode'> {\n /**\n * Auth roles configuration for this state.\n */\n readonly authRoles: ArrayOrValue<AuthRole | HasAuthRoleStateRoleConfig>;\n}\n\n/**\n * This hook redirects to the configured default state when a user:\n *\n * - does not have an allowed state\n * - has a disallowed state\n */\nexport function enableHasAuthRoleHook(transitionService: TransitionService, config: HasAuthRoleHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthRoleStateData>>;\n const match = Boolean(data?.authRoles);\n return match;\n }\n };\n\n const assertHasAuthRole: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthRoleStateData = targetState.state().data;\n const mapFn: OperatorFunction<AuthRoleSet, boolean> = hasAuthRoleDecisionPipe(data);\n return authService.authRoles$.pipe(mapFn);\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthRole, { priority: 100 });\n}\n\nexport function hasAuthRoleDecisionPipe(stateData: HasAuthRoleStateData): OperatorFunction<AuthRoleSet, boolean> {\n const authRolesMode: SetIncludesMode = stateData.authRolesMode || 'all';\n\n const authRoleConfigs: ParsedHasAuthRoleStateRoleConfig[] = asArray(stateData.authRoles).map((x) => {\n let config: HasAuthRoleStateRoleConfig;\n\n if (typeof x === 'string') {\n config = {\n authRoles: x,\n authRolesMode: 'any'\n };\n } else {\n config = x;\n }\n\n return {\n requiredRoles: new Set<AuthRole>(config.authRoles),\n authRolesMode: config.authRolesMode\n };\n });\n\n let mapFn: OperatorFunction<AuthRoleSet, boolean>;\n\n if (authRolesMode === 'any') {\n mapFn = map((x) => authRoleConfigs.findIndex((y) => setIncludes(x, y.requiredRoles, y.authRolesMode)) !== -1); // find the first match\n } else {\n mapFn = map((x) => authRoleConfigs.findIndex((y) => !setIncludes(x, y.requiredRoles, y.authRolesMode)) === -1); // find the first failed match\n }\n\n return mapFn;\n}\n","import { map, Observable } from 'rxjs';\nimport { AllowedSet, isAllowed, maybeSet, ArrayOrValue, Maybe } from '@dereekb/util';\nimport { TransitionService, TransitionHookFn, Transition, HookMatchCriteria } from '@uirouter/core';\nimport { AuthUserState } from '../../../auth.user';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { AuthTransitionDecision, AuthTransitionHookOptions, AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\nexport interface HasAuthStateHookConfig {\n options: AuthTransitionHookOptions;\n}\n\nexport type HasAuthStateConfig = ArrayOrValue<AuthUserState> | HasAuthStateObjectConfig;\n\nexport interface HasAuthStateObjectConfig {\n /**\n * Whether or not this state or any child state is considered \"secure\", which requires the user to be logged in.\n */\n allowedStates?: ArrayOrValue<AuthUserState>;\n\n /**\n * States that are not allowed. If the current state is this state, a rejection is returned.\n */\n disallowedStates?: ArrayOrValue<AuthUserState>;\n}\n\nexport interface HasAuthStateData extends AuthTransitionStateData {\n /**\n * Configuration for the hasAuthStateHook.\n */\n authStates: HasAuthStateConfig;\n}\n\n/**\n * This hook redirects to the configured default state when a user:\n *\n * - does not have an allowed state\n * - has a disallowed state\n */\nexport function enableHasAuthStateHook(transitionService: TransitionService, config: HasAuthStateHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthStateData>>;\n const match = Boolean(data?.authStates);\n return match;\n }\n };\n\n const assertHasAuthState: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthStateData = targetState.state().data;\n const config = toHasAuthStateObjectConfig(data.authStates);\n const allowedStates: ParsedHasAuthStateConfig = toParsedHasAuthStateConfig(config);\n\n return authService.authUserState$.pipe(map((x) => isAllowed(x, allowedStates)));\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthState, { priority: 100 });\n}\n\n// MARK: Utility\nfunction toHasAuthStateObjectConfig(input: HasAuthStateConfig): HasAuthStateObjectConfig {\n const isString = typeof input === 'string';\n\n if (Array.isArray(input) || isString) {\n if (isString) {\n input = [input as AuthUserState];\n }\n\n return {\n allowedStates: input as AuthUserState[]\n };\n } else {\n return input as HasAuthStateObjectConfig;\n }\n}\n\ntype ParsedHasAuthStateConfig = AllowedSet<AuthUserState>;\n\nfunction toParsedHasAuthStateConfig(input: HasAuthStateObjectConfig): ParsedHasAuthStateConfig {\n return {\n allowed: maybeSet(input.allowedStates),\n disallowed: maybeSet(input.disallowedStates)\n };\n}\n","/**\n * A contextual state identifier for a specific section of the app.\n *\n * Some examples are:\n * - init: The default context that is initialized.\n * - public: A public part of the app.\n * - onboarding: The onboarding section of the app.\n * - app: The main portion of the app.\n *\n * More complex apps may have more sub-sections or app portions that could each have their own context state.\n */\nexport type DbxAppContextState = string;\n\nexport const DBX_INIT_APP_CONTEXT_STATE = 'init';\n/**\n *\n */\nexport const DBX_PUBLIC_APP_CONTEXT_STATE = 'public';\n/**\n *\n */\nexport const DBX_AUTH_APP_CONTEXT_STATE = 'auth';\n/**\n *\n */\nexport const DBX_ONBOARD_APP_CONTEXT_STATE = 'onboard';\n/**\n *\n */\nexport const DBX_APP_APP_CONTEXT_STATE = 'app';\n\n/**\n * Default AppContextStates.\n *\n * Your app may not use these, but this type is available for convenience.\n */\nexport type DbxKnownAppContextState = typeof DBX_INIT_APP_CONTEXT_STATE | typeof DBX_PUBLIC_APP_CONTEXT_STATE | typeof DBX_AUTH_APP_CONTEXT_STATE | typeof DBX_ONBOARD_APP_CONTEXT_STATE | typeof DBX_APP_APP_CONTEXT_STATE;\n\n/**\n * Array of all DbxKnownAppContextState values, minus the init state.\n */\nexport const DBX_KNOWN_APP_CONTEXT_STATES: DbxKnownAppContextState[] = [DBX_PUBLIC_APP_CONTEXT_STATE, DBX_AUTH_APP_CONTEXT_STATE, DBX_ONBOARD_APP_CONTEXT_STATE, DBX_APP_APP_CONTEXT_STATE];\n","import { createAction, props } from '@ngrx/store';\nimport { DbxAppContextState } from '../../context';\n\n/**\n * Action to set the current DbxAppContextState value.\n */\nexport const setState = createAction('[App/Context] Set State', props<{ state: DbxAppContextState }>());\n\n/**\n * Resets the app back to the init context.\n */\nexport const resetState = createAction('[App/Context] Reset');\n","import { createReducer, on } from '@ngrx/store';\nimport { DbxAppContextState, DBX_INIT_APP_CONTEXT_STATE } from '../../context';\nimport { DbxAppContextActions } from '../action';\n\n/**\n * The feature key for these items/reducers.\n */\nexport const dbxAppContextStateFeatureKey = 'data';\n\n/**\n * The typings for this feature.\n */\nexport interface DbxAppContextStateData {\n state: DbxAppContextState;\n}\n\nexport const initialState: DbxAppContextStateData = {\n state: DBX_INIT_APP_CONTEXT_STATE\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * When DbxAppContextActions.dbxAppContextSetState is pushed, update the app's state to match the argument state.\n */\n on(DbxAppContextActions.setState, (_, { state }) => ({ state }))\n);\n","import { Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromDbxAppContextState from './data.reducer';\n\n/**\n * Global feature key for our app.\n */\nexport const featureKey = 'app.context';\n\n/**\n * This is a \"feature state\", which in this case is a single feature (our app state), but could include keys/states within this feature.\n */\nexport interface DbxAppContextFeatureState {\n [fromDbxAppContextState.dbxAppContextStateFeatureKey]: fromDbxAppContextState.DbxAppContextStateData;\n}\n\n/**\n * Interface typing extension for the DbxAppContextFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [featureKey]: DbxAppContextFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppContextFeatureState\n */\nexport function reducers(state: DbxAppContextFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppContextState.dbxAppContextStateFeatureKey]: fromDbxAppContextState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppContextFeatureState feature context.\n *\n * Used by createSelector() to retrieve more specific data from the DbxAppContextFeatureState.\n */\nexport const selectAppContextFeature = createFeatureSelector<DbxAppContextFeatureState>(featureKey);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppContextState = createSelector(selectAppContextFeature, (featureState: DbxAppContextFeatureState) => featureState[fromDbxAppContextState.dbxAppContextStateFeatureKey].state);\n","import { OnRunEffects, Actions, EffectNotification, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { Observable, exhaustMap, filter, takeUntil } from 'rxjs';\nimport { DbxAppContextState } from '../../context';\nimport { onDbxAppContext } from '../';\nimport { IterableOrValue, iterableToSet } from '@dereekb/util';\nimport { inject } from '@angular/core';\n\n// MARK: Abstract Context Effects\n/**\n * Abstract effects class that only runs/allows effects when the DbxAppContextState in the ngrx state matches input activeState value.\n */\nexport abstract class AbstractOnDbxAppContextStateEffects<S = unknown> implements OnRunEffects {\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<S>);\n\n /**\n * The set of state(s) to activate on.\n */\n private _activeStatesSet: Set<DbxAppContextState>;\n\n constructor(activeStates: IterableOrValue<DbxAppContextState>) {\n this._activeStatesSet = iterableToSet(activeStates);\n }\n\n /**\n * Configures all actions of the sub-class to only activate when the DbxAppContextState in App\n *\n * @param resolvedEffects$\n * @returns\n */\n ngrxOnRunEffects(resolvedEffects$: Observable<EffectNotification>): Observable<EffectNotification> {\n return this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => {\n return this._activeStatesSet.has(state);\n }),\n exhaustMap(() =>\n resolvedEffects$.pipe(\n takeUntil(\n this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => !this._activeStatesSet.has(state))\n )\n )\n )\n )\n );\n }\n}\n","import { Maybe } from '@dereekb/util';\n\n/**\n * An application user state.\n *\n * Generic states that define the current state of the user:\n * - none: the user is not logged in\n * - anon: the user is logged in as an anonymous account\n * - error: there was an error loading the correct user state\n * - new: the user has a full account but has not completed onboarding/setup\n * - user: the user has a full account and has completed setup\n */\nexport type AuthUserState = 'none' | 'anon' | 'new' | 'user' | 'error';\n\n/**\n * Arbitrary identifier used to differentiate users.\n */\nexport type AuthUserIdentifier = string;\n\nexport const NO_AUTH_USER_IDENTIFIER = '0';\n\n/**\n * AuthUserIdentifier used to indicate that the user cannot be uniquely identifier.\n */\nexport type NoAuthUserIdentifier = typeof NO_AUTH_USER_IDENTIFIER;\n\n/**\n * Creates an AuthUserIdentifier from the input. If the input is undefined, returns the NoAuthUserIdentifier.\n *\n * @param inputId\n * @returns\n */\nexport function authUserIdentifier(inputId: Maybe<AuthUserIdentifier>): AuthUserIdentifier {\n return inputId ? inputId : NO_AUTH_USER_IDENTIFIER;\n}\n","import { createAction } from '@ngrx/store';\n\n/**\n * Action for when the user has logged in.\n */\nexport const loggedIn = createAction('[App/Auth] Auth Logged In');\n\n/**\n * Action for when the user has logged out.\n */\nexport const loggedOut = createAction('[App/Auth] Auth Logged Out');\n\n/**\n * Action to log the user out.\n */\nexport const logout = createAction('[App/Auth] Auth Logout');\n","import { createAction, props } from '@ngrx/store';\nimport { AuthRole } from '@dereekb/util';\nimport { AuthUserIdentifier, AuthUserState } from '../../auth.user';\n\n/**\n * Sets the user's identifier in the auth.\n */\nexport const setUserIdentifier = createAction('[App/Auth] Set User Identifier', props<{ id: AuthUserIdentifier }>());\n\n/**\n * Sets the user's state in the auth.\n */\nexport const setUserState = createAction('[App/Auth] Set User State', props<{ state: AuthUserState }>());\n\n/**\n * Sets the user's roles in the auth.\n */\nexport const setUserRoles = createAction('[App/Auth] Set User Roles', props<{ roles: AuthRole[] }>());\n\n/**\n * Sets the user's onboarding state.\n */\nexport const setUserIsOnboarded = createAction('[App/Auth] Set User Is Onboarded', props<{ isOnboarded: boolean }>());\n","import { NO_AUTH_USER_IDENTIFIER, AuthUserIdentifier, AuthUserState } from '../../auth.user';\nimport { createReducer, on } from '@ngrx/store';\nimport { DbxAppAuthActions, DbxAppAuthUserActions } from '../action';\nimport { AuthRole } from '@dereekb/util';\n\nexport const dbxAppAuthUserFeatureKey = 'user';\n\nexport interface DbxAppAuthStateUser {\n userId: AuthUserIdentifier;\n isOnboarded: boolean;\n userState: AuthUserState;\n userRoles: AuthRole[];\n}\n\nexport const initialState: DbxAppAuthStateUser = {\n userId: NO_AUTH_USER_IDENTIFIER,\n isOnboarded: false,\n userState: 'none',\n userRoles: []\n};\n\nexport const reducer = createReducer(\n initialState,\n on(DbxAppAuthActions.loggedOut, () => ({ ...initialState })),\n on(DbxAppAuthUserActions.setUserIdentifier, (state, { id: userId }) => ({ ...state, userId })),\n on(DbxAppAuthUserActions.setUserIsOnboarded, (state, { isOnboarded }) => ({ ...state, isOnboarded })),\n on(DbxAppAuthUserActions.setUserState, (state, { state: userState }) => ({ ...state, userState })),\n on(DbxAppAuthUserActions.setUserRoles, (state, { roles: userRoles }) => ({ ...state, userRoles: Array.from(userRoles) }))\n);\n","import { Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromDbxAppAuthUserState from './user.reducer';\n\n/**\n * Global feature key\n */\nexport const featureKey = 'app.auth';\n\nexport interface DbxAppAuthFeatureState {\n [fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]: fromDbxAppAuthUserState.DbxAppAuthStateUser;\n}\n\n/**\n * Interface typing extension for the DbxAppAuthFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [featureKey]: DbxAppAuthFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppAuthFeatureState\n */\nexport function reducers(state: DbxAppAuthFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]: fromDbxAppAuthUserState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppAuthFeatureState feature context.\n */\nexport const selectAppAuthFeature = createFeatureSelector<DbxAppAuthFeatureState>(featureKey);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppAuthUser = createSelector(selectAppAuthFeature, (featureState: DbxAppAuthFeatureState) => featureState[fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]);\n","import { MousableFunction } from './mousable';\nimport { ClickableFunction, ClickableUrl } from './clickable';\nimport { SegueRef } from '../segue';\nimport { expandFlattenTreeFunction, expandTreeFunction, ExpandTreeFunction, FlattenTreeFunction, flattenTreeToArrayFunction, Maybe, TreeNode } from '@dereekb/util';\nimport { Type, Provider, forwardRef } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { DbxInjectionComponentConfig } from '../../injection/injection';\n\nexport interface ClickableAnchor extends ClickableFunction, MousableFunction, ClickableUrl, Partial<SegueRef> {\n disabled?: boolean;\n selected?: boolean;\n}\n\n/**\n * Title and an optional icon.\n */\nexport interface IconAndTitle {\n title: string;\n icon?: Maybe<string>;\n}\n\nexport interface ClickableAnchorLink extends ClickableAnchor, IconAndTitle {\n /**\n * Optional detail string/content.\n */\n hint?: string;\n /**\n * Custom injection content for this link.\n */\n content?: DbxInjectionComponentConfig;\n}\n\n/**\n * ClickableAnchorLink that definitely has a SegueRef\n */\nexport type ClickableAnchorLinkSegueRef = ClickableAnchorLink & SegueRef;\n\nexport interface ClickableIconAnchorLink extends Omit<ClickableAnchorLink, 'title'> {\n icon: string;\n}\n\nexport interface ClickableAnchorLinkTree extends ClickableAnchorLink {\n children?: ClickableAnchorLinkTree[];\n}\n\nexport type ExpandedClickableAnchorLinkTree = TreeNode<ClickableAnchorLinkTree>;\n\nexport const expandClickableAnchorLinkTreeNode: ExpandTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = expandTreeFunction({\n getChildren: (x) => x.children\n});\n\nexport const flattenExpandedClickableAnchorLinkTree: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = flattenTreeToArrayFunction();\nexport const flattenExpandedClickableAnchorLinkTreeToLinks: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ClickableAnchorLinkTree> = flattenTreeToArrayFunction((x) => x.value);\n\n/**\n * Fully expands the given parent link and flattens the tree to a single parent link.\n *\n * @param link\n * @returns\n */\nexport function expandClickableAnchorLinkTree(link: ClickableAnchorLinkTree): ExpandedClickableAnchorLinkTree[] {\n return flattenExpandedClickableAnchorLinkTree(expandClickableAnchorLinkTreeNode(link));\n}\n\n/**\n * Expands an array of links into an array of ExpandedClickableAnchorLinkTree tree values.\n */\nexport const expandClickableAnchorLinkTrees = expandFlattenTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree>(expandClickableAnchorLinkTreeNode, flattenExpandedClickableAnchorLinkTree);\n\nexport enum AnchorType {\n /**\n * When the anchor has no specific content but is not disabled.\n *\n * Is a passthrough for the content.\n */\n PLAIN = 0,\n CLICKABLE = 1,\n SREF = 2,\n HREF = 3,\n DISABLED = 4\n}\n\nexport function anchorTypeForAnchor(anchor: Maybe<ClickableAnchor>, disabled?: Maybe<boolean>): AnchorType {\n let type: AnchorType = AnchorType.DISABLED;\n\n if (!disabled && anchor) {\n if (anchor.disabled) {\n type = AnchorType.DISABLED;\n } else if (anchor.ref) {\n type = AnchorType.SREF;\n } else if (anchor.onClick) {\n type = AnchorType.CLICKABLE;\n } else if (anchor.url) {\n type = AnchorType.HREF;\n } else {\n type = AnchorType.PLAIN;\n }\n }\n\n return type;\n}\n\nexport abstract class DbxAnchor<T extends ClickableAnchor = ClickableAnchor> {\n abstract disabled$: Observable<Maybe<boolean>>;\n abstract selected$: Observable<Maybe<boolean>>;\n abstract anchor$: Observable<Maybe<T>>;\n abstract disabled: Maybe<boolean>;\n abstract selected: Maybe<boolean>;\n abstract anchor: Maybe<T>;\n abstract type$: Observable<AnchorType>;\n}\n\nexport function provideDbxAnchor<S extends DbxAnchor>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxAnchor,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { skipFirstMaybe } from '@dereekb/rxjs';\nimport { map, shareReplay, distinctUntilChanged, BehaviorSubject, combineLatest, Observable, delay } from 'rxjs';\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AnchorType, ClickableAnchor, anchorTypeForAnchor, DbxAnchor } from './anchor';\nimport { SegueRefOrSegueRefRouterLink, asSegueRef } from '../segue';\n\n/**\n * Abstract anchor directive.\n */\n@Directive()\nexport class AbstractDbxAnchorDirective<T extends ClickableAnchor = ClickableAnchor> implements DbxAnchor, OnDestroy {\n private _selected = new BehaviorSubject<Maybe<boolean>>(false);\n private _disabled = new BehaviorSubject<Maybe<boolean>>(false);\n private _anchor = new BehaviorSubject<Maybe<T>>(undefined);\n\n readonly disabled$ = this._disabled.pipe(distinctUntilChanged());\n readonly anchor$ = this._anchor.pipe(skipFirstMaybe(), distinctUntilChanged(), shareReplay(1));\n readonly selected$ = combineLatest([this._selected, this.anchor$]).pipe(\n map(([selected, anchor]) => selected || anchor?.selected),\n distinctUntilChanged()\n );\n\n readonly type$: Observable<AnchorType> = combineLatest([this.disabled$, this.anchor$]).pipe(\n delay(0),\n map(([disabled, anchor]) => anchorTypeForAnchor(anchor, disabled)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n ngOnDestroy(): void {\n this._selected.complete();\n this._disabled.complete();\n this._anchor.complete();\n }\n\n /**\n * Convenience input to create an Anchor from the input SegueRef.\n */\n @Input()\n public set ref(ref: Maybe<SegueRefOrSegueRefRouterLink>) {\n this.anchor = asSegueRef(ref) as T;\n }\n\n @Input()\n public get anchor(): Maybe<T> {\n return this._anchor.value;\n }\n\n public set anchor(anchor: Maybe<T>) {\n this._anchor.next(anchor);\n }\n\n @Input()\n public get disabled(): Maybe<boolean> {\n return this._disabled.value;\n }\n\n public set disabled(disabled: Maybe<boolean>) {\n this._disabled.next(disabled);\n }\n\n @Input()\n public get selected(): Maybe<boolean> {\n return this._selected.value;\n }\n\n public set selected(selected: Maybe<boolean>) {\n this._selected.next(selected);\n }\n}\n","import { E164PhoneNumberWithOptionalExtension, MailToUrlInput, mailToUrlString, Maybe, PhoneNumber, telUrlString, WebsiteUrl } from '@dereekb/util';\n\nexport interface ClickableFunction {\n onClick?: (event?: Maybe<MouseEvent>) => void;\n}\n\n/**\n * Represents a clickable href/url configuration.\n */\nexport interface ClickableUrl {\n /**\n * href url\n */\n url?: string;\n /**\n * href target attribute.\n */\n target?: string;\n}\n\nexport function clickableUrlInNewTab(url: string | WebsiteUrl): ClickableUrl {\n return {\n url,\n target: '_blank'\n };\n}\n\nexport function clickableUrlMailTo(mailTo: MailToUrlInput): ClickableUrl {\n return {\n url: mailToUrlString(mailTo)\n };\n}\n\nexport function clickableUrlTel(tel: PhoneNumber | E164PhoneNumberWithOptionalExtension): ClickableUrl {\n return {\n url: telUrlString(tel)\n };\n}\n","import { DbxAuthService } from '../../../auth/service/auth.service';\nimport { TransitionService, TransitionHookFn, Transition, HookResult, StateService, HookMatchCriteria } from '@uirouter/core';\nimport { Maybe, ModelKey } from '@dereekb/util';\nimport { map, first, switchMap, firstValueFrom, Observable, of } from 'rxjs';\nimport { Injector } from '@angular/core';\n\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE = '0';\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY = 'id';\n\nexport interface RedirectForIdentifierParamHookInput {\n /**\n * Factory that returns an observable that sends the default allowed identifier to use when accessing the resource.\n */\n readonly defaultAllowedValue: (authService: DbxAuthService, injector: Injector, transition: Transition) => Observable<ModelKey>;\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly idParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target id.\n *\n * Can return another identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewModelWithId: (targetId: ModelKey, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | ModelKey>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * This hook asserts the user is allowed to view a route with an identifier as a state parameter.\n */\nexport function redirectForIdentifierParamHook(input: RedirectForIdentifierParamHookInput): void {\n const { defaultAllowedValue, idParam = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE, priority = 100, transitionService, canViewModelWithId: canViewUser } = input;\n const criteria: HookMatchCriteria = typeof input.criteria === 'string' ? { entering: input.criteria } : input.criteria;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertAllowedId: TransitionHookFn = (transition: Transition): HookResult => {\n const $state: StateService = transition.router.stateService;\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const params = transition.params();\n\n const transitionTargetId: Maybe<string> = params[idParam];\n const defaultAllowedValueObs$ = defaultAllowedValue(authService, injector, transition);\n\n return firstValueFrom(\n defaultAllowedValueObs$.pipe(\n first(),\n switchMap((defaultAllowedIdValue) => {\n let result: Observable<HookResult> = of(true);\n\n let redirectToId: Maybe<Observable<Maybe<ModelKey>>>;\n\n if (!transitionTargetId || transitionTargetId === defaultParamValue) {\n // If the param isn't set, default to the default value\n redirectToId = of(defaultAllowedIdValue);\n } else if (defaultAllowedIdValue !== transitionTargetId) {\n redirectToId = canViewUser(transitionTargetId, authService, injector).pipe(\n map((x) => {\n if (x == null || typeof x === 'boolean') {\n return x ? transitionTargetId : defaultAllowedIdValue;\n } else {\n return x;\n }\n })\n );\n }\n\n if (redirectToId != null) {\n result = redirectToId.pipe(\n first(),\n map((targetId) => {\n if (targetId !== transitionTargetId) {\n const target = transition.targetState();\n const state = target.state();\n return $state.target(state, { ...params, [idParam]: targetId }, { location: true });\n } else {\n return true;\n }\n })\n );\n }\n\n return result;\n })\n )\n ) as HookResult;\n };\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(criteria, assertAllowedId, { priority });\n}\n","import { AuthUserIdentifier } from '../../../auth/auth.user';\nimport { DbxAuthService } from '../../../auth/service/auth.service';\nimport { TransitionService, HookMatchCriteria } from '@uirouter/core';\nimport { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\nimport { Injector } from '@angular/core';\nimport { redirectForIdentifierParamHook } from './id.hook';\n\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE = '0';\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY = 'uid';\n\nexport interface RedirectForUserIdentifierParamHookInput {\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly uidParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target user.\n *\n * Can return another users identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewUser: (targetUid: AuthUserIdentifier, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | AuthUserIdentifier>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * This hook asserts the user is allowed to view a route with a user identifier as a parameter.\n */\nexport function redirectForUserIdentifierParamHook(input: RedirectForUserIdentifierParamHookInput): void {\n const { uidParam = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE, criteria, priority = 100, transitionService, canViewUser } = input;\n\n return redirectForIdentifierParamHook({\n defaultAllowedValue: (authService: DbxAuthService) => authService.userIdentifier$,\n idParam: uidParam,\n defaultParamValue,\n criteria,\n transitionService,\n canViewModelWithId: canViewUser,\n priority\n });\n}\n","export enum DbxRouterTransitionEventType {\n /**\n * A transition started.\n */\n START = 'start',\n /**\n * A transition ended.\n */\n SUCCESS = 'success'\n}\n\nexport interface DbxRouterTransitionEvent {\n type: DbxRouterTransitionEventType;\n}\n","import { map, Observable, combineLatest, firstValueFrom } from 'rxjs';\nimport { asObservable, filterMaybe, ObservableOrValue } from '@dereekb/rxjs';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { asSegueRef, SegueRef, SegueRefOrSegueRefRouterLink, SegueRefRawSegueParams } from '../../../segue';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { ActivatedRoute, NavigationBehaviorOptions, NavigationEnd, NavigationExtras, NavigationStart, Router, UrlTree } from '@angular/router';\nimport { Injectable, inject } from '@angular/core';\nimport { isArray } from 'class-validator';\nimport { KeyValueTypleValueFilter, Maybe, mergeObjects } from '@dereekb/util';\n\n/**\n * AngularRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxAngularRouterService implements DbxRouterService, DbxRouterTransitionService {\n readonly router = inject(Router);\n readonly activatedRoute = inject(ActivatedRoute);\n\n readonly params$: Observable<SegueRefRawSegueParams> = this.activatedRoute.params;\n\n readonly transitions$ = this.router.events.pipe(\n map((x) => {\n let event: Maybe<DbxRouterTransitionEvent>;\n\n if (x instanceof NavigationStart) {\n event = {\n type: DbxRouterTransitionEventType.START\n };\n } else if (x instanceof NavigationEnd) {\n event = {\n type: DbxRouterTransitionEventType.SUCCESS\n };\n }\n\n return event;\n }),\n filterMaybe()\n );\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const ref = segueRef.ref;\n\n if (isArray(ref)) {\n return this.router.navigate(ref as unknown[], {\n ...segueRef.refOptions,\n queryParams: segueRef.refParams\n });\n } else {\n return this.router.navigateByUrl(ref as string | UrlTree, {\n ...segueRef.refOptions\n });\n }\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>> = combineLatest([this.activatedRoute.params, asObservable(inputParams)]).pipe(\n map(([currentParams, params]) => {\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n const segueRef: SegueRef<NavigationExtras | NavigationBehaviorOptions> = {\n ref: this.activatedRoute.pathFromRoot,\n refParams,\n refOptions: {\n replaceUrl: true\n }\n };\n\n return segueRef;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number {\n return 0; // TODO!\n }\n}\n","import { Observable } from 'rxjs';\nimport { DbxRouterTransitionEvent } from '../transition/transition';\n\n/**\n * Router service definition that provides high level information about router transitions.\n */\nexport abstract class DbxRouterTransitionService {\n /**\n * Observable that emits DbxRouterTransitionEvent values as transitions occur.\n */\n abstract readonly transitions$: Observable<DbxRouterTransitionEvent>;\n}\n","import { ObservableOrValue } from '@dereekb/rxjs';\nimport { Observable } from 'rxjs';\nimport { SegueRefOrSegueRefRouterLink, SegueRefRawSegueParams } from '../../segue';\nimport { DbxRouterTransitionService } from './router.transition.service';\n\n/**\n * Router service definition that can route the app and provide routing details.\n */\nexport abstract class DbxRouterService extends DbxRouterTransitionService {\n /**\n * Params of the current successfully loaded route.\n */\n abstract readonly params$: Observable<SegueRefRawSegueParams>;\n\n /**\n * Navigates to the target SegueRef.\n *\n * @param segueRef\n */\n abstract go(segueRef: ObservableOrValue<SegueRefOrSegueRefRouterLink>): Promise<boolean>;\n\n /**\n * Navigates to the current url with updated parameters. Will be merged with the existing parameters.\n *\n * The new state will replace the current state in the history.\n *\n * @param segueRef\n */\n abstract updateParams(params: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean>;\n\n /**\n * Returns true if the input segue ref is considered active.\n *\n * @param segueRef\n */\n abstract isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Returns true if the input segue ref is considered active exactly.\n *\n * @param segueRef\n */\n abstract isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Compares the two refs for precision for a certain route.\n *\n * For example, if the parent route is input with a child route, the child route is\n * considered more precise.\n *\n * @param a\n * @param b\n */\n abstract comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number;\n}\n","import { distinctUntilKeysChange } from '@dereekb/rxjs';\nimport { ArrayOrValue, asArray, filterMaybeValues, IndexRef } from '@dereekb/util';\nimport { filter, map, MonoTypeOperatorFunction, Observable, distinctUntilChanged, shareReplay, startWith } from 'rxjs';\nimport { SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { DbxRouterService } from '../service/router.service';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from './transition';\n\n/**\n * Convenience function for filtering success from the input observable.\n *\n * @param obs\n * @returns\n */\nexport function successTransition(obs: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return obs.pipe(filterTransitionSuccess());\n}\n\nexport function filterTransitionSuccess(): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);\n}\n\nexport function filterTransitionEvent(type: DbxRouterTransitionEventType): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filter((x) => x.type === type);\n}\n// MARK: LatestSuccessfulRoutesConfig\nexport interface LatestSuccessfulRoutesConfigRoute {\n /**\n * Route to check if it is active or not.\n */\n readonly route: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n */\n readonly activeExactly?: boolean;\n}\n\ninterface LatestSuccessfulRoutesConfigRouteItem<T> extends IndexRef {\n readonly r: T;\n}\n\n/**\n * latestSuccessfulRoute() config\n */\nexport interface LatestSuccessfulRoutesConfig<T extends LatestSuccessfulRoutesConfigRoute> {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<T>;\n}\n\n/**\n * Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.\n *\n * @param obs\n * @param config\n * @returns\n */\nexport function latestSuccessfulRoutes<T extends LatestSuccessfulRoutesConfigRoute>(config: LatestSuccessfulRoutesConfig<T>): Observable<T[]> {\n const { dbxRouterTransitionService, dbxRouterService, routes: inputRoutes } = config;\n const routes: LatestSuccessfulRoutesConfigRouteItem<T>[] = asArray(inputRoutes).map((r, i) => ({ r, i }));\n const checkRoutes: (() => LatestSuccessfulRoutesConfigRouteItem<T> | undefined)[] = routes.map((routeConfig) => {\n const { r: route } = routeConfig;\n return route.activeExactly ? () => (dbxRouterService.isActiveExactly(route.route) ? routeConfig : undefined) : () => (dbxRouterService.isActive(route.route) ? routeConfig : undefined);\n });\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const activeRoutes: LatestSuccessfulRoutesConfigRouteItem<T>[] = filterMaybeValues(checkRoutes.map((x) => x()));\n return activeRoutes;\n }),\n distinctUntilKeysChange((x) => x.i),\n map((x) => x.map((y) => y.r)),\n shareReplay(1)\n );\n}\n\n// MARK: IsLatestSuccessfulRouteConfig\n/**\n * isLatestSuccessfulRoute() config\n */\nexport interface IsLatestSuccessfulRouteConfig {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<SegueRefOrSegueRefRouterLink>;\n /**\n * Whether or not to match route activity exactly.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.\n *\n * @param obs\n * @param config\n * @returns\n */\nexport function isLatestSuccessfulRoute(config: IsLatestSuccessfulRouteConfig): Observable<boolean> {\n const { dbxRouterTransitionService, dbxRouterService, activeExactly } = config;\n const routes = asArray(config.routes);\n const checkRoute: (route: SegueRefOrSegueRefRouterLink) => boolean = activeExactly ? (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActiveExactly(route) : (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActive(route);\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const isActive = routes.findIndex(checkRoute) !== -1;\n return isActive;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n}\n","import { Observable, startWith } from 'rxjs';\nimport { Directive, inject } from '@angular/core';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { successTransition } from './transition.rxjs';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionDirective {\n protected readonly dbxRouterTransitionService = inject(DbxRouterTransitionService);\n\n readonly transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);\n readonly initAndUpdateOnTransitionSuccess$: Observable<void> = this.transitionSuccess$.pipe(startWith(undefined)) as Observable<void>;\n}\n","import { Directive, NgZone, OnDestroy, OnInit, inject } from '@angular/core';\nimport { SubscriptionObject } from '@dereekb/rxjs';\nimport { AbstractTransitionDirective } from './transition.directive';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionWatcherDirective extends AbstractTransitionDirective implements OnInit, OnDestroy {\n private _transitionSub = new SubscriptionObject();\n\n protected readonly ngZone = inject(NgZone);\n\n ngOnInit(): void {\n this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {\n this.updateForSuccessfulTransition();\n });\n }\n\n ngOnDestroy(): void {\n this._transitionSub.destroy();\n }\n\n // MARK: Action\n protected zoneUpdateForSuccessfulTransition(): void {\n this.ngZone.run(() => this.updateForSuccessfulTransition());\n }\n\n protected abstract updateForSuccessfulTransition(): void;\n}\n","import { Building } from '@dereekb/util';\nimport { SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { DbxRouterService } from './router.service';\n\n/**\n * Function that returns true when the configured segueRef is active.\n */\nexport type IsSegueRefActiveFunction = (() => boolean) & {\n readonly _segueRef: SegueRefOrSegueRefRouterLink;\n readonly _activeExactly: boolean;\n};\n\nexport interface IsSegueRefActiveFunctionConfig {\n readonly dbxRouterService: DbxRouterService;\n readonly segueRef: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n *\n * False by default.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates an IsSegueRefActiveFunction\n *\n * @param config\n * @returns\n */\nexport function isSegueRefActiveFunction(config: IsSegueRefActiveFunctionConfig): IsSegueRefActiveFunction {\n const { dbxRouterService, segueRef, activeExactly = false } = config;\n const result = (activeExactly ? () => dbxRouterService.isActiveExactly(segueRef) : () => dbxRouterService.isActive(segueRef)) as Building<IsSegueRefActiveFunction>;\n\n result._segueRef = segueRef;\n result._activeExactly = activeExactly;\n\n return result as IsSegueRefActiveFunction;\n}\n","import { Maybe } from '@dereekb/util';\nimport { filter, map, Observable, of, OperatorFunction, switchMap, startWith } from 'rxjs';\nimport { SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../transition';\nimport { isSegueRefActiveFunction, IsSegueRefActiveFunctionConfig } from './router.service.util';\n\n// MARK: Transition Events\nexport function onRouterTransitionEventType(events$: Observable<DbxRouterTransitionEvent>, type: DbxRouterTransitionEventType): Observable<DbxRouterTransitionEvent> {\n return events$.pipe(filter((x) => x.type === type));\n}\n\nexport function onRouterTransitionSuccessEvent(events$: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return onRouterTransitionEventType(events$, DbxRouterTransitionEventType.SUCCESS);\n}\n\n// MARK: Router Service\n/**\n * Creates an observable that returns true when the route for the input segueRef is active.\n *\n * @param dbxRouterService\n * @param segueRef\n */\nexport function isSegueRefActiveOnTransitionSuccess(config: IsSegueRefActiveFunctionConfig): Observable<boolean> {\n const isActiveFn = isSegueRefActiveFunction(config);\n return onRouterTransitionSuccessEvent(config.dbxRouterService.transitions$).pipe(\n startWith(undefined),\n map(() => isActiveFn())\n );\n}\n\nexport interface IsSegueRefActiveConfig extends Pick<IsSegueRefActiveFunctionConfig, 'dbxRouterService' | 'activeExactly'> {\n /**\n * What to pipe if the input segueRef is null.\n */\n readonly defaultIfNull?: boolean;\n}\n\n/**\n * Operator function that maps the input segueRef to a boolean depending on the current route state.\n *\n * @param dbxRouterService\n * @param segueRef\n */\nexport function isSegueRefActive(config: IsSegueRefActiveConfig): OperatorFunction<Maybe<SegueRefOrSegueRefRouterLink>, boolean> {\n const { defaultIfNull = false } = config;\n\n return switchMap((segueRef) => {\n if (segueRef) {\n return isSegueRefActiveOnTransitionSuccess({ ...config, segueRef });\n } else {\n return of(defaultIfNull);\n }\n });\n}\n","import { ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { firstValueFrom } from 'rxjs';\nimport { SegueRef, SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { DbxRouterService } from './router.service';\n\n/**\n * Function that will perform navigation with the input route.\n */\nexport type GoWithRouter = (route: ObservableOrValue<SegueRef>) => Promise<boolean>;\n\n/**\n * Creates a GoWithRouter function.\n *\n * @param dbxRouterService\n * @returns\n */\nexport function goWithRouter(dbxRouterService: DbxRouterService): (route: ObservableOrValue<SegueRefOrSegueRefRouterLink>) => Promise<boolean> {\n return (route) => {\n return firstValueFrom(asObservable(route)).then((x) => dbxRouterService.go(x));\n };\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { DbxAngularRouterService } from './angular.router.service';\n\n@NgModule({})\nexport class DbxCoreAngularRouterSegueModule {\n static forRoot(): ModuleWithProviders<DbxCoreAngularRouterSegueModule> {\n return {\n ngModule: DbxCoreAngularRouterSegueModule,\n providers: [\n DbxAngularRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxAngularRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxAngularRouterService\n }\n ]\n };\n }\n}\n","import { KeyValueTypleValueFilter, mergeObjects } from '@dereekb/util';\nimport { Subject, BehaviorSubject, Observable, firstValueFrom, map } from 'rxjs';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { asSegueRef, asSegueRefString, SegueRef, SegueRefOrSegueRefRouterLink, SegueRefRawSegueParams } from '../../../segue';\nimport { StateService, UIRouterGlobals, TransitionOptions, TransitionService } from '@uirouter/core';\nimport { Injectable, OnDestroy, inject } from '@angular/core';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { ObservableOrValue, asObservable } from '@dereekb/rxjs';\n\n/**\n * UIRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxUIRouterService implements DbxRouterService, DbxRouterTransitionService, OnDestroy {\n readonly state = inject(StateService);\n readonly transitionService = inject(TransitionService);\n readonly uiRouterGlobals = inject(UIRouterGlobals);\n\n private readonly _params = new BehaviorSubject<SegueRefRawSegueParams>(this.uiRouterGlobals.params);\n readonly params$ = this._params.asObservable();\n\n private readonly _transitions = new Subject<DbxRouterTransitionEvent>();\n readonly transitions$ = this._transitions.asObservable();\n\n constructor() {\n const emitTransition = (type: DbxRouterTransitionEventType) => {\n this._transitions.next({\n type\n });\n\n this._params.next(this.uiRouterGlobals.params);\n };\n\n this.transitionService.onStart({}, () => {\n emitTransition(DbxRouterTransitionEventType.START);\n });\n\n this.transitionService.onSuccess({}, () => {\n emitTransition(DbxRouterTransitionEventType.SUCCESS);\n });\n }\n\n ngOnDestroy(): void {\n this._transitions.complete();\n }\n\n get params() {\n return this.uiRouterGlobals.params;\n }\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<TransitionOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const params = { ...this.uiRouterGlobals.current.params, ...segueRef.refParams };\n return this.state\n .go(segueRef.ref as string, params, segueRef.refOptions)\n .then(() => true)\n .catch(() => false);\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<TransitionOptions>> = asObservable(inputParams).pipe(\n map((params) => {\n const currentParams = this.uiRouterGlobals.params;\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n\n const ref: SegueRef<TransitionOptions> = {\n ref: '.',\n refParams,\n refOptions: {\n location: 'replace',\n inherit: true\n }\n };\n\n return ref;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, false);\n }\n\n isActiveExactly(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, true);\n }\n\n comparePrecision(aInput: SegueRefOrSegueRefRouterLink, bInput: SegueRefOrSegueRefRouterLink): number {\n const aRef = asSegueRefString(aInput);\n const bRef = asSegueRefString(bInput);\n\n const aLength = aRef.length;\n const bLength = bRef.length;\n return aLength > bLength ? 1 : aLength === bLength ? 0 : -1;\n }\n\n // MARK: Internal\n isActiveState(input: SegueRefOrSegueRefRouterLink, exactly: boolean): boolean {\n const segueRef = asSegueRef(input);\n const ref = segueRef.ref as string;\n const refParams = segueRef.refParams;\n\n const targetRef = ref.startsWith('.') ? `^${ref}` : ref;\n const active = exactly ? this.state.is(targetRef, refParams) : this.state.includes(targetRef, refParams);\n return active;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxUIRouterService } from './uirouter.router.service';\n\n@NgModule({})\nexport class DbxCoreUIRouterSegueModule {\n static forRoot(): ModuleWithProviders<DbxCoreUIRouterSegueModule> {\n return {\n ngModule: DbxCoreUIRouterSegueModule,\n providers: [\n DbxUIRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxUIRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxUIRouterService\n }\n ]\n };\n }\n}\n","import { ObservableOrValueGetter, MaybeObservableOrValueGetter, switchMapToDefault, maybeValueFromObservableOrValueGetter, asObservableFromGetter } from '@dereekb/rxjs';\nimport { Destroyable, Maybe } from '@dereekb/util';\nimport { BehaviorSubject, combineLatest, distinctUntilChanged, first, map, Observable, shareReplay } from 'rxjs';\nimport { DbxRouterService } from '../service/router.service';\n\n/**\n * Interface used for reading a single value from the DbxRouterService. Supports a default value.\n */\nexport interface DbxRouteParamReader<T> {\n /**\n * The param value as read from the current router state.\n */\n readonly paramValue$: Observable<Maybe<T>>;\n /**\n * The default value observable.\n */\n readonly defaultValue$: Observable<Maybe<T>>;\n /**\n * The final computed value\n */\n readonly value$: Observable<Maybe<T>>;\n\n /**\n * Returns the current param key.\n */\n getParamKey(): string;\n\n /**\n * Sets a new param key. If the value is undefined, the param reader will use the default key.\n */\n setParamKey(paramKey: Maybe<string>): void;\n\n /**\n * Sets the default value source.\n *\n * @param defaultValue\n */\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<T>): void;\n\n /**\n * Updates the value on the current route for the paramKey.\n *\n * @param value\n */\n setParamValue(value: MaybeObservableOrValueGetter<T>): void;\n}\n\nexport interface DbxRouteParamReaderInstance<T> extends DbxRouteParamReader<T>, Destroyable {\n readonly dbxRouterService: DbxRouterService;\n readonly paramKey$: Observable<string>;\n readonly nextDefaultValue$: Observable<Maybe<T>>;\n readonly value$: Observable<Maybe<T>>;\n}\n\n/**\n * Creates a new DbxRouteParamReaderInstance from the input.\n *\n * @param dbxRouterService\n * @param defaultParamKey\n * @param defaultValue\n * @returns\n */\nexport function dbxRouteParamReaderInstance<T>(dbxRouterService: DbxRouterService, defaultParamKey: string, defaultValue?: MaybeObservableOrValueGetter<T>) {\n const _paramKey = new BehaviorSubject<string>(defaultParamKey);\n const _defaultValue = new BehaviorSubject<Maybe<ObservableOrValueGetter<Maybe<T>>>>(defaultValue);\n\n const paramKey$ = _paramKey.asObservable();\n\n const paramValue$ = combineLatest([paramKey$, dbxRouterService.params$]).pipe(\n map(([key, params]) => (params[key] as Maybe<T>) ?? undefined),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n const nextDefaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const defaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const value$ = paramValue$.pipe(switchMapToDefault(defaultValue$), shareReplay(1));\n\n const result: DbxRouteParamReaderInstance<T> = {\n dbxRouterService,\n\n paramKey$,\n paramValue$,\n nextDefaultValue$,\n defaultValue$,\n value$,\n\n destroy() {\n _paramKey.complete();\n _defaultValue.complete();\n },\n\n getParamKey(): string {\n return _paramKey.value;\n },\n\n setParamKey(paramKey: Maybe<string>) {\n _paramKey.next(paramKey || defaultParamKey);\n },\n\n setDefaultValue(newValue: MaybeObservableOrValueGetter<T>) {\n _defaultValue.next(newValue ?? defaultValue);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<T>) {\n combineLatest([paramKey$, asObservableFromGetter(value)])\n .pipe(first())\n .subscribe(([paramKey, value]) => dbxRouterService.updateParams({ [paramKey]: value }));\n }\n };\n\n return result;\n}\n","import { BehaviorSubject, EMPTY, switchMap, of } from 'rxjs';\nimport { DbxRouteParamReaderInstance } from './route.reader';\nimport { Destroyable, Initialized, Maybe, DefaultForwardFunctionFactory, defaultForwardFunctionFactory } from '@dereekb/util';\nimport { SubscriptionObject, switchMapToDefault, SwitchMapToDefaultFilterFunction, filterMaybe } from '@dereekb/rxjs';\n\nconst DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY = defaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<unknown>>((value) => of(value == null));\n\n/**\n * Utility class used in conjuction with a DbxRouteParamReaderInstance to redirect when the default param is not valid.\n */\nexport class DbxRouteParamDefaultRedirectInstance<T> implements Initialized, Destroyable {\n private readonly instance: DbxRouteParamReaderInstance<T>;\n\n private readonly _enabled = new BehaviorSubject<boolean>(true);\n private readonly _useDefaultFilter = new BehaviorSubject<Maybe<SwitchMapToDefaultFilterFunction<T>>>(undefined);\n private readonly _sub = new SubscriptionObject();\n\n constructor(instance: DbxRouteParamReaderInstance<T>) {\n this.instance = instance;\n }\n\n init(): void {\n this._sub.subscription = this._enabled\n .pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this.instance.paramValue$.pipe(\n switchMapToDefault(this.instance.defaultValue$, (value) => {\n return this._useDefaultFilter.pipe(switchMap((fn) => (DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY as DefaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<T>>)(fn)(value)));\n }),\n filterMaybe(), // do not redirect on MaybeNot values\n switchMap((defaultValue) => {\n return this.redirectWithDefaultValue(defaultValue);\n })\n );\n } else {\n return EMPTY;\n }\n })\n )\n .subscribe();\n }\n\n destroy(): void {\n this._enabled.complete();\n this._useDefaultFilter.complete();\n this._sub.destroy();\n }\n\n protected redirectWithDefaultValue(value: Maybe<T>): Promise<boolean> {\n if (value != null) {\n // perform a segue once\n return this.redirectWithValue(value);\n } else {\n // do nothing\n return Promise.resolve(false);\n }\n }\n\n protected redirectWithValue(value: Maybe<T>): Promise<boolean> {\n return this.instance.dbxRouterService.updateParams({\n [this.instance.getParamKey()]: value\n });\n }\n\n get enabled(): boolean {\n return this._enabled.value;\n }\n\n set enabled(enabled: boolean) {\n this._enabled.next(enabled);\n }\n\n setUseDefaultFilter(useValueFilter: Maybe<SwitchMapToDefaultFilterFunction<T>>): void {\n this._useDefaultFilter.next(useValueFilter);\n }\n}\n","import { SegueRefOrSegueRefRouterLink } from '../../router/segue';\n\n/**\n * Auth routes configurations for an app.\n */\nexport abstract class DbxAppAuthRoutes {\n abstract readonly loginRef: SegueRefOrSegueRefRouterLink;\n abstract readonly loggedOutRef?: SegueRefOrSegueRefRouterLink;\n abstract readonly onboardRef?: SegueRefOrSegueRefRouterLink;\n abstract readonly appRef: SegueRefOrSegueRefRouterLink;\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { Injectable, OnDestroy, inject } from '@angular/core';\nimport { goWithRouter } from '../../router';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Helper service for navigating to important auth-related routes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthRouterService implements OnDestroy {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxAppAuthRoutes = inject(DbxAppAuthRoutes);\n\n private _isAuthRouterEffectsEnabled = new BehaviorSubject<boolean>(true);\n readonly isAuthRouterEffectsEnabled$ = this._isAuthRouterEffectsEnabled.asObservable();\n\n ngOnDestroy(): void {\n this._isAuthRouterEffectsEnabled.complete();\n }\n\n get hasOnboardingState(): boolean {\n return Boolean(this.dbxAppAuthRoutes.onboardRef);\n }\n\n // MARK: Effects\n /**\n * Whether or not DbxAppAuthRouterEffects are enabled.\n */\n get isAuthRouterEffectsEnabled(): boolean {\n return this._isAuthRouterEffectsEnabled.value;\n }\n\n set isAuthRouterEffectsEnabled(enabled: boolean) {\n this._isAuthRouterEffectsEnabled.next(enabled);\n }\n\n // MARK: Navigate\n /**\n * Navigates to the login state.\n *\n * @returns\n */\n goToLogin() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the logged out state, if it exists, otherwise navigates to the login state.\n *\n * @returns\n */\n goToLoggedOut() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loggedOutRef ?? this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the onboarding state if it is available, otherwise navigates to the app.\n *\n * @returns\n */\n goToOnboarding(): Promise<boolean> {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.onboardRef ?? this.dbxAppAuthRoutes.appRef);\n }\n\n /**\n * Navigates to the app state.\n *\n * @returns\n */\n goToApp() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.appRef);\n }\n}\n","import { exhaustMap, filter } from 'rxjs';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\nimport { ArrayOrValue, Maybe } from '@dereekb/util';\nimport { createEffect, ofType } from '@ngrx/effects';\nimport { DbxAppContextState, DBX_KNOWN_APP_CONTEXT_STATES } from '../../../../context/context';\nimport { AbstractOnDbxAppContextStateEffects } from '../../../../context/state/effect';\nimport { fromDbxAppAuth, onDbxAppAuth } from '../../../state';\nimport { DbxAppAuthRouterService } from '../../auth.router.service';\n\n/**\n * Used by DbxAppAuthRouterEffects to configure the states that should be activve by default.\n */\nexport const DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN = new InjectionToken('DbxAppAuthRouterEffectsActiveStates');\n\n/**\n * Set of ngrx effects that handle navigation in the app when the auth changes in certain ways.\n *\n * Is configurable via the DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN to choose which states this effect is active or not. By default is equal to DBX_KNOWN_APP_CONTEXT_STATES.\n */\n@Injectable()\nexport class DbxAppAuthRouterEffects extends AbstractOnDbxAppContextStateEffects<fromDbxAppAuth.State> {\n readonly dbxAppAuthRouterService = inject(DbxAppAuthRouterService);\n\n constructor() {\n super(inject<Maybe<ArrayOrValue<DbxAppContextState>>>(DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, { optional: true }) ?? DBX_KNOWN_APP_CONTEXT_STATES);\n }\n\n /**\n * Effect to redirect to the login when logout occurs.\n */\n readonly redirectToLoginOnLogout = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedOut),\n filter(() => this.dbxAppAuthRouterService.isAuthRouterEffectsEnabled),\n exhaustMap(() => this.dbxAppAuthRouterService.goToLogin())\n ),\n { dispatch: false }\n );\n\n /**\n * Effect to redirect to the app when login occurs.\n */\n readonly redirectToOnboardOnLogIn = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedIn),\n filter(() => this.dbxAppAuthRouterService.isAuthRouterEffectsEnabled),\n exhaustMap(() => this.dbxAppAuthRouterService.goToApp())\n ),\n { dispatch: false }\n );\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ArrayOrValue } from '@dereekb/util';\nimport { EffectsModule } from '@ngrx/effects';\nimport { DbxAppContextState } from '../../../context';\nimport { DbxAppAuthRouterEffects, DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN } from './effect/auth.router.state.effect';\n\nexport interface DbxAppAuthRouterStateModuleConfig {\n readonly activeRoutesToApplyEffects: ArrayOrValue<DbxAppContextState>;\n}\n\n@NgModule({\n imports: [EffectsModule.forFeature([DbxAppAuthRouterEffects])],\n declarations: [],\n exports: []\n})\nexport class DbxAppAuthRouterStateModule {\n static forRoot(config: DbxAppAuthRouterStateModuleConfig): ModuleWithProviders<DbxAppAuthRouterStateModule> {\n return {\n ngModule: DbxAppAuthRouterStateModule,\n providers: [\n {\n provide: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN,\n useValue: config.activeRoutesToApplyEffects\n }\n ]\n };\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n@NgModule({\n imports: [],\n declarations: [],\n exports: []\n})\nexport class DbxAppAuthRouterModule {\n static forRoot(dbxAppAuthRoutes: DbxAppAuthRoutes): ModuleWithProviders<DbxAppAuthRouterModule> {\n return {\n ngModule: DbxAppAuthRouterModule,\n providers: [\n {\n provide: DbxAppAuthRoutes,\n useValue: dbxAppAuthRoutes\n }\n ]\n };\n }\n}\n","import { AuthRole, AuthRoleSet, Maybe } from '@dereekb/util';\nimport { onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, setContainsNoValueFrom } from '@dereekb/rxjs';\nimport { map, Observable, OperatorFunction } from 'rxjs';\n\n/**\n * Convenience operator that emits events when the input observable goes from false to true.\n *\n * @param isLoggedInObs\n * @returns\n */\nexport function loggedInObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onFalseToTrue(),\n map(() => undefined)\n );\n}\n/**\n * Convenience operator that emits events when the input observable goes from true to false.\n *\n * @param isLoggedInObs\n * @returns\n */\nexport function loggedOutObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onTrueToFalse(),\n map(() => undefined)\n );\n}\n\nexport function authRolesSetContainsAllRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\nexport function authRolesSetContainsAnyRoleFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\nexport function authRolesSetContainsNoRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsNoValueFrom<AuthRole>(roles);\n}\n","import { AuthRole, ArrayOrValue, Maybe } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { authRolesSetContainsAnyRoleFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has any of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthHasAnyRole]'\n})\nexport class DbxAuthHasAnyRoleDirective extends AbstractIfDirective implements OnDestroy {\n private _targetRoles = new BehaviorSubject<Maybe<ArrayOrValue<AuthRole>>>(undefined);\n\n readonly targetRoles$ = this._targetRoles.asObservable();\n\n readonly show$ = inject(DbxAuthService).authRoles$.pipe(authRolesSetContainsAnyRoleFrom(this.targetRoles$));\n\n override ngOnDestroy(): void {\n this._targetRoles.complete();\n }\n\n @Input('dbxAuthHasAnyRole')\n set targetRoles(roles: Maybe<ArrayOrValue<AuthRole>>) {\n this._targetRoles.next(roles);\n }\n}\n","import { Maybe, AuthRole, ArrayOrValue } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { authRolesSetContainsAllRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has all of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthHasRoles]'\n})\nexport class DbxAuthHasRolesDirective extends AbstractIfDirective implements OnDestroy {\n private _targetRoles = new BehaviorSubject<Maybe<ArrayOrValue<AuthRole>>>(undefined);\n readonly targetRoles$ = this._targetRoles.asObservable();\n\n readonly show$ = inject(DbxAuthService).authRoles$.pipe(authRolesSetContainsAllRolesFrom(this.targetRoles$));\n\n override ngOnDestroy(): void {\n this._targetRoles.complete();\n }\n\n @Input('dbxAuthHasRoles')\n set targetRoles(roles: Maybe<ArrayOrValue<AuthRole>>) {\n this._targetRoles.next(roles);\n }\n}\n","import { Maybe, AuthRole, ArrayOrValue } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { authRolesSetContainsNoRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has none of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthNotAnyRole]'\n})\nexport class DbxAuthNotAnyRoleDirective extends AbstractIfDirective implements OnDestroy {\n private _targetRoles = new BehaviorSubject<Maybe<ArrayOrValue<AuthRole>>>(undefined);\n\n readonly targetRoles$ = this._targetRoles.asObservable();\n\n readonly show$ = inject(DbxAuthService).authRoles$.pipe(authRolesSetContainsNoRolesFrom(this.targetRoles$));\n\n override ngOnDestroy(): void {\n this._targetRoles.complete();\n }\n\n @Input('dbxAuthNotAnyRole')\n set targetRoles(roles: Maybe<ArrayOrValue<AuthRole>>) {\n this._targetRoles.next(roles);\n }\n}\n","import { DbxAuthHasAnyRoleDirective } from './auth.role.any.directive';\nimport { NgModule } from '@angular/core';\nimport { DbxAuthHasRolesDirective } from './auth.role.has.directive';\nimport { DbxAuthNotAnyRoleDirective } from './auth.role.not.directive';\n\n@NgModule({\n imports: [],\n declarations: [DbxAuthHasRolesDirective, DbxAuthHasAnyRoleDirective, DbxAuthNotAnyRoleDirective],\n exports: [DbxAuthHasRolesDirective, DbxAuthHasAnyRoleDirective, DbxAuthNotAnyRoleDirective]\n})\nexport class DbxCoreAuthModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { DbxAuthService } from '../../service';\nimport { onDbxAppAuth } from '../';\nimport { map, tap } from 'rxjs';\nimport * as fromDbxAppAuth from '../reducer';\n\n/**\n * Set of ngrx effects that repeat events from DbxAuthService.\n */\n@Injectable()\nexport class DbxAppAuthEffects {\n private readonly dbxAuthService = inject(DbxAuthService);\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<fromDbxAppAuth.State>);\n\n // MARK: Auth\n readonly emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedIn())));\n\n readonly emitLoggedOut = createEffect(() => this.dbxAuthService.onLogOut$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedOut())));\n\n readonly forwardLogoutToAuthService = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.logout),\n tap(() => {\n // Perform the logout\n this.dbxAuthService.logOut();\n })\n ),\n { dispatch: false }\n );\n\n // MARK: Auth\n readonly setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier$.pipe(map((id) => onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier({ id }))));\n\n readonly setUserState = createEffect(() => this.dbxAuthService.authUserState$.pipe(map((state) => onDbxAppAuth.DbxAppAuthUserActions.setUserState({ state }))));\n\n readonly setUserRoles = createEffect(() => this.dbxAuthService.authRoles$.pipe(map((roles) => onDbxAppAuth.DbxAppAuthUserActions.setUserRoles({ roles: Array.from(roles ?? []) }))));\n\n readonly setUserIsOnboarded = createEffect(() => this.dbxAuthService.isOnboarded$.pipe(map((isOnboarded) => onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded({ isOnboarded }))));\n}\n","import { fromDbxAppAuth } from './state';\nimport { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { DbxAppAuthEffects } from './state/effect/auth.effect';\n\n@NgModule({\n imports: [StoreModule.forFeature(fromDbxAppAuth.featureKey, fromDbxAppAuth.reducers), EffectsModule.forFeature([DbxAppAuthEffects])],\n declarations: [],\n exports: []\n})\nexport class DbxAppAuthStateModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { DbxAppAuthFullState } from './state/state';\n\n/**\n * State for accessing the app's DbxAppAuthState defined within the DbxAppAuthFullState for the ngrx store.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthStateService {\n readonly store = inject(Store<DbxAppAuthFullState>);\n readonly authStateUser$ = this.store.select(fromDbxAppAuth.selectDbxAppAuthUser);\n}\n","import { MonoTypeOperatorFunction, tap } from 'rxjs';\nimport { ChangeDetectorRef, ViewRef, ElementRef } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Convenience function used within observables for views that need to detect changes after a value changes.\n *\n * @param cdRef\n * @param timeout\n * @returns\n */\nexport function tapDetectChanges<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n return cdRef ? tap(() => setTimeout(() => safeDetectChanges(cdRef), timeout)) : tap();\n}\n\n/**\n * Triggers a check for detecting any changes on the model safely to ve registered via detectChanges().\n *\n * @param cdRef\n */\nexport function safeDetectChanges(cdRef: ChangeDetectorRef): void {\n safeUseCdRef(cdRef, () => cdRef.detectChanges());\n}\n\n/**\n * Convenience function used within observables for views that use the OnPush ChangeDetectionStrategy and needs to call markForCheck when a new observable value is pushed.\n *\n * NOTE: If the observable is being consumed via the \"async\" pipe, this may not be necessary.\n *\n * @param cdRef\n * @param timeout\n * @returns\n */\nexport function tapSafeMarkForCheck<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n return cdRef ? tap(() => setTimeout(() => safeMarkForCheck(cdRef), timeout)) : tap();\n}\n\n/**\n * Marks the ChangeDetectorRef for changes as long as the view has not been destroyed.\n *\n * @param cdRef\n */\nexport function safeMarkForCheck(cdRef: ChangeDetectorRef): void {\n safeUseCdRef(cdRef, () => cdRef.markForCheck());\n}\n\n/**\n * Triggers a detection change on the input view as long as the view has not been destroyed.\n *\n * @param cdRef\n */\nexport function safeUseCdRef(cdRef: ChangeDetectorRef, use: (cdRef: ChangeDetectorRef) => void): void {\n if (!(cdRef as ViewRef).destroyed) {\n use(cdRef);\n }\n}\n\n/**\n * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,\n * or more specifically if the parent component passed any target content to the child. This will still return true if\n * passed content is empty.\n *\n * TS:\n * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;\n *\n * HTML:\n * <div #customContent>\n * <ng-content select=\"[content]\"></ng-content>\n * </div>\n */\nexport function checkNgContentWrapperHasContent(ref: Maybe<ElementRef<Element>>): boolean {\n // https://github.com/angular/angular/issues/26083\n let hasContent = false;\n\n if (ref != null) {\n const childNodes = ref.nativeElement.childNodes;\n const hasChildNodes = childNodes && childNodes.length > 0;\n hasContent = Boolean(hasChildNodes);\n }\n\n return hasContent;\n}\n","import { Type, Provider, forwardRef } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\n\n/**\n * Used for intercepting button click events.\n *\n * Can be used to delay/modify trigger/click behaviors.\n */\nexport interface DbxButtonInterceptor {\n /**\n * Handles a button click event. Returns an observable that will say whether or not to continue the click event.\n */\n interceptButtonClick: () => Observable<boolean>;\n}\n\n/**\n * Text and icon display content for a button.\n */\nexport interface DbxButtonDisplayContent {\n /**\n * button Icon, if applicable\n */\n icon?: Maybe<string>;\n /**\n * button text, if applicable\n */\n text?: Maybe<string>;\n}\n\nexport abstract class DbxButton implements DbxButtonDisplayContent {\n abstract readonly disabled$: Observable<boolean>;\n abstract readonly working$: Observable<boolean>;\n abstract disabled: Maybe<boolean>;\n abstract working: Maybe<boolean>;\n abstract icon?: Maybe<string>;\n abstract text?: Maybe<string>;\n abstract readonly clicked$: Observable<unknown>;\n abstract setButtonInterceptor(interceptor: DbxButtonInterceptor): void;\n abstract clickButton(): void;\n}\n\nexport function provideDbxButton<S extends DbxButton>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxButton,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n// MARK: Display\nexport type DbxButtonDisplayContentType = 'text_button' | 'icon_button';\n\n/**\n * Delegate class used for retrieving the DbxButtonDisplayContent given an input value.\n */\nexport interface DbxButtonDisplayDelegate<T> {\n /**\n * Returns the DbxButtonDisplayContent for the input value.\n *\n * @param value\n */\n buttonDisplayContentForValue(value: T): DbxButtonDisplayContent;\n}\n\n/**\n * Returns the DbxButtonDisplayContentType given the input content.\n *\n * @param content\n * @returns\n */\nexport function dbxButtonDisplayContentType(content: DbxButtonDisplayContent): DbxButtonDisplayContentType {\n return !content.text && content.icon ? 'icon_button' : 'text_button';\n}\n","import { Directive, OnInit, inject } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../subscription';\nimport { DbxButton } from '../button';\nimport { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Context used for linking a button to an ActionContext and only look for triggers.\n */\n@Directive({\n selector: '[dbxActionButtonTrigger]'\n})\nexport class DbxActionButtonTriggerDirective extends AbstractSubscriptionDirective implements OnInit {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly source = inject(DbxActionContextStoreSourceInstance);\n\n ngOnInit(): void {\n this.sub = this.dbxButton.clicked$.subscribe(() => {\n this._buttonClicked();\n });\n }\n\n protected _buttonClicked(): void {\n this.source.trigger();\n }\n}\n","import { safeDetectChanges } from '../../util/view';\nimport { Directive, OnInit, OnDestroy, ChangeDetectorRef, inject } from '@angular/core';\nimport { DbxActionButtonTriggerDirective } from './action.button.trigger.directive';\nimport { SubscriptionObject } from '@dereekb/rxjs';\n\n/**\n * Context used for linking a button to an ActionContext.\n */\n@Directive({\n selector: '[dbxActionButton]'\n})\nexport class DbxActionButtonDirective extends DbxActionButtonTriggerDirective implements OnInit, OnDestroy {\n private readonly cdRef = inject(ChangeDetectorRef);\n\n private _workingSub = new SubscriptionObject();\n private _disabledSub = new SubscriptionObject();\n\n override ngOnInit(): void {\n super.ngOnInit();\n\n this._workingSub.subscription = this.source.isWorking$.subscribe((working) => {\n this.dbxButton.working = working;\n safeDetectChanges(this.cdRef);\n });\n\n this._disabledSub.subscription = this.source.isDisabled$.subscribe((disabled) => {\n this.dbxButton.disabled = disabled;\n safeDetectChanges(this.cdRef);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._workingSub.destroy();\n this._disabledSub.destroy();\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, OnInit, OnDestroy, Input, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../subscription';\nimport { shareReplay, distinctUntilChanged, switchMap, tap, BehaviorSubject } from 'rxjs';\nimport { DbxButton } from '../button';\nimport { SegueRef, DbxRouterService } from '../../router';\n\n// MARK: Button Directives\n@Directive({\n selector: '[dbxButtonSegue]'\n})\nexport class DbxButtonSegueDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly dbxButton = inject(DbxButton);\n readonly dbxRouterService = inject(DbxRouterService);\n\n private readonly _segueRef = new BehaviorSubject<Maybe<SegueRef>>(undefined);\n readonly segueRef$ = this._segueRef.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n @Input('dbxButtonSegue')\n get segueRef(): Maybe<SegueRef> {\n return this._segueRef.value;\n }\n\n set segueRef(segueRef: Maybe<SegueRef>) {\n this._segueRef.next(segueRef);\n }\n\n ngOnInit(): void {\n this.sub = this.segueRef$\n .pipe(\n switchMap((segueRef) =>\n this.dbxButton.clicked$.pipe(\n tap(() => {\n this.dbxRouterService.go(segueRef);\n })\n )\n )\n )\n .subscribe();\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._segueRef.complete();\n }\n}\n","import { Directive, Input, Output, EventEmitter, OnDestroy, OnInit } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, of, Subject, filter, first, switchMap } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxButton, DbxButtonDisplayContent, DbxButtonDisplayContentType, dbxButtonDisplayContentType, DbxButtonInterceptor, provideDbxButton } from './button';\n\n/**\n * Abstract button component.\n */\n@Directive()\nexport abstract class AbstractDbxButtonDirective extends AbstractSubscriptionDirective implements DbxButton, OnInit, OnDestroy {\n private readonly _disabled = new BehaviorSubject<boolean>(false);\n private readonly _working = new BehaviorSubject<boolean>(false);\n\n /**\n * Pre-interceptor button click.\n */\n protected readonly _buttonClick = new Subject<void>();\n protected readonly _buttonInterceptor = new BehaviorSubject<Maybe<DbxButtonInterceptor>>(undefined);\n\n readonly disabled$ = this._disabled.asObservable();\n readonly working$ = this._working.asObservable();\n\n @Input()\n get disabled(): boolean {\n return this._disabled.value;\n }\n\n set disabled(disabled: Maybe<boolean>) {\n this._disabled.next(disabled ?? false);\n }\n\n @Input()\n get working(): boolean {\n return this._working.value;\n }\n\n set working(working: Maybe<boolean>) {\n this._working.next(working ?? false);\n }\n\n @Input()\n icon?: Maybe<string>;\n\n @Input()\n text?: Maybe<string>;\n\n @Input()\n get buttonDisplay(): DbxButtonDisplayContent {\n return {\n icon: this.icon,\n text: this.text\n };\n }\n\n set buttonDisplay(buttonDisplay: Maybe<DbxButtonDisplayContent>) {\n this.icon = buttonDisplay?.icon;\n this.text = buttonDisplay?.text;\n }\n\n get buttonDisplayType(): DbxButtonDisplayContentType {\n return dbxButtonDisplayContentType(this.buttonDisplay);\n }\n\n @Output()\n readonly buttonClick = new EventEmitter();\n\n readonly clicked$ = this.buttonClick.asObservable();\n\n ngOnInit(): void {\n this.sub = this._buttonClick\n .pipe(\n switchMap(() =>\n this._buttonInterceptor.pipe(\n switchMap((x) => {\n if (x) {\n return x.interceptButtonClick().pipe(first());\n } else {\n return of(true);\n }\n }),\n filter((x) => Boolean(x)) // Ignore false values.\n )\n )\n )\n .subscribe(() => {\n this._forceButtonClicked();\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disabled.complete();\n this._working.complete();\n this._buttonClick.complete();\n this._buttonInterceptor.complete();\n }\n\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n */\n public setButtonInterceptor(interceptor: DbxButtonInterceptor): void {\n this._buttonInterceptor.next(interceptor);\n }\n\n /**\n * Main function to use for handling clicks on the button.\n */\n public clickButton(): void {\n if (!this.disabled) {\n this._buttonClick.next();\n }\n }\n\n /**\n * Forces a button click. Skips the interceptors if any are configured.\n */\n protected _forceButtonClicked(): void {\n this.buttonClick.emit();\n }\n}\n\n// MARK: Implementation\n/**\n * Provides an DbxButton directive.\n */\n@Directive({\n selector: '[dbxButton]',\n exportAs: 'dbxButton',\n providers: provideDbxButton(DbxButtonDirective)\n})\nexport class DbxButtonDirective extends AbstractDbxButtonDirective {}\n","import { Directive, Input, NgZone, inject } from '@angular/core';\nimport { LoadingContext } from '@dereekb/rxjs';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxButton } from './button';\n\n/**\n * Context used for linking a button to a LoadingContext.\n *\n * It will be set working when the context is set loading.\n */\n@Directive({\n selector: '[dbxLoadingButton]'\n})\nexport class DbxLoadingButtonDirective extends AbstractSubscriptionDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly ngZone = inject(NgZone);\n\n /**\n * Sets a LoadingContext that is watched for the loading state.\n */\n @Input('dbxLoadingButton')\n set context(context: LoadingContext) {\n let subscription;\n\n if (context) {\n subscription = context.stream$.subscribe((x) => {\n this.ngZone.run(() => (this.dbxButton.working = x.loading));\n });\n }\n\n this.sub = subscription;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxActionButtonTriggerDirective, DbxActionButtonDirective } from './action';\nimport { DbxButtonDirective } from './button.directive';\nimport { DbxLoadingButtonDirective } from './button.loading.directive';\nimport { DbxButtonSegueDirective } from './router/button.segue.directive';\n\n@NgModule({\n imports: [],\n declarations: [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective],\n exports: [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective]\n})\nexport class DbxCoreButtonModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { DbxAppContextState } from './context';\nimport { onDbxAppContext, fromDbxAppContext } from './state';\nimport { DbxAppContextFullState } from './state/state';\n\n/**\n * State for accessing the app's DbxAppContextState defined within the DbxAppContextFullState for the ngrx store.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppContextService {\n readonly store = inject(Store<DbxAppContextFullState>);\n readonly state$ = this.store.select(fromDbxAppContext.selectDbxAppContextState);\n\n setState(state: DbxAppContextState) {\n this.store.dispatch(onDbxAppContext.DbxAppContextActions.setState({ state }));\n }\n\n resetState() {\n this.store.next(onDbxAppContext.DbxAppContextActions.resetState());\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport { DbxAppContextService } from './context.service';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxAppContextState } from './context';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Used to set the DbxAppContextState for an app to the input state using the DbxAppContextService.\n */\n@Directive({\n selector: '[dbxAppContextState]'\n})\nexport class DbxAppContextStateDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly dbxAppContextStateService = inject(DbxAppContextService);\n\n private readonly _state = new BehaviorSubject<Maybe<DbxAppContextState>>(undefined);\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this._state.pipe(filterMaybe()).subscribe((state) => {\n this.dbxAppContextStateService.setState(state);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._state.complete();\n }\n\n @Input('dbxAppContextState')\n set state(state: Maybe<DbxAppContextState>) {\n this._state.next(state);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\nimport { DbxAppContextStateDirective } from './context.directive';\nimport { fromDbxAppContext } from './state';\n\n@NgModule({\n imports: [StoreModule.forFeature(fromDbxAppContext.featureKey, fromDbxAppContext.reducers)],\n declarations: [DbxAppContextStateDirective],\n exports: [DbxAppContextStateDirective]\n})\nexport class DbxAppContextStateModule {}\n","/**\n * App environment details\n */\nexport abstract class DbxAppEnviroment {\n /**\n * Whether or not this is a production environment.\n */\n abstract production: boolean;\n /**\n * Whether or not this is a testing environment.\n *\n * Generally \"production\" is false when this is true.\n */\n abstract testing?: boolean;\n /**\n * Whether or not this is a staging environment.\n *\n * Generally \"production\" is true when this is true.\n */\n abstract staging?: boolean;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\n\n/**\n * Service for accessing the app's environment details.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppEnviromentService {\n readonly environment = inject(DbxAppEnviroment);\n\n get isProduction() {\n return this.environment.production === true;\n }\n\n get isStaging() {\n return this.environment.staging ?? false;\n }\n\n get isTesting() {\n return this.environment.testing ?? !this.environment.production;\n }\n\n /**\n * Returns the environment, typed as a specific type.\n */\n getEnvironment<T extends DbxAppEnviroment>(): T {\n return this.environment as T;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { asObservableFromGetter, ObservableOrValueGetter } from '@dereekb/rxjs';\nimport { Observable } from 'rxjs';\n\n/**\n * Pipes an ObservableOrValueGetter to an Observable value.\n */\n@Pipe({ name: 'asObservable' })\nexport class AsObservablePipe implements PipeTransform {\n transform<T>(input: ObservableOrValueGetter<T>): Observable<T> {\n return asObservableFromGetter(input);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { AsObservablePipe } from './asobservable.pipe';\n\nconst declarations = [AsObservablePipe];\n\n@NgModule({\n exports: declarations,\n declarations\n})\nexport class DbxAsyncPipeModule {}\n","import { addMinutes } from 'date-fns';\nimport { Pipe, PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatToTimeString, toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and number of minutes and outputs a formatted date.\n */\n@Pipe({ name: 'dateFromPlusTo' })\nexport class DateFromToTimePipe implements PipeTransform {\n private locale = inject(LOCALE_ID);\n\n static formatFromTo(input: Maybe<DateOrDateString>, format: string, minutes: number, locale: string): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n const endDate = addMinutes(date, minutes);\n const dateString = formatDate(date, format, locale);\n return dateString + ' - ' + formatToTimeString(endDate);\n }\n\n return undefined;\n }\n\n transform(input: Maybe<DateOrDateString>, format: string, minutes: number): Maybe<string> {\n return DateFromToTimePipe.formatFromTo(input, format, minutes, this.locale);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'minutesString', pure: false })\nexport class MinutesStringPipe implements PipeTransform {\n transform(input: Maybe<number | string>): Maybe<string> {\n const minutes = Number(input);\n\n if (input != null && !isNaN(minutes)) {\n if (minutes > 3600) {\n const unrounded = minutes / 3600;\n const days = Math.ceil(unrounded);\n return (unrounded !== days ? '~' : '') + days + ' days';\n } else if (minutes > 180) {\n const unrounded = minutes / 60;\n const hours = Math.ceil(unrounded);\n return (unrounded !== hours ? '~' : '') + hours + ' hours';\n } else {\n return minutes + ' minutes';\n }\n } else {\n return undefined;\n }\n }\n}\n","import { isValid } from 'date-fns';\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { toJsDate } from '@dereekb/date';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'toJsDate' })\nexport class ToJsDatePipe implements PipeTransform {\n public static toJsDate(input: DateOrDateString): Date;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date>;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date> {\n let date: Maybe<Date>;\n\n if (input != null) {\n date = toJsDate(input);\n\n if (!isValid(date)) {\n date = undefined;\n }\n }\n\n return date;\n }\n\n transform(input: Maybe<DateOrDateString>): Maybe<Date> {\n return ToJsDatePipe.toJsDate(input);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatDistance, isPast } from 'date-fns';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n@Pipe({ name: 'timeCountdownDistance', pure: false })\nexport class TimeDistanceCountdownPipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, soonString: string = 'Soon', unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n\n if (isPast(from)) {\n return soonString;\n } else {\n const to = new Date();\n return formatDistance(from, to, {\n addSuffix: true\n });\n }\n } else {\n return unavailable;\n }\n }\n}\n\n@Pipe({ name: 'timeDistance', pure: false })\nexport class TimeDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, to?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n return formatDistance(from, to ?? new Date(), {\n addSuffix: true\n });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'toMinutes' })\nexport class ToMinutesPipe implements PipeTransform {\n transform(milliseconds: number): number {\n if (milliseconds) {\n return Math.floor(milliseconds / (60 * 1000));\n }\n\n return milliseconds;\n }\n}\n","import { Pipe, PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { formatDistanceToNow, isValid } from 'date-fns';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\nimport { toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and appends the distance to it in parenthesis.\n */\n@Pipe({ name: 'dateFormatDistance', pure: false })\nexport class DateFormatDistancePipe implements PipeTransform {\n private locale = inject(LOCALE_ID);\n\n transform(input: Maybe<DateOrDateString>, format: string, includeSeconds = false): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n\n if (isValid(date)) {\n const dateString = formatDate(date, format, this.locale);\n\n const distance = formatDistanceToNow(date, {\n includeSeconds,\n addSuffix: true\n });\n\n return `${dateString} (${distance})`;\n }\n }\n\n return undefined;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { formatDateDistance } from '@dereekb/date';\n\n@Pipe({ name: 'dateDistance', pure: false })\nexport class DateDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, inputTo?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n const to = inputTo ?? new Date();\n const from = ToJsDatePipe.toJsDate(input);\n return formatDateDistance(to, from);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatToDayRangeString } from '@dereekb/date';\n\n@Pipe({ name: 'dateDayRange' })\nexport class DateDayRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n@Pipe({ name: 'dateTimeRange' })\nexport class DateTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatToDayTimeRangeString } from '@dereekb/date';\n\n@Pipe({ name: 'dateDayTimeRange' })\nexport class DateDayTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n@Pipe({ name: 'dateTimeRangeOnly' })\nexport class DateTimeRangeOnlyPipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input, undefined, true);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatDateRangeDistance, FormatDateRangeDistanceFunctionConfig } from '@dereekb/date';\n\n@Pipe({ name: 'dateTimeRangeOnlyDistance' })\nexport class DateTimeRangeOnlyDistancePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, config?: FormatDateRangeDistanceFunctionConfig, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatDateRangeDistance(input, { ...config });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { TimezoneString, dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to a system date that represents that date/time.\n */\n@Pipe({ name: 'targetDateToSystemDate', pure: false })\nexport class TargetDateToSystemDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).targetDateToSystemDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { TimezoneString, getTimezoneAbbreviation } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to the proper abbreviation. Uses the input date for the context, or uses now.\n */\n@Pipe({ name: 'timezoneAbbreviation', pure: false })\nexport class TimezoneAbbreviationPipe implements PipeTransform {\n transform(timezone: Maybe<TimezoneString>, input?: Maybe<Date>): Maybe<string> {\n if (timezone) {\n return getTimezoneAbbreviation(timezone, input ?? undefined);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { TimezoneString, dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to a target date that represents that date/time for the timezone.\n */\n@Pipe({ name: 'systemDateToTargetDate', pure: false })\nexport class SystemDateToTargetDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).systemDateToTargetDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatDateDistance } from '@dereekb/date';\n\n@Pipe({ name: 'dateRangeDistance', pure: false })\nexport class DateRangeDistancePipe implements PipeTransform {\n transform(input: Maybe<Date | DateRange>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n return formatDateDistance(input as Date, new Date());\n } else {\n return unavailable;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DateFromToTimePipe } from './datefromtoformat.pipe';\nimport { MinutesStringPipe } from './minutesstring.pipe';\nimport { TimeDistanceCountdownPipe, TimeDistancePipe } from './timedistance.pipe';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { ToMinutesPipe } from './tominutes.pipe';\nimport { DateFormatDistancePipe } from './dateformatdistance.pipe';\nimport { DateDistancePipe } from './datedistance.pipe';\nimport { DateDayRangePipe } from './datedayrange.pipe';\nimport { DateTimeRangePipe } from './datetimerange.pipe';\nimport { DateDayTimeRangePipe } from './datedaytimerange.pipe';\nimport { DateTimeRangeOnlyPipe } from './datetimerangeonly.pipe';\nimport { DateTimeRangeOnlyDistancePipe } from './datetimerangeonlydistance.pipe';\nimport { TargetDateToSystemDatePipe } from './targetdatetosystemdate.pipe';\nimport { TimezoneAbbreviationPipe } from './timezoneabbreviation.pipe';\nimport { SystemDateToTargetDatePipe } from './systemdatetotargetdate.pipe';\nimport { DateRangeDistancePipe } from './daterangedistance.pipe';\n\nconst declarations = [\n //\n DateDistancePipe,\n DateRangeDistancePipe,\n TargetDateToSystemDatePipe,\n SystemDateToTargetDatePipe,\n TimezoneAbbreviationPipe,\n DateFromToTimePipe,\n DateDayRangePipe,\n DateDayTimeRangePipe,\n DateTimeRangeOnlyPipe,\n DateTimeRangePipe,\n DateTimeRangeOnlyDistancePipe,\n DateFormatDistancePipe,\n MinutesStringPipe,\n TimeDistanceCountdownPipe,\n TimeDistancePipe,\n ToJsDatePipe,\n ToMinutesPipe\n];\n\n@NgModule({\n declarations,\n exports: declarations\n})\nexport class DbxDatePipeModule {}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'prettyjson' })\nexport class PrettyJsonPipe implements PipeTransform {\n public static toPrettyJson(input: Maybe<unknown>, spacing: number = 2): Maybe<string> {\n let json: Maybe<string>;\n\n if (input) {\n try {\n json = JSON.stringify(input, null, spacing);\n } catch (e) {\n console.error('prettyjson pipe failed parsing input: ', input);\n json = 'ERROR';\n }\n }\n\n return json;\n }\n\n transform(input: Maybe<unknown>, spacing?: number): Maybe<string> {\n return PrettyJsonPipe.toPrettyJson(input, spacing);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PrettyJsonPipe } from './prettyjson.pipe';\n\n@NgModule({\n exports: [PrettyJsonPipe],\n declarations: [PrettyJsonPipe]\n})\nexport class DbxMiscPipeModule {}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { GetterOrValue, getValueFromGetter } from '@dereekb/util';\n\n/**\n * Retrieves the value from the getter. This is a non-pure pipe. Use the getValueOncePipe instead for a pure pipe.\n */\n@Pipe({\n name: 'getValue',\n pure: false\n})\nexport class GetValuePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n\n/**\n * Pipes a GetValuePipe to an Observable value.\n */\n@Pipe({\n name: 'getValueOnce',\n pure: true\n})\nexport class GetValueOncePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { dollarAmountString, Maybe } from '@dereekb/util';\n\n/**\n * Pipe that takes in a number and returns the number formatted as a dollar using dollarAmountString().\n *\n * Can provide a default string value to use when the input is null or undefined.\n */\n@Pipe({ name: 'dollarAmount' })\nexport class DollarAmountPipe implements PipeTransform {\n transform(input: Maybe<number>, defaultIfNull?: Maybe<string>): Maybe<string> {\n return defaultIfNull == null || input != null ? dollarAmountString(input) : defaultIfNull;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DollarAmountPipe } from './dollar.pipe';\nimport { GetValueOncePipe, GetValuePipe } from './getvalue.pipe';\n\nconst declarations = [DollarAmountPipe, GetValuePipe, GetValueOncePipe];\n\n@NgModule({\n exports: declarations,\n declarations\n})\nexport class DbxValuePipeModule {}\n","import { NgModule } from '@angular/core';\nimport { DbxDatePipeModule } from './date/date.pipe.module';\nimport { DbxMiscPipeModule } from './misc/misc.pipe.module';\nimport { DbxAsyncPipeModule } from './async/async.pipe.module';\nimport { DbxValuePipeModule } from './value/value.pipe.module';\n\n@NgModule({\n exports: [DbxAsyncPipeModule, DbxMiscPipeModule, DbxDatePipeModule, DbxValuePipeModule]\n})\nexport class DbxPipesModule {}\n","import { Observable, BehaviorSubject, of, switchMap, shareReplay } from 'rxjs';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { FilterSourceConnector, FilterSource, filterMaybe } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Abstract FilterSourceConnector directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceConnectorDirective<F> implements FilterSourceConnector<F>, FilterSource<F>, OnDestroy {\n private _source = new BehaviorSubject<Maybe<FilterSource<F>>>(undefined);\n\n readonly filter$: Observable<F> = this._source.pipe(\n switchMap((x) => x?.filter$ ?? of(undefined)),\n filterMaybe(),\n shareReplay(1)\n );\n\n ngOnDestroy(): void {\n this._source.complete();\n }\n\n connectWithSource(filterSource: FilterSource<F>): void {\n this._source.next(filterSource);\n }\n}\n","import { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\nimport { forwardRef, Provider, Type } from '@angular/core';\n\n/**\n * Angular provider convenience function for a FilterSource.\n */\nexport function provideFilterSource<S extends FilterSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n/**\n * Angular provider convenience function for a FilterSourceConnector.\n */\nexport function provideFilterSourceConnector<S extends FilterSourceConnector>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSourceConnector,\n useExisting: forwardRef(() => sourceType)\n },\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { of, Observable } from 'rxjs';\nimport { Directive, forwardRef, OnDestroy, OnInit, Provider, Type } from '@angular/core';\nimport { FilterSource, FilterSourceInstance, ObservableOrValue } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { provideFilterSource } from './filter.content';\n\nexport abstract class FilterSourceDirective<F = unknown> implements FilterSource<F> {\n abstract filter$: Observable<F>;\n abstract initWithFilter(filterObs: Observable<F>): void;\n abstract setFilter(filter: F): void;\n abstract resetFilter(): void;\n}\n\n/**\n * Angular provider convenience function for a FilterSourceDirective.\n */\nexport function provideFilterSourceDirective<S extends FilterSourceDirective<F>, F = unknown>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSourceDirective,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideFilterSource(sourceType)\n ];\n}\n\n/**\n * Abstract FilterSource implementation and directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceDirective<F = unknown> implements FilterSourceDirective<F>, OnInit, OnDestroy {\n protected defaultFilterValue?: Maybe<F>;\n\n protected _defaultFilterSource = new FilterSourceInstance<F>();\n\n readonly filter$: Observable<F> = this._defaultFilterSource.filter$;\n\n ngOnInit(): void {\n this._defaultFilterSource.setDefaultFilter(this.makeDefaultFilter());\n }\n\n ngOnDestroy(): void {\n this._defaultFilterSource.destroy();\n }\n\n initWithFilter(filterObs: Observable<F>): void {\n this._defaultFilterSource.initWithFilter(filterObs);\n }\n\n setFilter(filter: F): void {\n this._defaultFilterSource.setFilter(filter);\n }\n\n resetFilter(): void {\n this._defaultFilterSource.resetFilter();\n }\n\n get initialFilterTakesPriority() {\n return this._defaultFilterSource.initialFilterTakesPriority;\n }\n\n set initialFilterTakesPriority(initialFilterTakesPriority: boolean) {\n this._defaultFilterSource.initialFilterTakesPriority = initialFilterTakesPriority;\n }\n\n // MARK: Internal\n protected makeDefaultFilter(): ObservableOrValue<Maybe<F>> {\n return of(this.defaultFilterValue);\n }\n}\n","import { Directive, OnInit, inject } from '@angular/core';\nimport { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\n\n/**\n * Connects the host FilterSource to a FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterConnectSource]'\n})\nexport class DbxFilterConnectSourceDirective<F = unknown> implements OnInit {\n readonly filterSource = inject(FilterSource<F>, { host: true });\n readonly filterSourceConnector = inject(FilterSourceConnector<F>);\n\n ngOnInit(): void {\n this.filterSourceConnector.connectWithSource(this.filterSource);\n }\n}\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceConnectorDirective } from './filter.abstract.connector.directive';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\n\n/**\n * Used as a FilterSource and FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterSourceConnector]',\n providers: [...provideFilterSource(DbxFilterSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterSourceConnectorDirective)]\n})\nexport class DbxFilterSourceConnectorDirective<F = unknown> extends AbstractFilterSourceConnectorDirective<F> {}\n","import { filterMaybe, FilterMapKey, FilterMap } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapInstanceDirective<F> implements OnDestroy {\n protected _key = new BehaviorSubject<Maybe<FilterMapKey>>(undefined);\n\n readonly dbxFilterMap = inject(FilterMap<F>);\n readonly key$ = this._key.pipe(filterMaybe());\n\n readonly instance$ = this.dbxFilterMap.instanceObsForKeyObs(this.key$);\n\n ngOnDestroy(): void {\n this._key.complete();\n }\n}\n","import { FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { switchMap, first, Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { provideFilterSource } from './filter.content';\nimport { AbstractDbxFilterMapInstanceDirective } from './filter.map.instance.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMapSource]',\n exportAs: 'dbxFilterMapSource',\n providers: [provideFilterSource(DbxFilterMapSourceDirective)]\n})\nexport class DbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapInstanceDirective<F> implements FilterSource<F> {\n readonly filter$: Observable<F> = this.instance$.pipe(switchMap((x) => x.filter$));\n\n @Input('dbxFilterMapSource')\n get key(): Maybe<FilterMapKey> {\n return this._key.value;\n }\n\n set key(key: Maybe<FilterMapKey>) {\n this._key.next(key);\n }\n\n initWithFilter(filterObs: Observable<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.initWithFilter(filterObs));\n }\n}\n","import { first } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { FilterSourceConnector, FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Acts as an \"input\" FilterSourceConnector for an FilterMap, as well as a source for the FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterMapSourceConnector]',\n exportAs: 'dbxFilterMapSourceConnector',\n providers: [...provideFilterSource(DbxFilterMapSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)]\n})\nexport class DbxFilterMapSourceConnectorDirective<F> extends DbxFilterMapSourceDirective<F> implements FilterSourceConnector<F> {\n @Input('dbxFilterMapSourceConnector')\n override get key(): Maybe<FilterMapKey> {\n return this._key.value;\n }\n\n override set key(key: Maybe<FilterMapKey>) {\n this._key.next(key);\n }\n\n // MARK: FilterSourceConnector\n connectWithSource(filterSource: FilterSource<F>): void {\n this.instance$.pipe(first()).subscribe((x) => {\n x.connectWithSource(filterSource);\n\n if (filterSource.initWithFilter) {\n filterSource.initWithFilter(this.filter$);\n }\n });\n }\n}\n","import { Directive, OnDestroy, inject } from '@angular/core';\nimport { FilterMap } from '@dereekb/rxjs';\n\n/**\n * Direction that provides an FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMap]',\n exportAs: 'dbxFilterMap',\n providers: [FilterMap]\n})\nexport class DbxFilterMapDirective<F> implements OnDestroy {\n readonly filterMap = inject(FilterMap<F>);\n\n ngOnDestroy(): void {\n this.filterMap.destroy();\n }\n}\n","import { FilterPresetStringRef, FilterWithPreset, FilterWithPresetOptional } from '@dereekb/rxjs';\nimport { EmptyObject, GetterOrValue, Maybe, objectHasKey, objectHasKeys } from '@dereekb/util';\nimport { ClickableAnchorLink } from '../router/anchor/anchor';\n\nexport interface ClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'>, FilterPresetStringRef<P> {\n /**\n * GetterOrValue that retrieves the filter for this preset.\n *\n * A null value or empty object is used for reset.\n */\n readonly presetValue: GetterOrValue<FilterWithPresetOptional<F>> | EmptyObject | null;\n}\n\nexport function isClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string>(preset: object): preset is ClickableFilterPreset<F, P> {\n return objectHasKey(preset, 'presetValue');\n}\n\nexport interface ClickablePartialFilterPreset<F> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'> {\n /**\n * GetterOrValue that retrieves the partial filter value.\n *\n * A null value or empty object is used for no change.\n */\n readonly partialPresetValue: GetterOrValue<Partial<F>> | EmptyObject | null;\n /**\n * The current value to test against. Returns true if this partial preset is considered active.\n */\n readonly isActive: (currentFilter: Maybe<Partial<F>>) => boolean;\n}\n\nexport function isClickablePartialFilterPreset<F>(preset: object): preset is ClickablePartialFilterPreset<F> {\n return objectHasKeys(preset, ['partialPresetValue', 'isActive']);\n}\n\n/**\n * Convenience type for either a ClickableFilterPreset or a ClickablePartialFilterPreset of the same type.\n */\nexport type ClickableFilterPresetOrPartialPreset<F extends FilterWithPreset<P>, P extends string = string> = ClickableFilterPreset<F, P> | ClickablePartialFilterPreset<F>;\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceDirective, provideFilterSourceDirective } from './filter.abstract.source.directive';\n\n/**\n * Basic filter source directive.\n */\n@Directive({\n selector: '[dbxFilterSource]',\n providers: provideFilterSourceDirective(DbxFilterSourceDirective)\n})\nexport class DbxFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DbxFilterMapDirective } from './filter.map.directive';\nimport { DbxFilterMapSourceConnectorDirective } from './filter.map.connector.directive';\nimport { DbxFilterSourceDirective } from './filter.source.directive';\nimport { DbxFilterSourceConnectorDirective } from './filter.connector.directive';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { DbxFilterConnectSourceDirective } from './filter.connect.source.directive';\n\nconst declarations = [DbxFilterSourceDirective, DbxFilterMapSourceConnectorDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceDirective];\n\n@NgModule({\n imports: [CommonModule],\n declarations,\n exports: declarations\n})\nexport class DbxCoreFilterModule {}\n","import { InjectionToken, Injector, NgModuleRef, StaticProvider, TemplateRef, Type, ViewRef } from '@angular/core';\nimport { FactoryWithRequiredInput, filterMaybeValues, Maybe, mergeArrays, mergeObjects } from '@dereekb/util';\n\nexport const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentConfigData');\n\nexport interface DbxInjectionComponentConfig<T = unknown> {\n /**\n * Type of Component to initialize.\n */\n componentClass: Type<T>;\n /**\n * (Optional) providers to provide to the existing injector.\n */\n providers?: StaticProvider[];\n /**\n * (Optional) Custom parent injector to use when creating the component.\n */\n injector?: Injector;\n /**\n * (Optional) Module ref to use when creating the component.\n */\n ngModuleRef?: NgModuleRef<unknown>;\n /**\n * (Optional) Custom initialization code when an instance is created.\n */\n init?: (instance: T) => void;\n /**\n * unknown optional data to inject into the component.\n */\n data?: unknown;\n}\n\n/**\n * The injector may be important to where the dbxInjection is getting injected at. Some types may disallow setting a custom parent injector.\n */\nexport type DbxInjectionComponentConfigWithoutInjector<T = unknown> = Omit<DbxInjectionComponentConfig<T>, 'injector'>;\n\nexport type DbxInjectionComponentConfigFactory<I, T = unknown> = FactoryWithRequiredInput<DbxInjectionComponentConfig<T>, I>;\n\nexport interface DbxInjectionTemplateConfig<T = unknown> {\n /**\n * Template ref to display.\n */\n templateRef?: Maybe<TemplateRef<T>>;\n /**\n * View ref to inject.\n */\n viewRef?: Maybe<ViewRef>;\n}\n\n/**\n * Merges multiple configurations into a single configuration.\n *\n * @param configs\n * @returns\n */\nexport function mergeDbxInjectionComponentConfigs<T = unknown>(configs: Maybe<Partial<DbxInjectionComponentConfig<T>>>[]): Partial<DbxInjectionComponentConfig<T>> {\n const providers = mergeArrays(filterMaybeValues(configs).map((x) => x.providers));\n const result = mergeObjects(configs);\n result.providers = providers;\n return result;\n}\n","import { ComponentRef, Injector, ViewContainerRef } from '@angular/core';\nimport { distinctUntilChanged, map, shareReplay, BehaviorSubject, combineLatest } from 'rxjs';\nimport { DbxInjectionComponentConfig, DbxInjectionTemplateConfig, DBX_INJECTION_COMPONENT_DATA } from './injection';\nimport { Initialized, Destroyable, Maybe, pushItemOrArrayItemsIntoArray } from '@dereekb/util';\nimport { SubscriptionObject, filterMaybe, skipFirstMaybe } from '@dereekb/rxjs';\n\n/**\n * Instance used by components to inject content based on the configuration into the view.\n */\nexport class DbxInjectionInstance<T> implements Initialized, Destroyable {\n private readonly _subscriptionObject = new SubscriptionObject();\n\n private readonly _config = new BehaviorSubject<Maybe<DbxInjectionComponentConfig<T>>>(undefined);\n private readonly _template = new BehaviorSubject<Maybe<DbxInjectionTemplateConfig<T>>>(undefined);\n\n private readonly _content = new BehaviorSubject<Maybe<ViewContainerRef>>(undefined);\n private readonly _componentRef = new BehaviorSubject<Maybe<ComponentRef<T>>>(undefined);\n\n private readonly _injector: Injector;\n\n readonly config$ = this._config.pipe(distinctUntilChanged());\n readonly template$ = this._template.pipe(distinctUntilChanged());\n readonly content$ = this._content.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n get config(): Maybe<DbxInjectionComponentConfig<T>> {\n return this._config.value;\n }\n\n set config(config: Maybe<DbxInjectionComponentConfig<T>>) {\n this._config.next(config);\n }\n\n get template(): Maybe<DbxInjectionTemplateConfig<T>> {\n return this._template.value;\n }\n\n set template(template: Maybe<DbxInjectionTemplateConfig<T>>) {\n this._template.next(template);\n }\n\n get content(): Maybe<Maybe<ViewContainerRef>> {\n return this._content.value;\n }\n\n set content(content: Maybe<Maybe<ViewContainerRef>>) {\n this._content.next(content);\n }\n\n get componentRef(): Maybe<ComponentRef<T>> {\n return this._componentRef.value;\n }\n\n set componentRef(componentRef: Maybe<ComponentRef<T>>) {\n this._componentRef.next(componentRef);\n }\n\n constructor(injector: Injector) {\n this._injector = injector;\n }\n\n init(): void {\n // Wait until the first of either of the two inputs comes in as not defined, and then emit.\n // We filter the first maybe here between the two items.\n const configTemplateObs = combineLatest([this.config$, this.template$]).pipe(\n map(([config, template]) => {\n if (config || template) {\n return {\n config,\n template\n };\n } else {\n return undefined;\n }\n }),\n skipFirstMaybe()\n );\n\n this._subscriptionObject.subscription = combineLatest([configTemplateObs, this.content$]).subscribe(([inputConfig, content]) => {\n const { config, template } = inputConfig ?? {};\n this._reset(content);\n\n if (config) {\n this._initComponent(config, content);\n } else if (template) {\n this._initTemplate(template, content);\n }\n });\n }\n\n destroy(): void {\n this._subscriptionObject.destroy();\n this._config.complete();\n this._template.complete();\n this._content.complete();\n this._componentRef.complete();\n }\n\n private _initComponent(config: DbxInjectionComponentConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { init, injector: inputInjector, providers, ngModuleRef, componentClass, data } = config;\n\n const parentInjector = inputInjector ?? this._injector;\n let injector: Injector | undefined = parentInjector;\n\n if (providers || data) {\n injector = Injector.create({\n parent: parentInjector,\n providers: pushItemOrArrayItemsIntoArray(\n [\n {\n provide: DBX_INJECTION_COMPONENT_DATA,\n useValue: data\n }\n ],\n providers ?? []\n )\n });\n }\n\n const componentRef: ComponentRef<T> = content.createComponent(componentClass, { injector, ngModuleRef });\n\n const instance = componentRef.instance;\n\n if (init) {\n init(instance);\n }\n\n this.componentRef = componentRef;\n }\n\n private _initTemplate(config: DbxInjectionTemplateConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { templateRef, viewRef } = config;\n\n if (templateRef) {\n content.createEmbeddedView(templateRef);\n\n // TODO: Figure out if these items need to be destroyed or not when this item is destroyed. If so, we need a reference to destroy.\n } else if (viewRef) {\n content.insert(viewRef);\n }\n }\n\n private _reset(content: ViewContainerRef): void {\n if (this.componentRef) {\n content.clear();\n this.componentRef = undefined;\n }\n }\n}\n","import { ViewContainerRef, OnInit, OnDestroy, Directive, Injector, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DbxInjectionComponentConfig, DbxInjectionTemplateConfig } from './injection';\nimport { DbxInjectionInstance as DbxInjectionInstance } from './injection.instance';\n\n/**\n * Abstract directive that injects content based on the configuration into the view.\n */\n@Directive()\nexport abstract class AbstractDbxInjectionDirective<T> implements OnInit, OnDestroy {\n private _instance = new DbxInjectionInstance<T>(inject(Injector));\n\n ngOnInit(): void {\n this._instance.init();\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n }\n\n setConfig(config: Maybe<DbxInjectionComponentConfig<T>>) {\n this._instance.config = config;\n }\n\n setTemplate(template: Maybe<DbxInjectionTemplateConfig<T>>) {\n this._instance.template = template;\n }\n\n setContent(content: Maybe<ViewContainerRef>) {\n this._instance.content = content;\n }\n}\n","import { Component, ViewChild, ViewContainerRef, Input } from '@angular/core';\nimport { DbxInjectionComponentConfig, DbxInjectionTemplateConfig } from './injection';\nimport { AbstractDbxInjectionDirective } from './injection.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injection, [dbxInjection], [dbx-injection]',\n template: `\n <ng-template #content></ng-template>\n `\n})\nexport class DbxInjectionComponent<T> extends AbstractDbxInjectionDirective<T> {\n @Input()\n set config(config: Maybe<DbxInjectionComponentConfig<T>>) {\n this.setConfig(config);\n }\n\n @Input()\n set template(template: Maybe<DbxInjectionTemplateConfig<T>>) {\n this.setTemplate(template);\n }\n\n @ViewChild('content', { static: true, read: ViewContainerRef })\n set content(content: Maybe<ViewContainerRef>) {\n this.setContent(content);\n }\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { ChangeDetectionStrategy, Component, Input, OnDestroy, TrackByFunction } from '@angular/core';\nimport { DbxInjectionArrayEntry } from './injection.array';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injection-array',\n template: `\n <ng-container *ngFor=\"let entry of entries$ | async; trackBy: trackByKeyFn\">\n <dbx-injection [config]=\"entry.injectionConfig | asObservable | async\"></dbx-injection>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxInjectionArrayComponent implements OnDestroy {\n private _entries = new BehaviorSubject<DbxInjectionArrayEntry[]>([]);\n readonly entries$ = this._entries.asObservable();\n\n readonly trackByKeyFn: TrackByFunction<DbxInjectionArrayEntry> = (index, item) => item.key;\n\n ngOnDestroy(): void {\n this._entries.complete();\n }\n\n @Input()\n get entries(): DbxInjectionArrayEntry[] {\n return this._entries.getValue();\n }\n\n set entries(entries: Maybe<DbxInjectionArrayEntry[]>) {\n this._entries.next(entries || []);\n }\n}\n","import { Provider, Type } from '@angular/core';\nimport { DbxInjectionComponentConfig } from './injection';\n\n/**\n * DbxInjectedViewContext showContext() configuration.\n */\nexport interface DbxInjectionContextConfig<T = unknown, O = unknown> {\n /**\n * Injected config.\n */\n config: DbxInjectionComponentConfig<T>;\n /**\n * Promise used to retrieve data from the given instance.\n */\n use: (instance: T) => Promise<O>;\n}\n\n/**\n * View that can switch to show another arbitrary view, then switch back when the promise ends.\n *\n * It is similar to *ngIf/*ngSwitch, but the original child content is retained instead of discarded,\n * and returns once the special context is done being used.\n */\nexport abstract class DbxInjectionContext {\n /**\n * Shows the given context until the promise ends, then displays the original content.\n *\n * The original content is hidden instead of removed from the context to avoid destruction of children elements.\n */\n abstract showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T>): Promise<O>;\n\n /**\n * Bails out of any current promise, if one is set.\n *\n * Returns true if the bail signal has been sent.\n */\n abstract resetContext(): boolean;\n}\n\n/**\n * Allows a directive to provide a formly context and form.\n */\nexport function provideDbxInjectionContext<T extends DbxInjectionContext>(type: Type<T>): Provider[] {\n return [\n {\n provide: DbxInjectionContext,\n useExisting: type\n }\n ];\n}\n","import { Directive, EmbeddedViewRef, Injector, Input, TemplateRef, ViewContainerRef, OnDestroy, OnInit, inject } from '@angular/core';\nimport { DbxInjectionContext, DbxInjectionContextConfig, provideDbxInjectionContext } from './injection.context';\nimport { DbxInjectionInstance } from './injection.instance';\nimport { DbxInjectionComponentConfig } from './injection';\nimport { PromiseOrValue, PromiseReference, promiseReference, Maybe } from '@dereekb/util';\n\n/**\n * DbxInjectedViewContext implementation. Acts similar to *ngIf, but instead switches to a different view without destroying the original child view.\n */\n@Directive({\n selector: '[dbxInjectionContext]',\n providers: provideDbxInjectionContext(DbxInjectionContextDirective)\n})\nexport class DbxInjectionContextDirective<O = unknown> implements DbxInjectionContext, OnInit, OnDestroy {\n private readonly _injector = inject(Injector);\n private readonly _templateRef = inject(TemplateRef<O>);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n private _currentPromise: Maybe<PromiseReference<unknown>>;\n private _instance = new DbxInjectionInstance(this._injector);\n private _embeddedView!: EmbeddedViewRef<O>;\n private _isDetached = false;\n\n @Input()\n set config(config: Maybe<DbxInjectionComponentConfig<unknown>>) {\n let reattach = false;\n\n if (config) {\n if (!this._isDetached) {\n // detach the original view before setting config.\n this._viewContainer.detach();\n this._isDetached = true;\n }\n } else if (this._isDetached) {\n reattach = true;\n }\n\n this._instance.config = config;\n\n if (reattach) {\n this._viewContainer.insert(this._embeddedView);\n this._isDetached = false;\n }\n }\n\n ngOnInit() {\n this._instance.content = this._viewContainer;\n this._instance.init();\n this._embeddedView = this._viewContainer.createEmbeddedView(this._templateRef);\n\n // detach the embedded view\n this._viewContainer.detach();\n\n // reattach it through the template configuration.\n // the template configuration acts as the default.\n this._instance.template = {\n viewRef: this._embeddedView\n };\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n this._embeddedView?.destroy(); // destroy our embedded view too.\n }\n\n async showContext<T, O>(config: DbxInjectionContextConfig<T>): Promise<O> {\n // clear the current context before showing something new.\n this.resetContext();\n\n let promiseRef: Maybe<PromiseReference<O>>;\n\n let result: Maybe<O>;\n let error: unknown;\n\n // wait for the promise to resolve and use to finish using that instance.\n try {\n promiseRef = promiseReference(async (resolve, reject) => {\n const injectionConfig: DbxInjectionComponentConfig<T> = {\n ...config.config,\n init: async (instance: T) => {\n // init if available in the base config.\n if (config.config.init) {\n config.config.init(instance);\n }\n\n try {\n const result = (await config.use(instance)) as PromiseOrValue<O>;\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n\n this.config = injectionConfig as DbxInjectionComponentConfig<unknown>;\n });\n\n this._currentPromise = promiseRef as PromiseReference<unknown>;\n\n // await the promise\n await promiseRef.promise;\n } catch (e) {\n error = e;\n }\n\n // if we're still using the same promiseRef\n if (promiseRef && promiseRef === this._currentPromise) {\n // clear the config to reshow the view\n this.config = undefined;\n\n // clear the current promise\n this._currentPromise = undefined;\n }\n\n if (error != null) {\n return Promise.reject(error);\n } else {\n return result as O;\n }\n }\n\n resetContext(): boolean {\n let clearedValue = false;\n\n if (this._currentPromise) {\n const promise = this._currentPromise;\n\n // clear the current promise too\n this._currentPromise = undefined;\n\n // clear the config.\n this.config = undefined;\n\n // send a rejection signal to bail out.\n promise.reject(new Error('dbxInjectionContext bailout'));\n\n clearedValue = true;\n }\n\n return clearedValue;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { DbxAsyncPipeModule } from '../pipe/async/async.pipe.module';\nimport { DbxInjectionArrayComponent } from './injection.array.component';\nimport { DbxInjectionComponent } from './injection.component';\nimport { DbxInjectionContextDirective } from './injection.context.directive';\n\nconst declarations = [DbxInjectionComponent, DbxInjectionArrayComponent, DbxInjectionContextDirective];\n\n@NgModule({\n imports: [CommonModule, DbxAsyncPipeModule],\n declarations,\n exports: declarations\n})\nexport class DbxInjectionComponentModule {}\n","import { Directive, inject } from '@angular/core';\nimport { DbxInjectionContext, DbxInjectionContextConfig } from './injection.context';\n\n/**\n * Abstract DbxInjectionContext implementation that forwards commands to a host DbxInjectionContext.\n *\n * This abstract type is used by related types for dependency injection purposes, so that those types\n * can be injected instead of just any DbxInjectionContext.\n */\n@Directive()\nexport abstract class AbstractForwardDbxInjectionContextDirective implements DbxInjectionContext {\n readonly dbxInjectionContext = inject(DbxInjectionContext, { host: true });\n\n // MARK: DbxInjectionContext\n showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T, unknown>): Promise<O> {\n return this.dbxInjectionContext.showContext(config);\n }\n\n resetContext(): boolean {\n return this.dbxInjectionContext.resetContext();\n }\n}\n","import { asGetter, GetterOrValue, Maybe } from '@dereekb/util';\nimport { switchMapObject } from '@dereekb/rxjs';\nimport { DbxInjectionComponentConfig } from './injection';\nimport { Type } from '@angular/core';\n\n/**\n * Provides a switchMap that passes configuration from the observable, unless the value is null/undefined/true in which case it passes the default configuration.\n *\n * @param defaultConfig\n * @returns\n */\nexport function switchMapDbxInjectionComponentConfig<T extends DbxInjectionComponentConfig<X>, X = any>(defaultConfig?: GetterOrValue<Maybe<T | Type<X>>>) {\n const defaultAsGetter = asGetter(defaultConfig);\n\n return switchMapObject<T>({\n defaultGetter: () => {\n const value = defaultAsGetter();\n\n if (typeof value === 'function') {\n // is a component class\n return { componentClass: value } as T;\n } else {\n return value;\n }\n }\n });\n}\n","import { AbstractType, Injector, Provider, Type } from '@angular/core';\n\nexport type InjectableType<T> = (Type<T> | AbstractType<T>) & Provider;\n\n/**\n * Creates a new instance of the injectable type with the input injector.\n *\n * @param type\n * @param parent\n * @returns\n */\nexport function newWithInjector<T>(type: InjectableType<T>, parent: Injector): T {\n const injector = Injector.create({ providers: [type], parent });\n return injector.get(type);\n}\n","import { map, Observable } from 'rxjs';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Inject, Optional, Injectable, OnDestroy } from '@angular/core';\nimport { LockSet, ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\nexport interface LockSetComponent {\n readonly lockSet: LockSet;\n}\n\nexport interface LockSetComponentStoreConfig {\n parent?: Maybe<Observable<LockSetComponent>>;\n locks?: {\n [key: string]: Observable<boolean>;\n };\n}\n\n/**\n * Abstract ComponentStore extension that provides a LockSet and OnDestroy delaying/cleanup.\n */\n@Injectable()\nexport abstract class LockSetComponentStore<S extends object> extends ComponentStore<S> implements OnDestroy {\n readonly lockSet = new LockSet();\n\n protected lockSetDestroyDelayMs = 2000;\n protected lockSetDestroyTimeoutMs: Maybe<number>;\n\n protected constructor(@Inject(null) @Optional() protected readonly initialState?: S) {\n super(initialState);\n }\n\n // MARK: State Changes\n readonly resetStore = this.updater(() => ({ ...this.initialState } as S));\n\n // MARK: Locks\n protected setupLockSet({ parent, locks }: LockSetComponentStoreConfig): void {\n if (parent) {\n this.setParentLockSet(parent);\n }\n\n if (locks) {\n for (const key in locks) {\n if (locks[key]) {\n this.addLock(key, locks[key]);\n }\n }\n }\n }\n\n setParentLockSet(obs: ObservableOrValue<Maybe<LockSetComponent>>): void {\n this.lockSet.setParentLockSet(asObservable(obs).pipe(map((x) => x?.lockSet)));\n }\n\n addLock(key: string, obs: Observable<boolean>): void {\n this.lockSet.addLock(key, obs);\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.destroyOnNextUnlock(\n {\n fn: () => {\n this._destroyNow();\n },\n timeout: this.lockSetDestroyTimeoutMs\n },\n this.lockSetDestroyDelayMs\n );\n }\n\n /**\n * Completes the cleanup of the object.\n */\n _destroyNow() {\n this.lockSet.destroy();\n }\n}\n","import { Observable, map } from 'rxjs';\nimport { timeHasExpired, unixTimeNumberForNow } from '@dereekb/date';\nimport { DataDoesNotExistError, DataIsExpiredError, ReadStoredData, StoredData, StoredDataStorageKey, StoredDataString, Maybe, hasNonNullValue, splitJoinRemainder } from '@dereekb/util';\nimport { StorageAccessor } from './storage.accessor';\n\n// MARK: SimpleStorageAccessor\nexport interface SimpleStorageAccessorConverter<T> {\n /**\n * Converts the input value to a string.\n */\n stringifyValue(value: T): StoredDataString;\n /**\n * Converts the data string into a value.\n */\n parseValue(data: StoredDataString): T;\n}\n\n/**\n * SimpleStorageAccessor delegate.\n */\nexport interface SimpleStorageAccessorDelegate<T> extends SimpleStorageAccessorConverter<T>, StorageAccessor<StoredDataString> {}\n\nexport class StringifySimpleStorageAccessorConverter<T> implements SimpleStorageAccessorConverter<T> {\n stringifyValue(value: T): StoredDataString {\n return JSON.stringify(value);\n }\n\n parseValue(data: StoredDataString): T {\n return JSON.parse(data);\n }\n}\n\nexport class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {\n private readonly _delegate: StorageAccessor<StoredDataString>;\n private readonly _converter: SimpleStorageAccessorConverter<T>;\n\n constructor(delegate: StorageAccessor<StoredDataString>, converter: SimpleStorageAccessorConverter<T>) {\n this._delegate = delegate;\n this._converter = converter;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return this._delegate.get(key);\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return this._delegate.set(key, value);\n }\n\n remove(key: string): Observable<void> {\n return this._delegate.remove(key);\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n all(prefix?: string): Observable<string[]> {\n return this._delegate.all(prefix);\n }\n\n allKeys(prefix?: string): Observable<string[]> {\n return this._delegate.allKeys(prefix);\n }\n\n stringifyValue(value: T): StoredDataString {\n return this._converter.stringifyValue(value);\n }\n\n parseValue(data: StoredDataString): T {\n return this._converter.parseValue(data);\n }\n}\n\nexport interface SimpleStorageAccessorConfig {\n /**\n * Storage Key Prefix\n */\n readonly prefix: string;\n /**\n * Optional prefix/value splitter.\n */\n readonly prefixSplitter?: string;\n /**\n * Number in milliseconds that objects stored will expire in.\n */\n readonly expiresIn?: number;\n}\n\ninterface ConfiguredSimpleStorageAccessorConfig extends SimpleStorageAccessorConfig {\n readonly prefixSplitter: string;\n readonly fullPrefix: string;\n}\n\nexport function assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void {\n if (!prefixSplitter) {\n throw new Error('Invalid storage key prefix splitter. Must be defined and not empty.'); // TODO(FUTURE): Consider changing to a concrete error type\n }\n\n if (!isValidStorageKeyPrefix(prefix, prefixSplitter)) {\n throw new Error('Invalid storage key prefix.');\n }\n}\n\nexport function isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean {\n return Boolean(prefix && prefix.indexOf(prefixSpltter) === -1);\n}\n\n/**\n * LimitedStorageAccessor implementation that uses a Delegate\n */\nexport class SimpleStorageAccessor<T> implements StorageAccessor<T> {\n static readonly PREFIX_SPLITTER = '::';\n\n private readonly _delegate: SimpleStorageAccessorDelegate<T>;\n protected readonly _config: ConfiguredSimpleStorageAccessorConfig;\n\n constructor(delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig) {\n const prefix = config.prefix;\n const prefixSplitter = config.prefixSplitter ?? SimpleStorageAccessor.PREFIX_SPLITTER;\n\n assertValidStorageKeyPrefix(prefix, prefixSplitter);\n\n const fullPrefix = `${prefix}${prefixSplitter}`;\n\n this._delegate = delegate;\n this._config = {\n ...config,\n prefixSplitter,\n fullPrefix\n };\n }\n\n get delegate() {\n return this._delegate;\n }\n\n get config() {\n return this._config;\n }\n\n // MARK: LimitedStorageAccessor\n get(inputKey: string): Observable<T> {\n const storeKey = this.makeStorageKey(inputKey);\n return this._delegate.get(storeKey).pipe(\n map((storedData: Maybe<string>) => {\n if (storedData) {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n throw new DataIsExpiredError<T>(readStoredData);\n }\n } else {\n throw new DataDoesNotExistError();\n }\n })\n );\n }\n\n set(inputKey: string, inputValue: T): Observable<void> {\n const storeKey = this.makeStorageKey(inputKey);\n const storeData: StoredData = this.buildStoredData(inputValue);\n const data = JSON.stringify(storeData);\n return this._delegate.set(storeKey, data);\n }\n\n remove(key: string): Observable<void> {\n const storeKey = this.makeStorageKey(key);\n return this._delegate.remove(storeKey);\n }\n\n all(): Observable<T[]> {\n return this._delegate.all(this._config.fullPrefix).pipe(\n map((allStoredData) => {\n return allStoredData\n .map((storedData) => {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n return null;\n }\n })\n .filter(hasNonNullValue);\n })\n );\n }\n\n allKeys(): Observable<string[]> {\n return this._delegate.allKeys(this._config.fullPrefix).pipe(map((keys) => keys.map((x) => this.decodeStorageKey(x))));\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n // MARK: Stored Values\n protected readStoredData(storedDataString: StoredDataString): ReadStoredData<T> {\n const storedData: StoredData = JSON.parse(storedDataString);\n const expired = this.isExpiredStoredData(storedData);\n const convertedData = this._delegate.parseValue(storedData.data);\n\n return {\n ...storedData,\n expired,\n convertedData\n };\n }\n\n protected buildStoredData(value: T): StoredData {\n return {\n storedAt: unixTimeNumberForNow(),\n data: this.stringifyValue(value)\n };\n }\n\n protected isExpiredStoredData(storeData: StoredData): boolean {\n const expiresIn = this._config.expiresIn;\n if (expiresIn) {\n if (storeData.storedAt) {\n return timeHasExpired(storeData.storedAt, expiresIn);\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n // MARK: Internal\n protected makeStorageKey(key: string): StoredDataStorageKey {\n return `${this._config.prefix}${this._config.prefixSplitter}${String(key)}`;\n }\n\n protected isKeyOfAccessor(storageKey: StoredDataStorageKey): boolean {\n return storageKey.startsWith(this._config.fullPrefix);\n }\n\n protected decodeStorageKey(storageKey: StoredDataStorageKey): string {\n const split = splitJoinRemainder(storageKey, this._config.prefixSplitter, 2);\n return split[1];\n }\n\n protected stringifyValue(value: T): string {\n return this._delegate.stringifyValue(value);\n }\n}\n","import { filterMaybeValues, StoredDataString, FullStorageObject, StorageObjectUtility, Maybe } from '@dereekb/util';\nimport { Observable, map, shareReplay } from 'rxjs';\nimport { StorageAccessor } from './storage.accessor';\n\n/**\n * Simple StorageAccessor implementation that wraps a FullStorageObject.\n */\nexport class StringStorageAccessor implements StorageAccessor<StoredDataString> {\n private readonly _storage: FullStorageObject;\n\n constructor(storage: FullStorageObject) {\n this._storage = storage;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return new Observable((x) => {\n const value = this._storage.getItem(key);\n x.next(value);\n x.complete();\n });\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.setItem(key, value);\n x.next();\n x.complete();\n });\n }\n\n remove(key: string): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.removeItem(key);\n x.next();\n x.complete();\n });\n }\n\n clear(): Observable<StoredDataString[]> {\n const removed = this._storage.removeAll();\n return new Observable((x) => {\n x.next(removed);\n x.complete();\n });\n }\n\n all(): Observable<StoredDataString[]> {\n return this.allKeys().pipe(\n map((x) => filterMaybeValues(x.map((y) => this._storage.getItem(y)))),\n shareReplay(1)\n );\n }\n\n allKeys(): Observable<string[]> {\n return new Observable((x) => {\n const result = StorageObjectUtility.allKeysFromStorageObject(this._storage);\n x.next(result);\n x.complete();\n });\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const DEFAULT_STORAGE_OBJECT_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_OBJECT');\nexport const DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_ACCESSOR_FACTORY');\n","import { Injectable, inject } from '@angular/core';\nimport { StorageAccessor } from './storage.accessor';\nimport { SimpleStorageAccessorConfig, SimpleStorageAccessor, SimpleStorageAccessorConverter, StringifySimpleStorageAccessorConverter, WrapperSimpleStorageAccessorDelegate } from './storage.accessor.simple';\nimport { StringStorageAccessor } from './storage.accessor.string';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN } from './storage.di';\nimport { FullStorageObject, StoredDataString } from '@dereekb/util';\n\nexport interface StorageAccessorFactoryConfig<T> extends SimpleStorageAccessorConfig {\n storage?: StorageAccessor<StoredDataString>;\n converter?: SimpleStorageAccessorConverter<T>;\n}\n\n/**\n * Used for building SimpleStorageAccessor instances from SimpleStorageAccessorConfig.\n */\n@Injectable()\nexport class SimpleStorageAccessorFactory {\n readonly storageObject = inject<FullStorageObject>(DEFAULT_STORAGE_OBJECT_TOKEN);\n\n createStorageAccessor<T>(config: StorageAccessorFactoryConfig<T>): SimpleStorageAccessor<T> {\n const storage = config.storage ?? new StringStorageAccessor(this.storageObject);\n const converter = config.converter ?? new StringifySimpleStorageAccessorConverter<T>();\n const delegate = new WrapperSimpleStorageAccessorDelegate<T>(storage, converter);\n\n const accessorConfig = {\n prefix: config.prefix\n };\n\n return new SimpleStorageAccessor<T>(delegate, accessorConfig);\n }\n}\n","import { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\n\n/**\n * Stored object accessor that can get/set/remove via a key, or be cleared entirely.\n */\nexport abstract class LimitedStorageAccessor<T> {\n /**\n * Attempts to get the value. Throws a DataDoesNotExistError if not available.\n */\n abstract get(key: string): Observable<Maybe<T>>;\n\n abstract set(key: string, value: Maybe<T>): Observable<void>;\n\n abstract remove(key: string): Observable<void>;\n\n abstract clear(): Observable<object>;\n}\n\n/**\n * LimitedStorageAccessor extension that has knowledge of all stored keys.\n */\nexport abstract class StorageAccessor<T> extends LimitedStorageAccessor<T> {\n /**\n * Returns all values. Filtered by keys of a given prefix.\n */\n abstract all(prefix?: string): Observable<T[]>;\n\n /**\n * Returns all keys. Filtered by keys of a given prefix.\n */\n abstract allKeys(prefix?: string): Observable<string[]>;\n}\n\n/**\n * StorageAccessor-like object that has immediate/synchronous functionality for get/set.\n */\nexport abstract class InstantStorageAccessor<T> {\n abstract getNow(key: string): T | undefined;\n\n abstract setNow(key: string, value: T): void;\n\n abstract removeNow(key: string): void;\n}\n","import { FullStorageObject, Maybe, StorageObject, StorageObjectUtility, StoredDataStorageKey } from '@dereekb/util';\n\n/**\n * StorageObject using LocalStorage.\n */\nexport class FullLocalStorageObject implements FullStorageObject {\n private readonly _localStorage: StorageObject;\n\n constructor(localStorage: StorageObject) {\n this._localStorage = localStorage;\n }\n\n get isPersistant(): boolean {\n return true;\n }\n\n get isAvailable(): boolean {\n const test = '_T_E_S_T_';\n\n try {\n // Tests setting and removing an item. These will throw an\n // exception if the localstorage is not available\n this._localStorage.setItem(test, test);\n this._localStorage.removeItem(test);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n get length(): number {\n return this._localStorage.length;\n }\n\n getItem(key: StoredDataStorageKey): Maybe<string> {\n return this._localStorage.getItem(key);\n }\n\n setItem(key: StoredDataStorageKey, item: string): void {\n this._localStorage.setItem(key, item);\n }\n\n removeItem(key: StoredDataStorageKey): void {\n this._localStorage.removeItem(key);\n }\n\n key(index: number): string | null {\n return this._localStorage.key(index);\n }\n\n removeAll(): string[] {\n const keys = StorageObjectUtility.allKeysFromStorageObject(this);\n keys.forEach((x) => this.removeItem(x));\n return keys;\n }\n}\n","import { SHARED_MEMORY_STORAGE } from '@dereekb/util';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\n\n/**\n * FullStorageObject implementation that uses a localstorage that entirely resides in memory.\n */\nexport class MemoryStorageObject extends FullLocalStorageObject {\n get isLastingStorage(): boolean {\n return false;\n }\n\n override get isAvailable(): boolean {\n return true;\n }\n\n constructor() {\n super(SHARED_MEMORY_STORAGE);\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FullStorageObject } from '@dereekb/util';\nimport { SimpleStorageAccessorFactory } from './storage.accessor.simple.factory';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN } from './storage.di';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\nimport { MemoryStorageObject } from './storage.object.memory';\n\nexport function defaultStorageObjectFactory(): FullStorageObject {\n let storageObject: FullStorageObject = new FullLocalStorageObject(localStorage);\n\n if (!storageObject.isAvailable) {\n storageObject = new MemoryStorageObject();\n }\n\n return storageObject;\n}\n\n@NgModule()\nexport class DbxStorageModule {\n static forRoot(): ModuleWithProviders<DbxStorageModule> {\n return {\n ngModule: DbxStorageModule,\n providers: [\n {\n provide: DEFAULT_STORAGE_OBJECT_TOKEN,\n useFactory: defaultStorageObjectFactory\n },\n {\n provide: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN,\n useClass: SimpleStorageAccessorFactory\n },\n {\n provide: SimpleStorageAccessorFactory,\n useExisting: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN\n }\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["declarations","initialState","reducer","DbxAppContextActions.setState","featureKey","reducers","fromDbxAppContextState.dbxAppContextStateFeatureKey","fromDbxAppContextState.reducer","onDbxAppContext.DbxAppContextActions.setState","DbxAppAuthActions.loggedOut","DbxAppAuthUserActions.setUserIdentifier","DbxAppAuthUserActions.setUserIsOnboarded","DbxAppAuthUserActions.setUserState","DbxAppAuthUserActions.setUserRoles","fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey","fromDbxAppAuthUserState.reducer","onDbxAppAuth.DbxAppAuthActions.loggedOut","onDbxAppAuth.DbxAppAuthActions.loggedIn","onDbxAppAuth.DbxAppAuthActions.logout","onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier","onDbxAppAuth.DbxAppAuthUserActions.setUserState","onDbxAppAuth.DbxAppAuthUserActions.setUserRoles","onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded","i1","i2","fromDbxAppAuth.featureKey","fromDbxAppAuth.reducers","fromDbxAppAuth.selectDbxAppAuthUser","fromDbxAppContext.selectDbxAppContextState","onDbxAppContext.DbxAppContextActions.resetState","fromDbxAppContext.featureKey","fromDbxAppContext.reducers","i2.DbxInjectionComponent","i3.AsObservablePipe"],"mappings":";;;;;;;;;;;;;;;;;;AAKA;;AAEG;MAEmB,6BAA6B,CAAA;AAChC,IAAA,mBAAmB,GAAG,IAAI,kBAAkB,EAAE,CAAC;IAEhE,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC;KACpC;IAED,IAAc,GAAG,CAAC,YAA6C,EAAA;AAC7D,QAAA,IAAI,CAAC,mBAAmB,CAAC,YAAY,GAAG,YAAY,CAAC;KACtD;wGATmB,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;4FAA7B,6BAA6B,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBADlD,SAAS;;AAaV;;AAEG;AAEG,MAAgB,oCAAqC,SAAQ,6BAA6B,CAAA;AACrF,IAAA,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAExB,WAAW,GAAA;AAClB,QAAA,IAAI,C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4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,QAAQ;;;ACjBT;;AAEG;;;;"}
1
+ {"version":3,"file":"dereekb-dbx-core.mjs","sources":["../../../../packages/dbx-core/src/lib/subscription/subscription.directive.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.automodify.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.autotrigger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.stream.directive.ts","../../../../packages/dbx-core/src/lib/action/action.handler.ts","../../../../packages/dbx-core/src/lib/action/action.ts","../../../../packages/dbx-core/src/lib/action/action.store.ts","../../../../packages/dbx-core/src/lib/action/action.holder.ts","../../../../packages/dbx-core/src/lib/action/action.machine.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.provide.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/debug/action.logger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.key.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.working.disable.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disabled.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disableonsuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.directive.ts","../../../../packages/dbx-core/src/lib/view/if.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.presuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.working.component.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.enforce.modified.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.directive.ts","../../../../packages/dbx-core/src/lib/action/action.module.ts","../../../../packages/dbx-core/src/lib/action/action.reference.ts","../../../../packages/dbx-core/src/lib/router/segue.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/redirect.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/auth.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/role.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/state.hook.ts","../../../../packages/dbx-core/src/lib/context/context.ts","../../../../packages/dbx-core/src/lib/context/state/action/data.action.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/data.reducer.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/context/state/effect/index.ts","../../../../packages/dbx-core/src/lib/auth/auth.user.ts","../../../../packages/dbx-core/src/lib/auth/state/action/auth.action.ts","../../../../packages/dbx-core/src/lib/auth/state/action/user.action.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/user.reducer.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.directive.ts","../../../../packages/dbx-core/src/lib/router/anchor/clickable.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/id.hook.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/uid.hook.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.transition.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.directive.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.watcher.directive.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.util.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.go.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.module.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.module.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.reader.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.default.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/state/effect/auth.router.state.effect.ts","../../../../packages/dbx-core/src/lib/auth/router/state/auth.router.state.module.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.module.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.rxjs.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.any.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.has.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.not.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.module.ts","../../../../packages/dbx-core/src/lib/auth/state/effect/auth.effect.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.module.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.service.ts","../../../../packages/dbx-core/src/lib/util/view.ts","../../../../packages/dbx-core/src/lib/button/button.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.trigger.directive.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.directive.ts","../../../../packages/dbx-core/src/lib/button/router/button.segue.directive.ts","../../../../packages/dbx-core/src/lib/button/button.directive.ts","../../../../packages/dbx-core/src/lib/button/button.loading.directive.ts","../../../../packages/dbx-core/src/lib/button/button.module.ts","../../../../packages/dbx-core/src/lib/context/context.service.ts","../../../../packages/dbx-core/src/lib/context/context.directive.ts","../../../../packages/dbx-core/src/lib/context/context.module.ts","../../../../packages/dbx-core/src/lib/environment/service/environment.ts","../../../../packages/dbx-core/src/lib/environment/service/environment.service.ts","../../../../packages/dbx-core/src/lib/pipe/async/asobservable.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/async/async.pipe.module.ts","../../../../packages/dbx-core/src/lib/pipe/date/datefromtoformat.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/minutesstring.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tojsdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tominutes.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatdistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedayrange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedaytimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonly.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonlydistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/targetdatetosystemdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timezoneabbreviation.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/systemdatetotargetdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/daterangedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/date.pipe.module.ts","../../../../packages/dbx-core/src/lib/pipe/misc/prettyjson.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/misc/misc.pipe.module.ts","../../../../packages/dbx-core/src/lib/pipe/value/getvalue.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/dollar.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/value.pipe.module.ts","../../../../packages/dbx-core/src/lib/pipe/pipe.module.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.content.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connect.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.instance.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.preset.ts","../../../../packages/dbx-core/src/lib/filter/filter.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.module.ts","../../../../packages/dbx-core/src/lib/injection/injection.ts","../../../../packages/dbx-core/src/lib/injection/injection.instance.ts","../../../../packages/dbx-core/src/lib/injection/injection.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.array.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.component.module.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.forward.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.rxjs.ts","../../../../packages/dbx-core/src/lib/injection/injector.ts","../../../../packages/dbx-core/src/lib/ngrx/store.lockset.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.string.ts","../../../../packages/dbx-core/src/lib/storage/storage.di.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.factory.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.localstorage.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.memory.ts","../../../../packages/dbx-core/src/lib/storage/storage.module.ts","../../../../packages/dbx-core/src/dereekb-dbx-core.ts"],"sourcesContent":["import { OnDestroy, Directive } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { SubscriptionObject, LockSet } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Abstract component that contains a SubscriptionObject and will clean it up automatically.\n */\n@Directive()\nexport abstract class AbstractSubscriptionDirective implements OnDestroy {\n private readonly _subscriptionObject = new SubscriptionObject();\n\n ngOnDestroy(): void {\n this._subscriptionObject.destroy();\n }\n\n protected set sub(subscription: Maybe<Subscription | undefined>) {\n this._subscriptionObject.subscription = subscription;\n }\n}\n\n/**\n * AbstractSubscriptionDirective extension that prevents the OnDestroy from occuring until the lockset is unlocked.\n */\n@Directive()\nexport abstract class AbstractLockSetSubscriptionDirective extends AbstractSubscriptionDirective implements OnDestroy {\n readonly lockSet = new LockSet();\n\n override ngOnDestroy(): void {\n this.lockSet.onNextUnlock(() => this.onLockSetDestroy());\n }\n\n protected onLockSetDestroy(): void {\n super.ngOnDestroy();\n }\n}\n","import { first, switchMap, Observable, Subscription } from 'rxjs';\nimport { LockSet, filterMaybe, LoadingState, LoadingStateType } from '@dereekb/rxjs';\nimport { Destroyable, Maybe, ReadableError } from '@dereekb/util';\nimport { ActionContextState, ActionContextStore } from './action.store';\nimport { DbxActionDisabledKey, DbxActionRejectedPair, DbxActionState, DbxActionSuccessPair } from './action';\n\n/**\n * Source that provides a ActionContextStore observable.\n */\nexport abstract class ActionContextStoreSource<T = unknown, O = unknown> {\n /**\n * Observable referencing the ActionContextStore.\n *\n * This observable by design is pre-filtered to not return null values.\n */\n abstract readonly store$: Observable<ActionContextStore<T, O>>;\n}\n\n/**\n * Secondary source. Used by DbxActionContextComponent to find secondary sources.\n */\nexport abstract class SecondaryActionContextStoreSource<T = unknown, O = unknown> extends ActionContextStoreSource<T, O> {}\n\nexport function actionContextStoreSourcePipe<T, O>(obs: Observable<Maybe<ActionContextStore<T, O>>>): Observable<ActionContextStore<T, O>> {\n return obs.pipe(filterMaybe());\n}\n\nexport type PipeActionStoreFunction<R, T, O> = (store: ActionContextStore<T, O>) => Observable<R>;\n\nexport function pipeActionStore<R = unknown, T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return source.store$.pipe(switchMap(pipeFn));\n}\n\nexport type UseActionStoreFunction<T, O> = (store: ActionContextStore<T, O>) => void;\n\n/**\n * Convenience function for subscribing to the input source once and using the provided store.\n */\nexport function useActionStore<T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, useFn: UseActionStoreFunction<T, O>): Subscription {\n return source.store$.pipe(first()).subscribe(useFn);\n}\n\n/**\n * Service that wraps a ActionContextStoreSource.\n */\nexport class DbxActionContextStoreSourceInstance<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n readonly lockSet = new LockSet();\n\n private readonly _source: ActionContextStoreSource<T, O>;\n\n constructor(source: ActionContextStoreSource<T, O>) {\n if (!source) {\n throw new Error('Source is required.');\n }\n\n this._source = source;\n }\n\n get source(): ActionContextStoreSource<T, O> {\n return this._source;\n }\n\n public destroy(): void {\n this.lockSet.destroyOnNextUnlock();\n }\n\n // MARK: Store\n get store$(): Observable<ActionContextStore<T, O>> {\n return this.source.store$;\n }\n\n pipeStore<R>(pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return pipeActionStore(this.source, pipeFn);\n }\n\n useStore(useFn: UseActionStoreFunction<T, O>): Subscription {\n return useActionStore(this.source, useFn);\n }\n\n get state$(): Observable<ActionContextState<T, O>> {\n return this.pipeStore((x) => x.state$);\n }\n\n get triggered$(): Observable<boolean> {\n return this.pipeStore((x) => x.triggered$);\n }\n\n get valueReady$(): Observable<T> {\n return this.pipeStore((x) => x.valueReady$);\n }\n\n get success$(): Observable<Maybe<O>> {\n return this.pipeStore((x) => x.success$);\n }\n\n get successPair$(): Observable<DbxActionSuccessPair<T, O>> {\n return this.pipeStore((x) => x.successPair$);\n }\n\n get error$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.error$);\n }\n\n get rejected$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.rejected$);\n }\n\n get rejectedPair$(): Observable<DbxActionRejectedPair<T>> {\n return this.pipeStore((x) => x.rejectedPair$);\n }\n\n get isModified$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModified$);\n }\n\n get canTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.canTrigger$);\n }\n\n get isModifiedAndCanTriggerUpdates$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTriggerUpdates$);\n }\n\n get isModifiedAndCanTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTrigger$);\n }\n\n get actionState$(): Observable<DbxActionState> {\n return this.pipeStore((x) => x.actionState$);\n }\n\n get loadingState$(): Observable<LoadingState<O>> {\n return this.pipeStore((x) => x.loadingState$);\n }\n\n get loadingStateType$(): Observable<LoadingStateType> {\n return this.pipeStore((x) => x.loadingStateType$);\n }\n\n get isWorking$(): Observable<boolean> {\n return this.pipeStore((x) => x.isWorking$);\n }\n\n get isSuccess$(): Observable<boolean> {\n return this.pipeStore((x) => x.isSuccess$);\n }\n\n get disabledKeys$(): Observable<string[]> {\n return this.pipeStore((x) => x.disabledKeys$);\n }\n\n get isDisabled$(): Observable<boolean> {\n return this.pipeStore((x) => x.isDisabled$);\n }\n\n get errorCountSinceLastSuccess$(): Observable<number> {\n return this.pipeStore((x) => x.errorCountSinceLastSuccess$);\n }\n\n public enable(key?: DbxActionDisabledKey, enable = true): void {\n this.disable(key, !enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable = true): void {\n this.useStore((x) => (disable ? x.disable(key) : x.enable(key)));\n }\n\n public setIsModified(isModified?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsModified(isModified));\n }\n\n public trigger(): void {\n this.useStore((x) => x.trigger());\n }\n\n public triggerWithValue(value: T | Observable<T>): void {\n this.useStore((x) => {\n x.trigger();\n x.readyValue(value);\n });\n }\n\n public readyValue(value: T | Observable<T>): void {\n this.useStore((x) => x.readyValue(value));\n }\n\n public startWorking(): void {\n this.useStore((x) => x.startWorking());\n }\n\n public reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.useStore((x) => x.reject(error));\n }\n\n public resolve(value: O | Observable<O>): void {\n this.useStore((x) => x.resolve(value));\n }\n\n public reset(): void {\n this.useStore((x) => x.reset());\n }\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { distinctUntilChanged, filter, combineLatest, BehaviorSubject } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { Maybe } from '@dereekb/util';\n\n@Directive({\n selector: '[dbxActionAutoModify]'\n})\nexport class DbxActionAutoModifyDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _autoModifyEnabled = new BehaviorSubject<boolean>(true);\n\n @Input('dbxActionAutoModify')\n get autoModifyEnabled(): boolean {\n return this._autoModifyEnabled.value;\n }\n\n set autoModifyEnabled(autoModifyEnabled: Maybe<boolean | ''>) {\n this._autoModifyEnabled.next(autoModifyEnabled !== false);\n }\n\n ngOnInit(): void {\n const obs = combineLatest([\n this._autoModifyEnabled.pipe(distinctUntilChanged()), // Don't change unless specified otherwise.\n this.source.isModified$.pipe(filter((x) => !x)) // Only when not modified send a value.\n ]);\n\n this.sub = obs.subscribe(([autoModifyEnabled, isModified]) => {\n if (autoModifyEnabled && !isModified) {\n this.source.setIsModified(true);\n }\n });\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._autoModifyEnabled.complete();\n });\n }\n}\n","import { inject, Directive, Input, OnInit, OnDestroy } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { debounce, distinctUntilChanged, exhaustMap, filter, first, map, mergeMap, shareReplay, switchMap, throttle, EMPTY, interval, Subject, combineLatest, Observable, BehaviorSubject } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isDefinedAndNotFalse, Maybe } from '@dereekb/util';\n\nconst DEFAULT_DEBOUNCE_MS = 2 * 1000;\n\nconst DEFAULT_THROTTLE_MS = 10 * 1000;\n\nconst DEFAULT_ERROR_THROTTLE_MS = 3 * 1000;\n\nconst MAX_ERRORS_TO_THROTTLE_ON = 6;\n\n/**\n * Directive that automatically triggers the action periodically when it is in a modified state.\n *\n * When using auto triggers be sure to make sure that the action is not triggering too often due to misconfiguration.\n */\n@Directive({\n selector: 'dbxActionAutoTrigger, [dbxActionAutoTrigger]'\n})\nexport class DbxActionAutoTriggerDirective<T = unknown, O = unknown> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _triggerEnabled = new BehaviorSubject<boolean>(true);\n private readonly _triggerLimit = new BehaviorSubject<number | undefined>(undefined);\n private readonly _trigger = new Subject<number>();\n\n /**\n * How much to throttle the auto-triggering.\n */\n @Input('dbxActionAutoTrigger')\n get triggerEnabled(): boolean {\n return this._triggerEnabled.value;\n }\n\n set triggerEnabled(triggerEnabled: Maybe<boolean> | '') {\n triggerEnabled = triggerEnabled !== false; // Default to true\n\n if (this.triggerEnabled !== triggerEnabled) {\n this._triggerEnabled.next(triggerEnabled);\n }\n }\n\n @Input()\n triggerDebounce = DEFAULT_DEBOUNCE_MS;\n\n @Input()\n triggerThrottle = DEFAULT_THROTTLE_MS;\n\n @Input()\n triggerErrorThrottle = DEFAULT_ERROR_THROTTLE_MS;\n\n maxErrorsForThrottle = MAX_ERRORS_TO_THROTTLE_ON;\n\n /**\n * Optional input to override both triggerDebounce and triggerThrottle.\n *\n * Used in forms that are simple.\n */\n @Input()\n set fastTrigger(fastTrigger: Maybe<boolean> | '') {\n if (isDefinedAndNotFalse(fastTrigger)) {\n this.triggerDebounce = 200;\n this.triggerThrottle = 500;\n }\n }\n\n /**\n * Optional input to override both triggerDebounce and triggerThrottle to be 0.\n *\n * Used in forms that generally return a single value.\n */\n @Input()\n set instantTrigger(instantTrigger: Maybe<boolean> | '') {\n if (isDefinedAndNotFalse(instantTrigger)) {\n this.triggerDebounce = 10;\n this.triggerThrottle = 0;\n }\n }\n\n @Input()\n get triggerLimit(): Maybe<number> {\n return this._triggerLimit.value;\n }\n\n set triggerLimit(triggerLimit: Maybe<number>) {\n triggerLimit = triggerLimit || 0;\n this._triggerLimit.next(triggerLimit);\n }\n\n private _triggerCount = 0;\n\n readonly _errorCount$ = this.source.errorCountSinceLastSuccess$;\n\n readonly _triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(\n filter(() => this.isEnabled),\n filter((x) => x),\n debounce(() => interval(this.triggerDebounce)),\n throttle(\n () =>\n this._errorCount$.pipe(\n first(),\n exhaustMap((count) => interval(this.triggerThrottle + Math.min(count, this.maxErrorsForThrottle) * this.triggerErrorThrottle))\n ),\n { leading: true, trailing: true }\n ),\n // Check again for the \"trailing\" piece.\n filter(() => this.isEnabled),\n mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())),\n filter((x) => x),\n map(() => (this._triggerCount += 1)),\n shareReplay(1)\n );\n\n /**\n * Observable for the trigger mechanism.\n */\n readonly triggerCount$ = this._triggerEnabled.pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this._triggerCount$;\n } else {\n return EMPTY;\n }\n })\n );\n\n private readonly _isTriggerLimited$: Observable<[number, boolean]> = combineLatest([this.triggerCount$, this._triggerLimit]).pipe(\n map(([triggerCount, limit]) => [triggerCount, limit ? triggerCount > limit : false] as [number, boolean]),\n shareReplay(1)\n );\n\n readonly isTriggerLimited$ = this._isTriggerLimited$.pipe(map((x) => x[1]));\n readonly trigger$: Observable<void> = this._isTriggerLimited$.pipe(\n filter((x) => !x[1]),\n distinctUntilChanged((a, b) => a[0] === b[0]), // Only trigger when the count changes.\n map(() => undefined as void)\n );\n\n get isEnabled(): boolean {\n return this.triggerEnabled !== false;\n }\n\n ngOnInit(): void {\n this.sub = this.trigger$.subscribe(() => {\n this.source.trigger();\n });\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._triggerEnabled.complete();\n this._trigger.complete();\n this._triggerLimit.complete();\n });\n }\n}\n","import { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { switchMap, mergeMap, map, withLatestFrom, shareReplay, BehaviorSubject, Observable, of, EMPTY } from 'rxjs';\nimport { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { hasValueOrNotEmpty, Maybe, isDefinedAndNotFalse } from '@dereekb/util';\nimport { IsModifiedFunction, SubscriptionObject } from '@dereekb/rxjs';\n\n/**\n * Directive that watches a value observable for changes and sets the new value and modified states as necessary.\n */\n@Directive({\n selector: '[dbxActionValueStream]'\n})\nexport class dbxActionValueStreamDirective<T, O> implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private _valueObs = new BehaviorSubject<Observable<T>>(EMPTY);\n private _isModifiedFn = new BehaviorSubject<Maybe<IsModifiedFunction<T>>>(undefined);\n\n private _modifiedSub = new SubscriptionObject();\n private _triggerSub = new SubscriptionObject();\n\n @Input()\n set dbxActionValueStream(dbxActionValueStream: Observable<T>) {\n this._valueObs.next(dbxActionValueStream);\n }\n\n @Input()\n set dbxActionValueStreamIsNotEmpty(requireNonEmpty: unknown) {\n if (isDefinedAndNotFalse(requireNonEmpty)) {\n this.dbxActionValueStreamModified = (value) => {\n return of(hasValueOrNotEmpty(value));\n };\n }\n }\n\n @Input()\n set dbxActionValueStreamModified(dbxActionValueStreamModified: IsModifiedFunction<T>) {\n this._isModifiedFn.next(dbxActionValueStreamModified);\n }\n\n readonly modifiedValue$ = this._valueObs.pipe(\n switchMap((obs) =>\n obs.pipe(\n withLatestFrom(this._isModifiedFn),\n mergeMap(([value, dbxActionValueStreamModified]) => {\n let result: Observable<[boolean, T]>;\n\n if (dbxActionValueStreamModified) {\n result = dbxActionValueStreamModified(value).pipe(map((isModified) => [isModified, value] as [boolean, T]));\n } else {\n result = of([true, value]);\n }\n\n return result;\n }),\n shareReplay(1)\n )\n )\n );\n\n ngOnInit(): void {\n // Update Modified value.\n this._modifiedSub.subscription = this.modifiedValue$.subscribe(([isModified]) => {\n this.source.setIsModified(isModified);\n });\n\n // Set the value on triggers.\n this._triggerSub.subscription = this.source.triggered$.pipe(switchMap(() => this.modifiedValue$)).subscribe(([isModified, value]) => {\n if (isModified) {\n this.source.readyValue(value);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._valueObs.complete();\n this._isModifiedFn.complete();\n this._modifiedSub.destroy();\n this._triggerSub.destroy();\n });\n }\n}\n","import { Maybe, ReadableError } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from './action.store.source';\nimport { WorkInstanceDelegate } from '@dereekb/rxjs';\nimport { Observable } from 'rxjs';\n\n/**\n * WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.\n */\nexport class DbxActionWorkInstanceDelegate<T = unknown, O = unknown> implements WorkInstanceDelegate<O> {\n private _source: DbxActionContextStoreSourceInstance<T, O>;\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._source = source;\n }\n\n get source() {\n return this._source;\n }\n\n startWorking(): void {\n this.source.startWorking();\n }\n\n success(result: O): void {\n this.source.resolve(result);\n }\n\n reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.source.reject(error);\n }\n}\n","import { LoadingStateType } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Used by ActionContextState to denote what state the action is in.\n */\nexport enum DbxActionState {\n /**\n * No action in progress. Waiting for the trigger.\n */\n IDLE = 'idle',\n /**\n * Idle state that can be set to show that the source is not yet ready.\n */\n DISABLED = 'disabled',\n /**\n * The action was triggered. We wait (and allow) the value to be updated.\n */\n TRIGGERED = 'triggered',\n /**\n * The trigger was accepted and the value is updated. It should begin working immediately.\n *\n * ValueReady cannot be set until triggered is set.\n */\n VALUE_READY = 'valueReady',\n /**\n * The action is in progress.\n */\n WORKING = 'working',\n /**\n * The trigger, action, or value was rejected due to an error or other issue.\n *\n * An error may be specified optionally.\n */\n REJECTED = 'rejected',\n /**\n * The action resolved without issue.\n */\n RESOLVED = 'resolved'\n}\n\n/**\n * Contains the input value and the output result from a DbxAction.\n */\nexport interface DbxActionSuccessPair<T, O> {\n readonly value: T;\n readonly result: Maybe<O>;\n}\n\n/**\n * Contains the input value and the output error from a DbxAction.\n */\nexport interface DbxActionRejectedPair<T> {\n readonly value: T;\n readonly error: unknown;\n}\n\n/**\n * Unique key for disabling/enabling.\n */\nexport type DbxActionDisabledKey = string;\n\nexport const DEFAULT_ACTION_DISABLED_KEY = 'dbx_action_disabled';\n\nexport function isIdleActionState(actionState: DbxActionState): boolean {\n switch (actionState) {\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n case DbxActionState.REJECTED:\n case DbxActionState.RESOLVED:\n return true;\n default:\n return false;\n }\n}\n\nexport function loadingStateTypeForActionState(actionState: DbxActionState): LoadingStateType {\n let loadingStateType: LoadingStateType;\n\n switch (actionState) {\n case DbxActionState.RESOLVED:\n loadingStateType = LoadingStateType.SUCCESS;\n break;\n case DbxActionState.REJECTED:\n loadingStateType = LoadingStateType.ERROR;\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingStateType = LoadingStateType.IDLE;\n break;\n default:\n loadingStateType = LoadingStateType.LOADING;\n break;\n }\n\n return loadingStateType;\n}\n","import { Injectable, OnDestroy } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Observable, distinctUntilChanged, filter, map, shareReplay, switchMap, startWith } from 'rxjs';\nimport { BooleanStringKeyArray, BooleanStringKeyArrayUtility, Maybe, ReadableError } from '@dereekb/util';\nimport { LoadingStateType, idleLoadingState, errorResult, filterMaybe, LoadingState, LockSet, scanCount, successResult, beginLoading } from '@dereekb/rxjs';\nimport { DbxActionDisabledKey, DbxActionRejectedPair, DbxActionState, DbxActionSuccessPair, DEFAULT_ACTION_DISABLED_KEY, isIdleActionState, loadingStateTypeForActionState } from './action';\n\nexport function isActionContextEnabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isFalse(state.disabled);\n}\n\nexport function isActionContextDisabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isTrue(state.disabled);\n}\n\nexport function isDisabledActionContextState(state: ActionContextState): boolean {\n return isIdleActionState(state.actionState) && isActionContextDisabled(state);\n}\n\nexport function isWorkingActionState(actionState: DbxActionState): boolean {\n return !isIdleActionState(actionState);\n}\n\nexport function canTriggerActionState(actionState: DbxActionState): boolean {\n return actionState !== DbxActionState.DISABLED && isIdleActionState(actionState);\n}\n\nexport function canTriggerAction(state: ActionContextState): boolean {\n return isActionContextEnabled(state) && isIdleActionState(state.actionState);\n}\n\nexport function canReadyValue(state: ActionContextState): boolean {\n return state.actionState === DbxActionState.TRIGGERED;\n}\n\nexport function actionContextIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n // console.log('check: ', state, state.isModified, canTriggerAction(state));\n return state.isModified && canTriggerAction(state);\n}\n\nexport function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n return !state.error && actionContextIsModifiedAndCanTrigger(state);\n}\n\nexport function loadingStateForActionContextState<O = unknown>(state: ActionContextState<unknown, O>): LoadingState<O> {\n let loadingState: LoadingState<O>;\n\n switch (state.actionState) {\n case DbxActionState.RESOLVED:\n loadingState = successResult(state.result);\n break;\n case DbxActionState.REJECTED:\n loadingState = errorResult(state.error);\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingState = idleLoadingState();\n break;\n default:\n loadingState = beginLoading();\n break;\n }\n\n return loadingState;\n}\n\nexport function loadingStateTypeForActionContextState(state: ActionContextState): LoadingStateType {\n return loadingStateTypeForActionState(state.actionState);\n}\n\nexport interface ActionContextState<T = unknown, O = unknown> {\n actionState: DbxActionState;\n isModified: boolean;\n /**\n * Value that is set after a triggered action. Not to be confused with result.\n */\n value?: Maybe<T>;\n /**\n * Resolved result value.\n */\n result?: Maybe<O>;\n /**\n * Rejected error, if available.\n */\n error?: Maybe<ReadableError>;\n /**\n * Current disabled state.\n */\n disabled?: BooleanStringKeyArray;\n /**\n * Number of consecutive errors that have occured.\n */\n errorCount?: number;\n}\n\nconst INITIAL_STATE: ActionContextState = {\n isModified: false,\n actionState: DbxActionState.IDLE\n};\n\n@Injectable()\nexport class ActionContextStore<T = unknown, O = unknown> extends ComponentStore<ActionContextState<T, O>> implements OnDestroy {\n readonly lockSet = new LockSet();\n\n constructor() {\n super({ ...INITIAL_STATE } as ActionContextState<T, O>);\n this.lockSet.addLock('working', this.isWorking$);\n }\n\n // MARK: Accessors\n readonly actionState$ = this.state$.pipe(\n map((x) => (isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState)),\n shareReplay(1)\n );\n\n /**\n * Returns the current disabled reasons/keys.\n */\n readonly disabledKeys$ = this.state$.pipe(\n map((x) => [...(x.disabled ?? [])]),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Current value of the state.\n */\n readonly currentValue$: Observable<Maybe<T>> = this.state$.pipe(map((x) => x.value));\n\n /**\n * Maps the current state to true or not when the action state changes to/from disabled.\n */\n readonly isDisabled$ = this.state$.pipe(map(isDisabledActionContextState), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipes when idle but modified.\n */\n readonly isModified$ = this.afterDistinctBoolean((x) => x.isModified);\n\n /**\n * Pipes true when triggered.\n */\n readonly triggered$ = this.afterDistinctActionState(DbxActionState.TRIGGERED, () => true);\n\n /**\n * Pipes the readied value on ValueReady.\n */\n readonly valueReady$: Observable<T> = this.afterDistinctActionState(DbxActionState.VALUE_READY, (x) => x.value as T);\n\n /**\n * Pipes the error on the rejection state.\n */\n readonly rejected$ = this.afterDistinctActionState(DbxActionState.REJECTED, (x) => x.error);\n\n /**\n * Pipes the result when the ActionState becomes rejected.\n */\n readonly rejectedPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, error: x.error } as DbxActionRejectedPair<T>));\n\n /**\n * Pipes the result when the ActionState becomes working.\n */\n readonly working$ = this.afterDistinctActionState(DbxActionState.WORKING, () => true);\n\n /**\n * Whether or not it is currently in a working state.\n */\n readonly isWorking$ = this.afterDistinctBoolean((x) => isWorkingActionState(x.actionState));\n\n /**\n * Pipes the current error.\n */\n readonly error$ = this.state$.pipe(\n map((x) => x.error),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly success$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => x.result);\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly successPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, result: x.result } as DbxActionSuccessPair<T, O>));\n\n /**\n * Whether or not it is currently in a success state.\n */\n readonly isSuccess$ = this.afterDistinctBoolean((x) => x.actionState === DbxActionState.RESOLVED);\n\n /**\n * Returns a loading state based on the current state.\n */\n readonly loadingState$ = this.afterDistinctLoadingStateTypeChange().pipe(\n map((x) => loadingStateForActionContextState<O>(x)),\n shareReplay(1)\n );\n\n /**\n * Returns the current LoadingStateType based on the current state.\n */\n readonly loadingStateType$ = this.state$.pipe(\n map((x) => loadingStateTypeForActionContextState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Number of errors since last success.\n */\n readonly errorCountSinceLastSuccess$ = this.isSuccess$.pipe(\n startWith(false),\n distinctUntilChanged(),\n switchMap(() => this.error$.pipe(filterMaybe(), scanCount(), startWith(0))),\n shareReplay(1)\n );\n\n /**\n * Whether or not the state can be triggered.\n */\n readonly canTrigger$ = this.state$.pipe(map(canTriggerAction), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipe that maps whether or not this is modified and can be triggered.\n *\n * Updates every state update instead of when the value changes.\n */\n readonly isModifiedAndCanTriggerUpdates$ = this.state$.pipe(map((x) => actionContextIsModifiedAndCanTrigger(x), shareReplay(1)));\n\n /**\n * Whether or not it can be triggered and modified.\n */\n readonly isModifiedAndCanTrigger$ = this.isModifiedAndCanTriggerUpdates$.pipe(distinctUntilChanged());\n\n readonly hasNoErrorAndIsModifiedAndCanTrigger$ = this.state$.pipe(\n map((x) => actionContextHasNoErrorAndIsModifiedAndCanTrigger(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n /**\n * Adds a disabled reason.\n */\n readonly disable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.insert(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Removes a disabled reason.\n */\n readonly enable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.remove(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Triggers the modified state, if not disabled.\n */\n readonly setIsModified = this.updater((state, isModified: void | boolean) => ({\n ...state,\n actionState: state.actionState === DbxActionState.RESOLVED ? DbxActionState.IDLE : state.actionState, // Set to idle from success.\n isModified: (isModified as boolean) ?? true\n }));\n\n /**\n * Triggers the action if the state is currently not idle. The current state is cleared, but the error is retained (as we may need the error from the previous attempt).\n *\n * Will not fire if the action is disabled.\n */\n readonly trigger = this.updater((state) => (canTriggerAction(state) ? { isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined } : state));\n\n /**\n * Updates the value, setting value ready. The current result is cleared.\n */\n readonly readyValue = this.updater((state, value: T) => (canReadyValue(state) ? { ...state, actionState: DbxActionState.VALUE_READY, value, result: undefined } : state));\n\n /**\n * Notifys the context that the action is in progress.\n */\n readonly startWorking = this.updater((state) => ({ ...state, actionState: DbxActionState.WORKING }));\n\n /**\n * Triggers rejection of the action. The value is cleared.\n */\n readonly reject = this.updater((state, error?: Maybe<ReadableError>) => ({\n isModified: state.isModified,\n actionState: DbxActionState.REJECTED,\n error,\n errorCount: (state.errorCount ?? 0) + 1,\n disabled: state.disabled\n }));\n\n /**\n * Updates the state to success, and optionally sets a result.\n *\n * Clears modified state, and any errors.\n */\n readonly resolve = this.updater((state, result?: Maybe<O>) => ({ isModified: false, actionState: DbxActionState.RESOLVED, value: state.value, result, error: undefined, disabled: state.disabled }));\n\n /**\n * Completely resets the store.\n */\n readonly reset = this.updater(() => ({ ...INITIAL_STATE } as ActionContextState<T, O>));\n\n // MARK: Utility\n afterDistinctBoolean(fromState: (state: ActionContextState<T, O>) => boolean): Observable<boolean> {\n return this.state$.pipe(\n map((x) => fromState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n afterDistinctActionState<X>(actionState: DbxActionState, fromState: (state: ActionContextState<T, O>) => X): Observable<X> {\n return this.afterDistinctActionStateChange().pipe(\n filter((x) => x.actionState === actionState), // Only pipe when the new action state matches.\n map((x) => fromState(x)),\n shareReplay(1)\n );\n }\n\n afterDistinctActionStateChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, x.actionState] as [ActionContextState, DbxActionState]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n afterDistinctLoadingStateTypeChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, loadingStateTypeForActionContextState(x)] as [ActionContextState, LoadingStateType]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the loading state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n }, 2000);\n }\n}\n","import { Observable, of } from 'rxjs';\nimport { Destroyable, Maybe } from '@dereekb/util';\nimport { LockSet } from '@dereekb/rxjs';\nimport { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { ActionContextStore } from './action.store';\nimport { DbxActionDisabledKey } from './action';\n\n/**\n * Abstract class that can either use SecondaryActionContextStoreSource or create it's own.\n */\nexport abstract class DbxActionContextBaseSource<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n private readonly _inputSource: Maybe<SecondaryActionContextStoreSource<T, O>>;\n\n private readonly _store?: ActionContextStore<T, O>;\n private readonly _store$: Observable<ActionContextStore<T, O>>;\n private readonly _instance: DbxActionContextStoreSourceInstance<T, O>;\n\n readonly isModified$: Observable<boolean>;\n readonly triggered$: Observable<boolean>;\n readonly success$: Observable<Maybe<O>>;\n\n constructor(inputSource?: Maybe<SecondaryActionContextStoreSource<T, O>>) {\n this._inputSource = inputSource;\n\n if (inputSource) {\n this._store$ = inputSource.store$;\n } else {\n this._store = new ActionContextStore();\n this._store$ = of(this._store);\n }\n\n this._instance = new DbxActionContextStoreSourceInstance(this);\n this.isModified$ = this._instance.isModified$;\n this.triggered$ = this._instance.triggered$;\n this.success$ = this._instance.success$;\n }\n\n destroy(): void {\n if (this._store) {\n this._store.ngOnDestroy();\n this._instance.destroy();\n }\n }\n\n get inputSource() {\n return this._inputSource;\n }\n\n get lockSet(): LockSet {\n return this._instance.lockSet;\n }\n\n get sourceInstance(): DbxActionContextStoreSourceInstance<T, O> {\n return this._instance;\n }\n\n get store$(): Observable<ActionContextStore<T, O>> {\n return this._store$;\n }\n\n /**\n * Use to trigger the action directly.\n */\n public trigger(): void {\n this._instance.trigger();\n }\n\n public readyValue(value: T | Observable<T>): void {\n this._instance.readyValue(value);\n }\n\n /**\n * Triggers the context and then readies the value.\n * @param value\n */\n public triggerWithValue(value: T | Observable<T>): void {\n this._instance.triggerWithValue(value);\n }\n\n public reset(): void {\n this._instance.reset();\n }\n\n public enable(key?: DbxActionDisabledKey, enable?: boolean): void {\n this._instance.enable(key, enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable?: boolean): void {\n this._instance.disable(key, disable);\n }\n\n public setIsModified(isModified?: boolean): void {\n this._instance.setIsModified(isModified);\n }\n}\n","import { DbxActionContextSourceReference } from './action.reference';\nimport { delay, first } from 'rxjs';\nimport { ActionContextStoreSource } from './action.store.source';\nimport { DbxActionWorkInstanceDelegate } from './action.handler';\nimport { DbxActionContextBaseSource } from './action.holder';\nimport { Destroyable, Maybe } from '@dereekb/util';\nimport { SubscriptionObject, Work, workFactory } from '@dereekb/rxjs';\nimport { Injectable, OnDestroy } from '@angular/core';\n\n/**\n * DbxActionContextMachine configuration.\n */\nexport interface DbxActionContextMachineConfig<T = unknown, O = unknown> {\n /**\n * Whether or not the machine should clean itself up after being triggered once.\n */\n oneTimeUse: boolean;\n /**\n * Function to handle any valueReady events.\n *\n * If false, will not subscribe/handle valueReady$ events.\n */\n handleValueReady: Work<T, O> | false;\n /**\n * Optional function to execute after the action has succeeded.\n */\n onSuccess?: (value: Maybe<O>) => void;\n}\n\n/**\n * Configurable machine that handles components of the ActionContextStore lifecycle.\n *\n * It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.\n */\nexport class DbxActionContextMachine<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> implements DbxActionContextSourceReference<T, O>, Destroyable {\n private _isShutdown = true;\n private readonly _config: DbxActionContextMachineConfig<T, O>;\n private readonly _handleValueReadySub = new SubscriptionObject();\n private readonly _successSub = new SubscriptionObject();\n\n constructor(config: DbxActionContextMachineConfig<T, O>, source?: ActionContextStoreSource<T, O>) {\n super(source);\n this._config = config;\n\n // Handle Value Ready\n if (config.handleValueReady !== false) {\n this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {\n const doWork = workFactory({\n work: config.handleValueReady as Work<T, O>,\n delegate: new DbxActionWorkInstanceDelegate<T, O>(this.sourceInstance)\n });\n\n doWork(value);\n });\n }\n\n // If this is a one-time use, then destroy it after the first success comes through.\n if (config.oneTimeUse) {\n this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {\n this.destroy();\n });\n }\n\n if (config.onSuccess) {\n this._successSub.subscription = this.sourceInstance.success$.subscribe(config.onSuccess);\n }\n }\n\n override destroy(): void {\n super.destroy();\n this._handleValueReadySub.destroy();\n this._successSub.destroy();\n this._isShutdown = true;\n }\n\n get config() {\n return this._config;\n }\n\n get isShutdown(): boolean {\n return this._isShutdown;\n }\n}\n\n/**\n * DbxActionContextMachine that implements OnDestroy and is configured for use as a Service/Injectable.\n */\n@Injectable()\nexport class DbxActionContextMachineAsService<T = unknown, O = unknown> extends DbxActionContextMachine<T, O> implements OnDestroy {\n constructor() {\n super({\n oneTimeUse: false,\n handleValueReady: false\n });\n }\n\n ngOnDestroy(): void {\n this.destroy();\n }\n}\n","import { forwardRef, Provider, Type } from '@angular/core';\nimport { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { DbxActionContextMachineAsService } from './action.machine';\n\nexport const actionContextStoreSourceInstanceFactory = (source: ActionContextStoreSource) => {\n return new DbxActionContextStoreSourceInstance(source);\n};\n\nexport const actionContextStoreSourceMachineFactory = () => {\n return new DbxActionContextMachineAsService();\n};\n\n/**\n * Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.\n */\nexport function provideActionStoreSource<S extends ActionContextStoreSource>(sourceType: Type<S> | null): Provider[] {\n const storeSourceProvider: Provider =\n sourceType != null\n ? {\n provide: ActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n }\n : {\n provide: ActionContextStoreSource,\n useFactory: actionContextStoreSourceMachineFactory\n };\n\n return [\n storeSourceProvider,\n {\n provide: DbxActionContextStoreSourceInstance,\n useFactory: actionContextStoreSourceInstanceFactory,\n deps: [ActionContextStoreSource]\n }\n ];\n}\n\nexport function provideSecondaryActionStoreSource<S extends SecondaryActionContextStoreSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: SecondaryActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideActionStoreSource(sourceType)\n ];\n}\n","import { Directive, OnDestroy, inject } from '@angular/core';\nimport { SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideActionStoreSource } from '../../action.store.source.provide';\nimport { DbxActionContextBaseSource } from '../../action.holder';\n\n/**\n * Provides an DbxActionContext.\n */\n@Directive({\n selector: 'dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]',\n exportAs: 'action,dbxAction',\n providers: provideActionStoreSource(DbxActionDirective)\n})\nexport class DbxActionDirective<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> implements OnDestroy {\n constructor() {\n super(inject(SecondaryActionContextStoreSource<T, O>, { optional: true, host: true }));\n }\n\n ngOnDestroy(): void {\n this.lockSet.destroyOnNextUnlock(() => {\n this.destroy();\n });\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, switchMap } from 'rxjs';\nimport { SecondaryActionContextStoreSource, ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\n\n/**\n * Directive that provides a DbxActionSourceDirective that is passed in.\n */\n@Directive({\n selector: '[dbxActionSource]',\n providers: provideSecondaryActionStoreSource(DbxActionSourceDirective)\n})\nexport class DbxActionSourceDirective implements SecondaryActionContextStoreSource, OnDestroy {\n private _source = new BehaviorSubject<Maybe<ActionContextStoreSource>>(undefined);\n readonly store$ = this._source.pipe(\n filterMaybe(),\n switchMap((x) => actionContextStoreSourcePipe(x.store$))\n );\n\n ngOnDestroy(): void {\n this._source.complete();\n }\n\n @Input('dbxActionSource')\n get source(): Maybe<ActionContextStoreSource> {\n return this._source.value;\n }\n\n set source(source: Maybe<ActionContextStoreSource>) {\n if (source && !source.store$) {\n throw new Error('Invalid source passed to dbxActionSource.');\n }\n\n this._source.next(source);\n }\n}\n","import { Directive, OnInit, inject } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Prints out the current state to the console. Useful for debugging.\n */\n@Directive({\n selector: '[dbxActionLogger],[dbxActionContextLogger]'\n})\nexport class DbxActionContextLoggerDirective extends AbstractSubscriptionDirective implements OnInit {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n ngOnInit(): void {\n this.sub = this.source.state$.subscribe((state) => {\n console.log('dbxActionLogger - state: ', state);\n });\n }\n}\n","import { reduceBooleansWithOrFn } from '@dereekb/util';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, Observable, of, distinctUntilChanged, map, shareReplay, switchMap } from 'rxjs';\nimport { combineLatestFromMapValuesObsFn } from '@dereekb/rxjs';\nimport { ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { ActionContextStore } from '../../action.store';\nimport { ActionContextStoreSourceMap, ActionKey } from './action.map';\n\n/**\n * Context used for providing actions based on the action key.\n *\n * This is useful for passing action contexts around via the providers instead of explicit injection.\n */\n@Directive({\n selector: '[dbxActionContextMap]',\n exportAs: 'actionMap',\n providers: []\n})\nexport class DbxActionContextMapDirective implements ActionContextStoreSourceMap, OnDestroy {\n private readonly _map = new BehaviorSubject<Map<ActionKey, ActionContextStoreSource>>(new Map());\n readonly map$ = this._map.asObservable();\n\n readonly areAnyWorking$ = this.checkAnyAre((x) => x.isWorking$, false);\n\n get map(): Map<ActionKey, ActionContextStoreSource> {\n return this._map.value;\n }\n\n sourceForKey(key: ActionKey): ActionContextStoreSource<unknown, unknown> {\n return new DbxActionContextMapDirectiveSourceInstance(this, key);\n }\n\n addStoreSource(key: ActionKey, source: ActionContextStoreSource): void {\n if (this.map.has(key)) {\n throw new Error(`Key already existed for \"${key}\" in map. Ensure the previous store is removed before setting another.`);\n } else if (!source) {\n throw new Error('addStoreSource requires a source.');\n }\n\n this.map.set(key, source);\n this._map.next(this.map);\n }\n\n removeStore(key: ActionKey): void {\n if (!this.map.delete(key)) {\n console.warn('removeStore called and no value was found.');\n }\n\n this._map.next(this.map);\n }\n\n ngOnDestroy(): void {\n this._map.complete();\n }\n\n // MARK: Utility\n checkAnyAre(mapFn: (input: ActionContextStore) => Observable<boolean>, emptyArrayValue = false): Observable<boolean> {\n return this.reduceFromAllSources(mapFn, reduceBooleansWithOrFn(emptyArrayValue));\n }\n\n reduceFromAllSources<O, R>(mapFn: (input: ActionContextStore) => Observable<O>, reduceFn: (values: O[]) => R): Observable<R> {\n return this.fromAllSources<O>(mapFn).pipe(map(reduceFn));\n }\n\n fromAllSources<O>(mapFn: (input: ActionContextStore) => Observable<O>): Observable<O[]> {\n return this.map$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));\n }\n}\n\nexport class DbxActionContextMapDirectiveSourceInstance implements ActionContextStoreSource {\n private readonly _parent: DbxActionContextMapDirective;\n private readonly _key: ActionKey;\n\n readonly store$: Observable<ActionContextStore>;\n\n constructor(parent: DbxActionContextMapDirective, key: ActionKey) {\n this._parent = parent;\n this._key = key;\n\n const _source$ = parent.map$.pipe(\n map((x) => x.get(key)),\n distinctUntilChanged()\n );\n\n const _store$ = _source$.pipe(\n switchMap((x) => x?.store$ ?? of(undefined)),\n shareReplay(1)\n );\n\n this.store$ = actionContextStoreSourcePipe(_store$);\n }\n\n get parent() {\n return this._parent;\n }\n\n get key() {\n return this._key;\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, switchMap } from 'rxjs';\nimport { ActionKey } from './action.map';\nimport { SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\n\n/**\n * Directive that provides a ActionContextStoreSource using the input key and DbxActionContextMapDirective.\n */\n@Directive({\n selector: '[dbxActionFromMap]',\n providers: provideSecondaryActionStoreSource(DbxActionFromMapDirective)\n})\nexport class DbxActionFromMapDirective implements SecondaryActionContextStoreSource, OnDestroy {\n private readonly _map = inject(DbxActionContextMapDirective);\n private readonly _key = new BehaviorSubject<Maybe<ActionKey>>(undefined);\n\n readonly store$ = this._key.pipe(\n filterMaybe(),\n switchMap((x) => this._map.sourceForKey(x).store$)\n );\n\n ngOnDestroy(): void {\n this._key.complete();\n }\n\n @Input('dbxActionFromMap')\n get key(): Maybe<ActionKey> {\n return this._key.value;\n }\n\n set key(key: Maybe<ActionKey>) {\n this._key.next(key);\n }\n}\n","import { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { ActionContextStoreSource } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { ActionKey } from './action.map';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to the store based on the key.\n */\n@Directive({\n selector: '[dbxActionMapSource]'\n})\nexport class DbxActionMapSourceDirective implements OnDestroy {\n private readonly _map = inject(DbxActionContextMapDirective);\n readonly source = inject(ActionContextStoreSource, { host: true });\n\n private _key: Maybe<ActionKey>;\n\n ngOnDestroy(): void {\n this._removeFromToStore();\n }\n\n @Input('dbxActionMapSource')\n set key(key: ActionKey) {\n if (this._key !== key) {\n this._removeFromToStore();\n }\n\n this._key = key;\n this._addToStore();\n }\n\n private _addToStore(): void {\n if (this._key) {\n this._map.addStoreSource(this._key, this.source);\n }\n }\n\n private _removeFromToStore(): void {\n if (this._key) {\n this._map.removeStore(this._key);\n }\n }\n}\n","import { ActionContextStoreSource } from '../../action.store.source';\n\nexport type ActionKey = string;\n\n/**\n * Map that returns sources for ActionKey values.\n */\nexport abstract class ActionContextStoreSourceMap<T = unknown, O = unknown> {\n /**\n * Returns a ActionContextStoreSource for the input action key.\n *\n * @param key Action key to retrieve the source for.\n */\n abstract sourceForKey(key: ActionKey): ActionContextStoreSource<T, O>;\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { DbxActionDisabledKey } from '../../action';\n\nexport const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = 'action_map_working_disable';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to be disabled if any other element in the map is working.\n */\n@Directive({\n selector: '[dbxActionMapWorkingDisable]'\n})\nexport class DbxActionMapWorkingDisableDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n private readonly _map = inject(DbxActionContextMapDirective);\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n @Input('dbxActionMapWorkingDisable')\n disabledKey: Maybe<DbxActionDisabledKey>;\n\n ngOnInit(): void {\n this.sub = this._map.areAnyWorking$.subscribe((x) => {\n this.source.disable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, x);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this.source.enable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);\n }\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, distinctUntilChanged } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_DISABLED_DIRECTIVE_KEY = 'dbx_action_disabled';\n\n/**\n * Directive that allows disabling an action using the inputs.\n */\n@Directive({\n selector: '[dbxActionDisabled]'\n})\nexport class DbxActionDisabledDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _disabled = new BehaviorSubject<boolean>(false);\n readonly disabled$ = this._disabled.pipe(distinctUntilChanged());\n\n ngOnInit(): void {\n this.sub = this.disabled$.subscribe((x) => {\n this.source.disable(APP_ACTION_DISABLED_DIRECTIVE_KEY, x);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disabled.complete();\n this.source.enable(APP_ACTION_DISABLED_DIRECTIVE_KEY);\n }\n\n @Input('dbxActionDisabled')\n get disabled(): boolean {\n return this._disabled.value;\n }\n\n set disabled(disabled: Maybe<boolean | ''>) {\n this._disabled.next(disabled !== false);\n }\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, distinctUntilChanged, combineLatest } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY = 'dbx_action_disabled_on_success';\n\n/**\n * Directive that will disable the action after the action completes successfully.\n */\n@Directive({\n selector: '[dbxActionDisabledOnSuccess]'\n})\nexport class DbxActionDisabledOnSuccessDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _disableOnSuccess = new BehaviorSubject<boolean>(true);\n readonly disableOnSuccess$ = this._disableOnSuccess.pipe(distinctUntilChanged());\n\n ngOnInit(): void {\n this.sub = combineLatest([this.disableOnSuccess$, this.source.isSuccess$]).subscribe(([disableOnSuccess, success]) => {\n this.source.disable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY, disableOnSuccess && success);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disableOnSuccess.complete();\n this.source.enable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY);\n }\n\n @Input('dbxActionDisabledOnSuccess')\n get disabled(): boolean {\n return this._disableOnSuccess.value;\n }\n\n set disabled(disabled: Maybe<boolean | ''>) {\n this._disableOnSuccess.next(disabled !== false);\n }\n}\n","import { map, shareReplay, switchMap, tap, BehaviorSubject, combineLatest } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionWorkInstanceDelegate } from '../../action.handler';\nimport { Maybe, Destroyable, Initialized, GetterOrValue, asGetter, FactoryWithInput } from '@dereekb/util';\nimport { filterMaybe, SubscriptionObject, Work, workFactory } from '@dereekb/rxjs';\n\nexport const DBX_ACTION_HANDLER_LOCK_KEY = 'dbxActionHandler';\n\n/**\n * Context used for defining a function that performs an action using the input function to handle valueReady$ events from an action context.\n */\nexport class DbxActionHandlerInstance<T = unknown, O = unknown> implements Initialized, Destroyable {\n private readonly _delegate: DbxActionWorkInstanceDelegate<T, O>;\n\n private readonly _sub = new SubscriptionObject();\n private readonly _handlerFunction = new BehaviorSubject<Maybe<Work<T, O>>>(undefined);\n private readonly _handlerValue = new BehaviorSubject<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>(undefined);\n\n readonly handlerFunction$ = combineLatest([this._handlerValue, this._handlerFunction]).pipe(\n map(([handlerValue, handlerFunction]) => {\n let work: Maybe<Work<T, O>>;\n\n if (handlerFunction != null) {\n work = handlerFunction;\n } else if (handlerValue !== undefined) {\n const getter = asGetter(handlerValue) as FactoryWithInput<O, T>;\n\n work = (x, c) => {\n c.performTaskWithReturnValue(() => getter(x));\n };\n }\n\n return work;\n }),\n filterMaybe(),\n shareReplay(1)\n );\n\n get handlerFunction(): Maybe<Work<T, O>> {\n return this._handlerFunction.value;\n }\n\n set handlerFunction(handlerFunction: Maybe<Work<T, O>>) {\n this._handlerFunction.next(handlerFunction);\n }\n\n get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>> {\n return this._handlerValue.value;\n }\n\n set handlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>) {\n this._handlerValue.next(handlerValue);\n }\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._delegate = new DbxActionWorkInstanceDelegate<T, O>(source);\n }\n\n get source(): DbxActionContextStoreSourceInstance<T, O> {\n return this._delegate.source;\n }\n\n init(): void {\n this._sub.subscription = this.handlerFunction$\n .pipe(\n switchMap((work) =>\n this.source.valueReady$.pipe(\n tap((value) => {\n const context = workFactory({ work, delegate: this._delegate })(value);\n\n if (context) {\n // Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.\n this.source.lockSet.addLock(DBX_ACTION_HANDLER_LOCK_KEY, context.isComplete$.pipe(map((x) => !x)));\n }\n })\n )\n )\n )\n .subscribe();\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._sub.destroy();\n this._handlerFunction.complete();\n });\n }\n}\n","import { Directive, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { FactoryWithInput, GetterOrValue, Maybe } from '@dereekb/util';\nimport { DbxActionHandlerInstance } from './action.handler.instance';\nimport { Work } from '@dereekb/rxjs';\n\n/**\n * Abstract directive that wraps and handles a DbxActionHandlerInstance lifecycle.\n */\n@Directive()\nexport abstract class AbstractDbxActionHandlerDirective<T = unknown, O = unknown> implements OnInit, OnDestroy {\n readonly source: DbxActionContextStoreSourceInstance<T, O> = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n protected _dbxActionHandlerInstance = new DbxActionHandlerInstance<T, O>(this.source);\n\n ngOnInit(): void {\n this._dbxActionHandlerInstance.init();\n }\n\n ngOnDestroy(): void {\n this._dbxActionHandlerInstance.destroy();\n }\n}\n\n/**\n * Directive that wraps and controls a DbxActionHandlerInstance.\n */\n@Directive({\n selector: '[dbxActionHandler]'\n})\nexport class DbxActionHandlerDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n @Input('dbxActionHandler')\n get handlerFunction(): Maybe<Work<T, O>> {\n return this._dbxActionHandlerInstance.handlerFunction;\n }\n\n set handlerFunction(handlerFunction: Maybe<Work<T, O>>) {\n this._dbxActionHandlerInstance.handlerFunction = handlerFunction;\n }\n}\n\n/**\n * Directive that passes\n */\n@Directive({\n selector: '[dbxActionHandlerValue]'\n})\nexport class DbxActionHandlerValueDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n @Input('dbxActionHandlerValue')\n get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>> {\n return this._dbxActionHandlerInstance.handlerValue;\n }\n\n set handlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>) {\n this._dbxActionHandlerInstance.handlerValue = handlerValue;\n }\n\n override ngOnInit(): void {\n super.ngOnInit();\n\n if (this.handlerValue === undefined) {\n this.handlerValue = null; // pass a default null value\n }\n }\n}\n","import { Directive, OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { distinctUntilChanged, Observable } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../subscription';\n\n/**\n * Abstract directive class that watches a show$ observable and behaves like *ngIf.\n */\n@Directive()\nexport abstract class AbstractIfDirective extends AbstractSubscriptionDirective implements OnInit {\n private readonly _templateRef = inject(TemplateRef<unknown>);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n /**\n * Observable that is watched for showing/hiding.\n */\n abstract readonly show$: Observable<boolean>;\n\n ngOnInit() {\n this.sub = this.show$.pipe(distinctUntilChanged()).subscribe((show) => {\n if (show) {\n this._viewContainer.createEmbeddedView(this._templateRef);\n } else {\n this._viewContainer.clear();\n }\n });\n }\n}\n","import { Input, Directive, inject } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Structural directive that displays the content before the store has success.\n *\n * Can be configured to hide for a temporary period.\n */\n@Directive({\n selector: '[dbxActionPreSuccess]'\n})\nexport class DbxActionPreSuccessDirective extends AbstractIfDirective {\n @Input('dbxActionPreSuccess')\n hideFor?: Maybe<number> | '';\n\n readonly show$ = inject(DbxActionContextStoreSourceInstance).isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(false, true, this.hideFor || undefined);\n } else {\n return of(true);\n }\n }),\n shareReplay(1)\n );\n}\n","import { OnDestroy, Input, Directive, inject } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Structural directive that displays the content when the store has a success value.\n *\n * Can be configured to show for a temporary period.\n */\n@Directive({\n selector: '[dbxActionHasSuccess]'\n})\nexport class DbxActionHasSuccessDirective extends AbstractIfDirective implements OnDestroy {\n @Input('dbxActionHasSuccess')\n hideAfter?: Maybe<number> | '';\n\n readonly show$ = inject(DbxActionContextStoreSourceInstance).isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(true, false, this.hideAfter || undefined);\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { map, tap, shareReplay, switchMap, BehaviorSubject } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Performs the action on success.\n */\nexport type DbxActionSuccessHandlerFunction<O = unknown> = (value: O) => void;\n\n/**\n * Directive that executes a function on ActionContextStore Success.\n */\n@Directive({\n selector: '[dbxActionSuccessHandler]'\n})\nexport class DbxActionSuccessHandlerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _successFunction = new BehaviorSubject<Maybe<DbxActionSuccessHandlerFunction<O>>>(undefined);\n readonly successFunction$ = this._successFunction.pipe(filterMaybe(), shareReplay(1));\n\n ngOnInit(): void {\n this.sub = this.successFunction$\n .pipe(\n switchMap((successFunction) =>\n this.source.success$.pipe(\n map((x) => [successFunction, x] as [DbxActionSuccessHandlerFunction<O>, O]),\n tap(([successFn, result]) => {\n successFn(result);\n })\n )\n )\n )\n .subscribe();\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._successFunction.complete();\n }\n\n @Input('dbxActionSuccessHandler')\n get successFunction(): Maybe<DbxActionSuccessHandlerFunction<O>> {\n return this._successFunction.value;\n }\n\n set successFunction(successFunction: Maybe<DbxActionSuccessHandlerFunction<O>>) {\n this._successFunction.next(successFunction);\n }\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { getValueFromGetter, Maybe, GetterOrValue } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject, shareReplay, switchMap, tap } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Directive that provides a default value when triggered.\n *\n * No value is required, allowing the directive to automatically call readyValue.\n */\n@Directive({\n selector: '[dbxActionValue]'\n})\nexport class DbxActionValueDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _valueOrFunction = new BehaviorSubject<Maybe<GetterOrValue<T>>>(undefined);\n readonly valueOrFunction$ = this._valueOrFunction.pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.valueOrFunction$\n .pipe(\n switchMap((valueOrFunction) =>\n this.source.triggered$.pipe(\n tap(() => {\n const value: T = getValueFromGetter(valueOrFunction);\n this.source.readyValue(value);\n })\n )\n )\n )\n .subscribe();\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._valueOrFunction.complete();\n });\n }\n\n @Input('dbxActionValue')\n get valueOrFunction(): Maybe<GetterOrValue<T>> {\n return this._valueOrFunction.value;\n }\n\n set valueOrFunction(valueOrFunction: Maybe<GetterOrValue<T>>) {\n this._valueOrFunction.next(valueOrFunction);\n }\n}\n","import { OnDestroy, Input, Directive, inject } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Structural directive that displays the content when the store is working.\n *\n * Can specify a period in milliseconds that shows how long to show up after working for a particular number of seconds.\n */\n@Directive({\n selector: '[dbxActionIsWorking]'\n})\nexport class DbxActionIsWorkingDirective extends AbstractIfDirective implements OnDestroy {\n @Input('dbxActionIsWorking')\n showAfter?: Maybe<number> | '';\n\n readonly show$ = inject(DbxActionContextStoreSourceInstance).isWorking$.pipe(\n exhaustMap((isWorking) => {\n if (isWorking && this.showAfter) {\n return emitDelayObs(false, true, this.showAfter || undefined);\n } else {\n return of(isWorking);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, Input, OnInit, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, combineLatest, delay } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY = 'dbx_action_enforce_modified';\n\n/**\n * Directive that toggles disabling an action if the action is not marked modified.\n */\n@Directive({\n selector: '[dbxActionEnforceModified]'\n})\nexport class DbxActionEnforceModifiedDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n private readonly _enabled = new BehaviorSubject<boolean>(true);\n\n ngOnInit(): void {\n this.sub = combineLatest([this.source.isModified$, this._enabled])\n .pipe(delay(0))\n .subscribe(([modified, enableDirective]) => {\n const disable = enableDirective && !modified;\n this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._enabled.complete();\n this.source.enable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY);\n }\n\n @Input('dbxActionEnforceModified')\n get enabled(): boolean {\n return this._enabled.value;\n }\n\n set enabled(enabled: Maybe<boolean | ''>) {\n this._enabled.next(enabled !== false);\n }\n}\n","import { toReadableError, Destroyable, Initialized, Maybe, ReadableError } from '@dereekb/util';\nimport { switchMap, map, catchError, of, BehaviorSubject } from 'rxjs';\nimport { ObservableOrValue, SubscriptionObject, IsModifiedFunction, asObservable, returnIfIs, filterMaybe } from '@dereekb/rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * DbxActionValueOnTriggerInstance function. Returns an ObervableGetter that returns a value.\n */\nexport type DbxActionValueOnTriggerFunction<T> = () => ObservableOrValue<Maybe<T>>;\n\nexport interface DbxActionValueOnTriggerResult<T = unknown> {\n value?: Maybe<T>;\n reject?: Maybe<ReadableError>;\n}\n\n/**\n * DbxActionValueOnTriggerInstance configuration.\n */\nexport interface DbxActionValueOnTriggerInstanceConfig<T> {\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n readonly valueGetter?: Maybe<DbxActionValueOnTriggerFunction<T>>;\n readonly isModifiedFunction?: Maybe<IsModifiedFunction<T>>;\n}\n\n/**\n * Utility class that handles trigger events to retrieve a value.\n */\nexport class DbxActionValueOnTriggerInstance<T> implements Initialized, Destroyable {\n private _valueGetter = new BehaviorSubject<Maybe<DbxActionValueOnTriggerFunction<T>>>(undefined);\n readonly valueGetter$ = this._valueGetter.pipe(filterMaybe());\n\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n\n isModifiedFunction?: Maybe<IsModifiedFunction<T>>;\n\n private _triggeredSub = new SubscriptionObject();\n\n constructor(config: DbxActionValueOnTriggerInstanceConfig<T>) {\n this.source = config.source;\n this._valueGetter.next(config.valueGetter);\n }\n\n get valueGetter(): Maybe<DbxActionValueOnTriggerFunction<T>> {\n return this._valueGetter.value;\n }\n\n set valueGetter(valueGetter: Maybe<DbxActionValueOnTriggerFunction<T>>) {\n this._valueGetter.next(valueGetter);\n }\n\n init(): void {\n // Ready the value after the source is triggered. Do modified check one last time.\n this._triggeredSub.subscription = this.source.triggered$\n .pipe(\n switchMap(() =>\n this.valueGetter$.pipe(switchMap((valueGetter) => asObservable(valueGetter()))).pipe(\n // If the value is not null/undefined and is considered modified, then pass the value.\n switchMap((value) => returnIfIs(this.isModifiedFunction, value, false).pipe(map((value) => ({ value })))),\n // Catch unknown errors and pass them to reject.\n catchError((reject) => of({ reject: toReadableError(reject) }))\n )\n )\n )\n .subscribe((result: DbxActionValueOnTriggerResult<T>) => {\n if (result.value != null) {\n this.source.readyValue(result.value);\n } else {\n this.source.reject(result.reject);\n }\n });\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._triggeredSub.destroy();\n this._valueGetter.complete();\n });\n }\n}\n","import { Directive, ElementRef, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport { IsModifiedFunction, SubscriptionObject } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionValueOnTriggerFunction, DbxActionValueOnTriggerInstance } from './action.value.trigger.instance';\n\n/**\n * Abstract class for directives that may perform an action when trigger is called, and returns a value.\n */\n@Directive()\nexport abstract class AbstractDbxActionValueOnTriggerDirective<T> implements OnInit, OnDestroy {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, unknown>);\n\n private readonly _triggerInstance: DbxActionValueOnTriggerInstance<T> = new DbxActionValueOnTriggerInstance<T>({\n source: this.source\n });\n\n private _triggeredSub = new SubscriptionObject();\n\n get valueGetter(): Maybe<DbxActionValueOnTriggerFunction<T>> {\n return this._triggerInstance.valueGetter;\n }\n\n set valueGetter(valueGetter: Maybe<DbxActionValueOnTriggerFunction<T>>) {\n this._triggerInstance.valueGetter = valueGetter;\n }\n\n get isModifiedFunction(): Maybe<IsModifiedFunction<T>> {\n return this._triggerInstance.isModifiedFunction;\n }\n\n set isModifiedFunction(isModifiedFunction: Maybe<IsModifiedFunction<T>>) {\n this._triggerInstance.isModifiedFunction = isModifiedFunction;\n }\n\n ngOnInit(): void {\n this._triggerInstance.init();\n }\n\n ngOnDestroy(): void {\n this._triggerInstance.destroy();\n this._triggeredSub.destroy();\n }\n}\n\n/**\n * Action directive that is used to trigger/display a popover, then watches that popover for a value.\n */\n@Directive({\n exportAs: 'dbxActionValueOnTrigger',\n selector: '[dbxActionValueOnTrigger]'\n})\nexport class DbxActionValueTriggerDirective<T = object> extends AbstractDbxActionValueOnTriggerDirective<T> implements OnInit, OnDestroy {\n readonly elementRef = inject(ElementRef);\n\n @Input()\n set dbxActionValueOnTrigger(dbxActionValueTrigger: Maybe<DbxActionValueOnTriggerFunction<T>>) {\n this.valueGetter = dbxActionValueTrigger;\n }\n\n @Input()\n set dbxActionValueTriggerModified(isModifiedFunction: Maybe<IsModifiedFunction>) {\n this.isModifiedFunction = isModifiedFunction;\n }\n\n constructor() {\n super();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport {\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionDisabledDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n dbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionIsWorkingDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionPreSuccessDirective,\n DbxActionHandlerValueDirective\n} from './directive';\n\nconst declarations = [\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionHandlerValueDirective,\n DbxActionDisabledDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n dbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionPreSuccessDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionIsWorkingDirective\n];\n\n@NgModule({\n imports: [CommonModule],\n declarations,\n exports: declarations\n})\nexport class DbxCoreActionModule {}\n","import { Destroyable } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from './action.store.source';\n\n/**\n * Acts as a reference to a DbxActionContextStoreSourceInstance that can be destroyed.\n *\n * This is used in cases where the action is passed around and the context it is passed to needs to clean up.\n */\nexport interface DbxActionContextSourceReference<T = unknown, O = unknown> extends Destroyable {\n readonly sourceInstance: DbxActionContextStoreSourceInstance<T, O>;\n}\n\nexport function makeDbxActionContextSourceReference<T, O>(sourceInstance: DbxActionContextStoreSourceInstance<T, O>): DbxActionContextSourceReference<T, O> {\n return {\n sourceInstance,\n destroy: () => 0\n };\n}\n","import { ArrayOrValue, hasValueOrNotEmpty, Maybe } from '@dereekb/util';\nimport { map, Observable } from 'rxjs';\n\nexport type SegueRefRouterLink = string | ArrayOrValue<object>;\n\nexport interface SegueRefRawSegueParams {\n [key: string]: unknown;\n}\n\nexport interface SegueRefOptions<O = object> {\n /**\n * Raw parameters\n */\n refParams?: SegueRefRawSegueParams;\n\n /**\n * Custom Transition Options.\n *\n * For UIRouter, this is TransitionOptions.\n */\n refOptions?: O;\n}\n\n/**\n * Represents a segue ref\n */\nexport interface SegueRef<O = object> extends SegueRefOptions<O> {\n /**\n * Ref path value.\n */\n ref: SegueRefRouterLink;\n}\n\n/**\n * A SegueRef object or a different router link representation.\n */\nexport type SegueRefOrSegueRefRouterLink<O = object> = SegueRef<O> | SegueRefRouterLink;\n\nexport function isSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): input is SegueRef<O> {\n return typeof input === 'object' && hasValueOrNotEmpty((input as SegueRef).ref);\n}\n\nexport function asSegueRef<O = object>(input: SegueRefOrSegueRefRouterLink<O>): SegueRef<O>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>> {\n const type = typeof input;\n\n if (type === 'string') {\n return refStringToSegueRef(input as string);\n } else if (isSegueRef(input)) {\n return input as SegueRef<O>;\n } else {\n return undefined;\n }\n}\n\nexport function asSegueRefString<O = object>(input: SegueRefOrSegueRefRouterLink<O> | string): string;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string>;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string> {\n if (typeof input === 'string') {\n return input;\n } else if (isSegueRef(input)) {\n return input.ref as string;\n } else {\n throw new Error(`asSegueRefString() failed to convert the input to a string: ${input}`);\n }\n}\n\nexport function refStringToSegueRef<O = object>(ref: string, options?: SegueRefOptions<O>): SegueRef<O> {\n return { ...options, ref };\n}\n\nexport function mapRefStringObsToSegueRefObs<O = object>(obs: Observable<string>, options?: SegueRefOptions<O>): Observable<SegueRef<O>> {\n return obs.pipe(map((x) => refStringToSegueRef(x, options)));\n}\n","import { Observable } from 'rxjs';\nimport { AuthRoleSet } from '@dereekb/util';\nimport { AuthUserIdentifier, AuthUserState } from '../auth.user';\n\n/**\n * Client auth service used to retrieve info about the current state of client authentication and client roles they may have.\n */\nexport abstract class DbxAuthService {\n /**\n * Whether or not the user is logged in.\n *\n * This will only emit once the authentication has been determined, preventing issues with premature decision making.\n *\n * A user is considered logged in even if there is an anonymous user. For more detailed info, consider using authUserState$.\n */\n abstract readonly isLoggedIn$: Observable<boolean>;\n\n /**\n * Whether or not the user has finished onboarding.\n *\n * This will only emit once the onboarding status has been determined, preventing issues with premature decision making.\n */\n abstract readonly isOnboarded$: Observable<boolean>;\n\n /**\n * Emits an event every time the user logs in.\n */\n abstract readonly onLogIn$: Observable<void>;\n\n /**\n * Emits an event every time the user logs out.\n */\n abstract readonly onLogOut$: Observable<void>;\n\n /**\n * Current state of the user.\n */\n abstract readonly authUserState$: Observable<AuthUserState>;\n\n /**\n * Role set for the current user.\n */\n abstract readonly authRoles$: Observable<AuthRoleSet>;\n\n /**\n * Identifier for the current user.\n */\n abstract readonly userIdentifier$: Observable<AuthUserIdentifier>;\n\n /**\n * Performs the logout action.\n */\n abstract logOut(): Promise<void>;\n}\n","import { TransitionHookFn, Transition, HookResult, StateService, UIInjector, TransitionOptions, RawParams } from '@uirouter/core';\nimport { catchError, map, first, firstValueFrom, Observable, of, switchMap } from 'rxjs';\nimport { asSegueRef, asSegueRefString, SegueRefOrSegueRefRouterLink } from './../../../../router/segue';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { FactoryWithRequiredInput, getValueFromGetter, isGetter, Maybe, Milliseconds } from '@dereekb/util';\nimport { Injector } from '@angular/core';\nimport { timeoutStartWith } from '@dereekb/rxjs';\n\n/**\n * authTransitionHookFn() configuration. The values are handled as:\n * - true: continue to the state.\n * - false: redirect to the login page.\n * - StateOrName: redirect to the target page instead.\n */\nexport type AuthTransitionDecision = true | false | SegueRefOrSegueRefRouterLink;\n\nexport interface AuthTransitionDecisionGetterInput {\n readonly transition: Transition;\n readonly injector: Injector;\n readonly authService: DbxAuthService;\n}\n\nexport type AuthTransitionRedirectTarget = Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\nexport type AuthTransitionRedirectTargetGetter = FactoryWithRequiredInput<AuthTransitionRedirectTarget, AuthTransitionDecisionGetterInput>;\nexport type AuthTransitionRedirectTargetOrGetter = Maybe<SegueRefOrSegueRefRouterLink> | AuthTransitionRedirectTargetGetter;\n\nexport interface AuthTransitionHookOptions {\n /**\n * The state to redirect the user to when their auth fails.\n */\n defaultRedirectTarget: string;\n\n /**\n * The state to redirect the user to. Defaults to defaultRedirectTarget.\n */\n errorRedirectTarget?: string;\n\n /**\n * Timeout time for the decision obs. Defaults to 1000ms.\n */\n timeoutTime?: Milliseconds;\n}\n\nexport interface AuthTransitionHookConfig extends AuthTransitionHookOptions {\n /**\n * Creates the decision observable for the transition that decides whether or not to redirect or continue.\n */\n makeDecisionsObs: (transition: Transition, authService: DbxAuthService, injector: UIInjector) => Observable<AuthTransitionDecision>;\n}\n\nexport interface AuthTransitionStateData {\n /**\n * Optional getter/decision maker when a role needs to be\n */\n redirectTo?: AuthTransitionRedirectTargetOrGetter;\n}\n\n/**\n * This generates a TransitionHookFn that can be used with redirecting routes.\n */\nexport function makeAuthTransitionHook(config: AuthTransitionHookConfig): TransitionHookFn {\n const { defaultRedirectTarget, errorRedirectTarget = defaultRedirectTarget, timeoutTime = 1000 } = config;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertIsAuthenticated: TransitionHookFn = (transition: Transition): HookResult => {\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const $state: StateService = transition.router.stateService;\n const decisionObs = config.makeDecisionsObs(transition, authService, injector);\n\n function redirectOut(): Observable<HookResult> {\n const stateData: AuthTransitionStateData = transition.targetState().state().data;\n const redirectTo = stateData?.redirectTo;\n\n let redirectToObs: Observable<HookResult>;\n\n if (redirectTo) {\n let resultObs: Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\n\n if (isGetter<AuthTransitionRedirectTarget>(redirectTo)) {\n resultObs = getValueFromGetter(redirectTo, { authService, injector, transition } as AuthTransitionDecisionGetterInput);\n } else {\n resultObs = of(redirectTo as SegueRefOrSegueRefRouterLink);\n }\n\n redirectToObs = resultObs.pipe(\n map((inputStateRef: Maybe<SegueRefOrSegueRefRouterLink>) => {\n const stateRef = asSegueRef(inputStateRef);\n\n let redirectTarget;\n let redirectParams;\n\n if (stateRef) {\n redirectTarget = stateRef.ref;\n redirectParams = stateRef.refParams;\n }\n\n if (!redirectTarget) {\n redirectTarget = defaultRedirectTarget;\n }\n\n return $state.target(redirectTarget, redirectParams);\n })\n );\n } else {\n redirectToObs = of($state.target(defaultRedirectTarget));\n }\n\n return redirectToObs;\n }\n\n const resultObs = decisionObs.pipe(\n // after the timeoutTime seconds of no transition working, redirect with a false decision\n timeoutStartWith(false as AuthTransitionDecision, timeoutTime),\n first(),\n switchMap((decision: AuthTransitionDecision): Observable<HookResult> => {\n if (typeof decision === 'boolean') {\n if (decision) {\n return of(true);\n } else {\n return redirectOut();\n }\n } else {\n const segueRef = asSegueRef(decision);\n return of($state.target(asSegueRefString(segueRef.ref), segueRef.refParams as RawParams, segueRef.refOptions as TransitionOptions));\n }\n }),\n catchError((x) => {\n console.warn(`Encountered error in auth transition hook. Attempting redirect to ${errorRedirectTarget}.`, x);\n return of($state.target(errorRedirectTarget, { location: true })); // Redirect to home\n })\n );\n\n return firstValueFrom(resultObs) as HookResult;\n };\n\n return assertIsAuthenticated;\n}\n","import { first, Observable, of, switchMap } from 'rxjs';\nimport { getValueFromGetter, isGetter, Maybe, ObjectMap } from '@dereekb/util';\nimport { AuthTransitionDecisionGetterInput, AuthTransitionRedirectTarget, AuthTransitionRedirectTargetGetter, AuthTransitionRedirectTargetOrGetter } from './hook';\nimport { SegueRefOrSegueRefRouterLink } from '../../../../router/segue';\nimport { AuthUserState } from '../../../auth.user';\n\n/**\n * Creates a AuthTransitionRedirectTargetGetter that can redirect values based on the current authUserState.\n *\n * @param stateMap\n * @returns\n */\nexport function redirectBasedOnAuthUserState(stateMap: ObjectMap<AuthTransitionRedirectTargetOrGetter>): AuthTransitionRedirectTargetGetter {\n return (input: AuthTransitionDecisionGetterInput) => {\n return input.authService.authUserState$.pipe(\n first(),\n switchMap((authUserState: AuthUserState) => {\n const getter = stateMap[authUserState];\n let result: Maybe<Observable<Maybe<SegueRefOrSegueRefRouterLink>>>;\n\n if (getter) {\n if (isGetter<AuthTransitionRedirectTarget>(getter)) {\n result = getValueFromGetter(getter, input);\n } else {\n result = of(getter);\n }\n }\n\n if (!result) {\n result = of(undefined);\n }\n\n return result;\n })\n );\n };\n}\n","import { Observable } from 'rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { TransitionService, TransitionHookFn, Transition, HookMatchCriteria } from '@uirouter/core';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { AuthTransitionDecision, AuthTransitionHookOptions, makeAuthTransitionHook } from './hook';\n\nexport interface IsLoggedInHookConfig {\n options: AuthTransitionHookOptions;\n}\n\n/**\n * UIRouter State data with configuration for the hasAuthRoleHook.\n */\nexport interface IsLoggedInStateData {\n /**\n * Whether or not the user needs to be logged in for this state.\n */\n requiredLogIn: boolean;\n}\n\n/**\n * This hook redirects to the configured default state when a user is not logged in for configured states.\n */\nexport function enableIsLoggedInHook(transitionService: TransitionService, config: IsLoggedInHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<IsLoggedInStateData>>;\n const match = Boolean(data?.requiredLogIn);\n return match;\n }\n };\n\n const assertIsLoggedIn: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n return authService.isLoggedIn$;\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertIsLoggedIn, { priority: 100 });\n}\n","import { map, Observable, OperatorFunction } from 'rxjs';\nimport { AuthRole, SetIncludesMode, ArrayOrValue, Maybe, setIncludes, asArray, AuthRoleSet } from '@dereekb/util';\nimport { TransitionService, TransitionHookFn, Transition, HookMatchCriteria } from '@uirouter/core';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { AuthTransitionDecision, AuthTransitionHookOptions, AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\nexport interface HasAuthRoleHookConfig {\n readonly options: AuthTransitionHookOptions;\n}\n\nexport interface HasAuthRoleStateRoleConfig {\n /**\n * Auth roles marked for this state\n */\n readonly authRoles: ArrayOrValue<AuthRole>;\n /**\n * How to use the above auth roles. This defaults to 'all' by default.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\nexport interface ParsedHasAuthRoleStateRoleConfig {\n /**\n * Auth roles marked for this state\n */\n readonly requiredRoles: Set<AuthRole>;\n /**\n * How to use the above auth roles. This defaults to 'all' by default.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\n/**\n * UIRouter State data with configuration for the hasAuthRoleHook.\n */\nexport interface HasAuthRoleStateData extends AuthTransitionStateData, Pick<HasAuthRoleStateRoleConfig, 'authRolesMode'> {\n /**\n * Auth roles configuration for this state.\n */\n readonly authRoles: ArrayOrValue<AuthRole | HasAuthRoleStateRoleConfig>;\n}\n\n/**\n * This hook redirects to the configured default state when a user:\n *\n * - does not have an allowed state\n * - has a disallowed state\n */\nexport function enableHasAuthRoleHook(transitionService: TransitionService, config: HasAuthRoleHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthRoleStateData>>;\n const match = Boolean(data?.authRoles);\n return match;\n }\n };\n\n const assertHasAuthRole: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthRoleStateData = targetState.state().data;\n const mapFn: OperatorFunction<AuthRoleSet, boolean> = hasAuthRoleDecisionPipe(data);\n return authService.authRoles$.pipe(mapFn);\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthRole, { priority: 100 });\n}\n\nexport function hasAuthRoleDecisionPipe(stateData: HasAuthRoleStateData): OperatorFunction<AuthRoleSet, boolean> {\n const authRolesMode: SetIncludesMode = stateData.authRolesMode || 'all';\n\n const authRoleConfigs: ParsedHasAuthRoleStateRoleConfig[] = asArray(stateData.authRoles).map((x) => {\n let config: HasAuthRoleStateRoleConfig;\n\n if (typeof x === 'string') {\n config = {\n authRoles: x,\n authRolesMode: 'any'\n };\n } else {\n config = x;\n }\n\n return {\n requiredRoles: new Set<AuthRole>(config.authRoles),\n authRolesMode: config.authRolesMode\n };\n });\n\n let mapFn: OperatorFunction<AuthRoleSet, boolean>;\n\n if (authRolesMode === 'any') {\n mapFn = map((x) => authRoleConfigs.findIndex((y) => setIncludes(x, y.requiredRoles, y.authRolesMode)) !== -1); // find the first match\n } else {\n mapFn = map((x) => authRoleConfigs.findIndex((y) => !setIncludes(x, y.requiredRoles, y.authRolesMode)) === -1); // find the first failed match\n }\n\n return mapFn;\n}\n","import { map, Observable } from 'rxjs';\nimport { AllowedSet, isAllowed, maybeSet, ArrayOrValue, Maybe } from '@dereekb/util';\nimport { TransitionService, TransitionHookFn, Transition, HookMatchCriteria } from '@uirouter/core';\nimport { AuthUserState } from '../../../auth.user';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { AuthTransitionDecision, AuthTransitionHookOptions, AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\nexport interface HasAuthStateHookConfig {\n options: AuthTransitionHookOptions;\n}\n\nexport type HasAuthStateConfig = ArrayOrValue<AuthUserState> | HasAuthStateObjectConfig;\n\nexport interface HasAuthStateObjectConfig {\n /**\n * Whether or not this state or any child state is considered \"secure\", which requires the user to be logged in.\n */\n allowedStates?: ArrayOrValue<AuthUserState>;\n\n /**\n * States that are not allowed. If the current state is this state, a rejection is returned.\n */\n disallowedStates?: ArrayOrValue<AuthUserState>;\n}\n\nexport interface HasAuthStateData extends AuthTransitionStateData {\n /**\n * Configuration for the hasAuthStateHook.\n */\n authStates: HasAuthStateConfig;\n}\n\n/**\n * This hook redirects to the configured default state when a user:\n *\n * - does not have an allowed state\n * - has a disallowed state\n */\nexport function enableHasAuthStateHook(transitionService: TransitionService, config: HasAuthStateHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthStateData>>;\n const match = Boolean(data?.authStates);\n return match;\n }\n };\n\n const assertHasAuthState: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthStateData = targetState.state().data;\n const config = toHasAuthStateObjectConfig(data.authStates);\n const allowedStates: ParsedHasAuthStateConfig = toParsedHasAuthStateConfig(config);\n\n return authService.authUserState$.pipe(map((x) => isAllowed(x, allowedStates)));\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthState, { priority: 100 });\n}\n\n// MARK: Utility\nfunction toHasAuthStateObjectConfig(input: HasAuthStateConfig): HasAuthStateObjectConfig {\n const isString = typeof input === 'string';\n\n if (Array.isArray(input) || isString) {\n if (isString) {\n input = [input as AuthUserState];\n }\n\n return {\n allowedStates: input as AuthUserState[]\n };\n } else {\n return input as HasAuthStateObjectConfig;\n }\n}\n\ntype ParsedHasAuthStateConfig = AllowedSet<AuthUserState>;\n\nfunction toParsedHasAuthStateConfig(input: HasAuthStateObjectConfig): ParsedHasAuthStateConfig {\n return {\n allowed: maybeSet(input.allowedStates),\n disallowed: maybeSet(input.disallowedStates)\n };\n}\n","/**\n * A contextual state identifier for a specific section of the app.\n *\n * Some examples are:\n * - init: The default context that is initialized.\n * - public: A public part of the app.\n * - onboarding: The onboarding section of the app.\n * - app: The main portion of the app.\n *\n * More complex apps may have more sub-sections or app portions that could each have their own context state.\n */\nexport type DbxAppContextState = string;\n\nexport const DBX_INIT_APP_CONTEXT_STATE = 'init';\n/**\n *\n */\nexport const DBX_PUBLIC_APP_CONTEXT_STATE = 'public';\n/**\n *\n */\nexport const DBX_AUTH_APP_CONTEXT_STATE = 'auth';\n/**\n *\n */\nexport const DBX_ONBOARD_APP_CONTEXT_STATE = 'onboard';\n/**\n *\n */\nexport const DBX_APP_APP_CONTEXT_STATE = 'app';\n\n/**\n * Default AppContextStates.\n *\n * Your app may not use these, but this type is available for convenience.\n */\nexport type DbxKnownAppContextState = typeof DBX_INIT_APP_CONTEXT_STATE | typeof DBX_PUBLIC_APP_CONTEXT_STATE | typeof DBX_AUTH_APP_CONTEXT_STATE | typeof DBX_ONBOARD_APP_CONTEXT_STATE | typeof DBX_APP_APP_CONTEXT_STATE;\n\n/**\n * Array of all DbxKnownAppContextState values, minus the init state.\n */\nexport const DBX_KNOWN_APP_CONTEXT_STATES: DbxKnownAppContextState[] = [DBX_PUBLIC_APP_CONTEXT_STATE, DBX_AUTH_APP_CONTEXT_STATE, DBX_ONBOARD_APP_CONTEXT_STATE, DBX_APP_APP_CONTEXT_STATE];\n","import { createAction, props } from '@ngrx/store';\nimport { DbxAppContextState } from '../../context';\n\n/**\n * Action to set the current DbxAppContextState value.\n */\nexport const setState = createAction('[App/Context] Set State', props<{ state: DbxAppContextState }>());\n\n/**\n * Resets the app back to the init context.\n */\nexport const resetState = createAction('[App/Context] Reset');\n","import { createReducer, on } from '@ngrx/store';\nimport { DbxAppContextState, DBX_INIT_APP_CONTEXT_STATE } from '../../context';\nimport { DbxAppContextActions } from '../action';\n\n/**\n * The feature key for these items/reducers.\n */\nexport const dbxAppContextStateFeatureKey = 'data';\n\n/**\n * The typings for this feature.\n */\nexport interface DbxAppContextStateData {\n state: DbxAppContextState;\n}\n\nexport const initialState: DbxAppContextStateData = {\n state: DBX_INIT_APP_CONTEXT_STATE\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * When DbxAppContextActions.dbxAppContextSetState is pushed, update the app's state to match the argument state.\n */\n on(DbxAppContextActions.setState, (_, { state }) => ({ state }))\n);\n","import { Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromDbxAppContextState from './data.reducer';\n\n/**\n * Global feature key for our app.\n */\nexport const featureKey = 'app.context';\n\n/**\n * This is a \"feature state\", which in this case is a single feature (our app state), but could include keys/states within this feature.\n */\nexport interface DbxAppContextFeatureState {\n [fromDbxAppContextState.dbxAppContextStateFeatureKey]: fromDbxAppContextState.DbxAppContextStateData;\n}\n\n/**\n * Interface typing extension for the DbxAppContextFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [featureKey]: DbxAppContextFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppContextFeatureState\n */\nexport function reducers(state: DbxAppContextFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppContextState.dbxAppContextStateFeatureKey]: fromDbxAppContextState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppContextFeatureState feature context.\n *\n * Used by createSelector() to retrieve more specific data from the DbxAppContextFeatureState.\n */\nexport const selectAppContextFeature = createFeatureSelector<DbxAppContextFeatureState>(featureKey);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppContextState = createSelector(selectAppContextFeature, (featureState: DbxAppContextFeatureState) => featureState[fromDbxAppContextState.dbxAppContextStateFeatureKey].state);\n","import { OnRunEffects, Actions, EffectNotification, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { Observable, exhaustMap, filter, takeUntil } from 'rxjs';\nimport { DbxAppContextState } from '../../context';\nimport { onDbxAppContext } from '../';\nimport { IterableOrValue, iterableToSet } from '@dereekb/util';\nimport { inject } from '@angular/core';\n\n// MARK: Abstract Context Effects\n/**\n * Abstract effects class that only runs/allows effects when the DbxAppContextState in the ngrx state matches input activeState value.\n */\nexport abstract class AbstractOnDbxAppContextStateEffects<S = unknown> implements OnRunEffects {\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<S>);\n\n /**\n * The set of state(s) to activate on.\n */\n private _activeStatesSet: Set<DbxAppContextState>;\n\n constructor(activeStates: IterableOrValue<DbxAppContextState>) {\n this._activeStatesSet = iterableToSet(activeStates);\n }\n\n /**\n * Configures all actions of the sub-class to only activate when the DbxAppContextState in App\n *\n * @param resolvedEffects$\n * @returns\n */\n ngrxOnRunEffects(resolvedEffects$: Observable<EffectNotification>): Observable<EffectNotification> {\n return this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => {\n return this._activeStatesSet.has(state);\n }),\n exhaustMap(() =>\n resolvedEffects$.pipe(\n takeUntil(\n this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => !this._activeStatesSet.has(state))\n )\n )\n )\n )\n );\n }\n}\n","import { Maybe } from '@dereekb/util';\n\n/**\n * An application user state.\n *\n * Generic states that define the current state of the user:\n * - none: the user is not logged in\n * - anon: the user is logged in as an anonymous account\n * - error: there was an error loading the correct user state\n * - new: the user has a full account but has not completed onboarding/setup\n * - user: the user has a full account and has completed setup\n */\nexport type AuthUserState = 'none' | 'anon' | 'new' | 'user' | 'error';\n\n/**\n * Arbitrary identifier used to differentiate users.\n */\nexport type AuthUserIdentifier = string;\n\nexport const NO_AUTH_USER_IDENTIFIER = '0';\n\n/**\n * AuthUserIdentifier used to indicate that the user cannot be uniquely identifier.\n */\nexport type NoAuthUserIdentifier = typeof NO_AUTH_USER_IDENTIFIER;\n\n/**\n * Creates an AuthUserIdentifier from the input. If the input is undefined, returns the NoAuthUserIdentifier.\n *\n * @param inputId\n * @returns\n */\nexport function authUserIdentifier(inputId: Maybe<AuthUserIdentifier>): AuthUserIdentifier {\n return inputId ? inputId : NO_AUTH_USER_IDENTIFIER;\n}\n","import { createAction } from '@ngrx/store';\n\n/**\n * Action for when the user has logged in.\n */\nexport const loggedIn = createAction('[App/Auth] Auth Logged In');\n\n/**\n * Action for when the user has logged out.\n */\nexport const loggedOut = createAction('[App/Auth] Auth Logged Out');\n\n/**\n * Action to log the user out.\n */\nexport const logout = createAction('[App/Auth] Auth Logout');\n","import { createAction, props } from '@ngrx/store';\nimport { AuthRole } from '@dereekb/util';\nimport { AuthUserIdentifier, AuthUserState } from '../../auth.user';\n\n/**\n * Sets the user's identifier in the auth.\n */\nexport const setUserIdentifier = createAction('[App/Auth] Set User Identifier', props<{ id: AuthUserIdentifier }>());\n\n/**\n * Sets the user's state in the auth.\n */\nexport const setUserState = createAction('[App/Auth] Set User State', props<{ state: AuthUserState }>());\n\n/**\n * Sets the user's roles in the auth.\n */\nexport const setUserRoles = createAction('[App/Auth] Set User Roles', props<{ roles: AuthRole[] }>());\n\n/**\n * Sets the user's onboarding state.\n */\nexport const setUserIsOnboarded = createAction('[App/Auth] Set User Is Onboarded', props<{ isOnboarded: boolean }>());\n","import { NO_AUTH_USER_IDENTIFIER, AuthUserIdentifier, AuthUserState } from '../../auth.user';\nimport { createReducer, on } from '@ngrx/store';\nimport { DbxAppAuthActions, DbxAppAuthUserActions } from '../action';\nimport { AuthRole } from '@dereekb/util';\n\nexport const dbxAppAuthUserFeatureKey = 'user';\n\nexport interface DbxAppAuthStateUser {\n userId: AuthUserIdentifier;\n isOnboarded: boolean;\n userState: AuthUserState;\n userRoles: AuthRole[];\n}\n\nexport const initialState: DbxAppAuthStateUser = {\n userId: NO_AUTH_USER_IDENTIFIER,\n isOnboarded: false,\n userState: 'none',\n userRoles: []\n};\n\nexport const reducer = createReducer(\n initialState,\n on(DbxAppAuthActions.loggedOut, () => ({ ...initialState })),\n on(DbxAppAuthUserActions.setUserIdentifier, (state, { id: userId }) => ({ ...state, userId })),\n on(DbxAppAuthUserActions.setUserIsOnboarded, (state, { isOnboarded }) => ({ ...state, isOnboarded })),\n on(DbxAppAuthUserActions.setUserState, (state, { state: userState }) => ({ ...state, userState })),\n on(DbxAppAuthUserActions.setUserRoles, (state, { roles: userRoles }) => ({ ...state, userRoles: Array.from(userRoles) }))\n);\n","import { Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromDbxAppAuthUserState from './user.reducer';\n\n/**\n * Global feature key\n */\nexport const featureKey = 'app.auth';\n\nexport interface DbxAppAuthFeatureState {\n [fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]: fromDbxAppAuthUserState.DbxAppAuthStateUser;\n}\n\n/**\n * Interface typing extension for the DbxAppAuthFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [featureKey]: DbxAppAuthFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppAuthFeatureState\n */\nexport function reducers(state: DbxAppAuthFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]: fromDbxAppAuthUserState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppAuthFeatureState feature context.\n */\nexport const selectAppAuthFeature = createFeatureSelector<DbxAppAuthFeatureState>(featureKey);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppAuthUser = createSelector(selectAppAuthFeature, (featureState: DbxAppAuthFeatureState) => featureState[fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey]);\n","import { MousableFunction } from './mousable';\nimport { ClickableFunction, ClickableUrl } from './clickable';\nimport { SegueRef } from '../segue';\nimport { expandFlattenTreeFunction, expandTreeFunction, ExpandTreeFunction, FlattenTreeFunction, flattenTreeToArrayFunction, Maybe, TreeNode } from '@dereekb/util';\nimport { Type, Provider, forwardRef } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { DbxInjectionComponentConfig } from '../../injection/injection';\n\nexport interface ClickableAnchor extends ClickableFunction, MousableFunction, ClickableUrl, Partial<SegueRef> {\n disabled?: boolean;\n selected?: boolean;\n}\n\n/**\n * Title and an optional icon.\n */\nexport interface IconAndTitle {\n title: string;\n icon?: Maybe<string>;\n}\n\nexport interface ClickableAnchorLink extends ClickableAnchor, IconAndTitle {\n /**\n * Optional detail string/content.\n */\n hint?: string;\n /**\n * Custom injection content for this link.\n */\n content?: DbxInjectionComponentConfig;\n}\n\n/**\n * ClickableAnchorLink that definitely has a SegueRef\n */\nexport type ClickableAnchorLinkSegueRef = ClickableAnchorLink & SegueRef;\n\nexport interface ClickableIconAnchorLink extends Omit<ClickableAnchorLink, 'title'> {\n icon: string;\n}\n\nexport interface ClickableAnchorLinkTree extends ClickableAnchorLink {\n children?: ClickableAnchorLinkTree[];\n}\n\nexport type ExpandedClickableAnchorLinkTree = TreeNode<ClickableAnchorLinkTree>;\n\nexport const expandClickableAnchorLinkTreeNode: ExpandTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = expandTreeFunction({\n getChildren: (x) => x.children\n});\n\nexport const flattenExpandedClickableAnchorLinkTree: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = flattenTreeToArrayFunction();\nexport const flattenExpandedClickableAnchorLinkTreeToLinks: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ClickableAnchorLinkTree> = flattenTreeToArrayFunction((x) => x.value);\n\n/**\n * Fully expands the given parent link and flattens the tree to a single parent link.\n *\n * @param link\n * @returns\n */\nexport function expandClickableAnchorLinkTree(link: ClickableAnchorLinkTree): ExpandedClickableAnchorLinkTree[] {\n return flattenExpandedClickableAnchorLinkTree(expandClickableAnchorLinkTreeNode(link));\n}\n\n/**\n * Expands an array of links into an array of ExpandedClickableAnchorLinkTree tree values.\n */\nexport const expandClickableAnchorLinkTrees = expandFlattenTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree>(expandClickableAnchorLinkTreeNode, flattenExpandedClickableAnchorLinkTree);\n\nexport enum AnchorType {\n /**\n * When the anchor has no specific content but is not disabled.\n *\n * Is a passthrough for the content.\n */\n PLAIN = 0,\n CLICKABLE = 1,\n SREF = 2,\n HREF = 3,\n DISABLED = 4\n}\n\nexport function anchorTypeForAnchor(anchor: Maybe<ClickableAnchor>, disabled?: Maybe<boolean>): AnchorType {\n let type: AnchorType = AnchorType.DISABLED;\n\n if (!disabled && anchor) {\n if (anchor.disabled) {\n type = AnchorType.DISABLED;\n } else if (anchor.ref) {\n type = AnchorType.SREF;\n } else if (anchor.onClick) {\n type = AnchorType.CLICKABLE;\n } else if (anchor.url) {\n type = AnchorType.HREF;\n } else {\n type = AnchorType.PLAIN;\n }\n }\n\n return type;\n}\n\nexport abstract class DbxAnchor<T extends ClickableAnchor = ClickableAnchor> {\n abstract disabled$: Observable<Maybe<boolean>>;\n abstract selected$: Observable<Maybe<boolean>>;\n abstract anchor$: Observable<Maybe<T>>;\n abstract disabled: Maybe<boolean>;\n abstract selected: Maybe<boolean>;\n abstract anchor: Maybe<T>;\n abstract type$: Observable<AnchorType>;\n}\n\nexport function provideDbxAnchor<S extends DbxAnchor>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxAnchor,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { skipFirstMaybe } from '@dereekb/rxjs';\nimport { map, shareReplay, distinctUntilChanged, BehaviorSubject, combineLatest, Observable, delay } from 'rxjs';\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AnchorType, ClickableAnchor, anchorTypeForAnchor, DbxAnchor } from './anchor';\nimport { SegueRefOrSegueRefRouterLink, asSegueRef } from '../segue';\n\n/**\n * Abstract anchor directive.\n */\n@Directive()\nexport class AbstractDbxAnchorDirective<T extends ClickableAnchor = ClickableAnchor> implements DbxAnchor, OnDestroy {\n private _selected = new BehaviorSubject<Maybe<boolean>>(false);\n private _disabled = new BehaviorSubject<Maybe<boolean>>(false);\n private _anchor = new BehaviorSubject<Maybe<T>>(undefined);\n\n readonly disabled$ = this._disabled.pipe(distinctUntilChanged());\n readonly anchor$ = this._anchor.pipe(skipFirstMaybe(), distinctUntilChanged(), shareReplay(1));\n readonly selected$ = combineLatest([this._selected, this.anchor$]).pipe(\n map(([selected, anchor]) => selected || anchor?.selected),\n distinctUntilChanged()\n );\n\n readonly type$: Observable<AnchorType> = combineLatest([this.disabled$, this.anchor$]).pipe(\n delay(0),\n map(([disabled, anchor]) => anchorTypeForAnchor(anchor, disabled)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n ngOnDestroy(): void {\n this._selected.complete();\n this._disabled.complete();\n this._anchor.complete();\n }\n\n /**\n * Convenience input to create an Anchor from the input SegueRef.\n */\n @Input()\n public set ref(ref: Maybe<SegueRefOrSegueRefRouterLink>) {\n this.anchor = asSegueRef(ref) as T;\n }\n\n @Input()\n public get anchor(): Maybe<T> {\n return this._anchor.value;\n }\n\n public set anchor(anchor: Maybe<T>) {\n this._anchor.next(anchor);\n }\n\n @Input()\n public get disabled(): Maybe<boolean> {\n return this._disabled.value;\n }\n\n public set disabled(disabled: Maybe<boolean>) {\n this._disabled.next(disabled);\n }\n\n @Input()\n public get selected(): Maybe<boolean> {\n return this._selected.value;\n }\n\n public set selected(selected: Maybe<boolean>) {\n this._selected.next(selected);\n }\n}\n","import { E164PhoneNumberWithOptionalExtension, MailToUrlInput, mailToUrlString, Maybe, PhoneNumber, telUrlString, WebsiteUrl } from '@dereekb/util';\n\nexport interface ClickableFunction {\n onClick?: (event?: Maybe<MouseEvent>) => void;\n}\n\n/**\n * Represents a clickable href/url configuration.\n */\nexport interface ClickableUrl {\n /**\n * href url\n */\n url?: string;\n /**\n * href target attribute.\n */\n target?: string;\n}\n\nexport function clickableUrlInNewTab(url: string | WebsiteUrl): ClickableUrl {\n return {\n url,\n target: '_blank'\n };\n}\n\nexport function clickableUrlMailTo(mailTo: MailToUrlInput): ClickableUrl {\n return {\n url: mailToUrlString(mailTo)\n };\n}\n\nexport function clickableUrlTel(tel: PhoneNumber | E164PhoneNumberWithOptionalExtension): ClickableUrl {\n return {\n url: telUrlString(tel)\n };\n}\n","import { DbxAuthService } from '../../../auth/service/auth.service';\nimport { TransitionService, TransitionHookFn, Transition, HookResult, StateService, HookMatchCriteria } from '@uirouter/core';\nimport { Maybe, ModelKey } from '@dereekb/util';\nimport { map, first, switchMap, firstValueFrom, Observable, of } from 'rxjs';\nimport { Injector } from '@angular/core';\n\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE = '0';\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY = 'id';\n\nexport interface RedirectForIdentifierParamHookInput {\n /**\n * Factory that returns an observable that sends the default allowed identifier to use when accessing the resource.\n */\n readonly defaultAllowedValue: (authService: DbxAuthService, injector: Injector, transition: Transition) => Observable<ModelKey>;\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly idParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target id.\n *\n * Can return another identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewModelWithId: (targetId: ModelKey, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | ModelKey>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * This hook asserts the user is allowed to view a route with an identifier as a state parameter.\n */\nexport function redirectForIdentifierParamHook(input: RedirectForIdentifierParamHookInput): void {\n const { defaultAllowedValue, idParam = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE, priority = 100, transitionService, canViewModelWithId: canViewUser } = input;\n const criteria: HookMatchCriteria = typeof input.criteria === 'string' ? { entering: input.criteria } : input.criteria;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertAllowedId: TransitionHookFn = (transition: Transition): HookResult => {\n const $state: StateService = transition.router.stateService;\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const params = transition.params();\n\n const transitionTargetId: Maybe<string> = params[idParam];\n const defaultAllowedValueObs$ = defaultAllowedValue(authService, injector, transition);\n\n return firstValueFrom(\n defaultAllowedValueObs$.pipe(\n first(),\n switchMap((defaultAllowedIdValue) => {\n let result: Observable<HookResult> = of(true);\n\n let redirectToId: Maybe<Observable<Maybe<ModelKey>>>;\n\n if (!transitionTargetId || transitionTargetId === defaultParamValue) {\n // If the param isn't set, default to the default value\n redirectToId = of(defaultAllowedIdValue);\n } else if (defaultAllowedIdValue !== transitionTargetId) {\n redirectToId = canViewUser(transitionTargetId, authService, injector).pipe(\n map((x) => {\n if (x == null || typeof x === 'boolean') {\n return x ? transitionTargetId : defaultAllowedIdValue;\n } else {\n return x;\n }\n })\n );\n }\n\n if (redirectToId != null) {\n result = redirectToId.pipe(\n first(),\n map((targetId) => {\n if (targetId !== transitionTargetId) {\n const target = transition.targetState();\n const state = target.state();\n return $state.target(state, { ...params, [idParam]: targetId }, { location: true });\n } else {\n return true;\n }\n })\n );\n }\n\n return result;\n })\n )\n ) as HookResult;\n };\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(criteria, assertAllowedId, { priority });\n}\n","import { AuthUserIdentifier } from '../../../auth/auth.user';\nimport { DbxAuthService } from '../../../auth/service/auth.service';\nimport { TransitionService, HookMatchCriteria } from '@uirouter/core';\nimport { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\nimport { Injector } from '@angular/core';\nimport { redirectForIdentifierParamHook } from './id.hook';\n\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE = '0';\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY = 'uid';\n\nexport interface RedirectForUserIdentifierParamHookInput {\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly uidParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target user.\n *\n * Can return another users identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewUser: (targetUid: AuthUserIdentifier, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | AuthUserIdentifier>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * This hook asserts the user is allowed to view a route with a user identifier as a parameter.\n */\nexport function redirectForUserIdentifierParamHook(input: RedirectForUserIdentifierParamHookInput): void {\n const { uidParam = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE, criteria, priority = 100, transitionService, canViewUser } = input;\n\n return redirectForIdentifierParamHook({\n defaultAllowedValue: (authService: DbxAuthService) => authService.userIdentifier$,\n idParam: uidParam,\n defaultParamValue,\n criteria,\n transitionService,\n canViewModelWithId: canViewUser,\n priority\n });\n}\n","export enum DbxRouterTransitionEventType {\n /**\n * A transition started.\n */\n START = 'start',\n /**\n * A transition ended.\n */\n SUCCESS = 'success'\n}\n\nexport interface DbxRouterTransitionEvent {\n type: DbxRouterTransitionEventType;\n}\n","import { map, Observable, combineLatest, firstValueFrom } from 'rxjs';\nimport { asObservable, filterMaybe, ObservableOrValue } from '@dereekb/rxjs';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { asSegueRef, SegueRef, SegueRefOrSegueRefRouterLink, SegueRefRawSegueParams } from '../../../segue';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { ActivatedRoute, NavigationBehaviorOptions, NavigationEnd, NavigationExtras, NavigationStart, Router, UrlTree } from '@angular/router';\nimport { Injectable, inject } from '@angular/core';\nimport { isArray } from 'class-validator';\nimport { KeyValueTypleValueFilter, Maybe, mergeObjects } from '@dereekb/util';\n\n/**\n * AngularRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxAngularRouterService implements DbxRouterService, DbxRouterTransitionService {\n readonly router = inject(Router);\n readonly activatedRoute = inject(ActivatedRoute);\n\n readonly params$: Observable<SegueRefRawSegueParams> = this.activatedRoute.params;\n\n readonly transitions$ = this.router.events.pipe(\n map((x) => {\n let event: Maybe<DbxRouterTransitionEvent>;\n\n if (x instanceof NavigationStart) {\n event = {\n type: DbxRouterTransitionEventType.START\n };\n } else if (x instanceof NavigationEnd) {\n event = {\n type: DbxRouterTransitionEventType.SUCCESS\n };\n }\n\n return event;\n }),\n filterMaybe()\n );\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const ref = segueRef.ref;\n\n if (isArray(ref)) {\n return this.router.navigate(ref as unknown[], {\n ...segueRef.refOptions,\n queryParams: segueRef.refParams\n });\n } else {\n return this.router.navigateByUrl(ref as string | UrlTree, {\n ...segueRef.refOptions\n });\n }\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>> = combineLatest([this.activatedRoute.params, asObservable(inputParams)]).pipe(\n map(([currentParams, params]) => {\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n const segueRef: SegueRef<NavigationExtras | NavigationBehaviorOptions> = {\n ref: this.activatedRoute.pathFromRoot,\n refParams,\n refOptions: {\n replaceUrl: true\n }\n };\n\n return segueRef;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number {\n return 0; // TODO!\n }\n}\n","import { Observable } from 'rxjs';\nimport { DbxRouterTransitionEvent } from '../transition/transition';\n\n/**\n * Router service definition that provides high level information about router transitions.\n */\nexport abstract class DbxRouterTransitionService {\n /**\n * Observable that emits DbxRouterTransitionEvent values as transitions occur.\n */\n abstract readonly transitions$: Observable<DbxRouterTransitionEvent>;\n}\n","import { ObservableOrValue } from '@dereekb/rxjs';\nimport { Observable } from 'rxjs';\nimport { SegueRefOrSegueRefRouterLink, SegueRefRawSegueParams } from '../../segue';\nimport { DbxRouterTransitionService } from './router.transition.service';\n\n/**\n * Router service definition that can route the app and provide routing details.\n */\nexport abstract class DbxRouterService extends DbxRouterTransitionService {\n /**\n * Params of the current successfully loaded route.\n */\n abstract readonly params$: Observable<SegueRefRawSegueParams>;\n\n /**\n * Navigates to the target SegueRef.\n *\n * @param segueRef\n */\n abstract go(segueRef: ObservableOrValue<SegueRefOrSegueRefRouterLink>): Promise<boolean>;\n\n /**\n * Navigates to the current url with updated parameters. Will be merged with the existing parameters.\n *\n * The new state will replace the current state in the history.\n *\n * @param segueRef\n */\n abstract updateParams(params: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean>;\n\n /**\n * Returns true if the input segue ref is considered active.\n *\n * @param segueRef\n */\n abstract isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Returns true if the input segue ref is considered active exactly.\n *\n * @param segueRef\n */\n abstract isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Compares the two refs for precision for a certain route.\n *\n * For example, if the parent route is input with a child route, the child route is\n * considered more precise.\n *\n * @param a\n * @param b\n */\n abstract comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number;\n}\n","import { distinctUntilKeysChange } from '@dereekb/rxjs';\nimport { ArrayOrValue, asArray, filterMaybeValues, IndexRef } from '@dereekb/util';\nimport { filter, map, MonoTypeOperatorFunction, Observable, distinctUntilChanged, shareReplay, startWith } from 'rxjs';\nimport { SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { DbxRouterService } from '../service/router.service';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from './transition';\n\n/**\n * Convenience function for filtering success from the input observable.\n *\n * @param obs\n * @returns\n */\nexport function successTransition(obs: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return obs.pipe(filterTransitionSuccess());\n}\n\nexport function filterTransitionSuccess(): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);\n}\n\nexport function filterTransitionEvent(type: DbxRouterTransitionEventType): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filter((x) => x.type === type);\n}\n// MARK: LatestSuccessfulRoutesConfig\nexport interface LatestSuccessfulRoutesConfigRoute {\n /**\n * Route to check if it is active or not.\n */\n readonly route: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n */\n readonly activeExactly?: boolean;\n}\n\ninterface LatestSuccessfulRoutesConfigRouteItem<T> extends IndexRef {\n readonly r: T;\n}\n\n/**\n * latestSuccessfulRoute() config\n */\nexport interface LatestSuccessfulRoutesConfig<T extends LatestSuccessfulRoutesConfigRoute> {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<T>;\n}\n\n/**\n * Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.\n *\n * @param obs\n * @param config\n * @returns\n */\nexport function latestSuccessfulRoutes<T extends LatestSuccessfulRoutesConfigRoute>(config: LatestSuccessfulRoutesConfig<T>): Observable<T[]> {\n const { dbxRouterTransitionService, dbxRouterService, routes: inputRoutes } = config;\n const routes: LatestSuccessfulRoutesConfigRouteItem<T>[] = asArray(inputRoutes).map((r, i) => ({ r, i }));\n const checkRoutes: (() => LatestSuccessfulRoutesConfigRouteItem<T> | undefined)[] = routes.map((routeConfig) => {\n const { r: route } = routeConfig;\n return route.activeExactly ? () => (dbxRouterService.isActiveExactly(route.route) ? routeConfig : undefined) : () => (dbxRouterService.isActive(route.route) ? routeConfig : undefined);\n });\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const activeRoutes: LatestSuccessfulRoutesConfigRouteItem<T>[] = filterMaybeValues(checkRoutes.map((x) => x()));\n return activeRoutes;\n }),\n distinctUntilKeysChange((x) => x.i),\n map((x) => x.map((y) => y.r)),\n shareReplay(1)\n );\n}\n\n// MARK: IsLatestSuccessfulRouteConfig\n/**\n * isLatestSuccessfulRoute() config\n */\nexport interface IsLatestSuccessfulRouteConfig {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<SegueRefOrSegueRefRouterLink>;\n /**\n * Whether or not to match route activity exactly.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.\n *\n * @param obs\n * @param config\n * @returns\n */\nexport function isLatestSuccessfulRoute(config: IsLatestSuccessfulRouteConfig): Observable<boolean> {\n const { dbxRouterTransitionService, dbxRouterService, activeExactly } = config;\n const routes = asArray(config.routes);\n const checkRoute: (route: SegueRefOrSegueRefRouterLink) => boolean = activeExactly ? (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActiveExactly(route) : (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActive(route);\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const isActive = routes.findIndex(checkRoute) !== -1;\n return isActive;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n}\n","import { Observable, startWith } from 'rxjs';\nimport { Directive, inject } from '@angular/core';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { successTransition } from './transition.rxjs';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionDirective {\n protected readonly dbxRouterTransitionService = inject(DbxRouterTransitionService);\n\n readonly transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);\n readonly initAndUpdateOnTransitionSuccess$: Observable<void> = this.transitionSuccess$.pipe(startWith(undefined)) as Observable<void>;\n}\n","import { Directive, NgZone, OnDestroy, OnInit, inject } from '@angular/core';\nimport { SubscriptionObject } from '@dereekb/rxjs';\nimport { AbstractTransitionDirective } from './transition.directive';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionWatcherDirective extends AbstractTransitionDirective implements OnInit, OnDestroy {\n private _transitionSub = new SubscriptionObject();\n\n protected readonly ngZone = inject(NgZone);\n\n ngOnInit(): void {\n this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {\n this.updateForSuccessfulTransition();\n });\n }\n\n ngOnDestroy(): void {\n this._transitionSub.destroy();\n }\n\n // MARK: Action\n protected zoneUpdateForSuccessfulTransition(): void {\n this.ngZone.run(() => this.updateForSuccessfulTransition());\n }\n\n protected abstract updateForSuccessfulTransition(): void;\n}\n","import { Building } from '@dereekb/util';\nimport { SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { DbxRouterService } from './router.service';\n\n/**\n * Function that returns true when the configured segueRef is active.\n */\nexport type IsSegueRefActiveFunction = (() => boolean) & {\n readonly _segueRef: SegueRefOrSegueRefRouterLink;\n readonly _activeExactly: boolean;\n};\n\nexport interface IsSegueRefActiveFunctionConfig {\n readonly dbxRouterService: DbxRouterService;\n readonly segueRef: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n *\n * False by default.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates an IsSegueRefActiveFunction\n *\n * @param config\n * @returns\n */\nexport function isSegueRefActiveFunction(config: IsSegueRefActiveFunctionConfig): IsSegueRefActiveFunction {\n const { dbxRouterService, segueRef, activeExactly = false } = config;\n const result = (activeExactly ? () => dbxRouterService.isActiveExactly(segueRef) : () => dbxRouterService.isActive(segueRef)) as Building<IsSegueRefActiveFunction>;\n\n result._segueRef = segueRef;\n result._activeExactly = activeExactly;\n\n return result as IsSegueRefActiveFunction;\n}\n","import { Maybe } from '@dereekb/util';\nimport { filter, map, Observable, of, OperatorFunction, switchMap, startWith } from 'rxjs';\nimport { SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../transition';\nimport { isSegueRefActiveFunction, IsSegueRefActiveFunctionConfig } from './router.service.util';\n\n// MARK: Transition Events\nexport function onRouterTransitionEventType(events$: Observable<DbxRouterTransitionEvent>, type: DbxRouterTransitionEventType): Observable<DbxRouterTransitionEvent> {\n return events$.pipe(filter((x) => x.type === type));\n}\n\nexport function onRouterTransitionSuccessEvent(events$: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return onRouterTransitionEventType(events$, DbxRouterTransitionEventType.SUCCESS);\n}\n\n// MARK: Router Service\n/**\n * Creates an observable that returns true when the route for the input segueRef is active.\n *\n * @param dbxRouterService\n * @param segueRef\n */\nexport function isSegueRefActiveOnTransitionSuccess(config: IsSegueRefActiveFunctionConfig): Observable<boolean> {\n const isActiveFn = isSegueRefActiveFunction(config);\n return onRouterTransitionSuccessEvent(config.dbxRouterService.transitions$).pipe(\n startWith(undefined),\n map(() => isActiveFn())\n );\n}\n\nexport interface IsSegueRefActiveConfig extends Pick<IsSegueRefActiveFunctionConfig, 'dbxRouterService' | 'activeExactly'> {\n /**\n * What to pipe if the input segueRef is null.\n */\n readonly defaultIfNull?: boolean;\n}\n\n/**\n * Operator function that maps the input segueRef to a boolean depending on the current route state.\n *\n * @param dbxRouterService\n * @param segueRef\n */\nexport function isSegueRefActive(config: IsSegueRefActiveConfig): OperatorFunction<Maybe<SegueRefOrSegueRefRouterLink>, boolean> {\n const { defaultIfNull = false } = config;\n\n return switchMap((segueRef) => {\n if (segueRef) {\n return isSegueRefActiveOnTransitionSuccess({ ...config, segueRef });\n } else {\n return of(defaultIfNull);\n }\n });\n}\n","import { ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { firstValueFrom } from 'rxjs';\nimport { SegueRef, SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { DbxRouterService } from './router.service';\n\n/**\n * Function that will perform navigation with the input route.\n */\nexport type GoWithRouter = (route: ObservableOrValue<SegueRef>) => Promise<boolean>;\n\n/**\n * Creates a GoWithRouter function.\n *\n * @param dbxRouterService\n * @returns\n */\nexport function goWithRouter(dbxRouterService: DbxRouterService): (route: ObservableOrValue<SegueRefOrSegueRefRouterLink>) => Promise<boolean> {\n return (route) => {\n return firstValueFrom(asObservable(route)).then((x) => dbxRouterService.go(x));\n };\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { DbxAngularRouterService } from './angular.router.service';\n\n@NgModule({})\nexport class DbxCoreAngularRouterSegueModule {\n static forRoot(): ModuleWithProviders<DbxCoreAngularRouterSegueModule> {\n return {\n ngModule: DbxCoreAngularRouterSegueModule,\n providers: [\n DbxAngularRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxAngularRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxAngularRouterService\n }\n ]\n };\n }\n}\n","import { KeyValueTypleValueFilter, mergeObjects } from '@dereekb/util';\nimport { Subject, BehaviorSubject, Observable, firstValueFrom, map } from 'rxjs';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { asSegueRef, asSegueRefString, SegueRef, SegueRefOrSegueRefRouterLink, SegueRefRawSegueParams } from '../../../segue';\nimport { StateService, UIRouterGlobals, TransitionOptions, TransitionService } from '@uirouter/core';\nimport { Injectable, OnDestroy, inject } from '@angular/core';\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { ObservableOrValue, asObservable } from '@dereekb/rxjs';\n\n/**\n * UIRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxUIRouterService implements DbxRouterService, DbxRouterTransitionService, OnDestroy {\n readonly state = inject(StateService);\n readonly transitionService = inject(TransitionService);\n readonly uiRouterGlobals = inject(UIRouterGlobals);\n\n private readonly _params = new BehaviorSubject<SegueRefRawSegueParams>(this.uiRouterGlobals.params);\n readonly params$ = this._params.asObservable();\n\n private readonly _transitions = new Subject<DbxRouterTransitionEvent>();\n readonly transitions$ = this._transitions.asObservable();\n\n constructor() {\n const emitTransition = (type: DbxRouterTransitionEventType) => {\n this._transitions.next({\n type\n });\n\n this._params.next(this.uiRouterGlobals.params);\n };\n\n this.transitionService.onStart({}, () => {\n emitTransition(DbxRouterTransitionEventType.START);\n });\n\n this.transitionService.onSuccess({}, () => {\n emitTransition(DbxRouterTransitionEventType.SUCCESS);\n });\n }\n\n ngOnDestroy(): void {\n this._transitions.complete();\n }\n\n get params() {\n return this.uiRouterGlobals.params;\n }\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<TransitionOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const params = { ...this.uiRouterGlobals.current.params, ...segueRef.refParams };\n return this.state\n .go(segueRef.ref as string, params, segueRef.refOptions)\n .then(() => true)\n .catch(() => false);\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<TransitionOptions>> = asObservable(inputParams).pipe(\n map((params) => {\n const currentParams = this.uiRouterGlobals.params;\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n\n const ref: SegueRef<TransitionOptions> = {\n ref: '.',\n refParams,\n refOptions: {\n location: 'replace',\n inherit: true\n }\n };\n\n return ref;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, false);\n }\n\n isActiveExactly(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, true);\n }\n\n comparePrecision(aInput: SegueRefOrSegueRefRouterLink, bInput: SegueRefOrSegueRefRouterLink): number {\n const aRef = asSegueRefString(aInput);\n const bRef = asSegueRefString(bInput);\n\n const aLength = aRef.length;\n const bLength = bRef.length;\n return aLength > bLength ? 1 : aLength === bLength ? 0 : -1;\n }\n\n // MARK: Internal\n isActiveState(input: SegueRefOrSegueRefRouterLink, exactly: boolean): boolean {\n const segueRef = asSegueRef(input);\n const ref = segueRef.ref as string;\n const refParams = segueRef.refParams;\n\n const targetRef = ref.startsWith('.') ? `^${ref}` : ref;\n const active = exactly ? this.state.is(targetRef, refParams) : this.state.includes(targetRef, refParams);\n return active;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxUIRouterService } from './uirouter.router.service';\n\n@NgModule({})\nexport class DbxCoreUIRouterSegueModule {\n static forRoot(): ModuleWithProviders<DbxCoreUIRouterSegueModule> {\n return {\n ngModule: DbxCoreUIRouterSegueModule,\n providers: [\n DbxUIRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxUIRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxUIRouterService\n }\n ]\n };\n }\n}\n","import { ObservableOrValueGetter, MaybeObservableOrValueGetter, switchMapToDefault, maybeValueFromObservableOrValueGetter, asObservableFromGetter } from '@dereekb/rxjs';\nimport { Destroyable, Maybe } from '@dereekb/util';\nimport { BehaviorSubject, combineLatest, distinctUntilChanged, first, map, Observable, shareReplay } from 'rxjs';\nimport { DbxRouterService } from '../service/router.service';\n\n/**\n * Interface used for reading a single value from the DbxRouterService. Supports a default value.\n */\nexport interface DbxRouteParamReader<T> {\n /**\n * The param value as read from the current router state.\n */\n readonly paramValue$: Observable<Maybe<T>>;\n /**\n * The default value observable.\n */\n readonly defaultValue$: Observable<Maybe<T>>;\n /**\n * The final computed value\n */\n readonly value$: Observable<Maybe<T>>;\n\n /**\n * Returns the current param key.\n */\n getParamKey(): string;\n\n /**\n * Sets a new param key. If the value is undefined, the param reader will use the default key.\n */\n setParamKey(paramKey: Maybe<string>): void;\n\n /**\n * Sets the default value source.\n *\n * @param defaultValue\n */\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<T>): void;\n\n /**\n * Updates the value on the current route for the paramKey.\n *\n * @param value\n */\n setParamValue(value: MaybeObservableOrValueGetter<T>): void;\n}\n\nexport interface DbxRouteParamReaderInstance<T> extends DbxRouteParamReader<T>, Destroyable {\n readonly dbxRouterService: DbxRouterService;\n readonly paramKey$: Observable<string>;\n readonly nextDefaultValue$: Observable<Maybe<T>>;\n readonly value$: Observable<Maybe<T>>;\n}\n\n/**\n * Creates a new DbxRouteParamReaderInstance from the input.\n *\n * @param dbxRouterService\n * @param defaultParamKey\n * @param defaultValue\n * @returns\n */\nexport function dbxRouteParamReaderInstance<T>(dbxRouterService: DbxRouterService, defaultParamKey: string, defaultValue?: MaybeObservableOrValueGetter<T>) {\n const _paramKey = new BehaviorSubject<string>(defaultParamKey);\n const _defaultValue = new BehaviorSubject<Maybe<ObservableOrValueGetter<Maybe<T>>>>(defaultValue);\n\n const paramKey$ = _paramKey.asObservable();\n\n const paramValue$ = combineLatest([paramKey$, dbxRouterService.params$]).pipe(\n map(([key, params]) => (params[key] as Maybe<T>) ?? undefined),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n const nextDefaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const defaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const value$ = paramValue$.pipe(switchMapToDefault(defaultValue$), shareReplay(1));\n\n const result: DbxRouteParamReaderInstance<T> = {\n dbxRouterService,\n\n paramKey$,\n paramValue$,\n nextDefaultValue$,\n defaultValue$,\n value$,\n\n destroy() {\n _paramKey.complete();\n _defaultValue.complete();\n },\n\n getParamKey(): string {\n return _paramKey.value;\n },\n\n setParamKey(paramKey: Maybe<string>) {\n _paramKey.next(paramKey || defaultParamKey);\n },\n\n setDefaultValue(newValue: MaybeObservableOrValueGetter<T>) {\n _defaultValue.next(newValue ?? defaultValue);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<T>) {\n combineLatest([paramKey$, asObservableFromGetter(value)])\n .pipe(first())\n .subscribe(([paramKey, value]) => dbxRouterService.updateParams({ [paramKey]: value }));\n }\n };\n\n return result;\n}\n","import { BehaviorSubject, EMPTY, switchMap, of } from 'rxjs';\nimport { DbxRouteParamReaderInstance } from './route.reader';\nimport { Destroyable, Initialized, Maybe, DefaultForwardFunctionFactory, defaultForwardFunctionFactory } from '@dereekb/util';\nimport { SubscriptionObject, switchMapToDefault, SwitchMapToDefaultFilterFunction, filterMaybe } from '@dereekb/rxjs';\n\nconst DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY = defaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<unknown>>((value) => of(value == null));\n\n/**\n * Utility class used in conjuction with a DbxRouteParamReaderInstance to redirect when the default param is not valid.\n */\nexport class DbxRouteParamDefaultRedirectInstance<T> implements Initialized, Destroyable {\n private readonly instance: DbxRouteParamReaderInstance<T>;\n\n private readonly _enabled = new BehaviorSubject<boolean>(true);\n private readonly _useDefaultFilter = new BehaviorSubject<Maybe<SwitchMapToDefaultFilterFunction<T>>>(undefined);\n private readonly _sub = new SubscriptionObject();\n\n constructor(instance: DbxRouteParamReaderInstance<T>) {\n this.instance = instance;\n }\n\n init(): void {\n this._sub.subscription = this._enabled\n .pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this.instance.paramValue$.pipe(\n switchMapToDefault(this.instance.defaultValue$, (value) => {\n return this._useDefaultFilter.pipe(switchMap((fn) => (DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY as DefaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<T>>)(fn)(value)));\n }),\n filterMaybe(), // do not redirect on MaybeNot values\n switchMap((defaultValue) => {\n return this.redirectWithDefaultValue(defaultValue);\n })\n );\n } else {\n return EMPTY;\n }\n })\n )\n .subscribe();\n }\n\n destroy(): void {\n this._enabled.complete();\n this._useDefaultFilter.complete();\n this._sub.destroy();\n }\n\n protected redirectWithDefaultValue(value: Maybe<T>): Promise<boolean> {\n if (value != null) {\n // perform a segue once\n return this.redirectWithValue(value);\n } else {\n // do nothing\n return Promise.resolve(false);\n }\n }\n\n protected redirectWithValue(value: Maybe<T>): Promise<boolean> {\n return this.instance.dbxRouterService.updateParams({\n [this.instance.getParamKey()]: value\n });\n }\n\n get enabled(): boolean {\n return this._enabled.value;\n }\n\n set enabled(enabled: boolean) {\n this._enabled.next(enabled);\n }\n\n setUseDefaultFilter(useValueFilter: Maybe<SwitchMapToDefaultFilterFunction<T>>): void {\n this._useDefaultFilter.next(useValueFilter);\n }\n}\n","import { SegueRefOrSegueRefRouterLink } from '../../router/segue';\n\n/**\n * Auth routes configurations for an app.\n */\nexport abstract class DbxAppAuthRoutes {\n abstract readonly loginRef: SegueRefOrSegueRefRouterLink;\n abstract readonly loggedOutRef?: SegueRefOrSegueRefRouterLink;\n abstract readonly onboardRef?: SegueRefOrSegueRefRouterLink;\n abstract readonly appRef: SegueRefOrSegueRefRouterLink;\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { Injectable, OnDestroy, inject } from '@angular/core';\nimport { goWithRouter } from '../../router';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Helper service for navigating to important auth-related routes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthRouterService implements OnDestroy {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxAppAuthRoutes = inject(DbxAppAuthRoutes);\n\n private _isAuthRouterEffectsEnabled = new BehaviorSubject<boolean>(true);\n readonly isAuthRouterEffectsEnabled$ = this._isAuthRouterEffectsEnabled.asObservable();\n\n ngOnDestroy(): void {\n this._isAuthRouterEffectsEnabled.complete();\n }\n\n get hasOnboardingState(): boolean {\n return Boolean(this.dbxAppAuthRoutes.onboardRef);\n }\n\n // MARK: Effects\n /**\n * Whether or not DbxAppAuthRouterEffects are enabled.\n */\n get isAuthRouterEffectsEnabled(): boolean {\n return this._isAuthRouterEffectsEnabled.value;\n }\n\n set isAuthRouterEffectsEnabled(enabled: boolean) {\n this._isAuthRouterEffectsEnabled.next(enabled);\n }\n\n // MARK: Navigate\n /**\n * Navigates to the login state.\n *\n * @returns\n */\n goToLogin() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the logged out state, if it exists, otherwise navigates to the login state.\n *\n * @returns\n */\n goToLoggedOut() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loggedOutRef ?? this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the onboarding state if it is available, otherwise navigates to the app.\n *\n * @returns\n */\n goToOnboarding(): Promise<boolean> {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.onboardRef ?? this.dbxAppAuthRoutes.appRef);\n }\n\n /**\n * Navigates to the app state.\n *\n * @returns\n */\n goToApp() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.appRef);\n }\n}\n","import { exhaustMap, filter } from 'rxjs';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\nimport { ArrayOrValue, Maybe } from '@dereekb/util';\nimport { createEffect, ofType } from '@ngrx/effects';\nimport { DbxAppContextState, DBX_KNOWN_APP_CONTEXT_STATES } from '../../../../context/context';\nimport { AbstractOnDbxAppContextStateEffects } from '../../../../context/state/effect';\nimport { fromDbxAppAuth, onDbxAppAuth } from '../../../state';\nimport { DbxAppAuthRouterService } from '../../auth.router.service';\n\n/**\n * Used by DbxAppAuthRouterEffects to configure the states that should be activve by default.\n */\nexport const DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN = new InjectionToken('DbxAppAuthRouterEffectsActiveStates');\n\n/**\n * Set of ngrx effects that handle navigation in the app when the auth changes in certain ways.\n *\n * Is configurable via the DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN to choose which states this effect is active or not. By default is equal to DBX_KNOWN_APP_CONTEXT_STATES.\n */\n@Injectable()\nexport class DbxAppAuthRouterEffects extends AbstractOnDbxAppContextStateEffects<fromDbxAppAuth.State> {\n readonly dbxAppAuthRouterService = inject(DbxAppAuthRouterService);\n\n constructor() {\n super(inject<Maybe<ArrayOrValue<DbxAppContextState>>>(DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, { optional: true }) ?? DBX_KNOWN_APP_CONTEXT_STATES);\n }\n\n /**\n * Effect to redirect to the login when logout occurs.\n */\n readonly redirectToLoginOnLogout = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedOut),\n filter(() => this.dbxAppAuthRouterService.isAuthRouterEffectsEnabled),\n exhaustMap(() => this.dbxAppAuthRouterService.goToLogin())\n ),\n { dispatch: false }\n );\n\n /**\n * Effect to redirect to the app when login occurs.\n */\n readonly redirectToOnboardOnLogIn = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedIn),\n filter(() => this.dbxAppAuthRouterService.isAuthRouterEffectsEnabled),\n exhaustMap(() => this.dbxAppAuthRouterService.goToApp())\n ),\n { dispatch: false }\n );\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ArrayOrValue } from '@dereekb/util';\nimport { EffectsModule } from '@ngrx/effects';\nimport { DbxAppContextState } from '../../../context';\nimport { DbxAppAuthRouterEffects, DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN } from './effect/auth.router.state.effect';\n\nexport interface DbxAppAuthRouterStateModuleConfig {\n readonly activeRoutesToApplyEffects: ArrayOrValue<DbxAppContextState>;\n}\n\n@NgModule({\n imports: [EffectsModule.forFeature([DbxAppAuthRouterEffects])],\n declarations: [],\n exports: []\n})\nexport class DbxAppAuthRouterStateModule {\n static forRoot(config: DbxAppAuthRouterStateModuleConfig): ModuleWithProviders<DbxAppAuthRouterStateModule> {\n return {\n ngModule: DbxAppAuthRouterStateModule,\n providers: [\n {\n provide: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN,\n useValue: config.activeRoutesToApplyEffects\n }\n ]\n };\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n@NgModule({\n imports: [],\n declarations: [],\n exports: []\n})\nexport class DbxAppAuthRouterModule {\n static forRoot(dbxAppAuthRoutes: DbxAppAuthRoutes): ModuleWithProviders<DbxAppAuthRouterModule> {\n return {\n ngModule: DbxAppAuthRouterModule,\n providers: [\n {\n provide: DbxAppAuthRoutes,\n useValue: dbxAppAuthRoutes\n }\n ]\n };\n }\n}\n","import { AuthRole, AuthRoleSet, Maybe } from '@dereekb/util';\nimport { onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, setContainsNoValueFrom } from '@dereekb/rxjs';\nimport { map, Observable, OperatorFunction } from 'rxjs';\n\n/**\n * Convenience operator that emits events when the input observable goes from false to true.\n *\n * @param isLoggedInObs\n * @returns\n */\nexport function loggedInObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onFalseToTrue(),\n map(() => undefined)\n );\n}\n/**\n * Convenience operator that emits events when the input observable goes from true to false.\n *\n * @param isLoggedInObs\n * @returns\n */\nexport function loggedOutObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onTrueToFalse(),\n map(() => undefined)\n );\n}\n\nexport function authRolesSetContainsAllRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\nexport function authRolesSetContainsAnyRoleFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\nexport function authRolesSetContainsNoRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsNoValueFrom<AuthRole>(roles);\n}\n","import { AuthRole, ArrayOrValue, Maybe } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { authRolesSetContainsAnyRoleFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has any of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthHasAnyRole]'\n})\nexport class DbxAuthHasAnyRoleDirective extends AbstractIfDirective implements OnDestroy {\n private _targetRoles = new BehaviorSubject<Maybe<ArrayOrValue<AuthRole>>>(undefined);\n\n readonly targetRoles$ = this._targetRoles.asObservable();\n\n readonly show$ = inject(DbxAuthService).authRoles$.pipe(authRolesSetContainsAnyRoleFrom(this.targetRoles$));\n\n override ngOnDestroy(): void {\n this._targetRoles.complete();\n }\n\n @Input('dbxAuthHasAnyRole')\n set targetRoles(roles: Maybe<ArrayOrValue<AuthRole>>) {\n this._targetRoles.next(roles);\n }\n}\n","import { Maybe, AuthRole, ArrayOrValue } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { authRolesSetContainsAllRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has all of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthHasRoles]'\n})\nexport class DbxAuthHasRolesDirective extends AbstractIfDirective implements OnDestroy {\n private _targetRoles = new BehaviorSubject<Maybe<ArrayOrValue<AuthRole>>>(undefined);\n readonly targetRoles$ = this._targetRoles.asObservable();\n\n readonly show$ = inject(DbxAuthService).authRoles$.pipe(authRolesSetContainsAllRolesFrom(this.targetRoles$));\n\n override ngOnDestroy(): void {\n this._targetRoles.complete();\n }\n\n @Input('dbxAuthHasRoles')\n set targetRoles(roles: Maybe<ArrayOrValue<AuthRole>>) {\n this._targetRoles.next(roles);\n }\n}\n","import { Maybe, AuthRole, ArrayOrValue } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Input, OnDestroy, inject } from '@angular/core';\nimport { authRolesSetContainsNoRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural decorator directive similar to ngIf that embeds content if the current auth user has none of the target role(s).\n */\n@Directive({\n selector: '[dbxAuthNotAnyRole]'\n})\nexport class DbxAuthNotAnyRoleDirective extends AbstractIfDirective implements OnDestroy {\n private _targetRoles = new BehaviorSubject<Maybe<ArrayOrValue<AuthRole>>>(undefined);\n\n readonly targetRoles$ = this._targetRoles.asObservable();\n\n readonly show$ = inject(DbxAuthService).authRoles$.pipe(authRolesSetContainsNoRolesFrom(this.targetRoles$));\n\n override ngOnDestroy(): void {\n this._targetRoles.complete();\n }\n\n @Input('dbxAuthNotAnyRole')\n set targetRoles(roles: Maybe<ArrayOrValue<AuthRole>>) {\n this._targetRoles.next(roles);\n }\n}\n","import { DbxAuthHasAnyRoleDirective } from './auth.role.any.directive';\nimport { NgModule } from '@angular/core';\nimport { DbxAuthHasRolesDirective } from './auth.role.has.directive';\nimport { DbxAuthNotAnyRoleDirective } from './auth.role.not.directive';\n\n@NgModule({\n imports: [],\n declarations: [DbxAuthHasRolesDirective, DbxAuthHasAnyRoleDirective, DbxAuthNotAnyRoleDirective],\n exports: [DbxAuthHasRolesDirective, DbxAuthHasAnyRoleDirective, DbxAuthNotAnyRoleDirective]\n})\nexport class DbxCoreAuthModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { DbxAuthService } from '../../service';\nimport { onDbxAppAuth } from '../';\nimport { map, tap } from 'rxjs';\nimport * as fromDbxAppAuth from '../reducer';\n\n/**\n * Set of ngrx effects that repeat events from DbxAuthService.\n */\n@Injectable()\nexport class DbxAppAuthEffects {\n private readonly dbxAuthService = inject(DbxAuthService);\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<fromDbxAppAuth.State>);\n\n // MARK: Auth\n readonly emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedIn())));\n\n readonly emitLoggedOut = createEffect(() => this.dbxAuthService.onLogOut$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedOut())));\n\n readonly forwardLogoutToAuthService = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.logout),\n tap(() => {\n // Perform the logout\n this.dbxAuthService.logOut();\n })\n ),\n { dispatch: false }\n );\n\n // MARK: Auth\n readonly setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier$.pipe(map((id) => onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier({ id }))));\n\n readonly setUserState = createEffect(() => this.dbxAuthService.authUserState$.pipe(map((state) => onDbxAppAuth.DbxAppAuthUserActions.setUserState({ state }))));\n\n readonly setUserRoles = createEffect(() => this.dbxAuthService.authRoles$.pipe(map((roles) => onDbxAppAuth.DbxAppAuthUserActions.setUserRoles({ roles: Array.from(roles ?? []) }))));\n\n readonly setUserIsOnboarded = createEffect(() => this.dbxAuthService.isOnboarded$.pipe(map((isOnboarded) => onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded({ isOnboarded }))));\n}\n","import { fromDbxAppAuth } from './state';\nimport { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { DbxAppAuthEffects } from './state/effect/auth.effect';\n\n@NgModule({\n imports: [StoreModule.forFeature(fromDbxAppAuth.featureKey, fromDbxAppAuth.reducers), EffectsModule.forFeature([DbxAppAuthEffects])],\n declarations: [],\n exports: []\n})\nexport class DbxAppAuthStateModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { DbxAppAuthFullState } from './state/state';\n\n/**\n * State for accessing the app's DbxAppAuthState defined within the DbxAppAuthFullState for the ngrx store.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthStateService {\n readonly store = inject(Store<DbxAppAuthFullState>);\n readonly authStateUser$ = this.store.select(fromDbxAppAuth.selectDbxAppAuthUser);\n}\n","import { MonoTypeOperatorFunction, tap } from 'rxjs';\nimport { ChangeDetectorRef, ViewRef, ElementRef } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Convenience function used within observables for views that need to detect changes after a value changes.\n *\n * @param cdRef\n * @param timeout\n * @returns\n */\nexport function tapDetectChanges<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n return cdRef ? tap(() => setTimeout(() => safeDetectChanges(cdRef), timeout)) : tap();\n}\n\n/**\n * Triggers a check for detecting any changes on the model safely to ve registered via detectChanges().\n *\n * @param cdRef\n */\nexport function safeDetectChanges(cdRef: ChangeDetectorRef): void {\n safeUseCdRef(cdRef, () => cdRef.detectChanges());\n}\n\n/**\n * Convenience function used within observables for views that use the OnPush ChangeDetectionStrategy and needs to call markForCheck when a new observable value is pushed.\n *\n * NOTE: If the observable is being consumed via the \"async\" pipe, this may not be necessary.\n *\n * @param cdRef\n * @param timeout\n * @returns\n */\nexport function tapSafeMarkForCheck<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n return cdRef ? tap(() => setTimeout(() => safeMarkForCheck(cdRef), timeout)) : tap();\n}\n\n/**\n * Marks the ChangeDetectorRef for changes as long as the view has not been destroyed.\n *\n * @param cdRef\n */\nexport function safeMarkForCheck(cdRef: ChangeDetectorRef): void {\n safeUseCdRef(cdRef, () => cdRef.markForCheck());\n}\n\n/**\n * Triggers a detection change on the input view as long as the view has not been destroyed.\n *\n * @param cdRef\n */\nexport function safeUseCdRef(cdRef: ChangeDetectorRef, use: (cdRef: ChangeDetectorRef) => void): void {\n if (!(cdRef as ViewRef).destroyed) {\n use(cdRef);\n }\n}\n\n/**\n * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,\n * or more specifically if the parent component passed any target content to the child. This will still return true if\n * passed content is empty.\n *\n * TS:\n * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;\n *\n * HTML:\n * <div #customContent>\n * <ng-content select=\"[content]\"></ng-content>\n * </div>\n */\nexport function checkNgContentWrapperHasContent(ref: Maybe<ElementRef<Element>>): boolean {\n // https://github.com/angular/angular/issues/26083\n let hasContent = false;\n\n if (ref != null) {\n const childNodes = ref.nativeElement.childNodes;\n const hasChildNodes = childNodes && childNodes.length > 0;\n hasContent = Boolean(hasChildNodes);\n }\n\n return hasContent;\n}\n","import { Type, Provider, forwardRef } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\n\n/**\n * Used for intercepting button click events.\n *\n * Can be used to delay/modify trigger/click behaviors.\n */\nexport interface DbxButtonInterceptor {\n /**\n * Handles a button click event. Returns an observable that will say whether or not to continue the click event.\n */\n interceptButtonClick: () => Observable<boolean>;\n}\n\n/**\n * Text and icon display content for a button.\n */\nexport interface DbxButtonDisplayContent {\n /**\n * button Icon, if applicable\n */\n icon?: Maybe<string>;\n /**\n * button text, if applicable\n */\n text?: Maybe<string>;\n}\n\nexport abstract class DbxButton implements DbxButtonDisplayContent {\n abstract readonly disabled$: Observable<boolean>;\n abstract readonly working$: Observable<boolean>;\n abstract disabled: Maybe<boolean>;\n abstract working: Maybe<boolean>;\n abstract icon?: Maybe<string>;\n abstract text?: Maybe<string>;\n abstract readonly clicked$: Observable<unknown>;\n abstract setButtonInterceptor(interceptor: DbxButtonInterceptor): void;\n abstract clickButton(): void;\n}\n\nexport function provideDbxButton<S extends DbxButton>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxButton,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n// MARK: Display\nexport type DbxButtonDisplayContentType = 'text_button' | 'icon_button';\n\n/**\n * Delegate class used for retrieving the DbxButtonDisplayContent given an input value.\n */\nexport interface DbxButtonDisplayDelegate<T> {\n /**\n * Returns the DbxButtonDisplayContent for the input value.\n *\n * @param value\n */\n buttonDisplayContentForValue(value: T): DbxButtonDisplayContent;\n}\n\n/**\n * Returns the DbxButtonDisplayContentType given the input content.\n *\n * @param content\n * @returns\n */\nexport function dbxButtonDisplayContentType(content: DbxButtonDisplayContent): DbxButtonDisplayContentType {\n return !content.text && content.icon ? 'icon_button' : 'text_button';\n}\n","import { Directive, OnInit, inject } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../subscription';\nimport { DbxButton } from '../button';\nimport { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Context used for linking a button to an ActionContext and only look for triggers.\n */\n@Directive({\n selector: '[dbxActionButtonTrigger]'\n})\nexport class DbxActionButtonTriggerDirective extends AbstractSubscriptionDirective implements OnInit {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly source = inject(DbxActionContextStoreSourceInstance);\n\n ngOnInit(): void {\n this.sub = this.dbxButton.clicked$.subscribe(() => {\n this._buttonClicked();\n });\n }\n\n protected _buttonClicked(): void {\n this.source.trigger();\n }\n}\n","import { safeDetectChanges } from '../../util/view';\nimport { Directive, OnInit, OnDestroy, ChangeDetectorRef, inject } from '@angular/core';\nimport { DbxActionButtonTriggerDirective } from './action.button.trigger.directive';\nimport { SubscriptionObject } from '@dereekb/rxjs';\n\n/**\n * Context used for linking a button to an ActionContext.\n */\n@Directive({\n selector: '[dbxActionButton]'\n})\nexport class DbxActionButtonDirective extends DbxActionButtonTriggerDirective implements OnInit, OnDestroy {\n private readonly cdRef = inject(ChangeDetectorRef);\n\n private _workingSub = new SubscriptionObject();\n private _disabledSub = new SubscriptionObject();\n\n override ngOnInit(): void {\n super.ngOnInit();\n\n this._workingSub.subscription = this.source.isWorking$.subscribe((working) => {\n this.dbxButton.working = working;\n safeDetectChanges(this.cdRef);\n });\n\n this._disabledSub.subscription = this.source.isDisabled$.subscribe((disabled) => {\n this.dbxButton.disabled = disabled;\n safeDetectChanges(this.cdRef);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._workingSub.destroy();\n this._disabledSub.destroy();\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, OnInit, OnDestroy, Input, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../subscription';\nimport { shareReplay, distinctUntilChanged, switchMap, tap, BehaviorSubject } from 'rxjs';\nimport { DbxButton } from '../button';\nimport { SegueRef, DbxRouterService } from '../../router';\n\n// MARK: Button Directives\n@Directive({\n selector: '[dbxButtonSegue]'\n})\nexport class DbxButtonSegueDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly dbxButton = inject(DbxButton);\n readonly dbxRouterService = inject(DbxRouterService);\n\n private readonly _segueRef = new BehaviorSubject<Maybe<SegueRef>>(undefined);\n readonly segueRef$ = this._segueRef.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n @Input('dbxButtonSegue')\n get segueRef(): Maybe<SegueRef> {\n return this._segueRef.value;\n }\n\n set segueRef(segueRef: Maybe<SegueRef>) {\n this._segueRef.next(segueRef);\n }\n\n ngOnInit(): void {\n this.sub = this.segueRef$\n .pipe(\n switchMap((segueRef) =>\n this.dbxButton.clicked$.pipe(\n tap(() => {\n this.dbxRouterService.go(segueRef);\n })\n )\n )\n )\n .subscribe();\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._segueRef.complete();\n }\n}\n","import { Directive, Input, Output, EventEmitter, OnDestroy, OnInit } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, of, Subject, filter, first, switchMap } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxButton, DbxButtonDisplayContent, DbxButtonDisplayContentType, dbxButtonDisplayContentType, DbxButtonInterceptor, provideDbxButton } from './button';\n\n/**\n * Abstract button component.\n */\n@Directive()\nexport abstract class AbstractDbxButtonDirective extends AbstractSubscriptionDirective implements DbxButton, OnInit, OnDestroy {\n private readonly _disabled = new BehaviorSubject<boolean>(false);\n private readonly _working = new BehaviorSubject<boolean>(false);\n\n /**\n * Pre-interceptor button click.\n */\n protected readonly _buttonClick = new Subject<void>();\n protected readonly _buttonInterceptor = new BehaviorSubject<Maybe<DbxButtonInterceptor>>(undefined);\n\n readonly disabled$ = this._disabled.asObservable();\n readonly working$ = this._working.asObservable();\n\n @Input()\n get disabled(): boolean {\n return this._disabled.value;\n }\n\n set disabled(disabled: Maybe<boolean>) {\n this._disabled.next(disabled ?? false);\n }\n\n @Input()\n get working(): boolean {\n return this._working.value;\n }\n\n set working(working: Maybe<boolean>) {\n this._working.next(working ?? false);\n }\n\n @Input()\n icon?: Maybe<string>;\n\n @Input()\n text?: Maybe<string>;\n\n @Input()\n get buttonDisplay(): DbxButtonDisplayContent {\n return {\n icon: this.icon,\n text: this.text\n };\n }\n\n set buttonDisplay(buttonDisplay: Maybe<DbxButtonDisplayContent>) {\n this.icon = buttonDisplay?.icon;\n this.text = buttonDisplay?.text;\n }\n\n get buttonDisplayType(): DbxButtonDisplayContentType {\n return dbxButtonDisplayContentType(this.buttonDisplay);\n }\n\n @Output()\n readonly buttonClick = new EventEmitter();\n\n readonly clicked$ = this.buttonClick.asObservable();\n\n ngOnInit(): void {\n this.sub = this._buttonClick\n .pipe(\n switchMap(() =>\n this._buttonInterceptor.pipe(\n switchMap((x) => {\n if (x) {\n return x.interceptButtonClick().pipe(first());\n } else {\n return of(true);\n }\n }),\n filter((x) => Boolean(x)) // Ignore false values.\n )\n )\n )\n .subscribe(() => {\n this._forceButtonClicked();\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disabled.complete();\n this._working.complete();\n this._buttonClick.complete();\n this._buttonInterceptor.complete();\n }\n\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n */\n public setButtonInterceptor(interceptor: DbxButtonInterceptor): void {\n this._buttonInterceptor.next(interceptor);\n }\n\n /**\n * Main function to use for handling clicks on the button.\n */\n public clickButton(): void {\n if (!this.disabled) {\n this._buttonClick.next();\n }\n }\n\n /**\n * Forces a button click. Skips the interceptors if any are configured.\n */\n protected _forceButtonClicked(): void {\n this.buttonClick.emit();\n }\n}\n\n// MARK: Implementation\n/**\n * Provides an DbxButton directive.\n */\n@Directive({\n selector: '[dbxButton]',\n exportAs: 'dbxButton',\n providers: provideDbxButton(DbxButtonDirective)\n})\nexport class DbxButtonDirective extends AbstractDbxButtonDirective {}\n","import { Directive, Input, NgZone, inject } from '@angular/core';\nimport { LoadingContext } from '@dereekb/rxjs';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxButton } from './button';\n\n/**\n * Context used for linking a button to a LoadingContext.\n *\n * It will be set working when the context is set loading.\n */\n@Directive({\n selector: '[dbxLoadingButton]'\n})\nexport class DbxLoadingButtonDirective extends AbstractSubscriptionDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly ngZone = inject(NgZone);\n\n /**\n * Sets a LoadingContext that is watched for the loading state.\n */\n @Input('dbxLoadingButton')\n set context(context: LoadingContext) {\n let subscription;\n\n if (context) {\n subscription = context.stream$.subscribe((x) => {\n this.ngZone.run(() => (this.dbxButton.working = x.loading));\n });\n }\n\n this.sub = subscription;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxActionButtonTriggerDirective, DbxActionButtonDirective } from './action';\nimport { DbxButtonDirective } from './button.directive';\nimport { DbxLoadingButtonDirective } from './button.loading.directive';\nimport { DbxButtonSegueDirective } from './router/button.segue.directive';\n\n@NgModule({\n imports: [],\n declarations: [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective],\n exports: [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective]\n})\nexport class DbxCoreButtonModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { DbxAppContextState } from './context';\nimport { onDbxAppContext, fromDbxAppContext } from './state';\nimport { DbxAppContextFullState } from './state/state';\n\n/**\n * State for accessing the app's DbxAppContextState defined within the DbxAppContextFullState for the ngrx store.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppContextService {\n readonly store = inject(Store<DbxAppContextFullState>);\n readonly state$ = this.store.select(fromDbxAppContext.selectDbxAppContextState);\n\n setState(state: DbxAppContextState) {\n this.store.dispatch(onDbxAppContext.DbxAppContextActions.setState({ state }));\n }\n\n resetState() {\n this.store.next(onDbxAppContext.DbxAppContextActions.resetState());\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport { DbxAppContextService } from './context.service';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxAppContextState } from './context';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Used to set the DbxAppContextState for an app to the input state using the DbxAppContextService.\n */\n@Directive({\n selector: '[dbxAppContextState]'\n})\nexport class DbxAppContextStateDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n readonly dbxAppContextStateService = inject(DbxAppContextService);\n\n private readonly _state = new BehaviorSubject<Maybe<DbxAppContextState>>(undefined);\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this._state.pipe(filterMaybe()).subscribe((state) => {\n this.dbxAppContextStateService.setState(state);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._state.complete();\n }\n\n @Input('dbxAppContextState')\n set state(state: Maybe<DbxAppContextState>) {\n this._state.next(state);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\nimport { DbxAppContextStateDirective } from './context.directive';\nimport { fromDbxAppContext } from './state';\n\n@NgModule({\n imports: [StoreModule.forFeature(fromDbxAppContext.featureKey, fromDbxAppContext.reducers)],\n declarations: [DbxAppContextStateDirective],\n exports: [DbxAppContextStateDirective]\n})\nexport class DbxAppContextStateModule {}\n","/**\n * App environment details\n */\nexport abstract class DbxAppEnviroment {\n /**\n * Whether or not this is a production environment.\n */\n abstract production: boolean;\n /**\n * Whether or not this is a testing environment.\n *\n * Generally \"production\" is false when this is true.\n */\n abstract testing?: boolean;\n /**\n * Whether or not this is a staging environment.\n *\n * Generally \"production\" is true when this is true.\n */\n abstract staging?: boolean;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\n\n/**\n * Service for accessing the app's environment details.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppEnviromentService {\n readonly environment = inject(DbxAppEnviroment);\n\n get isProduction() {\n return this.environment.production === true;\n }\n\n get isStaging() {\n return this.environment.staging ?? false;\n }\n\n get isTesting() {\n return this.environment.testing ?? !this.environment.production;\n }\n\n /**\n * Returns the environment, typed as a specific type.\n */\n getEnvironment<T extends DbxAppEnviroment>(): T {\n return this.environment as T;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { asObservableFromGetter, ObservableOrValueGetter } from '@dereekb/rxjs';\nimport { Observable } from 'rxjs';\n\n/**\n * Pipes an ObservableOrValueGetter to an Observable value.\n */\n@Pipe({ name: 'asObservable' })\nexport class AsObservablePipe implements PipeTransform {\n transform<T>(input: ObservableOrValueGetter<T>): Observable<T> {\n return asObservableFromGetter(input);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { AsObservablePipe } from './asobservable.pipe';\n\nconst declarations = [AsObservablePipe];\n\n@NgModule({\n exports: declarations,\n declarations\n})\nexport class DbxAsyncPipeModule {}\n","import { addMinutes } from 'date-fns';\nimport { Pipe, PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatToTimeString, toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and number of minutes and outputs a formatted date.\n */\n@Pipe({ name: 'dateFromPlusTo' })\nexport class DateFromToTimePipe implements PipeTransform {\n private locale = inject(LOCALE_ID);\n\n static formatFromTo(input: Maybe<DateOrDateString>, format: string, minutes: number, locale: string): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n const endDate = addMinutes(date, minutes);\n const dateString = formatDate(date, format, locale);\n return dateString + ' - ' + formatToTimeString(endDate);\n }\n\n return undefined;\n }\n\n transform(input: Maybe<DateOrDateString>, format: string, minutes: number): Maybe<string> {\n return DateFromToTimePipe.formatFromTo(input, format, minutes, this.locale);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'minutesString', pure: false })\nexport class MinutesStringPipe implements PipeTransform {\n transform(input: Maybe<number | string>): Maybe<string> {\n const minutes = Number(input);\n\n if (input != null && !isNaN(minutes)) {\n if (minutes > 3600) {\n const unrounded = minutes / 3600;\n const days = Math.ceil(unrounded);\n return (unrounded !== days ? '~' : '') + days + ' days';\n } else if (minutes > 180) {\n const unrounded = minutes / 60;\n const hours = Math.ceil(unrounded);\n return (unrounded !== hours ? '~' : '') + hours + ' hours';\n } else {\n return minutes + ' minutes';\n }\n } else {\n return undefined;\n }\n }\n}\n","import { isValid } from 'date-fns';\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { toJsDate } from '@dereekb/date';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'toJsDate' })\nexport class ToJsDatePipe implements PipeTransform {\n public static toJsDate(input: DateOrDateString): Date;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date>;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date> {\n let date: Maybe<Date>;\n\n if (input != null) {\n date = toJsDate(input);\n\n if (!isValid(date)) {\n date = undefined;\n }\n }\n\n return date;\n }\n\n transform(input: Maybe<DateOrDateString>): Maybe<Date> {\n return ToJsDatePipe.toJsDate(input);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatDistance, isPast } from 'date-fns';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n@Pipe({ name: 'timeCountdownDistance', pure: false })\nexport class TimeDistanceCountdownPipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, soonString: string = 'Soon', unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n\n if (isPast(from)) {\n return soonString;\n } else {\n const to = new Date();\n return formatDistance(from, to, {\n addSuffix: true\n });\n }\n } else {\n return unavailable;\n }\n }\n}\n\n@Pipe({ name: 'timeDistance', pure: false })\nexport class TimeDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, to?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n return formatDistance(from, to ?? new Date(), {\n addSuffix: true\n });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'toMinutes' })\nexport class ToMinutesPipe implements PipeTransform {\n transform(milliseconds: number): number {\n if (milliseconds) {\n return Math.floor(milliseconds / (60 * 1000));\n }\n\n return milliseconds;\n }\n}\n","import { Pipe, PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { formatDistanceToNow, isValid } from 'date-fns';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\nimport { toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and appends the distance to it in parenthesis.\n */\n@Pipe({ name: 'dateFormatDistance', pure: false })\nexport class DateFormatDistancePipe implements PipeTransform {\n private locale = inject(LOCALE_ID);\n\n transform(input: Maybe<DateOrDateString>, format: string, includeSeconds = false): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n\n if (isValid(date)) {\n const dateString = formatDate(date, format, this.locale);\n\n const distance = formatDistanceToNow(date, {\n includeSeconds,\n addSuffix: true\n });\n\n return `${dateString} (${distance})`;\n }\n }\n\n return undefined;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { formatDateDistance } from '@dereekb/date';\n\n@Pipe({ name: 'dateDistance', pure: false })\nexport class DateDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, inputTo?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n const to = inputTo ?? new Date();\n const from = ToJsDatePipe.toJsDate(input);\n return formatDateDistance(to, from);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatToDayRangeString } from '@dereekb/date';\n\n@Pipe({ name: 'dateDayRange' })\nexport class DateDayRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n@Pipe({ name: 'dateTimeRange' })\nexport class DateTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatToDayTimeRangeString } from '@dereekb/date';\n\n@Pipe({ name: 'dateDayTimeRange' })\nexport class DateDayTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n@Pipe({ name: 'dateTimeRangeOnly' })\nexport class DateTimeRangeOnlyPipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input, undefined, true);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatDateRangeDistance, FormatDateRangeDistanceFunctionConfig } from '@dereekb/date';\n\n@Pipe({ name: 'dateTimeRangeOnlyDistance' })\nexport class DateTimeRangeOnlyDistancePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, config?: FormatDateRangeDistanceFunctionConfig, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatDateRangeDistance(input, { ...config });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { TimezoneString, dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to a system date that represents that date/time.\n */\n@Pipe({ name: 'targetDateToSystemDate', pure: false })\nexport class TargetDateToSystemDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).targetDateToSystemDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { TimezoneString, getTimezoneAbbreviation } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to the proper abbreviation. Uses the input date for the context, or uses now.\n */\n@Pipe({ name: 'timezoneAbbreviation', pure: false })\nexport class TimezoneAbbreviationPipe implements PipeTransform {\n transform(timezone: Maybe<TimezoneString>, input?: Maybe<Date>): Maybe<string> {\n if (timezone) {\n return getTimezoneAbbreviation(timezone, input ?? undefined);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { TimezoneString, dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts the input date and timezone to a target date that represents that date/time for the timezone.\n */\n@Pipe({ name: 'systemDateToTargetDate', pure: false })\nexport class SystemDateToTargetDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).systemDateToTargetDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DateRange, formatDateDistance } from '@dereekb/date';\n\n@Pipe({ name: 'dateRangeDistance', pure: false })\nexport class DateRangeDistancePipe implements PipeTransform {\n transform(input: Maybe<Date | DateRange>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n return formatDateDistance(input as Date, new Date());\n } else {\n return unavailable;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DateFromToTimePipe } from './datefromtoformat.pipe';\nimport { MinutesStringPipe } from './minutesstring.pipe';\nimport { TimeDistanceCountdownPipe, TimeDistancePipe } from './timedistance.pipe';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { ToMinutesPipe } from './tominutes.pipe';\nimport { DateFormatDistancePipe } from './dateformatdistance.pipe';\nimport { DateDistancePipe } from './datedistance.pipe';\nimport { DateDayRangePipe } from './datedayrange.pipe';\nimport { DateTimeRangePipe } from './datetimerange.pipe';\nimport { DateDayTimeRangePipe } from './datedaytimerange.pipe';\nimport { DateTimeRangeOnlyPipe } from './datetimerangeonly.pipe';\nimport { DateTimeRangeOnlyDistancePipe } from './datetimerangeonlydistance.pipe';\nimport { TargetDateToSystemDatePipe } from './targetdatetosystemdate.pipe';\nimport { TimezoneAbbreviationPipe } from './timezoneabbreviation.pipe';\nimport { SystemDateToTargetDatePipe } from './systemdatetotargetdate.pipe';\nimport { DateRangeDistancePipe } from './daterangedistance.pipe';\n\nconst declarations = [\n //\n DateDistancePipe,\n DateRangeDistancePipe,\n TargetDateToSystemDatePipe,\n SystemDateToTargetDatePipe,\n TimezoneAbbreviationPipe,\n DateFromToTimePipe,\n DateDayRangePipe,\n DateDayTimeRangePipe,\n DateTimeRangeOnlyPipe,\n DateTimeRangePipe,\n DateTimeRangeOnlyDistancePipe,\n DateFormatDistancePipe,\n MinutesStringPipe,\n TimeDistanceCountdownPipe,\n TimeDistancePipe,\n ToJsDatePipe,\n ToMinutesPipe\n];\n\n@NgModule({\n declarations,\n exports: declarations\n})\nexport class DbxDatePipeModule {}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'prettyjson' })\nexport class PrettyJsonPipe implements PipeTransform {\n public static toPrettyJson(input: Maybe<unknown>, spacing: number = 2): Maybe<string> {\n let json: Maybe<string>;\n\n if (input) {\n try {\n json = JSON.stringify(input, null, spacing);\n } catch (e) {\n console.error('prettyjson pipe failed parsing input: ', input);\n json = 'ERROR';\n }\n }\n\n return json;\n }\n\n transform(input: Maybe<unknown>, spacing?: number): Maybe<string> {\n return PrettyJsonPipe.toPrettyJson(input, spacing);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PrettyJsonPipe } from './prettyjson.pipe';\n\n@NgModule({\n exports: [PrettyJsonPipe],\n declarations: [PrettyJsonPipe]\n})\nexport class DbxMiscPipeModule {}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { GetterOrValue, getValueFromGetter } from '@dereekb/util';\n\n/**\n * Retrieves the value from the getter. This is a non-pure pipe. Use the getValueOncePipe instead for a pure pipe.\n */\n@Pipe({\n name: 'getValue',\n pure: false\n})\nexport class GetValuePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n\n/**\n * Pipes a GetValuePipe to an Observable value.\n */\n@Pipe({\n name: 'getValueOnce',\n pure: true\n})\nexport class GetValueOncePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { dollarAmountString, Maybe } from '@dereekb/util';\n\n/**\n * Pipe that takes in a number and returns the number formatted as a dollar using dollarAmountString().\n *\n * Can provide a default string value to use when the input is null or undefined.\n */\n@Pipe({ name: 'dollarAmount' })\nexport class DollarAmountPipe implements PipeTransform {\n transform(input: Maybe<number>, defaultIfNull?: Maybe<string>): Maybe<string> {\n return defaultIfNull == null || input != null ? dollarAmountString(input) : defaultIfNull;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DollarAmountPipe } from './dollar.pipe';\nimport { GetValueOncePipe, GetValuePipe } from './getvalue.pipe';\n\nconst declarations = [DollarAmountPipe, GetValuePipe, GetValueOncePipe];\n\n@NgModule({\n exports: declarations,\n declarations\n})\nexport class DbxValuePipeModule {}\n","import { NgModule } from '@angular/core';\nimport { DbxDatePipeModule } from './date/date.pipe.module';\nimport { DbxMiscPipeModule } from './misc/misc.pipe.module';\nimport { DbxAsyncPipeModule } from './async/async.pipe.module';\nimport { DbxValuePipeModule } from './value/value.pipe.module';\n\n@NgModule({\n exports: [DbxAsyncPipeModule, DbxMiscPipeModule, DbxDatePipeModule, DbxValuePipeModule]\n})\nexport class DbxPipesModule {}\n","import { Observable, BehaviorSubject, of, switchMap, shareReplay } from 'rxjs';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { FilterSourceConnector, FilterSource, filterMaybe } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Abstract FilterSourceConnector directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceConnectorDirective<F> implements FilterSourceConnector<F>, FilterSource<F>, OnDestroy {\n private _source = new BehaviorSubject<Maybe<FilterSource<F>>>(undefined);\n\n readonly filter$: Observable<F> = this._source.pipe(\n switchMap((x) => x?.filter$ ?? of(undefined)),\n filterMaybe(),\n shareReplay(1)\n );\n\n ngOnDestroy(): void {\n this._source.complete();\n }\n\n connectWithSource(filterSource: FilterSource<F>): void {\n this._source.next(filterSource);\n }\n}\n","import { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\nimport { forwardRef, Provider, Type } from '@angular/core';\n\n/**\n * Angular provider convenience function for a FilterSource.\n */\nexport function provideFilterSource<S extends FilterSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n/**\n * Angular provider convenience function for a FilterSourceConnector.\n */\nexport function provideFilterSourceConnector<S extends FilterSourceConnector>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSourceConnector,\n useExisting: forwardRef(() => sourceType)\n },\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { of, Observable } from 'rxjs';\nimport { Directive, forwardRef, OnDestroy, OnInit, Provider, Type } from '@angular/core';\nimport { FilterSource, FilterSourceInstance, ObservableOrValue } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { provideFilterSource } from './filter.content';\n\nexport abstract class FilterSourceDirective<F = unknown> implements FilterSource<F> {\n abstract filter$: Observable<F>;\n abstract initWithFilter(filterObs: Observable<F>): void;\n abstract setFilter(filter: F): void;\n abstract resetFilter(): void;\n}\n\n/**\n * Angular provider convenience function for a FilterSourceDirective.\n */\nexport function provideFilterSourceDirective<S extends FilterSourceDirective<F>, F = unknown>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSourceDirective,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideFilterSource(sourceType)\n ];\n}\n\n/**\n * Abstract FilterSource implementation and directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceDirective<F = unknown> implements FilterSourceDirective<F>, OnInit, OnDestroy {\n protected defaultFilterValue?: Maybe<F>;\n\n protected _defaultFilterSource = new FilterSourceInstance<F>();\n\n readonly filter$: Observable<F> = this._defaultFilterSource.filter$;\n\n ngOnInit(): void {\n this._defaultFilterSource.setDefaultFilter(this.makeDefaultFilter());\n }\n\n ngOnDestroy(): void {\n this._defaultFilterSource.destroy();\n }\n\n initWithFilter(filterObs: Observable<F>): void {\n this._defaultFilterSource.initWithFilter(filterObs);\n }\n\n setFilter(filter: F): void {\n this._defaultFilterSource.setFilter(filter);\n }\n\n resetFilter(): void {\n this._defaultFilterSource.resetFilter();\n }\n\n get initialFilterTakesPriority() {\n return this._defaultFilterSource.initialFilterTakesPriority;\n }\n\n set initialFilterTakesPriority(initialFilterTakesPriority: boolean) {\n this._defaultFilterSource.initialFilterTakesPriority = initialFilterTakesPriority;\n }\n\n // MARK: Internal\n protected makeDefaultFilter(): ObservableOrValue<Maybe<F>> {\n return of(this.defaultFilterValue);\n }\n}\n","import { Directive, OnInit, inject } from '@angular/core';\nimport { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\n\n/**\n * Connects the host FilterSource to a FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterConnectSource]'\n})\nexport class DbxFilterConnectSourceDirective<F = unknown> implements OnInit {\n readonly filterSource = inject(FilterSource<F>, { host: true });\n readonly filterSourceConnector = inject(FilterSourceConnector<F>);\n\n ngOnInit(): void {\n this.filterSourceConnector.connectWithSource(this.filterSource);\n }\n}\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceConnectorDirective } from './filter.abstract.connector.directive';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\n\n/**\n * Used as a FilterSource and FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterSourceConnector]',\n providers: [...provideFilterSource(DbxFilterSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterSourceConnectorDirective)]\n})\nexport class DbxFilterSourceConnectorDirective<F = unknown> extends AbstractFilterSourceConnectorDirective<F> {}\n","import { filterMaybe, FilterMapKey, FilterMap } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, OnDestroy, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapInstanceDirective<F> implements OnDestroy {\n protected _key = new BehaviorSubject<Maybe<FilterMapKey>>(undefined);\n\n readonly dbxFilterMap = inject(FilterMap<F>);\n readonly key$ = this._key.pipe(filterMaybe());\n\n readonly instance$ = this.dbxFilterMap.instanceObsForKeyObs(this.key$);\n\n ngOnDestroy(): void {\n this._key.complete();\n }\n}\n","import { FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { switchMap, first, Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { provideFilterSource } from './filter.content';\nimport { AbstractDbxFilterMapInstanceDirective } from './filter.map.instance.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMapSource]',\n exportAs: 'dbxFilterMapSource',\n providers: [provideFilterSource(DbxFilterMapSourceDirective)]\n})\nexport class DbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapInstanceDirective<F> implements FilterSource<F> {\n readonly filter$: Observable<F> = this.instance$.pipe(switchMap((x) => x.filter$));\n\n @Input('dbxFilterMapSource')\n get key(): Maybe<FilterMapKey> {\n return this._key.value;\n }\n\n set key(key: Maybe<FilterMapKey>) {\n this._key.next(key);\n }\n\n initWithFilter(filterObs: Observable<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.initWithFilter(filterObs));\n }\n}\n","import { first } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { FilterSourceConnector, FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Acts as an \"input\" FilterSourceConnector for an FilterMap, as well as a source for the FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterMapSourceConnector]',\n exportAs: 'dbxFilterMapSourceConnector',\n providers: [...provideFilterSource(DbxFilterMapSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)]\n})\nexport class DbxFilterMapSourceConnectorDirective<F> extends DbxFilterMapSourceDirective<F> implements FilterSourceConnector<F> {\n @Input('dbxFilterMapSourceConnector')\n override get key(): Maybe<FilterMapKey> {\n return this._key.value;\n }\n\n override set key(key: Maybe<FilterMapKey>) {\n this._key.next(key);\n }\n\n // MARK: FilterSourceConnector\n connectWithSource(filterSource: FilterSource<F>): void {\n this.instance$.pipe(first()).subscribe((x) => {\n x.connectWithSource(filterSource);\n\n if (filterSource.initWithFilter) {\n filterSource.initWithFilter(this.filter$);\n }\n });\n }\n}\n","import { Directive, OnDestroy, inject } from '@angular/core';\nimport { FilterMap } from '@dereekb/rxjs';\n\n/**\n * Direction that provides an FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMap]',\n exportAs: 'dbxFilterMap',\n providers: [FilterMap]\n})\nexport class DbxFilterMapDirective<F> implements OnDestroy {\n readonly filterMap = inject(FilterMap<F>);\n\n ngOnDestroy(): void {\n this.filterMap.destroy();\n }\n}\n","import { FilterPresetStringRef, FilterWithPreset, FilterWithPresetOptional } from '@dereekb/rxjs';\nimport { EmptyObject, GetterOrValue, Maybe, objectHasKey, objectHasKeys } from '@dereekb/util';\nimport { ClickableAnchorLink } from '../router/anchor/anchor';\n\nexport interface ClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'>, FilterPresetStringRef<P> {\n /**\n * GetterOrValue that retrieves the filter for this preset.\n *\n * A null value or empty object is used for reset.\n */\n readonly presetValue: GetterOrValue<FilterWithPresetOptional<F>> | EmptyObject | null;\n}\n\nexport function isClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string>(preset: object): preset is ClickableFilterPreset<F, P> {\n return objectHasKey(preset, 'presetValue');\n}\n\nexport interface ClickablePartialFilterPreset<F> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'> {\n /**\n * GetterOrValue that retrieves the partial filter value.\n *\n * A null value or empty object is used for no change.\n */\n readonly partialPresetValue: GetterOrValue<Partial<F>> | EmptyObject | null;\n /**\n * The current value to test against. Returns true if this partial preset is considered active.\n */\n readonly isActive: (currentFilter: Maybe<Partial<F>>) => boolean;\n}\n\nexport function isClickablePartialFilterPreset<F>(preset: object): preset is ClickablePartialFilterPreset<F> {\n return objectHasKeys(preset, ['partialPresetValue', 'isActive']);\n}\n\n/**\n * Convenience type for either a ClickableFilterPreset or a ClickablePartialFilterPreset of the same type.\n */\nexport type ClickableFilterPresetOrPartialPreset<F extends FilterWithPreset<P>, P extends string = string> = ClickableFilterPreset<F, P> | ClickablePartialFilterPreset<F>;\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceDirective, provideFilterSourceDirective } from './filter.abstract.source.directive';\n\n/**\n * Basic filter source directive.\n */\n@Directive({\n selector: '[dbxFilterSource]',\n providers: provideFilterSourceDirective(DbxFilterSourceDirective)\n})\nexport class DbxFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DbxFilterMapDirective } from './filter.map.directive';\nimport { DbxFilterMapSourceConnectorDirective } from './filter.map.connector.directive';\nimport { DbxFilterSourceDirective } from './filter.source.directive';\nimport { DbxFilterSourceConnectorDirective } from './filter.connector.directive';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { DbxFilterConnectSourceDirective } from './filter.connect.source.directive';\n\nconst declarations = [DbxFilterSourceDirective, DbxFilterMapSourceConnectorDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceDirective];\n\n@NgModule({\n imports: [CommonModule],\n declarations,\n exports: declarations\n})\nexport class DbxCoreFilterModule {}\n","import { InjectionToken, Injector, NgModuleRef, StaticProvider, TemplateRef, Type, ViewRef } from '@angular/core';\nimport { FactoryWithRequiredInput, filterMaybeValues, Maybe, mergeArrays, mergeObjects } from '@dereekb/util';\n\nexport const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentConfigData');\n\nexport interface DbxInjectionComponentConfig<T = unknown> {\n /**\n * Type of Component to initialize.\n */\n componentClass: Type<T>;\n /**\n * (Optional) providers to provide to the existing injector.\n */\n providers?: StaticProvider[];\n /**\n * (Optional) Custom parent injector to use when creating the component.\n */\n injector?: Injector;\n /**\n * (Optional) Module ref to use when creating the component.\n */\n ngModuleRef?: NgModuleRef<unknown>;\n /**\n * (Optional) Custom initialization code when an instance is created.\n */\n init?: (instance: T) => void;\n /**\n * unknown optional data to inject into the component.\n */\n data?: unknown;\n}\n\n/**\n * The injector may be important to where the dbxInjection is getting injected at. Some types may disallow setting a custom parent injector.\n */\nexport type DbxInjectionComponentConfigWithoutInjector<T = unknown> = Omit<DbxInjectionComponentConfig<T>, 'injector'>;\n\nexport type DbxInjectionComponentConfigFactory<I, T = unknown> = FactoryWithRequiredInput<DbxInjectionComponentConfig<T>, I>;\n\nexport interface DbxInjectionTemplateConfig<T = unknown> {\n /**\n * Template ref to display.\n */\n templateRef?: Maybe<TemplateRef<T>>;\n /**\n * View ref to inject.\n */\n viewRef?: Maybe<ViewRef>;\n}\n\n/**\n * Merges multiple configurations into a single configuration.\n *\n * @param configs\n * @returns\n */\nexport function mergeDbxInjectionComponentConfigs<T = unknown>(configs: Maybe<Partial<DbxInjectionComponentConfig<T>>>[]): Partial<DbxInjectionComponentConfig<T>> {\n const providers = mergeArrays(filterMaybeValues(configs).map((x) => x.providers));\n const result = mergeObjects(configs);\n result.providers = providers;\n return result;\n}\n","import { ComponentRef, Injector, ViewContainerRef } from '@angular/core';\nimport { distinctUntilChanged, map, shareReplay, BehaviorSubject, combineLatest } from 'rxjs';\nimport { DbxInjectionComponentConfig, DbxInjectionTemplateConfig, DBX_INJECTION_COMPONENT_DATA } from './injection';\nimport { Initialized, Destroyable, Maybe, pushItemOrArrayItemsIntoArray } from '@dereekb/util';\nimport { SubscriptionObject, filterMaybe, skipFirstMaybe } from '@dereekb/rxjs';\n\n/**\n * Instance used by components to inject content based on the configuration into the view.\n */\nexport class DbxInjectionInstance<T> implements Initialized, Destroyable {\n private readonly _subscriptionObject = new SubscriptionObject();\n\n private readonly _config = new BehaviorSubject<Maybe<DbxInjectionComponentConfig<T>>>(undefined);\n private readonly _template = new BehaviorSubject<Maybe<DbxInjectionTemplateConfig<T>>>(undefined);\n\n private readonly _content = new BehaviorSubject<Maybe<ViewContainerRef>>(undefined);\n private readonly _componentRef = new BehaviorSubject<Maybe<ComponentRef<T>>>(undefined);\n\n private readonly _injector: Injector;\n\n readonly config$ = this._config.pipe(distinctUntilChanged());\n readonly template$ = this._template.pipe(distinctUntilChanged());\n readonly content$ = this._content.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n get config(): Maybe<DbxInjectionComponentConfig<T>> {\n return this._config.value;\n }\n\n set config(config: Maybe<DbxInjectionComponentConfig<T>>) {\n this._config.next(config);\n }\n\n get template(): Maybe<DbxInjectionTemplateConfig<T>> {\n return this._template.value;\n }\n\n set template(template: Maybe<DbxInjectionTemplateConfig<T>>) {\n this._template.next(template);\n }\n\n get content(): Maybe<Maybe<ViewContainerRef>> {\n return this._content.value;\n }\n\n set content(content: Maybe<Maybe<ViewContainerRef>>) {\n this._content.next(content);\n }\n\n get componentRef(): Maybe<ComponentRef<T>> {\n return this._componentRef.value;\n }\n\n set componentRef(componentRef: Maybe<ComponentRef<T>>) {\n this._componentRef.next(componentRef);\n }\n\n constructor(injector: Injector) {\n this._injector = injector;\n }\n\n init(): void {\n // Wait until the first of either of the two inputs comes in as not defined, and then emit.\n // We filter the first maybe here between the two items.\n const configTemplateObs = combineLatest([this.config$, this.template$]).pipe(\n map(([config, template]) => {\n if (config || template) {\n return {\n config,\n template\n };\n } else {\n return undefined;\n }\n }),\n skipFirstMaybe()\n );\n\n this._subscriptionObject.subscription = combineLatest([configTemplateObs, this.content$]).subscribe(([inputConfig, content]) => {\n const { config, template } = inputConfig ?? {};\n this._reset(content);\n\n if (config) {\n this._initComponent(config, content);\n } else if (template) {\n this._initTemplate(template, content);\n }\n });\n }\n\n destroy(): void {\n this._subscriptionObject.destroy();\n this._config.complete();\n this._template.complete();\n this._content.complete();\n this._componentRef.complete();\n }\n\n private _initComponent(config: DbxInjectionComponentConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { init, injector: inputInjector, providers, ngModuleRef, componentClass, data } = config;\n\n const parentInjector = inputInjector ?? this._injector;\n let injector: Injector | undefined = parentInjector;\n\n if (providers || data) {\n injector = Injector.create({\n parent: parentInjector,\n providers: pushItemOrArrayItemsIntoArray(\n [\n {\n provide: DBX_INJECTION_COMPONENT_DATA,\n useValue: data\n }\n ],\n providers ?? []\n )\n });\n }\n\n const componentRef: ComponentRef<T> = content.createComponent(componentClass, { injector, ngModuleRef });\n\n const instance = componentRef.instance;\n\n if (init) {\n init(instance);\n }\n\n this.componentRef = componentRef;\n }\n\n private _initTemplate(config: DbxInjectionTemplateConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { templateRef, viewRef } = config;\n\n if (templateRef) {\n content.createEmbeddedView(templateRef);\n\n // TODO: Figure out if these items need to be destroyed or not when this item is destroyed. If so, we need a reference to destroy.\n } else if (viewRef) {\n content.insert(viewRef);\n }\n }\n\n private _reset(content: ViewContainerRef): void {\n if (this.componentRef) {\n content.clear();\n this.componentRef = undefined;\n }\n }\n}\n","import { ViewContainerRef, OnInit, OnDestroy, Directive, Injector, inject } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DbxInjectionComponentConfig, DbxInjectionTemplateConfig } from './injection';\nimport { DbxInjectionInstance as DbxInjectionInstance } from './injection.instance';\n\n/**\n * Abstract directive that injects content based on the configuration into the view.\n */\n@Directive()\nexport abstract class AbstractDbxInjectionDirective<T> implements OnInit, OnDestroy {\n private _instance = new DbxInjectionInstance<T>(inject(Injector));\n\n ngOnInit(): void {\n this._instance.init();\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n }\n\n setConfig(config: Maybe<DbxInjectionComponentConfig<T>>) {\n this._instance.config = config;\n }\n\n setTemplate(template: Maybe<DbxInjectionTemplateConfig<T>>) {\n this._instance.template = template;\n }\n\n setContent(content: Maybe<ViewContainerRef>) {\n this._instance.content = content;\n }\n}\n","import { Component, ViewChild, ViewContainerRef, Input } from '@angular/core';\nimport { DbxInjectionComponentConfig, DbxInjectionTemplateConfig } from './injection';\nimport { AbstractDbxInjectionDirective } from './injection.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injection, [dbxInjection], [dbx-injection]',\n template: `\n <ng-template #content></ng-template>\n `\n})\nexport class DbxInjectionComponent<T> extends AbstractDbxInjectionDirective<T> {\n @Input()\n set config(config: Maybe<DbxInjectionComponentConfig<T>>) {\n this.setConfig(config);\n }\n\n @Input()\n set template(template: Maybe<DbxInjectionTemplateConfig<T>>) {\n this.setTemplate(template);\n }\n\n @ViewChild('content', { static: true, read: ViewContainerRef })\n set content(content: Maybe<ViewContainerRef>) {\n this.setContent(content);\n }\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { ChangeDetectionStrategy, Component, Input, OnDestroy, TrackByFunction } from '@angular/core';\nimport { DbxInjectionArrayEntry } from './injection.array';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injection-array',\n template: `\n <ng-container *ngFor=\"let entry of entries$ | async; trackBy: trackByKeyFn\">\n <dbx-injection [config]=\"entry.injectionConfig | asObservable | async\"></dbx-injection>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxInjectionArrayComponent implements OnDestroy {\n private _entries = new BehaviorSubject<DbxInjectionArrayEntry[]>([]);\n readonly entries$ = this._entries.asObservable();\n\n readonly trackByKeyFn: TrackByFunction<DbxInjectionArrayEntry> = (index, item) => item.key;\n\n ngOnDestroy(): void {\n this._entries.complete();\n }\n\n @Input()\n get entries(): DbxInjectionArrayEntry[] {\n return this._entries.getValue();\n }\n\n set entries(entries: Maybe<DbxInjectionArrayEntry[]>) {\n this._entries.next(entries || []);\n }\n}\n","import { Provider, Type } from '@angular/core';\nimport { DbxInjectionComponentConfig } from './injection';\n\n/**\n * DbxInjectedViewContext showContext() configuration.\n */\nexport interface DbxInjectionContextConfig<T = unknown, O = unknown> {\n /**\n * Injected config.\n */\n config: DbxInjectionComponentConfig<T>;\n /**\n * Promise used to retrieve data from the given instance.\n */\n use: (instance: T) => Promise<O>;\n}\n\n/**\n * View that can switch to show another arbitrary view, then switch back when the promise ends.\n *\n * It is similar to *ngIf/*ngSwitch, but the original child content is retained instead of discarded,\n * and returns once the special context is done being used.\n */\nexport abstract class DbxInjectionContext {\n /**\n * Shows the given context until the promise ends, then displays the original content.\n *\n * The original content is hidden instead of removed from the context to avoid destruction of children elements.\n */\n abstract showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T>): Promise<O>;\n\n /**\n * Bails out of any current promise, if one is set.\n *\n * Returns true if the bail signal has been sent.\n */\n abstract resetContext(): boolean;\n}\n\n/**\n * Allows a directive to provide a formly context and form.\n */\nexport function provideDbxInjectionContext<T extends DbxInjectionContext>(type: Type<T>): Provider[] {\n return [\n {\n provide: DbxInjectionContext,\n useExisting: type\n }\n ];\n}\n","import { Directive, EmbeddedViewRef, Injector, Input, TemplateRef, ViewContainerRef, OnDestroy, OnInit, inject } from '@angular/core';\nimport { DbxInjectionContext, DbxInjectionContextConfig, provideDbxInjectionContext } from './injection.context';\nimport { DbxInjectionInstance } from './injection.instance';\nimport { DbxInjectionComponentConfig } from './injection';\nimport { PromiseOrValue, PromiseReference, promiseReference, Maybe } from '@dereekb/util';\n\n/**\n * DbxInjectedViewContext implementation. Acts similar to *ngIf, but instead switches to a different view without destroying the original child view.\n */\n@Directive({\n selector: '[dbxInjectionContext]',\n providers: provideDbxInjectionContext(DbxInjectionContextDirective)\n})\nexport class DbxInjectionContextDirective<O = unknown> implements DbxInjectionContext, OnInit, OnDestroy {\n private readonly _injector = inject(Injector);\n private readonly _templateRef = inject(TemplateRef<O>);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n private _currentPromise: Maybe<PromiseReference<unknown>>;\n private _instance = new DbxInjectionInstance(this._injector);\n private _embeddedView!: EmbeddedViewRef<O>;\n private _isDetached = false;\n\n @Input()\n set config(config: Maybe<DbxInjectionComponentConfig<unknown>>) {\n let reattach = false;\n\n if (config) {\n if (!this._isDetached) {\n // detach the original view before setting config.\n this._viewContainer.detach();\n this._isDetached = true;\n }\n } else if (this._isDetached) {\n reattach = true;\n }\n\n this._instance.config = config;\n\n if (reattach) {\n this._viewContainer.insert(this._embeddedView);\n this._isDetached = false;\n }\n }\n\n ngOnInit() {\n this._instance.content = this._viewContainer;\n this._instance.init();\n this._embeddedView = this._viewContainer.createEmbeddedView(this._templateRef);\n\n // detach the embedded view\n this._viewContainer.detach();\n\n // reattach it through the template configuration.\n // the template configuration acts as the default.\n this._instance.template = {\n viewRef: this._embeddedView\n };\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n this._embeddedView?.destroy(); // destroy our embedded view too.\n }\n\n async showContext<T, O>(config: DbxInjectionContextConfig<T>): Promise<O> {\n // clear the current context before showing something new.\n this.resetContext();\n\n let promiseRef: Maybe<PromiseReference<O>>;\n\n let result: Maybe<O>;\n let error: unknown;\n\n // wait for the promise to resolve and use to finish using that instance.\n try {\n promiseRef = promiseReference(async (resolve, reject) => {\n const injectionConfig: DbxInjectionComponentConfig<T> = {\n ...config.config,\n init: async (instance: T) => {\n // init if available in the base config.\n if (config.config.init) {\n config.config.init(instance);\n }\n\n try {\n const result = (await config.use(instance)) as PromiseOrValue<O>;\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n\n this.config = injectionConfig as DbxInjectionComponentConfig<unknown>;\n });\n\n this._currentPromise = promiseRef as PromiseReference<unknown>;\n\n // await the promise\n await promiseRef.promise;\n } catch (e) {\n error = e;\n }\n\n // if we're still using the same promiseRef\n if (promiseRef && promiseRef === this._currentPromise) {\n // clear the config to reshow the view\n this.config = undefined;\n\n // clear the current promise\n this._currentPromise = undefined;\n }\n\n if (error != null) {\n return Promise.reject(error);\n } else {\n return result as O;\n }\n }\n\n resetContext(): boolean {\n let clearedValue = false;\n\n if (this._currentPromise) {\n const promise = this._currentPromise;\n\n // clear the current promise too\n this._currentPromise = undefined;\n\n // clear the config.\n this.config = undefined;\n\n // send a rejection signal to bail out.\n promise.reject(new Error('dbxInjectionContext bailout'));\n\n clearedValue = true;\n }\n\n return clearedValue;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { DbxAsyncPipeModule } from '../pipe/async/async.pipe.module';\nimport { DbxInjectionArrayComponent } from './injection.array.component';\nimport { DbxInjectionComponent } from './injection.component';\nimport { DbxInjectionContextDirective } from './injection.context.directive';\n\nconst declarations = [DbxInjectionComponent, DbxInjectionArrayComponent, DbxInjectionContextDirective];\n\n@NgModule({\n imports: [CommonModule, DbxAsyncPipeModule],\n declarations,\n exports: declarations\n})\nexport class DbxInjectionComponentModule {}\n","import { Directive, inject } from '@angular/core';\nimport { DbxInjectionContext, DbxInjectionContextConfig } from './injection.context';\n\n/**\n * Abstract DbxInjectionContext implementation that forwards commands to a host DbxInjectionContext.\n *\n * This abstract type is used by related types for dependency injection purposes, so that those types\n * can be injected instead of just any DbxInjectionContext.\n */\n@Directive()\nexport abstract class AbstractForwardDbxInjectionContextDirective implements DbxInjectionContext {\n readonly dbxInjectionContext = inject(DbxInjectionContext, { host: true });\n\n // MARK: DbxInjectionContext\n showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T, unknown>): Promise<O> {\n return this.dbxInjectionContext.showContext(config);\n }\n\n resetContext(): boolean {\n return this.dbxInjectionContext.resetContext();\n }\n}\n","import { asGetter, GetterOrValue, Maybe } from '@dereekb/util';\nimport { switchMapObject } from '@dereekb/rxjs';\nimport { DbxInjectionComponentConfig } from './injection';\nimport { Type } from '@angular/core';\n\n/**\n * Provides a switchMap that passes configuration from the observable, unless the value is null/undefined/true in which case it passes the default configuration.\n *\n * @param defaultConfig\n * @returns\n */\nexport function switchMapDbxInjectionComponentConfig<T extends DbxInjectionComponentConfig<X>, X = any>(defaultConfig?: GetterOrValue<Maybe<T | Type<X>>>) {\n const defaultAsGetter = asGetter(defaultConfig);\n\n return switchMapObject<T>({\n defaultGetter: () => {\n const value = defaultAsGetter();\n\n if (typeof value === 'function') {\n // is a component class\n return { componentClass: value } as T;\n } else {\n return value;\n }\n }\n });\n}\n","import { AbstractType, Injector, Provider, Type } from '@angular/core';\n\nexport type InjectableType<T> = (Type<T> | AbstractType<T>) & Provider;\n\n/**\n * Creates a new instance of the injectable type with the input injector.\n *\n * @param type\n * @param parent\n * @returns\n */\nexport function newWithInjector<T>(type: InjectableType<T>, parent: Injector): T {\n const injector = Injector.create({ providers: [type], parent });\n return injector.get(type);\n}\n","import { map, Observable } from 'rxjs';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Inject, Optional, Injectable, OnDestroy } from '@angular/core';\nimport { LockSet, ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\nexport interface LockSetComponent {\n readonly lockSet: LockSet;\n}\n\nexport interface LockSetComponentStoreConfig {\n parent?: Maybe<Observable<LockSetComponent>>;\n locks?: {\n [key: string]: Observable<boolean>;\n };\n}\n\n/**\n * Abstract ComponentStore extension that provides a LockSet and OnDestroy delaying/cleanup.\n */\n@Injectable()\nexport abstract class LockSetComponentStore<S extends object> extends ComponentStore<S> implements OnDestroy {\n readonly lockSet = new LockSet();\n\n protected lockSetDestroyDelayMs = 2000;\n protected lockSetDestroyTimeoutMs: Maybe<number>;\n\n protected constructor(@Inject(null) @Optional() protected readonly initialState?: S) {\n super(initialState);\n }\n\n // MARK: State Changes\n readonly resetStore = this.updater(() => ({ ...this.initialState } as S));\n\n // MARK: Locks\n protected setupLockSet({ parent, locks }: LockSetComponentStoreConfig): void {\n if (parent) {\n this.setParentLockSet(parent);\n }\n\n if (locks) {\n for (const key in locks) {\n if (locks[key]) {\n this.addLock(key, locks[key]);\n }\n }\n }\n }\n\n setParentLockSet(obs: ObservableOrValue<Maybe<LockSetComponent>>): void {\n this.lockSet.setParentLockSet(asObservable(obs).pipe(map((x) => x?.lockSet)));\n }\n\n addLock(key: string, obs: Observable<boolean>): void {\n this.lockSet.addLock(key, obs);\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.destroyOnNextUnlock(\n {\n fn: () => {\n this._destroyNow();\n },\n timeout: this.lockSetDestroyTimeoutMs\n },\n this.lockSetDestroyDelayMs\n );\n }\n\n /**\n * Completes the cleanup of the object.\n */\n _destroyNow() {\n this.lockSet.destroy();\n }\n}\n","import { Observable, map } from 'rxjs';\nimport { timeHasExpired, unixTimeNumberForNow } from '@dereekb/date';\nimport { DataDoesNotExistError, DataIsExpiredError, ReadStoredData, StoredData, StoredDataStorageKey, StoredDataString, Maybe, hasNonNullValue, splitJoinRemainder } from '@dereekb/util';\nimport { StorageAccessor } from './storage.accessor';\n\n// MARK: SimpleStorageAccessor\nexport interface SimpleStorageAccessorConverter<T> {\n /**\n * Converts the input value to a string.\n */\n stringifyValue(value: T): StoredDataString;\n /**\n * Converts the data string into a value.\n */\n parseValue(data: StoredDataString): T;\n}\n\n/**\n * SimpleStorageAccessor delegate.\n */\nexport interface SimpleStorageAccessorDelegate<T> extends SimpleStorageAccessorConverter<T>, StorageAccessor<StoredDataString> {}\n\nexport class StringifySimpleStorageAccessorConverter<T> implements SimpleStorageAccessorConverter<T> {\n stringifyValue(value: T): StoredDataString {\n return JSON.stringify(value);\n }\n\n parseValue(data: StoredDataString): T {\n return JSON.parse(data);\n }\n}\n\nexport class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {\n private readonly _delegate: StorageAccessor<StoredDataString>;\n private readonly _converter: SimpleStorageAccessorConverter<T>;\n\n constructor(delegate: StorageAccessor<StoredDataString>, converter: SimpleStorageAccessorConverter<T>) {\n this._delegate = delegate;\n this._converter = converter;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return this._delegate.get(key);\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return this._delegate.set(key, value);\n }\n\n remove(key: string): Observable<void> {\n return this._delegate.remove(key);\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n all(prefix?: string): Observable<string[]> {\n return this._delegate.all(prefix);\n }\n\n allKeys(prefix?: string): Observable<string[]> {\n return this._delegate.allKeys(prefix);\n }\n\n stringifyValue(value: T): StoredDataString {\n return this._converter.stringifyValue(value);\n }\n\n parseValue(data: StoredDataString): T {\n return this._converter.parseValue(data);\n }\n}\n\nexport interface SimpleStorageAccessorConfig {\n /**\n * Storage Key Prefix\n */\n readonly prefix: string;\n /**\n * Optional prefix/value splitter.\n */\n readonly prefixSplitter?: string;\n /**\n * Number in milliseconds that objects stored will expire in.\n */\n readonly expiresIn?: number;\n}\n\ninterface ConfiguredSimpleStorageAccessorConfig extends SimpleStorageAccessorConfig {\n readonly prefixSplitter: string;\n readonly fullPrefix: string;\n}\n\nexport function assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void {\n if (!prefixSplitter) {\n throw new Error('Invalid storage key prefix splitter. Must be defined and not empty.'); // TODO(FUTURE): Consider changing to a concrete error type\n }\n\n if (!isValidStorageKeyPrefix(prefix, prefixSplitter)) {\n throw new Error('Invalid storage key prefix.');\n }\n}\n\nexport function isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean {\n return Boolean(prefix && prefix.indexOf(prefixSpltter) === -1);\n}\n\n/**\n * LimitedStorageAccessor implementation that uses a Delegate\n */\nexport class SimpleStorageAccessor<T> implements StorageAccessor<T> {\n static readonly PREFIX_SPLITTER = '::';\n\n private readonly _delegate: SimpleStorageAccessorDelegate<T>;\n protected readonly _config: ConfiguredSimpleStorageAccessorConfig;\n\n constructor(delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig) {\n const prefix = config.prefix;\n const prefixSplitter = config.prefixSplitter ?? SimpleStorageAccessor.PREFIX_SPLITTER;\n\n assertValidStorageKeyPrefix(prefix, prefixSplitter);\n\n const fullPrefix = `${prefix}${prefixSplitter}`;\n\n this._delegate = delegate;\n this._config = {\n ...config,\n prefixSplitter,\n fullPrefix\n };\n }\n\n get delegate() {\n return this._delegate;\n }\n\n get config() {\n return this._config;\n }\n\n // MARK: LimitedStorageAccessor\n get(inputKey: string): Observable<T> {\n const storeKey = this.makeStorageKey(inputKey);\n return this._delegate.get(storeKey).pipe(\n map((storedData: Maybe<string>) => {\n if (storedData) {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n throw new DataIsExpiredError<T>(readStoredData);\n }\n } else {\n throw new DataDoesNotExistError();\n }\n })\n );\n }\n\n set(inputKey: string, inputValue: T): Observable<void> {\n const storeKey = this.makeStorageKey(inputKey);\n const storeData: StoredData = this.buildStoredData(inputValue);\n const data = JSON.stringify(storeData);\n return this._delegate.set(storeKey, data);\n }\n\n remove(key: string): Observable<void> {\n const storeKey = this.makeStorageKey(key);\n return this._delegate.remove(storeKey);\n }\n\n all(): Observable<T[]> {\n return this._delegate.all(this._config.fullPrefix).pipe(\n map((allStoredData) => {\n return allStoredData\n .map((storedData) => {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n return null;\n }\n })\n .filter(hasNonNullValue);\n })\n );\n }\n\n allKeys(): Observable<string[]> {\n return this._delegate.allKeys(this._config.fullPrefix).pipe(map((keys) => keys.map((x) => this.decodeStorageKey(x))));\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n // MARK: Stored Values\n protected readStoredData(storedDataString: StoredDataString): ReadStoredData<T> {\n const storedData: StoredData = JSON.parse(storedDataString);\n const expired = this.isExpiredStoredData(storedData);\n const convertedData = this._delegate.parseValue(storedData.data);\n\n return {\n ...storedData,\n expired,\n convertedData\n };\n }\n\n protected buildStoredData(value: T): StoredData {\n return {\n storedAt: unixTimeNumberForNow(),\n data: this.stringifyValue(value)\n };\n }\n\n protected isExpiredStoredData(storeData: StoredData): boolean {\n const expiresIn = this._config.expiresIn;\n if (expiresIn) {\n if (storeData.storedAt) {\n return timeHasExpired(storeData.storedAt, expiresIn);\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n // MARK: Internal\n protected makeStorageKey(key: string): StoredDataStorageKey {\n return `${this._config.prefix}${this._config.prefixSplitter}${String(key)}`;\n }\n\n protected isKeyOfAccessor(storageKey: StoredDataStorageKey): boolean {\n return storageKey.startsWith(this._config.fullPrefix);\n }\n\n protected decodeStorageKey(storageKey: StoredDataStorageKey): string {\n const split = splitJoinRemainder(storageKey, this._config.prefixSplitter, 2);\n return split[1];\n }\n\n protected stringifyValue(value: T): string {\n return this._delegate.stringifyValue(value);\n }\n}\n","import { filterMaybeValues, StoredDataString, FullStorageObject, StorageObjectUtility, Maybe } from '@dereekb/util';\nimport { Observable, map, shareReplay } from 'rxjs';\nimport { StorageAccessor } from './storage.accessor';\n\n/**\n * Simple StorageAccessor implementation that wraps a FullStorageObject.\n */\nexport class StringStorageAccessor implements StorageAccessor<StoredDataString> {\n private readonly _storage: FullStorageObject;\n\n constructor(storage: FullStorageObject) {\n this._storage = storage;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return new Observable((x) => {\n const value = this._storage.getItem(key);\n x.next(value);\n x.complete();\n });\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.setItem(key, value);\n x.next();\n x.complete();\n });\n }\n\n remove(key: string): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.removeItem(key);\n x.next();\n x.complete();\n });\n }\n\n clear(): Observable<StoredDataString[]> {\n const removed = this._storage.removeAll();\n return new Observable((x) => {\n x.next(removed);\n x.complete();\n });\n }\n\n all(): Observable<StoredDataString[]> {\n return this.allKeys().pipe(\n map((x) => filterMaybeValues(x.map((y) => this._storage.getItem(y)))),\n shareReplay(1)\n );\n }\n\n allKeys(): Observable<string[]> {\n return new Observable((x) => {\n const result = StorageObjectUtility.allKeysFromStorageObject(this._storage);\n x.next(result);\n x.complete();\n });\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const DEFAULT_STORAGE_OBJECT_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_OBJECT');\nexport const DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_ACCESSOR_FACTORY');\n","import { Injectable, inject } from '@angular/core';\nimport { StorageAccessor } from './storage.accessor';\nimport { SimpleStorageAccessorConfig, SimpleStorageAccessor, SimpleStorageAccessorConverter, StringifySimpleStorageAccessorConverter, WrapperSimpleStorageAccessorDelegate } from './storage.accessor.simple';\nimport { StringStorageAccessor } from './storage.accessor.string';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN } from './storage.di';\nimport { FullStorageObject, StoredDataString } from '@dereekb/util';\n\nexport interface StorageAccessorFactoryConfig<T> extends SimpleStorageAccessorConfig {\n storage?: StorageAccessor<StoredDataString>;\n converter?: SimpleStorageAccessorConverter<T>;\n}\n\n/**\n * Used for building SimpleStorageAccessor instances from SimpleStorageAccessorConfig.\n */\n@Injectable()\nexport class SimpleStorageAccessorFactory {\n readonly storageObject = inject<FullStorageObject>(DEFAULT_STORAGE_OBJECT_TOKEN);\n\n createStorageAccessor<T>(config: StorageAccessorFactoryConfig<T>): SimpleStorageAccessor<T> {\n const storage = config.storage ?? new StringStorageAccessor(this.storageObject);\n const converter = config.converter ?? new StringifySimpleStorageAccessorConverter<T>();\n const delegate = new WrapperSimpleStorageAccessorDelegate<T>(storage, converter);\n\n const accessorConfig = {\n prefix: config.prefix\n };\n\n return new SimpleStorageAccessor<T>(delegate, accessorConfig);\n }\n}\n","import { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\n\n/**\n * Stored object accessor that can get/set/remove via a key, or be cleared entirely.\n */\nexport abstract class LimitedStorageAccessor<T> {\n /**\n * Attempts to get the value. Throws a DataDoesNotExistError if not available.\n */\n abstract get(key: string): Observable<Maybe<T>>;\n\n abstract set(key: string, value: Maybe<T>): Observable<void>;\n\n abstract remove(key: string): Observable<void>;\n\n abstract clear(): Observable<object>;\n}\n\n/**\n * LimitedStorageAccessor extension that has knowledge of all stored keys.\n */\nexport abstract class StorageAccessor<T> extends LimitedStorageAccessor<T> {\n /**\n * Returns all values. Filtered by keys of a given prefix.\n */\n abstract all(prefix?: string): Observable<T[]>;\n\n /**\n * Returns all keys. Filtered by keys of a given prefix.\n */\n abstract allKeys(prefix?: string): Observable<string[]>;\n}\n\n/**\n * StorageAccessor-like object that has immediate/synchronous functionality for get/set.\n */\nexport abstract class InstantStorageAccessor<T> {\n abstract getNow(key: string): T | undefined;\n\n abstract setNow(key: string, value: T): void;\n\n abstract removeNow(key: string): void;\n}\n","import { FullStorageObject, Maybe, StorageObject, StorageObjectUtility, StoredDataStorageKey } from '@dereekb/util';\n\n/**\n * StorageObject using LocalStorage.\n */\nexport class FullLocalStorageObject implements FullStorageObject {\n private readonly _localStorage: StorageObject;\n\n constructor(localStorage: StorageObject) {\n this._localStorage = localStorage;\n }\n\n get isPersistant(): boolean {\n return true;\n }\n\n get isAvailable(): boolean {\n const test = '_T_E_S_T_';\n\n try {\n // Tests setting and removing an item. These will throw an\n // exception if the localstorage is not available\n this._localStorage.setItem(test, test);\n this._localStorage.removeItem(test);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n get length(): number {\n return this._localStorage.length;\n }\n\n getItem(key: StoredDataStorageKey): Maybe<string> {\n return this._localStorage.getItem(key);\n }\n\n setItem(key: StoredDataStorageKey, item: string): void {\n this._localStorage.setItem(key, item);\n }\n\n removeItem(key: StoredDataStorageKey): void {\n this._localStorage.removeItem(key);\n }\n\n key(index: number): string | null {\n return this._localStorage.key(index);\n }\n\n removeAll(): string[] {\n const keys = StorageObjectUtility.allKeysFromStorageObject(this);\n keys.forEach((x) => this.removeItem(x));\n return keys;\n }\n}\n","import { SHARED_MEMORY_STORAGE } from '@dereekb/util';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\n\n/**\n * FullStorageObject implementation that uses a localstorage that entirely resides in memory.\n */\nexport class MemoryStorageObject extends FullLocalStorageObject {\n get isLastingStorage(): boolean {\n return false;\n }\n\n override get isAvailable(): boolean {\n return true;\n }\n\n constructor() {\n super(SHARED_MEMORY_STORAGE);\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FullStorageObject } from '@dereekb/util';\nimport { SimpleStorageAccessorFactory } from './storage.accessor.simple.factory';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN } from './storage.di';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\nimport { MemoryStorageObject } from './storage.object.memory';\n\nexport function defaultStorageObjectFactory(): FullStorageObject {\n let storageObject: FullStorageObject = new FullLocalStorageObject(localStorage);\n\n if (!storageObject.isAvailable) {\n storageObject = new MemoryStorageObject();\n }\n\n return storageObject;\n}\n\n@NgModule()\nexport class DbxStorageModule {\n static forRoot(): ModuleWithProviders<DbxStorageModule> {\n return {\n ngModule: DbxStorageModule,\n providers: [\n {\n provide: DEFAULT_STORAGE_OBJECT_TOKEN,\n useFactory: defaultStorageObjectFactory\n },\n {\n provide: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN,\n useClass: SimpleStorageAccessorFactory\n },\n {\n provide: SimpleStorageAccessorFactory,\n useExisting: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN\n }\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["declarations","initialState","reducer","DbxAppContextActions.setState","featureKey","reducers","fromDbxAppContextState.dbxAppContextStateFeatureKey","fromDbxAppContextState.reducer","onDbxAppContext.DbxAppContextActions.setState","DbxAppAuthActions.loggedOut","DbxAppAuthUserActions.setUserIdentifier","DbxAppAuthUserActions.setUserIsOnboarded","DbxAppAuthUserActions.setUserState","DbxAppAuthUserActions.setUserRoles","fromDbxAppAuthUserState.dbxAppAuthUserFeatureKey","fromDbxAppAuthUserState.reducer","onDbxAppAuth.DbxAppAuthActions.loggedOut","onDbxAppAuth.DbxAppAuthActions.loggedIn","onDbxAppAuth.DbxAppAuthActions.logout","onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier","onDbxAppAuth.DbxAppAuthUserActions.setUserState","onDbxAppAuth.DbxAppAuthUserActions.setUserRoles","onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded","i1","i2","fromDbxAppAuth.featureKey","fromDbxAppAuth.reducers","fromDbxAppAuth.selectDbxAppAuthUser","fromDbxAppContext.selectDbxAppContextState","onDbxAppContext.DbxAppContextActions.resetState","fromDbxAppContext.featureKey","fromDbxAppContext.reducers","i2.DbxInject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