UNPKG

39.7 kBSource Map (JSON)View Raw
1{"version":3,"file":"ngrx-entity.mjs","sources":["../../../../modules/entity/src/entity_state.ts","../../../../modules/entity/src/state_selectors.ts","../../../../modules/entity/src/state_adapter.ts","../../../../modules/entity/src/utils.ts","../../../../modules/entity/src/unsorted_state_adapter.ts","../../../../modules/entity/src/sorted_state_adapter.ts","../../../../modules/entity/src/create_adapter.ts","../../../../modules/entity/src/models.ts","../../../../modules/entity/index.ts","../../../../modules/entity/ngrx-entity.ts"],"sourcesContent":["import { EntityState } from './models';\n\nexport function getInitialEntityState<V>(): EntityState<V> {\n return {\n ids: [],\n entities: {},\n };\n}\n\nexport function createInitialStateFactory<V>() {\n function getInitialState(): EntityState<V>;\n function getInitialState<S extends object>(\n additionalState: S\n ): EntityState<V> & S;\n function getInitialState(additionalState: any = {}): any {\n return Object.assign(getInitialEntityState(), additionalState);\n }\n\n return { getInitialState };\n}\n","import { createSelector } from '@ngrx/store';\nimport { EntityState, EntitySelectors } from './models';\n\nexport function createSelectorsFactory<T>() {\n function getSelectors(): EntitySelectors<T, EntityState<T>>;\n function getSelectors<V>(\n selectState: (state: V) => EntityState<T>\n ): EntitySelectors<T, V>;\n function getSelectors(\n selectState?: (state: any) => EntityState<T>\n ): EntitySelectors<T, any> {\n const selectIds = (state: any) => state.ids;\n const selectEntities = (state: EntityState<T>) => state.entities;\n const selectAll = createSelector(\n selectIds,\n selectEntities,\n (ids, entities): any => ids.map((id: any) => (entities as any)[id])\n );\n\n const selectTotal = createSelector(selectIds, (ids) => ids.length);\n\n if (!selectState) {\n return {\n selectIds,\n selectEntities,\n selectAll,\n selectTotal,\n };\n }\n\n return {\n selectIds: createSelector(selectState, selectIds),\n selectEntities: createSelector(selectState, selectEntities),\n selectAll: createSelector(selectState, selectAll),\n selectTotal: createSelector(selectState, selectTotal),\n };\n }\n\n return { getSelectors };\n}\n","import { EntityState } from './models';\n\nexport enum DidMutate {\n EntitiesOnly,\n Both,\n None,\n}\n\nexport function createStateOperator<V, R>(\n mutator: (arg: R, state: EntityState<V>) => DidMutate\n): EntityState<V>;\nexport function createStateOperator<V, R>(\n mutator: (arg: any, state: any) => DidMutate\n): any {\n return function operation<S extends EntityState<V>>(arg: R, state: any): S {\n const clonedEntityState: EntityState<V> = {\n ids: [...state.ids],\n entities: { ...state.entities },\n };\n\n const didMutate = mutator(arg, clonedEntityState);\n\n if (didMutate === DidMutate.Both) {\n return Object.assign({}, state, clonedEntityState);\n }\n\n if (didMutate === DidMutate.EntitiesOnly) {\n return {\n ...state,\n entities: clonedEntityState.entities,\n };\n }\n\n return state;\n };\n}\n","import { isDevMode } from '@angular/core';\nimport { IdSelector } from './models';\n\nexport function selectIdValue<T>(entity: T, selectId: IdSelector<T>) {\n const key = selectId(entity);\n\n if (isDevMode() && key === undefined) {\n console.warn(\n '@ngrx/entity: The entity passed to the `selectId` implementation returned undefined.',\n 'You should probably provide your own `selectId` implementation.',\n 'The entity that was passed:',\n entity,\n 'The `selectId` implementation:',\n selectId.toString()\n );\n }\n\n return key;\n}\n","import {\n EntityState,\n EntityStateAdapter,\n IdSelector,\n Update,\n Predicate,\n EntityMap,\n EntityMapOneNum,\n EntityMapOneStr,\n} from './models';\nimport { createStateOperator, DidMutate } from './state_adapter';\nimport { selectIdValue } from './utils';\n\nexport function createUnsortedStateAdapter<T>(\n selectId: IdSelector<T>\n): EntityStateAdapter<T>;\nexport function createUnsortedStateAdapter<T>(selectId: IdSelector<T>): any {\n type R = EntityState<T>;\n\n function addOneMutably(entity: T, state: R): DidMutate;\n function addOneMutably(entity: any, state: any): DidMutate {\n const key = selectIdValue(entity, selectId);\n\n if (key in state.entities) {\n return DidMutate.None;\n }\n\n state.ids.push(key);\n state.entities[key] = entity;\n\n return DidMutate.Both;\n }\n\n function addManyMutably(entities: T[], state: R): DidMutate;\n function addManyMutably(entities: any[], state: any): DidMutate {\n let didMutate = false;\n\n for (const entity of entities) {\n didMutate = addOneMutably(entity, state) !== DidMutate.None || didMutate;\n }\n\n return didMutate ? DidMutate.Both : DidMutate.None;\n }\n\n function setAllMutably(entities: T[], state: R): DidMutate;\n function setAllMutably(entities: any[], state: any): DidMutate {\n state.ids = [];\n state.entities = {};\n\n addManyMutably(entities, state);\n\n return DidMutate.Both;\n }\n\n function setOneMutably(entity: T, state: R): DidMutate;\n function setOneMutably(entity: any, state: any): DidMutate {\n const key = selectIdValue(entity, selectId);\n\n if (key in state.entities) {\n state.entities[key] = entity;\n return DidMutate.EntitiesOnly;\n }\n\n state.ids.push(key);\n state.entities[key] = entity;\n\n return DidMutate.Both;\n }\n\n function setManyMutably(entities: T[], state: R): DidMutate;\n function setManyMutably(entities: any[], state: any): DidMutate {\n const didMutateSetOne = entities.map((entity) =>\n setOneMutably(entity, state)\n );\n\n switch (true) {\n case didMutateSetOne.some((didMutate) => didMutate === DidMutate.Both):\n return DidMutate.Both;\n case didMutateSetOne.some(\n (didMutate) => didMutate === DidMutate.EntitiesOnly\n ):\n return DidMutate.EntitiesOnly;\n default:\n return DidMutate.None;\n }\n }\n\n function removeOneMutably(key: string | number, state: R): DidMutate;\n function removeOneMutably(key: any, state: any): DidMutate {\n return removeManyMutably([key], state);\n }\n\n function removeManyMutably(keys: string[] | number[], state: R): DidMutate;\n function removeManyMutably(predicate: Predicate<T>, state: R): DidMutate;\n function removeManyMutably(\n keysOrPredicate: any[] | Predicate<T>,\n state: any\n ): DidMutate {\n const keys =\n keysOrPredicate instanceof Array\n ? keysOrPredicate\n : state.ids.filter((key: any) => keysOrPredicate(state.entities[key]));\n\n const didMutate =\n keys\n .filter((key: any) => key in state.entities)\n .map((key: any) => delete state.entities[key]).length > 0;\n\n if (didMutate) {\n state.ids = state.ids.filter((id: any) => id in state.entities);\n }\n\n return didMutate ? DidMutate.Both : DidMutate.None;\n }\n\n function removeAll<S extends R>(state: S): S;\n function removeAll<S extends R>(state: any): S {\n return Object.assign({}, state, {\n ids: [],\n entities: {},\n });\n }\n\n function takeNewKey(\n keys: { [id: string]: string },\n update: Update<T>,\n state: R\n ): void;\n function takeNewKey(\n keys: { [id: string]: any },\n update: Update<T>,\n state: any\n ): boolean {\n const original = state.entities[update.id];\n const updated: T = Object.assign({}, original, update.changes);\n const newKey = selectIdValue(updated, selectId);\n const hasNewKey = newKey !== update.id;\n\n if (hasNewKey) {\n keys[update.id] = newKey;\n delete state.entities[update.id];\n }\n\n state.entities[newKey] = updated;\n\n return hasNewKey;\n }\n\n function updateOneMutably(update: Update<T>, state: R): DidMutate;\n function updateOneMutably(update: any, state: any): DidMutate {\n return updateManyMutably([update], state);\n }\n\n function updateManyMutably(updates: Update<T>[], state: R): DidMutate;\n function updateManyMutably(updates: any[], state: any): DidMutate {\n const newKeys: { [id: string]: string } = {};\n\n updates = updates.filter((update) => update.id in state.entities);\n\n const didMutateEntities = updates.length > 0;\n\n if (didMutateEntities) {\n const didMutateIds =\n updates.filter((update) => takeNewKey(newKeys, update, state)).length >\n 0;\n\n if (didMutateIds) {\n state.ids = state.ids.map((id: any) => newKeys[id] || id);\n return DidMutate.Both;\n } else {\n return DidMutate.EntitiesOnly;\n }\n }\n\n return DidMutate.None;\n }\n\n function mapMutably(map: EntityMap<T>, state: R): DidMutate;\n function mapMutably(map: any, state: any): DidMutate {\n const changes: Update<T>[] = state.ids.reduce(\n (changes: any[], id: string | number) => {\n const change = map(state.entities[id]);\n if (change !== state.entities[id]) {\n changes.push({ id, changes: change });\n }\n return changes;\n },\n []\n );\n const updates = changes.filter(({ id }) => id in state.entities);\n\n return updateManyMutably(updates, state);\n }\n\n function mapOneMutably(map: EntityMapOneNum<T>, state: R): DidMutate;\n function mapOneMutably(map: EntityMapOneStr<T>, state: R): DidMutate;\n function mapOneMutably({ map, id }: any, state: any): DidMutate {\n const entity = state.entities[id];\n if (!entity) {\n return DidMutate.None;\n }\n\n const updatedEntity = map(entity);\n return updateOneMutably(\n {\n id: id,\n changes: updatedEntity,\n },\n state\n );\n }\n\n function upsertOneMutably(entity: T, state: R): DidMutate;\n function upsertOneMutably(entity: any, state: any): DidMutate {\n return upsertManyMutably([entity], state);\n }\n\n function upsertManyMutably(entities: T[], state: R): DidMutate;\n function upsertManyMutably(entities: any[], state: any): DidMutate {\n const added: any[] = [];\n const updated: any[] = [];\n\n for (const entity of entities) {\n const id = selectIdValue(entity, selectId);\n if (id in state.entities) {\n updated.push({ id, changes: entity });\n } else {\n added.push(entity);\n }\n }\n\n const didMutateByUpdated = updateManyMutably(updated, state);\n const didMutateByAdded = addManyMutably(added, state);\n\n switch (true) {\n case didMutateByAdded === DidMutate.None &&\n didMutateByUpdated === DidMutate.None:\n return DidMutate.None;\n case didMutateByAdded === DidMutate.Both ||\n didMutateByUpdated === DidMutate.Both:\n return DidMutate.Both;\n default:\n return DidMutate.EntitiesOnly;\n }\n }\n\n return {\n removeAll,\n addOne: createStateOperator(addOneMutably),\n addMany: createStateOperator(addManyMutably),\n setAll: createStateOperator(setAllMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n updateOne: createStateOperator(updateOneMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n upsertMany: createStateOperator(upsertManyMutably),\n removeOne: createStateOperator(removeOneMutably),\n removeMany: createStateOperator(removeManyMutably),\n map: createStateOperator(mapMutably),\n mapOne: createStateOperator(mapOneMutably),\n };\n}\n","import {\n EntityState,\n IdSelector,\n Comparer,\n EntityStateAdapter,\n Update,\n EntityMap,\n EntityMapOneNum,\n EntityMapOneStr,\n} from './models';\nimport { createStateOperator, DidMutate } from './state_adapter';\nimport { createUnsortedStateAdapter } from './unsorted_state_adapter';\nimport { selectIdValue } from './utils';\n\nexport function createSortedStateAdapter<T>(\n selectId: IdSelector<T>,\n sort: Comparer<T>\n): EntityStateAdapter<T>;\nexport function createSortedStateAdapter<T>(selectId: any, sort: any): any {\n type R = EntityState<T>;\n\n const { removeOne, removeMany, removeAll } =\n createUnsortedStateAdapter(selectId);\n\n function addOneMutably(entity: T, state: R): DidMutate;\n function addOneMutably(entity: any, state: any): DidMutate {\n return addManyMutably([entity], state);\n }\n\n function addManyMutably(newModels: T[], state: R): DidMutate;\n function addManyMutably(newModels: any[], state: any): DidMutate {\n const models = newModels.filter(\n (model) => !(selectIdValue(model, selectId) in state.entities)\n );\n\n if (models.length === 0) {\n return DidMutate.None;\n } else {\n merge(models, state);\n return DidMutate.Both;\n }\n }\n\n function setAllMutably(models: T[], state: R): DidMutate;\n function setAllMutably(models: any[], state: any): DidMutate {\n state.entities = {};\n state.ids = [];\n\n addManyMutably(models, state);\n\n return DidMutate.Both;\n }\n\n function setOneMutably(entity: T, state: R): DidMutate;\n function setOneMutably(entity: any, state: any): DidMutate {\n const id = selectIdValue(entity, selectId);\n if (id in state.entities) {\n state.ids = state.ids.filter((val: string | number) => val !== id);\n merge([entity], state);\n return DidMutate.Both;\n } else {\n return addOneMutably(entity, state);\n }\n }\n\n function setManyMutably(entities: T[], state: R): DidMutate;\n function setManyMutably(entities: any[], state: any): DidMutate {\n const didMutateSetOne = entities.map((entity) =>\n setOneMutably(entity, state)\n );\n\n switch (true) {\n case didMutateSetOne.some((didMutate) => didMutate === DidMutate.Both):\n return DidMutate.Both;\n case didMutateSetOne.some(\n (didMutate) => didMutate === DidMutate.EntitiesOnly\n ):\n return DidMutate.EntitiesOnly;\n default:\n return DidMutate.None;\n }\n }\n\n function updateOneMutably(update: Update<T>, state: R): DidMutate;\n function updateOneMutably(update: any, state: any): DidMutate {\n return updateManyMutably([update], state);\n }\n\n function takeUpdatedModel(models: T[], update: Update<T>, state: R): boolean;\n function takeUpdatedModel(models: any[], update: any, state: any): boolean {\n if (!(update.id in state.entities)) {\n return false;\n }\n\n const original = state.entities[update.id];\n const updated = Object.assign({}, original, update.changes);\n const newKey = selectIdValue(updated, selectId);\n\n delete state.entities[update.id];\n\n models.push(updated);\n\n return newKey !== update.id;\n }\n\n function updateManyMutably(updates: Update<T>[], state: R): DidMutate;\n function updateManyMutably(updates: any[], state: any): DidMutate {\n const models: T[] = [];\n\n const didMutateIds =\n updates.filter((update) => takeUpdatedModel(models, update, state))\n .length > 0;\n\n if (models.length === 0) {\n return DidMutate.None;\n } else {\n const originalIds = state.ids;\n const updatedIndexes: any[] = [];\n state.ids = state.ids.filter((id: any, index: number) => {\n if (id in state.entities) {\n return true;\n } else {\n updatedIndexes.push(index);\n return false;\n }\n });\n\n merge(models, state);\n\n if (\n !didMutateIds &&\n updatedIndexes.every((i: number) => state.ids[i] === originalIds[i])\n ) {\n return DidMutate.EntitiesOnly;\n } else {\n return DidMutate.Both;\n }\n }\n }\n\n function mapMutably(map: EntityMap<T>, state: R): DidMutate;\n function mapMutably(updatesOrMap: any, state: any): DidMutate {\n const updates: Update<T>[] = state.ids.reduce(\n (changes: any[], id: string | number) => {\n const change = updatesOrMap(state.entities[id]);\n if (change !== state.entities[id]) {\n changes.push({ id, changes: change });\n }\n return changes;\n },\n []\n );\n\n return updateManyMutably(updates, state);\n }\n\n function mapOneMutably(map: EntityMapOneNum<T>, state: R): DidMutate;\n function mapOneMutably(map: EntityMapOneStr<T>, state: R): DidMutate;\n function mapOneMutably({ map, id }: any, state: any): DidMutate {\n const entity = state.entities[id];\n if (!entity) {\n return DidMutate.None;\n }\n\n const updatedEntity = map(entity);\n return updateOneMutably(\n {\n id: id,\n changes: updatedEntity,\n },\n state\n );\n }\n\n function upsertOneMutably(entity: T, state: R): DidMutate;\n function upsertOneMutably(entity: any, state: any): DidMutate {\n return upsertManyMutably([entity], state);\n }\n\n function upsertManyMutably(entities: T[], state: R): DidMutate;\n function upsertManyMutably(entities: any[], state: any): DidMutate {\n const added: any[] = [];\n const updated: any[] = [];\n\n for (const entity of entities) {\n const id = selectIdValue(entity, selectId);\n if (id in state.entities) {\n updated.push({ id, changes: entity });\n } else {\n added.push(entity);\n }\n }\n\n const didMutateByUpdated = updateManyMutably(updated, state);\n const didMutateByAdded = addManyMutably(added, state);\n\n switch (true) {\n case didMutateByAdded === DidMutate.None &&\n didMutateByUpdated === DidMutate.None:\n return DidMutate.None;\n case didMutateByAdded === DidMutate.Both ||\n didMutateByUpdated === DidMutate.Both:\n return DidMutate.Both;\n default:\n return DidMutate.EntitiesOnly;\n }\n }\n\n function merge(models: T[], state: R): void;\n function merge(models: any[], state: any): void {\n models.sort(sort);\n\n const ids: any[] = [];\n\n let i = 0;\n let j = 0;\n\n while (i < models.length && j < state.ids.length) {\n const model = models[i];\n const modelId = selectIdValue(model, selectId);\n const entityId = state.ids[j];\n const entity = state.entities[entityId];\n\n if (sort(model, entity) <= 0) {\n ids.push(modelId);\n i++;\n } else {\n ids.push(entityId);\n j++;\n }\n }\n\n if (i < models.length) {\n state.ids = ids.concat(models.slice(i).map(selectId));\n } else {\n state.ids = ids.concat(state.ids.slice(j));\n }\n\n models.forEach((model, i) => {\n state.entities[selectId(model)] = model;\n });\n }\n\n return {\n removeOne,\n removeMany,\n removeAll,\n addOne: createStateOperator(addOneMutably),\n updateOne: createStateOperator(updateOneMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n setAll: createStateOperator(setAllMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n addMany: createStateOperator(addManyMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertMany: createStateOperator(upsertManyMutably),\n map: createStateOperator(mapMutably),\n mapOne: createStateOperator(mapOneMutably),\n };\n}\n","import {\n EntityDefinition,\n Comparer,\n IdSelector,\n EntityAdapter,\n} from './models';\nimport { createInitialStateFactory } from './entity_state';\nimport { createSelectorsFactory } from './state_selectors';\nimport { createSortedStateAdapter } from './sorted_state_adapter';\nimport { createUnsortedStateAdapter } from './unsorted_state_adapter';\n\nexport function createEntityAdapter<T>(\n options: {\n selectId?: IdSelector<T>;\n sortComparer?: false | Comparer<T>;\n } = {}\n): EntityAdapter<T> {\n const { selectId, sortComparer }: EntityDefinition<T> = {\n selectId: options.selectId ?? ((entity: any) => entity.id),\n sortComparer: options.sortComparer ?? false,\n };\n\n const stateFactory = createInitialStateFactory<T>();\n const selectorsFactory = createSelectorsFactory<T>();\n const stateAdapter = sortComparer\n ? createSortedStateAdapter(selectId, sortComparer)\n : createUnsortedStateAdapter(selectId);\n\n return {\n selectId,\n sortComparer,\n ...stateFactory,\n ...selectorsFactory,\n ...stateAdapter,\n };\n}\n","export type Comparer<T> = (a: T, b: T) => number;\n\nexport type IdSelectorStr<T> = (model: T) => string;\nexport type IdSelectorNum<T> = (model: T) => number;\n\nexport type IdSelector<T> = IdSelectorStr<T> | IdSelectorNum<T>;\n\nexport interface DictionaryNum<T> {\n [id: number]: T | undefined;\n}\n\nexport abstract class Dictionary<T> implements DictionaryNum<T> {\n [id: string]: T | undefined;\n}\n\nexport interface UpdateStr<T> {\n id: string;\n changes: Partial<T>;\n}\n\nexport interface UpdateNum<T> {\n id: number;\n changes: Partial<T>;\n}\n\nexport type Update<T> = UpdateStr<T> | UpdateNum<T>;\n\nexport type Predicate<T> = (entity: T) => boolean;\n\nexport type EntityMap<T> = (entity: T) => T;\n\nexport interface EntityMapOneNum<T> {\n id: number;\n map: EntityMap<T>;\n}\n\nexport interface EntityMapOneStr<T> {\n id: string;\n map: EntityMap<T>;\n}\n\nexport type EntityMapOne<T> = EntityMapOneNum<T> | EntityMapOneStr<T>;\n\nexport interface EntityState<T> {\n ids: string[] | number[];\n entities: Dictionary<T>;\n}\n\nexport interface EntityDefinition<T> {\n selectId: IdSelector<T>;\n sortComparer: false | Comparer<T>;\n}\n\nexport interface EntityStateAdapter<T> {\n addOne<S extends EntityState<T>>(entity: T, state: S): S;\n addMany<S extends EntityState<T>>(entities: T[], state: S): S;\n\n setAll<S extends EntityState<T>>(entities: T[], state: S): S;\n setOne<S extends EntityState<T>>(entity: T, state: S): S;\n setMany<S extends EntityState<T>>(entities: T[], state: S): S;\n\n removeOne<S extends EntityState<T>>(key: string, state: S): S;\n removeOne<S extends EntityState<T>>(key: number, state: S): S;\n\n removeMany<S extends EntityState<T>>(keys: string[], state: S): S;\n removeMany<S extends EntityState<T>>(keys: number[], state: S): S;\n removeMany<S extends EntityState<T>>(predicate: Predicate<T>, state: S): S;\n\n removeAll<S extends EntityState<T>>(state: S): S;\n\n updateOne<S extends EntityState<T>>(update: Update<T>, state: S): S;\n updateMany<S extends EntityState<T>>(updates: Update<T>[], state: S): S;\n\n upsertOne<S extends EntityState<T>>(entity: T, state: S): S;\n upsertMany<S extends EntityState<T>>(entities: T[], state: S): S;\n\n mapOne<S extends EntityState<T>>(map: EntityMapOne<T>, state: S): S;\n map<S extends EntityState<T>>(map: EntityMap<T>, state: S): S;\n}\n\nexport type EntitySelectors<T, V> = {\n selectIds: (state: V) => string[] | number[];\n selectEntities: (state: V) => Dictionary<T>;\n selectAll: (state: V) => T[];\n selectTotal: (state: V) => number;\n};\n\nexport interface EntityAdapter<T> extends EntityStateAdapter<T> {\n selectId: IdSelector<T>;\n sortComparer: false | Comparer<T>;\n getInitialState(): EntityState<T>;\n getInitialState<S extends object>(state: S): EntityState<T> & S;\n getSelectors(): EntitySelectors<T, EntityState<T>>;\n getSelectors<V>(\n selectState: (state: V) => EntityState<T>\n ): EntitySelectors<T, V>;\n}\n","/**\n * DO NOT EDIT\n *\n * This file is automatically generated at build\n */\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;SAEgB,qBAAqB,GAAA;IACnC,OAAO;AACL,QAAA,GAAG,EAAE,EAAE;AACP,QAAA,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC;SAEe,yBAAyB,GAAA;IAKvC,SAAS,eAAe,CAAC,eAAA,GAAuB,EAAE,EAAA;QAChD,OAAO,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,EAAE,eAAe,CAAC,CAAC;KAChE;IAED,OAAO,EAAE,eAAe,EAAE,CAAC;AAC7B;;SChBgB,sBAAsB,GAAA;IAKpC,SAAS,YAAY,CACnB,WAA4C,EAAA;QAE5C,MAAM,SAAS,GAAG,CAAC,KAAU,KAAK,KAAK,CAAC,GAAG,CAAC;QAC5C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