{"version":3,"file":"kuoki-environment-angular.mjs","sources":["../../../../packages/environment-angular/src/lib/decorators/environment-prefix.decorator.ts","../../../../packages/environment-angular/src/lib/helpers/is-class.ts","../../../../packages/environment-angular/src/lib/helpers/config-provider-factory.function.ts","../../../../packages/environment-angular/src/lib/helpers/get-options-factory.function.ts","../../../../packages/environment-angular/src/lib/helpers/index.ts","../../../../packages/environment-angular/src/lib/source/environment-sources.token.ts","../../../../packages/environment-angular/src/lib/source/environment-sources-factory.token.ts","../../../../packages/environment-angular/src/lib/source/index.ts","../../../../packages/environment-angular/src/lib/loader/environment-loader.application.ts","../../../../packages/environment-angular/src/lib/loader/index.ts","../../../../packages/environment-angular/src/lib/query/environment-query-config.token.ts","../../../../packages/environment-angular/src/lib/query/environment-query.application.ts","../../../../packages/environment-angular/src/lib/query/index.ts","../../../../packages/environment-angular/src/lib/service/environment-service.application.ts","../../../../packages/environment-angular/src/lib/service/index.ts","../../../../packages/environment-angular/src/lib/store/environment-initial-state.token.ts","../../../../packages/environment-angular/src/lib/store/environment-store.application.ts","../../../../packages/environment-angular/src/lib/store/index.ts","../../../../packages/environment-angular/src/lib/module/environment.module.ts","../../../../packages/environment-angular/src/lib/module/index.ts","../../../../packages/environment-angular/src/lib/decorators/environment-value-decorator-factory.function.ts","../../../../packages/environment-angular/src/lib/decorators/environment-value.decorator.ts","../../../../packages/environment-angular/src/lib/decorators/environment-value-async.decorator.ts","../../../../packages/environment-angular/src/lib/decorators/environment-value-reactive.decorator.ts","../../../../packages/environment-angular/src/lib/decorators/index.ts","../../../../packages/environment-angular/src/lib/guards/can-activate-environment.guard.ts","../../../../packages/environment-angular/src/lib/guards/index.ts","../../../../packages/environment-angular/src/lib/pipes/environment-value.pipe.ts","../../../../packages/environment-angular/src/lib/pipes/environment-value-reactive.pipe.ts","../../../../packages/environment-angular/src/lib/pipes/index.ts","../../../../packages/environment-angular/src/index.ts","../../../../packages/environment-angular/src/kuoki-environment-angular.ts"],"sourcesContent":["import 'reflect-metadata';\n\nimport { isPath, Path } from '@kuoki/environment';\n\n/* eslint-disable @typescript-eslint/ban-types */\n\nexport const ENVIRONMENT_PREFIX_METADATA_KEY: symbol = Symbol.for(`environment-prefix`);\n\n/**\n * Sets a base path for the class used by the other decorators.\n * @param path The EnvironmentState path to resolve.\n * @returns A class decorator to set a base path for the class used by the other decorators.\n */\nexport function EnvironmentPrefix(path: Path): ClassDecorator {\n  return <TFunction extends Function>(target: TFunction): TFunction | void => {\n    if (isPath(path)) {\n      Reflect.defineMetadata(ENVIRONMENT_PREFIX_METADATA_KEY, path, target);\n    }\n  };\n}\n","import { Newable } from 'ts-essentials';\n\n/**\n * Check if the value is a Class.\n * @param value The value to check.\n * @returns `true` if the value is a Class, otherwise `false`.\n */\nexport function isClass<T>(value: unknown): value is Newable<T> {\n  return typeof value === 'function' && 'prototype' in value && /^\\s*class\\s+/.test(value.toString());\n}\n","import { InjectionToken, Provider } from '@angular/core';\n\nimport { isClass } from './is-class';\n\n/**\n * Creates a suitable Provider object using a config value and a default value.\n * @param value The provider values.\n * @returns A suitable Provider.\n */\nexport function configProviderFactory(value: {\n  provide: unknown;\n  defaultValue: unknown;\n  configValue?: unknown;\n  deps?: unknown[];\n  multi?: boolean;\n}): Provider {\n  const providerValue: unknown = value.configValue ?? value.defaultValue;\n\n  if (providerValue instanceof InjectionToken) {\n    return { provide: value.provide, useExisting: providerValue, deps: value.deps, multi: value.multi };\n  }\n\n  if (isClass(providerValue)) {\n    return { provide: value.provide, useClass: providerValue, deps: value.deps, multi: value.multi };\n  }\n\n  if (typeof providerValue === 'function') {\n    return { provide: value.provide, useFactory: providerValue, deps: value.deps, multi: value.multi };\n  }\n\n  return { provide: value.provide, useValue: providerValue, deps: value.deps, multi: value.multi };\n}\n","import { GetOptions, GetOptionsAll, GetOptionsAsync, NonUndefined, Property } from '@kuoki/environment';\nimport { pickBy } from 'lodash-es';\n\n/**\n * A factory to create the GetOptionsAll object.\n * @param options the original GetOptionsAll.\n * @returns A safe GetOptionsAll.\n */\nexport function getOptionsFactory<T extends NonUndefined<Property>, K>(\n  options?: GetOptionsAll<T, K>\n): GetOptionsAll<T, K> {\n  if (options == null) {\n    return {} as GetOptionsAll<T, K>;\n  }\n\n  const getOptions: Record<string, unknown> = {\n    defaultValue: options.defaultValue,\n    targetType: options.targetType,\n    transpile: options.transpile,\n    config: options.config\n  };\n\n  if ('required' in options) {\n    return defined({ ...getOptions, required: options.required }) as GetOptions<T, K>;\n  }\n\n  if ('dueTime' in options) {\n    return defined({ ...getOptions, dueTime: options.dueTime }) as GetOptionsAsync<T, K>;\n  }\n\n  return defined(getOptions) as GetOptionsAll<T, K>;\n}\n\nfunction defined(obj: Record<string, unknown>): Record<string, unknown> {\n  return pickBy(obj, (v) => v !== undefined);\n}\n","/**\n * [[include:helpers/README.md]]\n * @module Helpers\n */\nexport * from './config-provider-factory.function';\nexport * from './get-options-factory.function';\nexport * from './is-class';\nexport * from './or-provider.type';\nexport * from './provider-value.type';\n","import { InjectionToken } from '@angular/core';\nimport { EnvironmentSource } from '@kuoki/environment';\nimport { ArrayOrSingle } from 'ts-essentials';\n\nimport { OrProvider } from '../helpers';\n\n/**\n * The source or list of sources from which to get the environment properties.\n */\nexport const ENVIRONMENT_SOURCES: InjectionToken<ArrayOrSingle<OrProvider<EnvironmentSource>>> = new InjectionToken(\n  'ENVIRONMENT_SOURCES'\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { EnvironmentSource } from '@kuoki/environment';\nimport { ArrayOrSingle } from 'ts-essentials';\n\nimport { isClass, OrProvider } from '../helpers';\nimport { ENVIRONMENT_SOURCES } from './environment-sources.token';\n\n/**\n * The environment sources as single injected source or array of injected sources.\n */\nexport const ENVIRONMENT_SOURCES_FACTORY: InjectionToken<EnvironmentSource[]> = new InjectionToken(\n  'ENVIRONMENT_SOURCES_FACTORY',\n  {\n    factory: () => {\n      const sources: ArrayOrSingle<OrProvider<EnvironmentSource>> | null = inject(ENVIRONMENT_SOURCES, {\n        optional: true\n      });\n\n      if (!Array.isArray(sources)) {\n        return sources;\n      }\n\n      const sourceObjects: EnvironmentSource[] = sources\n        .map((source: OrProvider<EnvironmentSource>) => (isClass(source) ? inject(source) : source))\n        .map((source: OrProvider<EnvironmentSource>) => source as EnvironmentSource)\n        .filter((source: EnvironmentSource) => source != null);\n\n      if (sourceObjects.length === 0) {\n        return null;\n      }\n\n      return sourceObjects.length === 1 ? sourceObjects[0] : sourceObjects;\n    }\n  }\n);\n","/**\n * [[include:source/README.md]]\n * @module EnvironmentSource\n */\nexport * from './environment-sources.token';\nexport * from './environment-sources-factory.token';\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport {\n  DefaultEnvironmentLoader as OriginalEnvironmentLoader,\n  EnvironmentService,\n  EnvironmentSource\n} from '@kuoki/environment';\nimport { ArrayOrSingle } from 'ts-essentials';\n\nimport { ENVIRONMENT_SOURCES_FACTORY } from '../source';\n\n@Injectable()\nexport class DefaultEnvironmentLoader extends OriginalEnvironmentLoader {\n  constructor(\n    protected override readonly service: EnvironmentService,\n\n    @Optional()\n    @Inject(ENVIRONMENT_SOURCES_FACTORY)\n    protected override readonly sources?: ArrayOrSingle<EnvironmentSource> | null\n  ) {\n    super(service, sources);\n  }\n}\n","/**\n * [[include:loader/README.md]]\n * @module EnvironmentLoader\n */\nexport * from './environment-loader.application';\n","import { InjectionToken } from '@angular/core';\nimport { EnvironmentQueryConfig } from '@kuoki/environment';\n\n/**\n * Configuration parameters for the environment query.\n */\nexport const ENVIRONMENT_QUERY_CONFIG: InjectionToken<EnvironmentQueryConfig> = new InjectionToken(\n  'ENVIRONMENT_QUERY_CONFIG'\n);\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport {\n  DefaultEnvironmentQuery as OriginalEnvironmentQuery,\n  EnvironmentQueryConfig,\n  EnvironmentStore\n} from '@kuoki/environment';\n\nimport { ENVIRONMENT_QUERY_CONFIG } from './environment-query-config.token';\n\n@Injectable()\nexport class DefaultEnvironmentQuery extends OriginalEnvironmentQuery {\n  constructor(\n    protected override readonly store: EnvironmentStore,\n\n    @Optional()\n    @Inject(ENVIRONMENT_QUERY_CONFIG)\n    protected override readonly queryConfig?: EnvironmentQueryConfig | null\n  ) {\n    super(store, queryConfig);\n  }\n}\n","/**\n * [[include:query/README.md]]\n * @module EnvironmentQuery\n */\nexport * from './environment-query.application';\nexport * from './environment-query-config.token';\n","import { Injectable } from '@angular/core';\nimport { DefaultEnvironmentService as OriginalEnvironmentService, EnvironmentStore } from '@kuoki/environment';\n\n@Injectable()\nexport class DefaultEnvironmentService extends OriginalEnvironmentService {\n  constructor(protected override readonly store: EnvironmentStore) {\n    super(store);\n  }\n}\n","/**\n * [[include:service/README.md]]\n * @module EnvironmentService\n */\nexport * from './environment-service.application';\n","import { InjectionToken } from '@angular/core';\nimport { EnvironmentState } from '@kuoki/environment';\n\n/**\n * The initial state for the environment store.\n */\nexport const ENVIRONMENT_INITIAL_STATE: InjectionToken<EnvironmentState> = new InjectionToken(\n  'ENVIRONMENT_INITIAL_STATE',\n  {\n    providedIn: 'root',\n    factory: () => ({})\n  }\n);\n","import { Inject, Injectable } from '@angular/core';\nimport { DefaultEnvironmentStore as OriginalEnvironmentStore, EnvironmentState } from '@kuoki/environment';\n\nimport { ENVIRONMENT_INITIAL_STATE } from './environment-initial-state.token';\n\n@Injectable()\nexport class DefaultEnvironmentStore extends OriginalEnvironmentStore {\n  constructor(\n    @Inject(ENVIRONMENT_INITIAL_STATE)\n    protected override readonly initialState: EnvironmentState = {}\n  ) {\n    super(initialState);\n  }\n}\n","/**\n * [[include:store/README.md]]\n * @module EnvironmentStore\n */\nexport * from './environment-initial-state.token';\nexport * from './environment-store.application';\n","import { CommonModule } from '@angular/common';\nimport { APP_INITIALIZER, Inject, Injector, ModuleWithProviders, NgModule } from '@angular/core';\nimport { EnvironmentLoader, EnvironmentQuery, EnvironmentService, EnvironmentStore } from '@kuoki/environment';\n\nimport { configProviderFactory } from '../helpers';\nimport { DefaultEnvironmentLoader } from '../loader';\nimport { DefaultEnvironmentQuery, ENVIRONMENT_QUERY_CONFIG } from '../query';\nimport { DefaultEnvironmentService } from '../service';\nimport { ENVIRONMENT_SOURCES, ENVIRONMENT_SOURCES_FACTORY } from '../source';\nimport { DefaultEnvironmentStore, ENVIRONMENT_INITIAL_STATE } from '../store';\nimport { EnvironmentAngularChildConfig, EnvironmentModuleConfig } from './environment-module-config.interface';\n\nfunction loadBeforeInitFactory(loader: EnvironmentLoader): () => Promise<void> {\n  return () => loader.load();\n}\n\n@NgModule({ imports: [CommonModule] })\nexport class EnvironmentModule {\n  private static _query?: EnvironmentQuery;\n\n  /**\n   * The singleton instance of EnvironmentQuery.\n   * @throws If EnvironmentQuery is not provided.\n   */\n  static get query(): EnvironmentQuery | undefined {\n    return EnvironmentModule._query;\n  }\n\n  /**\n   * Initializes the EnvironmentModule with all the required services.\n   * @param config Customizes the environment behavior and services.\n   * @returns The EnvironmentModule with all the required services.\n   */\n  static forRoot(config?: EnvironmentModuleConfig): ModuleWithProviders<EnvironmentModule> {\n    return {\n      ngModule: EnvironmentModule,\n      providers: [\n        configProviderFactory({\n          provide: ENVIRONMENT_INITIAL_STATE,\n          configValue: config?.initialState,\n          defaultValue: {}\n        }),\n        configProviderFactory({\n          provide: EnvironmentStore,\n          configValue: config?.store,\n          defaultValue: DefaultEnvironmentStore\n        }),\n        configProviderFactory({\n          provide: EnvironmentService,\n          configValue: config?.service,\n          defaultValue: DefaultEnvironmentService,\n          deps: [EnvironmentStore]\n        }),\n        configProviderFactory({\n          provide: ENVIRONMENT_QUERY_CONFIG,\n          configValue: config?.queryConfig,\n          defaultValue: null\n        }),\n        configProviderFactory({\n          provide: EnvironmentQuery,\n          configValue: config?.query,\n          defaultValue: DefaultEnvironmentQuery,\n          deps: [EnvironmentStore, ENVIRONMENT_QUERY_CONFIG]\n        }),\n        configProviderFactory({\n          provide: ENVIRONMENT_SOURCES,\n          configValue: config?.sources,\n          defaultValue: null\n        }),\n        configProviderFactory({\n          provide: EnvironmentLoader,\n          configValue: config?.loader,\n          defaultValue: DefaultEnvironmentLoader,\n          deps: [EnvironmentService, ENVIRONMENT_SOURCES_FACTORY]\n        }),\n        config?.loadBeforeInit ?? true\n          ? {\n              provide: APP_INITIALIZER,\n              useFactory: loadBeforeInitFactory,\n              deps: [EnvironmentLoader],\n              multi: true\n            }\n          : []\n      ]\n    };\n  }\n\n  static forChild(config?: EnvironmentAngularChildConfig): ModuleWithProviders<EnvironmentModule> {\n    return {\n      ngModule: EnvironmentModule,\n      providers: [\n        configProviderFactory({\n          provide: ENVIRONMENT_SOURCES,\n          configValue: config?.sources,\n          defaultValue: null\n        }),\n        configProviderFactory({\n          provide: EnvironmentLoader,\n          configValue: config?.loader,\n          defaultValue: DefaultEnvironmentLoader,\n          deps: [EnvironmentService, ENVIRONMENT_SOURCES_FACTORY]\n        })\n      ]\n    };\n  }\n\n  constructor(@Inject(Injector) protected readonly injector: Injector) {\n    const query: EnvironmentQuery | null = this.injector.get(EnvironmentQuery, null);\n\n    if (query == null) {\n      throw new Error(\n        'An instance of EnvironmentQuery is required. ' +\n          'Use EnvironmentModule.forRoot() or provide the EnvironmentQuery service'\n      );\n    }\n\n    EnvironmentModule._query = query;\n  }\n}\n","/**\n * [[include:module/README.md]]\n * @module EnvironmentModule\n */\nexport * from './environment.module';\nexport * from './environment-module-config.interface';\n","import 'reflect-metadata';\n\nimport { GetOptionsAll, NonUndefined, Path, prefixPath, Property } from '@kuoki/environment';\nimport { Observable } from 'rxjs';\nimport { Newable } from 'ts-essentials';\n\nimport { getOptionsFactory } from '../helpers';\nimport { ENVIRONMENT_PREFIX_METADATA_KEY } from './environment-prefix.decorator';\nimport { GetOptionsDecorator } from './get-options-decorator.type';\n\nexport type EnvironmentValueDecoratorMethodReturn<T> = T | Observable<T | unknown> | Promise<T | unknown> | unknown;\n\nexport function environmentValueDecoratorFactory<T extends NonUndefined<Property>, K = T>({\n  getEnvironmentValueFn,\n  path,\n  options\n}: {\n  getEnvironmentValueFn: (path: Path, options: GetOptionsAll<T, K>) => EnvironmentValueDecoratorMethodReturn<T>;\n  path: Path;\n  options?: GetOptionsAll<T, K> & GetOptionsDecorator;\n}): PropertyDecorator | MethodDecorator {\n  return (\n    target: object,\n    propertyKey: PropertyKey,\n    descriptor?: TypedPropertyDescriptor<T>\n  ): TypedPropertyDescriptor<T> | void => {\n    if (descriptor?.value != null) {\n      return descriptor;\n    }\n\n    const metadataKey: symbol = Symbol.for(`environment-value-decorator:${String(propertyKey)}`);\n\n    const localDescriptor: TypedPropertyDescriptor<T> =\n      descriptor != null\n        ? descriptor\n        : {\n            enumerable: true,\n            configurable: true\n          };\n\n    localDescriptor.get = function <THIS extends Newable<object>>(this: THIS): T {\n      let value: unknown = Reflect.getMetadata(metadataKey, this);\n\n      if (value === undefined) {\n        const prefixDecorator: Path | undefined = Reflect.getMetadata(\n          ENVIRONMENT_PREFIX_METADATA_KEY,\n          target.constructor\n        );\n        const localPath: Path = prefixDecorator != null ? prefixPath(path, prefixDecorator) : path;\n        const getOptions: GetOptionsAll<T, K> = getOptionsFactory<T, K>(options);\n        value = getEnvironmentValueFn(localPath, getOptions);\n\n        if (options?.static !== false) {\n          Reflect.defineMetadata(metadataKey, value, this);\n        }\n      }\n\n      return value as T;\n    };\n\n    localDescriptor.set = function <THIS extends Newable<object>>(this: THIS, value: T) {\n      Reflect.defineMetadata(metadataKey, value, this);\n    };\n\n    Object.defineProperty(target, propertyKey, localDescriptor);\n  };\n}\n","import { GetOptions, NonUndefined, Path, Property } from '@kuoki/environment';\n\nimport { EnvironmentModule } from '../module';\nimport { environmentValueDecoratorFactory } from './environment-value-decorator-factory.function';\nimport { GetOptionsDecorator } from './get-options-decorator.type';\n\n/**\n * Gets the synchronous value at path from environment if the property is undefined.\n * @param path The EnvironmentState path to resolve.\n * @param options The options to get the value and set the property.\n * @returns A property decorator to get the property with the value at path from environment.\n */\nexport function EnvironmentValue<T extends NonUndefined<Property>, K = T>(\n  path: Path,\n  options?: GetOptions<T, K> & GetOptionsDecorator\n): PropertyDecorator;\n\n/**\n * Gets the synchronous value at path from environment if the getter returns undefined.\n * @param path The EnvironmentState path to resolve.\n * @param options The options to get the value and set the property.\n * @returns A property decorator to get the property with the value at path from environment.\n */\nexport function EnvironmentValue<T extends NonUndefined<Property>, K = T>(\n  path: Path,\n  options?: GetOptions<T, K> & GetOptionsDecorator\n): MethodDecorator;\n\nexport function EnvironmentValue<T extends NonUndefined<Property>, K = T>(\n  path: Path,\n  options?: GetOptions<T, K> & GetOptionsDecorator\n): PropertyDecorator | MethodDecorator {\n  return environmentValueDecoratorFactory({\n    getEnvironmentValueFn: (_path: Path, _options: GetOptions<T, K>) => EnvironmentModule.query?.get(_path, _options),\n    path,\n    options\n  });\n}\n","import { GetOptionsAsync, NonUndefined, Path, Property } from '@kuoki/environment';\n\nimport { EnvironmentModule } from '../module';\nimport { environmentValueDecoratorFactory } from './environment-value-decorator-factory.function';\nimport { GetOptionsDecorator } from './get-options-decorator.type';\n\n/**\n * Gets the value at path from environment as Promise if the property is undefined.\n * @param path The EnvironmentState path to resolve.\n * @param options The options to get the value and set the property.\n * @returns A property decorator to get the property with the value at path from environment.\n */\nexport function EnvironmentValueAsync<T extends NonUndefined<Property>, K = T>(\n  path: Path,\n  options?: GetOptionsAsync<T, K> & GetOptionsDecorator\n): PropertyDecorator;\n\n/**\n * Gets the value at path from environment as Promise if the getter returns undefined.\n * @param path The EnvironmentState path to resolve.\n * @param options The options to get the value and set the property.\n * @returns A property decorator to get the property with the value at path from environment.\n */\nexport function EnvironmentValueAsync<T extends NonUndefined<Property>, K = T>(\n  path: Path,\n  options?: GetOptionsAsync<T, K> & GetOptionsDecorator\n): MethodDecorator;\n\nexport function EnvironmentValueAsync<T extends NonUndefined<Property>, K = T>(\n  path: Path,\n  options?: GetOptionsAsync<T, K> & GetOptionsDecorator\n): PropertyDecorator | MethodDecorator {\n  return environmentValueDecoratorFactory({\n    getEnvironmentValueFn: (_path: Path, _options: GetOptionsAsync<T, K>) =>\n      EnvironmentModule.query?.getAsync(_path, _options),\n    path,\n    options\n  });\n}\n","import { GetOptionsReactive, NonUndefined, Path, Property } from '@kuoki/environment';\n\nimport { EnvironmentModule } from '../module';\nimport { environmentValueDecoratorFactory } from './environment-value-decorator-factory.function';\nimport { GetOptionsDecorator } from './get-options-decorator.type';\n\n/**\n * Gets the value at path from environment as Observable if the property is undefined.\n * @param path The EnvironmentState path to resolve.\n * @param options The options to get the value and set the property.\n * @returns A property decorator to get the property with the value at path from environment.\n */\nexport function EnvironmentValue$<T extends NonUndefined<Property>, K = T>(\n  path: Path,\n  options?: GetOptionsReactive<T, K> & GetOptionsDecorator\n): PropertyDecorator;\n\n/**\n * Gets the value at path from environment as Observable if the getter returns undefined.\n * @param path The EnvironmentState path to resolve.\n * @param options The options to get the value and set the property.\n * @returns A property decorator to get the property with the value at path from environment.\n */\nexport function EnvironmentValue$<T extends NonUndefined<Property>, K = T>(\n  path: Path,\n  options?: GetOptionsReactive<T, K> & GetOptionsDecorator\n): MethodDecorator;\n\nexport function EnvironmentValue$<T extends NonUndefined<Property>, K = T>(\n  path: Path,\n  options?: GetOptionsReactive<T, K> & GetOptionsDecorator\n): PropertyDecorator | MethodDecorator {\n  return environmentValueDecoratorFactory({\n    getEnvironmentValueFn: (_path: Path, _options: GetOptionsReactive<T, K>) =>\n      EnvironmentModule.query?.get$(_path, _options),\n    path,\n    options\n  });\n}\n","/**\n * [[include:decorators/README.md]]\n * @module Decorators\n */\nexport * from './environment-prefix.decorator';\nexport * from './environment-value.decorator';\nexport * from './environment-value-async.decorator';\nexport * from './environment-value-decorator-factory.function';\nexport * from './environment-value-reactive.decorator';\nexport * from './get-options-decorator.type';\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, Router, UrlTree } from '@angular/router';\nimport { AtLeastOne, EnvironmentQuery, Path } from '@kuoki/environment';\nimport { get } from 'lodash-es';\nimport { delay, filter, merge, Observable, of } from 'rxjs';\n\n/**\n * Prevent path to be activated if required environment properties doesn't exist.\n */\n@Injectable()\nexport class CanActivateEnvironment {\n  /**\n   * The array of properties needed to activate the path.\n   */\n  protected readonly properties?: AtLeastOne<Path>;\n\n  /**\n   * The path to redirect on activation error.\n   */\n  protected readonly urlOnError?: string | UrlTree;\n\n  /**\n   * The time to wait until properties are resolved.\n   */\n  protected readonly dueTime?: number;\n\n  /**\n   * The path to manage properties on route Data.\n   */\n  protected readonly dataPath = 'canActivateEnvironment';\n\n  constructor(protected readonly router: Router, protected readonly query: EnvironmentQuery) {}\n\n  canActivate(route: ActivatedRouteSnapshot): Observable<boolean | UrlTree> {\n    const properties: unknown = this.getProperties(route);\n\n    if (!this.isNotEmptyProperties(properties)) {\n      return of(true);\n    }\n\n    const dueTime: number | undefined = this.getDueTime(route);\n    const urlTree: UrlTree | undefined = this.getUrlTree(route);\n\n    const containsAll$: Observable<boolean> = this.query\n      .containsAll$(...properties)\n      .pipe(filter((value: boolean) => value === true));\n\n    if (dueTime != null) {\n      const timeout$: Observable<boolean | UrlTree> = of(urlTree ?? false).pipe(delay(dueTime));\n\n      return merge(timeout$, containsAll$);\n    }\n\n    return containsAll$;\n  }\n\n  protected getProperties(route: ActivatedRouteSnapshot): unknown {\n    return get(route, `data.${this.dataPath}.properties`, this.properties);\n  }\n\n  protected getUrlTree(route: ActivatedRouteSnapshot): UrlTree | undefined {\n    const urlOnError: unknown = get(route, `data.${this.dataPath}.urlOnError`, this.urlOnError);\n\n    if (typeof urlOnError === 'string') {\n      return this.router.parseUrl(urlOnError);\n    }\n\n    return urlOnError instanceof UrlTree ? urlOnError : undefined;\n  }\n\n  protected isNotEmptyProperties(properties: unknown): properties is AtLeastOne<Path> {\n    return properties != null && Array.isArray(properties) && properties.length > 0;\n  }\n\n  protected getDueTime(route: ActivatedRouteSnapshot): number | undefined {\n    const due: unknown = get(route, `data.${this.dataPath}.dueTime`);\n\n    return typeof due === 'number' ? due : this.dueTime;\n  }\n}\n","/**\n * [[include:guards/README.md]]\n * @module Guards\n */\nexport * from './can-activate-environment.guard';\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { GetOptions, NonUndefined, Path, pathAsString, Property } from '@kuoki/environment';\n\nimport { EnvironmentModule } from '../module';\n\n/**\n * Renders the value from EnvironmentState or the path if value is undefined.\n */\n@Pipe({ name: 'envValue' })\nexport class EnvironmentValuePipe implements PipeTransform {\n  /**\n   * Transforms the value from EnvironmentState or the path if value is undefined.\n   * @template T The EnvironmentState property type.\n   * @template K The expected property target type.\n   * @param path The EnvironmentState path to resolve.\n   * @param config The options to get a property.\n   * @returns The value from EnvironmentState or the path if value is undefined.\n   * @see EnvironmentQuery#get\n   */\n  transform<T extends NonUndefined<Property>, K = T>(\n    path: Path,\n    config?: GetOptions<T, K>\n  ): NonUndefined<T | K> | string {\n    const value: T | K | undefined = EnvironmentModule.query?.get<T, K>(path, config);\n\n    return value !== undefined ? (value as NonUndefined<T | K>) : pathAsString(path);\n  }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { GetOptionsReactive, NonUndefined, Path, pathAsString, Property } from '@kuoki/environment';\nimport { map, Observable, of } from 'rxjs';\n\nimport { EnvironmentModule } from '../module';\n\n/**\n * Renders the value as Observable from EnvironmentState or the path as Observable if value is undefined.\n */\n@Pipe({ name: 'environmentValue$' })\nexport class EnvironmentValueReactivePipe implements PipeTransform {\n  /**\n   * Transforms the value as Observable from EnvironmentState or the path as Observable if value is undefined.\n   * @template T The EnvironmentState property type.\n   * @template K The expected property target type.\n   * @param path The EnvironmentState path to resolve.\n   * @param config The options to get a property as Observable.\n   * @returns The value as Observable from EnvironmentState or the path as Observable if value is undefined.\n   * @see EnvironmentQuery#get$\n   */\n  transform<T extends NonUndefined<Property>, K = T>(\n    path: Path,\n    config?: GetOptionsReactive<T, K>\n  ): Observable<NonUndefined<T | K> | string> {\n    return (\n      EnvironmentModule.query\n        ?.get$<T, K>(path, config)\n        .pipe(map((value?: T | K) => (value !== undefined ? (value as NonUndefined<T | K>) : pathAsString(path)))) ??\n      of(pathAsString(path))\n    );\n  }\n}\n","/**\n * [[include:pipes/README.md]]\n * @module Pipes\n */\nexport * from './environment-value.pipe';\nexport * from './environment-value-reactive.pipe';\n","/**\n * @module EnvironmentAngular\n */\nexport * from './lib/decorators/index';\nexport * from './lib/guards/index';\nexport * from './lib/helpers/index';\nexport * from './lib/loader/index';\nexport * from './lib/module/environment.module';\nexport * from './lib/pipes/index';\nexport * from './lib/query/index';\nexport * from './lib/service/index';\nexport * from './lib/source/index';\nexport * from './lib/store/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["OriginalEnvironmentLoader","OriginalEnvironmentQuery","OriginalEnvironmentService","OriginalEnvironmentStore","i1","i2"],"mappings":";;;;;;;;;;;AAIA;AAEa,MAAA,+BAA+B,GAAW,MAAM,CAAC,GAAG,CAAC,CAAoB,kBAAA,CAAA,EAAE;AAExF;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,IAAU,EAAA;IAC1C,OAAO,CAA6B,MAAiB,KAAsB;AACzE,QAAA,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE;YAChB,OAAO,CAAC,cAAc,CAAC,+BAA+B,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACvE,SAAA;AACH,KAAC,CAAC;AACJ;;ACjBA;;;;AAIG;AACG,SAAU,OAAO,CAAI,KAAc,EAAA;AACvC,IAAA,OAAO,OAAO,KAAK,KAAK,UAAU,IAAI,WAAW,IAAI,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;AACtG;;ACLA;;;;AAIG;AACG,SAAU,qBAAqB,CAAC,KAMrC,EAAA;IACC,MAAM,aAAa,GAAY,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,YAAY,CAAC;IAEvE,IAAI,aAAa,YAAY,cAAc,EAAE;QAC3C,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,CAA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