@angular-architects/ngrx-toolkit 19.2.1 → 19.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,10 +42,10 @@ class SignalReduxStore {
42
42
  resultMethod: mapper.resultMethod,
43
43
  })));
44
44
  }
45
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SignalReduxStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
46
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SignalReduxStore, providedIn: 'root' }); }
45
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SignalReduxStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
46
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SignalReduxStore, providedIn: 'root' }); }
47
47
  }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SignalReduxStore, decorators: [{
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SignalReduxStore, decorators: [{
49
49
  type: Injectable,
50
50
  args: [{
51
51
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"angular-architects-ngrx-toolkit-redux-connector.mjs","sources":["../../../../libs/ngrx-toolkit/redux-connector/src/lib/util.ts","../../../../libs/ngrx-toolkit/redux-connector/src/lib/signal-redux-store.ts","../../../../libs/ngrx-toolkit/redux-connector/src/lib/create-redux.ts","../../../../libs/ngrx-toolkit/redux-connector/src/lib/rxjs-interop/redux-method.ts","../../../../libs/ngrx-toolkit/redux-connector/angular-architects-ngrx-toolkit-redux-connector.ts"],"sourcesContent":["import { ActionCreator } from '@ngrx/store';\nimport { Unsubscribable } from 'rxjs';\n\nexport function isUnsubscribable<F extends (...args: unknown[]) => unknown>(\n fn: F | (F & Unsubscribable),\n): fn is F & Unsubscribable {\n return !!(fn as F & Unsubscribable)?.unsubscribe;\n}\n\nexport function capitalize(str: string): string {\n return str ? str[0].toUpperCase() + str.substring(1) : str;\n}\n\nexport function isActionCreator(action: unknown): action is ActionCreator {\n return Boolean(\n typeof action === 'function' &&\n action &&\n 'type' in action &&\n action.type &&\n typeof action.type === 'string',\n );\n}\n","import { Injectable, inject } from '@angular/core';\nimport { rxMethod } from '@ngrx/signals/rxjs-interop';\nimport { Action, ActionCreator } from '@ngrx/store';\nimport { pipe, tap } from 'rxjs';\nimport { MapperTypes } from './model';\nimport { isUnsubscribable } from './util';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SignalReduxStore {\n private mapperDict: Record<\n string,\n {\n storeMethod: (...args: unknown[]) => unknown;\n resultMethod?: (...args: unknown[]) => unknown;\n }\n > = {};\n\n dispatch = rxMethod<Action>(\n pipe(\n tap((action: Action) => {\n const callbacks = this.mapperDict[action.type];\n if (callbacks?.storeMethod) {\n if (\n isUnsubscribable(callbacks.storeMethod) &&\n callbacks.resultMethod\n ) {\n return callbacks.storeMethod(action, (a: Action) => {\n const resultAction = callbacks.resultMethod?.(a) as Action;\n this.dispatch(resultAction);\n });\n }\n\n return callbacks?.storeMethod(action);\n }\n\n return;\n }),\n ),\n );\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n connectFeatureStore(mappers: MapperTypes<ActionCreator<any, any>[]>[]): void {\n mappers.forEach((mapper) =>\n mapper.types.forEach(\n (action) =>\n (this.mapperDict[action] = {\n storeMethod: mapper.storeMethod,\n resultMethod: mapper.resultMethod,\n }),\n ),\n );\n }\n}\n\nexport function injectReduxDispatch() {\n return inject(SignalReduxStore).dispatch;\n}\n","import {\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\nimport { ActionCreator, ActionType } from '@ngrx/store/src/models';\nimport {\n CreateReduxState,\n ExtractActionTypes,\n MapperTypes,\n ServiceWithDecorator,\n Store,\n} from './model';\nimport { SignalReduxStore, injectReduxDispatch } from './signal-redux-store';\nimport { capitalize, isActionCreator } from './util';\n\nexport function mapAction<Creators extends readonly ActionCreator[]>(\n ...args: [\n ...creators: Creators,\n storeMethod: (action: ActionType<Creators[number]>) => unknown,\n ]\n): MapperTypes<Creators>;\nexport function mapAction<Creators extends readonly ActionCreator[], T>(\n ...args: [\n ...creators: Creators,\n storeMethod: (\n action: ActionType<Creators[number]>,\n resultMethod: (input: T) => unknown,\n ) => unknown,\n resultMethod: (input: T) => unknown,\n ]\n): MapperTypes<Creators>;\nexport function mapAction<Creators extends readonly ActionCreator[]>(\n ...args: [\n ...creators: Creators,\n storeMethod: (action: ActionType<Creators[number]>) => unknown,\n resultMethod?: (input: unknown) => unknown,\n ]\n): MapperTypes<Creators> {\n let resultMethod = args.pop() as unknown as\n | ((input: unknown) => unknown)\n | undefined;\n let storeMethod = args.pop() as unknown as (\n action: ActionType<Creators[number]>,\n ) => unknown;\n\n if (isActionCreator(storeMethod)) {\n args.push(storeMethod);\n storeMethod = resultMethod || storeMethod;\n resultMethod = undefined;\n }\n\n const types = (args as unknown as Creators).map(\n (creator) => creator.type,\n ) as unknown as ExtractActionTypes<Creators>;\n\n return {\n types,\n storeMethod,\n resultMethod,\n };\n}\n\nexport function withActionMappers(\n ...mappers: MapperTypes<ActionCreator[]>[]\n): MapperTypes<ActionCreator[]>[] {\n return mappers;\n}\n\nexport function createReduxState<StoreName extends string, STORE extends Store>(\n storeName: StoreName,\n signalStore: STORE,\n withActionMappers: (\n store: InstanceType<STORE>,\n ) => MapperTypes<ActionCreator[]>[],\n): CreateReduxState<StoreName, STORE> {\n const isRootProvider =\n (signalStore as ServiceWithDecorator)?.ɵprov?.providedIn === 'root';\n return {\n [`provide${capitalize(storeName)}Store`]: (connectReduxDevtools = false) =>\n makeEnvironmentProviders([\n isRootProvider ? [] : signalStore,\n provideEnvironmentInitializer(() => {\n const initializerFn = (\n (\n signalReduxStore = inject(SignalReduxStore),\n store = inject(signalStore),\n ) =>\n () => {\n if (connectReduxDevtools) {\n // addStoreToReduxDevtools(store, storeName, false);\n }\n signalReduxStore.connectFeatureStore(withActionMappers(store));\n }\n )();\n return initializerFn();\n }),\n ]),\n [`inject${capitalize(storeName)}Store`]: () =>\n Object.assign(inject(signalStore), { dispatch: injectReduxDispatch() }),\n } as CreateReduxState<StoreName, STORE>;\n}\n","import { Injector, Signal, inject } from '@angular/core';\nimport { rxMethod } from '@ngrx/signals/rxjs-interop';\nimport { Observable, Unsubscribable, map, pipe } from 'rxjs';\n\ntype RxMethodInput<Input> = Input | Observable<Input> | Signal<Input>;\n\ntype RxMethodRef = {\n destroy: () => void;\n};\n\ntype RxMethod<Input, MethodInput = Input, MethodResult = unknown> = ((\n input: RxMethodInput<Input>,\n resultMethod: (input: MethodInput) => MethodResult,\n) => RxMethodRef) &\n RxMethodRef;\n\nexport function reduxMethod<Input, MethodInput = Input>(\n generator: (source$: Observable<Input>) => Observable<MethodInput>,\n config?: { injector?: Injector },\n): RxMethod<Input, MethodInput>;\nexport function reduxMethod<Input, MethodInput = Input, MethodResult = unknown>(\n generator: (source$: Observable<Input>) => Observable<MethodInput>,\n resultMethod: (input: MethodInput) => MethodResult,\n config?: {\n injector?: Injector;\n },\n): RxMethod<Input, MethodInput, MethodResult>;\nexport function reduxMethod<Input, MethodInput = Input, MethodResult = unknown>(\n generator: (source$: Observable<Input>) => Observable<MethodInput>,\n resultMethodOrConfig?:\n | ((input: MethodInput) => MethodResult)\n | {\n injector?: Injector;\n },\n config?: {\n injector?: Injector;\n },\n): RxMethod<Input, MethodInput, MethodResult> {\n const injector = inject(Injector);\n\n if (typeof resultMethodOrConfig === 'function') {\n let unsubscribable: Unsubscribable;\n const inputResultFn = ((\n input: RxMethodInput<Input>,\n resultMethod = resultMethodOrConfig,\n ) => {\n const rxMethodWithResult = rxMethod<Input>(\n pipe(generator, map(resultMethod)),\n {\n ...(config || {}),\n injector: config?.injector || injector,\n },\n );\n const rxWithInput = rxMethodWithResult(input);\n unsubscribable = { unsubscribe: rxWithInput.destroy.bind(rxWithInput) };\n\n return rxWithInput;\n }) as RxMethod<Input, MethodInput, MethodResult>;\n\n inputResultFn.destroy = () => unsubscribable?.unsubscribe();\n\n return inputResultFn;\n }\n\n return rxMethod<Input>(generator, resultMethodOrConfig);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGM,SAAU,gBAAgB,CAC9B,EAA4B,EAAA;AAE5B,IAAA,OAAO,CAAC,CAAE,EAAyB,EAAE,WAAW;AAClD;AAEM,SAAU,UAAU,CAAC,GAAW,EAAA;IACpC,OAAO,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG;AAC5D;AAEM,SAAU,eAAe,CAAC,MAAe,EAAA;AAC7C,IAAA,OAAO,OAAO,CACZ,OAAO,MAAM,KAAK,UAAU;QAC1B,MAAM;AACN,QAAA,MAAM,IAAI,MAAM;AAChB,QAAA,MAAM,CAAC,IAAI;AACX,QAAA,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAClC;AACH;;MCXa,gBAAgB,CAAA;AAH7B,IAAA,WAAA,GAAA;QAIU,IAAU,CAAA,UAAA,GAMd,EAAE;QAEN,IAAQ,CAAA,QAAA,GAAG,QAAQ,CACjB,IAAI,CACF,GAAG,CAAC,CAAC,MAAc,KAAI;YACrB,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC;AAC9C,YAAA,IAAI,SAAS,EAAE,WAAW,EAAE;AAC1B,gBAAA,IACE,gBAAgB,CAAC,SAAS,CAAC,WAAW,CAAC;oBACvC,SAAS,CAAC,YAAY,EACtB;oBACA,OAAO,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,CAA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AAA;AAED,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAEjC,IAAA,IAAI,OAAO,oBAAoB,KAAK,UAAU,EAAE;AAC9C,QAAA,IAAI,cAA8B;QAClC,MAAM,aAAa,IAAI,CACrB,KAA2B,EAC3B,YAAY,GAAG,oBAAoB,KACjC;AACF,YAAA,MAAM,kBAAkB,GAAG,QAAQ,CACjC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,EAClC;AACE,gBAAA,IAAI,MAAM,IAAI,EAAE,CAAC;AACjB,gBAAA,QAAQ,EAAE,MAAM,EAAE,QAAQ,IAAI,QAAQ;AACvC,aAAA,CACF;AACD,YAAA,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC;AAC7C,YAAA,cAAc,GAAG,EAAE,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;AAEvE,YAAA,OAAO,WAAW;AACpB,SAAC,CAA+C;QAEhD,aAAa,CAAC,OAAO,GAAG,MAAM,cAAc,EAAE,WAAW,EAAE;AAE3D,QAAA,OAAO,aAAa;;AAGtB,IAAA,OAAO,QAAQ,CAAQ,SAAS,EAAE,oBAAoB,CAAC;AACzD;;ACjEA;;AAEG;;;;"}
1
+ {"version":3,"file":"angular-architects-ngrx-toolkit-redux-connector.mjs","sources":["../../../../libs/ngrx-toolkit/redux-connector/src/lib/util.ts","../../../../libs/ngrx-toolkit/redux-connector/src/lib/signal-redux-store.ts","../../../../libs/ngrx-toolkit/redux-connector/src/lib/create-redux.ts","../../../../libs/ngrx-toolkit/redux-connector/src/lib/rxjs-interop/redux-method.ts","../../../../libs/ngrx-toolkit/redux-connector/angular-architects-ngrx-toolkit-redux-connector.ts"],"sourcesContent":["import { ActionCreator } from '@ngrx/store';\nimport { Unsubscribable } from 'rxjs';\n\nexport function isUnsubscribable<F extends (...args: unknown[]) => unknown>(\n fn: F | (F & Unsubscribable),\n): fn is F & Unsubscribable {\n return !!(fn as F & Unsubscribable)?.unsubscribe;\n}\n\nexport function capitalize(str: string): string {\n return str ? str[0].toUpperCase() + str.substring(1) : str;\n}\n\nexport function isActionCreator(action: unknown): action is ActionCreator {\n return Boolean(\n typeof action === 'function' &&\n action &&\n 'type' in action &&\n action.type &&\n typeof action.type === 'string',\n );\n}\n","import { Injectable, inject } from '@angular/core';\nimport { rxMethod } from '@ngrx/signals/rxjs-interop';\nimport { Action, ActionCreator } from '@ngrx/store';\nimport { pipe, tap } from 'rxjs';\nimport { MapperTypes } from './model';\nimport { isUnsubscribable } from './util';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SignalReduxStore {\n private mapperDict: Record<\n string,\n {\n storeMethod: (...args: unknown[]) => unknown;\n resultMethod?: (...args: unknown[]) => unknown;\n }\n > = {};\n\n dispatch = rxMethod<Action>(\n pipe(\n tap((action: Action) => {\n const callbacks = this.mapperDict[action.type];\n if (callbacks?.storeMethod) {\n if (\n isUnsubscribable(callbacks.storeMethod) &&\n callbacks.resultMethod\n ) {\n return callbacks.storeMethod(action, (a: Action) => {\n const resultAction = callbacks.resultMethod?.(a) as Action;\n this.dispatch(resultAction);\n });\n }\n\n return callbacks?.storeMethod(action);\n }\n\n return;\n }),\n ),\n );\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n connectFeatureStore(mappers: MapperTypes<ActionCreator<any, any>[]>[]): void {\n mappers.forEach((mapper) =>\n mapper.types.forEach(\n (action) =>\n (this.mapperDict[action] = {\n storeMethod: mapper.storeMethod,\n resultMethod: mapper.resultMethod,\n }),\n ),\n );\n }\n}\n\nexport function injectReduxDispatch() {\n return inject(SignalReduxStore).dispatch;\n}\n","import {\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\nimport { ActionCreator, ActionType } from '@ngrx/store/src/models';\nimport {\n CreateReduxState,\n ExtractActionTypes,\n MapperTypes,\n ServiceWithDecorator,\n Store,\n} from './model';\nimport { SignalReduxStore, injectReduxDispatch } from './signal-redux-store';\nimport { capitalize, isActionCreator } from './util';\n\nexport function mapAction<Creators extends readonly ActionCreator[]>(\n ...args: [\n ...creators: Creators,\n storeMethod: (action: ActionType<Creators[number]>) => unknown,\n ]\n): MapperTypes<Creators>;\nexport function mapAction<Creators extends readonly ActionCreator[], T>(\n ...args: [\n ...creators: Creators,\n storeMethod: (\n action: ActionType<Creators[number]>,\n resultMethod: (input: T) => unknown,\n ) => unknown,\n resultMethod: (input: T) => unknown,\n ]\n): MapperTypes<Creators>;\nexport function mapAction<Creators extends readonly ActionCreator[]>(\n ...args: [\n ...creators: Creators,\n storeMethod: (action: ActionType<Creators[number]>) => unknown,\n resultMethod?: (input: unknown) => unknown,\n ]\n): MapperTypes<Creators> {\n let resultMethod = args.pop() as unknown as\n | ((input: unknown) => unknown)\n | undefined;\n let storeMethod = args.pop() as unknown as (\n action: ActionType<Creators[number]>,\n ) => unknown;\n\n if (isActionCreator(storeMethod)) {\n args.push(storeMethod);\n storeMethod = resultMethod || storeMethod;\n resultMethod = undefined;\n }\n\n const types = (args as unknown as Creators).map(\n (creator) => creator.type,\n ) as unknown as ExtractActionTypes<Creators>;\n\n return {\n types,\n storeMethod,\n resultMethod,\n };\n}\n\nexport function withActionMappers(\n ...mappers: MapperTypes<ActionCreator[]>[]\n): MapperTypes<ActionCreator[]>[] {\n return mappers;\n}\n\nexport function createReduxState<StoreName extends string, STORE extends Store>(\n storeName: StoreName,\n signalStore: STORE,\n withActionMappers: (\n store: InstanceType<STORE>,\n ) => MapperTypes<ActionCreator[]>[],\n): CreateReduxState<StoreName, STORE> {\n const isRootProvider =\n (signalStore as ServiceWithDecorator)?.ɵprov?.providedIn === 'root';\n return {\n [`provide${capitalize(storeName)}Store`]: (connectReduxDevtools = false) =>\n makeEnvironmentProviders([\n isRootProvider ? [] : signalStore,\n provideEnvironmentInitializer(() => {\n const initializerFn = (\n (\n signalReduxStore = inject(SignalReduxStore),\n store = inject(signalStore),\n ) =>\n () => {\n if (connectReduxDevtools) {\n // addStoreToReduxDevtools(store, storeName, false);\n }\n signalReduxStore.connectFeatureStore(withActionMappers(store));\n }\n )();\n return initializerFn();\n }),\n ]),\n [`inject${capitalize(storeName)}Store`]: () =>\n Object.assign(inject(signalStore), { dispatch: injectReduxDispatch() }),\n } as CreateReduxState<StoreName, STORE>;\n}\n","import { Injector, Signal, inject } from '@angular/core';\nimport { rxMethod } from '@ngrx/signals/rxjs-interop';\nimport { Observable, Unsubscribable, map, pipe } from 'rxjs';\n\ntype RxMethodInput<Input> = Input | Observable<Input> | Signal<Input>;\n\ntype RxMethodRef = {\n destroy: () => void;\n};\n\ntype RxMethod<Input, MethodInput = Input, MethodResult = unknown> = ((\n input: RxMethodInput<Input>,\n resultMethod: (input: MethodInput) => MethodResult,\n) => RxMethodRef) &\n RxMethodRef;\n\nexport function reduxMethod<Input, MethodInput = Input>(\n generator: (source$: Observable<Input>) => Observable<MethodInput>,\n config?: { injector?: Injector },\n): RxMethod<Input, MethodInput>;\nexport function reduxMethod<Input, MethodInput = Input, MethodResult = unknown>(\n generator: (source$: Observable<Input>) => Observable<MethodInput>,\n resultMethod: (input: MethodInput) => MethodResult,\n config?: {\n injector?: Injector;\n },\n): RxMethod<Input, MethodInput, MethodResult>;\nexport function reduxMethod<Input, MethodInput = Input, MethodResult = unknown>(\n generator: (source$: Observable<Input>) => Observable<MethodInput>,\n resultMethodOrConfig?:\n | ((input: MethodInput) => MethodResult)\n | {\n injector?: Injector;\n },\n config?: {\n injector?: Injector;\n },\n): RxMethod<Input, MethodInput, MethodResult> {\n const injector = inject(Injector);\n\n if (typeof resultMethodOrConfig === 'function') {\n let unsubscribable: Unsubscribable;\n const inputResultFn = ((\n input: RxMethodInput<Input>,\n resultMethod = resultMethodOrConfig,\n ) => {\n const rxMethodWithResult = rxMethod<Input>(\n pipe(generator, map(resultMethod)),\n {\n ...(config || {}),\n injector: config?.injector || injector,\n },\n );\n const rxWithInput = rxMethodWithResult(input);\n unsubscribable = { unsubscribe: rxWithInput.destroy.bind(rxWithInput) };\n\n return rxWithInput;\n }) as RxMethod<Input, MethodInput, MethodResult>;\n\n inputResultFn.destroy = () => unsubscribable?.unsubscribe();\n\n return inputResultFn;\n }\n\n return rxMethod<Input>(generator, resultMethodOrConfig);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGM,SAAU,gBAAgB,CAC9B,EAA4B,EAAA;AAE5B,IAAA,OAAO,CAAC,CAAE,EAAyB,EAAE,WAAW;AAClD;AAEM,SAAU,UAAU,CAAC,GAAW,EAAA;IACpC,OAAO,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG;AAC5D;AAEM,SAAU,eAAe,CAAC,MAAe,EAAA;AAC7C,IAAA,OAAO,OAAO,CACZ,OAAO,MAAM,KAAK,UAAU;QAC1B,MAAM;AACN,QAAA,MAAM,IAAI,MAAM;AAChB,QAAA,MAAM,CAAC,IAAI;AACX,QAAA,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAClC;AACH;;MCXa,gBAAgB,CAAA;AAH7B,IAAA,WAAA,GAAA;QAIU,IAAA,CAAA,UAAU,GAMd,EAAE;QAEN,IAAA,CAAA,QAAQ,GAAG,QAAQ,CACjB,IAAI,CACF,GAAG,CAAC,CAAC,MAAc,KAAI;YACrB,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC;AAC9C,YAAA,IAAI,SAAS,EAAE,WAAW,EAAE;AAC1B,gBAAA,IACE,gBAAgB,CAAC,SAAS,CAAC,WAAW,CAAC;oBACvC,SAAS,CAAC,YAAY,EACtB;oBACA,OAAO,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAS,KAAI;wBACjD,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,GAAG,CAAC,CAAW;AAC1D,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AAM,CAAC,QAAQ,CAAC;AAEjC,IAAA,IAAI,OAAO,oBAAoB,KAAK,UAAU,EAAE;AAC9C,QAAA,IAAI,cAA8B;QAClC,MAAM,aAAa,IAAI,CACrB,KAA2B,EAC3B,YAAY,GAAG,oBAAoB,KACjC;AACF,YAAA,MAAM,kBAAkB,GAAG,QAAQ,CACjC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,EAClC;AACE,gBAAA,IAAI,MAAM,IAAI,EAAE,CAAC;AACjB,gBAAA,QAAQ,EAAE,MAAM,EAAE,QAAQ,IAAI,QAAQ;AACvC,aAAA,CACF;AACD,YAAA,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC;AAC7C,YAAA,cAAc,GAAG,EAAE,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;AAEvE,YAAA,OAAO,WAAW;AACpB,QAAA,CAAC,CAA+C;QAEhD,aAAa,CAAC,OAAO,GAAG,MAAM,cAAc,EAAE,WAAW,EAAE;AAE3D,QAAA,OAAO,aAAa;IACtB;AAEA,IAAA,OAAO,QAAQ,CAAQ,SAAS,EAAE,oBAAoB,CAAC;AACzD;;ACjEA;;AAEG;;;;"}
@@ -3,7 +3,7 @@ import { Injectable, InjectionToken, signal, effect, inject, PLATFORM_ID, comput
3
3
  import { watchState, getState, signalStoreFeature, withMethods, withHooks, patchState as patchState$1, withState, withComputed, withProps } from '@ngrx/signals';
4
4
  import { isPlatformBrowser, isPlatformServer } from '@angular/common';
5
5
  import { Subject } from 'rxjs';
6
- import { setAllEntities, addEntity, updateEntity, removeEntity } from '@ngrx/signals/entities';
6
+ import { removeEntity, setAllEntities, updateEntity, addEntity } from '@ngrx/signals/entities';
7
7
 
8
8
  const DEVTOOLS_FEATURE = Symbol('DEVTOOLS_FEATURE');
9
9
  function createDevtoolsFeature(options) {
@@ -90,10 +90,10 @@ class GlitchTrackerService {
90
90
  this.#callback({ [id]: getState(this.#stores[id].store) });
91
91
  }
92
92
  }
93
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: GlitchTrackerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
94
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: GlitchTrackerService, providedIn: 'root' }); }
93
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: GlitchTrackerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
94
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: GlitchTrackerService, providedIn: 'root' }); }
95
95
  }
96
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: GlitchTrackerService, decorators: [{
96
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: GlitchTrackerService, decorators: [{
97
97
  type: Injectable,
98
98
  args: [{ providedIn: 'root' }]
99
99
  }] });
@@ -216,10 +216,10 @@ class DefaultTracker {
216
216
  });
217
217
  }
218
218
  }
219
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DefaultTracker, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
220
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DefaultTracker, providedIn: 'root' }); }
219
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DefaultTracker, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
220
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DefaultTracker, providedIn: 'root' }); }
221
221
  }
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DefaultTracker, decorators: [{
222
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DefaultTracker, decorators: [{
223
223
  type: Injectable,
224
224
  args: [{ providedIn: 'root' }]
225
225
  }] });
@@ -373,10 +373,10 @@ Enable automatic indexing via withDevTools('${storeName}', { indexNames: true })
373
373
  }, {});
374
374
  this.#trackers.forEach((tracker) => tracker.notifyRenamedStore(id));
375
375
  }
376
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DevtoolsSyncer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
377
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DevtoolsSyncer, providedIn: 'root' }); }
376
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DevtoolsSyncer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
377
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DevtoolsSyncer, providedIn: 'root' }); }
378
378
  }
379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DevtoolsSyncer, decorators: [{
379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DevtoolsSyncer, decorators: [{
380
380
  type: Injectable,
381
381
  args: [{ providedIn: 'root' }]
382
382
  }], ctorParameters: () => [] });
@@ -1440,14 +1440,23 @@ class IndexedDBService {
1440
1440
  };
1441
1441
  });
1442
1442
  }
1443
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: IndexedDBService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1444
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: IndexedDBService, providedIn: 'root' }); }
1443
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: IndexedDBService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1444
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: IndexedDBService, providedIn: 'root' }); }
1445
1445
  }
1446
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: IndexedDBService, decorators: [{
1446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: IndexedDBService, decorators: [{
1447
1447
  type: Injectable,
1448
1448
  args: [{ providedIn: 'root' }]
1449
1449
  }] });
1450
1450
 
1451
+ /**
1452
+ * AsyncFeatureResult is used as the public interface that users interact with
1453
+ * when calling `withIndexedDB`. It intentionally omits the internal SYNC_STATUS
1454
+ * property to avoid TypeScript error TS4058 (return type of public method
1455
+ * includes private type).
1456
+ *
1457
+ * For internal implementation, we use AsyncStoreForFactory which includes
1458
+ * the SYNC_STATUS property needed for state management.
1459
+ */
1451
1460
  const SYNC_STATUS = Symbol('SYNC_STATUS');
