{"version":3,"file":"_not_found-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/di/src/injector.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/di/src/not_found.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Constructor, InjectionToken} from './injection_token';\nimport {NotFound} from './not_found';\n\nexport interface Injector {\n  retrieve<T>(token: InjectionToken<T>, options?: unknown): T | NotFound;\n}\n\n/**\n * Current injector value used by `inject`.\n * - `undefined`: it is an error to call `inject`\n * - `null`: `inject` can be called but there is no injector (limp-mode).\n * - Injector instance: Use the injector for resolution.\n */\nlet _currentInjector: Injector | undefined | null = undefined;\n\nexport function getCurrentInjector(): Injector | undefined | null {\n  return _currentInjector;\n}\n\nexport function setCurrentInjector(\n  injector: Injector | null | undefined,\n): Injector | undefined | null {\n  const former = _currentInjector;\n  _currentInjector = injector;\n  return former;\n}\n\nexport function inject<T>(token: InjectionToken<T> | Constructor<T>): T;\nexport function inject<T>(\n  token: InjectionToken<T> | Constructor<T>,\n  options?: unknown,\n): T | NotFound {\n  const currentInjector = getCurrentInjector();\n  if (!currentInjector) {\n    throw new Error('Current injector is not set.');\n  }\n  if (!(token as InjectionToken<T>).ɵprov) {\n    throw new Error('Token is not an injectable');\n  }\n  return currentInjector.retrieve(token as InjectionToken<T>, options);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Value returned if the key-value pair couldn't be found in the context\n * hierarchy.\n */\nexport const NOT_FOUND: unique symbol = Symbol('NotFound');\n\n/**\n * Error thrown when the key-value pair couldn't be found in the context\n * hierarchy. Context can be attached below.\n */\nexport class NotFoundError extends Error {\n  override readonly name: string = 'ɵNotFound';\n  constructor(message: string) {\n    super(message);\n  }\n}\n\n/**\n * Type guard for checking if an unknown value is a NotFound.\n */\nexport function isNotFound(e: unknown): e is NotFound {\n  return e === NOT_FOUND || (e as NotFoundError)?.name === 'ɵNotFound';\n}\n\n/**\n * Type union of NotFound and NotFoundError.\n */\nexport type NotFound = typeof NOT_FOUND | NotFoundError;\n"],"names":[],"mappings":";;;;;;AAqBA,IAAI,gBAAgB,GAAgC,SAAS;SAE7C,kBAAkB,GAAA;AAChC,EAAA,OAAO,gBAAgB;AACzB;AAEM,SAAU,kBAAkB,CAChC,QAAqC,EAAA;EAErC,MAAM,MAAM,GAAG,gBAAgB;AAC/B,EAAA,gBAAgB,GAAG,QAAQ;AAC3B,EAAA,OAAO,MAAM;AACf;AAGM,SAAU,MAAM,CACpB,KAAyC,EACzC,OAAiB,EAAA;AAEjB,EAAA,MAAM,eAAe,GAAG,kBAAkB,EAAE;EAC5C,IAAI,CAAC,eAAe,EAAE;AACpB,IAAA,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC;AACjD,EAAA;AACA,EAAA,IAAI,CAAE,KAA2B,CAAC,KAAK,EAAE;AACvC,IAAA,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC;AAC/C,EAAA;AACA,EAAA,OAAO,eAAe,CAAC,QAAQ,CAAC,KAA0B,EAAE,OAAO,CAAC;AACtE;;MCpCa,SAAS,GAAkB,MAAM,CAAC,UAAU;AAMnD,MAAO,aAAc,SAAQ,KAAK,CAAA;AACpB,EAAA,IAAI,GAAW,WAAW;EAC5C,WAAA,CAAY,OAAe,EAAA;IACzB,KAAK,CAAC,OAAO,CAAC;AAChB,EAAA;AACD;AAKK,SAAU,UAAU,CAAC,CAAU,EAAA;EACnC,OAAO,CAAC,KAAK,SAAS,IAAK,CAAmB,EAAE,IAAI,KAAK,WAAW;AACtE;;;;"}