This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

24
node_modules/@angular/core/fesm2022/attribute.mjs generated vendored Executable file
View File

@@ -0,0 +1,24 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
const Attribute = {
/**
* The jsaction attribute defines a mapping of a DOM event to a
* generic event (aka jsaction), to which the actual event handlers
* that implement the behavior of the application are bound. The
* value is a semicolon separated list of colon separated pairs of
* an optional DOM event name and a jsaction name. If the optional
* DOM event name is omitted, 'click' is assumed. The jsaction names
* are dot separated pairs of a namespace and a simple jsaction
* name.
*
* See grammar in README.md for expected syntax in the attribute value.
*/
JSACTION: 'jsaction',
};
export { Attribute };
//# sourceMappingURL=attribute.mjs.map

1
node_modules/@angular/core/fesm2022/attribute.mjs.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"attribute.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/event-dispatch/src/attribute.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\nexport const Attribute = {\n /**\n * The jsaction attribute defines a mapping of a DOM event to a\n * generic event (aka jsaction), to which the actual event handlers\n * that implement the behavior of the application are bound. The\n * value is a semicolon separated list of colon separated pairs of\n * an optional DOM event name and a jsaction name. If the optional\n * DOM event name is omitted, 'click' is assumed. The jsaction names\n * are dot separated pairs of a namespace and a simple jsaction\n * name.\n *\n * See grammar in README.md for expected syntax in the attribute value.\n */\n JSACTION: 'jsaction' as const,\n};\n"],"names":[],"mappings":";;;;;;AAQa,MAAA,SAAS,GAAG;AACvB;;;;;;;;;;;AAWG;AACH,IAAA,QAAQ,EAAE,UAAmB;;;;;"}

4525
node_modules/@angular/core/fesm2022/core.mjs generated vendored Executable file

File diff suppressed because one or more lines are too long

1
node_modules/@angular/core/fesm2022/core.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

32007
node_modules/@angular/core/fesm2022/debug_node.mjs generated vendored Executable file

File diff suppressed because one or more lines are too long

1
node_modules/@angular/core/fesm2022/debug_node.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

141
node_modules/@angular/core/fesm2022/effect.mjs generated vendored Executable file
View File

@@ -0,0 +1,141 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import { SIGNAL, runPostProducerCreatedFn, producerUpdateValueVersion, signalSetFn, producerMarkClean, signalUpdateFn, REACTIVE_NODE, UNSET, defaultEquals, COMPUTING, consumerBeforeComputation, ERRORED, consumerAfterComputation, producerAccessed, setActiveConsumer, consumerPollProducersForChange } from './signal.mjs';
function createLinkedSignal(sourceFn, computationFn, equalityFn) {
const node = Object.create(LINKED_SIGNAL_NODE);
node.source = sourceFn;
node.computation = computationFn;
if (equalityFn != undefined) {
node.equal = equalityFn;
}
const linkedSignalGetter = () => {
// Check if the value needs updating before returning it.
producerUpdateValueVersion(node);
// Record that someone looked at this signal.
producerAccessed(node);
if (node.value === ERRORED) {
throw node.error;
}
return node.value;
};
const getter = linkedSignalGetter;
getter[SIGNAL] = node;
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
const debugName = node.debugName ? ' (' + node.debugName + ')' : '';
getter.toString = () => `[LinkedSignal${debugName}: ${node.value}]`;
}
runPostProducerCreatedFn(node);
return getter;
}
function linkedSignalSetFn(node, newValue) {
producerUpdateValueVersion(node);
signalSetFn(node, newValue);
producerMarkClean(node);
}
function linkedSignalUpdateFn(node, updater) {
producerUpdateValueVersion(node);
signalUpdateFn(node, updater);
producerMarkClean(node);
}
// Note: Using an IIFE here to ensure that the spread assignment is not considered
// a side-effect, ending up preserving `LINKED_SIGNAL_NODE` and `REACTIVE_NODE`.
// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
const LINKED_SIGNAL_NODE = /* @__PURE__ */ (() => {
return {
...REACTIVE_NODE,
value: UNSET,
dirty: true,
error: null,
equal: defaultEquals,
kind: 'linkedSignal',
producerMustRecompute(node) {
// Force a recomputation if there's no current value, or if the current value is in the
// process of being calculated (which should throw an error).
return node.value === UNSET || node.value === COMPUTING;
},
producerRecomputeValue(node) {
if (node.value === COMPUTING) {
// Our computation somehow led to a cyclic read of itself.
throw new Error(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Detected cycle in computations.' : '');
}
const oldValue = node.value;
node.value = COMPUTING;
const prevConsumer = consumerBeforeComputation(node);
let newValue;
try {
const newSourceValue = node.source();
const prev = oldValue === UNSET || oldValue === ERRORED
? undefined
: {
source: node.sourceValue,
value: oldValue,
};
newValue = node.computation(newSourceValue, prev);
node.sourceValue = newSourceValue;
}
catch (err) {
newValue = ERRORED;
node.error = err;
}
finally {
consumerAfterComputation(node, prevConsumer);
}
if (oldValue !== UNSET && newValue !== ERRORED && node.equal(oldValue, newValue)) {
// No change to `valueVersion` - old and new values are
// semantically equivalent.
node.value = oldValue;
return;
}
node.value = newValue;
node.version++;
},
};
})();
/**
* Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
* can, optionally, return a value.
*/
function untracked(nonReactiveReadsFn) {
const prevConsumer = setActiveConsumer(null);
// We are not trying to catch any particular errors here, just making sure that the consumers
// stack is restored in case of errors.
try {
return nonReactiveReadsFn();
}
finally {
setActiveConsumer(prevConsumer);
}
}
const BASE_EFFECT_NODE =
/* @__PURE__ */ (() => ({
...REACTIVE_NODE,
consumerIsAlwaysLive: true,
consumerAllowSignalWrites: true,
dirty: true,
kind: 'effect',
}))();
function runEffect(node) {
node.dirty = false;
if (node.version > 0 && !consumerPollProducersForChange(node)) {
return;
}
node.version++;
const prevNode = consumerBeforeComputation(node);
try {
node.cleanup();
node.fn();
}
finally {
consumerAfterComputation(node, prevNode);
}
}
export { BASE_EFFECT_NODE, createLinkedSignal, linkedSignalSetFn, linkedSignalUpdateFn, runEffect, untracked };
//# sourceMappingURL=effect.mjs.map

1
node_modules/@angular/core/fesm2022/effect.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

56
node_modules/@angular/core/fesm2022/not_found.mjs generated vendored Executable file
View File

@@ -0,0 +1,56 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
/**
* Current injector value used by `inject`.
* - `undefined`: it is an error to call `inject`
* - `null`: `inject` can be called but there is no injector (limp-mode).
* - Injector instance: Use the injector for resolution.
*/
let _currentInjector = undefined;
function getCurrentInjector() {
return _currentInjector;
}
function setCurrentInjector(injector) {
const former = _currentInjector;
_currentInjector = injector;
return former;
}
function inject(token, options) {
const currentInjector = getCurrentInjector();
if (!currentInjector) {
throw new Error('Current injector is not set.');
}
if (!token.ɵprov) {
throw new Error('Token is not an injectable');
}
return currentInjector.retrieve(token, options);
}
/**
* Value returned if the key-value pair couldn't be found in the context
* hierarchy.
*/
const NOT_FOUND = Symbol('NotFound');
/**
* Error thrown when the key-value pair couldn't be found in the context
* hierarchy. Context can be attached below.
*/
class NotFoundError extends Error {
name = 'ɵNotFound';
constructor(message) {
super(message);
}
}
/**
* Type guard for checking if an unknown value is a NotFound.
*/
function isNotFound(e) {
return e === NOT_FOUND || e?.name === 'ɵNotFound';
}
export { NOT_FOUND, NotFoundError, getCurrentInjector, inject, isNotFound, setCurrentInjector };
//# sourceMappingURL=not_found.mjs.map

1
node_modules/@angular/core/fesm2022/not_found.mjs.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"not_found.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/di/src/injector.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/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, NOT_FOUND} 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":";;;;;;AAeA;;;;;AAKG;AACH,IAAI,gBAAgB,GAAgC,SAAS;SAE7C,kBAAkB,GAAA;AAChC,IAAA,OAAO,gBAAgB;AACzB;AAEM,SAAU,kBAAkB,CAChC,QAAqC,EAAA;IAErC,MAAM,MAAM,GAAG,gBAAgB;IAC/B,gBAAgB,GAAG,QAAQ;AAC3B,IAAA,OAAO,MAAM;AACf;AAGgB,SAAA,MAAM,CACpB,KAAyC,EACzC,OAAiB,EAAA;AAEjB,IAAA,MAAM,eAAe,GAAG,kBAAkB,EAAE;IAC5C,IAAI,CAAC,eAAe,EAAE;AACpB,QAAA,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC;;AAEjD,IAAA,IAAI,CAAE,KAA2B,CAAC,KAAK,EAAE;AACvC,QAAA,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC;;IAE/C,OAAO,eAAe,CAAC,QAAQ,CAAC,KAA0B,EAAE,OAAO,CAAC;AACtE;;ACxCA;;;AAGG;MACU,SAAS,GAAkB,MAAM,CAAC,UAAU;AAEzD;;;AAGG;AACG,MAAO,aAAc,SAAQ,KAAK,CAAA;IACpB,IAAI,GAAW,WAAW;AAC5C,IAAA,WAAA,CAAY,OAAe,EAAA;QACzB,KAAK,CAAC,OAAO,CAAC;;AAEjB;AAED;;AAEG;AACG,SAAU,UAAU,CAAC,CAAU,EAAA;IACnC,OAAO,CAAC,KAAK,SAAS,IAAK,CAAmB,EAAE,IAAI,KAAK,WAAW;AACtE;;;;"}