1452
1461
 
1453
1462
  function withIndexedDB() {
@@ -1515,10 +1524,10 @@ class LocalStorageService {
1515
1524
  clear(key) {
1516
1525
  return localStorage.removeItem(key);
1517
1526
  }
1518
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1519
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: LocalStorageService, providedIn: 'root' }); }
1527
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1528
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LocalStorageService, providedIn: 'root' }); }
1520
1529
  }
1521
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: LocalStorageService, decorators: [{
1530
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LocalStorageService, decorators: [{
1522
1531
  type: Injectable,
1523
1532
  args: [{
1524
1533
  providedIn: 'root',
@@ -1535,10 +1544,10 @@ class SessionStorageService {
1535
1544
  clear(key) {
1536
1545
  return sessionStorage.removeItem(key);
1537
1546
  }
1538
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SessionStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1539
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SessionStorageService, providedIn: 'root' }); }
1547
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1548
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionStorageService, providedIn: 'root' }); }
1540
1549
  }
1541
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SessionStorageService, decorators: [{
1550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionStorageService, decorators: [{
1542
1551
  type: Injectable,
1543
1552
  args: [{
1544
1553
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"angular-architects-ngrx-toolkit.mjs","sources":["../../../../libs/ngrx-toolkit/src/lib/devtools/internal/devtools-feature.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/features/with-disabled-name-indicies.ts","../../../../libs/ngrx-toolkit/src/lib/shared/throw-if-null.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/internal/glitch-tracker.service.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/features/with-glitch-tracking.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/features/with-mapper.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/provide-devtools-config.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/internal/default-tracker.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/internal/current-action-names.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/internal/devtools-syncer.service.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/with-devtools.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/rename-devtools-name.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/update-state.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/with-dev-tools-stub.ts","../../../../libs/ngrx-toolkit/src/lib/assertions/assertions.ts","../../../../libs/ngrx-toolkit/src/lib/with-redux.ts","../../../../libs/ngrx-toolkit/src/lib/with-call-state.ts","../../../../libs/ngrx-toolkit/src/lib/with-data-service.ts","../../../../libs/ngrx-toolkit/src/lib/with-pagination.ts","../../../../libs/ngrx-toolkit/src/lib/with-reset.ts","../../../../libs/ngrx-toolkit/src/lib/with-undo-redo.ts","../../../../libs/ngrx-toolkit/src/lib/immutable-state/deep-freeze.ts","../../../../libs/ngrx-toolkit/src/lib/immutable-state/is-dev-mode.ts","../../../../libs/ngrx-toolkit/src/lib/immutable-state/with-immutable-state.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/internal/indexeddb.service.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/internal/models.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/features/with-indexed-db.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/internal/local-storage.service.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/internal/session-storage.service.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/features/with-local-storage.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/with-storage-sync.ts","../../../../libs/ngrx-toolkit/src/lib/with-conditional.ts","../../../../libs/ngrx-toolkit/src/lib/with-feature-factory.ts","../../../../libs/ngrx-toolkit/src/angular-architects-ngrx-toolkit.ts"],"sourcesContent":["import { Tracker } from './models';\n\nexport const DEVTOOLS_FEATURE = Symbol('DEVTOOLS_FEATURE');\n\nexport type Mapper = (state: object) => object;\n\nexport type DevtoolsOptions = {\n indexNames?: boolean; // defines if names should be indexed.\n map?: Mapper; // defines a mapper for the state.\n tracker?: new () => Tracker; // defines a tracker for the state\n};\n\nexport type DevtoolsInnerOptions = {\n indexNames: boolean;\n map: Mapper;\n tracker: Tracker;\n};\n\n/**\n * A DevtoolsFeature adds or modifies the behavior of the\n * devtools extension.\n *\n * We use them (function calls) instead of a config object,\n * because of tree-shaking.\n */\nexport type DevtoolsFeature = {\n [DEVTOOLS_FEATURE]: true;\n} & Partial<DevtoolsOptions>;\n\nexport function createDevtoolsFeature(\n options: DevtoolsOptions,\n): DevtoolsFeature {\n return {\n [DEVTOOLS_FEATURE]: true,\n ...options,\n };\n}\n","import { createDevtoolsFeature } from '../internal/devtools-feature';\n\n/**\n * If multiple instances of the same SignalStore class\n * exist, their devtool names are indexed.\n *\n * For example:\n *\n * ```typescript\n * const Store = signalStore(\n * withDevtools('flights')\n * )\n *\n * const store1 = new Store(); // will show up as 'flights'\n * const store2 = new Store(); // will show up as 'flights-1'\n * ```\n *\n * With adding `withDisabledNameIndices` to the store:\n * ```typescript\n * const Store = signalStore(\n * withDevtools('flights', withDisabledNameIndices())\n * )\n *\n * const store1 = new Store(); // will show up as 'flights'\n * const store2 = new Store(); //💥 throws an error\n * ```\n *\n */\nexport function withDisabledNameIndices() {\n return createDevtoolsFeature({ indexNames: false });\n}\n","export function throwIfNull<T>(obj: T): NonNullable<T> {\n if (obj === null || obj === undefined) {\n throw new Error('');\n }\n\n return obj;\n}\n","import { Injectable } from '@angular/core';\nimport { getState, StateSource, watchState } from '@ngrx/signals';\nimport { throwIfNull } from '../../shared/throw-if-null';\nimport { Tracker, TrackerStores } from './models';\n\ntype Stores = Record<\n string,\n { destroyWatcher: () => void; store: StateSource<object> }\n>;\n\n/**\n * Internal Service used by {@link withGlitchTracking}. It does not rely\n * on `effect` as {@link DefaultTracker} does but uses the NgRx function\n * `watchState` to track all state changes.\n */\n@Injectable({ providedIn: 'root' })\nexport class GlitchTrackerService implements Tracker {\n #stores: Stores = {};\n #callback: ((changedState: Record<string, object>) => void) | undefined;\n\n get stores() {\n return Object.entries(this.#stores).reduce((acc, [id, { store }]) => {\n acc[id] = store;\n return acc;\n }, {} as TrackerStores);\n }\n\n onChange(callback: (changedState: Record<string, object>) => void): void {\n this.#callback = callback;\n }\n\n removeStore(id: string): void {\n this.#stores = Object.entries(this.#stores).reduce(\n (newStore, [storeId, value]) => {\n if (storeId !== id) {\n newStore[storeId] = value;\n } else {\n value.destroyWatcher();\n }\n return newStore;\n },\n {} as Stores,\n );\n\n throwIfNull(this.#callback)({});\n }\n\n track(id: string, store: StateSource<object>): void {\n const watcher = watchState(store, (state) => {\n throwIfNull(this.#callback)({ [id]: state });\n });\n\n this.#stores[id] = { destroyWatcher: watcher.destroy, store };\n }\n\n notifyRenamedStore(id: string): void {\n if (Object.keys(this.#stores).includes(id) && this.#callback) {\n this.#callback({ [id]: getState(this.#stores[id].store) });\n }\n }\n}\n","import { createDevtoolsFeature } from '../internal/devtools-feature';\nimport { GlitchTrackerService } from '../internal/glitch-tracker.service';\n\n/**\n * It tracks all state changes of the State, including intermediary updates\n * that are typically suppressed by Angular's glitch-free mechanism.\n *\n * This feature is especially useful for debugging.\n *\n * Example:\n *\n * ```typescript\n * const Store = signalStore(\n * { providedIn: 'root' },\n * withState({ count: 0 }),\n * withDevtools('counter', withGlitchTracking()),\n * withMethods((store) => ({\n * increase: () =>\n * patchState(store, (value) => ({ count: value.count + 1 })),\n * }))\n * );\n *\n * // would show up in the DevTools with value 0\n * const store = inject(Store);\n *\n * store.increase(); // would show up in the DevTools with value 1\n * store.increase(); // would show up in the DevTools with value 2\n * store.increase(); // would show up in the DevTools with value 3\n * ```\n *\n * Without `withGlitchTracking`, the DevTools would only show the final value of 3.\n */\nexport function withGlitchTracking() {\n return createDevtoolsFeature({ tracker: GlitchTrackerService });\n}\n","import { createDevtoolsFeature, Mapper } from '../internal/devtools-feature';\n\n/**\n * Allows you to define a function to map the state.\n *\n * It is needed for huge states, that slows down the Devtools and where\n * you don't need to see the whole state or other reasons.\n *\n * Example:\n *\n * ```typescript\n * const initialState = {\n * id: 1,\n * email: 'john.list@host.com',\n * name: 'John List',\n * enteredPassword: ''\n * }\n *\n * const Store = signalStore(\n * withState(initialState),\n * withDevtools(\n * 'user',\n * withMapper(state => ({...state, enteredPassword: '***' }))\n * )\n * )\n * ```\n *\n * @param map function which maps the state\n */\nexport function withMapper<State extends object>(\n map: (state: State) => Record<string, unknown>,\n) {\n return createDevtoolsFeature({ map: map as Mapper });\n}\n","import { InjectionToken, ValueProvider } from '@angular/core';\n\n/**\n * Provides the configuration options for connecting to the Redux DevTools Extension.\n */\nexport function provideDevtoolsConfig(\n config: ReduxDevtoolsConfig,\n): ValueProvider {\n return {\n provide: REDUX_DEVTOOLS_CONFIG,\n useValue: config,\n };\n}\n\n/**\n * Injection token for the configuration options for connecting to the Redux DevTools Extension.\n */\nexport const REDUX_DEVTOOLS_CONFIG = new InjectionToken<ReduxDevtoolsConfig>(\n 'ReduxDevtoolsConfig',\n);\n\n/**\n * Options for connecting to the Redux DevTools Extension.\n * @example\n * const devToolsOptions: ReduxDevtoolsConfig = {\n * name: 'My App',\n * };\n */\nexport type ReduxDevtoolsConfig = {\n /** Optional name for the devtools instance. If empty, \"NgRx SignalStore\" will be used. */\n name?: string;\n};\n","import { effect, Injectable, signal } from '@angular/core';\nimport { getState, StateSource } from '@ngrx/signals';\nimport { Tracker, TrackerStores } from './models';\n\n@Injectable({ providedIn: 'root' })\nexport class DefaultTracker implements Tracker {\n readonly #stores = signal<TrackerStores>({});\n\n get stores(): TrackerStores {\n return this.#stores();\n }\n\n #trackCallback: undefined | ((changedState: Record<string, object>) => void);\n\n #trackingEffect = effect(() => {\n if (this.#trackCallback === undefined) {\n throw new Error('no callback function defined');\n }\n const stores = this.#stores();\n\n const fullState = Object.entries(stores).reduce(\n (acc, [id, store]) => {\n return { ...acc, [id]: getState(store) };\n },\n {} as Record<string, object>,\n );\n\n this.#trackCallback(fullState);\n });\n\n track(id: string, store: StateSource<object>): void {\n this.#stores.update((value) => ({\n ...value,\n [id]: store,\n }));\n }\n\n onChange(callback: (changedState: Record<string, object>) => void): void {\n this.#trackCallback = callback;\n }\n\n removeStore(id: string) {\n this.#stores.update((stores) =>\n Object.entries(stores).reduce((newStore, [storeId, state]) => {\n if (storeId !== id) {\n newStore[storeId] = state;\n }\n return newStore;\n }, {} as TrackerStores),\n );\n }\n\n notifyRenamedStore(id: string): void {\n if (this.#stores()[id]) {\n this.#stores.update((stores) => {\n return { ...stores };\n });\n }\n }\n}\n","export const currentActionNames = new Set<string>();\n","import { isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, OnDestroy, PLATFORM_ID } from '@angular/core';\nimport { StateSource } from '@ngrx/signals';\nimport { throwIfNull } from '../../shared/throw-if-null';\nimport { REDUX_DEVTOOLS_CONFIG } from '../provide-devtools-config';\nimport { currentActionNames } from './current-action-names';\nimport { DevtoolsInnerOptions } from './devtools-feature';\nimport { Connection, StoreRegistry, Tracker } from './models';\n\nconst dummyConnection: Connection = {\n send: () => void true,\n};\n\n/**\n * A service provided by the root injector is\n * required because the synchronization runs\n * globally.\n *\n * The SignalStore could be provided in a component.\n * If the effect starts in the injection\n * context of the SignalStore, the complete sync\n * process would shut down once the component gets\n * destroyed.\n */\n@Injectable({ providedIn: 'root' })\nexport class DevtoolsSyncer implements OnDestroy {\n /**\n * Stores all SignalStores that are connected to the\n * DevTools along their options, names and id.\n */\n #stores: StoreRegistry = {};\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #trackers = [] as Tracker[];\n readonly #devtoolsConfig = {\n name: 'NgRx SignalStore',\n ...inject(REDUX_DEVTOOLS_CONFIG, { optional: true }),\n };\n\n /**\n * Maintains the current states of all stores to avoid conflicts\n * between glitch-free and glitched trackers when used simultaneously.\n *\n * The challenge lies in ensuring that glitched trackers do not\n * interfere with the synchronization process of glitch-free trackers.\n * Specifically, glitched trackers could cause the synchronization to\n * read the current state of stores managed by glitch-free trackers.\n *\n * Therefore, the synchronization process doesn't read the state from\n * each store, but relies on #currentState.\n *\n * Please note, that here the key is the name and not the id.\n */\n #currentState: Record<string, object> = {};\n #currentId = 1;\n\n readonly #connection: Connection = this.#isBrowser\n ? window.__REDUX_DEVTOOLS_EXTENSION__\n ? window.__REDUX_DEVTOOLS_EXTENSION__.connect(this.#devtoolsConfig)\n : dummyConnection\n : dummyConnection;\n\n constructor() {\n if (!this.#isBrowser) {\n return;\n }\n }\n\n ngOnDestroy(): void {\n currentActionNames.clear();\n }\n\n syncToDevTools(changedStatePerId: Record<string, object>) {\n const mappedChangedStatePerName = Object.entries(changedStatePerId).reduce(\n (acc, [id, store]) => {\n const { options, name } = this.#stores[id];\n acc[name] = options.map(store);\n return acc;\n },\n {} as Record<string, object>,\n );\n this.#currentState = {\n ...this.#currentState,\n ...mappedChangedStatePerName,\n };\n\n const names = Array.from(currentActionNames);\n const type = names.length ? names.join(', ') : 'Store Update';\n currentActionNames.clear();\n\n this.#connection.send({ type }, this.#currentState);\n }\n\n getNextId() {\n return String(this.#currentId++);\n }\n\n /**\n * Consumer provides the id. That is because we can only start\n * tracking the store in the init hook.\n * Unfortunately, methods for renaming having the final id\n * need to be defined already before.\n * That's why `withDevtools` requests first the id and\n * then registers itself later.\n */\n addStore(\n id: string,\n name: string,\n store: StateSource<object>,\n options: DevtoolsInnerOptions,\n ) {\n let storeName = name;\n const names = Object.values(this.#stores).map((store) => store.name);\n\n if (names.includes(storeName)) {\n // const { options } = throwIfNull(\n // Object.values(this.#stores).find((store) => store.name === storeName)\n // );\n if (!options.indexNames) {\n throw new Error(`An instance of the store ${storeName} already exists. \\\nEnable automatic indexing via withDevTools('${storeName}', { indexNames: true }), or rename it upon instantiation.`);\n }\n }\n\n for (let i = 1; names.includes(storeName); i++) {\n storeName = `${name}-${i}`;\n }\n this.#stores[id] = { name: storeName, options };\n\n const tracker = options.tracker;\n if (!this.#trackers.includes(tracker)) {\n this.#trackers.push(tracker);\n }\n\n tracker.onChange((changedState) => this.syncToDevTools(changedState));\n tracker.track(id, store);\n }\n\n removeStore(id: string) {\n const name = this.#stores[id].name;\n this.#stores = Object.entries(this.#stores).reduce(\n (newStore, [storeId, value]) => {\n if (storeId !== id) {\n newStore[storeId] = value;\n }\n return newStore;\n },\n {} as StoreRegistry,\n );\n\n this.#currentState = Object.entries(this.#currentState).reduce(\n (newState, [storeName, state]) => {\n if (storeName !== name) {\n newState[name] = state;\n }\n return newState;\n },\n {} as Record<string, object>,\n );\n\n for (const tracker of this.#trackers) {\n tracker.removeStore(id);\n }\n }\n\n renameStore(oldName: string, newName: string) {\n const storeNames = Object.values(this.#stores).map((store) => store.name);\n const id = throwIfNull(\n Object.keys(this.#stores).find((id) => this.#stores[id].name === oldName),\n );\n if (storeNames.includes(newName)) {\n throw new Error(\n `NgRx Toolkit/DevTools: cannot rename from ${oldName} to ${newName}. ${newName} is already assigned to another SignalStore instance.`,\n );\n }\n\n this.#stores = Object.entries(this.#stores).reduce(\n (newStore, [id, value]) => {\n if (value.name === oldName) {\n newStore[id] = { ...value, name: newName };\n } else {\n newStore[id] = value;\n }\n return newStore;\n },\n {} as StoreRegistry,\n );\n\n // we don't rename in #currentState but wait for tracker to notify\n // us with a changed state that contains that name.\n this.#currentState = Object.entries(this.#currentState).reduce(\n (newState, [storeName, state]) => {\n if (storeName !== oldName) {\n newState[storeName] = state;\n }\n return newState;\n },\n {} as Record<string, object>,\n );\n\n this.#trackers.forEach((tracker) => tracker.notifyRenamedStore(id));\n }\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n signalStoreFeature,\n withHooks,\n withMethods,\n} from '@ngrx/signals';\nimport { DefaultTracker } from './internal/default-tracker';\nimport {\n DevtoolsFeature,\n DevtoolsInnerOptions,\n} from './internal/devtools-feature';\nimport { DevtoolsSyncer } from './internal/devtools-syncer.service';\nimport { ReduxDevtoolsExtension } from './internal/models';\n\ndeclare global {\n interface Window {\n __REDUX_DEVTOOLS_EXTENSION__: ReduxDevtoolsExtension | undefined;\n }\n}\n\nexport const renameDevtoolsMethodName = '___renameDevtoolsName';\nexport const uniqueDevtoolsId = '___uniqueDevtoolsId';\n\nconst EXISTING_NAMES = new InjectionToken(\n 'Array contain existing names for the signal stores',\n { factory: () => [] as string[], providedIn: 'root' },\n);\n\n/**\n * Adds this store as a feature state to the Redux DevTools.\n *\n * By default, the action name is 'Store Update'. You can\n * change that via the {@link updateState} method, which has as second\n * parameter the action name.\n *\n * The standalone function {@link renameDevtoolsName} can rename\n * the store name.\n *\n * @param name name of the store as it should appear in the DevTools\n * @param features features to extend or modify the behavior of the Devtools\n */\nexport function withDevtools(name: string, ...features: DevtoolsFeature[]) {\n return signalStoreFeature(\n withMethods(() => {\n const syncer = inject(DevtoolsSyncer);\n\n const id = syncer.getNextId();\n\n // TODO: use withProps and symbols\n return {\n [renameDevtoolsMethodName]: (newName: string) => {\n syncer.renameStore(name, newName);\n },\n [uniqueDevtoolsId]: () => id,\n } as Record<string, (newName?: unknown) => unknown>;\n }),\n withHooks((store) => {\n const syncer = inject(DevtoolsSyncer);\n const id = String(store[uniqueDevtoolsId]());\n return {\n onInit() {\n const id = String(store[uniqueDevtoolsId]());\n const finalOptions: DevtoolsInnerOptions = {\n indexNames: !features.some((f) => f.indexNames === false),\n map: features.find((f) => f.map)?.map ?? ((state) => state),\n tracker: inject(\n features.find((f) => f.tracker)?.tracker || DefaultTracker,\n ),\n };\n\n syncer.addStore(id, name, store, finalOptions);\n },\n onDestroy() {\n syncer.removeStore(id);\n },\n };\n }),\n ) as SignalStoreFeature<EmptyFeatureResult, EmptyFeatureResult>;\n}\n","import { StateSource } from '@ngrx/signals';\nimport { renameDevtoolsMethodName } from './with-devtools';\n\n/**\n * Renames the name of a store how it appears in the Devtools.\n * @param store instance of the SignalStore\n * @param newName new name for the Devtools\n */\nexport function renameDevtoolsName<State extends object>(\n store: StateSource<State>,\n newName: string,\n): void {\n const renameMethod = (store as Record<string, (newName: string) => void>)[\n renameDevtoolsMethodName\n ];\n if (!renameMethod) {\n throw new Error(\"Devtools extensions haven't been added to this store.\");\n }\n\n renameMethod(newName);\n}\n","import {\n patchState as originalPatchState,\n PartialStateUpdater,\n WritableStateSource,\n} from '@ngrx/signals';\nimport { Prettify } from '../shared/prettify';\nimport { currentActionNames } from './internal/current-action-names';\n\ntype PatchFn = typeof originalPatchState extends (\n arg1: infer First,\n ...args: infer Rest\n) => infer Returner\n ? (state: First, action: string, ...rest: Rest) => Returner\n : never;\n\n/**\n * @deprecated Has been renamed to `updateState`\n */\nexport const patchState: PatchFn = (state, action, ...rest) => {\n updateState(state, action, ...rest);\n};\n\n/**\n * Wrapper of `patchState` for DevTools integration. Next to updating the state,\n * it also sends the action to the DevTools.\n * @param stateSource state of Signal Store\n * @param action name of action how it will show in DevTools\n * @param updaters updater functions or objects\n */\nexport function updateState<State extends object>(\n stateSource: WritableStateSource<State>,\n action: string,\n ...updaters: Array<\n Partial<Prettify<State>> | PartialStateUpdater<Prettify<State>>\n >\n): void {\n currentActionNames.add(action);\n return originalPatchState(stateSource, ...updaters);\n}\n","import { withDevtools } from './with-devtools';\n\n/**\n * Stub for DevTools integration. Can be used to disable DevTools in production.\n */\nexport const withDevToolsStub: typeof withDevtools = () => (store) => store;\n","import { ActionsFnSpecs } from '../with-redux';\n\nexport function assertActionFnSpecs(\n obj: unknown,\n): asserts obj is ActionsFnSpecs {\n if (!obj || typeof obj !== 'object') {\n throw new Error('%o is not an Action Specification');\n }\n}\n","import {\n EmptyFeatureResult,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n WritableStateSource,\n} from '@ngrx/signals';\nimport { Observable, Subject } from 'rxjs';\nimport { assertActionFnSpecs } from './assertions/assertions';\n\n/** Actions **/\n\ntype Payload = Record<string, unknown>;\n\ntype ActionFn<\n Type extends string = string,\n ActionPayload extends Payload = Payload,\n> = ((payload: ActionPayload) => ActionPayload & { type: Type }) & {\n type: Type;\n};\n\ntype ActionFns = Record<string, ActionFn>;\n\nexport type ActionsFnSpecs = Record<string, Payload>;\n\ntype ActionFnCreator<Spec extends ActionsFnSpecs> = {\n [ActionName in keyof Spec]: (Record<never, never> extends Spec[ActionName]\n ? () => Spec[ActionName] & { type: ActionName }\n : (\n payload: Spec[ActionName],\n ) => Spec[ActionName] & { type: ActionName }) & {\n type: ActionName & string;\n };\n};\n\ntype ActionFnPayload<Action> = Action extends (payload: infer Payload) => void\n ? Payload\n : never;\n\ntype ActionFnsCreator<Spec extends ActionsFnSpecs> = Spec extends {\n private: Record<string, Payload>;\n public: Record<string, Payload>;\n}\n ? ActionFnCreator<Spec['private']> & ActionFnCreator<Spec['public']>\n : ActionFnCreator<Spec>;\n\ntype PublicActionFns<Spec extends ActionsFnSpecs> = Spec extends {\n public: Record<string, Payload>;\n}\n ? ActionFnCreator<Spec['public']>\n : ActionFnCreator<Spec>;\n\nexport function payload<Type extends Payload>(): Type {\n return {} as Type;\n}\n\nexport const noPayload = {};\n\n/** Reducer **/\n\ntype ReducerFunction<ReducerAction, State> = (\n state: State,\n action: ActionFnPayload<ReducerAction>,\n) => void;\n\ntype ReducerFactory<StateActionFns extends ActionFns, State> = (\n actions: StateActionFns,\n on: <ReducerAction extends { type: string }>(\n action: ReducerAction,\n reducerFn: ReducerFunction<ReducerAction, State>,\n ) => void,\n) => void;\n\n/**\n * Creates a reducer function to separate the reducer logic into another file.\n *\n * ```typescript\n * interface FlightState {\n * flights: Flight[];\n * effect1: boolean;\n * effect2: boolean;\n * }\n *\n * const initialState: FlightState = {\n * flights: [],\n * effect1: false,\n * effect2: false,\n * };\n *\n * const actions = {\n * init: noPayload,\n * updateEffect1: payload<{ value: boolean }>(),\n * updateEffect2: payload<{ value: boolean }>(),\n * };\n *\n * const reducer = createReducer<FlightState, typeof actions>((actions, on) => {\n * on(actions.updateEffect1, (state, { value }) => {\n * patchState(state, { effect1: value });\n * });\n *\n * on(actions.updateEffect2, (state, { value }) => {\n * patchState(state, { effect2: value });\n * });\n * });\n *\n * signalStore(\n * withState(initialState),\n * withRedux({\n * actions,\n * reducer,\n * })\n * );\n * ```\n * @param reducerFactory\n */\nexport function createReducer<\n State extends object,\n Actions extends ActionsFnSpecs,\n>(\n reducerFactory: ReducerFactory<\n ActionFnsCreator<Actions>,\n WritableStateSource<State>\n >,\n) {\n return reducerFactory;\n}\n\n/** Effect **/\n\ntype EffectsFactory<StateActionFns extends ActionFns> = (\n actions: StateActionFns,\n create: <EffectAction extends { type: string }>(\n action: EffectAction,\n ) => Observable<ActionFnPayload<EffectAction>>,\n) => Record<string, Observable<unknown>>;\n\n/**\n * @deprecated Use NgRx's `@ngrx/signals/events` starting in 19.2\n *\n * Creates the effects function to separate the effects logic into another file.\n *\n * ```typescript\n * interface FlightState {\n * flights: Flight[];\n * effect1: boolean;\n * effect2: boolean;\n * }\n *\n * const initialState: FlightState = {\n * flights: [],\n * effect1: false,\n * effect2: false,\n * };\n *\n * const actions = {\n * init: noPayload,\n * updateEffect1: payload<{ value: boolean }>(),\n * updateEffect2: payload<{ value: boolean }>(),\n * };\n *\n * const effects = createEffects(actions, (actions, create) => {\n * return {\n * init1$: create(actions.init).pipe(\n * map(() => actions.updateEffect1({ value: true }))\n * ),\n * init2$: create(actions.init).pipe(\n * map(() => actions.updateEffect2({ value: true }))\n * ),\n * };\n * });\n *\n * signalStore(\n * withState(initialState),\n * withRedux({\n * actions,\n * effects,\n * })\n * );\n * ```\n * @param actions\n * @param effectsFactory\n */\nexport function createEffects<Actions extends ActionsFnSpecs>(\n actions: Actions,\n effectsFactory: EffectsFactory<ActionFnsCreator<Actions>>,\n) {\n return effectsFactory;\n}\n\n// internal types\n\n/**\n * Record which holds all effects for a specific action type.\n * The values are Subject which the effect are subscribed to.\n * `createActionFns` will call next on these subjects.\n */\ntype EffectsRegistry = Record<string, Subject<ActionFnPayload<unknown>>[]>;\n\nfunction createActionFns<Spec extends ActionsFnSpecs>(\n actionFnSpecs: Spec,\n reducerRegistry: Record<\n string,\n (state: unknown, payload: ActionFnPayload<unknown>) => void\n >,\n effectsRegistry: EffectsRegistry,\n state: unknown,\n) {\n const actionFns: Record<string, ActionFn> = {};\n\n for (const type in actionFnSpecs) {\n const actionFn = (payload: Payload) => {\n const fullPayload = { ...payload, type };\n const reducer = reducerRegistry[type];\n if (reducer) {\n (reducer as (state: unknown, payload: unknown) => void)(\n state,\n fullPayload as unknown,\n );\n }\n const effectSubjects = effectsRegistry[type];\n if (effectSubjects?.length) {\n for (const effectSubject of effectSubjects) {\n (effectSubject as unknown as Subject<unknown>).next(fullPayload);\n }\n }\n return fullPayload;\n };\n actionFn.type = type.toString();\n actionFns[type] = actionFn;\n }\n\n return actionFns;\n}\n\nfunction createPublicAndAllActionsFns<Spec extends ActionsFnSpecs>(\n actionFnSpecs: Spec,\n reducerRegistry: Record<\n string,\n (state: unknown, payload: ActionFnPayload<unknown>) => void\n >,\n effectsRegistry: EffectsRegistry,\n state: unknown,\n): { all: ActionFns; publics: ActionFns } {\n if ('public' in actionFnSpecs || 'private' in actionFnSpecs) {\n const privates = actionFnSpecs['private'] || {};\n const publics = actionFnSpecs['public'] || {};\n\n assertActionFnSpecs(privates);\n assertActionFnSpecs(publics);\n\n const privateActionFns = createActionFns(\n privates,\n reducerRegistry,\n effectsRegistry,\n state,\n );\n const publicActionFns = createActionFns(\n publics,\n reducerRegistry,\n effectsRegistry,\n state,\n );\n\n return {\n all: { ...privateActionFns, ...publicActionFns },\n publics: publicActionFns,\n };\n }\n\n const actionFns = createActionFns(\n actionFnSpecs,\n reducerRegistry,\n effectsRegistry,\n state,\n );\n\n return { all: actionFns, publics: actionFns };\n}\n\nfunction fillReducerRegistry(\n reducer: ReducerFactory<ActionFns, unknown>,\n actionFns: ActionFns,\n reducerRegistry: Record<\n string,\n (state: unknown, payload: ActionFnPayload<unknown>) => void\n >,\n) {\n function on(\n action: { type: string },\n reducerFn: (state: unknown, payload: ActionFnPayload<unknown>) => void,\n ) {\n reducerRegistry[action.type] = reducerFn;\n }\n\n reducer(actionFns, on);\n\n return reducerRegistry;\n}\n\nfunction fillEffects(\n effects: EffectsFactory<ActionFns>,\n actionFns: ActionFns,\n effectsRegistry: EffectsRegistry = {},\n): Observable<unknown>[] {\n function create(action: { type: string }) {\n const subject = new Subject<ActionFnPayload<unknown>>();\n if (!(action.type in effectsRegistry)) {\n effectsRegistry[action.type] = [];\n }\n effectsRegistry[action.type].push(subject);\n return subject.asObservable();\n }\n\n const effectObservables = effects(actionFns, create);\n return Object.values(effectObservables);\n}\n\nfunction startSubscriptions(observables: Observable<unknown>[]) {\n return observables.map((observable) => observable.subscribe());\n}\n\nfunction processRedux<Spec extends ActionsFnSpecs, ReturnType>(\n actionFnSpecs: Spec,\n reducer: ReducerFactory<ActionFns, unknown>,\n effects: EffectsFactory<ActionFns>,\n store: unknown,\n) {\n const reducerRegistry: Record<\n string,\n (state: unknown, payload: ActionFnPayload<unknown>) => void\n > = {};\n const effectsRegistry: Record<string, Subject<ActionFnPayload<unknown>>[]> =\n {};\n const actionsMap = createPublicAndAllActionsFns(\n actionFnSpecs,\n reducerRegistry,\n effectsRegistry,\n store,\n );\n const actionFns = actionsMap.all;\n const publicActionsFns = actionsMap.publics;\n\n fillReducerRegistry(reducer, actionFns, reducerRegistry);\n const effectObservables = fillEffects(effects, actionFns, effectsRegistry);\n const subscriptions = startSubscriptions(effectObservables);\n\n return {\n methods: publicActionsFns as ReturnType,\n subscriptions: subscriptions,\n };\n}\n\n/**\n * @param redux redux\n *\n * properties do not start with `with` since they are not extension functions on their own.\n *\n * no dependency to NgRx\n *\n * actions are passed to reducer and effects, but it is also possible to use other actions.\n * effects provide forAction and do not return anything. that is important because effects should stay inaccessible\n */\nexport function withRedux<\n Spec extends ActionsFnSpecs,\n Input extends SignalStoreFeatureResult,\n StateActionFns extends ActionFnsCreator<Spec> = ActionFnsCreator<Spec>,\n PublicStoreActionFns extends PublicActionFns<Spec> = PublicActionFns<Spec>,\n>(redux: {\n actions: Spec;\n reducer: ReducerFactory<StateActionFns, WritableStateSource<Input['state']>>;\n effects: EffectsFactory<StateActionFns>;\n}): SignalStoreFeature<\n Input,\n EmptyFeatureResult & { methods: PublicStoreActionFns }\n> {\n return (store) => {\n const { methods } = processRedux<Spec, PublicStoreActionFns>(\n redux.actions,\n redux.reducer as ReducerFactory<ActionFns, unknown>,\n redux.effects as EffectsFactory<ActionFns>,\n store,\n );\n return {\n ...store,\n methods: { ...store.methods, ...methods },\n };\n };\n}\n","import { Signal, computed } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n signalStoreFeature,\n withComputed,\n withState,\n} from '@ngrx/signals';\n\nexport type CallState = 'init' | 'loading' | 'loaded' | { error: string };\n\nexport type CallStateSlice = {\n callState: CallState;\n};\n\nexport type NamedCallStateSlice<Collection extends string> = {\n [K in keyof CallStateSlice as Collection extends ''\n ? `${Collection}${K}`\n : `${Collection}${Capitalize<K>}`]: CallStateSlice[K];\n};\n\nexport type CallStateSignals = {\n loading: Signal<boolean>;\n loaded: Signal<boolean>;\n error: Signal<string | null>;\n};\n\nexport type NamedCallStateSignals<Prop extends string> = {\n [K in keyof CallStateSignals as Prop extends ''\n ? `${Prop}${K}`\n : `${Prop}${Capitalize<K>}`]: CallStateSignals[K];\n};\n\nexport type SetCallState<Prop extends string | undefined> = Prop extends string\n ? NamedCallStateSlice<Prop>\n : CallStateSlice;\n\nexport function deriveCallStateKeys<Collection extends string>(\n collection?: Collection,\n) {\n return {\n callStateKey: collection ? `${collection}CallState` : 'callState',\n loadingKey: collection ? `${collection}Loading` : 'loading',\n loadedKey: collection ? `${collection}Loaded` : 'loaded',\n errorKey: collection ? `${collection}Error` : 'error',\n };\n}\n\nexport function getCallStateKeys(config?: { collection?: string }) {\n const prop = config?.collection;\n return deriveCallStateKeys(prop);\n}\n\nexport function getCollectionArray(\n config: { collection?: string } | { collections?: string[] },\n) {\n return 'collections' in config\n ? config.collections\n : 'collection' in config && config.collection\n ? [config.collection]\n : undefined;\n}\n\nexport function withCallState<Collection extends string>(config: {\n collections: Collection[];\n}): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: NamedCallStateSlice<Collection>;\n props: NamedCallStateSignals<Collection>;\n }\n>;\nexport function withCallState<Collection extends string>(config: {\n collection: Collection;\n}): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: NamedCallStateSlice<Collection>;\n props: NamedCallStateSignals<Collection>;\n }\n>;\nexport function withCallState(): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: CallStateSlice;\n props: CallStateSignals;\n }\n>;\nexport function withCallState<Collection extends string>(\n config?:\n | {\n collection: Collection;\n }\n | {\n collections: Collection[];\n },\n): SignalStoreFeature {\n return signalStoreFeature(\n withState(() => {\n if (!config) {\n return { callState: 'init' };\n }\n const collections = getCollectionArray(config);\n if (collections) {\n return collections.reduce(\n (acc, cur) => ({\n ...acc,\n ...{ [cur ? `${cur}CallState` : 'callState']: 'init' },\n }),\n {},\n );\n }\n\n return { callState: 'init' };\n }),\n withComputed((state: Record<string, Signal<unknown>>) => {\n if (config) {\n const collections = getCollectionArray(config);\n if (collections) {\n return collections.reduce<Record<string, Signal<unknown>>>(\n (acc, cur: string) => {\n const { callStateKey, errorKey, loadedKey, loadingKey } =\n deriveCallStateKeys(cur);\n const callState = state[callStateKey] as Signal<CallState>;\n return {\n ...acc,\n [loadingKey]: computed(() => callState() === 'loading'),\n [loadedKey]: computed(() => callState() === 'loaded'),\n [errorKey]: computed(() => {\n const v = callState();\n return typeof v === 'object' ? v.error : null;\n }),\n };\n },\n {},\n );\n }\n }\n const { callStateKey, errorKey, loadedKey, loadingKey } =\n deriveCallStateKeys();\n const callState = state[callStateKey] as Signal<CallState>;\n return {\n [loadingKey]: computed(() => callState() === 'loading'),\n [loadedKey]: computed(() => callState() === 'loaded'),\n [errorKey]: computed(() => {\n const v = callState();\n return typeof v === 'object' ? v.error : null;\n }),\n };\n }),\n );\n}\n\nexport function setLoading<Prop extends string | undefined = undefined>(\n prop?: Prop,\n): SetCallState<Prop> {\n if (prop) {\n return { [`${prop}CallState`]: 'loading' } as SetCallState<Prop>;\n }\n\n return { callState: 'loading' } as SetCallState<Prop>;\n}\n\nexport function setLoaded<Prop extends string | undefined = undefined>(\n prop?: Prop,\n): SetCallState<Prop> {\n if (prop) {\n return { [`${prop}CallState`]: 'loaded' } as SetCallState<Prop>;\n } else {\n return { callState: 'loaded' } as SetCallState<Prop>;\n }\n}\n\nexport function setError<Prop extends string | undefined = undefined>(\n error: unknown,\n prop?: Prop,\n): SetCallState<Prop> {\n let errorMessage: string;\n\n if (!error) {\n errorMessage = '';\n } else if (typeof error === 'object' && 'message' in error) {\n errorMessage = String(error.message);\n } else {\n errorMessage = String(error);\n }\n\n if (prop) {\n return {\n [`${prop}CallState`]: { error: errorMessage },\n } as SetCallState<Prop>;\n } else {\n return { callState: { error: errorMessage } } as SetCallState<Prop>;\n }\n}\n","import { ProviderToken, Signal, computed, inject } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n WritableStateSource,\n patchState,\n signalStoreFeature,\n withComputed,\n withMethods,\n withState,\n} from '@ngrx/signals';\nimport {\n EntityId,\n NamedEntityState,\n addEntity,\n removeEntity,\n setAllEntities,\n updateEntity,\n} from '@ngrx/signals/entities';\nimport { EntityState } from './shared/signal-store-models';\nimport {\n CallState,\n NamedCallStateSlice,\n getCallStateKeys,\n setError,\n setLoaded,\n setLoading,\n} from './with-call-state';\n\nexport type Filter = Record<string, unknown>;\nexport type Entity = { id: EntityId };\n\nexport interface DataService<E extends Entity, F extends Filter> {\n load(filter: F): Promise<E[]>;\n\n loadById(id: EntityId): Promise<E>;\n\n create(entity: E): Promise<E>;\n\n update(entity: E): Promise<E>;\n\n updateAll(entity: E[]): Promise<E[]>;\n\n delete(entity: E): Promise<void>;\n}\n\nexport function capitalize(str: string): string {\n return str ? str[0].toUpperCase() + str.substring(1) : str;\n}\n\nexport function getDataServiceKeys(options: { collection?: string }) {\n const filterKey = options.collection\n ? `${options.collection}Filter`\n : 'filter';\n const selectedIdsKey = options.collection\n ? `selected${capitalize(options.collection)}Ids`\n : 'selectedIds';\n const selectedEntitiesKey = options.collection\n ? `selected${capitalize(options.collection)}Entities`\n : 'selectedEntities';\n\n const updateFilterKey = options.collection\n ? `update${capitalize(options.collection)}Filter`\n : 'updateFilter';\n const updateSelectedKey = options.collection\n ? `updateSelected${capitalize(options.collection)}Entities`\n : 'updateSelected';\n const loadKey = options.collection\n ? `load${capitalize(options.collection)}Entities`\n : 'load';\n\n const currentKey = options.collection\n ? `current${capitalize(options.collection)}`\n : 'current';\n const loadByIdKey = options.collection\n ? `load${capitalize(options.collection)}ById`\n : 'loadById';\n const setCurrentKey = options.collection\n ? `setCurrent${capitalize(options.collection)}`\n : 'setCurrent';\n const createKey = options.collection\n ? `create${capitalize(options.collection)}`\n : 'create';\n const updateKey = options.collection\n ? `update${capitalize(options.collection)}`\n : 'update';\n const updateAllKey = options.collection\n ? `updateAll${capitalize(options.collection)}`\n : 'updateAll';\n const deleteKey = options.collection\n ? `delete${capitalize(options.collection)}`\n : 'delete';\n\n // TODO: Take these from @ngrx/signals/entities, when they are exported\n const entitiesKey = options.collection\n ? `${options.collection}Entities`\n : 'entities';\n const entityMapKey = options.collection\n ? `${options.collection}EntityMap`\n : 'entityMap';\n const idsKey = options.collection ? `${options.collection}Ids` : 'ids';\n\n return {\n filterKey,\n selectedIdsKey,\n selectedEntitiesKey,\n updateFilterKey,\n updateSelectedKey,\n loadKey,\n entitiesKey,\n entityMapKey,\n idsKey,\n\n currentKey,\n loadByIdKey,\n setCurrentKey,\n createKey,\n updateKey,\n updateAllKey,\n deleteKey,\n };\n}\n\nexport type NamedDataServiceState<\n E extends Entity,\n F extends Filter,\n Collection extends string,\n> = {\n [K in Collection as `${K}Filter`]: F;\n} & {\n [K in Collection as `selected${Capitalize<K>}Ids`]: Record<EntityId, boolean>;\n} & {\n [K in Collection as `current${Capitalize<K>}`]: E;\n};\n\nexport type DataServiceState<E extends Entity, F extends Filter> = {\n filter: F;\n selectedIds: Record<EntityId, boolean>;\n current: E;\n};\n\nexport type DataServiceComputed<E extends Entity> = {\n selectedEntities: Signal<E[]>;\n};\n\nexport type NamedDataServiceComputed<\n E extends Entity,\n Collection extends string,\n> = {\n [K in Collection as `selected${Capitalize<K>}Entities`]: Signal<E[]>;\n};\n\nexport type NamedDataServiceMethods<\n E extends Entity,\n F extends Filter,\n Collection extends string,\n> = {\n [K in Collection as `update${Capitalize<K>}Filter`]: (filter: F) => void;\n} & {\n [K in Collection as `updateSelected${Capitalize<K>}Entities`]: (\n id: EntityId,\n selected: boolean,\n ) => void;\n} & {\n [K in Collection as `load${Capitalize<K>}Entities`]: () => Promise<void>;\n} & {\n [K in Collection as `setCurrent${Capitalize<K>}`]: (entity: E) => void;\n} & {\n [K in Collection as `load${Capitalize<K>}ById`]: (\n id: EntityId,\n ) => Promise<void>;\n} & {\n [K in Collection as `create${Capitalize<K>}`]: (entity: E) => Promise<void>;\n} & {\n [K in Collection as `update${Capitalize<K>}`]: (entity: E) => Promise<void>;\n} & {\n [K in Collection as `updateAll${Capitalize<K>}`]: (\n entity: E[],\n ) => Promise<void>;\n} & {\n [K in Collection as `delete${Capitalize<K>}`]: (entity: E) => Promise<void>;\n};\n\nexport type DataServiceMethods<E extends Entity, F extends Filter> = {\n updateFilter: (filter: F) => void;\n updateSelected: (id: EntityId, selected: boolean) => void;\n load: () => Promise<void>;\n\n setCurrent(entity: E): void;\n loadById(id: EntityId): Promise<void>;\n create(entity: E): Promise<void>;\n update(entity: E): Promise<void>;\n updateAll(entities: E[]): Promise<void>;\n delete(entity: E): Promise<void>;\n};\n\nexport function withDataService<\n E extends Entity,\n F extends Filter,\n Collection extends string,\n>(options: {\n dataServiceType: ProviderToken<DataService<E, F>>;\n filter: F;\n collection: Collection;\n}): SignalStoreFeature<\n EmptyFeatureResult & {\n state: NamedCallStateSlice<Collection> & NamedEntityState<E, Collection>;\n },\n {\n state: NamedDataServiceState<E, F, Collection>;\n props: NamedDataServiceComputed<E, Collection>;\n methods: NamedDataServiceMethods<E, F, Collection>;\n }\n>;\nexport function withDataService<E extends Entity, F extends Filter>(options: {\n dataServiceType: ProviderToken<DataService<E, F>>;\n filter: F;\n}): SignalStoreFeature<\n EmptyFeatureResult & { state: { callState: CallState } & EntityState<E> },\n {\n state: DataServiceState<E, F>;\n props: DataServiceComputed<E>;\n methods: DataServiceMethods<E, F>;\n }\n>;\n\nexport function withDataService<\n E extends Entity,\n F extends Filter,\n Collection extends string,\n>(options: {\n dataServiceType: ProviderToken<DataService<E, F>>;\n filter: F;\n collection?: Collection;\n}): /* eslint-disable @typescript-eslint/no-explicit-any */\nSignalStoreFeature<any, any> {\n const { dataServiceType, filter, collection: prefix } = options;\n const {\n entitiesKey,\n filterKey,\n loadKey,\n selectedEntitiesKey,\n selectedIdsKey,\n updateFilterKey,\n updateSelectedKey,\n\n currentKey,\n createKey,\n updateKey,\n updateAllKey,\n deleteKey,\n loadByIdKey,\n setCurrentKey,\n } = getDataServiceKeys(options);\n\n const { callStateKey } = getCallStateKeys({ collection: prefix });\n\n return signalStoreFeature(\n withState(() => ({\n [filterKey]: filter,\n [selectedIdsKey]: {} as Record<EntityId, boolean>,\n [currentKey]: undefined as E | undefined,\n })),\n withComputed((store: Record<string, unknown>) => {\n const entities = store[entitiesKey] as Signal<E[]>;\n const selectedIds = store[selectedIdsKey] as Signal<\n Record<EntityId, boolean>\n >;\n\n return {\n [selectedEntitiesKey]: computed(() =>\n entities().filter((e) => selectedIds()[e.id]),\n ),\n };\n }),\n withMethods(\n (store: Record<string, unknown> & WritableStateSource<object>) => {\n const dataService = inject(dataServiceType);\n return {\n [updateFilterKey]: (filter: F): void => {\n patchState(store, { [filterKey]: filter });\n },\n [updateSelectedKey]: (id: EntityId, selected: boolean): void => {\n patchState(store, (state: Record<string, unknown>) => ({\n [selectedIdsKey]: {\n ...(state[selectedIdsKey] as Record<EntityId, boolean>),\n [id]: selected,\n },\n }));\n },\n [loadKey]: async (): Promise<void> => {\n const filter = store[filterKey] as Signal<F>;\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const result = await dataService.load(filter());\n patchState(\n store,\n prefix\n ? setAllEntities(result, { collection: prefix })\n : setAllEntities(result),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [loadByIdKey]: async (id: EntityId): Promise<void> => {\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const current = await dataService.loadById(id);\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n patchState(store, { [currentKey]: current });\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [setCurrentKey]: (current: E): void => {\n patchState(store, { [currentKey]: current });\n },\n [createKey]: async (entity: E): Promise<void> => {\n patchState(store, { [currentKey]: entity });\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const created = await dataService.create(entity);\n patchState(store, { [currentKey]: created });\n patchState(\n store,\n prefix\n ? addEntity(created, { collection: prefix })\n : addEntity(created),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [updateKey]: async (entity: E): Promise<void> => {\n patchState(store, { [currentKey]: entity });\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const updated = await dataService.update(entity);\n patchState(store, { [currentKey]: updated });\n\n const updateArg = {\n id: updated.id,\n changes: updated,\n };\n\n const updater = (collection: string) =>\n updateEntity(updateArg, { collection });\n\n patchState(\n store,\n prefix ? updater(prefix) : updateEntity(updateArg),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [updateAllKey]: async (entities: E[]): Promise<void> => {\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const result = await dataService.updateAll(entities);\n patchState(\n store,\n prefix\n ? setAllEntities(result, { collection: prefix })\n : setAllEntities(result),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [deleteKey]: async (entity: E): Promise<void> => {\n patchState(store, { [currentKey]: entity });\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n await dataService.delete(entity);\n patchState(store, { [currentKey]: undefined });\n patchState(\n store,\n prefix\n ? removeEntity(entity.id, { collection: prefix })\n : removeEntity(entity.id),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n };\n },\n ),\n );\n}\n","/** With pagination comes in two flavors the first one is local pagination or in memory pagination. For example we have 2000 items which we want\n * to display in a table and the response payload is small enough to be stored in the memory. But we can not display all 2000 items at once\n * so we need to paginate the data. The second flavor is server side pagination where the response payload is too large to be stored in the memory\n * and we need to fetch the data from the server in chunks. In the second case we 'could' also cache the data in the memory but that could lead to\n * other problems like memory leaks and stale data. So we will not cache the data in the memory in the second case.\n * This feature implements the local pagination.\n */\n\nimport { Signal, computed } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n signalStoreFeature,\n withComputed,\n withState,\n} from '@ngrx/signals';\nimport { capitalize } from './with-data-service';\n\n// This is a virtual page which is can be used to create a pagination control\nexport type Page = { label: string | number; value: number };\n\nexport type NamedPaginationServiceState<E, Collection extends string> = {\n [K in Collection as `selectedPage${Capitalize<K>}Entities`]: Array<E>;\n} & {\n [K in Collection as `${Lowercase<K>}CurrentPage`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}PageSize`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}TotalCount`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}PageCount`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}PageNavigationArray`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}PageNavigationArrayMax`]: number;\n};\n\nexport type NamedPaginationServiceSignals<E, Collection extends string> = {\n [K in Collection as `selectedPage${Capitalize<K>}Entities`]: Signal<E[]>;\n} & {\n [K in Collection as `${Lowercase<K>}CurrentPage`]: Signal<number>;\n} & {\n [K in Collection as `${Lowercase<K>}PageSize`]: Signal<number>;\n} & {\n [K in Collection as `${Lowercase<K>}TotalCount`]: Signal<number>;\n} & {\n [K in Collection as `${Lowercase<K>}PageCount`]: Signal<number>;\n} & {\n [K in Collection as `${Lowercase<K>}PageNavigationArray`]: Signal<Page[]>;\n} & {\n [K in Collection as `${Lowercase<K>}PageNavigationArrayMax`]: Signal<number>;\n} & {\n [K in Collection as `hasNext${Capitalize<K>}Page`]: Signal<boolean>;\n} & {\n [K in Collection as `hasPrevious${Capitalize<K>}Page`]: Signal<boolean>;\n};\n\nexport type PaginationServiceState<E> = {\n selectedPageEntities: Array<E>;\n currentPage: number;\n pageSize: number;\n totalCount: number;\n pageCount: number;\n pageNavigationArray: Page[];\n pageNavigationArrayMax: number;\n};\n\nexport type PaginationServiceSignals<E> = {\n selectedPageEntities: Signal<E[]>;\n currentPage: Signal<number>;\n pageSize: Signal<number>;\n totalCount: Signal<number>;\n pageCount: Signal<number>;\n pageNavigationArray: Signal<Page[]>;\n pageNavigationArrayMax: Signal<number>;\n hasNextPage: Signal<boolean>;\n hasPreviousPage: Signal<boolean>;\n};\n\nexport type SetPaginationState<\n E,\n Collection extends string | undefined,\n> = Collection extends string\n ? NamedPaginationServiceState<E, Collection>\n : PaginationServiceState<E>;\n\nexport function withPagination<E, Collection extends string>(options: {\n entity: E;\n collection: Collection;\n}): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: NamedPaginationServiceState<E, Collection>;\n props: NamedPaginationServiceSignals<E, Collection>;\n }\n>;\n\nexport function withPagination<E>(): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: PaginationServiceState<E>;\n props: PaginationServiceSignals<E>;\n }\n>;\n\nexport function withPagination<E, Collection extends string>(options?: {\n entity: E;\n collection: Collection;\n}): SignalStoreFeature {\n const {\n pageKey,\n pageSizeKey,\n entitiesKey,\n selectedPageEntitiesKey,\n totalCountKey,\n pageCountKey,\n pageNavigationArrayMaxKey,\n pageNavigationArrayKey,\n hasNextPageKey,\n hasPreviousPageKey,\n } = createPaginationKeys<Collection>(options);\n\n return signalStoreFeature(\n withState({\n [pageKey]: 0,\n [pageSizeKey]: 10,\n [pageNavigationArrayMaxKey]: 7,\n }),\n withComputed((store: Record<string, unknown>) => {\n const entities = store[entitiesKey] as Signal<E[]>;\n const page = store[pageKey] as Signal<number>;\n const pageSize = store[pageSizeKey] as Signal<number>;\n const pageNavigationArrayMax = store[\n pageNavigationArrayMaxKey\n ] as Signal<number>;\n\n return {\n // The derived enitites which are displayed on the current page\n [selectedPageEntitiesKey]: computed<E[]>(() => {\n const pageSizeValue = pageSize();\n const pageValue = page();\n\n return entities().slice(\n pageValue * pageSizeValue,\n (pageValue + 1) * pageSizeValue,\n ) as E[];\n }),\n [totalCountKey]: computed(() => entities().length),\n [pageCountKey]: computed(() => {\n const totalCountValue = entities().length;\n const pageSizeValue = pageSize();\n\n if (totalCountValue === 0) {\n return 0;\n }\n\n return Math.ceil(totalCountValue / pageSizeValue);\n }),\n [pageNavigationArrayKey]: computed(() =>\n createPageArray(\n page(),\n pageSize(),\n entities().length,\n pageNavigationArrayMax(),\n ),\n ),\n\n [hasNextPageKey]: computed(() => {\n return page() < pageSize();\n }),\n\n [hasPreviousPageKey]: computed(() => {\n return page() > 1;\n }),\n };\n }),\n );\n}\n\nexport function gotoPage<E, Collection extends string>(\n page: number,\n options?: {\n collection: Collection;\n },\n): Partial<SetPaginationState<E, Collection>> {\n const { pageKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageKey]: page,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function setPageSize<E, Collection extends string>(\n pageSize: number,\n options?: {\n collection: Collection;\n },\n): Partial<SetPaginationState<E, Collection>> {\n const { pageSizeKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageSizeKey]: pageSize,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function nextPage<E, Collection extends string>(options?: {\n collection: Collection;\n}): Partial<SetPaginationState<E, Collection>> {\n const { pageKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageKey]: (currentPage: number) => currentPage + 1,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function previousPage<E, Collection extends string>(options?: {\n collection: Collection;\n}): Partial<SetPaginationState<E, Collection>> {\n const { pageKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageKey]: (currentPage: number) => Math.max(currentPage - 1, 1),\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function firstPage<E, Collection extends string>(options?: {\n collection: Collection;\n}): Partial<SetPaginationState<E, Collection>> {\n const { pageKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageKey]: 1,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function setMaxPageNavigationArrayItems<E, Collection extends string>(\n maxPageNavigationArrayItems: number,\n options?: {\n collection: Collection;\n },\n): Partial<SetPaginationState<E, Collection>> {\n const { pageNavigationArrayMaxKey } =\n createPaginationKeys<Collection>(options);\n\n return {\n [pageNavigationArrayMaxKey]: maxPageNavigationArrayItems,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nfunction createPaginationKeys<Collection extends string>(\n options: { collection: Collection } | undefined,\n) {\n const entitiesKey = options?.collection\n ? `${options.collection}Entities`\n : 'entities';\n\n const selectedPageEntitiesKey = options?.collection\n ? `selectedPage${capitalize(options?.collection)}Entities`\n : 'selectedPageEntities';\n\n const pageKey = options?.collection\n ? `${options.collection}CurrentPage`\n : 'currentPage';\n\n const pageSizeKey = options?.collection\n ? `${options.collection}PageSize`\n : 'pageSize';\n\n const totalCountKey = options?.collection\n ? `${options.collection}TotalCount`\n : 'totalCount';\n\n const pageCountKey = options?.collection\n ? `${options.collection}PageCount`\n : 'pageCount';\n\n const pageNavigationArrayMaxKey = options?.collection\n ? `${options.collection}PageNavigationArrayMax`\n : 'pageNavigationArrayMax';\n\n const pageNavigationArrayKey = options?.collection\n ? `${options.collection}PageNavigationArray`\n : 'pageNavigationArray';\n\n const hasNextPageKey = options?.collection\n ? `hasNext${capitalize(options.collection)}Page`\n : 'hasNextPage';\n\n const hasPreviousPageKey = options?.collection\n ? `hasPrevious${capitalize(options.collection)}Page`\n : 'hasPreviousPage';\n\n return {\n pageKey,\n pageSizeKey,\n entitiesKey,\n selectedPageEntitiesKey,\n totalCountKey,\n pageCountKey,\n pageNavigationArrayKey,\n pageNavigationArrayMaxKey,\n hasNextPageKey,\n hasPreviousPageKey,\n };\n}\n\nexport function createPageArray(\n currentPage: number,\n itemsPerPage: number,\n totalItems: number,\n paginationRange: number,\n): Page[] {\n // Convert paginationRange to number in case it's a string\n paginationRange = +paginationRange;\n\n // Calculate total number of pages\n const totalPages = Math.max(Math.ceil(totalItems / itemsPerPage), 1);\n const halfWay = Math.ceil(paginationRange / 2);\n\n const isStart = currentPage <= halfWay;\n const isEnd = totalPages - halfWay < currentPage;\n const isMiddle = !isStart && !isEnd;\n\n const ellipsesNeeded = paginationRange < totalPages;\n const pages: Page[] = [];\n\n for (let i = 1; i <= totalPages && i <= paginationRange; i++) {\n let pageNumber = i;\n\n if (i === paginationRange) {\n pageNumber = totalPages;\n } else if (ellipsesNeeded) {\n if (isEnd) {\n pageNumber = totalPages - paginationRange + i;\n } else if (isMiddle) {\n pageNumber = currentPage - halfWay + i;\n }\n }\n\n const openingEllipsesNeeded = i === 2 && (isMiddle || isEnd);\n const closingEllipsesNeeded =\n i === paginationRange - 1 && (isMiddle || isStart);\n\n const label =\n ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)\n ? '...'\n : pageNumber;\n\n pages.push({ label, value: pageNumber });\n }\n\n return pages;\n}\n","import {\n getState,\n patchState,\n signalStoreFeature,\n StateSource,\n withHooks,\n withMethods,\n withProps,\n} from '@ngrx/signals';\n\nexport type PublicMethods = {\n resetState(): void;\n};\n\n/**\n * Adds a `resetState` method to the store, which resets the state\n * to the initial state.\n *\n * If you want to set a custom initial state, you can use {@link setResetState}.\n */\nexport function withReset() {\n return signalStoreFeature(\n withProps(() => ({ _resetState: { value: {} } })),\n withMethods((store): PublicMethods => {\n // workaround to TS excessive property check\n const methods = {\n resetState() {\n patchState(store, store._resetState.value);\n },\n __setResetState__(state: object) {\n store._resetState.value = state;\n },\n };\n\n return methods;\n }),\n withHooks((store) => ({\n onInit() {\n store._resetState.value = getState(store);\n },\n })),\n );\n}\n\n/**\n * Sets the reset state of the store to the given state.\n *\n * Throws an error if the store is not configured with {@link withReset}.\n * @param store the instance of a SignalStore\n * @param state the state to set as the reset state\n */\nexport function setResetState<State extends object>(\n store: StateSource<State>,\n state: State,\n): void {\n if (!('__setResetState__' in store)) {\n throw new Error(\n 'Cannot set reset state, since store is not configured with withReset()',\n );\n }\n (store.__setResetState__ as (state: State) => void)(state);\n}\n","import { Signal, effect, isSignal, signal, untracked } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n patchState,\n signalStoreFeature,\n withComputed,\n withHooks,\n withMethods,\n} from '@ngrx/signals';\nimport { capitalize } from './with-data-service';\n\nexport type StackItem = Record<string, unknown>;\n\nexport type NormalizedUndoRedoOptions = {\n maxStackSize: number;\n collections?: string[];\n keys: string[];\n skip: number;\n};\n\nconst defaultOptions: NormalizedUndoRedoOptions = {\n maxStackSize: 100,\n keys: [],\n skip: 0,\n};\n\nexport function getUndoRedoKeys(collections?: string[]): string[] {\n if (collections) {\n return collections.flatMap((c) => [\n `${c}EntityMap`,\n `${c}Ids`,\n `selected${capitalize(c)}Ids`,\n `${c}Filter`,\n ]);\n }\n return ['entityMap', 'ids', 'selectedIds', 'filter'];\n}\n\ntype NonNever<T> = T extends never ? never : T;\n\ntype ExtractEntityCollection<T> = T extends `${infer U}Entities` ? U : never;\n\ntype ExtractEntityCollections<Store extends SignalStoreFeatureResult> =\n NonNever<\n {\n [K in keyof Store['props']]: ExtractEntityCollection<K>;\n }[keyof Store['props']]\n >;\n\ntype OptionsForState<Store extends SignalStoreFeatureResult> = Partial<\n Omit<NormalizedUndoRedoOptions, 'collections' | 'keys'>\n> & {\n collections?: ExtractEntityCollections<Store>[];\n keys?: (keyof Store['state'])[];\n};\n\nexport function withUndoRedo<Input extends EmptyFeatureResult>(\n options?: OptionsForState<Input>,\n): SignalStoreFeature<\n Input,\n EmptyFeatureResult & {\n props: {\n canUndo: Signal<boolean>;\n canRedo: Signal<boolean>;\n };\n methods: {\n undo: () => void;\n redo: () => void;\n clearStack: () => void;\n };\n }\n> {\n let previous: StackItem | null = null;\n let skipOnce = false;\n\n const normalized = {\n ...defaultOptions,\n ...options,\n };\n\n //\n // Design Decision: This feature has its own\n // internal state.\n //\n\n const undoStack: StackItem[] = [];\n const redoStack: StackItem[] = [];\n\n const canUndo = signal(false);\n const canRedo = signal(false);\n\n const updateInternal = () => {\n canUndo.set(undoStack.length !== 0);\n canRedo.set(redoStack.length !== 0);\n };\n\n const keys = [...getUndoRedoKeys(normalized.collections), ...normalized.keys];\n\n return signalStoreFeature(\n withComputed(() => ({\n canUndo: canUndo.asReadonly(),\n canRedo: canRedo.asReadonly(),\n })),\n withMethods((store) => ({\n undo(): void {\n const item = undoStack.pop();\n\n if (item && previous) {\n redoStack.push(previous);\n }\n\n if (item) {\n skipOnce = true;\n patchState(store, item);\n previous = item;\n }\n\n updateInternal();\n },\n redo(): void {\n const item = redoStack.pop();\n\n if (item && previous) {\n undoStack.push(previous);\n }\n\n if (item) {\n skipOnce = true;\n patchState(store, item);\n previous = item;\n }\n\n updateInternal();\n },\n clearStack(): void {\n undoStack.splice(0);\n redoStack.splice(0);\n previous = null;\n updateInternal();\n },\n })),\n withHooks({\n onInit(store) {\n effect(() => {\n const cand = keys.reduce((acc, key) => {\n const s = (store as Record<string | keyof Input['state'], unknown>)[\n key\n ];\n if (s && isSignal(s)) {\n return {\n ...acc,\n [key]: s(),\n };\n }\n return acc;\n }, {});\n\n if (normalized.skip > 0) {\n normalized.skip--;\n return;\n }\n\n if (skipOnce) {\n skipOnce = false;\n return;\n }\n\n //\n // Deep Comparison to prevent duplicated entries\n // on the stack. This can e.g. happen after an undo\n // if the component sends back the undone filter\n // to the store.\n //\n if (JSON.stringify(cand) === JSON.stringify(previous)) {\n return;\n }\n\n // Clear redoStack after recorded action\n redoStack.splice(0);\n\n if (previous) {\n undoStack.push(previous);\n }\n\n if (redoStack.length > normalized.maxStackSize) {\n undoStack.unshift();\n }\n\n previous = cand;\n\n // Don't propogate current reactive context\n untracked(() => updateInternal());\n });\n },\n }),\n );\n}\n","/**\n * Deep freezes a state object along its properties with primitive values\n * on the first level.\n *\n * The reason for this is that the final state is a merge of all\n * root properties of all states, i.e. `withState`,....\n *\n * Since the root object will not be part of the state (shadow clone),\n * we are not freezing it.\n */\n\nexport function deepFreeze<T extends Record<string | symbol, unknown>>(\n target: T,\n // if empty all properties will be frozen\n propertyNamesToBeFrozen: (string | symbol)[],\n // also means that we are on the first level\n isRoot = true,\n): void {\n const runPropertyNameCheck = propertyNamesToBeFrozen.length > 0;\n for (const key of Reflect.ownKeys(target)) {\n if (runPropertyNameCheck && !propertyNamesToBeFrozen.includes(key)) {\n continue;\n }\n\n const propValue = target[key];\n if (isRecordLike(propValue) && !Object.isFrozen(propValue)) {\n Object.freeze(propValue);\n deepFreeze(propValue, [], false);\n } else if (isRoot) {\n Object.defineProperty(target, key, {\n value: propValue,\n writable: false,\n configurable: false,\n });\n }\n }\n}\n\nfunction isRecordLike(\n target: unknown,\n): target is Record<string | symbol, unknown> {\n return typeof target === 'object' && target !== null;\n}\n","import { isDevMode as ngIsInDevMode } from '@angular/core';\n\n// necessary wrapper function to test prod mode\nexport function isDevMode() {\n return ngIsInDevMode();\n}\n","import {\n EmptyFeatureResult,\n signalStoreFeature,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n watchState,\n withHooks,\n withState,\n} from '@ngrx/signals';\nimport { deepFreeze } from './deep-freeze';\nimport { isDevMode } from './is-dev-mode';\n\n/**\n * The implementation of this feature is a little bit tricky.\n *\n * `signalStore` does a shallow clone in the initial phase, in order to\n * merge all different states together.\n *\n * Shallow cloning also happens in `patchState`.\n *\n * With shallow cloning, the root state object is replaced, which means,\n * the freezing only stays for its nested properties but not for\n * the primitive and immediate properties.\n *\n * For example:\n *\n * ```ts\n * const state = {\n * id: 1,\n * address: {\n * street: 'Main St',\n * city: 'Springfield',\n * }\n * }\n * ```\n *\n * Running `Object.freeze` on `state` will freeze the `address` object, and\n * the `id`. But since `state` is shallow cloned, the \"frozing\" state of the\n * `id` is lost. `address`, being an object, is still frozen.\n *\n * To overcome that, we run `watchState` and run `deepFreeze`\n * on every change.\n */\n\n/**\n * Prevents mutation of the state.\n *\n * This is done by deeply applying `Object.freeze`. Any mutable change within\n * or outside the `SignalStore` will throw an error.\n *\n * @param state the state object\n * @param options enable protection in production (default: false)\n */\nexport function withImmutableState<State extends object>(\n state: State,\n options?: { enableInProduction?: boolean },\n): SignalStoreFeature<\n SignalStoreFeatureResult,\n EmptyFeatureResult & { state: State }\n>;\n/**\n * Prevents mutation of the state.\n *\n * This is done by deeply applying `Object.freeze`. Any mutable change within\n * or outside the `SignalStore` will throw an error.\n *\n * @param stateFactory a function returning the state object\n * @param options enable protection in production (default: false)\n */\nexport function withImmutableState<State extends object>(\n stateFactory: () => State,\n options?: { enableInProduction?: boolean },\n): SignalStoreFeature<\n SignalStoreFeatureResult,\n EmptyFeatureResult & { state: State }\n>;\nexport function withImmutableState<State extends object>(\n stateOrFactory: State | (() => State),\n options?: { enableInProduction?: boolean },\n): SignalStoreFeature<\n SignalStoreFeatureResult,\n EmptyFeatureResult & { state: State }\n> {\n const immutableState =\n typeof stateOrFactory === 'function' ? stateOrFactory() : stateOrFactory;\n const stateKeys = Reflect.ownKeys(immutableState);\n\n const applyFreezing = isDevMode() || options?.enableInProduction === true;\n return signalStoreFeature(\n withState(immutableState),\n withHooks((store) => ({\n onInit() {\n if (!applyFreezing) {\n return;\n }\n /**\n * `immutableState` will be initially frozen. That is because\n * of potential mutations outside the SignalStore\n *\n * ```ts\n * const initialState = {id: 1};\n * signalStore(withImmutableState(initialState));\n *\n * initialState.id = 2; // must throw immutability\n * ```\n */\n\n Object.freeze(immutableState);\n watchState(store, (state) => {\n deepFreeze(state, stateKeys);\n });\n },\n })),\n );\n}\n","import { Injectable } from '@angular/core';\n\nexport const keyPath = 'ngrxToolkitKeyPath';\n\nexport const dbName = 'ngrxToolkitDb';\n\nexport const storeName = 'ngrxToolkitStore';\n\nexport const VERSION: number = 1 as const;\n\n@Injectable({ providedIn: 'root' })\nexport class IndexedDBService {\n /**\n * write to indexedDB\n * @param key\n * @param data\n */\n async setItem(key: string, data: string): Promise<void> {\n const db = await this.openDB();\n\n const tx = db.transaction(storeName, 'readwrite');\n\n const store = tx.objectStore(storeName);\n\n store.put({\n [keyPath]: key,\n value: data,\n });\n\n return new Promise((resolve, reject) => {\n tx.oncomplete = (): void => {\n db.close();\n resolve();\n };\n\n tx.onerror = (): void => {\n db.close();\n reject();\n };\n });\n }\n\n /**\n * read from indexedDB\n * @param key\n */\n async getItem(key: string): Promise<string | null> {\n const db = await this.openDB();\n\n const tx = db.transaction(storeName, 'readonly');\n\n const store = tx.objectStore(storeName);\n\n const request = store.get(key);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = (): void => {\n db.close();\n // localStorage(sessionStorage) returns null if the key does not exist\n // Similarly, indexedDB should return null\n if (request.result === undefined) {\n resolve(null);\n }\n resolve(request.result?.['value']);\n };\n\n request.onerror = (): void => {\n db.close();\n reject();\n };\n });\n }\n\n /**\n * delete indexedDB\n * @param key\n */\n async clear(key: string): Promise<void> {\n const db = await this.openDB();\n\n const tx = db.transaction(storeName, 'readwrite');\n\n const store = tx.objectStore(storeName);\n\n const request = store.delete(key);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = (): void => {\n db.close();\n resolve();\n };\n\n request.onerror = (): void => {\n db.close();\n reject();\n };\n });\n }\n\n /**\n * open indexedDB\n */\n private async openDB(): Promise<IDBDatabase> {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(dbName, VERSION);\n\n request.onupgradeneeded = () => {\n const db = request.result;\n\n if (!db.objectStoreNames.contains(storeName)) {\n db.createObjectStore(storeName, { keyPath });\n }\n };\n\n request.onsuccess = (): void => {\n resolve(request.result);\n };\n\n request.onerror = (): void => {\n reject(request.error);\n };\n });\n }\n}\n","import { Signal, WritableSignal } from '@angular/core';\nimport { EmptyFeatureResult, WritableStateSource } from '@ngrx/signals';\nimport { SyncConfig } from '../with-storage-sync';\n\nexport type SyncMethods = {\n clearStorage(): void;\n readFromStorage(): void;\n writeToStorage(): void;\n};\n\nexport type SyncFeatureResult = EmptyFeatureResult & {\n methods: SyncMethods;\n};\n\nexport type SyncStoreForFactory<State extends object> =\n WritableStateSource<State>;\n\nexport type SyncStorageStrategy<State extends object> = ((\n config: Required<SyncConfig<State>>,\n store: SyncStoreForFactory<State>,\n useStubs: boolean,\n) => SyncMethods) & { type: 'sync' };\n\nexport type AsyncMethods = {\n clearStorage(): Promise<void>;\n readFromStorage(): Promise<void>;\n writeToStorage(): Promise<void>;\n};\n\nexport const SYNC_STATUS = Symbol('SYNC_STATUS');\nexport type SyncStatus = 'idle' | 'syncing' | 'synced';\n\nexport type AsyncFeatureResult = EmptyFeatureResult & {\n methods: AsyncMethods;\n props: {\n isSynced: Signal<boolean>;\n whenSynced: () => Promise<void>;\n [SYNC_STATUS]: WritableSignal<SyncStatus>;\n };\n};\n\nexport type AsyncStoreForFactory<State extends object> =\n WritableStateSource<State> & AsyncFeatureResult['props'];\n\nexport type AsyncStorageStrategy<State extends object> = ((\n config: Required<SyncConfig<State>>,\n store: AsyncStoreForFactory<State>,\n useStubs: boolean,\n) => AsyncMethods) & { type: 'async' };\n","import { inject } from '@angular/core';\nimport { getState, patchState } from '@ngrx/signals';\nimport { IndexedDBService } from '../internal/indexeddb.service';\nimport {\n AsyncMethods,\n AsyncStorageStrategy,\n AsyncStoreForFactory,\n SYNC_STATUS,\n} from '../internal/models';\nimport { SyncConfig } from '../with-storage-sync';\n\nexport function withIndexedDB<\n State extends object,\n>(): AsyncStorageStrategy<State> {\n function factory(\n { key, parse, select, stringify }: Required<SyncConfig<State>>,\n store: AsyncStoreForFactory<State>,\n useStubs: boolean,\n ): AsyncMethods {\n if (useStubs) {\n return {\n clearStorage: () => Promise.resolve(),\n readFromStorage: () => Promise.resolve(),\n writeToStorage: () => Promise.resolve(),\n };\n }\n\n const indexeddbService = inject(IndexedDBService);\n\n function warnOnSyncing(mode: 'read' | 'write'): void {\n if (store[SYNC_STATUS]() === 'syncing') {\n const prettyMode = mode === 'read' ? 'Reading' : 'Writing';\n console.warn(\n `${prettyMode} to Store (${key}) happened during an ongoing synchronization process.`,\n 'Please ensure that the store is not in syncing state via `store.whenSynced()`.',\n 'Alternatively, you can disable the autoSync by passing `autoSync: false` in the config.',\n );\n }\n }\n\n return {\n /**\n * Removes the item stored in storage.\n */\n async clearStorage(): Promise<void> {\n warnOnSyncing('write');\n store[SYNC_STATUS].set('syncing');\n patchState(store, {});\n await indexeddbService.clear(key);\n store[SYNC_STATUS].set('synced');\n },\n\n /**\n * Reads item from storage and patches the state.\n */\n async readFromStorage(): Promise<void> {\n warnOnSyncing('read');\n store[SYNC_STATUS].set('syncing');\n const stateString = await indexeddbService.getItem(key);\n if (stateString) {\n patchState(store, parse(stateString));\n }\n store[SYNC_STATUS].set('synced');\n },\n\n /**\n * Writes selected portion to storage.\n */\n async writeToStorage(): Promise<void> {\n warnOnSyncing('write');\n store[SYNC_STATUS].set('syncing');\n const slicedState = select(getState(store)) as State;\n await indexeddbService.setItem(key, stringify(slicedState));\n store[SYNC_STATUS].set('synced');\n },\n };\n }\n factory.type = 'async' as const;\n\n return factory;\n}\n","import { Injectable } from '@angular/core';\nimport {} from './models';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LocalStorageService {\n getItem(key: string): string | null {\n return localStorage.getItem(key);\n }\n\n setItem(key: string, data: string): void {\n return localStorage.setItem(key, data);\n }\n\n clear(key: string): void {\n return localStorage.removeItem(key);\n }\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SessionStorageService {\n getItem(key: string): string | null {\n return sessionStorage.getItem(key);\n }\n\n setItem(key: string, data: string): void {\n return sessionStorage.setItem(key, data);\n }\n\n clear(key: string): void {\n return sessionStorage.removeItem(key);\n }\n}\n","import { inject, Type } from '@angular/core';\nimport { getState, patchState } from '@ngrx/signals';\nimport { LocalStorageService } from '../internal/local-storage.service';\nimport { SyncStorageStrategy, SyncStoreForFactory } from '../internal/models';\nimport { SessionStorageService } from '../internal/session-storage.service';\nimport { SyncConfig } from '../with-storage-sync';\n\nexport function withLocalStorage<\n State extends object,\n>(): SyncStorageStrategy<State> {\n return createSyncMethods<State>(LocalStorageService);\n}\n\nexport function withSessionStorage<State extends object>() {\n return createSyncMethods<State>(SessionStorageService);\n}\n\nfunction createSyncMethods<State extends object>(\n Storage: Type<LocalStorageService | SessionStorageService>,\n): SyncStorageStrategy<State> {\n function factory(\n { key, parse, select, stringify }: Required<SyncConfig<State>>,\n store: SyncStoreForFactory<State>,\n useStubs: boolean,\n ) {\n if (useStubs) {\n return {\n clearStorage: () => undefined,\n readFromStorage: () => undefined,\n writeToStorage: () => undefined,\n };\n }\n\n const storage = inject(Storage);\n\n return {\n clearStorage(): void {\n storage.clear(key);\n },\n\n readFromStorage(): void {\n const stateString = storage.getItem(key);\n\n if (stateString) {\n patchState(store, parse(stateString));\n }\n },\n\n writeToStorage() {\n const slicedState = select(getState(store)) as State;\n storage.setItem(key, stringify(slicedState));\n },\n };\n }\n factory.type = 'sync' as const;\n\n return factory;\n}\n","import { isPlatformServer } from '@angular/common';\nimport { computed, effect, inject, PLATFORM_ID, signal } from '@angular/core';\nimport {\n EmptyFeatureResult,\n getState,\n signalStoreFeature,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n watchState,\n withHooks,\n withMethods,\n withProps,\n} from '@ngrx/signals';\nimport {\n withLocalStorage,\n withSessionStorage,\n} from './features/with-local-storage';\nimport {\n AsyncFeatureResult,\n AsyncStorageStrategy,\n SYNC_STATUS,\n SyncFeatureResult,\n SyncStorageStrategy,\n} from './internal/models';\n\nexport type SyncConfig<State> = {\n /**\n * The key which is used to access the storage.\n */\n key: string;\n /**\n * Flag indicating if the store should read from storage on init and write to storage on every state change.\n *\n * `true` by default\n */\n autoSync?: boolean;\n /**\n * Function to select that portion of the state which should be stored.\n *\n * Returns the whole state object by default\n */\n select?: (state: State) => unknown;\n /**\n * Function used to parse the state coming from storage.\n *\n * `JSON.parse()` by default\n */\n parse?: (stateString: string) => State;\n /**\n * Function used to transform the state into a string representation.\n *\n * `JSON.stringify()` by default\n */\n stringify?: (state: State) => string;\n\n /**\n * @deprecated Use {@link withSessionStorage} instead.\n * Factory function used to switch to sessionStorage.\n *\n * `localStorage` by default\n */\n storage?: () => Storage;\n};\n\n// only key\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n key: string,\n): SignalStoreFeature<Input, SyncFeatureResult>;\n\n// key + indexeddb\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n key: string,\n storageStrategy: AsyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<Input, AsyncFeatureResult>;\n\n// key + localStorage(or sessionStorage)\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n key: string,\n storageStrategy: SyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<Input, SyncFeatureResult>;\n\n// config + localStorage\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n config: SyncConfig<Input['state']>,\n): SignalStoreFeature<Input, SyncFeatureResult>;\n\n// config + indexeddb\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n config: SyncConfig<Input['state']>,\n storageStrategy: AsyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<Input, AsyncFeatureResult>;\n\n// config + localStorage(or sessionStorage)\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n config: SyncConfig<Input['state']>,\n storageStrategy: SyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<Input, SyncFeatureResult>;\n\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n configOrKey: SyncConfig<Input['state']> | string,\n storageStrategy?:\n | AsyncStorageStrategy<Input['state']>\n | SyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<\n Input,\n EmptyFeatureResult & (SyncFeatureResult | AsyncFeatureResult)\n> {\n if (\n typeof configOrKey !== 'string' &&\n configOrKey.storage &&\n storageStrategy\n ) {\n throw new Error(\n 'You can either pass a storage strategy or a config with storage, but not both.',\n );\n }\n const config: Required<SyncConfig<Input['state']>> = {\n autoSync: true,\n select: (state: Input['state']) => state,\n parse: JSON.parse,\n stringify: JSON.stringify,\n storage: () => localStorage,\n ...(typeof configOrKey === 'string' ? { key: configOrKey } : configOrKey),\n };\n\n const factory =\n storageStrategy ??\n (config.storage() === localStorage\n ? withLocalStorage()\n : withSessionStorage());\n\n if (factory.type === 'sync') {\n return createSyncStorageSync(factory, config);\n } else {\n return createAsyncStorageSync(factory, config);\n }\n}\n\nfunction createSyncStorageSync<Input extends SignalStoreFeatureResult>(\n factory: SyncStorageStrategy<Input['state']>,\n config: Required<SyncConfig<Input['state']>>,\n) {\n return signalStoreFeature(\n withMethods((store, platformId = inject(PLATFORM_ID)) => {\n return factory(config, store, isPlatformServer(platformId));\n }),\n withHooks({\n onInit(store, platformId = inject(PLATFORM_ID)) {\n if (isPlatformServer(platformId)) {\n return;\n }\n\n if (config.autoSync) {\n store.readFromStorage();\n watchState(store, () => store.writeToStorage());\n }\n },\n }),\n ) satisfies SignalStoreFeature<EmptyFeatureResult, SyncFeatureResult>;\n}\n\nfunction createAsyncStorageSync<Input extends SignalStoreFeatureResult>(\n factory: AsyncStorageStrategy<Input['state']>,\n config: Required<SyncConfig<Input['state']>>,\n) {\n return signalStoreFeature(\n withProps(() => {\n const props = {\n /*\n // we need to have that as property (and not state)\n // Otherwise the state watcher fires when updating the sync status\n */\n [SYNC_STATUS]: signal<'idle' | 'syncing' | 'synced'>('idle'),\n };\n\n const resolves = [] as (() => void)[];\n\n effect(() => {\n const syncStatus = props[SYNC_STATUS]();\n if (syncStatus === 'synced') {\n resolves.forEach((resolve) => resolve());\n resolves.splice(0, resolves.length);\n }\n });\n\n return {\n ...props,\n isSynced: computed(() => props[SYNC_STATUS]() === 'synced'),\n whenSynced: () =>\n new Promise<void>((resolve) => {\n if (props[SYNC_STATUS]() === 'synced') {\n resolve();\n } else {\n resolves.push(resolve);\n }\n }),\n };\n }),\n withMethods((store, platformId = inject(PLATFORM_ID)) => {\n return factory(config, store, isPlatformServer(platformId));\n }),\n withHooks({\n async onInit(store, platformId = inject(PLATFORM_ID)) {\n if (isPlatformServer(platformId)) {\n return;\n }\n\n const initialState = getState(store);\n if (config.autoSync) {\n let startWatching = false;\n watchState(store, () => {\n if (!startWatching) {\n if (getState(store) === initialState) {\n return;\n }\n\n console.warn(\n `Writing to Store (${config.key}) happened before the state was initially read from storage.`,\n 'Please ensure that the store is not in syncing state via `store.whenSynced()` before writing to the state.',\n 'Alternatively, you can disable autoSync by passing `autoSync: false` in the config.',\n );\n return;\n }\n return store.writeToStorage();\n });\n\n await store.readFromStorage();\n startWatching = true;\n }\n },\n }),\n ) satisfies SignalStoreFeature<EmptyFeatureResult, AsyncFeatureResult>;\n}\n","import {\n signalStoreFeature,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n StateSignals,\n withState,\n} from '@ngrx/signals';\n\n/**\n * `withConditional` activates a feature based on a given condition.\n *\n * **Use Cases**\n * - Conditionally activate features based on the **store state** or other criteria.\n * - Choose between **two different implementations** of a feature.\n *\n * **Type Constraints**\n * Both features must have **exactly the same state, props, and methods**.\n * Otherwise, a type error will occur.\n *\n *\n * **Usage**\n *\n * ```typescript\n * const withUser = signalStoreFeature(\n * withState({ id: 1, name: 'Konrad' }),\n * withHooks(store => ({\n * onInit() {\n * // user loading logic\n * }\n * }))\n * );\n *\n * function withFakeUser() {\n * return signalStoreFeature(\n * withState({ id: 0, name: 'anonymous' })\n * );\n * }\n *\n * signalStore(\n * withMethods(() => ({\n * useRealUser: () => true\n * })),\n * withConditional((store) => store.useRealUser(), withUser, withFakeUser)\n * )\n * ```\n *\n * @param condition - A function that determines which feature to activate based on the store state.\n * @param featureIfTrue - The feature to activate if the condition evaluates to `true`.\n * @param featureIfFalse - The feature to activate if the condition evaluates to `false`.\n * @returns A `SignalStoreFeature` that applies the selected feature based on the condition.\n */\nexport function withConditional<\n Input extends SignalStoreFeatureResult,\n Output extends SignalStoreFeatureResult,\n>(\n condition: (\n store: StateSignals<Input['state']> & Input['props'] & Input['methods'],\n ) => boolean,\n featureIfTrue: SignalStoreFeature<NoInfer<Input>, Output>,\n featureIfFalse: SignalStoreFeature<NoInfer<Input>, NoInfer<Output>>,\n): SignalStoreFeature<Input, Output> {\n return (store) => {\n const conditionStore = {\n ...store['stateSignals'],\n ...store['props'],\n ...store['methods'],\n };\n return condition(conditionStore)\n ? featureIfTrue(store)\n : featureIfFalse(store);\n };\n}\n\nexport const emptyFeature = signalStoreFeature(withState({}));\n","import {\n SignalStoreFeature,\n SignalStoreFeatureResult,\n StateSignals,\n} from '@ngrx/signals';\n\ntype StoreForFactory<Input extends SignalStoreFeatureResult> = StateSignals<\n Input['state']\n> &\n Input['props'] &\n Input['methods'];\n\n/**\n * @deprecated Use `import { withFeature } from '@ngrx/signals'` instead, starting with `ngrx/signals` 19.1: https://ngrx.io/guide/signals/signal-store/custom-store-features#connecting-a-custom-feature-with-the-store\n *\n * Allows to pass properties, methods, or signals from a SignalStore\n * to a feature.\n *\n * Typically, a `signalStoreFeature` can have input constraints on\n *\n * ```typescript\n * function withSum(a: Signal<number>, b: Signal<number>) {\n * return signalStoreFeature(\n * withComputed(() => ({\n * sum: computed(() => a() + b())\n * }))\n * );\n * }\n *\n * signalStore(\n * withState({ a: 1, b: 2 }),\n * withFeatureFactory((store) => withSum(store.a, store.b))\n * );\n * ```\n * @param factoryFn\n */\nexport function withFeatureFactory<\n Input extends SignalStoreFeatureResult,\n Output extends SignalStoreFeatureResult,\n>(\n factoryFn: (\n store: StoreForFactory<Input>,\n ) => SignalStoreFeature<Input, Output>,\n): SignalStoreFeature<Input, Output> {\n return (store) => {\n const storeForFactory = {\n ...store['stateSignals'],\n ...store['props'],\n ...store['methods'],\n } as StoreForFactory<Input>;\n\n const feature = factoryFn(storeForFactory);\n\n return feature(store);\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["originalPatchState","patchState","ngIsInDevMode"],"mappings":";;;;;;;AAEO,MAAM,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AA2BpD,SAAU,qBAAqB,CACnC,OAAwB,EAAA;IAExB,OAAO;QACL,CAAC,gBAAgB,GAAG,IAAI;AACxB,QA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B;QACD,OAAO,SAAS,CAAC,cAAc;AAC7B,cAAE,aAAa,CAAC,KAAK;AACrB,cAAE,cAAc,CAAC,KAAK,CAAC;AAC3B,KAAC;AACH;AAEa,MAAA,YAAY,GAAG,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC;;AC7D5D;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACG,SAAU,kBAAkB,CAIhC,SAEsC,EAAA;IAEtC,OAAO,CAAC,KAAK,KAAI;AACf,QAAA,MAAM,eAAe,GAAG;YACtB,GAAG,KAAK,CAAC,cAAc,CAAC;YACxB,GAAG,KAAK,CAAC,OAAO,CAAC;YACjB,GAAG,KAAK,CAAC,SAAS,CAAC;SACM;AAE3B,QAAA,MAAM,OAAO,GAAG,SAAS,CAAC,eAAe,CAAC;AAE1C,QAAA,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB,KAAC;AACH;;ACvDA;;AAEG;;;;"}
1
+ {"version":3,"file":"angular-architects-ngrx-toolkit.mjs","sources":["../../../../libs/ngrx-toolkit/src/lib/devtools/internal/devtools-feature.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/features/with-disabled-name-indicies.ts","../../../../libs/ngrx-toolkit/src/lib/shared/throw-if-null.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/internal/glitch-tracker.service.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/features/with-glitch-tracking.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/features/with-mapper.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/provide-devtools-config.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/internal/default-tracker.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/internal/current-action-names.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/internal/devtools-syncer.service.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/with-devtools.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/rename-devtools-name.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/update-state.ts","../../../../libs/ngrx-toolkit/src/lib/devtools/with-dev-tools-stub.ts","../../../../libs/ngrx-toolkit/src/lib/assertions/assertions.ts","../../../../libs/ngrx-toolkit/src/lib/with-redux.ts","../../../../libs/ngrx-toolkit/src/lib/with-call-state.ts","../../../../libs/ngrx-toolkit/src/lib/with-data-service.ts","../../../../libs/ngrx-toolkit/src/lib/with-pagination.ts","../../../../libs/ngrx-toolkit/src/lib/with-reset.ts","../../../../libs/ngrx-toolkit/src/lib/with-undo-redo.ts","../../../../libs/ngrx-toolkit/src/lib/immutable-state/deep-freeze.ts","../../../../libs/ngrx-toolkit/src/lib/immutable-state/is-dev-mode.ts","../../../../libs/ngrx-toolkit/src/lib/immutable-state/with-immutable-state.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/internal/indexeddb.service.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/internal/models.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/features/with-indexed-db.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/internal/local-storage.service.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/internal/session-storage.service.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/features/with-local-storage.ts","../../../../libs/ngrx-toolkit/src/lib/storage-sync/with-storage-sync.ts","../../../../libs/ngrx-toolkit/src/lib/with-conditional.ts","../../../../libs/ngrx-toolkit/src/lib/with-feature-factory.ts","../../../../libs/ngrx-toolkit/src/angular-architects-ngrx-toolkit.ts"],"sourcesContent":["import { Tracker } from './models';\n\nexport const DEVTOOLS_FEATURE = Symbol('DEVTOOLS_FEATURE');\n\nexport type Mapper = (state: object) => object;\n\nexport type DevtoolsOptions = {\n indexNames?: boolean; // defines if names should be indexed.\n map?: Mapper; // defines a mapper for the state.\n tracker?: new () => Tracker; // defines a tracker for the state\n};\n\nexport type DevtoolsInnerOptions = {\n indexNames: boolean;\n map: Mapper;\n tracker: Tracker;\n};\n\n/**\n * A DevtoolsFeature adds or modifies the behavior of the\n * devtools extension.\n *\n * We use them (function calls) instead of a config object,\n * because of tree-shaking.\n */\nexport type DevtoolsFeature = {\n [DEVTOOLS_FEATURE]: true;\n} & Partial<DevtoolsOptions>;\n\nexport function createDevtoolsFeature(\n options: DevtoolsOptions,\n): DevtoolsFeature {\n return {\n [DEVTOOLS_FEATURE]: true,\n ...options,\n };\n}\n","import { createDevtoolsFeature } from '../internal/devtools-feature';\n\n/**\n * If multiple instances of the same SignalStore class\n * exist, their devtool names are indexed.\n *\n * For example:\n *\n * ```typescript\n * const Store = signalStore(\n * withDevtools('flights')\n * )\n *\n * const store1 = new Store(); // will show up as 'flights'\n * const store2 = new Store(); // will show up as 'flights-1'\n * ```\n *\n * With adding `withDisabledNameIndices` to the store:\n * ```typescript\n * const Store = signalStore(\n * withDevtools('flights', withDisabledNameIndices())\n * )\n *\n * const store1 = new Store(); // will show up as 'flights'\n * const store2 = new Store(); //💥 throws an error\n * ```\n *\n */\nexport function withDisabledNameIndices() {\n return createDevtoolsFeature({ indexNames: false });\n}\n","export function throwIfNull<T>(obj: T): NonNullable<T> {\n if (obj === null || obj === undefined) {\n throw new Error('');\n }\n\n return obj;\n}\n","import { Injectable } from '@angular/core';\nimport { getState, StateSource, watchState } from '@ngrx/signals';\nimport { throwIfNull } from '../../shared/throw-if-null';\nimport { Tracker, TrackerStores } from './models';\n\ntype Stores = Record<\n string,\n { destroyWatcher: () => void; store: StateSource<object> }\n>;\n\n/**\n * Internal Service used by {@link withGlitchTracking}. It does not rely\n * on `effect` as {@link DefaultTracker} does but uses the NgRx function\n * `watchState` to track all state changes.\n */\n@Injectable({ providedIn: 'root' })\nexport class GlitchTrackerService implements Tracker {\n #stores: Stores = {};\n #callback: ((changedState: Record<string, object>) => void) | undefined;\n\n get stores() {\n return Object.entries(this.#stores).reduce((acc, [id, { store }]) => {\n acc[id] = store;\n return acc;\n }, {} as TrackerStores);\n }\n\n onChange(callback: (changedState: Record<string, object>) => void): void {\n this.#callback = callback;\n }\n\n removeStore(id: string): void {\n this.#stores = Object.entries(this.#stores).reduce(\n (newStore, [storeId, value]) => {\n if (storeId !== id) {\n newStore[storeId] = value;\n } else {\n value.destroyWatcher();\n }\n return newStore;\n },\n {} as Stores,\n );\n\n throwIfNull(this.#callback)({});\n }\n\n track(id: string, store: StateSource<object>): void {\n const watcher = watchState(store, (state) => {\n throwIfNull(this.#callback)({ [id]: state });\n });\n\n this.#stores[id] = { destroyWatcher: watcher.destroy, store };\n }\n\n notifyRenamedStore(id: string): void {\n if (Object.keys(this.#stores).includes(id) && this.#callback) {\n this.#callback({ [id]: getState(this.#stores[id].store) });\n }\n }\n}\n","import { createDevtoolsFeature } from '../internal/devtools-feature';\nimport { GlitchTrackerService } from '../internal/glitch-tracker.service';\n\n/**\n * It tracks all state changes of the State, including intermediary updates\n * that are typically suppressed by Angular's glitch-free mechanism.\n *\n * This feature is especially useful for debugging.\n *\n * Example:\n *\n * ```typescript\n * const Store = signalStore(\n * { providedIn: 'root' },\n * withState({ count: 0 }),\n * withDevtools('counter', withGlitchTracking()),\n * withMethods((store) => ({\n * increase: () =>\n * patchState(store, (value) => ({ count: value.count + 1 })),\n * }))\n * );\n *\n * // would show up in the DevTools with value 0\n * const store = inject(Store);\n *\n * store.increase(); // would show up in the DevTools with value 1\n * store.increase(); // would show up in the DevTools with value 2\n * store.increase(); // would show up in the DevTools with value 3\n * ```\n *\n * Without `withGlitchTracking`, the DevTools would only show the final value of 3.\n */\nexport function withGlitchTracking() {\n return createDevtoolsFeature({ tracker: GlitchTrackerService });\n}\n","import { createDevtoolsFeature, Mapper } from '../internal/devtools-feature';\n\n/**\n * Allows you to define a function to map the state.\n *\n * It is needed for huge states, that slows down the Devtools and where\n * you don't need to see the whole state or other reasons.\n *\n * Example:\n *\n * ```typescript\n * const initialState = {\n * id: 1,\n * email: 'john.list@host.com',\n * name: 'John List',\n * enteredPassword: ''\n * }\n *\n * const Store = signalStore(\n * withState(initialState),\n * withDevtools(\n * 'user',\n * withMapper(state => ({...state, enteredPassword: '***' }))\n * )\n * )\n * ```\n *\n * @param map function which maps the state\n */\nexport function withMapper<State extends object>(\n map: (state: State) => Record<string, unknown>,\n) {\n return createDevtoolsFeature({ map: map as Mapper });\n}\n","import { InjectionToken, ValueProvider } from '@angular/core';\n\n/**\n * Provides the configuration options for connecting to the Redux DevTools Extension.\n */\nexport function provideDevtoolsConfig(\n config: ReduxDevtoolsConfig,\n): ValueProvider {\n return {\n provide: REDUX_DEVTOOLS_CONFIG,\n useValue: config,\n };\n}\n\n/**\n * Injection token for the configuration options for connecting to the Redux DevTools Extension.\n */\nexport const REDUX_DEVTOOLS_CONFIG = new InjectionToken<ReduxDevtoolsConfig>(\n 'ReduxDevtoolsConfig',\n);\n\n/**\n * Options for connecting to the Redux DevTools Extension.\n * @example\n * const devToolsOptions: ReduxDevtoolsConfig = {\n * name: 'My App',\n * };\n */\nexport type ReduxDevtoolsConfig = {\n /** Optional name for the devtools instance. If empty, \"NgRx SignalStore\" will be used. */\n name?: string;\n};\n","import { effect, Injectable, signal } from '@angular/core';\nimport { getState, StateSource } from '@ngrx/signals';\nimport { Tracker, TrackerStores } from './models';\n\n@Injectable({ providedIn: 'root' })\nexport class DefaultTracker implements Tracker {\n readonly #stores = signal<TrackerStores>({});\n\n get stores(): TrackerStores {\n return this.#stores();\n }\n\n #trackCallback: undefined | ((changedState: Record<string, object>) => void);\n\n #trackingEffect = effect(() => {\n if (this.#trackCallback === undefined) {\n throw new Error('no callback function defined');\n }\n const stores = this.#stores();\n\n const fullState = Object.entries(stores).reduce(\n (acc, [id, store]) => {\n return { ...acc, [id]: getState(store) };\n },\n {} as Record<string, object>,\n );\n\n this.#trackCallback(fullState);\n });\n\n track(id: string, store: StateSource<object>): void {\n this.#stores.update((value) => ({\n ...value,\n [id]: store,\n }));\n }\n\n onChange(callback: (changedState: Record<string, object>) => void): void {\n this.#trackCallback = callback;\n }\n\n removeStore(id: string) {\n this.#stores.update((stores) =>\n Object.entries(stores).reduce((newStore, [storeId, state]) => {\n if (storeId !== id) {\n newStore[storeId] = state;\n }\n return newStore;\n }, {} as TrackerStores),\n );\n }\n\n notifyRenamedStore(id: string): void {\n if (this.#stores()[id]) {\n this.#stores.update((stores) => {\n return { ...stores };\n });\n }\n }\n}\n","export const currentActionNames = new Set<string>();\n","import { isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, OnDestroy, PLATFORM_ID } from '@angular/core';\nimport { StateSource } from '@ngrx/signals';\nimport { throwIfNull } from '../../shared/throw-if-null';\nimport { REDUX_DEVTOOLS_CONFIG } from '../provide-devtools-config';\nimport { currentActionNames } from './current-action-names';\nimport { DevtoolsInnerOptions } from './devtools-feature';\nimport { Connection, StoreRegistry, Tracker } from './models';\n\nconst dummyConnection: Connection = {\n send: () => void true,\n};\n\n/**\n * A service provided by the root injector is\n * required because the synchronization runs\n * globally.\n *\n * The SignalStore could be provided in a component.\n * If the effect starts in the injection\n * context of the SignalStore, the complete sync\n * process would shut down once the component gets\n * destroyed.\n */\n@Injectable({ providedIn: 'root' })\nexport class DevtoolsSyncer implements OnDestroy {\n /**\n * Stores all SignalStores that are connected to the\n * DevTools along their options, names and id.\n */\n #stores: StoreRegistry = {};\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #trackers = [] as Tracker[];\n readonly #devtoolsConfig = {\n name: 'NgRx SignalStore',\n ...inject(REDUX_DEVTOOLS_CONFIG, { optional: true }),\n };\n\n /**\n * Maintains the current states of all stores to avoid conflicts\n * between glitch-free and glitched trackers when used simultaneously.\n *\n * The challenge lies in ensuring that glitched trackers do not\n * interfere with the synchronization process of glitch-free trackers.\n * Specifically, glitched trackers could cause the synchronization to\n * read the current state of stores managed by glitch-free trackers.\n *\n * Therefore, the synchronization process doesn't read the state from\n * each store, but relies on #currentState.\n *\n * Please note, that here the key is the name and not the id.\n */\n #currentState: Record<string, object> = {};\n #currentId = 1;\n\n readonly #connection: Connection = this.#isBrowser\n ? window.__REDUX_DEVTOOLS_EXTENSION__\n ? window.__REDUX_DEVTOOLS_EXTENSION__.connect(this.#devtoolsConfig)\n : dummyConnection\n : dummyConnection;\n\n constructor() {\n if (!this.#isBrowser) {\n return;\n }\n }\n\n ngOnDestroy(): void {\n currentActionNames.clear();\n }\n\n syncToDevTools(changedStatePerId: Record<string, object>) {\n const mappedChangedStatePerName = Object.entries(changedStatePerId).reduce(\n (acc, [id, store]) => {\n const { options, name } = this.#stores[id];\n acc[name] = options.map(store);\n return acc;\n },\n {} as Record<string, object>,\n );\n this.#currentState = {\n ...this.#currentState,\n ...mappedChangedStatePerName,\n };\n\n const names = Array.from(currentActionNames);\n const type = names.length ? names.join(', ') : 'Store Update';\n currentActionNames.clear();\n\n this.#connection.send({ type }, this.#currentState);\n }\n\n getNextId() {\n return String(this.#currentId++);\n }\n\n /**\n * Consumer provides the id. That is because we can only start\n * tracking the store in the init hook.\n * Unfortunately, methods for renaming having the final id\n * need to be defined already before.\n * That's why `withDevtools` requests first the id and\n * then registers itself later.\n */\n addStore(\n id: string,\n name: string,\n store: StateSource<object>,\n options: DevtoolsInnerOptions,\n ) {\n let storeName = name;\n const names = Object.values(this.#stores).map((store) => store.name);\n\n if (names.includes(storeName)) {\n // const { options } = throwIfNull(\n // Object.values(this.#stores).find((store) => store.name === storeName)\n // );\n if (!options.indexNames) {\n throw new Error(`An instance of the store ${storeName} already exists. \\\nEnable automatic indexing via withDevTools('${storeName}', { indexNames: true }), or rename it upon instantiation.`);\n }\n }\n\n for (let i = 1; names.includes(storeName); i++) {\n storeName = `${name}-${i}`;\n }\n this.#stores[id] = { name: storeName, options };\n\n const tracker = options.tracker;\n if (!this.#trackers.includes(tracker)) {\n this.#trackers.push(tracker);\n }\n\n tracker.onChange((changedState) => this.syncToDevTools(changedState));\n tracker.track(id, store);\n }\n\n removeStore(id: string) {\n const name = this.#stores[id].name;\n this.#stores = Object.entries(this.#stores).reduce(\n (newStore, [storeId, value]) => {\n if (storeId !== id) {\n newStore[storeId] = value;\n }\n return newStore;\n },\n {} as StoreRegistry,\n );\n\n this.#currentState = Object.entries(this.#currentState).reduce(\n (newState, [storeName, state]) => {\n if (storeName !== name) {\n newState[name] = state;\n }\n return newState;\n },\n {} as Record<string, object>,\n );\n\n for (const tracker of this.#trackers) {\n tracker.removeStore(id);\n }\n }\n\n renameStore(oldName: string, newName: string) {\n const storeNames = Object.values(this.#stores).map((store) => store.name);\n const id = throwIfNull(\n Object.keys(this.#stores).find((id) => this.#stores[id].name === oldName),\n );\n if (storeNames.includes(newName)) {\n throw new Error(\n `NgRx Toolkit/DevTools: cannot rename from ${oldName} to ${newName}. ${newName} is already assigned to another SignalStore instance.`,\n );\n }\n\n this.#stores = Object.entries(this.#stores).reduce(\n (newStore, [id, value]) => {\n if (value.name === oldName) {\n newStore[id] = { ...value, name: newName };\n } else {\n newStore[id] = value;\n }\n return newStore;\n },\n {} as StoreRegistry,\n );\n\n // we don't rename in #currentState but wait for tracker to notify\n // us with a changed state that contains that name.\n this.#currentState = Object.entries(this.#currentState).reduce(\n (newState, [storeName, state]) => {\n if (storeName !== oldName) {\n newState[storeName] = state;\n }\n return newState;\n },\n {} as Record<string, object>,\n );\n\n this.#trackers.forEach((tracker) => tracker.notifyRenamedStore(id));\n }\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n signalStoreFeature,\n withHooks,\n withMethods,\n} from '@ngrx/signals';\nimport { DefaultTracker } from './internal/default-tracker';\nimport {\n DevtoolsFeature,\n DevtoolsInnerOptions,\n} from './internal/devtools-feature';\nimport { DevtoolsSyncer } from './internal/devtools-syncer.service';\nimport { ReduxDevtoolsExtension } from './internal/models';\n\ndeclare global {\n interface Window {\n __REDUX_DEVTOOLS_EXTENSION__: ReduxDevtoolsExtension | undefined;\n }\n}\n\nexport const renameDevtoolsMethodName = '___renameDevtoolsName';\nexport const uniqueDevtoolsId = '___uniqueDevtoolsId';\n\nconst EXISTING_NAMES = new InjectionToken(\n 'Array contain existing names for the signal stores',\n { factory: () => [] as string[], providedIn: 'root' },\n);\n\n/**\n * Adds this store as a feature state to the Redux DevTools.\n *\n * By default, the action name is 'Store Update'. You can\n * change that via the {@link updateState} method, which has as second\n * parameter the action name.\n *\n * The standalone function {@link renameDevtoolsName} can rename\n * the store name.\n *\n * @param name name of the store as it should appear in the DevTools\n * @param features features to extend or modify the behavior of the Devtools\n */\nexport function withDevtools(name: string, ...features: DevtoolsFeature[]) {\n return signalStoreFeature(\n withMethods(() => {\n const syncer = inject(DevtoolsSyncer);\n\n const id = syncer.getNextId();\n\n // TODO: use withProps and symbols\n return {\n [renameDevtoolsMethodName]: (newName: string) => {\n syncer.renameStore(name, newName);\n },\n [uniqueDevtoolsId]: () => id,\n } as Record<string, (newName?: unknown) => unknown>;\n }),\n withHooks((store) => {\n const syncer = inject(DevtoolsSyncer);\n const id = String(store[uniqueDevtoolsId]());\n return {\n onInit() {\n const id = String(store[uniqueDevtoolsId]());\n const finalOptions: DevtoolsInnerOptions = {\n indexNames: !features.some((f) => f.indexNames === false),\n map: features.find((f) => f.map)?.map ?? ((state) => state),\n tracker: inject(\n features.find((f) => f.tracker)?.tracker || DefaultTracker,\n ),\n };\n\n syncer.addStore(id, name, store, finalOptions);\n },\n onDestroy() {\n syncer.removeStore(id);\n },\n };\n }),\n ) as SignalStoreFeature<EmptyFeatureResult, EmptyFeatureResult>;\n}\n","import { StateSource } from '@ngrx/signals';\nimport { renameDevtoolsMethodName } from './with-devtools';\n\n/**\n * Renames the name of a store how it appears in the Devtools.\n * @param store instance of the SignalStore\n * @param newName new name for the Devtools\n */\nexport function renameDevtoolsName<State extends object>(\n store: StateSource<State>,\n newName: string,\n): void {\n const renameMethod = (store as Record<string, (newName: string) => void>)[\n renameDevtoolsMethodName\n ];\n if (!renameMethod) {\n throw new Error(\"Devtools extensions haven't been added to this store.\");\n }\n\n renameMethod(newName);\n}\n","import {\n patchState as originalPatchState,\n PartialStateUpdater,\n WritableStateSource,\n} from '@ngrx/signals';\nimport { currentActionNames } from './internal/current-action-names';\n\ntype PatchFn = typeof originalPatchState extends (\n arg1: infer First,\n ...args: infer Rest\n) => infer Returner\n ? (state: First, action: string, ...rest: Rest) => Returner\n : never;\n\n/**\n * @deprecated Has been renamed to `updateState`\n */\nexport const patchState: PatchFn = (state, action, ...rest) => {\n updateState(state, action, ...rest);\n};\n\n/**\n * Wrapper of `patchState` for DevTools integration. Next to updating the state,\n * it also sends the action to the DevTools.\n * @param stateSource state of Signal Store\n * @param action name of action how it will show in DevTools\n * @param updaters updater functions or objects\n */\nexport function updateState<State extends object>(\n stateSource: WritableStateSource<State>,\n action: string,\n ...updaters: Array<\n Partial<NoInfer<State>> | PartialStateUpdater<NoInfer<State>>\n >\n): void {\n currentActionNames.add(action);\n return originalPatchState(stateSource, ...updaters);\n}\n","import { withDevtools } from './with-devtools';\n\n/**\n * Stub for DevTools integration. Can be used to disable DevTools in production.\n */\nexport const withDevToolsStub: typeof withDevtools = () => (store) => store;\n","import { ActionsFnSpecs } from '../with-redux';\n\nexport function assertActionFnSpecs(\n obj: unknown,\n): asserts obj is ActionsFnSpecs {\n if (!obj || typeof obj !== 'object') {\n throw new Error('%o is not an Action Specification');\n }\n}\n","import {\n EmptyFeatureResult,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n WritableStateSource,\n} from '@ngrx/signals';\nimport { Observable, Subject } from 'rxjs';\nimport { assertActionFnSpecs } from './assertions/assertions';\n\n/** Actions **/\n\ntype Payload = Record<string, unknown>;\n\ntype ActionFn<\n Type extends string = string,\n ActionPayload extends Payload = Payload,\n> = ((payload: ActionPayload) => ActionPayload & { type: Type }) & {\n type: Type;\n};\n\ntype ActionFns = Record<string, ActionFn>;\n\nexport type ActionsFnSpecs = Record<string, Payload>;\n\ntype ActionFnCreator<Spec extends ActionsFnSpecs> = {\n [ActionName in keyof Spec]: (Record<never, never> extends Spec[ActionName]\n ? () => Spec[ActionName] & { type: ActionName }\n : (\n payload: Spec[ActionName],\n ) => Spec[ActionName] & { type: ActionName }) & {\n type: ActionName & string;\n };\n};\n\ntype ActionFnPayload<Action> = Action extends (payload: infer Payload) => void\n ? Payload\n : never;\n\ntype ActionFnsCreator<Spec extends ActionsFnSpecs> = Spec extends {\n private: Record<string, Payload>;\n public: Record<string, Payload>;\n}\n ? ActionFnCreator<Spec['private']> & ActionFnCreator<Spec['public']>\n : ActionFnCreator<Spec>;\n\ntype PublicActionFns<Spec extends ActionsFnSpecs> = Spec extends {\n public: Record<string, Payload>;\n}\n ? ActionFnCreator<Spec['public']>\n : ActionFnCreator<Spec>;\n\nexport function payload<Type extends Payload>(): Type {\n return {} as Type;\n}\n\nexport const noPayload = {};\n\n/** Reducer **/\n\ntype ReducerFunction<ReducerAction, State> = (\n state: State,\n action: ActionFnPayload<ReducerAction>,\n) => void;\n\ntype ReducerFactory<StateActionFns extends ActionFns, State> = (\n actions: StateActionFns,\n on: <ReducerAction extends { type: string }>(\n action: ReducerAction,\n reducerFn: ReducerFunction<ReducerAction, State>,\n ) => void,\n) => void;\n\n/**\n * Creates a reducer function to separate the reducer logic into another file.\n *\n * ```typescript\n * interface FlightState {\n * flights: Flight[];\n * effect1: boolean;\n * effect2: boolean;\n * }\n *\n * const initialState: FlightState = {\n * flights: [],\n * effect1: false,\n * effect2: false,\n * };\n *\n * const actions = {\n * init: noPayload,\n * updateEffect1: payload<{ value: boolean }>(),\n * updateEffect2: payload<{ value: boolean }>(),\n * };\n *\n * const reducer = createReducer<FlightState, typeof actions>((actions, on) => {\n * on(actions.updateEffect1, (state, { value }) => {\n * patchState(state, { effect1: value });\n * });\n *\n * on(actions.updateEffect2, (state, { value }) => {\n * patchState(state, { effect2: value });\n * });\n * });\n *\n * signalStore(\n * withState(initialState),\n * withRedux({\n * actions,\n * reducer,\n * })\n * );\n * ```\n * @param reducerFactory\n */\nexport function createReducer<\n State extends object,\n Actions extends ActionsFnSpecs,\n>(\n reducerFactory: ReducerFactory<\n ActionFnsCreator<Actions>,\n WritableStateSource<State>\n >,\n) {\n return reducerFactory;\n}\n\n/** Effect **/\n\ntype EffectsFactory<StateActionFns extends ActionFns> = (\n actions: StateActionFns,\n create: <EffectAction extends { type: string }>(\n action: EffectAction,\n ) => Observable<ActionFnPayload<EffectAction>>,\n) => Record<string, Observable<unknown>>;\n\n/**\n * @deprecated Use NgRx's `@ngrx/signals/events` starting in 19.2\n *\n * Creates the effects function to separate the effects logic into another file.\n *\n * ```typescript\n * interface FlightState {\n * flights: Flight[];\n * effect1: boolean;\n * effect2: boolean;\n * }\n *\n * const initialState: FlightState = {\n * flights: [],\n * effect1: false,\n * effect2: false,\n * };\n *\n * const actions = {\n * init: noPayload,\n * updateEffect1: payload<{ value: boolean }>(),\n * updateEffect2: payload<{ value: boolean }>(),\n * };\n *\n * const effects = createEffects(actions, (actions, create) => {\n * return {\n * init1$: create(actions.init).pipe(\n * map(() => actions.updateEffect1({ value: true }))\n * ),\n * init2$: create(actions.init).pipe(\n * map(() => actions.updateEffect2({ value: true }))\n * ),\n * };\n * });\n *\n * signalStore(\n * withState(initialState),\n * withRedux({\n * actions,\n * effects,\n * })\n * );\n * ```\n * @param actions\n * @param effectsFactory\n */\nexport function createEffects<Actions extends ActionsFnSpecs>(\n actions: Actions,\n effectsFactory: EffectsFactory<ActionFnsCreator<Actions>>,\n) {\n return effectsFactory;\n}\n\n// internal types\n\n/**\n * Record which holds all effects for a specific action type.\n * The values are Subject which the effect are subscribed to.\n * `createActionFns` will call next on these subjects.\n */\ntype EffectsRegistry = Record<string, Subject<ActionFnPayload<unknown>>[]>;\n\nfunction createActionFns<Spec extends ActionsFnSpecs>(\n actionFnSpecs: Spec,\n reducerRegistry: Record<\n string,\n (state: unknown, payload: ActionFnPayload<unknown>) => void\n >,\n effectsRegistry: EffectsRegistry,\n state: unknown,\n) {\n const actionFns: Record<string, ActionFn> = {};\n\n for (const type in actionFnSpecs) {\n const actionFn = (payload: Payload) => {\n const fullPayload = { ...payload, type };\n const reducer = reducerRegistry[type];\n if (reducer) {\n (reducer as (state: unknown, payload: unknown) => void)(\n state,\n fullPayload as unknown,\n );\n }\n const effectSubjects = effectsRegistry[type];\n if (effectSubjects?.length) {\n for (const effectSubject of effectSubjects) {\n (effectSubject as unknown as Subject<unknown>).next(fullPayload);\n }\n }\n return fullPayload;\n };\n actionFn.type = type.toString();\n actionFns[type] = actionFn;\n }\n\n return actionFns;\n}\n\nfunction createPublicAndAllActionsFns<Spec extends ActionsFnSpecs>(\n actionFnSpecs: Spec,\n reducerRegistry: Record<\n string,\n (state: unknown, payload: ActionFnPayload<unknown>) => void\n >,\n effectsRegistry: EffectsRegistry,\n state: unknown,\n): { all: ActionFns; publics: ActionFns } {\n if ('public' in actionFnSpecs || 'private' in actionFnSpecs) {\n const privates = actionFnSpecs['private'] || {};\n const publics = actionFnSpecs['public'] || {};\n\n assertActionFnSpecs(privates);\n assertActionFnSpecs(publics);\n\n const privateActionFns = createActionFns(\n privates,\n reducerRegistry,\n effectsRegistry,\n state,\n );\n const publicActionFns = createActionFns(\n publics,\n reducerRegistry,\n effectsRegistry,\n state,\n );\n\n return {\n all: { ...privateActionFns, ...publicActionFns },\n publics: publicActionFns,\n };\n }\n\n const actionFns = createActionFns(\n actionFnSpecs,\n reducerRegistry,\n effectsRegistry,\n state,\n );\n\n return { all: actionFns, publics: actionFns };\n}\n\nfunction fillReducerRegistry(\n reducer: ReducerFactory<ActionFns, unknown>,\n actionFns: ActionFns,\n reducerRegistry: Record<\n string,\n (state: unknown, payload: ActionFnPayload<unknown>) => void\n >,\n) {\n function on(\n action: { type: string },\n reducerFn: (state: unknown, payload: ActionFnPayload<unknown>) => void,\n ) {\n reducerRegistry[action.type] = reducerFn;\n }\n\n reducer(actionFns, on);\n\n return reducerRegistry;\n}\n\nfunction fillEffects(\n effects: EffectsFactory<ActionFns>,\n actionFns: ActionFns,\n effectsRegistry: EffectsRegistry = {},\n): Observable<unknown>[] {\n function create(action: { type: string }) {\n const subject = new Subject<ActionFnPayload<unknown>>();\n if (!(action.type in effectsRegistry)) {\n effectsRegistry[action.type] = [];\n }\n effectsRegistry[action.type].push(subject);\n return subject.asObservable();\n }\n\n const effectObservables = effects(actionFns, create);\n return Object.values(effectObservables);\n}\n\nfunction startSubscriptions(observables: Observable<unknown>[]) {\n return observables.map((observable) => observable.subscribe());\n}\n\nfunction processRedux<Spec extends ActionsFnSpecs, ReturnType>(\n actionFnSpecs: Spec,\n reducer: ReducerFactory<ActionFns, unknown>,\n effects: EffectsFactory<ActionFns>,\n store: unknown,\n) {\n const reducerRegistry: Record<\n string,\n (state: unknown, payload: ActionFnPayload<unknown>) => void\n > = {};\n const effectsRegistry: Record<string, Subject<ActionFnPayload<unknown>>[]> =\n {};\n const actionsMap = createPublicAndAllActionsFns(\n actionFnSpecs,\n reducerRegistry,\n effectsRegistry,\n store,\n );\n const actionFns = actionsMap.all;\n const publicActionsFns = actionsMap.publics;\n\n fillReducerRegistry(reducer, actionFns, reducerRegistry);\n const effectObservables = fillEffects(effects, actionFns, effectsRegistry);\n const subscriptions = startSubscriptions(effectObservables);\n\n return {\n methods: publicActionsFns as ReturnType,\n subscriptions: subscriptions,\n };\n}\n\n/**\n * @param redux redux\n *\n * properties do not start with `with` since they are not extension functions on their own.\n *\n * no dependency to NgRx\n *\n * actions are passed to reducer and effects, but it is also possible to use other actions.\n * effects provide forAction and do not return anything. that is important because effects should stay inaccessible\n */\nexport function withRedux<\n Spec extends ActionsFnSpecs,\n Input extends SignalStoreFeatureResult,\n StateActionFns extends ActionFnsCreator<Spec> = ActionFnsCreator<Spec>,\n PublicStoreActionFns extends PublicActionFns<Spec> = PublicActionFns<Spec>,\n>(redux: {\n actions: Spec;\n reducer: ReducerFactory<StateActionFns, WritableStateSource<Input['state']>>;\n effects: EffectsFactory<StateActionFns>;\n}): SignalStoreFeature<\n Input,\n EmptyFeatureResult & { methods: PublicStoreActionFns }\n> {\n return (store) => {\n const { methods } = processRedux<Spec, PublicStoreActionFns>(\n redux.actions,\n redux.reducer as ReducerFactory<ActionFns, unknown>,\n redux.effects as EffectsFactory<ActionFns>,\n store,\n );\n return {\n ...store,\n methods: { ...store.methods, ...methods },\n };\n };\n}\n","import { Signal, computed } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n signalStoreFeature,\n withComputed,\n withState,\n} from '@ngrx/signals';\n\nexport type CallState = 'init' | 'loading' | 'loaded' | { error: string };\n\nexport type CallStateSlice = {\n callState: CallState;\n};\n\nexport type NamedCallStateSlice<Collection extends string> = {\n [K in keyof CallStateSlice as Collection extends ''\n ? `${Collection}${K}`\n : `${Collection}${Capitalize<K>}`]: CallStateSlice[K];\n};\n\nexport type CallStateSignals = {\n loading: Signal<boolean>;\n loaded: Signal<boolean>;\n error: Signal<string | null>;\n};\n\nexport type NamedCallStateSignals<Prop extends string> = {\n [K in keyof CallStateSignals as Prop extends ''\n ? `${Prop}${K}`\n : `${Prop}${Capitalize<K>}`]: CallStateSignals[K];\n};\n\nexport type SetCallState<Prop extends string | undefined> = Prop extends string\n ? NamedCallStateSlice<Prop>\n : CallStateSlice;\n\nexport function deriveCallStateKeys<Collection extends string>(\n collection?: Collection,\n) {\n return {\n callStateKey: collection ? `${collection}CallState` : 'callState',\n loadingKey: collection ? `${collection}Loading` : 'loading',\n loadedKey: collection ? `${collection}Loaded` : 'loaded',\n errorKey: collection ? `${collection}Error` : 'error',\n };\n}\n\nexport function getCallStateKeys(config?: { collection?: string }) {\n const prop = config?.collection;\n return deriveCallStateKeys(prop);\n}\n\nexport function getCollectionArray(\n config: { collection?: string } | { collections?: string[] },\n) {\n return 'collections' in config\n ? config.collections\n : 'collection' in config && config.collection\n ? [config.collection]\n : undefined;\n}\n\nexport function withCallState<Collection extends string>(config: {\n collections: Collection[];\n}): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: NamedCallStateSlice<Collection>;\n props: NamedCallStateSignals<Collection>;\n }\n>;\nexport function withCallState<Collection extends string>(config: {\n collection: Collection;\n}): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: NamedCallStateSlice<Collection>;\n props: NamedCallStateSignals<Collection>;\n }\n>;\nexport function withCallState(): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: CallStateSlice;\n props: CallStateSignals;\n }\n>;\nexport function withCallState<Collection extends string>(\n config?:\n | {\n collection: Collection;\n }\n | {\n collections: Collection[];\n },\n): SignalStoreFeature {\n return signalStoreFeature(\n withState(() => {\n if (!config) {\n return { callState: 'init' };\n }\n const collections = getCollectionArray(config);\n if (collections) {\n return collections.reduce(\n (acc, cur) => ({\n ...acc,\n ...{ [cur ? `${cur}CallState` : 'callState']: 'init' },\n }),\n {},\n );\n }\n\n return { callState: 'init' };\n }),\n withComputed((state: Record<string, Signal<unknown>>) => {\n if (config) {\n const collections = getCollectionArray(config);\n if (collections) {\n return collections.reduce<Record<string, Signal<unknown>>>(\n (acc, cur: string) => {\n const { callStateKey, errorKey, loadedKey, loadingKey } =\n deriveCallStateKeys(cur);\n const callState = state[callStateKey] as Signal<CallState>;\n return {\n ...acc,\n [loadingKey]: computed(() => callState() === 'loading'),\n [loadedKey]: computed(() => callState() === 'loaded'),\n [errorKey]: computed(() => {\n const v = callState();\n return typeof v === 'object' ? v.error : null;\n }),\n };\n },\n {},\n );\n }\n }\n const { callStateKey, errorKey, loadedKey, loadingKey } =\n deriveCallStateKeys();\n const callState = state[callStateKey] as Signal<CallState>;\n return {\n [loadingKey]: computed(() => callState() === 'loading'),\n [loadedKey]: computed(() => callState() === 'loaded'),\n [errorKey]: computed(() => {\n const v = callState();\n return typeof v === 'object' ? v.error : null;\n }),\n };\n }),\n );\n}\n\nexport function setLoading<Prop extends string | undefined = undefined>(\n prop?: Prop,\n): SetCallState<Prop> {\n if (prop) {\n return { [`${prop}CallState`]: 'loading' } as SetCallState<Prop>;\n }\n\n return { callState: 'loading' } as SetCallState<Prop>;\n}\n\nexport function setLoaded<Prop extends string | undefined = undefined>(\n prop?: Prop,\n): SetCallState<Prop> {\n if (prop) {\n return { [`${prop}CallState`]: 'loaded' } as SetCallState<Prop>;\n } else {\n return { callState: 'loaded' } as SetCallState<Prop>;\n }\n}\n\nexport function setError<Prop extends string | undefined = undefined>(\n error: unknown,\n prop?: Prop,\n): SetCallState<Prop> {\n let errorMessage: string;\n\n if (!error) {\n errorMessage = '';\n } else if (typeof error === 'object' && 'message' in error) {\n errorMessage = String(error.message);\n } else {\n errorMessage = String(error);\n }\n\n if (prop) {\n return {\n [`${prop}CallState`]: { error: errorMessage },\n } as SetCallState<Prop>;\n } else {\n return { callState: { error: errorMessage } } as SetCallState<Prop>;\n }\n}\n","import { ProviderToken, Signal, computed, inject } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n WritableStateSource,\n patchState,\n signalStoreFeature,\n withComputed,\n withMethods,\n withState,\n} from '@ngrx/signals';\nimport {\n EntityId,\n NamedEntityState,\n addEntity,\n removeEntity,\n setAllEntities,\n updateEntity,\n} from '@ngrx/signals/entities';\nimport { EntityState } from './shared/signal-store-models';\nimport {\n CallState,\n NamedCallStateSlice,\n getCallStateKeys,\n setError,\n setLoaded,\n setLoading,\n} from './with-call-state';\n\nexport type Filter = Record<string, unknown>;\nexport type Entity = { id: EntityId };\n\nexport interface DataService<E extends Entity, F extends Filter> {\n load(filter: F): Promise<E[]>;\n\n loadById(id: EntityId): Promise<E>;\n\n create(entity: E): Promise<E>;\n\n update(entity: E): Promise<E>;\n\n updateAll(entity: E[]): Promise<E[]>;\n\n delete(entity: E): Promise<void>;\n}\n\nexport function capitalize(str: string): string {\n return str ? str[0].toUpperCase() + str.substring(1) : str;\n}\n\nexport function getDataServiceKeys(options: { collection?: string }) {\n const filterKey = options.collection\n ? `${options.collection}Filter`\n : 'filter';\n const selectedIdsKey = options.collection\n ? `selected${capitalize(options.collection)}Ids`\n : 'selectedIds';\n const selectedEntitiesKey = options.collection\n ? `selected${capitalize(options.collection)}Entities`\n : 'selectedEntities';\n\n const updateFilterKey = options.collection\n ? `update${capitalize(options.collection)}Filter`\n : 'updateFilter';\n const updateSelectedKey = options.collection\n ? `updateSelected${capitalize(options.collection)}Entities`\n : 'updateSelected';\n const loadKey = options.collection\n ? `load${capitalize(options.collection)}Entities`\n : 'load';\n\n const currentKey = options.collection\n ? `current${capitalize(options.collection)}`\n : 'current';\n const loadByIdKey = options.collection\n ? `load${capitalize(options.collection)}ById`\n : 'loadById';\n const setCurrentKey = options.collection\n ? `setCurrent${capitalize(options.collection)}`\n : 'setCurrent';\n const createKey = options.collection\n ? `create${capitalize(options.collection)}`\n : 'create';\n const updateKey = options.collection\n ? `update${capitalize(options.collection)}`\n : 'update';\n const updateAllKey = options.collection\n ? `updateAll${capitalize(options.collection)}`\n : 'updateAll';\n const deleteKey = options.collection\n ? `delete${capitalize(options.collection)}`\n : 'delete';\n\n // TODO: Take these from @ngrx/signals/entities, when they are exported\n const entitiesKey = options.collection\n ? `${options.collection}Entities`\n : 'entities';\n const entityMapKey = options.collection\n ? `${options.collection}EntityMap`\n : 'entityMap';\n const idsKey = options.collection ? `${options.collection}Ids` : 'ids';\n\n return {\n filterKey,\n selectedIdsKey,\n selectedEntitiesKey,\n updateFilterKey,\n updateSelectedKey,\n loadKey,\n entitiesKey,\n entityMapKey,\n idsKey,\n\n currentKey,\n loadByIdKey,\n setCurrentKey,\n createKey,\n updateKey,\n updateAllKey,\n deleteKey,\n };\n}\n\nexport type NamedDataServiceState<\n E extends Entity,\n F extends Filter,\n Collection extends string,\n> = {\n [K in Collection as `${K}Filter`]: F;\n} & {\n [K in Collection as `selected${Capitalize<K>}Ids`]: Record<EntityId, boolean>;\n} & {\n [K in Collection as `current${Capitalize<K>}`]: E;\n};\n\nexport type DataServiceState<E extends Entity, F extends Filter> = {\n filter: F;\n selectedIds: Record<EntityId, boolean>;\n current: E;\n};\n\nexport type DataServiceComputed<E extends Entity> = {\n selectedEntities: Signal<E[]>;\n};\n\nexport type NamedDataServiceComputed<\n E extends Entity,\n Collection extends string,\n> = {\n [K in Collection as `selected${Capitalize<K>}Entities`]: Signal<E[]>;\n};\n\nexport type NamedDataServiceMethods<\n E extends Entity,\n F extends Filter,\n Collection extends string,\n> = {\n [K in Collection as `update${Capitalize<K>}Filter`]: (filter: F) => void;\n} & {\n [K in Collection as `updateSelected${Capitalize<K>}Entities`]: (\n id: EntityId,\n selected: boolean,\n ) => void;\n} & {\n [K in Collection as `load${Capitalize<K>}Entities`]: () => Promise<void>;\n} & {\n [K in Collection as `setCurrent${Capitalize<K>}`]: (entity: E) => void;\n} & {\n [K in Collection as `load${Capitalize<K>}ById`]: (\n id: EntityId,\n ) => Promise<void>;\n} & {\n [K in Collection as `create${Capitalize<K>}`]: (entity: E) => Promise<void>;\n} & {\n [K in Collection as `update${Capitalize<K>}`]: (entity: E) => Promise<void>;\n} & {\n [K in Collection as `updateAll${Capitalize<K>}`]: (\n entity: E[],\n ) => Promise<void>;\n} & {\n [K in Collection as `delete${Capitalize<K>}`]: (entity: E) => Promise<void>;\n};\n\nexport type DataServiceMethods<E extends Entity, F extends Filter> = {\n updateFilter: (filter: F) => void;\n updateSelected: (id: EntityId, selected: boolean) => void;\n load: () => Promise<void>;\n\n setCurrent(entity: E): void;\n loadById(id: EntityId): Promise<void>;\n create(entity: E): Promise<void>;\n update(entity: E): Promise<void>;\n updateAll(entities: E[]): Promise<void>;\n delete(entity: E): Promise<void>;\n};\n\nexport function withDataService<\n E extends Entity,\n F extends Filter,\n Collection extends string,\n>(options: {\n dataServiceType: ProviderToken<DataService<E, F>>;\n filter: F;\n collection: Collection;\n}): SignalStoreFeature<\n EmptyFeatureResult & {\n state: NamedCallStateSlice<Collection> & NamedEntityState<E, Collection>;\n },\n {\n state: NamedDataServiceState<E, F, Collection>;\n props: NamedDataServiceComputed<E, Collection>;\n methods: NamedDataServiceMethods<E, F, Collection>;\n }\n>;\nexport function withDataService<E extends Entity, F extends Filter>(options: {\n dataServiceType: ProviderToken<DataService<E, F>>;\n filter: F;\n}): SignalStoreFeature<\n EmptyFeatureResult & { state: { callState: CallState } & EntityState<E> },\n {\n state: DataServiceState<E, F>;\n props: DataServiceComputed<E>;\n methods: DataServiceMethods<E, F>;\n }\n>;\n\nexport function withDataService<\n E extends Entity,\n F extends Filter,\n Collection extends string,\n>(options: {\n dataServiceType: ProviderToken<DataService<E, F>>;\n filter: F;\n collection?: Collection;\n}): /* eslint-disable @typescript-eslint/no-explicit-any */\nSignalStoreFeature<any, any> {\n const { dataServiceType, filter, collection: prefix } = options;\n const {\n entitiesKey,\n filterKey,\n loadKey,\n selectedEntitiesKey,\n selectedIdsKey,\n updateFilterKey,\n updateSelectedKey,\n\n currentKey,\n createKey,\n updateKey,\n updateAllKey,\n deleteKey,\n loadByIdKey,\n setCurrentKey,\n } = getDataServiceKeys(options);\n\n const { callStateKey } = getCallStateKeys({ collection: prefix });\n\n return signalStoreFeature(\n withState(() => ({\n [filterKey]: filter,\n [selectedIdsKey]: {} as Record<EntityId, boolean>,\n [currentKey]: undefined as E | undefined,\n })),\n withComputed((store: Record<string, unknown>) => {\n const entities = store[entitiesKey] as Signal<E[]>;\n const selectedIds = store[selectedIdsKey] as Signal<\n Record<EntityId, boolean>\n >;\n\n return {\n [selectedEntitiesKey]: computed(() =>\n entities().filter((e) => selectedIds()[e.id]),\n ),\n };\n }),\n withMethods(\n (store: Record<string, unknown> & WritableStateSource<object>) => {\n const dataService = inject(dataServiceType);\n return {\n [updateFilterKey]: (filter: F): void => {\n patchState(store, { [filterKey]: filter });\n },\n [updateSelectedKey]: (id: EntityId, selected: boolean): void => {\n patchState(store, (state: Record<string, unknown>) => ({\n [selectedIdsKey]: {\n ...(state[selectedIdsKey] as Record<EntityId, boolean>),\n [id]: selected,\n },\n }));\n },\n [loadKey]: async (): Promise<void> => {\n const filter = store[filterKey] as Signal<F>;\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const result = await dataService.load(filter());\n patchState(\n store,\n prefix\n ? setAllEntities(result, { collection: prefix })\n : setAllEntities(result),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [loadByIdKey]: async (id: EntityId): Promise<void> => {\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const current = await dataService.loadById(id);\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n patchState(store, { [currentKey]: current });\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [setCurrentKey]: (current: E): void => {\n patchState(store, { [currentKey]: current });\n },\n [createKey]: async (entity: E): Promise<void> => {\n patchState(store, { [currentKey]: entity });\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const created = await dataService.create(entity);\n patchState(store, { [currentKey]: created });\n patchState(\n store,\n prefix\n ? addEntity(created, { collection: prefix })\n : addEntity(created),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [updateKey]: async (entity: E): Promise<void> => {\n patchState(store, { [currentKey]: entity });\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const updated = await dataService.update(entity);\n patchState(store, { [currentKey]: updated });\n\n const updateArg = {\n id: updated.id,\n changes: updated,\n };\n\n const updater = (collection: string) =>\n updateEntity(updateArg, { collection });\n\n patchState(\n store,\n prefix ? updater(prefix) : updateEntity(updateArg),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [updateAllKey]: async (entities: E[]): Promise<void> => {\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n const result = await dataService.updateAll(entities);\n patchState(\n store,\n prefix\n ? setAllEntities(result, { collection: prefix })\n : setAllEntities(result),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n [deleteKey]: async (entity: E): Promise<void> => {\n patchState(store, { [currentKey]: entity });\n (() =>\n store[callStateKey] && patchState(store, setLoading(prefix)))();\n\n try {\n await dataService.delete(entity);\n patchState(store, { [currentKey]: undefined });\n patchState(\n store,\n prefix\n ? removeEntity(entity.id, { collection: prefix })\n : removeEntity(entity.id),\n );\n (() =>\n store[callStateKey] && patchState(store, setLoaded(prefix)))();\n } catch (e) {\n (() =>\n store[callStateKey] &&\n patchState(store, setError(e, prefix)))();\n throw e;\n }\n },\n };\n },\n ),\n );\n}\n","/** With pagination comes in two flavors the first one is local pagination or in memory pagination. For example we have 2000 items which we want\n * to display in a table and the response payload is small enough to be stored in the memory. But we can not display all 2000 items at once\n * so we need to paginate the data. The second flavor is server side pagination where the response payload is too large to be stored in the memory\n * and we need to fetch the data from the server in chunks. In the second case we 'could' also cache the data in the memory but that could lead to\n * other problems like memory leaks and stale data. So we will not cache the data in the memory in the second case.\n * This feature implements the local pagination.\n */\n\nimport { Signal, computed } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n signalStoreFeature,\n withComputed,\n withState,\n} from '@ngrx/signals';\nimport { capitalize } from './with-data-service';\n\n// This is a virtual page which is can be used to create a pagination control\nexport type Page = { label: string | number; value: number };\n\nexport type NamedPaginationServiceState<E, Collection extends string> = {\n [K in Collection as `selectedPage${Capitalize<K>}Entities`]: Array<E>;\n} & {\n [K in Collection as `${Lowercase<K>}CurrentPage`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}PageSize`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}TotalCount`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}PageCount`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}PageNavigationArray`]: number;\n} & {\n [K in Collection as `${Lowercase<K>}PageNavigationArrayMax`]: number;\n};\n\nexport type NamedPaginationServiceSignals<E, Collection extends string> = {\n [K in Collection as `selectedPage${Capitalize<K>}Entities`]: Signal<E[]>;\n} & {\n [K in Collection as `${Lowercase<K>}CurrentPage`]: Signal<number>;\n} & {\n [K in Collection as `${Lowercase<K>}PageSize`]: Signal<number>;\n} & {\n [K in Collection as `${Lowercase<K>}TotalCount`]: Signal<number>;\n} & {\n [K in Collection as `${Lowercase<K>}PageCount`]: Signal<number>;\n} & {\n [K in Collection as `${Lowercase<K>}PageNavigationArray`]: Signal<Page[]>;\n} & {\n [K in Collection as `${Lowercase<K>}PageNavigationArrayMax`]: Signal<number>;\n} & {\n [K in Collection as `hasNext${Capitalize<K>}Page`]: Signal<boolean>;\n} & {\n [K in Collection as `hasPrevious${Capitalize<K>}Page`]: Signal<boolean>;\n};\n\nexport type PaginationServiceState<E> = {\n selectedPageEntities: Array<E>;\n currentPage: number;\n pageSize: number;\n totalCount: number;\n pageCount: number;\n pageNavigationArray: Page[];\n pageNavigationArrayMax: number;\n};\n\nexport type PaginationServiceSignals<E> = {\n selectedPageEntities: Signal<E[]>;\n currentPage: Signal<number>;\n pageSize: Signal<number>;\n totalCount: Signal<number>;\n pageCount: Signal<number>;\n pageNavigationArray: Signal<Page[]>;\n pageNavigationArrayMax: Signal<number>;\n hasNextPage: Signal<boolean>;\n hasPreviousPage: Signal<boolean>;\n};\n\nexport type SetPaginationState<\n E,\n Collection extends string | undefined,\n> = Collection extends string\n ? NamedPaginationServiceState<E, Collection>\n : PaginationServiceState<E>;\n\nexport function withPagination<E, Collection extends string>(options: {\n entity: E;\n collection: Collection;\n}): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: NamedPaginationServiceState<E, Collection>;\n props: NamedPaginationServiceSignals<E, Collection>;\n }\n>;\n\nexport function withPagination<E>(): SignalStoreFeature<\n EmptyFeatureResult,\n EmptyFeatureResult & {\n state: PaginationServiceState<E>;\n props: PaginationServiceSignals<E>;\n }\n>;\n\nexport function withPagination<E, Collection extends string>(options?: {\n entity: E;\n collection: Collection;\n}): SignalStoreFeature {\n const {\n pageKey,\n pageSizeKey,\n entitiesKey,\n selectedPageEntitiesKey,\n totalCountKey,\n pageCountKey,\n pageNavigationArrayMaxKey,\n pageNavigationArrayKey,\n hasNextPageKey,\n hasPreviousPageKey,\n } = createPaginationKeys<Collection>(options);\n\n return signalStoreFeature(\n withState({\n [pageKey]: 0,\n [pageSizeKey]: 10,\n [pageNavigationArrayMaxKey]: 7,\n }),\n withComputed((store: Record<string, unknown>) => {\n const entities = store[entitiesKey] as Signal<E[]>;\n const page = store[pageKey] as Signal<number>;\n const pageSize = store[pageSizeKey] as Signal<number>;\n const pageNavigationArrayMax = store[\n pageNavigationArrayMaxKey\n ] as Signal<number>;\n\n return {\n // The derived enitites which are displayed on the current page\n [selectedPageEntitiesKey]: computed<E[]>(() => {\n const pageSizeValue = pageSize();\n const pageValue = page();\n\n return entities().slice(\n pageValue * pageSizeValue,\n (pageValue + 1) * pageSizeValue,\n ) as E[];\n }),\n [totalCountKey]: computed(() => entities().length),\n [pageCountKey]: computed(() => {\n const totalCountValue = entities().length;\n const pageSizeValue = pageSize();\n\n if (totalCountValue === 0) {\n return 0;\n }\n\n return Math.ceil(totalCountValue / pageSizeValue);\n }),\n [pageNavigationArrayKey]: computed(() =>\n createPageArray(\n page(),\n pageSize(),\n entities().length,\n pageNavigationArrayMax(),\n ),\n ),\n\n [hasNextPageKey]: computed(() => {\n return page() < pageSize();\n }),\n\n [hasPreviousPageKey]: computed(() => {\n return page() > 1;\n }),\n };\n }),\n );\n}\n\nexport function gotoPage<E, Collection extends string>(\n page: number,\n options?: {\n collection: Collection;\n },\n): Partial<SetPaginationState<E, Collection>> {\n const { pageKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageKey]: page,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function setPageSize<E, Collection extends string>(\n pageSize: number,\n options?: {\n collection: Collection;\n },\n): Partial<SetPaginationState<E, Collection>> {\n const { pageSizeKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageSizeKey]: pageSize,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function nextPage<E, Collection extends string>(options?: {\n collection: Collection;\n}): Partial<SetPaginationState<E, Collection>> {\n const { pageKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageKey]: (currentPage: number) => currentPage + 1,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function previousPage<E, Collection extends string>(options?: {\n collection: Collection;\n}): Partial<SetPaginationState<E, Collection>> {\n const { pageKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageKey]: (currentPage: number) => Math.max(currentPage - 1, 1),\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function firstPage<E, Collection extends string>(options?: {\n collection: Collection;\n}): Partial<SetPaginationState<E, Collection>> {\n const { pageKey } = createPaginationKeys<Collection>(options);\n\n return {\n [pageKey]: 1,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nexport function setMaxPageNavigationArrayItems<E, Collection extends string>(\n maxPageNavigationArrayItems: number,\n options?: {\n collection: Collection;\n },\n): Partial<SetPaginationState<E, Collection>> {\n const { pageNavigationArrayMaxKey } =\n createPaginationKeys<Collection>(options);\n\n return {\n [pageNavigationArrayMaxKey]: maxPageNavigationArrayItems,\n } as Partial<SetPaginationState<E, Collection>>;\n}\n\nfunction createPaginationKeys<Collection extends string>(\n options: { collection: Collection } | undefined,\n) {\n const entitiesKey = options?.collection\n ? `${options.collection}Entities`\n : 'entities';\n\n const selectedPageEntitiesKey = options?.collection\n ? `selectedPage${capitalize(options?.collection)}Entities`\n : 'selectedPageEntities';\n\n const pageKey = options?.collection\n ? `${options.collection}CurrentPage`\n : 'currentPage';\n\n const pageSizeKey = options?.collection\n ? `${options.collection}PageSize`\n : 'pageSize';\n\n const totalCountKey = options?.collection\n ? `${options.collection}TotalCount`\n : 'totalCount';\n\n const pageCountKey = options?.collection\n ? `${options.collection}PageCount`\n : 'pageCount';\n\n const pageNavigationArrayMaxKey = options?.collection\n ? `${options.collection}PageNavigationArrayMax`\n : 'pageNavigationArrayMax';\n\n const pageNavigationArrayKey = options?.collection\n ? `${options.collection}PageNavigationArray`\n : 'pageNavigationArray';\n\n const hasNextPageKey = options?.collection\n ? `hasNext${capitalize(options.collection)}Page`\n : 'hasNextPage';\n\n const hasPreviousPageKey = options?.collection\n ? `hasPrevious${capitalize(options.collection)}Page`\n : 'hasPreviousPage';\n\n return {\n pageKey,\n pageSizeKey,\n entitiesKey,\n selectedPageEntitiesKey,\n totalCountKey,\n pageCountKey,\n pageNavigationArrayKey,\n pageNavigationArrayMaxKey,\n hasNextPageKey,\n hasPreviousPageKey,\n };\n}\n\nexport function createPageArray(\n currentPage: number,\n itemsPerPage: number,\n totalItems: number,\n paginationRange: number,\n): Page[] {\n // Convert paginationRange to number in case it's a string\n paginationRange = +paginationRange;\n\n // Calculate total number of pages\n const totalPages = Math.max(Math.ceil(totalItems / itemsPerPage), 1);\n const halfWay = Math.ceil(paginationRange / 2);\n\n const isStart = currentPage <= halfWay;\n const isEnd = totalPages - halfWay < currentPage;\n const isMiddle = !isStart && !isEnd;\n\n const ellipsesNeeded = paginationRange < totalPages;\n const pages: Page[] = [];\n\n for (let i = 1; i <= totalPages && i <= paginationRange; i++) {\n let pageNumber = i;\n\n if (i === paginationRange) {\n pageNumber = totalPages;\n } else if (ellipsesNeeded) {\n if (isEnd) {\n pageNumber = totalPages - paginationRange + i;\n } else if (isMiddle) {\n pageNumber = currentPage - halfWay + i;\n }\n }\n\n const openingEllipsesNeeded = i === 2 && (isMiddle || isEnd);\n const closingEllipsesNeeded =\n i === paginationRange - 1 && (isMiddle || isStart);\n\n const label =\n ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)\n ? '...'\n : pageNumber;\n\n pages.push({ label, value: pageNumber });\n }\n\n return pages;\n}\n","import {\n getState,\n patchState,\n signalStoreFeature,\n StateSource,\n withHooks,\n withMethods,\n withProps,\n} from '@ngrx/signals';\n\nexport type PublicMethods = {\n resetState(): void;\n};\n\n/**\n * Adds a `resetState` method to the store, which resets the state\n * to the initial state.\n *\n * If you want to set a custom initial state, you can use {@link setResetState}.\n */\nexport function withReset() {\n return signalStoreFeature(\n withProps(() => ({ _resetState: { value: {} } })),\n withMethods((store): PublicMethods => {\n // workaround to TS excessive property check\n const methods = {\n resetState() {\n patchState(store, store._resetState.value);\n },\n __setResetState__(state: object) {\n store._resetState.value = state;\n },\n };\n\n return methods;\n }),\n withHooks((store) => ({\n onInit() {\n store._resetState.value = getState(store);\n },\n })),\n );\n}\n\n/**\n * Sets the reset state of the store to the given state.\n *\n * Throws an error if the store is not configured with {@link withReset}.\n * @param store the instance of a SignalStore\n * @param state the state to set as the reset state\n */\nexport function setResetState<State extends object>(\n store: StateSource<State>,\n state: State,\n): void {\n if (!('__setResetState__' in store)) {\n throw new Error(\n 'Cannot set reset state, since store is not configured with withReset()',\n );\n }\n (store.__setResetState__ as (state: State) => void)(state);\n}\n","import { Signal, effect, isSignal, signal, untracked } from '@angular/core';\nimport {\n EmptyFeatureResult,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n patchState,\n signalStoreFeature,\n withComputed,\n withHooks,\n withMethods,\n} from '@ngrx/signals';\nimport { capitalize } from './with-data-service';\n\nexport type StackItem = Record<string, unknown>;\n\nexport type NormalizedUndoRedoOptions = {\n maxStackSize: number;\n collections?: string[];\n keys: string[];\n skip: number;\n};\n\nconst defaultOptions: NormalizedUndoRedoOptions = {\n maxStackSize: 100,\n keys: [],\n skip: 0,\n};\n\nexport function getUndoRedoKeys(collections?: string[]): string[] {\n if (collections) {\n return collections.flatMap((c) => [\n `${c}EntityMap`,\n `${c}Ids`,\n `selected${capitalize(c)}Ids`,\n `${c}Filter`,\n ]);\n }\n return ['entityMap', 'ids', 'selectedIds', 'filter'];\n}\n\ntype NonNever<T> = T extends never ? never : T;\n\ntype ExtractEntityCollection<T> = T extends `${infer U}Entities` ? U : never;\n\ntype ExtractEntityCollections<Store extends SignalStoreFeatureResult> =\n NonNever<\n {\n [K in keyof Store['props']]: ExtractEntityCollection<K>;\n }[keyof Store['props']]\n >;\n\ntype OptionsForState<Store extends SignalStoreFeatureResult> = Partial<\n Omit<NormalizedUndoRedoOptions, 'collections' | 'keys'>\n> & {\n collections?: ExtractEntityCollections<Store>[];\n keys?: (keyof Store['state'])[];\n};\n\nexport function withUndoRedo<Input extends EmptyFeatureResult>(\n options?: OptionsForState<Input>,\n): SignalStoreFeature<\n Input,\n EmptyFeatureResult & {\n props: {\n canUndo: Signal<boolean>;\n canRedo: Signal<boolean>;\n };\n methods: {\n undo: () => void;\n redo: () => void;\n clearStack: () => void;\n };\n }\n> {\n let previous: StackItem | null = null;\n let skipOnce = false;\n\n const normalized = {\n ...defaultOptions,\n ...options,\n };\n\n //\n // Design Decision: This feature has its own\n // internal state.\n //\n\n const undoStack: StackItem[] = [];\n const redoStack: StackItem[] = [];\n\n const canUndo = signal(false);\n const canRedo = signal(false);\n\n const updateInternal = () => {\n canUndo.set(undoStack.length !== 0);\n canRedo.set(redoStack.length !== 0);\n };\n\n const keys = [...getUndoRedoKeys(normalized.collections), ...normalized.keys];\n\n return signalStoreFeature(\n withComputed(() => ({\n canUndo: canUndo.asReadonly(),\n canRedo: canRedo.asReadonly(),\n })),\n withMethods((store) => ({\n undo(): void {\n const item = undoStack.pop();\n\n if (item && previous) {\n redoStack.push(previous);\n }\n\n if (item) {\n skipOnce = true;\n patchState(store, item);\n previous = item;\n }\n\n updateInternal();\n },\n redo(): void {\n const item = redoStack.pop();\n\n if (item && previous) {\n undoStack.push(previous);\n }\n\n if (item) {\n skipOnce = true;\n patchState(store, item);\n previous = item;\n }\n\n updateInternal();\n },\n clearStack(): void {\n undoStack.splice(0);\n redoStack.splice(0);\n previous = null;\n updateInternal();\n },\n })),\n withHooks({\n onInit(store) {\n effect(() => {\n const cand = keys.reduce((acc, key) => {\n const s = (store as Record<string | keyof Input['state'], unknown>)[\n key\n ];\n if (s && isSignal(s)) {\n return {\n ...acc,\n [key]: s(),\n };\n }\n return acc;\n }, {});\n\n if (normalized.skip > 0) {\n normalized.skip--;\n return;\n }\n\n if (skipOnce) {\n skipOnce = false;\n return;\n }\n\n //\n // Deep Comparison to prevent duplicated entries\n // on the stack. This can e.g. happen after an undo\n // if the component sends back the undone filter\n // to the store.\n //\n if (JSON.stringify(cand) === JSON.stringify(previous)) {\n return;\n }\n\n // Clear redoStack after recorded action\n redoStack.splice(0);\n\n if (previous) {\n undoStack.push(previous);\n }\n\n if (redoStack.length > normalized.maxStackSize) {\n undoStack.unshift();\n }\n\n previous = cand;\n\n // Don't propogate current reactive context\n untracked(() => updateInternal());\n });\n },\n }),\n );\n}\n","/**\n * Deep freezes a state object along its properties with primitive values\n * on the first level.\n *\n * The reason for this is that the final state is a merge of all\n * root properties of all states, i.e. `withState`,....\n *\n * Since the root object will not be part of the state (shadow clone),\n * we are not freezing it.\n */\n\nexport function deepFreeze<T extends Record<string | symbol, unknown>>(\n target: T,\n // if empty all properties will be frozen\n propertyNamesToBeFrozen: (string | symbol)[],\n // also means that we are on the first level\n isRoot = true,\n): void {\n const runPropertyNameCheck = propertyNamesToBeFrozen.length > 0;\n for (const key of Reflect.ownKeys(target)) {\n if (runPropertyNameCheck && !propertyNamesToBeFrozen.includes(key)) {\n continue;\n }\n\n const propValue = target[key];\n if (isRecordLike(propValue) && !Object.isFrozen(propValue)) {\n Object.freeze(propValue);\n deepFreeze(propValue, [], false);\n } else if (isRoot) {\n Object.defineProperty(target, key, {\n value: propValue,\n writable: false,\n configurable: false,\n });\n }\n }\n}\n\nfunction isRecordLike(\n target: unknown,\n): target is Record<string | symbol, unknown> {\n return typeof target === 'object' && target !== null;\n}\n","import { isDevMode as ngIsInDevMode } from '@angular/core';\n\n// necessary wrapper function to test prod mode\nexport function isDevMode() {\n return ngIsInDevMode();\n}\n","import {\n EmptyFeatureResult,\n signalStoreFeature,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n watchState,\n withHooks,\n withState,\n} from '@ngrx/signals';\nimport { deepFreeze } from './deep-freeze';\nimport { isDevMode } from './is-dev-mode';\n\n/**\n * The implementation of this feature is a little bit tricky.\n *\n * `signalStore` does a shallow clone in the initial phase, in order to\n * merge all different states together.\n *\n * Shallow cloning also happens in `patchState`.\n *\n * With shallow cloning, the root state object is replaced, which means,\n * the freezing only stays for its nested properties but not for\n * the primitive and immediate properties.\n *\n * For example:\n *\n * ```ts\n * const state = {\n * id: 1,\n * address: {\n * street: 'Main St',\n * city: 'Springfield',\n * }\n * }\n * ```\n *\n * Running `Object.freeze` on `state` will freeze the `address` object, and\n * the `id`. But since `state` is shallow cloned, the \"frozing\" state of the\n * `id` is lost. `address`, being an object, is still frozen.\n *\n * To overcome that, we run `watchState` and run `deepFreeze`\n * on every change.\n */\n\n/**\n * Prevents mutation of the state.\n *\n * This is done by deeply applying `Object.freeze`. Any mutable change within\n * or outside the `SignalStore` will throw an error.\n *\n * @param state the state object\n * @param options enable protection in production (default: false)\n */\nexport function withImmutableState<State extends object>(\n state: State,\n options?: { enableInProduction?: boolean },\n): SignalStoreFeature<\n SignalStoreFeatureResult,\n EmptyFeatureResult & { state: State }\n>;\n/**\n * Prevents mutation of the state.\n *\n * This is done by deeply applying `Object.freeze`. Any mutable change within\n * or outside the `SignalStore` will throw an error.\n *\n * @param stateFactory a function returning the state object\n * @param options enable protection in production (default: false)\n */\nexport function withImmutableState<State extends object>(\n stateFactory: () => State,\n options?: { enableInProduction?: boolean },\n): SignalStoreFeature<\n SignalStoreFeatureResult,\n EmptyFeatureResult & { state: State }\n>;\nexport function withImmutableState<State extends object>(\n stateOrFactory: State | (() => State),\n options?: { enableInProduction?: boolean },\n): SignalStoreFeature<\n SignalStoreFeatureResult,\n EmptyFeatureResult & { state: State }\n> {\n const immutableState =\n typeof stateOrFactory === 'function' ? stateOrFactory() : stateOrFactory;\n const stateKeys = Reflect.ownKeys(immutableState);\n\n const applyFreezing = isDevMode() || options?.enableInProduction === true;\n return signalStoreFeature(\n withState(immutableState),\n withHooks((store) => ({\n onInit() {\n if (!applyFreezing) {\n return;\n }\n /**\n * `immutableState` will be initially frozen. That is because\n * of potential mutations outside the SignalStore\n *\n * ```ts\n * const initialState = {id: 1};\n * signalStore(withImmutableState(initialState));\n *\n * initialState.id = 2; // must throw immutability\n * ```\n */\n\n Object.freeze(immutableState);\n watchState(store, (state) => {\n deepFreeze(state, stateKeys);\n });\n },\n })),\n );\n}\n","import { Injectable } from '@angular/core';\n\nexport const keyPath = 'ngrxToolkitKeyPath';\n\nexport const dbName = 'ngrxToolkitDb';\n\nexport const storeName = 'ngrxToolkitStore';\n\nexport const VERSION: number = 1 as const;\n\n@Injectable({ providedIn: 'root' })\nexport class IndexedDBService {\n /**\n * write to indexedDB\n * @param key\n * @param data\n */\n async setItem(key: string, data: string): Promise<void> {\n const db = await this.openDB();\n\n const tx = db.transaction(storeName, 'readwrite');\n\n const store = tx.objectStore(storeName);\n\n store.put({\n [keyPath]: key,\n value: data,\n });\n\n return new Promise((resolve, reject) => {\n tx.oncomplete = (): void => {\n db.close();\n resolve();\n };\n\n tx.onerror = (): void => {\n db.close();\n reject();\n };\n });\n }\n\n /**\n * read from indexedDB\n * @param key\n */\n async getItem(key: string): Promise<string | null> {\n const db = await this.openDB();\n\n const tx = db.transaction(storeName, 'readonly');\n\n const store = tx.objectStore(storeName);\n\n const request = store.get(key);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = (): void => {\n db.close();\n // localStorage(sessionStorage) returns null if the key does not exist\n // Similarly, indexedDB should return null\n if (request.result === undefined) {\n resolve(null);\n }\n resolve(request.result?.['value']);\n };\n\n request.onerror = (): void => {\n db.close();\n reject();\n };\n });\n }\n\n /**\n * delete indexedDB\n * @param key\n */\n async clear(key: string): Promise<void> {\n const db = await this.openDB();\n\n const tx = db.transaction(storeName, 'readwrite');\n\n const store = tx.objectStore(storeName);\n\n const request = store.delete(key);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = (): void => {\n db.close();\n resolve();\n };\n\n request.onerror = (): void => {\n db.close();\n reject();\n };\n });\n }\n\n /**\n * open indexedDB\n */\n private async openDB(): Promise<IDBDatabase> {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(dbName, VERSION);\n\n request.onupgradeneeded = () => {\n const db = request.result;\n\n if (!db.objectStoreNames.contains(storeName)) {\n db.createObjectStore(storeName, { keyPath });\n }\n };\n\n request.onsuccess = (): void => {\n resolve(request.result);\n };\n\n request.onerror = (): void => {\n reject(request.error);\n };\n });\n }\n}\n","import { Signal, WritableSignal } from '@angular/core';\nimport { EmptyFeatureResult, WritableStateSource } from '@ngrx/signals';\nimport { SyncConfig } from '../with-storage-sync';\n\nexport type SyncMethods = {\n clearStorage(): void;\n readFromStorage(): void;\n writeToStorage(): void;\n};\n\nexport type SyncFeatureResult = EmptyFeatureResult & {\n methods: SyncMethods;\n};\n\nexport type SyncStoreForFactory<State extends object> =\n WritableStateSource<State>;\n\nexport type SyncStorageStrategy<State extends object> = ((\n config: Required<SyncConfig<State>>,\n store: SyncStoreForFactory<State>,\n useStubs: boolean,\n) => SyncMethods) & { type: 'sync' };\n\nexport type AsyncMethods = {\n clearStorage(): Promise<void>;\n readFromStorage(): Promise<void>;\n writeToStorage(): Promise<void>;\n};\n\n/**\n * AsyncFeatureResult is used as the public interface that users interact with\n * when calling `withIndexedDB`. It intentionally omits the internal SYNC_STATUS\n * property to avoid TypeScript error TS4058 (return type of public method\n * includes private type).\n *\n * For internal implementation, we use AsyncStoreForFactory which includes\n * the SYNC_STATUS property needed for state management.\n */\nexport const SYNC_STATUS = Symbol('SYNC_STATUS');\nexport type SyncStatus = 'idle' | 'syncing' | 'synced';\n\n// Keeping it internal avoids TS4058 error\nexport type InternalAsyncProps = AsyncFeatureResult['props'] & {\n [SYNC_STATUS]: WritableSignal<SyncStatus>;\n};\n\nexport type AsyncFeatureResult = EmptyFeatureResult & {\n methods: AsyncMethods;\n props: {\n isSynced: Signal<boolean>;\n whenSynced: () => Promise<void>;\n };\n};\n\nexport type AsyncStoreForFactory<State extends object> =\n WritableStateSource<State> & InternalAsyncProps;\n\nexport type AsyncStorageStrategy<State extends object> = ((\n config: Required<SyncConfig<State>>,\n store: AsyncStoreForFactory<State>,\n useStubs: boolean,\n) => AsyncMethods) & { type: 'async' };\n","import { inject } from '@angular/core';\nimport { getState, patchState } from '@ngrx/signals';\nimport { IndexedDBService } from '../internal/indexeddb.service';\nimport {\n AsyncMethods,\n AsyncStorageStrategy,\n AsyncStoreForFactory,\n SYNC_STATUS,\n} from '../internal/models';\nimport { SyncConfig } from '../with-storage-sync';\n\nexport function withIndexedDB<\n State extends object,\n>(): AsyncStorageStrategy<State> {\n function factory(\n { key, parse, select, stringify }: Required<SyncConfig<State>>,\n store: AsyncStoreForFactory<State>,\n useStubs: boolean,\n ): AsyncMethods {\n if (useStubs) {\n return {\n clearStorage: () => Promise.resolve(),\n readFromStorage: () => Promise.resolve(),\n writeToStorage: () => Promise.resolve(),\n };\n }\n\n const indexeddbService = inject(IndexedDBService);\n\n function warnOnSyncing(mode: 'read' | 'write'): void {\n if (store[SYNC_STATUS]() === 'syncing') {\n const prettyMode = mode === 'read' ? 'Reading' : 'Writing';\n console.warn(\n `${prettyMode} to Store (${key}) happened during an ongoing synchronization process.`,\n 'Please ensure that the store is not in syncing state via `store.whenSynced()`.',\n 'Alternatively, you can disable the autoSync by passing `autoSync: false` in the config.',\n );\n }\n }\n\n return {\n /**\n * Removes the item stored in storage.\n */\n async clearStorage(): Promise<void> {\n warnOnSyncing('write');\n store[SYNC_STATUS].set('syncing');\n patchState(store, {});\n await indexeddbService.clear(key);\n store[SYNC_STATUS].set('synced');\n },\n\n /**\n * Reads item from storage and patches the state.\n */\n async readFromStorage(): Promise<void> {\n warnOnSyncing('read');\n store[SYNC_STATUS].set('syncing');\n const stateString = await indexeddbService.getItem(key);\n if (stateString) {\n patchState(store, parse(stateString));\n }\n store[SYNC_STATUS].set('synced');\n },\n\n /**\n * Writes selected portion to storage.\n */\n async writeToStorage(): Promise<void> {\n warnOnSyncing('write');\n store[SYNC_STATUS].set('syncing');\n const slicedState = select(getState(store)) as State;\n await indexeddbService.setItem(key, stringify(slicedState));\n store[SYNC_STATUS].set('synced');\n },\n };\n }\n factory.type = 'async' as const;\n\n return factory;\n}\n","import { Injectable } from '@angular/core';\nimport {} from './models';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LocalStorageService {\n getItem(key: string): string | null {\n return localStorage.getItem(key);\n }\n\n setItem(key: string, data: string): void {\n return localStorage.setItem(key, data);\n }\n\n clear(key: string): void {\n return localStorage.removeItem(key);\n }\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SessionStorageService {\n getItem(key: string): string | null {\n return sessionStorage.getItem(key);\n }\n\n setItem(key: string, data: string): void {\n return sessionStorage.setItem(key, data);\n }\n\n clear(key: string): void {\n return sessionStorage.removeItem(key);\n }\n}\n","import { inject, Type } from '@angular/core';\nimport { getState, patchState } from '@ngrx/signals';\nimport { LocalStorageService } from '../internal/local-storage.service';\nimport { SyncStorageStrategy, SyncStoreForFactory } from '../internal/models';\nimport { SessionStorageService } from '../internal/session-storage.service';\nimport { SyncConfig } from '../with-storage-sync';\n\nexport function withLocalStorage<\n State extends object,\n>(): SyncStorageStrategy<State> {\n return createSyncMethods<State>(LocalStorageService);\n}\n\nexport function withSessionStorage<State extends object>() {\n return createSyncMethods<State>(SessionStorageService);\n}\n\nfunction createSyncMethods<State extends object>(\n Storage: Type<LocalStorageService | SessionStorageService>,\n): SyncStorageStrategy<State> {\n function factory(\n { key, parse, select, stringify }: Required<SyncConfig<State>>,\n store: SyncStoreForFactory<State>,\n useStubs: boolean,\n ) {\n if (useStubs) {\n return {\n clearStorage: () => undefined,\n readFromStorage: () => undefined,\n writeToStorage: () => undefined,\n };\n }\n\n const storage = inject(Storage);\n\n return {\n clearStorage(): void {\n storage.clear(key);\n },\n\n readFromStorage(): void {\n const stateString = storage.getItem(key);\n\n if (stateString) {\n patchState(store, parse(stateString));\n }\n },\n\n writeToStorage() {\n const slicedState = select(getState(store)) as State;\n storage.setItem(key, stringify(slicedState));\n },\n };\n }\n factory.type = 'sync' as const;\n\n return factory;\n}\n","import { isPlatformServer } from '@angular/common';\nimport { computed, effect, inject, PLATFORM_ID, signal } from '@angular/core';\nimport {\n EmptyFeatureResult,\n getState,\n signalStoreFeature,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n watchState,\n withHooks,\n withMethods,\n withProps,\n} from '@ngrx/signals';\nimport {\n withLocalStorage,\n withSessionStorage,\n} from './features/with-local-storage';\nimport {\n AsyncFeatureResult,\n AsyncStorageStrategy,\n SYNC_STATUS,\n SyncFeatureResult,\n SyncStorageStrategy,\n} from './internal/models';\n\nexport type SyncConfig<State> = {\n /**\n * The key which is used to access the storage.\n */\n key: string;\n /**\n * Flag indicating if the store should read from storage on init and write to storage on every state change.\n *\n * `true` by default\n */\n autoSync?: boolean;\n /**\n * Function to select that portion of the state which should be stored.\n *\n * Returns the whole state object by default\n */\n select?: (state: State) => unknown;\n /**\n * Function used to parse the state coming from storage.\n *\n * `JSON.parse()` by default\n */\n parse?: (stateString: string) => State;\n /**\n * Function used to transform the state into a string representation.\n *\n * `JSON.stringify()` by default\n */\n stringify?: (state: State) => string;\n\n /**\n * @deprecated Use {@link withSessionStorage} instead.\n * Factory function used to switch to sessionStorage.\n *\n * `localStorage` by default\n */\n storage?: () => Storage;\n};\n\n// only key\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n key: string,\n): SignalStoreFeature<Input, SyncFeatureResult>;\n\n// key + indexeddb\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n key: string,\n storageStrategy: AsyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<Input, AsyncFeatureResult>;\n\n// key + localStorage(or sessionStorage)\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n key: string,\n storageStrategy: SyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<Input, SyncFeatureResult>;\n\n// config + localStorage\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n config: SyncConfig<Input['state']>,\n): SignalStoreFeature<Input, SyncFeatureResult>;\n\n// config + indexeddb\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n config: SyncConfig<Input['state']>,\n storageStrategy: AsyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<Input, AsyncFeatureResult>;\n\n// config + localStorage(or sessionStorage)\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n config: SyncConfig<Input['state']>,\n storageStrategy: SyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<Input, SyncFeatureResult>;\n\nexport function withStorageSync<Input extends SignalStoreFeatureResult>(\n configOrKey: SyncConfig<Input['state']> | string,\n storageStrategy?:\n | AsyncStorageStrategy<Input['state']>\n | SyncStorageStrategy<Input['state']>,\n): SignalStoreFeature<\n Input,\n EmptyFeatureResult & (SyncFeatureResult | AsyncFeatureResult)\n> {\n if (\n typeof configOrKey !== 'string' &&\n configOrKey.storage &&\n storageStrategy\n ) {\n throw new Error(\n 'You can either pass a storage strategy or a config with storage, but not both.',\n );\n }\n const config: Required<SyncConfig<Input['state']>> = {\n autoSync: true,\n select: (state: Input['state']) => state,\n parse: JSON.parse,\n stringify: JSON.stringify,\n storage: () => localStorage,\n ...(typeof configOrKey === 'string' ? { key: configOrKey } : configOrKey),\n };\n\n const factory =\n storageStrategy ??\n (config.storage() === localStorage\n ? withLocalStorage()\n : withSessionStorage());\n\n if (factory.type === 'sync') {\n return createSyncStorageSync(factory, config);\n } else {\n return createAsyncStorageSync(factory, config);\n }\n}\n\nfunction createSyncStorageSync<Input extends SignalStoreFeatureResult>(\n factory: SyncStorageStrategy<Input['state']>,\n config: Required<SyncConfig<Input['state']>>,\n) {\n return signalStoreFeature(\n withMethods((store, platformId = inject(PLATFORM_ID)) => {\n return factory(config, store, isPlatformServer(platformId));\n }),\n withHooks({\n onInit(store, platformId = inject(PLATFORM_ID)) {\n if (isPlatformServer(platformId)) {\n return;\n }\n\n if (config.autoSync) {\n store.readFromStorage();\n watchState(store, () => store.writeToStorage());\n }\n },\n }),\n ) satisfies SignalStoreFeature<EmptyFeatureResult, SyncFeatureResult>;\n}\n\nfunction createAsyncStorageSync<Input extends SignalStoreFeatureResult>(\n factory: AsyncStorageStrategy<Input['state']>,\n config: Required<SyncConfig<Input['state']>>,\n) {\n return signalStoreFeature(\n withProps(() => {\n const props = {\n /*\n // we need to have that as property (and not state)\n // Otherwise the state watcher fires when updating the sync status\n */\n [SYNC_STATUS]: signal<'idle' | 'syncing' | 'synced'>('idle'),\n };\n\n const resolves = [] as (() => void)[];\n\n effect(() => {\n const syncStatus = props[SYNC_STATUS]();\n if (syncStatus === 'synced') {\n resolves.forEach((resolve) => resolve());\n resolves.splice(0, resolves.length);\n }\n });\n\n return {\n ...props,\n isSynced: computed(() => props[SYNC_STATUS]() === 'synced'),\n whenSynced: () =>\n new Promise<void>((resolve) => {\n if (props[SYNC_STATUS]() === 'synced') {\n resolve();\n } else {\n resolves.push(resolve);\n }\n }),\n };\n }),\n withMethods((store, platformId = inject(PLATFORM_ID)) => {\n return factory(config, store, isPlatformServer(platformId));\n }),\n withHooks({\n async onInit(store, platformId = inject(PLATFORM_ID)) {\n if (isPlatformServer(platformId)) {\n return;\n }\n\n const initialState = getState(store);\n if (config.autoSync) {\n let startWatching = false;\n watchState(store, () => {\n if (!startWatching) {\n if (getState(store) === initialState) {\n return;\n }\n\n console.warn(\n `Writing to Store (${config.key}) happened before the state was initially read from storage.`,\n 'Please ensure that the store is not in syncing state via `store.whenSynced()` before writing to the state.',\n 'Alternatively, you can disable autoSync by passing `autoSync: false` in the config.',\n );\n return;\n }\n return store.writeToStorage();\n });\n\n await store.readFromStorage();\n startWatching = true;\n }\n },\n }),\n ) satisfies SignalStoreFeature<EmptyFeatureResult, AsyncFeatureResult>;\n}\n","import {\n signalStoreFeature,\n SignalStoreFeature,\n SignalStoreFeatureResult,\n StateSignals,\n withState,\n} from '@ngrx/signals';\n\n/**\n * `withConditional` activates a feature based on a given condition.\n *\n * **Use Cases**\n * - Conditionally activate features based on the **store state** or other criteria.\n * - Choose between **two different implementations** of a feature.\n *\n * **Type Constraints**\n * Both features must have **exactly the same state, props, and methods**.\n * Otherwise, a type error will occur.\n *\n *\n * **Usage**\n *\n * ```typescript\n * const withUser = signalStoreFeature(\n * withState({ id: 1, name: 'Konrad' }),\n * withHooks(store => ({\n * onInit() {\n * // user loading logic\n * }\n * }))\n * );\n *\n * function withFakeUser() {\n * return signalStoreFeature(\n * withState({ id: 0, name: 'anonymous' })\n * );\n * }\n *\n * signalStore(\n * withMethods(() => ({\n * useRealUser: () => true\n * })),\n * withConditional((store) => store.useRealUser(), withUser, withFakeUser)\n * )\n * ```\n *\n * @param condition - A function that determines which feature to activate based on the store state.\n * @param featureIfTrue - The feature to activate if the condition evaluates to `true`.\n * @param featureIfFalse - The feature to activate if the condition evaluates to `false`.\n * @returns A `SignalStoreFeature` that applies the selected feature based on the condition.\n */\nexport function withConditional<\n Input extends SignalStoreFeatureResult,\n Output extends SignalStoreFeatureResult,\n>(\n condition: (\n store: StateSignals<Input['state']> & Input['props'] & Input['methods'],\n ) => boolean,\n featureIfTrue: SignalStoreFeature<NoInfer<Input>, Output>,\n featureIfFalse: SignalStoreFeature<NoInfer<Input>, NoInfer<Output>>,\n): SignalStoreFeature<Input, Output> {\n return (store) => {\n const conditionStore = {\n ...store['stateSignals'],\n ...store['props'],\n ...store['methods'],\n };\n return condition(conditionStore)\n ? featureIfTrue(store)\n : featureIfFalse(store);\n };\n}\n\nexport const emptyFeature = signalStoreFeature(withState({}));\n","import {\n SignalStoreFeature,\n SignalStoreFeatureResult,\n StateSignals,\n} from '@ngrx/signals';\n\ntype StoreForFactory<Input extends SignalStoreFeatureResult> = StateSignals<\n Input['state']\n> &\n Input['props'] &\n Input['methods'];\n\n/**\n * @deprecated Use `import { withFeature } from '@ngrx/signals'` instead, starting with `ngrx/signals` 19.1: https://ngrx.io/guide/signals/signal-store/custom-store-features#connecting-a-custom-feature-with-the-store\n *\n * Allows to pass properties, methods, or signals from a SignalStore\n * to a feature.\n *\n * Typically, a `signalStoreFeature` can have input constraints on\n *\n * ```typescript\n * function withSum(a: Signal<number>, b: Signal<number>) {\n * return signalStoreFeature(\n * withComputed(() => ({\n * sum: computed(() => a() + b())\n * }))\n * );\n * }\n *\n * signalStore(\n * withState({ a: 1, b: 2 }),\n * withFeatureFactory((store) => withSum(store.a, store.b))\n * );\n * ```\n * @param factoryFn\n */\nexport function withFeatureFactory<\n Input extends SignalStoreFeatureResult,\n Output extends SignalStoreFeatureResult,\n>(\n factoryFn: (\n store: StoreForFactory<Input>,\n ) => SignalStoreFeature<Input, Output>,\n): SignalStoreFeature<Input, Output> {\n return (store) => {\n const storeForFactory = {\n ...store['stateSignals'],\n ...store['props'],\n ...store['methods'],\n } as StoreForFactory<Input>;\n\n const feature = factoryFn(storeForFactory);\n\n return feature(store);\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["originalPatchState","patchState","ngIsInDevMode"],"mappings":";;;;;;;AAEO,MAAM,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AA2BpD,SAAU,qBAAqB,CACnC,OAAwB,EAAA;IAExB,OAAO;QACL,CAAC,gBAAgB,GAAG,IAAI;AACxB,QAAA,GAAG,OAAO;KACX;AACH;;AClCA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;SACa,uBAAuB,GAAA;IACrC,OAAO,qBAAqB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AACrD;;AC9BM,SAAU,WAAW,CAAI,GAAM,EAAA;IACnC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;AACrC,QAAA,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC;IACrB;AAEA,IAAA,OAAO,GAAG;AACZ;;ACIA;;;;AAIG;MAEU,oBAAoB,CAAA;IAC/B,OAAO,GAAW,EAAE;AACpB,IAAA,SAAS;AAET,IAAA,IAAI,MAA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4DAAA,CAA8D,EAC7F,4GAA4G,EAC5G,qFAAqF,CACtF;wBACD;oBACF;AACA,oBAAA,OAAO,KAAK,CAAC,cAAc,EAAE;AAC/B,gBAAA,CAAC,CAAC;AAEF,gBAAA,MAAM,KAAK,CAAC,eAAe,EAAE;gBAC7B,aAAa,GAAG,IAAI;YACtB;QACF,CAAC;AACF,KAAA,CAAC,CACkE;AACxE;;AChOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;SACa,eAAe,CAI7B,SAEY,EACZ,aAAyD,EACzD,cAAmE,EAAA;IAEnE,OAAO,CAAC,KAAK,KAAI;AACf,QAAA,MAAM,cAAc,GAAG;YACrB,GAAG,KAAK,CAAC,cAAc,CAAC;YACxB,GAAG,KAAK,CAAC,OAAO,CAAC;YACjB,GAAG,KAAK,CAAC,SAAS,CAAC;SACpB;QACD,OAAO,SAAS,CAAC,cAAc;AAC7B,cAAE,aAAa,CAAC,KAAK;AACrB,cAAE,cAAc,CAAC,KAAK,CAAC;AAC3B,IAAA,CAAC;AACH;AAEO,MAAM,YAAY,GAAG,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC;;AC7D5D;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACG,SAAU,kBAAkB,CAIhC,SAEsC,EAAA;IAEtC,OAAO,CAAC,KAAK,KAAI;AACf,QAAA,MAAM,eAAe,GAAG;YACtB,GAAG,KAAK,CAAC,cAAc,CAAC;YACxB,GAAG,KAAK,CAAC,OAAO,CAAC;YACjB,GAAG,KAAK,CAAC,SAAS,CAAC;SACM;AAE3B,QAAA,MAAM,OAAO,GAAG,SAAS,CAAC,eAAe,CAAC;AAE1C,QAAA,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB,IAAA,CAAC;AACH;;ACvDA;;AAEG;;;;"}
@@ -1,5 +1,4 @@
1
1
  import { patchState as originalPatchState, PartialStateUpdater, WritableStateSource } from '@ngrx/signals';
2
- import { Prettify } from '../shared/prettify';
3
2
  type PatchFn = typeof originalPatchState extends (arg1: infer First, ...args: infer Rest) => infer Returner ? (state: First, action: string, ...rest: Rest) => Returner : never;
4
3
  /**
5
4
  * @deprecated Has been renamed to `updateState`
@@ -12,5 +11,5 @@ export declare const patchState: PatchFn;
12
11
  * @param action name of action how it will show in DevTools
13
12
  * @param updaters updater functions or objects
14
13
  */
15
- export declare function updateState<State extends object>(stateSource: WritableStateSource<State>, action: string, ...updaters: Array<Partial<Prettify<State>> | PartialStateUpdater<Prettify<State>>>): void;
14
+ export declare function updateState<State extends object>(stateSource: WritableStateSource<State>, action: string, ...updaters: Array<Partial<NoInfer<State>> | PartialStateUpdater<NoInfer<State>>>): void;
16
15
  export {};
@@ -18,17 +18,28 @@ export type AsyncMethods = {
18
18
  readFromStorage(): Promise<void>;
19
19
  writeToStorage(): Promise<void>;
20
20
  };
21
+ /**
22
+ * AsyncFeatureResult is used as the public interface that users interact with
23
+ * when calling `withIndexedDB`. It intentionally omits the internal SYNC_STATUS
24
+ * property to avoid TypeScript error TS4058 (return type of public method
25
+ * includes private type).
26
+ *
27
+ * For internal implementation, we use AsyncStoreForFactory which includes
28
+ * the SYNC_STATUS property needed for state management.
29
+ */
21
30
  export declare const SYNC_STATUS: unique symbol;
22
31
  export type SyncStatus = 'idle' | 'syncing' | 'synced';
32
+ export type InternalAsyncProps = AsyncFeatureResult['props'] & {
33
+ [SYNC_STATUS]: WritableSignal<SyncStatus>;
34
+ };
23
35
  export type AsyncFeatureResult = EmptyFeatureResult & {
24
36
  methods: AsyncMethods;
25
37
  props: {
26
38
  isSynced: Signal<boolean>;
27
39
  whenSynced: () => Promise<void>;
28
- [SYNC_STATUS]: WritableSignal<SyncStatus>;
29
40
  };
30
41
  };
31
- export type AsyncStoreForFactory<State extends object> = WritableStateSource<State> & AsyncFeatureResult['props'];
42
+ export type AsyncStoreForFactory<State extends object> = WritableStateSource<State> & InternalAsyncProps;
32
43
  export type AsyncStorageStrategy<State extends object> = ((config: Required<SyncConfig<State>>, store: AsyncStoreForFactory<State>, useStubs: boolean) => AsyncMethods) & {
33
44
  type: 'async';
34
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-architects/ngrx-toolkit",
3
- "version": "19.2.1",
3
+ "version": "19.2.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "GitHub",
@@ -1,3 +0,0 @@
1
- export type Prettify<Type extends object> = {
2
- [Key in keyof Type]: Type[Key];
3
- };