23
node_modules/@angular/core/fesm2022/primitives/di.mjs generated vendored Executable file
View File

@@ -0,0 +1,23 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
export { NOT_FOUND, NotFoundError, getCurrentInjector, inject, isNotFound, setCurrentInjector } from '../not_found.mjs';
function defineInjectable(opts) {
return {
token: opts.token,
providedIn: opts.providedIn || null,
factory: opts.factory,
value: undefined,
};
}
function registerInjectable(ctor, declaration) {
ctor.ɵprov = declaration;
return ctor;
}
export { defineInjectable, registerInjectable };
//# sourceMappingURL=di.mjs.map

1
node_modules/@angular/core/fesm2022/primitives/di.mjs.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"di.mjs","sources":["../../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/di/src/injection_token.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 {Type} from './type';\n/**\n * Information about how a type or `InjectionToken` interfaces with the DI\n * system. This describes:\n *\n * 1. *How* the type is provided\n * The declaration must specify only one of the following:\n * - A `value` which is a predefined instance of the type.\n * - A `factory` which defines how to create the given type `T`, possibly\n * requesting injection of other types if necessary.\n * - Neither, in which case the type is expected to already be present in the\n * injector hierarchy. This is used for internal use cases.\n *\n * 2. *Where* the type is stored (if it is stored)\n * - The `providedIn` parameter specifies which injector the type belongs to.\n * - The `token` is used as the key to store the type in the injector.\n */\nexport interface ɵɵInjectableDeclaration<T> {\n /**\n * Specifies that the given type belongs to a particular `Injector`,\n * `NgModule`, or a special scope (e.g. `'root'`).\n *\n * `any` is deprecated and will be removed soon.\n *\n * A value of `null` indicates that the injectable does not belong to any\n * scope, and won't be stored in any injector. For declarations with a\n * factory, this will create a new instance of the type each time it is\n * requested.\n */\n providedIn: Type<any> | 'root' | 'platform' | 'any' | null;\n\n /**\n * The token to which this definition belongs.\n *\n * Note that this may not be the same as the type that the `factory` will create.\n */\n token: unknown;\n\n /**\n * Factory method to execute to create an instance of the injectable.\n */\n factory?: (t?: Type<any>) => T;\n\n /**\n * In a case of no explicit injector, a location where the instance of the injectable is stored.\n */\n value?: T;\n}\n\n/**\n * A `Type` which has a `ɵprov: ɵɵInjectableDeclaration` static field.\n *\n * `InjectableType`s contain their own Dependency Injection metadata and are usable in an\n * `InjectorDef`-based `StaticInjector`.\n *\n * @publicApi\n */\nexport interface InjectionToken<T> {\n ɵprov: ɵɵInjectableDeclaration<T>;\n}\n\nexport function defineInjectable<T>(opts: {\n token: unknown;\n providedIn?: Type<any> | 'root' | 'platform' | 'any' | 'environment' | null;\n factory: () => T;\n}): ɵɵInjectableDeclaration<T> {\n return {\n token: opts.token,\n providedIn: (opts.providedIn as any) || null,\n factory: opts.factory,\n value: undefined,\n } as ɵɵInjectableDeclaration<T>;\n}\n\nexport type Constructor<T> = Function & {prototype: T};\n\nexport function registerInjectable<T>(\n ctor: unknown,\n declaration: ɵɵInjectableDeclaration<T>,\n): InjectionToken<T> {\n (ctor as unknown as InjectionToken<T>).ɵprov = declaration;\n return ctor as Constructor<T> & InjectionToken<T>;\n}\n"],"names":[],"mappings":";;;;;;;;AAqEM,SAAU,gBAAgB,CAAI,IAInC,EAAA;IACC,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK;AACjB,QAAA,UAAU,EAAG,IAAI,CAAC,UAAkB,IAAI,IAAI;QAC5C,OAAO,EAAE,IAAI,CAAC,OAAO;AACrB,QAAA,KAAK,EAAE,SAAS;KACa;AACjC;AAIgB,SAAA,kBAAkB,CAChC,IAAa,EACb,WAAuC,EAAA;AAEtC,IAAA,IAAqC,CAAC,KAAK,GAAG,WAAW;AAC1D,IAAA,OAAO,IAA0C;AACnD;;;;"}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

221
node_modules/@angular/core/fesm2022/primitives/signals.mjs generated vendored Executable file
View File

@@ -0,0 +1,221 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import { SIGNAL, consumerMarkDirty, REACTIVE_NODE, consumerDestroy, isInNotificationPhase, consumerPollProducersForChange, consumerBeforeComputation, consumerAfterComputation } from '../signal.mjs';
export { SIGNAL_NODE, createComputed, createSignal, defaultEquals, finalizeConsumerAfterComputation, getActiveConsumer, isReactive, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, resetConsumerBeforeComputation, runPostProducerCreatedFn, runPostSignalSetFn, setActiveConsumer, setPostProducerCreatedFn, setPostSignalSetFn, setThrowInvalidWriteToSignalError, signalGetFn, signalSetFn, signalUpdateFn } from '../signal.mjs';
export { BASE_EFFECT_NODE, createLinkedSignal, linkedSignalSetFn, linkedSignalUpdateFn, runEffect, untracked } from '../effect.mjs';
export { setAlternateWeakRefImpl } from '../weak_ref.mjs';
/**
* A custom formatter which renders signals in an easy-to-read format.
*
* @see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html
*/
const formatter = {
/**
* If the function returns `null`, the formatter is not used for this reference
*/
header: (sig, config) => {
if (!isSignal(sig) || config?.ngSkipFormatting)
return null;
let value;
try {
value = sig();
}
catch {
// In case the signl throws, we don't want to break the formatting.
return ['span', 'Signal(⚠️ Error)'];
}
const kind = 'computation' in sig[SIGNAL] ? 'Computed' : 'Signal';
const isPrimitive = value === null || (!Array.isArray(value) && typeof value !== 'object');
return [
'span',
{},
['span', {}, `${kind}(`],
(() => {
if (isSignal(value)) {
// Recursively call formatter. Could return an `object` to call the formatter through DevTools,
// but then recursive signals will render multiple expando arrows which is an awkward UX.
return formatter.header(value, config);
}
else if (isPrimitive && value !== undefined && typeof value !== 'function') {
// Use built-in rendering for primitives which applies standard syntax highlighting / theming.
// Can't do this for `undefined` however, as the browser thinks we forgot to provide an object.
// Also don't want to do this for functions which render nested expando arrows.
return ['object', { object: value }];
}
else {
return prettifyPreview(value);
}
})(),
['span', {}, `)`],
];
},
hasBody: (sig, config) => {
if (!isSignal(sig))
return false;
try {
sig();
}
catch {
return false;
}
return !config?.ngSkipFormatting;
},
body: (sig, config) => {
// We can use sys colors to fit the current DevTools theme.
// Those are unfortunately only available on Chromium-based browsers.
// On Firefow we fall back to the default color
const color = 'var(--sys-color-primary)';
return [
'div',
{ style: `background: #FFFFFF10; padding-left: 4px; padding-top: 2px; padding-bottom: 2px;` },
['div', { style: `color: ${color}` }, 'Signal value: '],
['div', { style: `padding-left: .5rem;` }, ['object', { object: sig(), config }]],
['div', { style: `color: ${color}` }, 'Signal function: '],
[
'div',
{ style: `padding-left: .5rem;` },
['object', { object: sig, config: { ...config, skipFormatting: true } }],
],
];
},
};
function prettifyPreview(value) {
if (value === null)
return 'null';
if (Array.isArray(value))
return `Array(${value.length})`;
if (value instanceof Element)
return `<${value.tagName.toLowerCase()}>`;
if (value instanceof URL)
return `URL`;
switch (typeof value) {
case 'undefined': {
return 'undefined';
}
case 'function': {
if ('prototype' in value) {
// This is what Chrome renders, can't use `object` though because it creates a nested expando arrow.
return 'class';
}
else {
return '() => {…}';
}
}
case 'object': {
if (value.constructor.name === 'Object') {
return '{…}';
}
else {
return `${value.constructor.name} {}`;
}
}
default: {
return ['object', { object: value, config: { skipFormatting: true } }];
}
}
}
function isSignal(value) {
return value[SIGNAL] !== undefined;
}
/**
* Installs the custom formatter into custom formatting on Signals in the devtools.
*
* Supported by both Chrome and Firefox.
*
* @see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html
*/
function installDevToolsSignalFormatter() {
globalThis.devtoolsFormatters ??= [];
if (!globalThis.devtoolsFormatters.some((f) => f === formatter)) {
globalThis.devtoolsFormatters.push(formatter);
}
}
function createWatch(fn, schedule, allowSignalWrites) {
const node = Object.create(WATCH_NODE);
if (allowSignalWrites) {
node.consumerAllowSignalWrites = true;
}
node.fn = fn;
node.schedule = schedule;
const registerOnCleanup = (cleanupFn) => {
node.cleanupFn = cleanupFn;
};
function isWatchNodeDestroyed(node) {
return node.fn === null && node.schedule === null;
}
function destroyWatchNode(node) {
if (!isWatchNodeDestroyed(node)) {
consumerDestroy(node); // disconnect watcher from the reactive graph
node.cleanupFn();
// nullify references to the integration functions to mark node as destroyed
node.fn = null;
node.schedule = null;
node.cleanupFn = NOOP_CLEANUP_FN;
}
}
const run = () => {
if (node.fn === null) {
// trying to run a destroyed watch is noop
return;
}
if (isInNotificationPhase()) {
throw new Error(typeof ngDevMode !== 'undefined' && ngDevMode
? 'Schedulers cannot synchronously execute watches while scheduling.'
: '');
}
node.dirty = false;
if (node.version > 0 && !consumerPollProducersForChange(node)) {
return;
}
node.version++;
const prevConsumer = consumerBeforeComputation(node);
try {
node.cleanupFn();
node.cleanupFn = NOOP_CLEANUP_FN;
node.fn(registerOnCleanup);
}
finally {
consumerAfterComputation(node, prevConsumer);
}
};
node.ref = {
notify: () => consumerMarkDirty(node),
run,
cleanup: () => node.cleanupFn(),
destroy: () => destroyWatchNode(node),
[SIGNAL]: node,
};
return node.ref;
}
const NOOP_CLEANUP_FN = () => { };
// Note: Using an IIFE here to ensure that the spread assignment is not considered
// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.
// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
const WATCH_NODE = /* @__PURE__ */ (() => {
return {
...REACTIVE_NODE,
consumerIsAlwaysLive: true,
consumerAllowSignalWrites: false,
consumerMarkedDirty: (node) => {
if (node.schedule !== null) {
node.schedule(node.ref);
}
},
cleanupFn: NOOP_CLEANUP_FN,
};
})();
// We're using a top-level access to enable signal formatting whenever the signals package is loaded.
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
// tslint:disable-next-line: no-toplevel-property-access
installDevToolsSignalFormatter();
}
export { REACTIVE_NODE, SIGNAL, consumerAfterComputation, consumerBeforeComputation, consumerDestroy, consumerMarkDirty, consumerPollProducersForChange, createWatch, installDevToolsSignalFormatter, isInNotificationPhase };
//# sourceMappingURL=signals.mjs.map

File diff suppressed because one or more lines are too long

625
node_modules/@angular/core/fesm2022/resource.mjs generated vendored Executable file
View File

@@ -0,0 +1,625 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import { inject, ErrorHandler, DestroyRef, RuntimeError, formatRuntimeError, assertNotInReactiveContext, assertInInjectionContext, Injector, ViewContext, ChangeDetectionScheduler, EffectScheduler, setInjectorProfilerContext, emitEffectCreatedEvent, EFFECTS, NodeInjectorDestroyRef, FLAGS, markAncestorsForTraversal, noop, setIsRefreshingViews, signalAsReadonlyFn, PendingTasks, signal } from './root_effect_scheduler.mjs';
import { setActiveConsumer, createComputed, SIGNAL, consumerDestroy, isInNotificationPhase } from './signal.mjs';
import { untracked as untracked$1, BASE_EFFECT_NODE, runEffect, createLinkedSignal, linkedSignalSetFn, linkedSignalUpdateFn } from './effect.mjs';
/**
* An `OutputEmitterRef` is created by the `output()` function and can be
* used to emit values to consumers of your directive or component.
*
* Consumers of your directive/component can bind to the output and
* subscribe to changes via the bound event syntax. For example:
*
* ```html
* <my-comp (valueChange)="processNewValue($event)" />
* ```
*
* @publicAPI
*/
class OutputEmitterRef {
destroyed = false;
listeners = null;
errorHandler = inject(ErrorHandler, { optional: true });
/** @internal */
destroyRef = inject(DestroyRef);
constructor() {
// Clean-up all listeners and mark as destroyed upon destroy.
this.destroyRef.onDestroy(() => {
this.destroyed = true;
this.listeners = null;
});
}
subscribe(callback) {
if (this.destroyed) {
throw new RuntimeError(953 /* RuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode &&
'Unexpected subscription to destroyed `OutputRef`. ' +
'The owning directive/component is destroyed.');
}
(this.listeners ??= []).push(callback);
return {
unsubscribe: () => {
const idx = this.listeners?.indexOf(callback);
if (idx !== undefined && idx !== -1) {
this.listeners?.splice(idx, 1);
}
},
};
}
/** Emits a new value to the output. */
emit(value) {
if (this.destroyed) {
console.warn(formatRuntimeError(953 /* RuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode &&
'Unexpected emit for destroyed `OutputRef`. ' +
'The owning directive/component is destroyed.'));
return;
}
if (this.listeners === null) {
return;
}
const previousConsumer = setActiveConsumer(null);
try {
for (const listenerFn of this.listeners) {
try {
listenerFn(value);
}
catch (err) {
this.errorHandler?.handleError(err);
}
}
}
finally {
setActiveConsumer(previousConsumer);
}
}
}
/** Gets the owning `DestroyRef` for the given output. */
function getOutputDestroyRef(ref) {
return ref.destroyRef;
}
/**
* Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
* can, optionally, return a value.
*/
function untracked(nonReactiveReadsFn) {
return untracked$1(nonReactiveReadsFn);
}
/**
* Create a computed `Signal` which derives a reactive value from an expression.
*/
function computed(computation, options) {
const getter = createComputed(computation, options?.equal);
if (ngDevMode) {
getter.toString = () => `[Computed: ${getter()}]`;
getter[SIGNAL].debugName = options?.debugName;
}
return getter;
}
class EffectRefImpl {
[SIGNAL];
constructor(node) {
this[SIGNAL] = node;
}
destroy() {
this[SIGNAL].destroy();
}
}
/**
* Registers an "effect" that will be scheduled & executed whenever the signals that it reads
* changes.
*
* Angular has two different kinds of effect: component effects and root effects. Component effects
* are created when `effect()` is called from a component, directive, or within a service of a
* component/directive. Root effects are created when `effect()` is called from outside the
* component tree, such as in a root service.
*
* The two effect types differ in their timing. Component effects run as a component lifecycle
* event during Angular's synchronization (change detection) process, and can safely read input
* signals or create/destroy views that depend on component state. Root effects run as microtasks
* and have no connection to the component tree or change detection.
*
* `effect()` must be run in injection context, unless the `injector` option is manually specified.
*
* @publicApi 20.0
*/
function effect(effectFn, options) {
ngDevMode &&
assertNotInReactiveContext(effect, 'Call `effect` outside of a reactive context. For example, schedule the ' +
'effect inside the component constructor.');
if (ngDevMode && !options?.injector) {
assertInInjectionContext(effect);
}
if (ngDevMode && options?.allowSignalWrites !== undefined) {
console.warn(`The 'allowSignalWrites' flag is deprecated and no longer impacts effect() (writes are always allowed)`);
}
const injector = options?.injector ?? inject(Injector);
let destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
let node;
const viewContext = injector.get(ViewContext, null, { optional: true });
const notifier = injector.get(ChangeDetectionScheduler);
if (viewContext !== null) {
// This effect was created in the context of a view, and will be associated with the view.
node = createViewEffect(viewContext.view, notifier, effectFn);
if (destroyRef instanceof NodeInjectorDestroyRef && destroyRef._lView === viewContext.view) {
// The effect is being created in the same view as the `DestroyRef` references, so it will be
// automatically destroyed without the need for an explicit `DestroyRef` registration.
destroyRef = null;
}
}
else {
// This effect was created outside the context of a view, and will be scheduled independently.
node = createRootEffect(effectFn, injector.get(EffectScheduler), notifier);
}
node.injector = injector;
if (destroyRef !== null) {
// If we need to register for cleanup, do that here.
node.onDestroyFn = destroyRef.onDestroy(() => node.destroy());
}
const effectRef = new EffectRefImpl(node);
if (ngDevMode) {
node.debugName = options?.debugName ?? '';
const prevInjectorProfilerContext = setInjectorProfilerContext({ injector, token: null });
try {
emitEffectCreatedEvent(effectRef);
}
finally {
setInjectorProfilerContext(prevInjectorProfilerContext);
}
}
return effectRef;
}
const EFFECT_NODE =
/* @__PURE__ */ (() => ({
...BASE_EFFECT_NODE,
cleanupFns: undefined,
zone: null,
onDestroyFn: noop,
run() {
if (ngDevMode && isInNotificationPhase()) {
throw new Error(`Schedulers cannot synchronously execute watches while scheduling.`);
}
// We clear `setIsRefreshingViews` so that `markForCheck()` within the body of an effect will
// cause CD to reach the component in question.
const prevRefreshingViews = setIsRefreshingViews(false);
try {
runEffect(this);
}
finally {
setIsRefreshingViews(prevRefreshingViews);
}
},
cleanup() {
if (!this.cleanupFns?.length) {
return;
}
const prevConsumer = setActiveConsumer(null);
try {
// Attempt to run the cleanup functions. Regardless of failure or success, we consider
// cleanup "completed" and clear the list for the next run of the effect. Note that an error
// from the cleanup function will still crash the current run of the effect.
while (this.cleanupFns.length) {
this.cleanupFns.pop()();
}
}
finally {
this.cleanupFns = [];
setActiveConsumer(prevConsumer);
}
},
}))();
const ROOT_EFFECT_NODE =
/* @__PURE__ */ (() => ({
...EFFECT_NODE,
consumerMarkedDirty() {
this.scheduler.schedule(this);
this.notifier.notify(12 /* NotificationSource.RootEffect */);
},
destroy() {
consumerDestroy(this);
this.onDestroyFn();
this.cleanup();
this.scheduler.remove(this);
},
}))();
const VIEW_EFFECT_NODE =
/* @__PURE__ */ (() => ({
...EFFECT_NODE,
consumerMarkedDirty() {
this.view[FLAGS] |= 8192 /* LViewFlags.HasChildViewsToRefresh */;
markAncestorsForTraversal(this.view);
this.notifier.notify(13 /* NotificationSource.ViewEffect */);
},
destroy() {
consumerDestroy(this);
this.onDestroyFn();
this.cleanup();
this.view[EFFECTS]?.delete(this);
},
}))();
function createViewEffect(view, notifier, fn) {
const node = Object.create(VIEW_EFFECT_NODE);
node.view = view;
node.zone = typeof Zone !== 'undefined' ? Zone.current : null;
node.notifier = notifier;
node.fn = createEffectFn(node, fn);
view[EFFECTS] ??= new Set();
view[EFFECTS].add(node);
node.consumerMarkedDirty(node);
return node;
}
function createRootEffect(fn, scheduler, notifier) {
const node = Object.create(ROOT_EFFECT_NODE);
node.fn = createEffectFn(node, fn);
node.scheduler = scheduler;
node.notifier = notifier;
node.zone = typeof Zone !== 'undefined' ? Zone.current : null;
node.scheduler.add(node);
node.notifier.notify(12 /* NotificationSource.RootEffect */);
return node;
}
function createEffectFn(node, fn) {
return () => {
fn((cleanupFn) => (node.cleanupFns ??= []).push(cleanupFn));
};
}
const identityFn = (v) => v;
function linkedSignal(optionsOrComputation, options) {
if (typeof optionsOrComputation === 'function') {
const getter = createLinkedSignal(optionsOrComputation, (identityFn), options?.equal);
return upgradeLinkedSignalGetter(getter, options?.debugName);
}
else {
const getter = createLinkedSignal(optionsOrComputation.source, optionsOrComputation.computation, optionsOrComputation.equal);
return upgradeLinkedSignalGetter(getter, optionsOrComputation.debugName);
}
}
function upgradeLinkedSignalGetter(getter, debugName) {
if (ngDevMode) {
getter.toString = () => `[LinkedSignal: ${getter()}]`;
getter[SIGNAL].debugName = debugName;
}
const node = getter[SIGNAL];
const upgradedGetter = getter;
upgradedGetter.set = (newValue) => linkedSignalSetFn(node, newValue);
upgradedGetter.update = (updateFn) => linkedSignalUpdateFn(node, updateFn);
upgradedGetter.asReadonly = signalAsReadonlyFn.bind(getter);
return upgradedGetter;
}
/**
* Whether a `Resource.value()` should throw an error when the resource is in the error state.
*
* This internal flag is being used to gradually roll out this behavior.
*/
let RESOURCE_VALUE_THROWS_ERRORS_DEFAULT = true;
function resource(options) {
if (ngDevMode && !options?.injector) {
assertInInjectionContext(resource);
}
const oldNameForParams = options.request;
const params = (options.params ?? oldNameForParams ?? (() => null));
return new ResourceImpl(params, getLoader(options), options.defaultValue, options.equal ? wrapEqualityFn(options.equal) : undefined, options.injector ?? inject(Injector), RESOURCE_VALUE_THROWS_ERRORS_DEFAULT);
}
/**
* Base class which implements `.value` as a `WritableSignal` by delegating `.set` and `.update`.
*/
class BaseWritableResource {
value;
constructor(value) {
this.value = value;
this.value.set = this.set.bind(this);
this.value.update = this.update.bind(this);
this.value.asReadonly = signalAsReadonlyFn;
}
isError = computed(() => this.status() === 'error');
update(updateFn) {
this.set(updateFn(untracked(this.value)));
}
isLoading = computed(() => this.status() === 'loading' || this.status() === 'reloading');
// Use a computed here to avoid triggering reactive consumers if the value changes while staying
// either defined or undefined.
isValueDefined = computed(() => {
// Check if it's in an error state first to prevent the error from bubbling up.
if (this.isError()) {
return false;
}
return this.value() !== undefined;
});
hasValue() {
return this.isValueDefined();
}
asReadonly() {
return this;
}
}
/**
* Implementation for `resource()` which uses a `linkedSignal` to manage the resource's state.
*/
class ResourceImpl extends BaseWritableResource {
loaderFn;
equal;
pendingTasks;
/**
* The current state of the resource. Status, value, and error are derived from this.
*/
state;
/**
* Combines the current request with a reload counter which allows the resource to be reloaded on
* imperative command.
*/
extRequest;
effectRef;
pendingController;
resolvePendingTask = undefined;
destroyed = false;
unregisterOnDestroy;
constructor(request, loaderFn, defaultValue, equal, injector, throwErrorsFromValue = RESOURCE_VALUE_THROWS_ERRORS_DEFAULT) {
super(
// Feed a computed signal for the value to `BaseWritableResource`, which will upgrade it to a
// `WritableSignal` that delegates to `ResourceImpl.set`.
computed(() => {
const streamValue = this.state().stream?.();
if (!streamValue) {
return defaultValue;
}
// Prevents `hasValue()` from throwing an error when a reload happened in the error state
if (this.state().status === 'loading' && this.error()) {
return defaultValue;
}
if (!isResolved(streamValue)) {
if (throwErrorsFromValue) {
throw new ResourceValueError(this.error());
}
else {
return defaultValue;
}
}
return streamValue.value;
}, { equal }));
this.loaderFn = loaderFn;
this.equal = equal;
// Extend `request()` to include a writable reload signal.
this.extRequest = linkedSignal({
source: request,
computation: (request) => ({ request, reload: 0 }),
});
// The main resource state is managed in a `linkedSignal`, which allows the resource to change
// state instantaneously when the request signal changes.
this.state = linkedSignal({
// Whenever the request changes,
source: this.extRequest,
// Compute the state of the resource given a change in status.
computation: (extRequest, previous) => {
const status = extRequest.request === undefined ? 'idle' : 'loading';
if (!previous) {
return {
extRequest,
status,
previousStatus: 'idle',
stream: undefined,
};
}
else {
return {
extRequest,
status,
previousStatus: projectStatusOfState(previous.value),
// If the request hasn't changed, keep the previous stream.
stream: previous.value.extRequest.request === extRequest.request
? previous.value.stream
: undefined,
};
}
},
});
this.effectRef = effect(this.loadEffect.bind(this), {
injector,
manualCleanup: true,
});
this.pendingTasks = injector.get(PendingTasks);
// Cancel any pending request when the resource itself is destroyed.
this.unregisterOnDestroy = injector.get(DestroyRef).onDestroy(() => this.destroy());
}
status = computed(() => projectStatusOfState(this.state()));
error = computed(() => {
const stream = this.state().stream?.();
return stream && !isResolved(stream) ? stream.error : undefined;
});
/**
* Called either directly via `WritableResource.set` or via `.value.set()`.
*/
set(value) {
if (this.destroyed) {
return;
}
const error = untracked(this.error);
const state = untracked(this.state);
if (!error) {
const current = untracked(this.value);
if (state.status === 'local' &&
(this.equal ? this.equal(current, value) : current === value)) {
return;
}
}
// Enter Local state with the user-defined value.
this.state.set({
extRequest: state.extRequest,
status: 'local',
previousStatus: 'local',
stream: signal({ value }),
});
// We're departing from whatever state the resource was in previously, so cancel any in-progress
// loading operations.
this.abortInProgressLoad();
}
reload() {
// We don't want to restart in-progress loads.
const { status } = untracked(this.state);
if (status === 'idle' || status === 'loading') {
return false;
}
// Increment the request reload to trigger the `state` linked signal to switch us to `Reload`
this.extRequest.update(({ request, reload }) => ({ request, reload: reload + 1 }));
return true;
}
destroy() {
this.destroyed = true;
this.unregisterOnDestroy();
this.effectRef.destroy();
this.abortInProgressLoad();
// Destroyed resources enter Idle state.
this.state.set({
extRequest: { request: undefined, reload: 0 },
status: 'idle',
previousStatus: 'idle',
stream: undefined,
});
}
async loadEffect() {
const extRequest = this.extRequest();
// Capture the previous status before any state transitions. Note that this is `untracked` since
// we do not want the effect to depend on the state of the resource, only on the request.
const { status: currentStatus, previousStatus } = untracked(this.state);
if (extRequest.request === undefined) {
// Nothing to load (and we should already be in a non-loading state).
return;
}
else if (currentStatus !== 'loading') {
// We're not in a loading or reloading state, so this loading request is stale.
return;
}
// Cancel any previous loading attempts.
this.abortInProgressLoad();
// Capturing _this_ load's pending task in a local variable is important here. We may attempt to
// resolve it twice:
//
// 1. when the loading function promise resolves/rejects
// 2. when cancelling the loading operation
//
// After the loading operation is cancelled, `this.resolvePendingTask` no longer represents this
// particular task, but this `await` may eventually resolve/reject. Thus, when we cancel in
// response to (1) below, we need to cancel the locally saved task.
let resolvePendingTask = (this.resolvePendingTask =
this.pendingTasks.add());
const { signal: abortSignal } = (this.pendingController = new AbortController());
try {
// The actual loading is run through `untracked` - only the request side of `resource` is
// reactive. This avoids any confusion with signals tracking or not tracking depending on
// which side of the `await` they are.
const stream = await untracked(() => {
return this.loaderFn({
params: extRequest.request,
// TODO(alxhub): cleanup after g3 removal of `request` alias.
request: extRequest.request,
abortSignal,
previous: {
status: previousStatus,
},
});
});
// If this request has been aborted, or the current request no longer
// matches this load, then we should ignore this resolution.
if (abortSignal.aborted || untracked(this.extRequest) !== extRequest) {
return;
}
this.state.set({
extRequest,
status: 'resolved',
previousStatus: 'resolved',
stream,
});
}
catch (err) {
if (abortSignal.aborted || untracked(this.extRequest) !== extRequest) {
return;
}
this.state.set({
extRequest,
status: 'resolved',
previousStatus: 'error',
stream: signal({ error: encapsulateResourceError(err) }),
});
}
finally {
// Resolve the pending task now that the resource has a value.
resolvePendingTask?.();
resolvePendingTask = undefined;
}
}
abortInProgressLoad() {
untracked(() => this.pendingController?.abort());
this.pendingController = undefined;
// Once the load is aborted, we no longer want to block stability on its resolution.
this.resolvePendingTask?.();
this.resolvePendingTask = undefined;
}
}
/**
* Wraps an equality function to handle either value being `undefined`.
*/
function wrapEqualityFn(equal) {
return (a, b) => (a === undefined || b === undefined ? a === b : equal(a, b));
}
function getLoader(options) {
if (isStreamingResourceOptions(options)) {
return options.stream;
}
return async (params) => {
try {
return signal({ value: await options.loader(params) });
}
catch (err) {
return signal({ error: encapsulateResourceError(err) });
}
};
}
function isStreamingResourceOptions(options) {
return !!options.stream;
}
/**
* Project from a state with `ResourceInternalStatus` to the user-facing `ResourceStatus`
*/
function projectStatusOfState(state) {
switch (state.status) {
case 'loading':
return state.extRequest.reload === 0 ? 'loading' : 'reloading';
case 'resolved':
return isResolved(state.stream()) ? 'resolved' : 'error';
default:
return state.status;
}
}
function isResolved(state) {
return state.error === undefined;
}
function encapsulateResourceError(error) {
if (error instanceof Error) {
return error;
}
return new ResourceWrappedError(error);
}
class ResourceValueError extends Error {
constructor(error) {
super(ngDevMode
? `Resource is currently in an error state (see Error.cause for details): ${error.message}`
: error.message, { cause: error });
}
}
class ResourceWrappedError extends Error {
constructor(error) {
super(ngDevMode
? `Resource returned an error that's not an Error instance: ${String(error)}. Check this error's .cause for the actual error.`
: String(error), { cause: error });
}
}
export { OutputEmitterRef, ResourceImpl, computed, effect, encapsulateResourceError, getOutputDestroyRef, linkedSignal, resource, untracked };
//# sourceMappingURL=resource.mjs.map

1
node_modules/@angular/core/fesm2022/resource.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

4034
node_modules/@angular/core/fesm2022/root_effect_scheduler.mjs generated vendored Executable file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

352
node_modules/@angular/core/fesm2022/rxjs-interop.mjs generated vendored Executable file
View File

@@ -0,0 +1,352 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import { Observable, ReplaySubject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { assertInInjectionContext, inject, DestroyRef, RuntimeError, Injector, assertNotInReactiveContext, signal, PendingTasks } from './root_effect_scheduler.mjs';
import { getOutputDestroyRef, effect, untracked, computed, resource, encapsulateResourceError } from './resource.mjs';
import './not_found.mjs';
import './signal.mjs';
import '@angular/core/primitives/signals';
import '@angular/core/primitives/di';
import './effect.mjs';
/**
* Operator which completes the Observable when the calling context (component, directive, service,
* etc) is destroyed.
*
* @param destroyRef optionally, the `DestroyRef` representing the current context. This can be
* passed explicitly to use `takeUntilDestroyed` outside of an [injection
* context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.
*
* @publicApi 19.0
*/
function takeUntilDestroyed(destroyRef) {
if (!destroyRef) {
ngDevMode && assertInInjectionContext(takeUntilDestroyed);
destroyRef = inject(DestroyRef);
}
const destroyed$ = new Observable((subscriber) => {
if (destroyRef.destroyed) {
subscriber.next();
return;
}
const unregisterFn = destroyRef.onDestroy(subscriber.next.bind(subscriber));
return unregisterFn;
});
return (source) => {
return source.pipe(takeUntil(destroyed$));
};
}
/**
* Implementation of `OutputRef` that emits values from
* an RxJS observable source.
*
* @internal
*/
class OutputFromObservableRef {
source;
destroyed = false;
destroyRef = inject(DestroyRef);
constructor(source) {
this.source = source;
this.destroyRef.onDestroy(() => {
this.destroyed = true;
});
}
subscribe(callbackFn) {
if (this.destroyed) {
throw new RuntimeError(953 /* ɵRuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode &&
'Unexpected subscription to destroyed `OutputRef`. ' +
'The owning directive/component is destroyed.');
}
// Stop yielding more values when the directive/component is already destroyed.
const subscription = this.source.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
next: (value) => callbackFn(value),
});
return {
unsubscribe: () => subscription.unsubscribe(),
};
}
}
/**
* Declares an Angular output that is using an RxJS observable as a source
* for events dispatched to parent subscribers.
*
* The behavior for an observable as source is defined as followed:
* 1. New values are forwarded to the Angular output (next notifications).
* 2. Errors notifications are not handled by Angular. You need to handle these manually.
* For example by using `catchError`.
* 3. Completion notifications stop the output from emitting new values.
*
* @usageNotes
* Initialize an output in your directive by declaring a
* class field and initializing it with the `outputFromObservable()` function.
*
* ```ts
* @Directive({..})
* export class MyDir {
* nameChange$ = <some-observable>;
* nameChange = outputFromObservable(this.nameChange$);
* }
* ```
*
* @publicApi 19.0
*/
function outputFromObservable(observable, opts) {
ngDevMode && assertInInjectionContext(outputFromObservable);
return new OutputFromObservableRef(observable);
}
/**
* Converts an Angular output declared via `output()` or `outputFromObservable()`
* to an observable.
* It creates an observable that represents the stream of "events firing" in an output.
*
* You can subscribe to the output via `Observable.subscribe` then.
*
* @publicApi 19.0
*/
function outputToObservable(ref) {
const destroyRef = getOutputDestroyRef(ref);
return new Observable((observer) => {
// Complete the observable upon directive/component destroy.
// Note: May be `undefined` if an `EventEmitter` is declared outside
// of an injection context.
const unregisterOnDestroy = destroyRef?.onDestroy(() => observer.complete());
const subscription = ref.subscribe((v) => observer.next(v));
return () => {
subscription.unsubscribe();
unregisterOnDestroy?.();
};
});
}
/**
* Exposes the value of an Angular `Signal` as an RxJS `Observable`.
* As it reflects a state, the observable will always emit the latest value upon subscription.
*
* The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.
*
* `toObservable` must be called in an injection context unless an injector is provided via options.
*
* @publicApi 20.0
*/
function toObservable(source, options) {
if (ngDevMode && !options?.injector) {
assertInInjectionContext(toObservable);
}
const injector = options?.injector ?? inject(Injector);
const subject = new ReplaySubject(1);
const watcher = effect(() => {
let value;
try {
value = source();
}
catch (err) {
untracked(() => subject.error(err));
return;
}
untracked(() => subject.next(value));
}, { injector, manualCleanup: true });
injector.get(DestroyRef).onDestroy(() => {
watcher.destroy();
subject.complete();
});
return subject.asObservable();
}
/**
* Get the current value of an `Observable` as a reactive `Signal`.
*
* `toSignal` returns a `Signal` which provides synchronous reactive access to values produced
* by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always
* have the most recent value emitted by the subscription, and will throw an error if the
* `Observable` errors.
*
* With `requireSync` set to `true`, `toSignal` will assert that the `Observable` produces a value
* immediately upon subscription. No `initialValue` is needed in this case, and the returned signal
* does not include an `undefined` type.
*
* By default, the subscription will be automatically cleaned up when the current [injection
* context](guide/di/dependency-injection-context) is destroyed. For example, when `toSignal` is
* called during the construction of a component, the subscription will be cleaned up when the
* component is destroyed. If an injection context is not available, an explicit `Injector` can be
* passed instead.
*
* If the subscription should persist until the `Observable` itself completes, the `manualCleanup`
* option can be specified instead, which disables the automatic subscription teardown. No injection
* context is needed in this configuration as well.
*/
function toSignal(source, options) {
typeof ngDevMode !== 'undefined' &&
ngDevMode &&
assertNotInReactiveContext(toSignal, 'Invoking `toSignal` causes new subscriptions every time. ' +
'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.');
const requiresCleanup = !options?.manualCleanup;
if (ngDevMode && requiresCleanup && !options?.injector) {
assertInInjectionContext(toSignal);
}
const cleanupRef = requiresCleanup
? (options?.injector?.get(DestroyRef) ?? inject(DestroyRef))
: null;
const equal = makeToSignalEqual(options?.equal);
// Note: T is the Observable value type, and U is the initial value type. They don't have to be
// the same - the returned signal gives values of type `T`.
let state;
if (options?.requireSync) {
// Initially the signal is in a `NoValue` state.
state = signal({ kind: 0 /* StateKind.NoValue */ }, { equal });
}
else {
// If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.
state = signal({ kind: 1 /* StateKind.Value */, value: options?.initialValue }, { equal });
}
let destroyUnregisterFn;
// Note: This code cannot run inside a reactive context (see assertion above). If we'd support
// this, we would subscribe to the observable outside of the current reactive context, avoiding
// that side-effect signal reads/writes are attribute to the current consumer. The current
// consumer only needs to be notified when the `state` signal changes through the observable
// subscription. Additional context (related to async pipe):
// https://github.com/angular/angular/pull/50522.
const sub = source.subscribe({
next: (value) => state.set({ kind: 1 /* StateKind.Value */, value }),
error: (error) => {
state.set({ kind: 2 /* StateKind.Error */, error });
destroyUnregisterFn?.();
},
complete: () => {
destroyUnregisterFn?.();
},
// Completion of the Observable is meaningless to the signal. Signals don't have a concept of
// "complete".
});
if (options?.requireSync && state().kind === 0 /* StateKind.NoValue */) {
throw new RuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
'`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');
}
// Unsubscribe when the current context is destroyed, if requested.
destroyUnregisterFn = cleanupRef?.onDestroy(sub.unsubscribe.bind(sub));
// The actual returned signal is a `computed` of the `State` signal, which maps the various states
// to either values or errors.
return computed(() => {
const current = state();
switch (current.kind) {
case 1 /* StateKind.Value */:
return current.value;
case 2 /* StateKind.Error */:
throw current.error;
case 0 /* StateKind.NoValue */:
// This shouldn't really happen because the error is thrown on creation.
throw new RuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
'`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');
}
}, { equal: options?.equal });
}
function makeToSignalEqual(userEquality = Object.is) {
return (a, b) => a.kind === 1 /* StateKind.Value */ && b.kind === 1 /* StateKind.Value */ && userEquality(a.value, b.value);
}
/**
* Operator which makes the application unstable until the observable emits, completes, errors, or is unsubscribed.
*
* Use this operator in observables whose subscriptions are important for rendering and should be included in SSR serialization.
*
* @param injector The `Injector` to use during creation. If this is not provided, the current injection context will be used instead (via `inject`).
*
* @developerPreview 20.0
*/
function pendingUntilEvent(injector) {
if (injector === undefined) {
ngDevMode && assertInInjectionContext(pendingUntilEvent);
injector = inject(Injector);
}
const taskService = injector.get(PendingTasks);
return (sourceObservable) => {
return new Observable((originalSubscriber) => {
// create a new task on subscription
const removeTask = taskService.add();
let cleanedUp = false;
function cleanupTask() {
if (cleanedUp) {
return;
}
removeTask();
cleanedUp = true;
}
const innerSubscription = sourceObservable.subscribe({
next: (v) => {
originalSubscriber.next(v);
cleanupTask();
},
complete: () => {
originalSubscriber.complete();
cleanupTask();
},
error: (e) => {
originalSubscriber.error(e);
cleanupTask();
},
});
innerSubscription.add(() => {
originalSubscriber.unsubscribe();
cleanupTask();
});
return innerSubscription;
});
};
}
function rxResource(opts) {
if (ngDevMode && !opts?.injector) {
assertInInjectionContext(rxResource);
}
return resource({
...opts,
loader: undefined,
stream: (params) => {
let sub;
// Track the abort listener so it can be removed if the Observable completes (as a memory
// optimization).
const onAbort = () => sub?.unsubscribe();
params.abortSignal.addEventListener('abort', onAbort);
// Start off stream as undefined.
const stream = signal({ value: undefined });
let resolve;
const promise = new Promise((r) => (resolve = r));
function send(value) {
stream.set(value);
resolve?.(stream);
resolve = undefined;
}
// TODO(alxhub): remove after g3 updated to rename loader -> stream
const streamFn = opts.stream ?? opts.loader;
if (streamFn === undefined) {
throw new RuntimeError(990 /* ɵRuntimeErrorCode.MUST_PROVIDE_STREAM_OPTION */, ngDevMode && `Must provide \`stream\` option.`);
}
sub = streamFn(params).subscribe({
next: (value) => send({ value }),
error: (error) => {
send({ error: encapsulateResourceError(error) });
params.abortSignal.removeEventListener('abort', onAbort);
},
complete: () => {
if (resolve) {
send({
error: new RuntimeError(991 /* ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE */, ngDevMode && 'Resource completed before producing a value'),
});
}
params.abortSignal.removeEventListener('abort', onAbort);
},
});
return promise;
},
});
}
export { outputFromObservable, outputToObservable, pendingUntilEvent, rxResource, takeUntilDestroyed, toObservable, toSignal };
//# sourceMappingURL=rxjs-interop.mjs.map

1
node_modules/@angular/core/fesm2022/rxjs-interop.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

581
node_modules/@angular/core/fesm2022/signal.mjs generated vendored Executable file
View File

@@ -0,0 +1,581 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
/**
* The currently active consumer `ReactiveNode`, if running code in a reactive context.
*
* Change this via `setActiveConsumer`.
*/
let activeConsumer = null;
let inNotificationPhase = false;
/**
* Global epoch counter. Incremented whenever a source signal is set.
*/
let epoch = 1;
/**
* If set, called after a producer `ReactiveNode` is created.
*/
let postProducerCreatedFn = null;
/**
* Symbol used to tell `Signal`s apart from other functions.
*
* This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.
*/
const SIGNAL = /* @__PURE__ */ Symbol('SIGNAL');
function setActiveConsumer(consumer) {
const prev = activeConsumer;
activeConsumer = consumer;
return prev;
}
function getActiveConsumer() {
return activeConsumer;
}
function isInNotificationPhase() {
return inNotificationPhase;
}
function isReactive(value) {
return value[SIGNAL] !== undefined;
}
const REACTIVE_NODE = {
version: 0,
lastCleanEpoch: 0,
dirty: false,
producers: undefined,
producersTail: undefined,
consumers: undefined,
consumersTail: undefined,
recomputing: false,
consumerAllowSignalWrites: false,
consumerIsAlwaysLive: false,
kind: 'unknown',
producerMustRecompute: () => false,
producerRecomputeValue: () => { },
consumerMarkedDirty: () => { },
consumerOnSignalRead: () => { },
};
/**
* Called by implementations when a producer's signal is read.
*/
function producerAccessed(node) {
if (inNotificationPhase) {
throw new Error(typeof ngDevMode !== 'undefined' && ngDevMode
? `Assertion error: signal read during notification phase`
: '');
}
if (activeConsumer === null) {
// Accessed outside of a reactive context, so nothing to record.
return;
}
activeConsumer.consumerOnSignalRead(node);
const prevProducerLink = activeConsumer.producersTail;
// If the last producer we accessed is the same as the current one, we can skip adding a new
// link
if (prevProducerLink !== undefined && prevProducerLink.producer === node) {
return;
}
let nextProducerLink = undefined;
const isRecomputing = activeConsumer.recomputing;
if (isRecomputing) {
// If we're incrementally rebuilding the producers list, we want to check if the next producer
// in the list is the same as the one we're trying to add.
// If the previous producer is defined, then the next producer is just the one that follows it.
// Otherwise, we should check the head of the producers list (the first node that we accessed the last time this consumer was run).
nextProducerLink =
prevProducerLink !== undefined ? prevProducerLink.nextProducer : activeConsumer.producers;
if (nextProducerLink !== undefined && nextProducerLink.producer === node) {
// If the next producer is the same as the one we're trying to add, we can just update the
// last read version, update the tail of the producers list of this rerun, and return.
activeConsumer.producersTail = nextProducerLink;
nextProducerLink.lastReadVersion = node.version;
return;
}
}
const prevConsumerLink = node.consumersTail;
// If the producer we're accessing already has a link to this consumer, we can skip adding a new
// link. This can short circuit the creation of a new link in the case where the consumer reads alternating ReeactiveNodes
if (prevConsumerLink !== undefined &&
prevConsumerLink.consumer === activeConsumer &&
// However, we have to make sure that the link we've discovered isn't from a node that is incrementally rebuilding its producer list
(!isRecomputing || isValidLink(prevConsumerLink, activeConsumer))) {
// If we found an existing link to the consumer we can just return.
return;
}
// If we got here, it means that we need to create a new link between the producer and the consumer.
const isLive = consumerIsLive(activeConsumer);
const newLink = {
producer: node,
consumer: activeConsumer,
// instead of eagerly destroying the previous link, we delay until we've finished recomputing
// the producers list, so that we can destroy all of the old links at once.
nextProducer: nextProducerLink,
prevConsumer: prevConsumerLink,
lastReadVersion: node.version,
nextConsumer: undefined,
};
activeConsumer.producersTail = newLink;
if (prevProducerLink !== undefined) {
prevProducerLink.nextProducer = newLink;
}
else {
activeConsumer.producers = newLink;
}
if (isLive) {
producerAddLiveConsumer(node, newLink);
}
}
/**
* Increment the global epoch counter.
*
* Called by source producers (that is, not computeds) whenever their values change.
*/
function producerIncrementEpoch() {
epoch++;
}
/**
* Ensure this producer's `version` is up-to-date.
*/
function producerUpdateValueVersion(node) {
if (consumerIsLive(node) && !node.dirty) {
// A live consumer will be marked dirty by producers, so a clean state means that its version
// is guaranteed to be up-to-date.
return;
}
if (!node.dirty && node.lastCleanEpoch === epoch) {
// Even non-live consumers can skip polling if they previously found themselves to be clean at
// the current epoch, since their dependencies could not possibly have changed (such a change
// would've increased the epoch).
return;
}
if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) {
// None of our producers report a change since the last time they were read, so no
// recomputation of our value is necessary, and we can consider ourselves clean.
producerMarkClean(node);
return;
}
node.producerRecomputeValue(node);
// After recomputing the value, we're no longer dirty.
producerMarkClean(node);
}
/**
* Propagate a dirty notification to live consumers of this producer.
*/
function producerNotifyConsumers(node) {
if (node.consumers === undefined) {
return;
}
// Prevent signal reads when we're updating the graph
const prev = inNotificationPhase;
inNotificationPhase = true;
try {
for (let link = node.consumers; link !== undefined; link = link.nextConsumer) {
const consumer = link.consumer;
if (!consumer.dirty) {
consumerMarkDirty(consumer);
}
}
}
finally {
inNotificationPhase = prev;
}
}
/**
* Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,
* based on the current consumer context.
*/
function producerUpdatesAllowed() {
return activeConsumer?.consumerAllowSignalWrites !== false;
}
function consumerMarkDirty(node) {
node.dirty = true;
producerNotifyConsumers(node);
node.consumerMarkedDirty?.(node);
}
function producerMarkClean(node) {
node.dirty = false;
node.lastCleanEpoch = epoch;
}
/**
* Prepare this consumer to run a computation in its reactive context and set
* it as the active consumer.
*
* Must be called by subclasses which represent reactive computations, before those computations
* begin.
*/
function consumerBeforeComputation(node) {
if (node)
resetConsumerBeforeComputation(node);
return setActiveConsumer(node);
}
/**
* Prepare this consumer to run a computation in its reactive context.
*
* We expose this mainly for code where we manually batch effects into a single
* consumer. In those cases we may wish to "reopen" a consumer multiple times
* in initial render before finalizing it. Most code should just call
* `consumerBeforeComputation` instead of calling this directly.
*/
function resetConsumerBeforeComputation(node) {
node.producersTail = undefined;
node.recomputing = true;
}
/**
* Finalize this consumer's state and set previous consumer as the active consumer after a
* reactive computation has run.
*
* Must be called by subclasses which represent reactive computations, after those computations
* have finished.
*/
function consumerAfterComputation(node, prevConsumer) {
setActiveConsumer(prevConsumer);
if (node)
finalizeConsumerAfterComputation(node);
}
/**
* Finalize this consumer's state after a reactive computation has run.
*
* We expose this mainly for code where we manually batch effects into a single
* consumer. In those cases we may wish to "reopen" a consumer multiple times
* in initial render before finalizing it. Most code should just call
* `consumerAfterComputation` instead of calling this directly.
*/
function finalizeConsumerAfterComputation(node) {
node.recomputing = false;
// We've finished incrementally rebuilding the producers list, now if there are any producers
// that are after producersTail, they are stale and should be removed.
const producersTail = node.producersTail;
let toRemove = producersTail !== undefined ? producersTail.nextProducer : node.producers;
if (toRemove !== undefined) {
if (consumerIsLive(node)) {
// For each stale link, we first unlink it from the producers list of consumers
do {
toRemove = producerRemoveLiveConsumerLink(toRemove);
} while (toRemove !== undefined);
}
// Now, we can truncate the producers list to remove all stale links.
if (producersTail !== undefined) {
producersTail.nextProducer = undefined;
}
else {
node.producers = undefined;
}
}
}
/**
* Determine whether this consumer has any dependencies which have changed since the last time
* they were read.
*/
function consumerPollProducersForChange(node) {
// Poll producers for change.
for (let link = node.producers; link !== undefined; link = link.nextProducer) {
const producer = link.producer;
const seenVersion = link.lastReadVersion;
// First check the versions. A mismatch means that the producer's value is known to have
// changed since the last time we read it.
if (seenVersion !== producer.version) {
return true;
}
// The producer's version is the same as the last time we read it, but it might itself be
// stale. Force the producer to recompute its version (calculating a new value if necessary).
producerUpdateValueVersion(producer);
// Now when we do this check, `producer.version` is guaranteed to be up to date, so if the
// versions still match then it has not changed since the last time we read it.
if (seenVersion !== producer.version) {
return true;
}
}
return false;
}
/**
* Disconnect this consumer from the graph.
*/
function consumerDestroy(node) {
if (consumerIsLive(node)) {
// Drop all connections from the graph to this node.
let link = node.producers;
while (link !== undefined) {
link = producerRemoveLiveConsumerLink(link);
}
}
// Truncate all the linked lists to drop all connection from this node to the graph.
node.producers = undefined;
node.producersTail = undefined;
node.consumers = undefined;
node.consumersTail = undefined;
}
/**
* Add `consumer` as a live consumer of this node.
*
* Note that this operation is potentially transitive. If this node becomes live, then it becomes
* a live consumer of all of its current producers.
*/
function producerAddLiveConsumer(node, link) {
const consumersTail = node.consumersTail;
const wasLive = consumerIsLive(node);
if (consumersTail !== undefined) {
link.nextConsumer = consumersTail.nextConsumer;
consumersTail.nextConsumer = link;
}
else {
link.nextConsumer = undefined;
node.consumers = link;
}
link.prevConsumer = consumersTail;
node.consumersTail = link;
if (!wasLive) {
for (let link = node.producers; link !== undefined; link = link.nextProducer) {
producerAddLiveConsumer(link.producer, link);
}
}
}
function producerRemoveLiveConsumerLink(link) {
const producer = link.producer;
const nextProducer = link.nextProducer;
const nextConsumer = link.nextConsumer;
const prevConsumer = link.prevConsumer;
link.nextConsumer = undefined;
link.prevConsumer = undefined;
if (nextConsumer !== undefined) {
nextConsumer.prevConsumer = prevConsumer;
}
else {
producer.consumersTail = prevConsumer;
}
if (prevConsumer !== undefined) {
prevConsumer.nextConsumer = nextConsumer;
}
else {
producer.consumers = nextConsumer;
if (!consumerIsLive(producer)) {
let producerLink = producer.producers;
while (producerLink !== undefined) {
producerLink = producerRemoveLiveConsumerLink(producerLink);
}
}
}
return nextProducer;
}
function consumerIsLive(node) {
return node.consumerIsAlwaysLive || node.consumers !== undefined;
}
function runPostProducerCreatedFn(node) {
postProducerCreatedFn?.(node);
}
function setPostProducerCreatedFn(fn) {
const prev = postProducerCreatedFn;
postProducerCreatedFn = fn;
return prev;
}
// While a ReactiveNode is recomputing, it may not have destroyed previous links
// This allows us to check if a given link will be destroyed by a reactivenode if it were to finish running immediately without accesing any more producers
function isValidLink(checkLink, consumer) {
const producersTail = consumer.producersTail;
if (producersTail !== undefined) {
let link = consumer.producers;
do {
if (link === checkLink) {
return true;
}
if (link === producersTail) {
break;
}
link = link.nextProducer;
} while (link !== undefined);
}
return false;
}
/**
* The default equality function used for `signal` and `computed`, which uses referential equality.
*/
function defaultEquals(a, b) {
return Object.is(a, b);
}
/**
* Create a computed signal which derives a reactive value from an expression.
*/
function createComputed(computation, equal) {
const node = Object.create(COMPUTED_NODE);
node.computation = computation;
if (equal !== undefined) {
node.equal = equal;
}
const computed = () => {
// Check if the value needs updating before returning it.
producerUpdateValueVersion(node);
// Record that someone looked at this signal.
producerAccessed(node);
if (node.value === ERRORED) {
throw node.error;
}
return node.value;
};
computed[SIGNAL] = node;
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
const debugName = node.debugName ? ' (' + node.debugName + ')' : '';
computed.toString = () => `[Computed${debugName}: ${node.value}]`;
}
runPostProducerCreatedFn(node);
return computed;
}
/**
* A dedicated symbol used before a computed value has been calculated for the first time.
* Explicitly typed as `any` so we can use it as signal's value.
*/
const UNSET = /* @__PURE__ */ Symbol('UNSET');
/**
* A dedicated symbol used in place of a computed signal value to indicate that a given computation
* is in progress. Used to detect cycles in computation chains.
* Explicitly typed as `any` so we can use it as signal's value.
*/
const COMPUTING = /* @__PURE__ */ Symbol('COMPUTING');
/**
* A dedicated symbol used in place of a computed signal value to indicate that a given computation
* failed. The thrown error is cached until the computation gets dirty again.
* Explicitly typed as `any` so we can use it as signal's value.
*/
const ERRORED = /* @__PURE__ */ Symbol('ERRORED');
// Note: Using an IIFE here to ensure that the spread assignment is not considered
// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.
// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
const COMPUTED_NODE = /* @__PURE__ */ (() => {
return {
...REACTIVE_NODE,
value: UNSET,
dirty: true,
error: null,
equal: defaultEquals,
kind: 'computed',
producerMustRecompute(node) {
// Force a recomputation if there's no current value, or if the current value is in the
// process of being calculated (which should throw an error).
return node.value === UNSET || node.value === COMPUTING;
},
producerRecomputeValue(node) {
if (node.value === COMPUTING) {
// Our computation somehow led to a cyclic read of itself.
throw new Error(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Detected cycle in computations.' : '');
}
const oldValue = node.value;
node.value = COMPUTING;
const prevConsumer = consumerBeforeComputation(node);
let newValue;
let wasEqual = false;
try {
newValue = node.computation();
// We want to mark this node as errored if calling `equal` throws; however, we don't want
// to track any reactive reads inside `equal`.
setActiveConsumer(null);
wasEqual =
oldValue !== UNSET &&
oldValue !== ERRORED &&
newValue !== ERRORED &&
node.equal(oldValue, newValue);
}
catch (err) {
newValue = ERRORED;
node.error = err;
}
finally {
consumerAfterComputation(node, prevConsumer);
}
if (wasEqual) {
// No change to `valueVersion` - old and new values are
// semantically equivalent.
node.value = oldValue;
return;
}
node.value = newValue;
node.version++;
},
};
})();
function defaultThrowError() {
throw new Error();
}
let throwInvalidWriteToSignalErrorFn = defaultThrowError;
function throwInvalidWriteToSignalError(node) {
throwInvalidWriteToSignalErrorFn(node);
}
function setThrowInvalidWriteToSignalError(fn) {
throwInvalidWriteToSignalErrorFn = fn;
}
/**
* If set, called after `WritableSignal`s are updated.
*
* This hook can be used to achieve various effects, such as running effects synchronously as part
* of setting a signal.
*/
let postSignalSetFn = null;
/**
* Creates a `Signal` getter, setter, and updater function.
*/
function createSignal(initialValue, equal) {
const node = Object.create(SIGNAL_NODE);
node.value = initialValue;
if (equal !== undefined) {
node.equal = equal;
}
const getter = (() => signalGetFn(node));
getter[SIGNAL] = node;
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
const debugName = node.debugName ? ' (' + node.debugName + ')' : '';
getter.toString = () => `[Signal${debugName}: ${node.value}]`;
}
runPostProducerCreatedFn(node);
const set = (newValue) => signalSetFn(node, newValue);
const update = (updateFn) => signalUpdateFn(node, updateFn);
return [getter, set, update];
}
function setPostSignalSetFn(fn) {
const prev = postSignalSetFn;
postSignalSetFn = fn;
return prev;
}
function signalGetFn(node) {
producerAccessed(node);
return node.value;
}
function signalSetFn(node, newValue) {
if (!producerUpdatesAllowed()) {
throwInvalidWriteToSignalError(node);
}
if (!node.equal(node.value, newValue)) {
node.value = newValue;
signalValueChanged(node);
}
}
function signalUpdateFn(node, updater) {
if (!producerUpdatesAllowed()) {
throwInvalidWriteToSignalError(node);
}
signalSetFn(node, updater(node.value));
}
function runPostSignalSetFn(node) {
postSignalSetFn?.(node);
}
// Note: Using an IIFE here to ensure that the spread assignment is not considered
// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.
// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
const SIGNAL_NODE = /* @__PURE__ */ (() => {
return {
...REACTIVE_NODE,
equal: defaultEquals,
value: undefined,
kind: 'signal',
};
})();
function signalValueChanged(node) {
node.version++;
producerIncrementEpoch();
producerNotifyConsumers(node);
postSignalSetFn?.(node);
}
export { COMPUTING, ERRORED, REACTIVE_NODE, SIGNAL, SIGNAL_NODE, UNSET, consumerAfterComputation, consumerBeforeComputation, consumerDestroy, consumerMarkDirty, consumerPollProducersForChange, createComputed, createSignal, defaultEquals, finalizeConsumerAfterComputation, getActiveConsumer, isInNotificationPhase, isReactive, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, resetConsumerBeforeComputation, runPostProducerCreatedFn, runPostSignalSetFn, setActiveConsumer, setPostProducerCreatedFn, setPostSignalSetFn, setThrowInvalidWriteToSignalError, signalGetFn, signalSetFn, signalUpdateFn };
//# sourceMappingURL=signal.mjs.map

1
node_modules/@angular/core/fesm2022/signal.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

3369
node_modules/@angular/core/fesm2022/testing.mjs generated vendored Executable file

File diff suppressed because it is too large Load Diff

1
node_modules/@angular/core/fesm2022/testing.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

12
node_modules/@angular/core/fesm2022/weak_ref.mjs generated vendored Executable file
View File

@@ -0,0 +1,12 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
function setAlternateWeakRefImpl(impl) {
// TODO: remove this function
}
export { setAlternateWeakRefImpl };
//# sourceMappingURL=weak_ref.mjs.map

1
node_modules/@angular/core/fesm2022/weak_ref.mjs.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"weak_ref.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/signals/src/weak_ref.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\nexport function setAlternateWeakRefImpl(impl: unknown) {\n // TODO: remove this function\n}\n"],"names":[],"mappings":";;;;;;AAQM,SAAU,uBAAuB,CAAC,IAAa,EAAA;;AAErD;;;;"}