silentium 0.0.77 → 0.0.78

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.78](https://github.com/silentium-lab/silentium/compare/v0.0.77...v0.0.78) (2025-08-31)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **main:** fix shared source ([6ddab6f](https://github.com/silentium-lab/silentium/commit/6ddab6f80e8e7aad42d5d779d2269a9ec37b436e))
11
+
5
12
  ### [0.0.77](https://github.com/silentium-lab/silentium/compare/v0.0.76...v0.0.77) (2025-08-30)
6
13
 
7
14
 
@@ -549,6 +549,7 @@ class SharedSource extends TheInformation {
549
549
  constructor(baseSrc, stateless = false) {
550
550
  const sharedSrc = new Shared(baseSrc, stateless);
551
551
  super(sharedSrc);
552
+ this.baseSrc = baseSrc;
552
553
  __publicField(this, "sharedSrc");
553
554
  this.sharedSrc = sharedSrc;
554
555
  }
@@ -557,6 +558,7 @@ class SharedSource extends TheInformation {
557
558
  return this;
558
559
  }
559
560
  give(value) {
561
+ this.baseSrc.give(value);
560
562
  this.sharedSrc.give(value);
561
563
  return this;
562
564
  }
@@ -1 +1 @@
1
- {"version":3,"file":"silentium.cjs","sources":["../src/base/Destroyable.ts","../src/base/DestroyFunc.ts","../src/base/TheOwner.ts","../src/base/From.ts","../src/base/TheInformation.ts","../src/helpers/isFilled.ts","../src/helpers/OwnerPool.ts","../src/base/Of.ts","../src/base/Lazy.ts","../src/base/OfFunc.ts","../src/base/Void.ts","../src/base/On.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/Chain.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromCallback.ts","../src/components/FromEvent.ts","../src/components/FromPromise.ts","../src/components/Late.ts","../src/components/LazyApplied.ts","../src/components/LazyClass.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Shared.ts","../src/components/SharedSource.ts","../src/components/Stream.ts"],"sourcesContent":["const isDestroyable = (dep: unknown): dep is Destroyable => {\n return typeof dep === \"object\" && dep !== null && \"destroy\" in dep;\n};\n\n/**\n * Representation of Destroyable object\n */\nexport class Destroyable {\n private theDeps: any[];\n public constructor(...deps: any[]) {\n this.theDeps = deps ?? [];\n }\n\n public destroy() {\n this.theDeps?.forEach((dep) => {\n if (isDestroyable(dep)) {\n dep.destroy();\n }\n });\n return this;\n }\n\n /**\n * Add dependency what can be destroyed\n */\n public addDep(dep: any) {\n this.theDeps?.push(dep);\n return this;\n }\n\n public dep(dep: any) {\n this.addDep(dep);\n return dep;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\n\n/**\n * Representation of destructor function as object\n */\nexport class DestroyFunc extends Destroyable {\n public constructor(private destructor: () => void) {\n super();\n }\n\n public destroy(): this {\n this.destructor();\n return this;\n }\n}\n","export interface OwnerType<T = unknown> {\n give(value: T): this;\n}\n\n/**\n * Representation of Information Owner\n */\nexport abstract class TheOwner<T = unknown> implements OwnerType<T> {\n public abstract give(value: T): this;\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Owner from function\n */\nexport class From<T = unknown> extends TheOwner<T> {\n public constructor(private fn: (value: T) => void) {\n super();\n }\n\n public give(value: T): this {\n this.fn(value);\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { OwnerType } from \"./TheOwner\";\n\nexport interface InformationType<T = unknown> {\n value(o: OwnerType<T>): this;\n}\n\nexport type MaybeInformationType<T = unknown> = InformationType<T> | T;\n\n/**\n * Representation of Information\n */\nexport abstract class TheInformation<T = unknown>\n extends Destroyable\n implements InformationType<T>\n{\n public abstract value(o: OwnerType<T>): this;\n}\n\nexport class MbInfo<T> extends TheInformation<T> {\n private info: InformationType<T>;\n\n public constructor(theInfo: MaybeInformationType<T>) {\n const info =\n typeof theInfo === \"object\" &&\n theInfo !== null &&\n \"value\" in theInfo &&\n typeof theInfo.value === \"function\"\n ? theInfo\n : new Of(theInfo);\n super(info);\n this.info = info;\n }\n\n public value(o: OwnerType<T>): this {\n this.info.value(o);\n return this;\n }\n}\n","export const isFilled = <T>(value?: T): value is T => {\n return value !== undefined && value !== null;\n};\n","import { From, OwnerType } from \"../base\";\n\n/**\n * Helps maintain an owner list allowing different\n * owners to get information from a common source\n * https://silentium-lab.github.io/silentium/#/en/utils/owner-pool\n */\nexport class OwnerPool<T> {\n private owners: Set<OwnerType<T>>;\n private innerOwner: OwnerType<T>;\n\n public constructor() {\n this.owners = new Set<OwnerType<T>>();\n this.innerOwner = new From((v) => {\n this.owners.forEach((g) => {\n g.give(v);\n });\n });\n }\n\n public owner() {\n return this.innerOwner;\n }\n\n public size(): number {\n return this.owners.size;\n }\n\n public has(owner: OwnerType<T>): boolean {\n return this.owners.has(owner);\n }\n\n public add(owner: OwnerType<T>) {\n this.owners.add(owner);\n return this;\n }\n\n public remove(g: OwnerType<T>) {\n this.owners.delete(g);\n return this;\n }\n\n public destroy() {\n this.owners.forEach((g) => {\n this.remove(g);\n });\n return this;\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * Information from primitive value\n */\nexport class Of<T> extends TheInformation<T> {\n public constructor(private theValue: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (isFilled(this.theValue)) {\n o.give(this.theValue);\n }\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { InformationType } from \"./TheInformation\";\n\n/**\n * Ability to create information after some event\n */\nexport class Lazy<T = unknown> extends Destroyable {\n public constructor(\n protected buildFn?: (...args: InformationType[]) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]) {\n args.forEach((dep) => {\n this.addDep(dep);\n });\n return this.buildFn?.(...args) ?? (new Of(null) as InformationType<T>);\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\n\ntype DestructorFnType = () => void;\n\n/**\n * Information of function\n */\nexport class OfFunc<T> extends TheInformation<T> {\n private mbDestructor?: DestructorFnType | void;\n\n public constructor(\n private valueFn: (o: OwnerType<T>) => DestructorFnType | undefined | void,\n ) {\n super(valueFn);\n }\n\n public value(o: OwnerType<T>): this {\n this.mbDestructor = this.valueFn(o);\n return this;\n }\n\n public destroy(): this {\n super.destroy();\n this.mbDestructor?.();\n return this;\n }\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Silent owner\n */\nexport class Void extends TheOwner {\n public give(): this {\n return this;\n }\n}\n","import { Destroyable } from \"../base/Destroyable\";\nimport { From } from \"../base/From\";\nimport { InformationType } from \"../base/TheInformation\";\nimport { Void } from \"../base/Void\";\n\n/**\n * Run information with functional owner if needed\n */\nexport class On<T = unknown> extends Destroyable {\n public constructor(src: InformationType<T>, fn?: (value: T) => void) {\n super(src, fn);\n src.value(fn ? new From(fn) : new Void());\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\ntype ExtractTypeS<T> = T extends InformationType<infer U> ? U : never;\n\nexport type ExtractTypesFromArrayS<T extends InformationType<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\n/**\n * Combines multiple information sources into a single unified source\n * represented as an array containing values from all sources\n * https://silentium-lab.github.io/silentium/#/en/information/all\n */\nexport class All<const T extends InformationType[]> extends TheInformation<\n ExtractTypesFromArrayS<T>\n> {\n private keysKnown: Set<string>;\n private keysFilled = new Set();\n private infos: T;\n\n public constructor(...theInfos: T) {\n super(theInfos);\n this.infos = theInfos;\n this.keysKnown = new Set<string>(Object.keys(theInfos));\n }\n\n public value(o: OwnerType<ExtractTypesFromArrayS<T>>): this {\n const result: Record<string, unknown> = {};\n\n Object.entries(this.infos).forEach(([key, info]) => {\n this.keysKnown.add(key);\n info.value(\n new From((v) => {\n this.keysFilled.add(key);\n result[key] = v;\n if (this.isAllFilled()) {\n o.give(Object.values(result) as ExtractTypesFromArrayS<T>);\n }\n }),\n );\n });\n return this;\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * From a set of information sources we get\n * a common response from any source for a single owner\n * https://silentium-lab.github.io/silentium/#/en/information/any\n */\nexport class Any<T> extends TheInformation<T> {\n private infos: InformationType<T>[];\n\n public constructor(...theInfos: InformationType<T>[]) {\n super(theInfos);\n this.infos = theInfos;\n }\n\n public value(o: OwnerType<T>): this {\n this.infos.forEach((info) => {\n info.value(o);\n });\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which the function was applied to change the value\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Applied<T, R> extends TheInformation<R> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (v: T) => R,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<R>): this {\n this.baseSrc.value(\n new From((v) => {\n o.give(this.applier(v));\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends any[]> = T extends [...infer U, infer L] ? L : never;\n\n/**\n * The set of information sources forms a sequential chain where each source provides\n * an answer. The final answer will be the output result. If any source in the chain\n * provides a new answer, the component's overall response will be repeated.\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Chain<T extends InformationType[]> extends TheInformation<\n Last<T>\n> {\n private theInfos: T;\n\n public constructor(...infos: T) {\n super(infos);\n this.theInfos = infos;\n }\n\n public value(o: OwnerType<Last<T>>) {\n let lastValue: Last<T> | undefined;\n\n const handleI = (index: number) => {\n const info = this.theInfos[index] as TheInformation<Last<T>>;\n const nextI = this.theInfos[index + 1] as\n | TheInformation<Last<T>>\n | undefined;\n\n info.value(\n new From((v) => {\n if (!nextI) {\n lastValue = v;\n }\n\n if (lastValue) {\n o.give(lastValue);\n }\n\n if (nextI && !lastValue) {\n handleI(index + 1);\n }\n }),\n );\n };\n\n handleI(0);\n\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which a function is applied in order\n * to control the value passing process\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class ExecutorApplied<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (executor: (v: T) => void) => (v: T) => void,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From(\n this.applier((v) => {\n o.give(v);\n }),\n ),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information whose value is being validated\n * via a predicate; if the predicate returns true, the value\n * can be passed to the output\n * https://silentium-lab.github.io/silentium/#/en/information/filtered\n */\nexport class Filtered<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private predicate: (v: T) => boolean,\n private defaultValue?: T,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n if (this.predicate(v)) {\n o.give(v);\n } else if (this.defaultValue !== undefined) {\n o.give(this.defaultValue);\n }\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * When receiving a reference to a function expecting a callback, the component\n * creates its own callback, and the data received in this callback\n * will become the value of the information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-callback\n */\nexport class FromCallback<T> extends TheInformation<T> {\n private theArgs: unknown[];\n\n public constructor(\n private waitForCb: (cb: (v: T) => any, ...args: unknown[]) => unknown,\n ...args: unknown[]\n ) {\n super(waitForCb);\n this.theArgs = args;\n }\n\n public value(o: OwnerType<T>): this {\n this.waitForCb(\n (v) => {\n o.give(v);\n },\n ...this.theArgs,\n );\n return this;\n }\n}\n","import { DestroyFunc } from \"../base/DestroyFunc\";\nimport { From, InformationType, Of, OwnerType, TheInformation } from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * A component that receives data from an event and\n * presents it as an information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-event\n */\nexport class FromEvent<T = unknown> extends TheInformation<T> {\n public constructor(\n private emitterSrc: InformationType<any>,\n private eventNameSrc: InformationType<string>,\n private subscribeMethodSrc: InformationType<string>,\n private unsubscribeMethodSrc: InformationType<string> = new Of(\"\"),\n ) {\n super(emitterSrc, eventNameSrc, subscribeMethodSrc, unsubscribeMethodSrc);\n }\n\n public value(o: OwnerType<T>): this {\n const a = new All(\n this.emitterSrc,\n this.eventNameSrc,\n this.subscribeMethodSrc,\n this.unsubscribeMethodSrc,\n );\n const handler = (v: T) => {\n o.give(v);\n };\n a.value(\n new From(([emitter, eventName, subscribe, unsubscribe]) => {\n emitter[subscribe](eventName, handler);\n this.addDep(\n new DestroyFunc(() => {\n emitter[unsubscribe](eventName, handler);\n }),\n );\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that gets a value from a promise and\n * presents it as information\n * https://silentium-lab.github.io/silentium/#/en/information/from-promise\n */\nexport class FromPromise<T> extends TheInformation<T> {\n public constructor(\n private p: Promise<T>,\n private errorOwner?: OwnerType,\n ) {\n super(p);\n }\n\n public value(o: OwnerType<T>): this {\n this.p\n .then((v) => {\n o.give(v);\n })\n .catch((e) => {\n this.errorOwner?.give(e);\n });\n return this;\n }\n}\n","import { From, OwnerType, TheInformation } from \"../base\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport class Late<T> extends TheInformation<T> implements OwnerType<T> {\n private theOwner?: OwnerType<T>;\n private lateOwner = new From((v: T) => {\n this.theValue = v;\n this.notify();\n });\n\n public constructor(private theValue?: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (this.theOwner) {\n throw new Error(\n \"Late component gets new owner, when another was already connected!\",\n );\n }\n this.theOwner = o;\n this.notify();\n return this;\n }\n\n public give(v: T) {\n this.theValue = v;\n this.lateOwner.give(v);\n return this;\n }\n\n private notify() {\n if (isFilled(this.theValue) && this.theOwner) {\n this.theOwner.give(this.theValue);\n }\n return this;\n }\n}\n","import { InformationType, Lazy } from \"../base\";\n\n/**\n * Lazy with applied function to its results\n */\nexport class LazyApplied<T> extends Lazy<T> {\n public constructor(\n private baseLazy: Lazy,\n private applier: (i: InformationType) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]): InformationType<T> {\n return this.applier(this.baseLazy.get(...args));\n }\n}\n","import { Lazy } from \"../base\";\n\n/**\n * Lazy instance from class constructor\n */\nexport class LazyClass<T> extends Lazy<T> {\n public constructor(constrFn: any) {\n const buildFn = (...args: unknown[]) => new constrFn(...args);\n super(buildFn);\n }\n}\n","import {\n From,\n InformationType,\n Lazy,\n Of,\n OwnerType,\n TheInformation,\n} from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n * https://silentium-lab.github.io/silentium/#/en/information/map\n */\nexport class Map<T, TG> extends TheInformation<TG[]> {\n public constructor(\n private baseSrc: InformationType<T[]>,\n private targetSrc: Lazy<TG>,\n ) {\n super(baseSrc, targetSrc);\n }\n\n public value(o: OwnerType<TG[]>) {\n this.baseSrc.value(\n new From((v) => {\n const infos: InformationType<TG>[] = [];\n v.forEach((val) => {\n let valInfo: InformationType<T> | T = val;\n if (!(valInfo instanceof TheInformation)) {\n valInfo = new Of(valInfo);\n }\n const info = this.targetSrc.get(valInfo);\n infos.push(info);\n });\n const allI = new All(...infos);\n allI.value(o);\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n * https://silentium-lab.github.io/silentium/#/en/information/once\n */\nexport class Once<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T>) {\n super();\n }\n\n public value(o: OwnerType<T>): this {\n let isFilled = false;\n this.baseSrc.value(\n new From((v) => {\n if (!isFilled) {\n isFilled = true;\n o.give(v);\n }\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * A component that takes one value at a time and returns\n * an array of all previous values\n * https://silentium-lab.github.io/silentium/#/en/information/sequence\n */\nexport class Sequence<T> extends TheInformation<T[]> {\n public constructor(private baseSrc: InformationType<T>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T[]>): this {\n const result: T[] = [];\n this.baseSrc.value(\n new From((v) => {\n result.push(v);\n o.give(result);\n }),\n );\n return this;\n }\n}\n","import { isFilled, OwnerPool } from \"../helpers\";\nimport {\n From,\n InformationType,\n OfFunc,\n OwnerType,\n TheInformation,\n} from \"../base\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n * https://silentium-lab.github.io/silentium/#/en/information/pool\n */\nexport class Shared<T> extends TheInformation<T> implements OwnerType<T> {\n private lastValue: T | undefined;\n private ownersPool = new OwnerPool<T>();\n\n public constructor(\n private baseSrc: InformationType<T>,\n private stateless = false,\n ) {\n super(baseSrc);\n this.addDep(this.ownersPool);\n this.baseSrc.value(\n new From((v) => {\n this.ownersPool.owner().give(v);\n this.lastValue = v;\n }),\n );\n }\n\n public value(o: OwnerType<T>): this {\n const i = new OfFunc((g: OwnerType<T>) => {\n if (\n !this.stateless &&\n isFilled(this.lastValue) &&\n !this.ownersPool.has(g)\n ) {\n g.give(this.lastValue);\n }\n this.ownersPool.add(g);\n return () => {\n this.ownersPool.remove(g);\n };\n });\n i.value(o);\n this.addDep(i);\n\n return this;\n }\n\n public pool() {\n return this.ownersPool;\n }\n\n public give(value: T) {\n this.lastValue = value;\n this.ownersPool.owner().give(value);\n return this;\n }\n}\n","import { Shared } from \"../components/Shared\";\nimport { OwnerType, SourceType, TheInformation } from \"../base\";\n\nexport class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {\n private sharedSrc: Shared<T>;\n\n public constructor(baseSrc: SourceType<T>, stateless = false) {\n const sharedSrc = new Shared(baseSrc, stateless);\n super(sharedSrc);\n this.sharedSrc = sharedSrc;\n }\n\n public value(o: OwnerType<T>): this {\n this.sharedSrc.value(o);\n return this;\n }\n\n public give(value: T): this {\n this.sharedSrc.give(value);\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that receives a data array and yields values one by one\n * https://silentium-lab.github.io/silentium/#/en/information/stream\n */\nexport class Stream<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T[]>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n v.forEach((cv) => {\n o.give(cv);\n });\n }),\n );\n return this;\n }\n}\n"],"names":["__publicField"],"mappings":";;;;;AAAA,MAAM,aAAA,GAAgB,CAAC,GAAqC,KAAA;AAC1D,EAAA,OAAO,OAAO,GAAA,KAAQ,QAAY,IAAA,GAAA,KAAQ,QAAQ,SAAa,IAAA,GAAA;AACjE,CAAA;AAKO,MAAM,WAAY,CAAA;AAAA,EAEhB,eAAe,IAAa,EAAA;AADnC,IAAQA,eAAA,CAAA,IAAA,EAAA,SAAA,CAAA;AAEN,IAAK,IAAA,CAAA,OAAA,GAAU,QAAQ,EAAC;AAAA;AAC1B,EAEO,OAAU,GAAA;AACf,IAAK,IAAA,CAAA,OAAA,EAAS,OAAQ,CAAA,CAAC,GAAQ,KAAA;AAC7B,MAAI,IAAA,aAAA,CAAc,GAAG,CAAG,EAAA;AACtB,QAAA,GAAA,CAAI,OAAQ,EAAA;AAAA;AACd,KACD,CAAA;AACD,IAAO,OAAA,IAAA;AAAA;AACT;AAAA;AAAA;AAAA,EAKO,OAAO,G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,EAGtE,WAAA,CAAY,OAAwB,EAAA,SAAA,GAAY,KAAO,EAAA;AAC5D,IAAA,MAAM,SAAY,GAAA,IAAI,MAAO,CAAA,OAAA,EAAS,SAAS,CAAA;AAC/C,IAAA,KAAA,CAAM,SAAS,CAAA;AAJjB,IAAQ,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA;AAKN,IAAA,IAAA,CAAK,SAAY,GAAA,SAAA;AAAA;AACnB,EAEO,MAAM,CAAuB,EAAA;AAClC,IAAK,IAAA,CAAA,SAAA,CAAU,MAAM,CAAC,CAAA;AACtB,IAAO,OAAA,IAAA;AAAA;AACT,EAEO,KAAK,KAAgB,EAAA;AAC1B,IAAK,IAAA,CAAA,SAAA,CAAU,KAAK,KAAK,CAAA;AACzB,IAAO,OAAA,IAAA;AAAA;AAEX;;ACfO,MAAM,eAAkB,cAAkB,CAAA;AAAA,EACxC,YAAoB,OAA+B,EAAA;AACxD,IAAA,KAAA,CAAM,OAAO,CAAA;AADY,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA;AAE3B,EAEO,MAAM,CAAuB,EAAA;AAClC,IAAA,IAAA,CAAK,OAAQ,CAAA,KAAA;AAAA,MACX,IAAI,IAAK,CAAA,CAAC,CAAM,KAAA;AACd,QAAE,CAAA,CAAA,OAAA,CAAQ,CAAC,EAAO,KAAA;AAChB,UAAA,CAAA,CAAE,KAAK,EAAE,CAAA;AAAA,SACV,CAAA;AAAA,OACF;AAAA,KACH;AACA,IAAO,OAAA,IAAA;AAAA;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"silentium.cjs","sources":["../src/base/Destroyable.ts","../src/base/DestroyFunc.ts","../src/base/TheOwner.ts","../src/base/From.ts","../src/base/TheInformation.ts","../src/helpers/isFilled.ts","../src/helpers/OwnerPool.ts","../src/base/Of.ts","../src/base/Lazy.ts","../src/base/OfFunc.ts","../src/base/Void.ts","../src/base/On.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/Chain.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromCallback.ts","../src/components/FromEvent.ts","../src/components/FromPromise.ts","../src/components/Late.ts","../src/components/LazyApplied.ts","../src/components/LazyClass.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Shared.ts","../src/components/SharedSource.ts","../src/components/Stream.ts"],"sourcesContent":["const isDestroyable = (dep: unknown): dep is Destroyable => {\n return typeof dep === \"object\" && dep !== null && \"destroy\" in dep;\n};\n\n/**\n * Representation of Destroyable object\n */\nexport class Destroyable {\n private theDeps: any[];\n public constructor(...deps: any[]) {\n this.theDeps = deps ?? [];\n }\n\n public destroy() {\n this.theDeps?.forEach((dep) => {\n if (isDestroyable(dep)) {\n dep.destroy();\n }\n });\n return this;\n }\n\n /**\n * Add dependency what can be destroyed\n */\n public addDep(dep: any) {\n this.theDeps?.push(dep);\n return this;\n }\n\n public dep(dep: any) {\n this.addDep(dep);\n return dep;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\n\n/**\n * Representation of destructor function as object\n */\nexport class DestroyFunc extends Destroyable {\n public constructor(private destructor: () => void) {\n super();\n }\n\n public destroy(): this {\n this.destructor();\n return this;\n }\n}\n","export interface OwnerType<T = unknown> {\n give(value: T): this;\n}\n\n/**\n * Representation of Information Owner\n */\nexport abstract class TheOwner<T = unknown> implements OwnerType<T> {\n public abstract give(value: T): this;\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Owner from function\n */\nexport class From<T = unknown> extends TheOwner<T> {\n public constructor(private fn: (value: T) => void) {\n super();\n }\n\n public give(value: T): this {\n this.fn(value);\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { OwnerType } from \"./TheOwner\";\n\nexport interface InformationType<T = unknown> {\n value(o: OwnerType<T>): this;\n}\n\nexport type MaybeInformationType<T = unknown> = InformationType<T> | T;\n\n/**\n * Representation of Information\n */\nexport abstract class TheInformation<T = unknown>\n extends Destroyable\n implements InformationType<T>\n{\n public abstract value(o: OwnerType<T>): this;\n}\n\nexport class MbInfo<T> extends TheInformation<T> {\n private info: InformationType<T>;\n\n public constructor(theInfo: MaybeInformationType<T>) {\n const info =\n typeof theInfo === \"object\" &&\n theInfo !== null &&\n \"value\" in theInfo &&\n typeof theInfo.value === \"function\"\n ? theInfo\n : new Of(theInfo);\n super(info);\n this.info = info;\n }\n\n public value(o: OwnerType<T>): this {\n this.info.value(o);\n return this;\n }\n}\n","export const isFilled = <T>(value?: T): value is T => {\n return value !== undefined && value !== null;\n};\n","import { From, OwnerType } from \"../base\";\n\n/**\n * Helps maintain an owner list allowing different\n * owners to get information from a common source\n * https://silentium-lab.github.io/silentium/#/en/utils/owner-pool\n */\nexport class OwnerPool<T> {\n private owners: Set<OwnerType<T>>;\n private innerOwner: OwnerType<T>;\n\n public constructor() {\n this.owners = new Set<OwnerType<T>>();\n this.innerOwner = new From((v) => {\n this.owners.forEach((g) => {\n g.give(v);\n });\n });\n }\n\n public owner() {\n return this.innerOwner;\n }\n\n public size(): number {\n return this.owners.size;\n }\n\n public has(owner: OwnerType<T>): boolean {\n return this.owners.has(owner);\n }\n\n public add(owner: OwnerType<T>) {\n this.owners.add(owner);\n return this;\n }\n\n public remove(g: OwnerType<T>) {\n this.owners.delete(g);\n return this;\n }\n\n public destroy() {\n this.owners.forEach((g) => {\n this.remove(g);\n });\n return this;\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * Information from primitive value\n */\nexport class Of<T> extends TheInformation<T> {\n public constructor(private theValue: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (isFilled(this.theValue)) {\n o.give(this.theValue);\n }\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { InformationType } from \"./TheInformation\";\n\n/**\n * Ability to create information after some event\n */\nexport class Lazy<T = unknown> extends Destroyable {\n public constructor(\n protected buildFn?: (...args: InformationType[]) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]) {\n args.forEach((dep) => {\n this.addDep(dep);\n });\n return this.buildFn?.(...args) ?? (new Of(null) as InformationType<T>);\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\n\ntype DestructorFnType = () => void;\n\n/**\n * Information of function\n */\nexport class OfFunc<T> extends TheInformation<T> {\n private mbDestructor?: DestructorFnType | void;\n\n public constructor(\n private valueFn: (o: OwnerType<T>) => DestructorFnType | undefined | void,\n ) {\n super(valueFn);\n }\n\n public value(o: OwnerType<T>): this {\n this.mbDestructor = this.valueFn(o);\n return this;\n }\n\n public destroy(): this {\n super.destroy();\n this.mbDestructor?.();\n return this;\n }\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Silent owner\n */\nexport class Void extends TheOwner {\n public give(): this {\n return this;\n }\n}\n","import { Destroyable } from \"../base/Destroyable\";\nimport { From } from \"../base/From\";\nimport { InformationType } from \"../base/TheInformation\";\nimport { Void } from \"../base/Void\";\n\n/**\n * Run information with functional owner if needed\n */\nexport class On<T = unknown> extends Destroyable {\n public constructor(src: InformationType<T>, fn?: (value: T) => void) {\n super(src, fn);\n src.value(fn ? new From(fn) : new Void());\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\ntype ExtractTypeS<T> = T extends InformationType<infer U> ? U : never;\n\nexport type ExtractTypesFromArrayS<T extends InformationType<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\n/**\n * Combines multiple information sources into a single unified source\n * represented as an array containing values from all sources\n * https://silentium-lab.github.io/silentium/#/en/information/all\n */\nexport class All<const T extends InformationType[]> extends TheInformation<\n ExtractTypesFromArrayS<T>\n> {\n private keysKnown: Set<string>;\n private keysFilled = new Set();\n private infos: T;\n\n public constructor(...theInfos: T) {\n super(theInfos);\n this.infos = theInfos;\n this.keysKnown = new Set<string>(Object.keys(theInfos));\n }\n\n public value(o: OwnerType<ExtractTypesFromArrayS<T>>): this {\n const result: Record<string, unknown> = {};\n\n Object.entries(this.infos).forEach(([key, info]) => {\n this.keysKnown.add(key);\n info.value(\n new From((v) => {\n this.keysFilled.add(key);\n result[key] = v;\n if (this.isAllFilled()) {\n o.give(Object.values(result) as ExtractTypesFromArrayS<T>);\n }\n }),\n );\n });\n return this;\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * From a set of information sources we get\n * a common response from any source for a single owner\n * https://silentium-lab.github.io/silentium/#/en/information/any\n */\nexport class Any<T> extends TheInformation<T> {\n private infos: InformationType<T>[];\n\n public constructor(...theInfos: InformationType<T>[]) {\n super(theInfos);\n this.infos = theInfos;\n }\n\n public value(o: OwnerType<T>): this {\n this.infos.forEach((info) => {\n info.value(o);\n });\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which the function was applied to change the value\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Applied<T, R> extends TheInformation<R> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (v: T) => R,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<R>): this {\n this.baseSrc.value(\n new From((v) => {\n o.give(this.applier(v));\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends any[]> = T extends [...infer U, infer L] ? L : never;\n\n/**\n * The set of information sources forms a sequential chain where each source provides\n * an answer. The final answer will be the output result. If any source in the chain\n * provides a new answer, the component's overall response will be repeated.\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Chain<T extends InformationType[]> extends TheInformation<\n Last<T>\n> {\n private theInfos: T;\n\n public constructor(...infos: T) {\n super(infos);\n this.theInfos = infos;\n }\n\n public value(o: OwnerType<Last<T>>) {\n let lastValue: Last<T> | undefined;\n\n const handleI = (index: number) => {\n const info = this.theInfos[index] as TheInformation<Last<T>>;\n const nextI = this.theInfos[index + 1] as\n | TheInformation<Last<T>>\n | undefined;\n\n info.value(\n new From((v) => {\n if (!nextI) {\n lastValue = v;\n }\n\n if (lastValue) {\n o.give(lastValue);\n }\n\n if (nextI && !lastValue) {\n handleI(index + 1);\n }\n }),\n );\n };\n\n handleI(0);\n\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which a function is applied in order\n * to control the value passing process\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class ExecutorApplied<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (executor: (v: T) => void) => (v: T) => void,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From(\n this.applier((v) => {\n o.give(v);\n }),\n ),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information whose value is being validated\n * via a predicate; if the predicate returns true, the value\n * can be passed to the output\n * https://silentium-lab.github.io/silentium/#/en/information/filtered\n */\nexport class Filtered<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private predicate: (v: T) => boolean,\n private defaultValue?: T,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n if (this.predicate(v)) {\n o.give(v);\n } else if (this.defaultValue !== undefined) {\n o.give(this.defaultValue);\n }\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * When receiving a reference to a function expecting a callback, the component\n * creates its own callback, and the data received in this callback\n * will become the value of the information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-callback\n */\nexport class FromCallback<T> extends TheInformation<T> {\n private theArgs: unknown[];\n\n public constructor(\n private waitForCb: (cb: (v: T) => any, ...args: unknown[]) => unknown,\n ...args: unknown[]\n ) {\n super(waitForCb);\n this.theArgs = args;\n }\n\n public value(o: OwnerType<T>): this {\n this.waitForCb(\n (v) => {\n o.give(v);\n },\n ...this.theArgs,\n );\n return this;\n }\n}\n","import { DestroyFunc } from \"../base/DestroyFunc\";\nimport { From, InformationType, Of, OwnerType, TheInformation } from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * A component that receives data from an event and\n * presents it as an information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-event\n */\nexport class FromEvent<T = unknown> extends TheInformation<T> {\n public constructor(\n private emitterSrc: InformationType<any>,\n private eventNameSrc: InformationType<string>,\n private subscribeMethodSrc: InformationType<string>,\n private unsubscribeMethodSrc: InformationType<string> = new Of(\"\"),\n ) {\n super(emitterSrc, eventNameSrc, subscribeMethodSrc, unsubscribeMethodSrc);\n }\n\n public value(o: OwnerType<T>): this {\n const a = new All(\n this.emitterSrc,\n this.eventNameSrc,\n this.subscribeMethodSrc,\n this.unsubscribeMethodSrc,\n );\n const handler = (v: T) => {\n o.give(v);\n };\n a.value(\n new From(([emitter, eventName, subscribe, unsubscribe]) => {\n emitter[subscribe](eventName, handler);\n this.addDep(\n new DestroyFunc(() => {\n emitter[unsubscribe](eventName, handler);\n }),\n );\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that gets a value from a promise and\n * presents it as information\n * https://silentium-lab.github.io/silentium/#/en/information/from-promise\n */\nexport class FromPromise<T> extends TheInformation<T> {\n public constructor(\n private p: Promise<T>,\n private errorOwner?: OwnerType,\n ) {\n super(p);\n }\n\n public value(o: OwnerType<T>): this {\n this.p\n .then((v) => {\n o.give(v);\n })\n .catch((e) => {\n this.errorOwner?.give(e);\n });\n return this;\n }\n}\n","import { From, OwnerType, TheInformation } from \"../base\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport class Late<T> extends TheInformation<T> implements OwnerType<T> {\n private theOwner?: OwnerType<T>;\n private lateOwner = new From((v: T) => {\n this.theValue = v;\n this.notify();\n });\n\n public constructor(private theValue?: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (this.theOwner) {\n throw new Error(\n \"Late component gets new owner, when another was already connected!\",\n );\n }\n this.theOwner = o;\n this.notify();\n return this;\n }\n\n public give(v: T) {\n this.theValue = v;\n this.lateOwner.give(v);\n return this;\n }\n\n private notify() {\n if (isFilled(this.theValue) && this.theOwner) {\n this.theOwner.give(this.theValue);\n }\n return this;\n }\n}\n","import { InformationType, Lazy } from \"../base\";\n\n/**\n * Lazy with applied function to its results\n */\nexport class LazyApplied<T> extends Lazy<T> {\n public constructor(\n private baseLazy: Lazy,\n private applier: (i: InformationType) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]): InformationType<T> {\n return this.applier(this.baseLazy.get(...args));\n }\n}\n","import { Lazy } from \"../base\";\n\n/**\n * Lazy instance from class constructor\n */\nexport class LazyClass<T> extends Lazy<T> {\n public constructor(constrFn: any) {\n const buildFn = (...args: unknown[]) => new constrFn(...args);\n super(buildFn);\n }\n}\n","import {\n From,\n InformationType,\n Lazy,\n Of,\n OwnerType,\n TheInformation,\n} from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n * https://silentium-lab.github.io/silentium/#/en/information/map\n */\nexport class Map<T, TG> extends TheInformation<TG[]> {\n public constructor(\n private baseSrc: InformationType<T[]>,\n private targetSrc: Lazy<TG>,\n ) {\n super(baseSrc, targetSrc);\n }\n\n public value(o: OwnerType<TG[]>) {\n this.baseSrc.value(\n new From((v) => {\n const infos: InformationType<TG>[] = [];\n v.forEach((val) => {\n let valInfo: InformationType<T> | T = val;\n if (!(valInfo instanceof TheInformation)) {\n valInfo = new Of(valInfo);\n }\n const info = this.targetSrc.get(valInfo);\n infos.push(info);\n });\n const allI = new All(...infos);\n allI.value(o);\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n * https://silentium-lab.github.io/silentium/#/en/information/once\n */\nexport class Once<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T>) {\n super();\n }\n\n public value(o: OwnerType<T>): this {\n let isFilled = false;\n this.baseSrc.value(\n new From((v) => {\n if (!isFilled) {\n isFilled = true;\n o.give(v);\n }\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * A component that takes one value at a time and returns\n * an array of all previous values\n * https://silentium-lab.github.io/silentium/#/en/information/sequence\n */\nexport class Sequence<T> extends TheInformation<T[]> {\n public constructor(private baseSrc: InformationType<T>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T[]>): this {\n const result: T[] = [];\n this.baseSrc.value(\n new From((v) => {\n result.push(v);\n o.give(result);\n }),\n );\n return this;\n }\n}\n","import { isFilled, OwnerPool } from \"../helpers\";\nimport {\n From,\n InformationType,\n OfFunc,\n OwnerType,\n TheInformation,\n} from \"../base\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n * https://silentium-lab.github.io/silentium/#/en/information/pool\n */\nexport class Shared<T> extends TheInformation<T> implements OwnerType<T> {\n private lastValue: T | undefined;\n private ownersPool = new OwnerPool<T>();\n\n public constructor(\n private baseSrc: InformationType<T>,\n private stateless = false,\n ) {\n super(baseSrc);\n this.addDep(this.ownersPool);\n this.baseSrc.value(\n new From((v) => {\n this.ownersPool.owner().give(v);\n this.lastValue = v;\n }),\n );\n }\n\n public value(o: OwnerType<T>): this {\n const i = new OfFunc((g: OwnerType<T>) => {\n if (\n !this.stateless &&\n isFilled(this.lastValue) &&\n !this.ownersPool.has(g)\n ) {\n g.give(this.lastValue);\n }\n this.ownersPool.add(g);\n return () => {\n this.ownersPool.remove(g);\n };\n });\n i.value(o);\n this.addDep(i);\n\n return this;\n }\n\n public pool() {\n return this.ownersPool;\n }\n\n public give(value: T) {\n this.lastValue = value;\n this.ownersPool.owner().give(value);\n return this;\n }\n}\n","import { Shared } from \"../components/Shared\";\nimport { OwnerType, SourceType, TheInformation } from \"../base\";\n\nexport class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {\n private sharedSrc: Shared<T>;\n\n public constructor(\n private baseSrc: SourceType<T>,\n stateless = false,\n ) {\n const sharedSrc = new Shared(baseSrc, stateless);\n super(sharedSrc);\n this.sharedSrc = sharedSrc;\n }\n\n public value(o: OwnerType<T>): this {\n this.sharedSrc.value(o);\n return this;\n }\n\n public give(value: T): this {\n this.baseSrc.give(value);\n this.sharedSrc.give(value);\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that receives a data array and yields values one by one\n * https://silentium-lab.github.io/silentium/#/en/information/stream\n */\nexport class Stream<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T[]>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n v.forEach((cv) => {\n o.give(cv);\n });\n }),\n );\n return this;\n }\n}\n"],"names":["__publicField"],"mappings":";;;;;AAAA,MAAM,aAAA,GAAgB,CAAC,GAAqC,KAAA;AAC1D,EAAA,OAAO,OAAO,GAAA,KAAQ,QAAY,IAAA,GAAA,KAAQ,QAAQ,SAAa,IAAA,GAAA;AACjE,CAAA;AAKO,MAAM,WAAY,CAAA;AAAA,EAEhB,eAAe,IAAa,EAAA;AADnC,IAAQA,eAAA,CAAA,IAAA,EAAA,SAAA,CAAA;AAEN,IAAK,IAAA,CAAA,OAAA,GAAU,QAAQ,EAAC;AAAA;AAC1B,EAEO,OAAU,GAAA;AACf,IAAK,IAAA,CAAA,OAAA,EAAS,OAAQ,CAAA,CAAC,GAAQ,KAAA;AAC7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;;;;;;;;;;;"}
@@ -324,6 +324,7 @@ declare class Shared<T> extends TheInformation<T> implements OwnerType<T> {
324
324
  }
325
325
 
326
326
  declare class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {
327
+ private baseSrc;
327
328
  private sharedSrc;
328
329
  constructor(baseSrc: SourceType<T>, stateless?: boolean);
329
330
  value(o: OwnerType<T>): this;
package/dist/silentium.js CHANGED
@@ -547,6 +547,7 @@ class SharedSource extends TheInformation {
547
547
  constructor(baseSrc, stateless = false) {
548
548
  const sharedSrc = new Shared(baseSrc, stateless);
549
549
  super(sharedSrc);
550
+ this.baseSrc = baseSrc;
550
551
  __publicField(this, "sharedSrc");
551
552
  this.sharedSrc = sharedSrc;
552
553
  }
@@ -555,6 +556,7 @@ class SharedSource extends TheInformation {
555
556
  return this;
556
557
  }
557
558
  give(value) {
559
+ this.baseSrc.give(value);
558
560
  this.sharedSrc.give(value);
559
561
  return this;
560
562
  }
@@ -1 +1 @@
1
- {"version":3,"file":"silentium.js","sources":["../src/base/Destroyable.ts","../src/base/DestroyFunc.ts","../src/base/TheOwner.ts","../src/base/From.ts","../src/base/TheInformation.ts","../src/helpers/isFilled.ts","../src/helpers/OwnerPool.ts","../src/base/Of.ts","../src/base/Lazy.ts","../src/base/OfFunc.ts","../src/base/Void.ts","../src/base/On.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/Chain.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromCallback.ts","../src/components/FromEvent.ts","../src/components/FromPromise.ts","../src/components/Late.ts","../src/components/LazyApplied.ts","../src/components/LazyClass.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Shared.ts","../src/components/SharedSource.ts","../src/components/Stream.ts"],"sourcesContent":["const isDestroyable = (dep: unknown): dep is Destroyable => {\n return typeof dep === \"object\" && dep !== null && \"destroy\" in dep;\n};\n\n/**\n * Representation of Destroyable object\n */\nexport class Destroyable {\n private theDeps: any[];\n public constructor(...deps: any[]) {\n this.theDeps = deps ?? [];\n }\n\n public destroy() {\n this.theDeps?.forEach((dep) => {\n if (isDestroyable(dep)) {\n dep.destroy();\n }\n });\n return this;\n }\n\n /**\n * Add dependency what can be destroyed\n */\n public addDep(dep: any) {\n this.theDeps?.push(dep);\n return this;\n }\n\n public dep(dep: any) {\n this.addDep(dep);\n return dep;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\n\n/**\n * Representation of destructor function as object\n */\nexport class DestroyFunc extends Destroyable {\n public constructor(private destructor: () => void) {\n super();\n }\n\n public destroy(): this {\n this.destructor();\n return this;\n }\n}\n","export interface OwnerType<T = unknown> {\n give(value: T): this;\n}\n\n/**\n * Representation of Information Owner\n */\nexport abstract class TheOwner<T = unknown> implements OwnerType<T> {\n public abstract give(value: T): this;\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Owner from function\n */\nexport class From<T = unknown> extends TheOwner<T> {\n public constructor(private fn: (value: T) => void) {\n super();\n }\n\n public give(value: T): this {\n this.fn(value);\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { OwnerType } from \"./TheOwner\";\n\nexport interface InformationType<T = unknown> {\n value(o: OwnerType<T>): this;\n}\n\nexport type MaybeInformationType<T = unknown> = InformationType<T> | T;\n\n/**\n * Representation of Information\n */\nexport abstract class TheInformation<T = unknown>\n extends Destroyable\n implements InformationType<T>\n{\n public abstract value(o: OwnerType<T>): this;\n}\n\nexport class MbInfo<T> extends TheInformation<T> {\n private info: InformationType<T>;\n\n public constructor(theInfo: MaybeInformationType<T>) {\n const info =\n typeof theInfo === \"object\" &&\n theInfo !== null &&\n \"value\" in theInfo &&\n typeof theInfo.value === \"function\"\n ? theInfo\n : new Of(theInfo);\n super(info);\n this.info = info;\n }\n\n public value(o: OwnerType<T>): this {\n this.info.value(o);\n return this;\n }\n}\n","export const isFilled = <T>(value?: T): value is T => {\n return value !== undefined && value !== null;\n};\n","import { From, OwnerType } from \"../base\";\n\n/**\n * Helps maintain an owner list allowing different\n * owners to get information from a common source\n * https://silentium-lab.github.io/silentium/#/en/utils/owner-pool\n */\nexport class OwnerPool<T> {\n private owners: Set<OwnerType<T>>;\n private innerOwner: OwnerType<T>;\n\n public constructor() {\n this.owners = new Set<OwnerType<T>>();\n this.innerOwner = new From((v) => {\n this.owners.forEach((g) => {\n g.give(v);\n });\n });\n }\n\n public owner() {\n return this.innerOwner;\n }\n\n public size(): number {\n return this.owners.size;\n }\n\n public has(owner: OwnerType<T>): boolean {\n return this.owners.has(owner);\n }\n\n public add(owner: OwnerType<T>) {\n this.owners.add(owner);\n return this;\n }\n\n public remove(g: OwnerType<T>) {\n this.owners.delete(g);\n return this;\n }\n\n public destroy() {\n this.owners.forEach((g) => {\n this.remove(g);\n });\n return this;\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * Information from primitive value\n */\nexport class Of<T> extends TheInformation<T> {\n public constructor(private theValue: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (isFilled(this.theValue)) {\n o.give(this.theValue);\n }\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { InformationType } from \"./TheInformation\";\n\n/**\n * Ability to create information after some event\n */\nexport class Lazy<T = unknown> extends Destroyable {\n public constructor(\n protected buildFn?: (...args: InformationType[]) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]) {\n args.forEach((dep) => {\n this.addDep(dep);\n });\n return this.buildFn?.(...args) ?? (new Of(null) as InformationType<T>);\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\n\ntype DestructorFnType = () => void;\n\n/**\n * Information of function\n */\nexport class OfFunc<T> extends TheInformation<T> {\n private mbDestructor?: DestructorFnType | void;\n\n public constructor(\n private valueFn: (o: OwnerType<T>) => DestructorFnType | undefined | void,\n ) {\n super(valueFn);\n }\n\n public value(o: OwnerType<T>): this {\n this.mbDestructor = this.valueFn(o);\n return this;\n }\n\n public destroy(): this {\n super.destroy();\n this.mbDestructor?.();\n return this;\n }\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Silent owner\n */\nexport class Void extends TheOwner {\n public give(): this {\n return this;\n }\n}\n","import { Destroyable } from \"../base/Destroyable\";\nimport { From } from \"../base/From\";\nimport { InformationType } from \"../base/TheInformation\";\nimport { Void } from \"../base/Void\";\n\n/**\n * Run information with functional owner if needed\n */\nexport class On<T = unknown> extends Destroyable {\n public constructor(src: InformationType<T>, fn?: (value: T) => void) {\n super(src, fn);\n src.value(fn ? new From(fn) : new Void());\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\ntype ExtractTypeS<T> = T extends InformationType<infer U> ? U : never;\n\nexport type ExtractTypesFromArrayS<T extends InformationType<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\n/**\n * Combines multiple information sources into a single unified source\n * represented as an array containing values from all sources\n * https://silentium-lab.github.io/silentium/#/en/information/all\n */\nexport class All<const T extends InformationType[]> extends TheInformation<\n ExtractTypesFromArrayS<T>\n> {\n private keysKnown: Set<string>;\n private keysFilled = new Set();\n private infos: T;\n\n public constructor(...theInfos: T) {\n super(theInfos);\n this.infos = theInfos;\n this.keysKnown = new Set<string>(Object.keys(theInfos));\n }\n\n public value(o: OwnerType<ExtractTypesFromArrayS<T>>): this {\n const result: Record<string, unknown> = {};\n\n Object.entries(this.infos).forEach(([key, info]) => {\n this.keysKnown.add(key);\n info.value(\n new From((v) => {\n this.keysFilled.add(key);\n result[key] = v;\n if (this.isAllFilled()) {\n o.give(Object.values(result) as ExtractTypesFromArrayS<T>);\n }\n }),\n );\n });\n return this;\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * From a set of information sources we get\n * a common response from any source for a single owner\n * https://silentium-lab.github.io/silentium/#/en/information/any\n */\nexport class Any<T> extends TheInformation<T> {\n private infos: InformationType<T>[];\n\n public constructor(...theInfos: InformationType<T>[]) {\n super(theInfos);\n this.infos = theInfos;\n }\n\n public value(o: OwnerType<T>): this {\n this.infos.forEach((info) => {\n info.value(o);\n });\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which the function was applied to change the value\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Applied<T, R> extends TheInformation<R> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (v: T) => R,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<R>): this {\n this.baseSrc.value(\n new From((v) => {\n o.give(this.applier(v));\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends any[]> = T extends [...infer U, infer L] ? L : never;\n\n/**\n * The set of information sources forms a sequential chain where each source provides\n * an answer. The final answer will be the output result. If any source in the chain\n * provides a new answer, the component's overall response will be repeated.\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Chain<T extends InformationType[]> extends TheInformation<\n Last<T>\n> {\n private theInfos: T;\n\n public constructor(...infos: T) {\n super(infos);\n this.theInfos = infos;\n }\n\n public value(o: OwnerType<Last<T>>) {\n let lastValue: Last<T> | undefined;\n\n const handleI = (index: number) => {\n const info = this.theInfos[index] as TheInformation<Last<T>>;\n const nextI = this.theInfos[index + 1] as\n | TheInformation<Last<T>>\n | undefined;\n\n info.value(\n new From((v) => {\n if (!nextI) {\n lastValue = v;\n }\n\n if (lastValue) {\n o.give(lastValue);\n }\n\n if (nextI && !lastValue) {\n handleI(index + 1);\n }\n }),\n );\n };\n\n handleI(0);\n\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which a function is applied in order\n * to control the value passing process\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class ExecutorApplied<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (executor: (v: T) => void) => (v: T) => void,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From(\n this.applier((v) => {\n o.give(v);\n }),\n ),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information whose value is being validated\n * via a predicate; if the predicate returns true, the value\n * can be passed to the output\n * https://silentium-lab.github.io/silentium/#/en/information/filtered\n */\nexport class Filtered<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private predicate: (v: T) => boolean,\n private defaultValue?: T,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n if (this.predicate(v)) {\n o.give(v);\n } else if (this.defaultValue !== undefined) {\n o.give(this.defaultValue);\n }\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * When receiving a reference to a function expecting a callback, the component\n * creates its own callback, and the data received in this callback\n * will become the value of the information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-callback\n */\nexport class FromCallback<T> extends TheInformation<T> {\n private theArgs: unknown[];\n\n public constructor(\n private waitForCb: (cb: (v: T) => any, ...args: unknown[]) => unknown,\n ...args: unknown[]\n ) {\n super(waitForCb);\n this.theArgs = args;\n }\n\n public value(o: OwnerType<T>): this {\n this.waitForCb(\n (v) => {\n o.give(v);\n },\n ...this.theArgs,\n );\n return this;\n }\n}\n","import { DestroyFunc } from \"../base/DestroyFunc\";\nimport { From, InformationType, Of, OwnerType, TheInformation } from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * A component that receives data from an event and\n * presents it as an information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-event\n */\nexport class FromEvent<T = unknown> extends TheInformation<T> {\n public constructor(\n private emitterSrc: InformationType<any>,\n private eventNameSrc: InformationType<string>,\n private subscribeMethodSrc: InformationType<string>,\n private unsubscribeMethodSrc: InformationType<string> = new Of(\"\"),\n ) {\n super(emitterSrc, eventNameSrc, subscribeMethodSrc, unsubscribeMethodSrc);\n }\n\n public value(o: OwnerType<T>): this {\n const a = new All(\n this.emitterSrc,\n this.eventNameSrc,\n this.subscribeMethodSrc,\n this.unsubscribeMethodSrc,\n );\n const handler = (v: T) => {\n o.give(v);\n };\n a.value(\n new From(([emitter, eventName, subscribe, unsubscribe]) => {\n emitter[subscribe](eventName, handler);\n this.addDep(\n new DestroyFunc(() => {\n emitter[unsubscribe](eventName, handler);\n }),\n );\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that gets a value from a promise and\n * presents it as information\n * https://silentium-lab.github.io/silentium/#/en/information/from-promise\n */\nexport class FromPromise<T> extends TheInformation<T> {\n public constructor(\n private p: Promise<T>,\n private errorOwner?: OwnerType,\n ) {\n super(p);\n }\n\n public value(o: OwnerType<T>): this {\n this.p\n .then((v) => {\n o.give(v);\n })\n .catch((e) => {\n this.errorOwner?.give(e);\n });\n return this;\n }\n}\n","import { From, OwnerType, TheInformation } from \"../base\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport class Late<T> extends TheInformation<T> implements OwnerType<T> {\n private theOwner?: OwnerType<T>;\n private lateOwner = new From((v: T) => {\n this.theValue = v;\n this.notify();\n });\n\n public constructor(private theValue?: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (this.theOwner) {\n throw new Error(\n \"Late component gets new owner, when another was already connected!\",\n );\n }\n this.theOwner = o;\n this.notify();\n return this;\n }\n\n public give(v: T) {\n this.theValue = v;\n this.lateOwner.give(v);\n return this;\n }\n\n private notify() {\n if (isFilled(this.theValue) && this.theOwner) {\n this.theOwner.give(this.theValue);\n }\n return this;\n }\n}\n","import { InformationType, Lazy } from \"../base\";\n\n/**\n * Lazy with applied function to its results\n */\nexport class LazyApplied<T> extends Lazy<T> {\n public constructor(\n private baseLazy: Lazy,\n private applier: (i: InformationType) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]): InformationType<T> {\n return this.applier(this.baseLazy.get(...args));\n }\n}\n","import { Lazy } from \"../base\";\n\n/**\n * Lazy instance from class constructor\n */\nexport class LazyClass<T> extends Lazy<T> {\n public constructor(constrFn: any) {\n const buildFn = (...args: unknown[]) => new constrFn(...args);\n super(buildFn);\n }\n}\n","import {\n From,\n InformationType,\n Lazy,\n Of,\n OwnerType,\n TheInformation,\n} from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n * https://silentium-lab.github.io/silentium/#/en/information/map\n */\nexport class Map<T, TG> extends TheInformation<TG[]> {\n public constructor(\n private baseSrc: InformationType<T[]>,\n private targetSrc: Lazy<TG>,\n ) {\n super(baseSrc, targetSrc);\n }\n\n public value(o: OwnerType<TG[]>) {\n this.baseSrc.value(\n new From((v) => {\n const infos: InformationType<TG>[] = [];\n v.forEach((val) => {\n let valInfo: InformationType<T> | T = val;\n if (!(valInfo instanceof TheInformation)) {\n valInfo = new Of(valInfo);\n }\n const info = this.targetSrc.get(valInfo);\n infos.push(info);\n });\n const allI = new All(...infos);\n allI.value(o);\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n * https://silentium-lab.github.io/silentium/#/en/information/once\n */\nexport class Once<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T>) {\n super();\n }\n\n public value(o: OwnerType<T>): this {\n let isFilled = false;\n this.baseSrc.value(\n new From((v) => {\n if (!isFilled) {\n isFilled = true;\n o.give(v);\n }\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * A component that takes one value at a time and returns\n * an array of all previous values\n * https://silentium-lab.github.io/silentium/#/en/information/sequence\n */\nexport class Sequence<T> extends TheInformation<T[]> {\n public constructor(private baseSrc: InformationType<T>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T[]>): this {\n const result: T[] = [];\n this.baseSrc.value(\n new From((v) => {\n result.push(v);\n o.give(result);\n }),\n );\n return this;\n }\n}\n","import { isFilled, OwnerPool } from \"../helpers\";\nimport {\n From,\n InformationType,\n OfFunc,\n OwnerType,\n TheInformation,\n} from \"../base\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n * https://silentium-lab.github.io/silentium/#/en/information/pool\n */\nexport class Shared<T> extends TheInformation<T> implements OwnerType<T> {\n private lastValue: T | undefined;\n private ownersPool = new OwnerPool<T>();\n\n public constructor(\n private baseSrc: InformationType<T>,\n private stateless = false,\n ) {\n super(baseSrc);\n this.addDep(this.ownersPool);\n this.baseSrc.value(\n new From((v) => {\n this.ownersPool.owner().give(v);\n this.lastValue = v;\n }),\n );\n }\n\n public value(o: OwnerType<T>): this {\n const i = new OfFunc((g: OwnerType<T>) => {\n if (\n !this.stateless &&\n isFilled(this.lastValue) &&\n !this.ownersPool.has(g)\n ) {\n g.give(this.lastValue);\n }\n this.ownersPool.add(g);\n return () => {\n this.ownersPool.remove(g);\n };\n });\n i.value(o);\n this.addDep(i);\n\n return this;\n }\n\n public pool() {\n return this.ownersPool;\n }\n\n public give(value: T) {\n this.lastValue = value;\n this.ownersPool.owner().give(value);\n return this;\n }\n}\n","import { Shared } from \"../components/Shared\";\nimport { OwnerType, SourceType, TheInformation } from \"../base\";\n\nexport class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {\n private sharedSrc: Shared<T>;\n\n public constructor(baseSrc: SourceType<T>, stateless = false) {\n const sharedSrc = new Shared(baseSrc, stateless);\n super(sharedSrc);\n this.sharedSrc = sharedSrc;\n }\n\n public value(o: OwnerType<T>): this {\n this.sharedSrc.value(o);\n return this;\n }\n\n public give(value: T): this {\n this.sharedSrc.give(value);\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that receives a data array and yields values one by one\n * https://silentium-lab.github.io/silentium/#/en/information/stream\n */\nexport class Stream<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T[]>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n v.forEach((cv) => {\n o.give(cv);\n });\n }),\n );\n return this;\n }\n}\n"],"names":["__publicField"],"mappings":";;;AAAA,MAAM,aAAA,GAAgB,CAAC,GAAqC,KAAA;AAC1D,EAAA,OAAO,OAAO,GAAA,KAAQ,QAAY,IAAA,GAAA,KAAQ,QAAQ,SAAa,IAAA,GAAA;AACjE,CAAA;AAKO,MAAM,WAAY,CAAA;AAAA,EAEhB,eAAe,IAAa,EAAA;AADnC,IAAQA,eAAA,CAAA,IAAA,EAAA,SAAA,CAAA;AAEN,IAAK,IAAA,CAAA,OAAA,GAAU,QAAQ,EAAC;AAAA;AAC1B,EAEO,OAAU,GAAA;AACf,IAAK,IAAA,CAAA,OAAA,EAAS,OAAQ,CAAA,CAAC,GAAQ,KAAA;AAC7B,MAAI,IAAA,aAAA,CAAc,GAAG,CAAG,EAAA;AACtB,QAAA,GAAA,CAAI,OAAQ,EAAA;AAAA;AACd,KACD,CAAA;AACD,IAAO,OAAA,IAAA;AAAA;AACT;AAAA;AAAA;AAAA,EAKO,OAAO,GAAU,EAAA;AACtB,IAAK,IAAA,CAAA,OAAA,EAAS,KAAK,GAAG,CAAA;AACtB,IAAO,OAAA,IAAA;AAAA;AACT,EAEO,IAAI,GAAU,EAAA;AACnB,IAAA,IAAA,CAAK,OAAO,GAAG,CAAA;AACf,IAAO,OAAA,GAAA;AAAA;AAEX;;AC7BO,MAAM,oBAAoB,WAAY,CAAA;AAAA,EACpC,YAAoB,U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AAA;AAAA;AACnB,EAEO,MAAM,CAAuB,EAAA;AAClC,IAAK,IAAA,CAAA,SAAA,CAAU,MAAM,CAAC,CAAA;AACtB,IAAO,OAAA,IAAA;AAAA;AACT,EAEO,KAAK,KAAgB,EAAA;AAC1B,IAAK,IAAA,CAAA,SAAA,CAAU,KAAK,KAAK,CAAA;AACzB,IAAO,OAAA,IAAA;AAAA;AAEX;;ACfO,MAAM,eAAkB,cAAkB,CAAA;AAAA,EACxC,YAAoB,OAA+B,EAAA;AACxD,IAAA,KAAA,CAAM,OAAO,CAAA;AADY,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA;AAE3B,EAEO,MAAM,CAAuB,EAAA;AAClC,IAAA,IAAA,CAAK,OAAQ,CAAA,KAAA;AAAA,MACX,IAAI,IAAK,CAAA,CAAC,CAAM,KAAA;AACd,QAAE,CAAA,CAAA,OAAA,CAAQ,CAAC,EAAO,KAAA;AAChB,UAAA,CAAA,CAAE,KAAK,EAAE,CAAA;AAAA,SACV,CAAA;AAAA,OACF;AAAA,KACH;AACA,IAAO,OAAA,IAAA;AAAA;AAEX;;;;"}
1
+ {"version":3,"file":"silentium.js","sources":["../src/base/Destroyable.ts","../src/base/DestroyFunc.ts","../src/base/TheOwner.ts","../src/base/From.ts","../src/base/TheInformation.ts","../src/helpers/isFilled.ts","../src/helpers/OwnerPool.ts","../src/base/Of.ts","../src/base/Lazy.ts","../src/base/OfFunc.ts","../src/base/Void.ts","../src/base/On.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/Chain.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromCallback.ts","../src/components/FromEvent.ts","../src/components/FromPromise.ts","../src/components/Late.ts","../src/components/LazyApplied.ts","../src/components/LazyClass.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Shared.ts","../src/components/SharedSource.ts","../src/components/Stream.ts"],"sourcesContent":["const isDestroyable = (dep: unknown): dep is Destroyable => {\n return typeof dep === \"object\" && dep !== null && \"destroy\" in dep;\n};\n\n/**\n * Representation of Destroyable object\n */\nexport class Destroyable {\n private theDeps: any[];\n public constructor(...deps: any[]) {\n this.theDeps = deps ?? [];\n }\n\n public destroy() {\n this.theDeps?.forEach((dep) => {\n if (isDestroyable(dep)) {\n dep.destroy();\n }\n });\n return this;\n }\n\n /**\n * Add dependency what can be destroyed\n */\n public addDep(dep: any) {\n this.theDeps?.push(dep);\n return this;\n }\n\n public dep(dep: any) {\n this.addDep(dep);\n return dep;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\n\n/**\n * Representation of destructor function as object\n */\nexport class DestroyFunc extends Destroyable {\n public constructor(private destructor: () => void) {\n super();\n }\n\n public destroy(): this {\n this.destructor();\n return this;\n }\n}\n","export interface OwnerType<T = unknown> {\n give(value: T): this;\n}\n\n/**\n * Representation of Information Owner\n */\nexport abstract class TheOwner<T = unknown> implements OwnerType<T> {\n public abstract give(value: T): this;\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Owner from function\n */\nexport class From<T = unknown> extends TheOwner<T> {\n public constructor(private fn: (value: T) => void) {\n super();\n }\n\n public give(value: T): this {\n this.fn(value);\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { OwnerType } from \"./TheOwner\";\n\nexport interface InformationType<T = unknown> {\n value(o: OwnerType<T>): this;\n}\n\nexport type MaybeInformationType<T = unknown> = InformationType<T> | T;\n\n/**\n * Representation of Information\n */\nexport abstract class TheInformation<T = unknown>\n extends Destroyable\n implements InformationType<T>\n{\n public abstract value(o: OwnerType<T>): this;\n}\n\nexport class MbInfo<T> extends TheInformation<T> {\n private info: InformationType<T>;\n\n public constructor(theInfo: MaybeInformationType<T>) {\n const info =\n typeof theInfo === \"object\" &&\n theInfo !== null &&\n \"value\" in theInfo &&\n typeof theInfo.value === \"function\"\n ? theInfo\n : new Of(theInfo);\n super(info);\n this.info = info;\n }\n\n public value(o: OwnerType<T>): this {\n this.info.value(o);\n return this;\n }\n}\n","export const isFilled = <T>(value?: T): value is T => {\n return value !== undefined && value !== null;\n};\n","import { From, OwnerType } from \"../base\";\n\n/**\n * Helps maintain an owner list allowing different\n * owners to get information from a common source\n * https://silentium-lab.github.io/silentium/#/en/utils/owner-pool\n */\nexport class OwnerPool<T> {\n private owners: Set<OwnerType<T>>;\n private innerOwner: OwnerType<T>;\n\n public constructor() {\n this.owners = new Set<OwnerType<T>>();\n this.innerOwner = new From((v) => {\n this.owners.forEach((g) => {\n g.give(v);\n });\n });\n }\n\n public owner() {\n return this.innerOwner;\n }\n\n public size(): number {\n return this.owners.size;\n }\n\n public has(owner: OwnerType<T>): boolean {\n return this.owners.has(owner);\n }\n\n public add(owner: OwnerType<T>) {\n this.owners.add(owner);\n return this;\n }\n\n public remove(g: OwnerType<T>) {\n this.owners.delete(g);\n return this;\n }\n\n public destroy() {\n this.owners.forEach((g) => {\n this.remove(g);\n });\n return this;\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * Information from primitive value\n */\nexport class Of<T> extends TheInformation<T> {\n public constructor(private theValue: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (isFilled(this.theValue)) {\n o.give(this.theValue);\n }\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { InformationType } from \"./TheInformation\";\n\n/**\n * Ability to create information after some event\n */\nexport class Lazy<T = unknown> extends Destroyable {\n public constructor(\n protected buildFn?: (...args: InformationType[]) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]) {\n args.forEach((dep) => {\n this.addDep(dep);\n });\n return this.buildFn?.(...args) ?? (new Of(null) as InformationType<T>);\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\n\ntype DestructorFnType = () => void;\n\n/**\n * Information of function\n */\nexport class OfFunc<T> extends TheInformation<T> {\n private mbDestructor?: DestructorFnType | void;\n\n public constructor(\n private valueFn: (o: OwnerType<T>) => DestructorFnType | undefined | void,\n ) {\n super(valueFn);\n }\n\n public value(o: OwnerType<T>): this {\n this.mbDestructor = this.valueFn(o);\n return this;\n }\n\n public destroy(): this {\n super.destroy();\n this.mbDestructor?.();\n return this;\n }\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Silent owner\n */\nexport class Void extends TheOwner {\n public give(): this {\n return this;\n }\n}\n","import { Destroyable } from \"../base/Destroyable\";\nimport { From } from \"../base/From\";\nimport { InformationType } from \"../base/TheInformation\";\nimport { Void } from \"../base/Void\";\n\n/**\n * Run information with functional owner if needed\n */\nexport class On<T = unknown> extends Destroyable {\n public constructor(src: InformationType<T>, fn?: (value: T) => void) {\n super(src, fn);\n src.value(fn ? new From(fn) : new Void());\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\ntype ExtractTypeS<T> = T extends InformationType<infer U> ? U : never;\n\nexport type ExtractTypesFromArrayS<T extends InformationType<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\n/**\n * Combines multiple information sources into a single unified source\n * represented as an array containing values from all sources\n * https://silentium-lab.github.io/silentium/#/en/information/all\n */\nexport class All<const T extends InformationType[]> extends TheInformation<\n ExtractTypesFromArrayS<T>\n> {\n private keysKnown: Set<string>;\n private keysFilled = new Set();\n private infos: T;\n\n public constructor(...theInfos: T) {\n super(theInfos);\n this.infos = theInfos;\n this.keysKnown = new Set<string>(Object.keys(theInfos));\n }\n\n public value(o: OwnerType<ExtractTypesFromArrayS<T>>): this {\n const result: Record<string, unknown> = {};\n\n Object.entries(this.infos).forEach(([key, info]) => {\n this.keysKnown.add(key);\n info.value(\n new From((v) => {\n this.keysFilled.add(key);\n result[key] = v;\n if (this.isAllFilled()) {\n o.give(Object.values(result) as ExtractTypesFromArrayS<T>);\n }\n }),\n );\n });\n return this;\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * From a set of information sources we get\n * a common response from any source for a single owner\n * https://silentium-lab.github.io/silentium/#/en/information/any\n */\nexport class Any<T> extends TheInformation<T> {\n private infos: InformationType<T>[];\n\n public constructor(...theInfos: InformationType<T>[]) {\n super(theInfos);\n this.infos = theInfos;\n }\n\n public value(o: OwnerType<T>): this {\n this.infos.forEach((info) => {\n info.value(o);\n });\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which the function was applied to change the value\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Applied<T, R> extends TheInformation<R> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (v: T) => R,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<R>): this {\n this.baseSrc.value(\n new From((v) => {\n o.give(this.applier(v));\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends any[]> = T extends [...infer U, infer L] ? L : never;\n\n/**\n * The set of information sources forms a sequential chain where each source provides\n * an answer. The final answer will be the output result. If any source in the chain\n * provides a new answer, the component's overall response will be repeated.\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Chain<T extends InformationType[]> extends TheInformation<\n Last<T>\n> {\n private theInfos: T;\n\n public constructor(...infos: T) {\n super(infos);\n this.theInfos = infos;\n }\n\n public value(o: OwnerType<Last<T>>) {\n let lastValue: Last<T> | undefined;\n\n const handleI = (index: number) => {\n const info = this.theInfos[index] as TheInformation<Last<T>>;\n const nextI = this.theInfos[index + 1] as\n | TheInformation<Last<T>>\n | undefined;\n\n info.value(\n new From((v) => {\n if (!nextI) {\n lastValue = v;\n }\n\n if (lastValue) {\n o.give(lastValue);\n }\n\n if (nextI && !lastValue) {\n handleI(index + 1);\n }\n }),\n );\n };\n\n handleI(0);\n\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which a function is applied in order\n * to control the value passing process\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class ExecutorApplied<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (executor: (v: T) => void) => (v: T) => void,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From(\n this.applier((v) => {\n o.give(v);\n }),\n ),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information whose value is being validated\n * via a predicate; if the predicate returns true, the value\n * can be passed to the output\n * https://silentium-lab.github.io/silentium/#/en/information/filtered\n */\nexport class Filtered<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private predicate: (v: T) => boolean,\n private defaultValue?: T,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n if (this.predicate(v)) {\n o.give(v);\n } else if (this.defaultValue !== undefined) {\n o.give(this.defaultValue);\n }\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * When receiving a reference to a function expecting a callback, the component\n * creates its own callback, and the data received in this callback\n * will become the value of the information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-callback\n */\nexport class FromCallback<T> extends TheInformation<T> {\n private theArgs: unknown[];\n\n public constructor(\n private waitForCb: (cb: (v: T) => any, ...args: unknown[]) => unknown,\n ...args: unknown[]\n ) {\n super(waitForCb);\n this.theArgs = args;\n }\n\n public value(o: OwnerType<T>): this {\n this.waitForCb(\n (v) => {\n o.give(v);\n },\n ...this.theArgs,\n );\n return this;\n }\n}\n","import { DestroyFunc } from \"../base/DestroyFunc\";\nimport { From, InformationType, Of, OwnerType, TheInformation } from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * A component that receives data from an event and\n * presents it as an information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-event\n */\nexport class FromEvent<T = unknown> extends TheInformation<T> {\n public constructor(\n private emitterSrc: InformationType<any>,\n private eventNameSrc: InformationType<string>,\n private subscribeMethodSrc: InformationType<string>,\n private unsubscribeMethodSrc: InformationType<string> = new Of(\"\"),\n ) {\n super(emitterSrc, eventNameSrc, subscribeMethodSrc, unsubscribeMethodSrc);\n }\n\n public value(o: OwnerType<T>): this {\n const a = new All(\n this.emitterSrc,\n this.eventNameSrc,\n this.subscribeMethodSrc,\n this.unsubscribeMethodSrc,\n );\n const handler = (v: T) => {\n o.give(v);\n };\n a.value(\n new From(([emitter, eventName, subscribe, unsubscribe]) => {\n emitter[subscribe](eventName, handler);\n this.addDep(\n new DestroyFunc(() => {\n emitter[unsubscribe](eventName, handler);\n }),\n );\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that gets a value from a promise and\n * presents it as information\n * https://silentium-lab.github.io/silentium/#/en/information/from-promise\n */\nexport class FromPromise<T> extends TheInformation<T> {\n public constructor(\n private p: Promise<T>,\n private errorOwner?: OwnerType,\n ) {\n super(p);\n }\n\n public value(o: OwnerType<T>): this {\n this.p\n .then((v) => {\n o.give(v);\n })\n .catch((e) => {\n this.errorOwner?.give(e);\n });\n return this;\n }\n}\n","import { From, OwnerType, TheInformation } from \"../base\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport class Late<T> extends TheInformation<T> implements OwnerType<T> {\n private theOwner?: OwnerType<T>;\n private lateOwner = new From((v: T) => {\n this.theValue = v;\n this.notify();\n });\n\n public constructor(private theValue?: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (this.theOwner) {\n throw new Error(\n \"Late component gets new owner, when another was already connected!\",\n );\n }\n this.theOwner = o;\n this.notify();\n return this;\n }\n\n public give(v: T) {\n this.theValue = v;\n this.lateOwner.give(v);\n return this;\n }\n\n private notify() {\n if (isFilled(this.theValue) && this.theOwner) {\n this.theOwner.give(this.theValue);\n }\n return this;\n }\n}\n","import { InformationType, Lazy } from \"../base\";\n\n/**\n * Lazy with applied function to its results\n */\nexport class LazyApplied<T> extends Lazy<T> {\n public constructor(\n private baseLazy: Lazy,\n private applier: (i: InformationType) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]): InformationType<T> {\n return this.applier(this.baseLazy.get(...args));\n }\n}\n","import { Lazy } from \"../base\";\n\n/**\n * Lazy instance from class constructor\n */\nexport class LazyClass<T> extends Lazy<T> {\n public constructor(constrFn: any) {\n const buildFn = (...args: unknown[]) => new constrFn(...args);\n super(buildFn);\n }\n}\n","import {\n From,\n InformationType,\n Lazy,\n Of,\n OwnerType,\n TheInformation,\n} from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n * https://silentium-lab.github.io/silentium/#/en/information/map\n */\nexport class Map<T, TG> extends TheInformation<TG[]> {\n public constructor(\n private baseSrc: InformationType<T[]>,\n private targetSrc: Lazy<TG>,\n ) {\n super(baseSrc, targetSrc);\n }\n\n public value(o: OwnerType<TG[]>) {\n this.baseSrc.value(\n new From((v) => {\n const infos: InformationType<TG>[] = [];\n v.forEach((val) => {\n let valInfo: InformationType<T> | T = val;\n if (!(valInfo instanceof TheInformation)) {\n valInfo = new Of(valInfo);\n }\n const info = this.targetSrc.get(valInfo);\n infos.push(info);\n });\n const allI = new All(...infos);\n allI.value(o);\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n * https://silentium-lab.github.io/silentium/#/en/information/once\n */\nexport class Once<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T>) {\n super();\n }\n\n public value(o: OwnerType<T>): this {\n let isFilled = false;\n this.baseSrc.value(\n new From((v) => {\n if (!isFilled) {\n isFilled = true;\n o.give(v);\n }\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * A component that takes one value at a time and returns\n * an array of all previous values\n * https://silentium-lab.github.io/silentium/#/en/information/sequence\n */\nexport class Sequence<T> extends TheInformation<T[]> {\n public constructor(private baseSrc: InformationType<T>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T[]>): this {\n const result: T[] = [];\n this.baseSrc.value(\n new From((v) => {\n result.push(v);\n o.give(result);\n }),\n );\n return this;\n }\n}\n","import { isFilled, OwnerPool } from \"../helpers\";\nimport {\n From,\n InformationType,\n OfFunc,\n OwnerType,\n TheInformation,\n} from \"../base\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n * https://silentium-lab.github.io/silentium/#/en/information/pool\n */\nexport class Shared<T> extends TheInformation<T> implements OwnerType<T> {\n private lastValue: T | undefined;\n private ownersPool = new OwnerPool<T>();\n\n public constructor(\n private baseSrc: InformationType<T>,\n private stateless = false,\n ) {\n super(baseSrc);\n this.addDep(this.ownersPool);\n this.baseSrc.value(\n new From((v) => {\n this.ownersPool.owner().give(v);\n this.lastValue = v;\n }),\n );\n }\n\n public value(o: OwnerType<T>): this {\n const i = new OfFunc((g: OwnerType<T>) => {\n if (\n !this.stateless &&\n isFilled(this.lastValue) &&\n !this.ownersPool.has(g)\n ) {\n g.give(this.lastValue);\n }\n this.ownersPool.add(g);\n return () => {\n this.ownersPool.remove(g);\n };\n });\n i.value(o);\n this.addDep(i);\n\n return this;\n }\n\n public pool() {\n return this.ownersPool;\n }\n\n public give(value: T) {\n this.lastValue = value;\n this.ownersPool.owner().give(value);\n return this;\n }\n}\n","import { Shared } from \"../components/Shared\";\nimport { OwnerType, SourceType, TheInformation } from \"../base\";\n\nexport class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {\n private sharedSrc: Shared<T>;\n\n public constructor(\n private baseSrc: SourceType<T>,\n stateless = false,\n ) {\n const sharedSrc = new Shared(baseSrc, stateless);\n super(sharedSrc);\n this.sharedSrc = sharedSrc;\n }\n\n public value(o: OwnerType<T>): this {\n this.sharedSrc.value(o);\n return this;\n }\n\n public give(value: T): this {\n this.baseSrc.give(value);\n this.sharedSrc.give(value);\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that receives a data array and yields values one by one\n * https://silentium-lab.github.io/silentium/#/en/information/stream\n */\nexport class Stream<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T[]>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n v.forEach((cv) => {\n o.give(cv);\n });\n }),\n );\n return this;\n }\n}\n"],"names":["__publicField"],"mappings":";;;AAAA,MAAM,aAAA,GAAgB,CAAC,GAAqC,KAAA;AAC1D,EAAA,OAAO,OAAO,GAAA,KAAQ,QAAY,IAAA,GAAA,KAAQ,QAAQ,SAAa,IAAA,GAAA;AACjE,CAAA;AAKO,MAAM,WAAY,CAAA;AAAA,EAEhB,eAAe,IAAa,EAAA;AADnC,IAAQA,eAAA,CAAA,IAAA,EAAA,SAAA,CAAA;AAEN,IAAK,IAAA,CAAA,OAAA,GAAU,QAAQ,EAAC;AAAA;AAC1B,EAEO,OAAU,GAAA;AACf,IAAK,IAAA,CAAA,OAAA,EAAS,OAAQ,CAAA,CAAC,GAAQ,KAAA;AAC7B,MAAI,IAAA,aAAA,CAAc,GAAG,CAAG,EAAA;AACtB,QAAA,GAAA,CAAI,OAAQ,EAAA;AAAA;AACd,KACD,CAAA;AACD,IAAO,OAAA,IAAA;AAAA;AACT;AAAA;AAAA;AAAA,EAKO,OAAO,GAAU,EAAA;AACtB,IAAK,IAAA,CAAA,OAAA,EAAS,KAAK,GAAG,CAAA;AACtB,IAAO,OAAA,IAAA;AAAA;AACT,EAEO,IAAI,GAAU,EAAA;AACnB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/C,IAAA,KAAA,CAAM,SAAS,CAAA;AAJP,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAHV,IAAQ,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA;AAQN,IAAA,IAAA,CAAK,SAAY,GAAA,SAAA;AAAA;AACnB,EAEO,MAAM,CAAuB,EAAA;AAClC,IAAK,IAAA,CAAA,SAAA,CAAU,MAAM,CAAC,CAAA;AACtB,IAAO,OAAA,IAAA;AAAA;AACT,EAEO,KAAK,KAAgB,EAAA;AAC1B,IAAK,IAAA,CAAA,OAAA,CAAQ,KAAK,KAAK,CAAA;AACvB,IAAK,IAAA,CAAA,SAAA,CAAU,KAAK,KAAK,CAAA;AACzB,IAAO,OAAA,IAAA;AAAA;AAEX;;ACnBO,MAAM,eAAkB,cAAkB,CAAA;AAAA,EACxC,YAAoB,OAA+B,EAAA;AACxD,IAAA,KAAA,CAAM,OAAO,CAAA;AADY,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA;AAE3B,EAEO,MAAM,CAAuB,EAAA;AAClC,IAAA,IAAA,CAAK,OAAQ,CAAA,KAAA;AAAA,MACX,IAAI,IAAK,CAAA,CAAC,CAAM,KAAA;AACd,QAAE,CAAA,CAAA,OAAA,CAAQ,CAAC,EAAO,KAAA;AAChB,UAAA,CAAA,CAAE,KAAK,EAAE,CAAA;AAAA,SACV,CAAA;AAAA,OACF;AAAA,KACH;AACA,IAAO,OAAA,IAAA;AAAA;AAEX;;;;"}
@@ -1 +1 @@
1
- !function(e){"use strict";var t=Object.defineProperty,s=(e,s,r)=>((e,s,r)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r)(e,s+"",r);class r{constructor(...e){s(this,"theDeps"),this.theDeps=e??[]}destroy(){return this.theDeps?.forEach((e=>{(e=>"object"==typeof e&&null!==e&&"destroy"in e)(e)&&e.destroy()})),this}addDep(e){return this.theDeps?.push(e),this}dep(e){return this.addDep(e),e}}class i extends r{constructor(e){super(),this.destructor=e}destroy(){return this.destructor(),this}}class n{}class a extends n{constructor(e){super(),this.fn=e}give(e){return this.fn(e),this}}var h=Object.defineProperty,o=(e,t,s)=>((e,t,s)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class u extends r{}const l=e=>null!=e;var c=Object.defineProperty,d=(e,t,s)=>((e,t,s)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class v{constructor(){d(this,"owners"),d(this,"innerOwner"),this.owners=new Set,this.innerOwner=new a((e=>{this.owners.forEach((t=>{t.give(e)}))}))}owner(){return this.innerOwner}size(){return this.owners.size}has(e){return this.owners.has(e)}add(e){return this.owners.add(e),this}remove(e){return this.owners.delete(e),this}destroy(){return this.owners.forEach((e=>{this.remove(e)})),this}}class b extends u{constructor(e){super(e),this.theValue=e}value(e){return l(this.theValue)&&e.give(this.theValue),this}}class w extends r{constructor(e){super(),this.buildFn=e}get(...e){return e.forEach((e=>{this.addDep(e)})),this.buildFn?.(...e)??new b(null)}}var p=Object.defineProperty,f=(e,t,s)=>((e,t,s)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class y extends u{constructor(e){super(e),this.valueFn=e,f(this,"mbDestructor")}value(e){return this.mbDestructor=this.valueFn(e),this}destroy(){return super.destroy(),this.mbDestructor?.(),this}}class g extends n{give(){return this}}var S=Object.defineProperty,m=(e,t,s)=>((e,t,s)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class O extends u{constructor(...e){super(e),m(this,"keysKnown"),m(this,"keysFilled",new Set),m(this,"infos"),this.infos=e,this.keysKnown=new Set(Object.keys(e))}value(e){const t={};return Object.entries(this.infos).forEach((([s,r])=>{this.keysKnown.add(s),r.value(new a((r=>{this.keysFilled.add(s),t[s]=r,this.isAllFilled()&&e.give(Object.values(t))})))})),this}isAllFilled(){return this.keysFilled.size>0&&this.keysFilled.size===this.keysKnown.size}}var x=Object.defineProperty,P=(e,t,s)=>((e,t,s)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);var F=Object.defineProperty,V=(e,t,s)=>((e,t,s)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);var j=Object.defineProperty,D=(e,t,s)=>((e,t,s)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);var E=Object.defineProperty,k=(e,t,s)=>((e,t,s)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);var z=Object.defineProperty,A=(e,t,s)=>((e,t,s)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class L extends u{constructor(e,t=!1){super(e),this.baseSrc=e,this.stateless=t,A(this,"lastValue"),A(this,"ownersPool",new v),this.addDep(this.ownersPool),this.baseSrc.value(new a((e=>{this.ownersPool.owner().give(e),this.lastValue=e})))}value(e){const t=new y((e=>(this.stateless||!l(this.lastValue)||this.ownersPool.has(e)||e.give(this.lastValue),this.ownersPool.add(e),()=>{this.ownersPool.remove(e)})));return t.value(e),this.addDep(t),this}pool(){return this.ownersPool}give(e){return this.lastValue=e,this.ownersPool.owner().give(e),this}}var I=Object.defineProperty,M=(e,t,s)=>((e,t,s)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);e.All=O,e.Any=class extends u{constructor(...e){super(e),P(this,"infos"),this.infos=e}value(e){return this.infos.forEach((t=>{t.value(e)})),this}},e.Applied=class extends u{constructor(e,t){super(e),this.baseSrc=e,this.applier=t}value(e){return this.baseSrc.value(new a((t=>{e.give(this.applier(t))}))),this}},e.Chain=class extends u{constructor(...e){super(e),V(this,"theInfos"),this.theInfos=e}value(e){let t;const s=r=>{const i=this.theInfos[r],n=this.theInfos[r+1];i.value(new a((i=>{n||(t=i),t&&e.give(t),n&&!t&&s(r+1)})))};return s(0),this}},e.DestroyFunc=i,e.Destroyable=r,e.ExecutorApplied=class extends u{constructor(e,t){super(e),this.baseSrc=e,this.applier=t}value(e){return this.baseSrc.value(new a(this.applier((t=>{e.give(t)})))),this}},e.Filtered=class extends u{constructor(e,t,s){super(e),this.baseSrc=e,this.predicate=t,this.defaultValue=s}value(e){return this.baseSrc.value(new a((t=>{this.predicate(t)?e.give(t):void 0!==this.defaultValue&&e.give(this.defaultValue)}))),this}},e.From=a,e.FromCallback=class extends u{constructor(e,...t){super(e),this.waitForCb=e,D(this,"theArgs"),this.theArgs=t}value(e){return this.waitForCb((t=>{e.give(t)}),...this.theArgs),this}},e.FromEvent=class extends u{constructor(e,t,s,r=new b("")){super(e,t,s,r),this.emitterSrc=e,this.eventNameSrc=t,this.subscribeMethodSrc=s,this.unsubscribeMethodSrc=r}value(e){const t=new O(this.emitterSrc,this.eventNameSrc,this.subscribeMethodSrc,this.unsubscribeMethodSrc),s=t=>{e.give(t)};return t.value(new a((([e,t,r,n])=>{e[r](t,s),this.addDep(new i((()=>{e[n](t,s)})))}))),this}},e.FromPromise=class extends u{constructor(e,t){super(e),this.p=e,this.errorOwner=t}value(e){return this.p.then((t=>{e.give(t)})).catch((e=>{this.errorOwner?.give(e)})),this}},e.Late=class extends u{constructor(e){super(e),this.theValue=e,k(this,"theOwner"),k(this,"lateOwner",new a((e=>{this.theValue=e,this.notify()})))}value(e){if(this.theOwner)throw new Error("Late component gets new owner, when another was already connected!");return this.theOwner=e,this.notify(),this}give(e){return this.theValue=e,this.lateOwner.give(e),this}notify(){return l(this.theValue)&&this.theOwner&&this.theOwner.give(this.theValue),this}},e.Lazy=w,e.LazyApplied=class extends w{constructor(e,t){super(),this.baseLazy=e,this.applier=t}get(...e){return this.applier(this.baseLazy.get(...e))}},e.LazyClass=class extends w{constructor(e){super(((...t)=>new e(...t)))}},e.Map=class extends u{constructor(e,t){super(e,t),this.baseSrc=e,this.targetSrc=t}value(e){return this.baseSrc.value(new a((t=>{const s=[];t.forEach((e=>{let t=e;t instanceof u||(t=new b(t));const r=this.targetSrc.get(t);s.push(r)}));new O(...s).value(e)}))),this}},e.MbInfo=class extends u{constructor(e){const t="object"==typeof e&&null!==e&&"value"in e&&"function"==typeof e.value?e:new b(e);super(t),o(this,"info"),this.info=t}value(e){return this.info.value(e),this}},e.Of=b,e.OfFunc=y,e.On=class extends r{constructor(e,t){super(e,t),e.value(t?new a(t):new g)}},e.Once=class extends u{constructor(e){super(),this.baseSrc=e}value(e){let t=!1;return this.baseSrc.value(new a((s=>{t||(t=!0,e.give(s))}))),this}},e.OwnerPool=v,e.Sequence=class extends u{constructor(e){super(e),this.baseSrc=e}value(e){const t=[];return this.baseSrc.value(new a((s=>{t.push(s),e.give(t)}))),this}},e.Shared=L,e.SharedSource=class extends u{constructor(e,t=!1){const s=new L(e,t);super(s),M(this,"sharedSrc"),this.sharedSrc=s}value(e){return this.sharedSrc.value(e),this}give(e){return this.sharedSrc.give(e),this}},e.Stream=class extends u{constructor(e){super(e),this.baseSrc=e}value(e){return this.baseSrc.value(new a((t=>{t.forEach((t=>{e.give(t)}))}))),this}},e.TheInformation=u,e.TheOwner=n,e.Void=g,e.isFilled=l}({});
1
+ !function(e){"use strict";var t=Object.defineProperty,s=(e,s,r)=>((e,s,r)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r)(e,s+"",r);class r{constructor(...e){s(this,"theDeps"),this.theDeps=e??[]}destroy(){return this.theDeps?.forEach((e=>{(e=>"object"==typeof e&&null!==e&&"destroy"in e)(e)&&e.destroy()})),this}addDep(e){return this.theDeps?.push(e),this}dep(e){return this.addDep(e),e}}class i extends r{constructor(e){super(),this.destructor=e}destroy(){return this.destructor(),this}}class n{}class a extends n{constructor(e){super(),this.fn=e}give(e){return this.fn(e),this}}var h=Object.defineProperty,o=(e,t,s)=>((e,t,s)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class u extends r{}const l=e=>null!=e;var c=Object.defineProperty,d=(e,t,s)=>((e,t,s)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class v{constructor(){d(this,"owners"),d(this,"innerOwner"),this.owners=new Set,this.innerOwner=new a((e=>{this.owners.forEach((t=>{t.give(e)}))}))}owner(){return this.innerOwner}size(){return this.owners.size}has(e){return this.owners.has(e)}add(e){return this.owners.add(e),this}remove(e){return this.owners.delete(e),this}destroy(){return this.owners.forEach((e=>{this.remove(e)})),this}}class b extends u{constructor(e){super(e),this.theValue=e}value(e){return l(this.theValue)&&e.give(this.theValue),this}}class w extends r{constructor(e){super(),this.buildFn=e}get(...e){return e.forEach((e=>{this.addDep(e)})),this.buildFn?.(...e)??new b(null)}}var p=Object.defineProperty,f=(e,t,s)=>((e,t,s)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class y extends u{constructor(e){super(e),this.valueFn=e,f(this,"mbDestructor")}value(e){return this.mbDestructor=this.valueFn(e),this}destroy(){return super.destroy(),this.mbDestructor?.(),this}}class g extends n{give(){return this}}var S=Object.defineProperty,m=(e,t,s)=>((e,t,s)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class O extends u{constructor(...e){super(e),m(this,"keysKnown"),m(this,"keysFilled",new Set),m(this,"infos"),this.infos=e,this.keysKnown=new Set(Object.keys(e))}value(e){const t={};return Object.entries(this.infos).forEach((([s,r])=>{this.keysKnown.add(s),r.value(new a((r=>{this.keysFilled.add(s),t[s]=r,this.isAllFilled()&&e.give(Object.values(t))})))})),this}isAllFilled(){return this.keysFilled.size>0&&this.keysFilled.size===this.keysKnown.size}}var x=Object.defineProperty,P=(e,t,s)=>((e,t,s)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);var F=Object.defineProperty,V=(e,t,s)=>((e,t,s)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);var j=Object.defineProperty,D=(e,t,s)=>((e,t,s)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);var E=Object.defineProperty,k=(e,t,s)=>((e,t,s)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);var z=Object.defineProperty,A=(e,t,s)=>((e,t,s)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class L extends u{constructor(e,t=!1){super(e),this.baseSrc=e,this.stateless=t,A(this,"lastValue"),A(this,"ownersPool",new v),this.addDep(this.ownersPool),this.baseSrc.value(new a((e=>{this.ownersPool.owner().give(e),this.lastValue=e})))}value(e){const t=new y((e=>(this.stateless||!l(this.lastValue)||this.ownersPool.has(e)||e.give(this.lastValue),this.ownersPool.add(e),()=>{this.ownersPool.remove(e)})));return t.value(e),this.addDep(t),this}pool(){return this.ownersPool}give(e){return this.lastValue=e,this.ownersPool.owner().give(e),this}}var I=Object.defineProperty,M=(e,t,s)=>((e,t,s)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);e.All=O,e.Any=class extends u{constructor(...e){super(e),P(this,"infos"),this.infos=e}value(e){return this.infos.forEach((t=>{t.value(e)})),this}},e.Applied=class extends u{constructor(e,t){super(e),this.baseSrc=e,this.applier=t}value(e){return this.baseSrc.value(new a((t=>{e.give(this.applier(t))}))),this}},e.Chain=class extends u{constructor(...e){super(e),V(this,"theInfos"),this.theInfos=e}value(e){let t;const s=r=>{const i=this.theInfos[r],n=this.theInfos[r+1];i.value(new a((i=>{n||(t=i),t&&e.give(t),n&&!t&&s(r+1)})))};return s(0),this}},e.DestroyFunc=i,e.Destroyable=r,e.ExecutorApplied=class extends u{constructor(e,t){super(e),this.baseSrc=e,this.applier=t}value(e){return this.baseSrc.value(new a(this.applier((t=>{e.give(t)})))),this}},e.Filtered=class extends u{constructor(e,t,s){super(e),this.baseSrc=e,this.predicate=t,this.defaultValue=s}value(e){return this.baseSrc.value(new a((t=>{this.predicate(t)?e.give(t):void 0!==this.defaultValue&&e.give(this.defaultValue)}))),this}},e.From=a,e.FromCallback=class extends u{constructor(e,...t){super(e),this.waitForCb=e,D(this,"theArgs"),this.theArgs=t}value(e){return this.waitForCb((t=>{e.give(t)}),...this.theArgs),this}},e.FromEvent=class extends u{constructor(e,t,s,r=new b("")){super(e,t,s,r),this.emitterSrc=e,this.eventNameSrc=t,this.subscribeMethodSrc=s,this.unsubscribeMethodSrc=r}value(e){const t=new O(this.emitterSrc,this.eventNameSrc,this.subscribeMethodSrc,this.unsubscribeMethodSrc),s=t=>{e.give(t)};return t.value(new a((([e,t,r,n])=>{e[r](t,s),this.addDep(new i((()=>{e[n](t,s)})))}))),this}},e.FromPromise=class extends u{constructor(e,t){super(e),this.p=e,this.errorOwner=t}value(e){return this.p.then((t=>{e.give(t)})).catch((e=>{this.errorOwner?.give(e)})),this}},e.Late=class extends u{constructor(e){super(e),this.theValue=e,k(this,"theOwner"),k(this,"lateOwner",new a((e=>{this.theValue=e,this.notify()})))}value(e){if(this.theOwner)throw new Error("Late component gets new owner, when another was already connected!");return this.theOwner=e,this.notify(),this}give(e){return this.theValue=e,this.lateOwner.give(e),this}notify(){return l(this.theValue)&&this.theOwner&&this.theOwner.give(this.theValue),this}},e.Lazy=w,e.LazyApplied=class extends w{constructor(e,t){super(),this.baseLazy=e,this.applier=t}get(...e){return this.applier(this.baseLazy.get(...e))}},e.LazyClass=class extends w{constructor(e){super(((...t)=>new e(...t)))}},e.Map=class extends u{constructor(e,t){super(e,t),this.baseSrc=e,this.targetSrc=t}value(e){return this.baseSrc.value(new a((t=>{const s=[];t.forEach((e=>{let t=e;t instanceof u||(t=new b(t));const r=this.targetSrc.get(t);s.push(r)}));new O(...s).value(e)}))),this}},e.MbInfo=class extends u{constructor(e){const t="object"==typeof e&&null!==e&&"value"in e&&"function"==typeof e.value?e:new b(e);super(t),o(this,"info"),this.info=t}value(e){return this.info.value(e),this}},e.Of=b,e.OfFunc=y,e.On=class extends r{constructor(e,t){super(e,t),e.value(t?new a(t):new g)}},e.Once=class extends u{constructor(e){super(),this.baseSrc=e}value(e){let t=!1;return this.baseSrc.value(new a((s=>{t||(t=!0,e.give(s))}))),this}},e.OwnerPool=v,e.Sequence=class extends u{constructor(e){super(e),this.baseSrc=e}value(e){const t=[];return this.baseSrc.value(new a((s=>{t.push(s),e.give(t)}))),this}},e.Shared=L,e.SharedSource=class extends u{constructor(e,t=!1){const s=new L(e,t);super(s),this.baseSrc=e,M(this,"sharedSrc"),this.sharedSrc=s}value(e){return this.sharedSrc.value(e),this}give(e){return this.baseSrc.give(e),this.sharedSrc.give(e),this}},e.Stream=class extends u{constructor(e){super(e),this.baseSrc=e}value(e){return this.baseSrc.value(new a((t=>{t.forEach((t=>{e.give(t)}))}))),this}},e.TheInformation=u,e.TheOwner=n,e.Void=g,e.isFilled=l}({});
@@ -1,2 +1,2 @@
1
- var e=Object.defineProperty,t=(t,s,r)=>((t,s,r)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r)(t,s+"",r);class s{constructor(...e){t(this,"theDeps"),this.theDeps=e??[]}destroy(){return this.theDeps?.forEach((e=>{(e=>"object"==typeof e&&null!==e&&"destroy"in e)(e)&&e.destroy()})),this}addDep(e){return this.theDeps?.push(e),this}dep(e){return this.addDep(e),e}}class r extends s{constructor(e){super(),this.destructor=e}destroy(){return this.destructor(),this}}class i{}class n extends i{constructor(e){super(),this.fn=e}give(e){return this.fn(e),this}}var a=Object.defineProperty,h=(e,t,s)=>((e,t,s)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class u extends s{}class o extends u{constructor(e){const t="object"==typeof e&&null!==e&&"value"in e&&"function"==typeof e.value?e:new b(e);super(t),h(this,"info"),this.info=t}value(e){return this.info.value(e),this}}const l=e=>null!=e;var c=Object.defineProperty,d=(e,t,s)=>((e,t,s)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class v{constructor(){d(this,"owners"),d(this,"innerOwner"),this.owners=new Set,this.innerOwner=new n((e=>{this.owners.forEach((t=>{t.give(e)}))}))}owner(){return this.innerOwner}size(){return this.owners.size}has(e){return this.owners.has(e)}add(e){return this.owners.add(e),this}remove(e){return this.owners.delete(e),this}destroy(){return this.owners.forEach((e=>{this.remove(e)})),this}}class b extends u{constructor(e){super(e),this.theValue=e}value(e){return l(this.theValue)&&e.give(this.theValue),this}}class w extends s{constructor(e){super(),this.buildFn=e}get(...e){return e.forEach((e=>{this.addDep(e)})),this.buildFn?.(...e)??new b(null)}}var p=Object.defineProperty,f=(e,t,s)=>((e,t,s)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class g extends u{constructor(e){super(e),this.valueFn=e,f(this,"mbDestructor")}value(e){return this.mbDestructor=this.valueFn(e),this}destroy(){return super.destroy(),this.mbDestructor?.(),this}}class y extends i{give(){return this}}class S extends s{constructor(e,t){super(e,t),e.value(t?new n(t):new y)}}var x=Object.defineProperty,m=(e,t,s)=>((e,t,s)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class O extends u{constructor(...e){super(e),m(this,"keysKnown"),m(this,"keysFilled",new Set),m(this,"infos"),this.infos=e,this.keysKnown=new Set(Object.keys(e))}value(e){const t={};return Object.entries(this.infos).forEach((([s,r])=>{this.keysKnown.add(s),r.value(new n((r=>{this.keysFilled.add(s),t[s]=r,this.isAllFilled()&&e.give(Object.values(t))})))})),this}isAllFilled(){return this.keysFilled.size>0&&this.keysFilled.size===this.keysKnown.size}}var P=Object.defineProperty,j=(e,t,s)=>((e,t,s)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class V extends u{constructor(...e){super(e),j(this,"infos"),this.infos=e}value(e){return this.infos.forEach((t=>{t.value(e)})),this}}class D extends u{constructor(e,t){super(e),this.baseSrc=e,this.applier=t}value(e){return this.baseSrc.value(new n((t=>{e.give(this.applier(t))}))),this}}var F=Object.defineProperty,k=(e,t,s)=>((e,t,s)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class E extends u{constructor(...e){super(e),k(this,"theInfos"),this.theInfos=e}value(e){let t;const s=r=>{const i=this.theInfos[r],a=this.theInfos[r+1];i.value(new n((i=>{a||(t=i),t&&e.give(t),a&&!t&&s(r+1)})))};return s(0),this}}class z extends u{constructor(e,t){super(e),this.baseSrc=e,this.applier=t}value(e){return this.baseSrc.value(new n(this.applier((t=>{e.give(t)})))),this}}class A extends u{constructor(e,t,s){super(e),this.baseSrc=e,this.predicate=t,this.defaultValue=s}value(e){return this.baseSrc.value(new n((t=>{this.predicate(t)?e.give(t):void 0!==this.defaultValue&&e.give(this.defaultValue)}))),this}}var I=Object.defineProperty,K=(e,t,s)=>((e,t,s)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class M extends u{constructor(e,...t){super(e),this.waitForCb=e,K(this,"theArgs"),this.theArgs=t}value(e){return this.waitForCb((t=>{e.give(t)}),...this.theArgs),this}}class L extends u{constructor(e,t,s,r=new b("")){super(e,t,s,r),this.emitterSrc=e,this.eventNameSrc=t,this.subscribeMethodSrc=s,this.unsubscribeMethodSrc=r}value(e){const t=new O(this.emitterSrc,this.eventNameSrc,this.subscribeMethodSrc,this.unsubscribeMethodSrc),s=t=>{e.give(t)};return t.value(new n((([e,t,i,n])=>{e[i](t,s),this.addDep(new r((()=>{e[n](t,s)})))}))),this}}class C extends u{constructor(e,t){super(e),this.p=e,this.errorOwner=t}value(e){return this.p.then((t=>{e.give(t)})).catch((e=>{this.errorOwner?.give(e)})),this}}var N=Object.defineProperty,q=(e,t,s)=>((e,t,s)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class B extends u{constructor(e){super(e),this.theValue=e,q(this,"theOwner"),q(this,"lateOwner",new n((e=>{this.theValue=e,this.notify()})))}value(e){if(this.theOwner)throw new Error("Late component gets new owner, when another was already connected!");return this.theOwner=e,this.notify(),this}give(e){return this.theValue=e,this.lateOwner.give(e),this}notify(){return l(this.theValue)&&this.theOwner&&this.theOwner.give(this.theValue),this}}class G extends w{constructor(e,t){super(),this.baseLazy=e,this.applier=t}get(...e){return this.applier(this.baseLazy.get(...e))}}class H extends w{constructor(e){super(((...t)=>new e(...t)))}}class J extends u{constructor(e,t){super(e,t),this.baseSrc=e,this.targetSrc=t}value(e){return this.baseSrc.value(new n((t=>{const s=[];t.forEach((e=>{let t=e;t instanceof u||(t=new b(t));const r=this.targetSrc.get(t);s.push(r)}));new O(...s).value(e)}))),this}}class Q extends u{constructor(e){super(),this.baseSrc=e}value(e){let t=!1;return this.baseSrc.value(new n((s=>{t||(t=!0,e.give(s))}))),this}}class R extends u{constructor(e){super(e),this.baseSrc=e}value(e){const t=[];return this.baseSrc.value(new n((s=>{t.push(s),e.give(t)}))),this}}var T=Object.defineProperty,U=(e,t,s)=>((e,t,s)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class W extends u{constructor(e,t=!1){super(e),this.baseSrc=e,this.stateless=t,U(this,"lastValue"),U(this,"ownersPool",new v),this.addDep(this.ownersPool),this.baseSrc.value(new n((e=>{this.ownersPool.owner().give(e),this.lastValue=e})))}value(e){const t=new g((e=>(this.stateless||!l(this.lastValue)||this.ownersPool.has(e)||e.give(this.lastValue),this.ownersPool.add(e),()=>{this.ownersPool.remove(e)})));return t.value(e),this.addDep(t),this}pool(){return this.ownersPool}give(e){return this.lastValue=e,this.ownersPool.owner().give(e),this}}var X=Object.defineProperty,Y=(e,t,s)=>((e,t,s)=>t in e?X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class Z extends u{constructor(e,t=!1){const s=new W(e,t);super(s),Y(this,"sharedSrc"),this.sharedSrc=s}value(e){return this.sharedSrc.value(e),this}give(e){return this.sharedSrc.give(e),this}}class $ extends u{constructor(e){super(e),this.baseSrc=e}value(e){return this.baseSrc.value(new n((t=>{t.forEach((t=>{e.give(t)}))}))),this}}export{O as All,V as Any,D as Applied,E as Chain,r as DestroyFunc,s as Destroyable,z as ExecutorApplied,A as Filtered,n as From,M as FromCallback,L as FromEvent,C as FromPromise,B as Late,w as Lazy,G as LazyApplied,H as LazyClass,J as Map,o as MbInfo,b as Of,g as OfFunc,S as On,Q as Once,v as OwnerPool,R as Sequence,W as Shared,Z as SharedSource,$ as Stream,u as TheInformation,i as TheOwner,y as Void,l as isFilled};
1
+ var e=Object.defineProperty,t=(t,s,r)=>((t,s,r)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r)(t,s+"",r);class s{constructor(...e){t(this,"theDeps"),this.theDeps=e??[]}destroy(){return this.theDeps?.forEach((e=>{(e=>"object"==typeof e&&null!==e&&"destroy"in e)(e)&&e.destroy()})),this}addDep(e){return this.theDeps?.push(e),this}dep(e){return this.addDep(e),e}}class r extends s{constructor(e){super(),this.destructor=e}destroy(){return this.destructor(),this}}class i{}class n extends i{constructor(e){super(),this.fn=e}give(e){return this.fn(e),this}}var a=Object.defineProperty,h=(e,t,s)=>((e,t,s)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class u extends s{}class o extends u{constructor(e){const t="object"==typeof e&&null!==e&&"value"in e&&"function"==typeof e.value?e:new b(e);super(t),h(this,"info"),this.info=t}value(e){return this.info.value(e),this}}const l=e=>null!=e;var c=Object.defineProperty,v=(e,t,s)=>((e,t,s)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class d{constructor(){v(this,"owners"),v(this,"innerOwner"),this.owners=new Set,this.innerOwner=new n((e=>{this.owners.forEach((t=>{t.give(e)}))}))}owner(){return this.innerOwner}size(){return this.owners.size}has(e){return this.owners.has(e)}add(e){return this.owners.add(e),this}remove(e){return this.owners.delete(e),this}destroy(){return this.owners.forEach((e=>{this.remove(e)})),this}}class b extends u{constructor(e){super(e),this.theValue=e}value(e){return l(this.theValue)&&e.give(this.theValue),this}}class w extends s{constructor(e){super(),this.buildFn=e}get(...e){return e.forEach((e=>{this.addDep(e)})),this.buildFn?.(...e)??new b(null)}}var p=Object.defineProperty,f=(e,t,s)=>((e,t,s)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class g extends u{constructor(e){super(e),this.valueFn=e,f(this,"mbDestructor")}value(e){return this.mbDestructor=this.valueFn(e),this}destroy(){return super.destroy(),this.mbDestructor?.(),this}}class y extends i{give(){return this}}class S extends s{constructor(e,t){super(e,t),e.value(t?new n(t):new y)}}var x=Object.defineProperty,m=(e,t,s)=>((e,t,s)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class O extends u{constructor(...e){super(e),m(this,"keysKnown"),m(this,"keysFilled",new Set),m(this,"infos"),this.infos=e,this.keysKnown=new Set(Object.keys(e))}value(e){const t={};return Object.entries(this.infos).forEach((([s,r])=>{this.keysKnown.add(s),r.value(new n((r=>{this.keysFilled.add(s),t[s]=r,this.isAllFilled()&&e.give(Object.values(t))})))})),this}isAllFilled(){return this.keysFilled.size>0&&this.keysFilled.size===this.keysKnown.size}}var P=Object.defineProperty,j=(e,t,s)=>((e,t,s)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class V extends u{constructor(...e){super(e),j(this,"infos"),this.infos=e}value(e){return this.infos.forEach((t=>{t.value(e)})),this}}class D extends u{constructor(e,t){super(e),this.baseSrc=e,this.applier=t}value(e){return this.baseSrc.value(new n((t=>{e.give(this.applier(t))}))),this}}var F=Object.defineProperty,k=(e,t,s)=>((e,t,s)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class E extends u{constructor(...e){super(e),k(this,"theInfos"),this.theInfos=e}value(e){let t;const s=r=>{const i=this.theInfos[r],a=this.theInfos[r+1];i.value(new n((i=>{a||(t=i),t&&e.give(t),a&&!t&&s(r+1)})))};return s(0),this}}class z extends u{constructor(e,t){super(e),this.baseSrc=e,this.applier=t}value(e){return this.baseSrc.value(new n(this.applier((t=>{e.give(t)})))),this}}class A extends u{constructor(e,t,s){super(e),this.baseSrc=e,this.predicate=t,this.defaultValue=s}value(e){return this.baseSrc.value(new n((t=>{this.predicate(t)?e.give(t):void 0!==this.defaultValue&&e.give(this.defaultValue)}))),this}}var I=Object.defineProperty,K=(e,t,s)=>((e,t,s)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class M extends u{constructor(e,...t){super(e),this.waitForCb=e,K(this,"theArgs"),this.theArgs=t}value(e){return this.waitForCb((t=>{e.give(t)}),...this.theArgs),this}}class L extends u{constructor(e,t,s,r=new b("")){super(e,t,s,r),this.emitterSrc=e,this.eventNameSrc=t,this.subscribeMethodSrc=s,this.unsubscribeMethodSrc=r}value(e){const t=new O(this.emitterSrc,this.eventNameSrc,this.subscribeMethodSrc,this.unsubscribeMethodSrc),s=t=>{e.give(t)};return t.value(new n((([e,t,i,n])=>{e[i](t,s),this.addDep(new r((()=>{e[n](t,s)})))}))),this}}class C extends u{constructor(e,t){super(e),this.p=e,this.errorOwner=t}value(e){return this.p.then((t=>{e.give(t)})).catch((e=>{this.errorOwner?.give(e)})),this}}var N=Object.defineProperty,q=(e,t,s)=>((e,t,s)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class B extends u{constructor(e){super(e),this.theValue=e,q(this,"theOwner"),q(this,"lateOwner",new n((e=>{this.theValue=e,this.notify()})))}value(e){if(this.theOwner)throw new Error("Late component gets new owner, when another was already connected!");return this.theOwner=e,this.notify(),this}give(e){return this.theValue=e,this.lateOwner.give(e),this}notify(){return l(this.theValue)&&this.theOwner&&this.theOwner.give(this.theValue),this}}class G extends w{constructor(e,t){super(),this.baseLazy=e,this.applier=t}get(...e){return this.applier(this.baseLazy.get(...e))}}class H extends w{constructor(e){super(((...t)=>new e(...t)))}}class J extends u{constructor(e,t){super(e,t),this.baseSrc=e,this.targetSrc=t}value(e){return this.baseSrc.value(new n((t=>{const s=[];t.forEach((e=>{let t=e;t instanceof u||(t=new b(t));const r=this.targetSrc.get(t);s.push(r)}));new O(...s).value(e)}))),this}}class Q extends u{constructor(e){super(),this.baseSrc=e}value(e){let t=!1;return this.baseSrc.value(new n((s=>{t||(t=!0,e.give(s))}))),this}}class R extends u{constructor(e){super(e),this.baseSrc=e}value(e){const t=[];return this.baseSrc.value(new n((s=>{t.push(s),e.give(t)}))),this}}var T=Object.defineProperty,U=(e,t,s)=>((e,t,s)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class W extends u{constructor(e,t=!1){super(e),this.baseSrc=e,this.stateless=t,U(this,"lastValue"),U(this,"ownersPool",new d),this.addDep(this.ownersPool),this.baseSrc.value(new n((e=>{this.ownersPool.owner().give(e),this.lastValue=e})))}value(e){const t=new g((e=>(this.stateless||!l(this.lastValue)||this.ownersPool.has(e)||e.give(this.lastValue),this.ownersPool.add(e),()=>{this.ownersPool.remove(e)})));return t.value(e),this.addDep(t),this}pool(){return this.ownersPool}give(e){return this.lastValue=e,this.ownersPool.owner().give(e),this}}var X=Object.defineProperty,Y=(e,t,s)=>((e,t,s)=>t in e?X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,t+"",s);class Z extends u{constructor(e,t=!1){const s=new W(e,t);super(s),this.baseSrc=e,Y(this,"sharedSrc"),this.sharedSrc=s}value(e){return this.sharedSrc.value(e),this}give(e){return this.baseSrc.give(e),this.sharedSrc.give(e),this}}class $ extends u{constructor(e){super(e),this.baseSrc=e}value(e){return this.baseSrc.value(new n((t=>{t.forEach((t=>{e.give(t)}))}))),this}}export{O as All,V as Any,D as Applied,E as Chain,r as DestroyFunc,s as Destroyable,z as ExecutorApplied,A as Filtered,n as From,M as FromCallback,L as FromEvent,C as FromPromise,B as Late,w as Lazy,G as LazyApplied,H as LazyClass,J as Map,o as MbInfo,b as Of,g as OfFunc,S as On,Q as Once,d as OwnerPool,R as Sequence,W as Shared,Z as SharedSource,$ as Stream,u as TheInformation,i as TheOwner,y as Void,l as isFilled};
2
2
  //# sourceMappingURL=silentium.min.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"silentium.min.mjs","sources":["../src/base/Destroyable.ts","../src/base/DestroyFunc.ts","../src/base/TheOwner.ts","../src/base/From.ts","../src/base/TheInformation.ts","../src/helpers/isFilled.ts","../src/helpers/OwnerPool.ts","../src/base/Of.ts","../src/base/Lazy.ts","../src/base/OfFunc.ts","../src/base/Void.ts","../src/base/On.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/Chain.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromCallback.ts","../src/components/FromEvent.ts","../src/components/FromPromise.ts","../src/components/Late.ts","../src/components/LazyApplied.ts","../src/components/LazyClass.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Shared.ts","../src/components/SharedSource.ts","../src/components/Stream.ts"],"sourcesContent":["const isDestroyable = (dep: unknown): dep is Destroyable => {\n return typeof dep === \"object\" && dep !== null && \"destroy\" in dep;\n};\n\n/**\n * Representation of Destroyable object\n */\nexport class Destroyable {\n private theDeps: any[];\n public constructor(...deps: any[]) {\n this.theDeps = deps ?? [];\n }\n\n public destroy() {\n this.theDeps?.forEach((dep) => {\n if (isDestroyable(dep)) {\n dep.destroy();\n }\n });\n return this;\n }\n\n /**\n * Add dependency what can be destroyed\n */\n public addDep(dep: any) {\n this.theDeps?.push(dep);\n return this;\n }\n\n public dep(dep: any) {\n this.addDep(dep);\n return dep;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\n\n/**\n * Representation of destructor function as object\n */\nexport class DestroyFunc extends Destroyable {\n public constructor(private destructor: () => void) {\n super();\n }\n\n public destroy(): this {\n this.destructor();\n return this;\n }\n}\n","export interface OwnerType<T = unknown> {\n give(value: T): this;\n}\n\n/**\n * Representation of Information Owner\n */\nexport abstract class TheOwner<T = unknown> implements OwnerType<T> {\n public abstract give(value: T): this;\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Owner from function\n */\nexport class From<T = unknown> extends TheOwner<T> {\n public constructor(private fn: (value: T) => void) {\n super();\n }\n\n public give(value: T): this {\n this.fn(value);\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { OwnerType } from \"./TheOwner\";\n\nexport interface InformationType<T = unknown> {\n value(o: OwnerType<T>): this;\n}\n\nexport type MaybeInformationType<T = unknown> = InformationType<T> | T;\n\n/**\n * Representation of Information\n */\nexport abstract class TheInformation<T = unknown>\n extends Destroyable\n implements InformationType<T>\n{\n public abstract value(o: OwnerType<T>): this;\n}\n\nexport class MbInfo<T> extends TheInformation<T> {\n private info: InformationType<T>;\n\n public constructor(theInfo: MaybeInformationType<T>) {\n const info =\n typeof theInfo === \"object\" &&\n theInfo !== null &&\n \"value\" in theInfo &&\n typeof theInfo.value === \"function\"\n ? theInfo\n : new Of(theInfo);\n super(info);\n this.info = info;\n }\n\n public value(o: OwnerType<T>): this {\n this.info.value(o);\n return this;\n }\n}\n","export const isFilled = <T>(value?: T): value is T => {\n return value !== undefined && value !== null;\n};\n","import { From, OwnerType } from \"../base\";\n\n/**\n * Helps maintain an owner list allowing different\n * owners to get information from a common source\n * https://silentium-lab.github.io/silentium/#/en/utils/owner-pool\n */\nexport class OwnerPool<T> {\n private owners: Set<OwnerType<T>>;\n private innerOwner: OwnerType<T>;\n\n public constructor() {\n this.owners = new Set<OwnerType<T>>();\n this.innerOwner = new From((v) => {\n this.owners.forEach((g) => {\n g.give(v);\n });\n });\n }\n\n public owner() {\n return this.innerOwner;\n }\n\n public size(): number {\n return this.owners.size;\n }\n\n public has(owner: OwnerType<T>): boolean {\n return this.owners.has(owner);\n }\n\n public add(owner: OwnerType<T>) {\n this.owners.add(owner);\n return this;\n }\n\n public remove(g: OwnerType<T>) {\n this.owners.delete(g);\n return this;\n }\n\n public destroy() {\n this.owners.forEach((g) => {\n this.remove(g);\n });\n return this;\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * Information from primitive value\n */\nexport class Of<T> extends TheInformation<T> {\n public constructor(private theValue: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (isFilled(this.theValue)) {\n o.give(this.theValue);\n }\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { InformationType } from \"./TheInformation\";\n\n/**\n * Ability to create information after some event\n */\nexport class Lazy<T = unknown> extends Destroyable {\n public constructor(\n protected buildFn?: (...args: InformationType[]) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]) {\n args.forEach((dep) => {\n this.addDep(dep);\n });\n return this.buildFn?.(...args) ?? (new Of(null) as InformationType<T>);\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\n\ntype DestructorFnType = () => void;\n\n/**\n * Information of function\n */\nexport class OfFunc<T> extends TheInformation<T> {\n private mbDestructor?: DestructorFnType | void;\n\n public constructor(\n private valueFn: (o: OwnerType<T>) => DestructorFnType | undefined | void,\n ) {\n super(valueFn);\n }\n\n public value(o: OwnerType<T>): this {\n this.mbDestructor = this.valueFn(o);\n return this;\n }\n\n public destroy(): this {\n super.destroy();\n this.mbDestructor?.();\n return this;\n }\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Silent owner\n */\nexport class Void extends TheOwner {\n public give(): this {\n return this;\n }\n}\n","import { Destroyable } from \"../base/Destroyable\";\nimport { From } from \"../base/From\";\nimport { InformationType } from \"../base/TheInformation\";\nimport { Void } from \"../base/Void\";\n\n/**\n * Run information with functional owner if needed\n */\nexport class On<T = unknown> extends Destroyable {\n public constructor(src: InformationType<T>, fn?: (value: T) => void) {\n super(src, fn);\n src.value(fn ? new From(fn) : new Void());\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\ntype ExtractTypeS<T> = T extends InformationType<infer U> ? U : never;\n\nexport type ExtractTypesFromArrayS<T extends InformationType<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\n/**\n * Combines multiple information sources into a single unified source\n * represented as an array containing values from all sources\n * https://silentium-lab.github.io/silentium/#/en/information/all\n */\nexport class All<const T extends InformationType[]> extends TheInformation<\n ExtractTypesFromArrayS<T>\n> {\n private keysKnown: Set<string>;\n private keysFilled = new Set();\n private infos: T;\n\n public constructor(...theInfos: T) {\n super(theInfos);\n this.infos = theInfos;\n this.keysKnown = new Set<string>(Object.keys(theInfos));\n }\n\n public value(o: OwnerType<ExtractTypesFromArrayS<T>>): this {\n const result: Record<string, unknown> = {};\n\n Object.entries(this.infos).forEach(([key, info]) => {\n this.keysKnown.add(key);\n info.value(\n new From((v) => {\n this.keysFilled.add(key);\n result[key] = v;\n if (this.isAllFilled()) {\n o.give(Object.values(result) as ExtractTypesFromArrayS<T>);\n }\n }),\n );\n });\n return this;\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * From a set of information sources we get\n * a common response from any source for a single owner\n * https://silentium-lab.github.io/silentium/#/en/information/any\n */\nexport class Any<T> extends TheInformation<T> {\n private infos: InformationType<T>[];\n\n public constructor(...theInfos: InformationType<T>[]) {\n super(theInfos);\n this.infos = theInfos;\n }\n\n public value(o: OwnerType<T>): this {\n this.infos.forEach((info) => {\n info.value(o);\n });\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which the function was applied to change the value\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Applied<T, R> extends TheInformation<R> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (v: T) => R,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<R>): this {\n this.baseSrc.value(\n new From((v) => {\n o.give(this.applier(v));\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends any[]> = T extends [...infer U, infer L] ? L : never;\n\n/**\n * The set of information sources forms a sequential chain where each source provides\n * an answer. The final answer will be the output result. If any source in the chain\n * provides a new answer, the component's overall response will be repeated.\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Chain<T extends InformationType[]> extends TheInformation<\n Last<T>\n> {\n private theInfos: T;\n\n public constructor(...infos: T) {\n super(infos);\n this.theInfos = infos;\n }\n\n public value(o: OwnerType<Last<T>>) {\n let lastValue: Last<T> | undefined;\n\n const handleI = (index: number) => {\n const info = this.theInfos[index] as TheInformation<Last<T>>;\n const nextI = this.theInfos[index + 1] as\n | TheInformation<Last<T>>\n | undefined;\n\n info.value(\n new From((v) => {\n if (!nextI) {\n lastValue = v;\n }\n\n if (lastValue) {\n o.give(lastValue);\n }\n\n if (nextI && !lastValue) {\n handleI(index + 1);\n }\n }),\n );\n };\n\n handleI(0);\n\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which a function is applied in order\n * to control the value passing process\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class ExecutorApplied<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (executor: (v: T) => void) => (v: T) => void,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From(\n this.applier((v) => {\n o.give(v);\n }),\n ),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information whose value is being validated\n * via a predicate; if the predicate returns true, the value\n * can be passed to the output\n * https://silentium-lab.github.io/silentium/#/en/information/filtered\n */\nexport class Filtered<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private predicate: (v: T) => boolean,\n private defaultValue?: T,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n if (this.predicate(v)) {\n o.give(v);\n } else if (this.defaultValue !== undefined) {\n o.give(this.defaultValue);\n }\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * When receiving a reference to a function expecting a callback, the component\n * creates its own callback, and the data received in this callback\n * will become the value of the information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-callback\n */\nexport class FromCallback<T> extends TheInformation<T> {\n private theArgs: unknown[];\n\n public constructor(\n private waitForCb: (cb: (v: T) => any, ...args: unknown[]) => unknown,\n ...args: unknown[]\n ) {\n super(waitForCb);\n this.theArgs = args;\n }\n\n public value(o: OwnerType<T>): this {\n this.waitForCb(\n (v) => {\n o.give(v);\n },\n ...this.theArgs,\n );\n return this;\n }\n}\n","import { DestroyFunc } from \"../base/DestroyFunc\";\nimport { From, InformationType, Of, OwnerType, TheInformation } from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * A component that receives data from an event and\n * presents it as an information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-event\n */\nexport class FromEvent<T = unknown> extends TheInformation<T> {\n public constructor(\n private emitterSrc: InformationType<any>,\n private eventNameSrc: InformationType<string>,\n private subscribeMethodSrc: InformationType<string>,\n private unsubscribeMethodSrc: InformationType<string> = new Of(\"\"),\n ) {\n super(emitterSrc, eventNameSrc, subscribeMethodSrc, unsubscribeMethodSrc);\n }\n\n public value(o: OwnerType<T>): this {\n const a = new All(\n this.emitterSrc,\n this.eventNameSrc,\n this.subscribeMethodSrc,\n this.unsubscribeMethodSrc,\n );\n const handler = (v: T) => {\n o.give(v);\n };\n a.value(\n new From(([emitter, eventName, subscribe, unsubscribe]) => {\n emitter[subscribe](eventName, handler);\n this.addDep(\n new DestroyFunc(() => {\n emitter[unsubscribe](eventName, handler);\n }),\n );\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that gets a value from a promise and\n * presents it as information\n * https://silentium-lab.github.io/silentium/#/en/information/from-promise\n */\nexport class FromPromise<T> extends TheInformation<T> {\n public constructor(\n private p: Promise<T>,\n private errorOwner?: OwnerType,\n ) {\n super(p);\n }\n\n public value(o: OwnerType<T>): this {\n this.p\n .then((v) => {\n o.give(v);\n })\n .catch((e) => {\n this.errorOwner?.give(e);\n });\n return this;\n }\n}\n","import { From, OwnerType, TheInformation } from \"../base\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport class Late<T> extends TheInformation<T> implements OwnerType<T> {\n private theOwner?: OwnerType<T>;\n private lateOwner = new From((v: T) => {\n this.theValue = v;\n this.notify();\n });\n\n public constructor(private theValue?: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (this.theOwner) {\n throw new Error(\n \"Late component gets new owner, when another was already connected!\",\n );\n }\n this.theOwner = o;\n this.notify();\n return this;\n }\n\n public give(v: T) {\n this.theValue = v;\n this.lateOwner.give(v);\n return this;\n }\n\n private notify() {\n if (isFilled(this.theValue) && this.theOwner) {\n this.theOwner.give(this.theValue);\n }\n return this;\n }\n}\n","import { InformationType, Lazy } from \"../base\";\n\n/**\n * Lazy with applied function to its results\n */\nexport class LazyApplied<T> extends Lazy<T> {\n public constructor(\n private baseLazy: Lazy,\n private applier: (i: InformationType) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]): InformationType<T> {\n return this.applier(this.baseLazy.get(...args));\n }\n}\n","import { Lazy } from \"../base\";\n\n/**\n * Lazy instance from class constructor\n */\nexport class LazyClass<T> extends Lazy<T> {\n public constructor(constrFn: any) {\n const buildFn = (...args: unknown[]) => new constrFn(...args);\n super(buildFn);\n }\n}\n","import {\n From,\n InformationType,\n Lazy,\n Of,\n OwnerType,\n TheInformation,\n} from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n * https://silentium-lab.github.io/silentium/#/en/information/map\n */\nexport class Map<T, TG> extends TheInformation<TG[]> {\n public constructor(\n private baseSrc: InformationType<T[]>,\n private targetSrc: Lazy<TG>,\n ) {\n super(baseSrc, targetSrc);\n }\n\n public value(o: OwnerType<TG[]>) {\n this.baseSrc.value(\n new From((v) => {\n const infos: InformationType<TG>[] = [];\n v.forEach((val) => {\n let valInfo: InformationType<T> | T = val;\n if (!(valInfo instanceof TheInformation)) {\n valInfo = new Of(valInfo);\n }\n const info = this.targetSrc.get(valInfo);\n infos.push(info);\n });\n const allI = new All(...infos);\n allI.value(o);\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n * https://silentium-lab.github.io/silentium/#/en/information/once\n */\nexport class Once<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T>) {\n super();\n }\n\n public value(o: OwnerType<T>): this {\n let isFilled = false;\n this.baseSrc.value(\n new From((v) => {\n if (!isFilled) {\n isFilled = true;\n o.give(v);\n }\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * A component that takes one value at a time and returns\n * an array of all previous values\n * https://silentium-lab.github.io/silentium/#/en/information/sequence\n */\nexport class Sequence<T> extends TheInformation<T[]> {\n public constructor(private baseSrc: InformationType<T>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T[]>): this {\n const result: T[] = [];\n this.baseSrc.value(\n new From((v) => {\n result.push(v);\n o.give(result);\n }),\n );\n return this;\n }\n}\n","import { isFilled, OwnerPool } from \"../helpers\";\nimport {\n From,\n InformationType,\n OfFunc,\n OwnerType,\n TheInformation,\n} from \"../base\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n * https://silentium-lab.github.io/silentium/#/en/information/pool\n */\nexport class Shared<T> extends TheInformation<T> implements OwnerType<T> {\n private lastValue: T | undefined;\n private ownersPool = new OwnerPool<T>();\n\n public constructor(\n private baseSrc: InformationType<T>,\n private stateless = false,\n ) {\n super(baseSrc);\n this.addDep(this.ownersPool);\n this.baseSrc.value(\n new From((v) => {\n this.ownersPool.owner().give(v);\n this.lastValue = v;\n }),\n );\n }\n\n public value(o: OwnerType<T>): this {\n const i = new OfFunc((g: OwnerType<T>) => {\n if (\n !this.stateless &&\n isFilled(this.lastValue) &&\n !this.ownersPool.has(g)\n ) {\n g.give(this.lastValue);\n }\n this.ownersPool.add(g);\n return () => {\n this.ownersPool.remove(g);\n };\n });\n i.value(o);\n this.addDep(i);\n\n return this;\n }\n\n public pool() {\n return this.ownersPool;\n }\n\n public give(value: T) {\n this.lastValue = value;\n this.ownersPool.owner().give(value);\n return this;\n }\n}\n","import { Shared } from \"../components/Shared\";\nimport { OwnerType, SourceType, TheInformation } from \"../base\";\n\nexport class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {\n private sharedSrc: Shared<T>;\n\n public constructor(baseSrc: SourceType<T>, stateless = false) {\n const sharedSrc = new Shared(baseSrc, stateless);\n super(sharedSrc);\n this.sharedSrc = sharedSrc;\n }\n\n public value(o: OwnerType<T>): this {\n this.sharedSrc.value(o);\n return this;\n }\n\n public give(value: T): this {\n this.sharedSrc.give(value);\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that receives a data array and yields values one by one\n * https://silentium-lab.github.io/silentium/#/en/information/stream\n */\nexport class Stream<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T[]>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n v.forEach((cv) => {\n o.give(cv);\n });\n }),\n );\n return this;\n }\n}\n"],"names":["Destroyable","constructor","deps","__publicField","this","theDeps","destroy","forEach","dep","isDestroyable","addDep","push","DestroyFunc","destructor","super","TheOwner","From","fn","give","value","TheInformation","MbInfo","theInfo","info","Of","o","isFilled","OwnerPool","owners","Set","innerOwner","v","g","owner","size","has","add","remove","delete","theValue","Lazy","buildFn","get","args","OfFunc","valueFn","mbDestructor","Void","On","src","All","theInfos","infos","keysKnown","Object","keys","result","entries","key","keysFilled","isAllFilled","values","Any","Applied","baseSrc","applier","Chain","lastValue","handleI","index","nextI","ExecutorApplied","Filtered","predicate","defaultValue","FromCallback","waitForCb","theArgs","FromEvent","emitterSrc","eventNameSrc","subscribeMethodSrc","unsubscribeMethodSrc","a","handler","emitter","eventName","subscribe","unsubscribe","FromPromise","p","errorOwner","then","catch","e","Late","notify","theOwner","Error","lateOwner","LazyApplied","baseLazy","LazyClass","constrFn","Map","targetSrc","val","valInfo","Once","Sequence","Shared","stateless","ownersPool","i","pool","SharedSource","sharedSrc","Stream","cv"],"mappings":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AAnB,CAAoB+D,GACzBlD,MAAMkD,GADmB5D,KAAA4D,QAAAA,CAAA,CAIpB,KAAA7C,CAAMM,GAQJ,OAPPrB,KAAK4D,QAAQ7C,MACX,IAAIH,GAAMe,IACNA,EAAAxB,SAAS+G,IACT7F,EAAEP,KAAKoG,EAAE,GACV,KAGElH,IAAA"}
1
+ {"version":3,"file":"silentium.min.mjs","sources":["../src/base/Destroyable.ts","../src/base/DestroyFunc.ts","../src/base/TheOwner.ts","../src/base/From.ts","../src/base/TheInformation.ts","../src/helpers/isFilled.ts","../src/helpers/OwnerPool.ts","../src/base/Of.ts","../src/base/Lazy.ts","../src/base/OfFunc.ts","../src/base/Void.ts","../src/base/On.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/Chain.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromCallback.ts","../src/components/FromEvent.ts","../src/components/FromPromise.ts","../src/components/Late.ts","../src/components/LazyApplied.ts","../src/components/LazyClass.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Shared.ts","../src/components/SharedSource.ts","../src/components/Stream.ts"],"sourcesContent":["const isDestroyable = (dep: unknown): dep is Destroyable => {\n return typeof dep === \"object\" && dep !== null && \"destroy\" in dep;\n};\n\n/**\n * Representation of Destroyable object\n */\nexport class Destroyable {\n private theDeps: any[];\n public constructor(...deps: any[]) {\n this.theDeps = deps ?? [];\n }\n\n public destroy() {\n this.theDeps?.forEach((dep) => {\n if (isDestroyable(dep)) {\n dep.destroy();\n }\n });\n return this;\n }\n\n /**\n * Add dependency what can be destroyed\n */\n public addDep(dep: any) {\n this.theDeps?.push(dep);\n return this;\n }\n\n public dep(dep: any) {\n this.addDep(dep);\n return dep;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\n\n/**\n * Representation of destructor function as object\n */\nexport class DestroyFunc extends Destroyable {\n public constructor(private destructor: () => void) {\n super();\n }\n\n public destroy(): this {\n this.destructor();\n return this;\n }\n}\n","export interface OwnerType<T = unknown> {\n give(value: T): this;\n}\n\n/**\n * Representation of Information Owner\n */\nexport abstract class TheOwner<T = unknown> implements OwnerType<T> {\n public abstract give(value: T): this;\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Owner from function\n */\nexport class From<T = unknown> extends TheOwner<T> {\n public constructor(private fn: (value: T) => void) {\n super();\n }\n\n public give(value: T): this {\n this.fn(value);\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { OwnerType } from \"./TheOwner\";\n\nexport interface InformationType<T = unknown> {\n value(o: OwnerType<T>): this;\n}\n\nexport type MaybeInformationType<T = unknown> = InformationType<T> | T;\n\n/**\n * Representation of Information\n */\nexport abstract class TheInformation<T = unknown>\n extends Destroyable\n implements InformationType<T>\n{\n public abstract value(o: OwnerType<T>): this;\n}\n\nexport class MbInfo<T> extends TheInformation<T> {\n private info: InformationType<T>;\n\n public constructor(theInfo: MaybeInformationType<T>) {\n const info =\n typeof theInfo === \"object\" &&\n theInfo !== null &&\n \"value\" in theInfo &&\n typeof theInfo.value === \"function\"\n ? theInfo\n : new Of(theInfo);\n super(info);\n this.info = info;\n }\n\n public value(o: OwnerType<T>): this {\n this.info.value(o);\n return this;\n }\n}\n","export const isFilled = <T>(value?: T): value is T => {\n return value !== undefined && value !== null;\n};\n","import { From, OwnerType } from \"../base\";\n\n/**\n * Helps maintain an owner list allowing different\n * owners to get information from a common source\n * https://silentium-lab.github.io/silentium/#/en/utils/owner-pool\n */\nexport class OwnerPool<T> {\n private owners: Set<OwnerType<T>>;\n private innerOwner: OwnerType<T>;\n\n public constructor() {\n this.owners = new Set<OwnerType<T>>();\n this.innerOwner = new From((v) => {\n this.owners.forEach((g) => {\n g.give(v);\n });\n });\n }\n\n public owner() {\n return this.innerOwner;\n }\n\n public size(): number {\n return this.owners.size;\n }\n\n public has(owner: OwnerType<T>): boolean {\n return this.owners.has(owner);\n }\n\n public add(owner: OwnerType<T>) {\n this.owners.add(owner);\n return this;\n }\n\n public remove(g: OwnerType<T>) {\n this.owners.delete(g);\n return this;\n }\n\n public destroy() {\n this.owners.forEach((g) => {\n this.remove(g);\n });\n return this;\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * Information from primitive value\n */\nexport class Of<T> extends TheInformation<T> {\n public constructor(private theValue: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (isFilled(this.theValue)) {\n o.give(this.theValue);\n }\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { InformationType } from \"./TheInformation\";\n\n/**\n * Ability to create information after some event\n */\nexport class Lazy<T = unknown> extends Destroyable {\n public constructor(\n protected buildFn?: (...args: InformationType[]) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]) {\n args.forEach((dep) => {\n this.addDep(dep);\n });\n return this.buildFn?.(...args) ?? (new Of(null) as InformationType<T>);\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\n\ntype DestructorFnType = () => void;\n\n/**\n * Information of function\n */\nexport class OfFunc<T> extends TheInformation<T> {\n private mbDestructor?: DestructorFnType | void;\n\n public constructor(\n private valueFn: (o: OwnerType<T>) => DestructorFnType | undefined | void,\n ) {\n super(valueFn);\n }\n\n public value(o: OwnerType<T>): this {\n this.mbDestructor = this.valueFn(o);\n return this;\n }\n\n public destroy(): this {\n super.destroy();\n this.mbDestructor?.();\n return this;\n }\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Silent owner\n */\nexport class Void extends TheOwner {\n public give(): this {\n return this;\n }\n}\n","import { Destroyable } from \"../base/Destroyable\";\nimport { From } from \"../base/From\";\nimport { InformationType } from \"../base/TheInformation\";\nimport { Void } from \"../base/Void\";\n\n/**\n * Run information with functional owner if needed\n */\nexport class On<T = unknown> extends Destroyable {\n public constructor(src: InformationType<T>, fn?: (value: T) => void) {\n super(src, fn);\n src.value(fn ? new From(fn) : new Void());\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\ntype ExtractTypeS<T> = T extends InformationType<infer U> ? U : never;\n\nexport type ExtractTypesFromArrayS<T extends InformationType<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\n/**\n * Combines multiple information sources into a single unified source\n * represented as an array containing values from all sources\n * https://silentium-lab.github.io/silentium/#/en/information/all\n */\nexport class All<const T extends InformationType[]> extends TheInformation<\n ExtractTypesFromArrayS<T>\n> {\n private keysKnown: Set<string>;\n private keysFilled = new Set();\n private infos: T;\n\n public constructor(...theInfos: T) {\n super(theInfos);\n this.infos = theInfos;\n this.keysKnown = new Set<string>(Object.keys(theInfos));\n }\n\n public value(o: OwnerType<ExtractTypesFromArrayS<T>>): this {\n const result: Record<string, unknown> = {};\n\n Object.entries(this.infos).forEach(([key, info]) => {\n this.keysKnown.add(key);\n info.value(\n new From((v) => {\n this.keysFilled.add(key);\n result[key] = v;\n if (this.isAllFilled()) {\n o.give(Object.values(result) as ExtractTypesFromArrayS<T>);\n }\n }),\n );\n });\n return this;\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * From a set of information sources we get\n * a common response from any source for a single owner\n * https://silentium-lab.github.io/silentium/#/en/information/any\n */\nexport class Any<T> extends TheInformation<T> {\n private infos: InformationType<T>[];\n\n public constructor(...theInfos: InformationType<T>[]) {\n super(theInfos);\n this.infos = theInfos;\n }\n\n public value(o: OwnerType<T>): this {\n this.infos.forEach((info) => {\n info.value(o);\n });\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which the function was applied to change the value\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Applied<T, R> extends TheInformation<R> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (v: T) => R,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<R>): this {\n this.baseSrc.value(\n new From((v) => {\n o.give(this.applier(v));\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends any[]> = T extends [...infer U, infer L] ? L : never;\n\n/**\n * The set of information sources forms a sequential chain where each source provides\n * an answer. The final answer will be the output result. If any source in the chain\n * provides a new answer, the component's overall response will be repeated.\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Chain<T extends InformationType[]> extends TheInformation<\n Last<T>\n> {\n private theInfos: T;\n\n public constructor(...infos: T) {\n super(infos);\n this.theInfos = infos;\n }\n\n public value(o: OwnerType<Last<T>>) {\n let lastValue: Last<T> | undefined;\n\n const handleI = (index: number) => {\n const info = this.theInfos[index] as TheInformation<Last<T>>;\n const nextI = this.theInfos[index + 1] as\n | TheInformation<Last<T>>\n | undefined;\n\n info.value(\n new From((v) => {\n if (!nextI) {\n lastValue = v;\n }\n\n if (lastValue) {\n o.give(lastValue);\n }\n\n if (nextI && !lastValue) {\n handleI(index + 1);\n }\n }),\n );\n };\n\n handleI(0);\n\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which a function is applied in order\n * to control the value passing process\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class ExecutorApplied<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (executor: (v: T) => void) => (v: T) => void,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From(\n this.applier((v) => {\n o.give(v);\n }),\n ),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information whose value is being validated\n * via a predicate; if the predicate returns true, the value\n * can be passed to the output\n * https://silentium-lab.github.io/silentium/#/en/information/filtered\n */\nexport class Filtered<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private predicate: (v: T) => boolean,\n private defaultValue?: T,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n if (this.predicate(v)) {\n o.give(v);\n } else if (this.defaultValue !== undefined) {\n o.give(this.defaultValue);\n }\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * When receiving a reference to a function expecting a callback, the component\n * creates its own callback, and the data received in this callback\n * will become the value of the information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-callback\n */\nexport class FromCallback<T> extends TheInformation<T> {\n private theArgs: unknown[];\n\n public constructor(\n private waitForCb: (cb: (v: T) => any, ...args: unknown[]) => unknown,\n ...args: unknown[]\n ) {\n super(waitForCb);\n this.theArgs = args;\n }\n\n public value(o: OwnerType<T>): this {\n this.waitForCb(\n (v) => {\n o.give(v);\n },\n ...this.theArgs,\n );\n return this;\n }\n}\n","import { DestroyFunc } from \"../base/DestroyFunc\";\nimport { From, InformationType, Of, OwnerType, TheInformation } from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * A component that receives data from an event and\n * presents it as an information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-event\n */\nexport class FromEvent<T = unknown> extends TheInformation<T> {\n public constructor(\n private emitterSrc: InformationType<any>,\n private eventNameSrc: InformationType<string>,\n private subscribeMethodSrc: InformationType<string>,\n private unsubscribeMethodSrc: InformationType<string> = new Of(\"\"),\n ) {\n super(emitterSrc, eventNameSrc, subscribeMethodSrc, unsubscribeMethodSrc);\n }\n\n public value(o: OwnerType<T>): this {\n const a = new All(\n this.emitterSrc,\n this.eventNameSrc,\n this.subscribeMethodSrc,\n this.unsubscribeMethodSrc,\n );\n const handler = (v: T) => {\n o.give(v);\n };\n a.value(\n new From(([emitter, eventName, subscribe, unsubscribe]) => {\n emitter[subscribe](eventName, handler);\n this.addDep(\n new DestroyFunc(() => {\n emitter[unsubscribe](eventName, handler);\n }),\n );\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that gets a value from a promise and\n * presents it as information\n * https://silentium-lab.github.io/silentium/#/en/information/from-promise\n */\nexport class FromPromise<T> extends TheInformation<T> {\n public constructor(\n private p: Promise<T>,\n private errorOwner?: OwnerType,\n ) {\n super(p);\n }\n\n public value(o: OwnerType<T>): this {\n this.p\n .then((v) => {\n o.give(v);\n })\n .catch((e) => {\n this.errorOwner?.give(e);\n });\n return this;\n }\n}\n","import { From, OwnerType, TheInformation } from \"../base\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport class Late<T> extends TheInformation<T> implements OwnerType<T> {\n private theOwner?: OwnerType<T>;\n private lateOwner = new From((v: T) => {\n this.theValue = v;\n this.notify();\n });\n\n public constructor(private theValue?: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (this.theOwner) {\n throw new Error(\n \"Late component gets new owner, when another was already connected!\",\n );\n }\n this.theOwner = o;\n this.notify();\n return this;\n }\n\n public give(v: T) {\n this.theValue = v;\n this.lateOwner.give(v);\n return this;\n }\n\n private notify() {\n if (isFilled(this.theValue) && this.theOwner) {\n this.theOwner.give(this.theValue);\n }\n return this;\n }\n}\n","import { InformationType, Lazy } from \"../base\";\n\n/**\n * Lazy with applied function to its results\n */\nexport class LazyApplied<T> extends Lazy<T> {\n public constructor(\n private baseLazy: Lazy,\n private applier: (i: InformationType) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]): InformationType<T> {\n return this.applier(this.baseLazy.get(...args));\n }\n}\n","import { Lazy } from \"../base\";\n\n/**\n * Lazy instance from class constructor\n */\nexport class LazyClass<T> extends Lazy<T> {\n public constructor(constrFn: any) {\n const buildFn = (...args: unknown[]) => new constrFn(...args);\n super(buildFn);\n }\n}\n","import {\n From,\n InformationType,\n Lazy,\n Of,\n OwnerType,\n TheInformation,\n} from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n * https://silentium-lab.github.io/silentium/#/en/information/map\n */\nexport class Map<T, TG> extends TheInformation<TG[]> {\n public constructor(\n private baseSrc: InformationType<T[]>,\n private targetSrc: Lazy<TG>,\n ) {\n super(baseSrc, targetSrc);\n }\n\n public value(o: OwnerType<TG[]>) {\n this.baseSrc.value(\n new From((v) => {\n const infos: InformationType<TG>[] = [];\n v.forEach((val) => {\n let valInfo: InformationType<T> | T = val;\n if (!(valInfo instanceof TheInformation)) {\n valInfo = new Of(valInfo);\n }\n const info = this.targetSrc.get(valInfo);\n infos.push(info);\n });\n const allI = new All(...infos);\n allI.value(o);\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n * https://silentium-lab.github.io/silentium/#/en/information/once\n */\nexport class Once<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T>) {\n super();\n }\n\n public value(o: OwnerType<T>): this {\n let isFilled = false;\n this.baseSrc.value(\n new From((v) => {\n if (!isFilled) {\n isFilled = true;\n o.give(v);\n }\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * A component that takes one value at a time and returns\n * an array of all previous values\n * https://silentium-lab.github.io/silentium/#/en/information/sequence\n */\nexport class Sequence<T> extends TheInformation<T[]> {\n public constructor(private baseSrc: InformationType<T>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T[]>): this {\n const result: T[] = [];\n this.baseSrc.value(\n new From((v) => {\n result.push(v);\n o.give(result);\n }),\n );\n return this;\n }\n}\n","import { isFilled, OwnerPool } from \"../helpers\";\nimport {\n From,\n InformationType,\n OfFunc,\n OwnerType,\n TheInformation,\n} from \"../base\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n * https://silentium-lab.github.io/silentium/#/en/information/pool\n */\nexport class Shared<T> extends TheInformation<T> implements OwnerType<T> {\n private lastValue: T | undefined;\n private ownersPool = new OwnerPool<T>();\n\n public constructor(\n private baseSrc: InformationType<T>,\n private stateless = false,\n ) {\n super(baseSrc);\n this.addDep(this.ownersPool);\n this.baseSrc.value(\n new From((v) => {\n this.ownersPool.owner().give(v);\n this.lastValue = v;\n }),\n );\n }\n\n public value(o: OwnerType<T>): this {\n const i = new OfFunc((g: OwnerType<T>) => {\n if (\n !this.stateless &&\n isFilled(this.lastValue) &&\n !this.ownersPool.has(g)\n ) {\n g.give(this.lastValue);\n }\n this.ownersPool.add(g);\n return () => {\n this.ownersPool.remove(g);\n };\n });\n i.value(o);\n this.addDep(i);\n\n return this;\n }\n\n public pool() {\n return this.ownersPool;\n }\n\n public give(value: T) {\n this.lastValue = value;\n this.ownersPool.owner().give(value);\n return this;\n }\n}\n","import { Shared } from \"../components/Shared\";\nimport { OwnerType, SourceType, TheInformation } from \"../base\";\n\nexport class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {\n private sharedSrc: Shared<T>;\n\n public constructor(\n private baseSrc: SourceType<T>,\n stateless = false,\n ) {\n const sharedSrc = new Shared(baseSrc, stateless);\n super(sharedSrc);\n this.sharedSrc = sharedSrc;\n }\n\n public value(o: OwnerType<T>): this {\n this.sharedSrc.value(o);\n return this;\n }\n\n public give(value: T): this {\n this.baseSrc.give(value);\n this.sharedSrc.give(value);\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that receives a data array and yields values one by one\n * https://silentium-lab.github.io/silentium/#/en/information/stream\n */\nexport class Stream<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T[]>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n v.forEach((cv) => {\n o.give(cv);\n });\n }),\n );\n return this;\n }\n}\n"],"names":["Destroyable","constructor","deps","__publicField","this","theDeps","destroy","forEach","dep","isDestroyable","addDep","push","DestroyFunc","destructor","super","TheOwner","From","fn","give","value","TheInformation","MbInfo","theInfo","info","Of","o","isFilled","OwnerPool","owners","Set","innerOwner","v","g","owner","size","has","add","remove","delete","theValue","Lazy","buildFn","get","args","OfFunc","valueFn","mbDestructor","Void","On","src","All","theInfos","infos","keysKnown","Object","keys","result","entries","key","keysFilled","isAllFilled","values","Any","Applied","baseSrc","applier","Chain","lastValue","handleI","index","nextI","ExecutorApplied","Filtered","predicate","defaultValue","FromCallback","waitForCb","theArgs","FromEvent","emitterSrc","eventNameSrc","subscribeMethodSrc","unsubscribeMethodSrc","a","handler","emitter","eventName","subscribe","unsubscribe","FromPromise","p","errorOwner","then","catch","e","Late","notify","theOwner","Error","lateOwner","LazyApplied","baseLazy","LazyClass","constrFn","Map","targetSrc","val","valInfo","Once","Sequence","Shared","stateless","ownersPool","i","pool","SharedSource","sharedSrc","Stream","cv"],"mappings":"qIAOO,MAAMA,EAEJ,WAAAC,IAAeC,GADdC,EAAAC,KAAA,WAEDA,KAAAC,QAAUH,GAAQ,EAAC,CAGnB,OAAAI,GAME,OALFF,KAAAC,SAASE,SAASC,IAdL,CAACA,GACC,iBAARA,GAA4B,OAARA,GAAgB,YAAaA,EAcvDC,CAAcD,IAChBA,EAAIF,SAAQ,IAGTF,IAAA,CAMF,MAAAM,CAAOF,GAEL,OADFJ,KAAAC,SAASM,KAAKH,GACZJ,IAAA,CAGF,GAAAI,CAAIA,GAEF,OADPJ,KAAKM,OAAOF,GACLA,CAAA,EC3BJ,MAAMI,UAAoBZ,EACxB,WAAAC,CAAoBY,GACnBC,QADmBV,KAAAS,WAAAA,CAAA,CAIpB,OAAAP,GAEE,OADPF,KAAKS,aACET,IAAA,ECLJ,MAAeW,GCFf,MAAMC,UAA0BD,EAC9B,WAAAd,CAAoBgB,GACnBH,QADmBV,KAAAa,GAAAA,C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AAK+D,WAET/D,KAAA4G,WAAW5E,IAAIJ,GACb,KACA5B,KAAA4G,WAAW3E,OAAOL,EAAC,KAMrB,OAHPiF,EAAE9F,MAAMM,GACRrB,KAAKM,OAAOuG,GAEL7G,IAAA,CAGF,IAAA8G,GACL,OAAO9G,KAAK4G,UAAA,CAGP,IAAA9F,CAAKC,GAGH,OAFPf,KAAK+D,UAAYhD,EACjBf,KAAK4G,WAAW/E,QAAQf,KAAKC,GACtBf,IAAA,uICxDJ,MAAM+G,UAAwB/F,EAG5B,WAAAnB,CACG+D,EACR+C,GAAY,GAEZ,MAAMK,EAAY,IAAIN,EAAO9C,EAAS+C,GACtCjG,MAAMsG,GAJEhH,KAAA4D,QAAAA,EAHF7D,EAAAC,KAAA,aAQNA,KAAKgH,UAAYA,CAAA,CAGZ,KAAAjG,CAAMM,GAEJ,OADFrB,KAAAgH,UAAUjG,MAAMM,GACdrB,IAAA,CAGF,IAAAc,CAAKC,GAGH,OAFFf,KAAA4D,QAAQ9C,KAAKC,GACbf,KAAAgH,UAAUlG,KAAKC,GACbf,IAAA,ECjBJ,MAAMiH,UAAkBjG,EACtB,WAAAnB,CAAoB+D,GACzBlD,MAAMkD,GADmB5D,KAAA4D,QAAAA,CAAA,CAIpB,KAAA7C,CAAMM,GAQJ,OAPPrB,KAAK4D,QAAQ7C,MACX,IAAIH,GAAMe,IACNA,EAAAxB,SAAS+G,IACT7F,EAAEP,KAAKoG,EAAE,GACV,KAGElH,IAAA"}
@@ -547,6 +547,7 @@ class SharedSource extends TheInformation {
547
547
  constructor(baseSrc, stateless = false) {
548
548
  const sharedSrc = new Shared(baseSrc, stateless);
549
549
  super(sharedSrc);
550
+ this.baseSrc = baseSrc;
550
551
  __publicField(this, "sharedSrc");
551
552
  this.sharedSrc = sharedSrc;
552
553
  }
@@ -555,6 +556,7 @@ class SharedSource extends TheInformation {
555
556
  return this;
556
557
  }
557
558
  give(value) {
559
+ this.baseSrc.give(value);
558
560
  this.sharedSrc.give(value);
559
561
  return this;
560
562
  }
@@ -1 +1 @@
1
- {"version":3,"file":"silentium.mjs","sources":["../src/base/Destroyable.ts","../src/base/DestroyFunc.ts","../src/base/TheOwner.ts","../src/base/From.ts","../src/base/TheInformation.ts","../src/helpers/isFilled.ts","../src/helpers/OwnerPool.ts","../src/base/Of.ts","../src/base/Lazy.ts","../src/base/OfFunc.ts","../src/base/Void.ts","../src/base/On.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/Chain.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromCallback.ts","../src/components/FromEvent.ts","../src/components/FromPromise.ts","../src/components/Late.ts","../src/components/LazyApplied.ts","../src/components/LazyClass.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Shared.ts","../src/components/SharedSource.ts","../src/components/Stream.ts"],"sourcesContent":["const isDestroyable = (dep: unknown): dep is Destroyable => {\n return typeof dep === \"object\" && dep !== null && \"destroy\" in dep;\n};\n\n/**\n * Representation of Destroyable object\n */\nexport class Destroyable {\n private theDeps: any[];\n public constructor(...deps: any[]) {\n this.theDeps = deps ?? [];\n }\n\n public destroy() {\n this.theDeps?.forEach((dep) => {\n if (isDestroyable(dep)) {\n dep.destroy();\n }\n });\n return this;\n }\n\n /**\n * Add dependency what can be destroyed\n */\n public addDep(dep: any) {\n this.theDeps?.push(dep);\n return this;\n }\n\n public dep(dep: any) {\n this.addDep(dep);\n return dep;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\n\n/**\n * Representation of destructor function as object\n */\nexport class DestroyFunc extends Destroyable {\n public constructor(private destructor: () => void) {\n super();\n }\n\n public destroy(): this {\n this.destructor();\n return this;\n }\n}\n","export interface OwnerType<T = unknown> {\n give(value: T): this;\n}\n\n/**\n * Representation of Information Owner\n */\nexport abstract class TheOwner<T = unknown> implements OwnerType<T> {\n public abstract give(value: T): this;\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Owner from function\n */\nexport class From<T = unknown> extends TheOwner<T> {\n public constructor(private fn: (value: T) => void) {\n super();\n }\n\n public give(value: T): this {\n this.fn(value);\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { OwnerType } from \"./TheOwner\";\n\nexport interface InformationType<T = unknown> {\n value(o: OwnerType<T>): this;\n}\n\nexport type MaybeInformationType<T = unknown> = InformationType<T> | T;\n\n/**\n * Representation of Information\n */\nexport abstract class TheInformation<T = unknown>\n extends Destroyable\n implements InformationType<T>\n{\n public abstract value(o: OwnerType<T>): this;\n}\n\nexport class MbInfo<T> extends TheInformation<T> {\n private info: InformationType<T>;\n\n public constructor(theInfo: MaybeInformationType<T>) {\n const info =\n typeof theInfo === \"object\" &&\n theInfo !== null &&\n \"value\" in theInfo &&\n typeof theInfo.value === \"function\"\n ? theInfo\n : new Of(theInfo);\n super(info);\n this.info = info;\n }\n\n public value(o: OwnerType<T>): this {\n this.info.value(o);\n return this;\n }\n}\n","export const isFilled = <T>(value?: T): value is T => {\n return value !== undefined && value !== null;\n};\n","import { From, OwnerType } from \"../base\";\n\n/**\n * Helps maintain an owner list allowing different\n * owners to get information from a common source\n * https://silentium-lab.github.io/silentium/#/en/utils/owner-pool\n */\nexport class OwnerPool<T> {\n private owners: Set<OwnerType<T>>;\n private innerOwner: OwnerType<T>;\n\n public constructor() {\n this.owners = new Set<OwnerType<T>>();\n this.innerOwner = new From((v) => {\n this.owners.forEach((g) => {\n g.give(v);\n });\n });\n }\n\n public owner() {\n return this.innerOwner;\n }\n\n public size(): number {\n return this.owners.size;\n }\n\n public has(owner: OwnerType<T>): boolean {\n return this.owners.has(owner);\n }\n\n public add(owner: OwnerType<T>) {\n this.owners.add(owner);\n return this;\n }\n\n public remove(g: OwnerType<T>) {\n this.owners.delete(g);\n return this;\n }\n\n public destroy() {\n this.owners.forEach((g) => {\n this.remove(g);\n });\n return this;\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * Information from primitive value\n */\nexport class Of<T> extends TheInformation<T> {\n public constructor(private theValue: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (isFilled(this.theValue)) {\n o.give(this.theValue);\n }\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { InformationType } from \"./TheInformation\";\n\n/**\n * Ability to create information after some event\n */\nexport class Lazy<T = unknown> extends Destroyable {\n public constructor(\n protected buildFn?: (...args: InformationType[]) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]) {\n args.forEach((dep) => {\n this.addDep(dep);\n });\n return this.buildFn?.(...args) ?? (new Of(null) as InformationType<T>);\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\n\ntype DestructorFnType = () => void;\n\n/**\n * Information of function\n */\nexport class OfFunc<T> extends TheInformation<T> {\n private mbDestructor?: DestructorFnType | void;\n\n public constructor(\n private valueFn: (o: OwnerType<T>) => DestructorFnType | undefined | void,\n ) {\n super(valueFn);\n }\n\n public value(o: OwnerType<T>): this {\n this.mbDestructor = this.valueFn(o);\n return this;\n }\n\n public destroy(): this {\n super.destroy();\n this.mbDestructor?.();\n return this;\n }\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Silent owner\n */\nexport class Void extends TheOwner {\n public give(): this {\n return this;\n }\n}\n","import { Destroyable } from \"../base/Destroyable\";\nimport { From } from \"../base/From\";\nimport { InformationType } from \"../base/TheInformation\";\nimport { Void } from \"../base/Void\";\n\n/**\n * Run information with functional owner if needed\n */\nexport class On<T = unknown> extends Destroyable {\n public constructor(src: InformationType<T>, fn?: (value: T) => void) {\n super(src, fn);\n src.value(fn ? new From(fn) : new Void());\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\ntype ExtractTypeS<T> = T extends InformationType<infer U> ? U : never;\n\nexport type ExtractTypesFromArrayS<T extends InformationType<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\n/**\n * Combines multiple information sources into a single unified source\n * represented as an array containing values from all sources\n * https://silentium-lab.github.io/silentium/#/en/information/all\n */\nexport class All<const T extends InformationType[]> extends TheInformation<\n ExtractTypesFromArrayS<T>\n> {\n private keysKnown: Set<string>;\n private keysFilled = new Set();\n private infos: T;\n\n public constructor(...theInfos: T) {\n super(theInfos);\n this.infos = theInfos;\n this.keysKnown = new Set<string>(Object.keys(theInfos));\n }\n\n public value(o: OwnerType<ExtractTypesFromArrayS<T>>): this {\n const result: Record<string, unknown> = {};\n\n Object.entries(this.infos).forEach(([key, info]) => {\n this.keysKnown.add(key);\n info.value(\n new From((v) => {\n this.keysFilled.add(key);\n result[key] = v;\n if (this.isAllFilled()) {\n o.give(Object.values(result) as ExtractTypesFromArrayS<T>);\n }\n }),\n );\n });\n return this;\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * From a set of information sources we get\n * a common response from any source for a single owner\n * https://silentium-lab.github.io/silentium/#/en/information/any\n */\nexport class Any<T> extends TheInformation<T> {\n private infos: InformationType<T>[];\n\n public constructor(...theInfos: InformationType<T>[]) {\n super(theInfos);\n this.infos = theInfos;\n }\n\n public value(o: OwnerType<T>): this {\n this.infos.forEach((info) => {\n info.value(o);\n });\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which the function was applied to change the value\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Applied<T, R> extends TheInformation<R> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (v: T) => R,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<R>): this {\n this.baseSrc.value(\n new From((v) => {\n o.give(this.applier(v));\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends any[]> = T extends [...infer U, infer L] ? L : never;\n\n/**\n * The set of information sources forms a sequential chain where each source provides\n * an answer. The final answer will be the output result. If any source in the chain\n * provides a new answer, the component's overall response will be repeated.\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Chain<T extends InformationType[]> extends TheInformation<\n Last<T>\n> {\n private theInfos: T;\n\n public constructor(...infos: T) {\n super(infos);\n this.theInfos = infos;\n }\n\n public value(o: OwnerType<Last<T>>) {\n let lastValue: Last<T> | undefined;\n\n const handleI = (index: number) => {\n const info = this.theInfos[index] as TheInformation<Last<T>>;\n const nextI = this.theInfos[index + 1] as\n | TheInformation<Last<T>>\n | undefined;\n\n info.value(\n new From((v) => {\n if (!nextI) {\n lastValue = v;\n }\n\n if (lastValue) {\n o.give(lastValue);\n }\n\n if (nextI && !lastValue) {\n handleI(index + 1);\n }\n }),\n );\n };\n\n handleI(0);\n\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which a function is applied in order\n * to control the value passing process\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class ExecutorApplied<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (executor: (v: T) => void) => (v: T) => void,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From(\n this.applier((v) => {\n o.give(v);\n }),\n ),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information whose value is being validated\n * via a predicate; if the predicate returns true, the value\n * can be passed to the output\n * https://silentium-lab.github.io/silentium/#/en/information/filtered\n */\nexport class Filtered<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private predicate: (v: T) => boolean,\n private defaultValue?: T,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n if (this.predicate(v)) {\n o.give(v);\n } else if (this.defaultValue !== undefined) {\n o.give(this.defaultValue);\n }\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * When receiving a reference to a function expecting a callback, the component\n * creates its own callback, and the data received in this callback\n * will become the value of the information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-callback\n */\nexport class FromCallback<T> extends TheInformation<T> {\n private theArgs: unknown[];\n\n public constructor(\n private waitForCb: (cb: (v: T) => any, ...args: unknown[]) => unknown,\n ...args: unknown[]\n ) {\n super(waitForCb);\n this.theArgs = args;\n }\n\n public value(o: OwnerType<T>): this {\n this.waitForCb(\n (v) => {\n o.give(v);\n },\n ...this.theArgs,\n );\n return this;\n }\n}\n","import { DestroyFunc } from \"../base/DestroyFunc\";\nimport { From, InformationType, Of, OwnerType, TheInformation } from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * A component that receives data from an event and\n * presents it as an information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-event\n */\nexport class FromEvent<T = unknown> extends TheInformation<T> {\n public constructor(\n private emitterSrc: InformationType<any>,\n private eventNameSrc: InformationType<string>,\n private subscribeMethodSrc: InformationType<string>,\n private unsubscribeMethodSrc: InformationType<string> = new Of(\"\"),\n ) {\n super(emitterSrc, eventNameSrc, subscribeMethodSrc, unsubscribeMethodSrc);\n }\n\n public value(o: OwnerType<T>): this {\n const a = new All(\n this.emitterSrc,\n this.eventNameSrc,\n this.subscribeMethodSrc,\n this.unsubscribeMethodSrc,\n );\n const handler = (v: T) => {\n o.give(v);\n };\n a.value(\n new From(([emitter, eventName, subscribe, unsubscribe]) => {\n emitter[subscribe](eventName, handler);\n this.addDep(\n new DestroyFunc(() => {\n emitter[unsubscribe](eventName, handler);\n }),\n );\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that gets a value from a promise and\n * presents it as information\n * https://silentium-lab.github.io/silentium/#/en/information/from-promise\n */\nexport class FromPromise<T> extends TheInformation<T> {\n public constructor(\n private p: Promise<T>,\n private errorOwner?: OwnerType,\n ) {\n super(p);\n }\n\n public value(o: OwnerType<T>): this {\n this.p\n .then((v) => {\n o.give(v);\n })\n .catch((e) => {\n this.errorOwner?.give(e);\n });\n return this;\n }\n}\n","import { From, OwnerType, TheInformation } from \"../base\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport class Late<T> extends TheInformation<T> implements OwnerType<T> {\n private theOwner?: OwnerType<T>;\n private lateOwner = new From((v: T) => {\n this.theValue = v;\n this.notify();\n });\n\n public constructor(private theValue?: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (this.theOwner) {\n throw new Error(\n \"Late component gets new owner, when another was already connected!\",\n );\n }\n this.theOwner = o;\n this.notify();\n return this;\n }\n\n public give(v: T) {\n this.theValue = v;\n this.lateOwner.give(v);\n return this;\n }\n\n private notify() {\n if (isFilled(this.theValue) && this.theOwner) {\n this.theOwner.give(this.theValue);\n }\n return this;\n }\n}\n","import { InformationType, Lazy } from \"../base\";\n\n/**\n * Lazy with applied function to its results\n */\nexport class LazyApplied<T> extends Lazy<T> {\n public constructor(\n private baseLazy: Lazy,\n private applier: (i: InformationType) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]): InformationType<T> {\n return this.applier(this.baseLazy.get(...args));\n }\n}\n","import { Lazy } from \"../base\";\n\n/**\n * Lazy instance from class constructor\n */\nexport class LazyClass<T> extends Lazy<T> {\n public constructor(constrFn: any) {\n const buildFn = (...args: unknown[]) => new constrFn(...args);\n super(buildFn);\n }\n}\n","import {\n From,\n InformationType,\n Lazy,\n Of,\n OwnerType,\n TheInformation,\n} from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n * https://silentium-lab.github.io/silentium/#/en/information/map\n */\nexport class Map<T, TG> extends TheInformation<TG[]> {\n public constructor(\n private baseSrc: InformationType<T[]>,\n private targetSrc: Lazy<TG>,\n ) {\n super(baseSrc, targetSrc);\n }\n\n public value(o: OwnerType<TG[]>) {\n this.baseSrc.value(\n new From((v) => {\n const infos: InformationType<TG>[] = [];\n v.forEach((val) => {\n let valInfo: InformationType<T> | T = val;\n if (!(valInfo instanceof TheInformation)) {\n valInfo = new Of(valInfo);\n }\n const info = this.targetSrc.get(valInfo);\n infos.push(info);\n });\n const allI = new All(...infos);\n allI.value(o);\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n * https://silentium-lab.github.io/silentium/#/en/information/once\n */\nexport class Once<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T>) {\n super();\n }\n\n public value(o: OwnerType<T>): this {\n let isFilled = false;\n this.baseSrc.value(\n new From((v) => {\n if (!isFilled) {\n isFilled = true;\n o.give(v);\n }\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * A component that takes one value at a time and returns\n * an array of all previous values\n * https://silentium-lab.github.io/silentium/#/en/information/sequence\n */\nexport class Sequence<T> extends TheInformation<T[]> {\n public constructor(private baseSrc: InformationType<T>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T[]>): this {\n const result: T[] = [];\n this.baseSrc.value(\n new From((v) => {\n result.push(v);\n o.give(result);\n }),\n );\n return this;\n }\n}\n","import { isFilled, OwnerPool } from \"../helpers\";\nimport {\n From,\n InformationType,\n OfFunc,\n OwnerType,\n TheInformation,\n} from \"../base\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n * https://silentium-lab.github.io/silentium/#/en/information/pool\n */\nexport class Shared<T> extends TheInformation<T> implements OwnerType<T> {\n private lastValue: T | undefined;\n private ownersPool = new OwnerPool<T>();\n\n public constructor(\n private baseSrc: InformationType<T>,\n private stateless = false,\n ) {\n super(baseSrc);\n this.addDep(this.ownersPool);\n this.baseSrc.value(\n new From((v) => {\n this.ownersPool.owner().give(v);\n this.lastValue = v;\n }),\n );\n }\n\n public value(o: OwnerType<T>): this {\n const i = new OfFunc((g: OwnerType<T>) => {\n if (\n !this.stateless &&\n isFilled(this.lastValue) &&\n !this.ownersPool.has(g)\n ) {\n g.give(this.lastValue);\n }\n this.ownersPool.add(g);\n return () => {\n this.ownersPool.remove(g);\n };\n });\n i.value(o);\n this.addDep(i);\n\n return this;\n }\n\n public pool() {\n return this.ownersPool;\n }\n\n public give(value: T) {\n this.lastValue = value;\n this.ownersPool.owner().give(value);\n return this;\n }\n}\n","import { Shared } from \"../components/Shared\";\nimport { OwnerType, SourceType, TheInformation } from \"../base\";\n\nexport class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {\n private sharedSrc: Shared<T>;\n\n public constructor(baseSrc: SourceType<T>, stateless = false) {\n const sharedSrc = new Shared(baseSrc, stateless);\n super(sharedSrc);\n this.sharedSrc = sharedSrc;\n }\n\n public value(o: OwnerType<T>): this {\n this.sharedSrc.value(o);\n return this;\n }\n\n public give(value: T): this {\n this.sharedSrc.give(value);\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that receives a data array and yields values one by one\n * https://silentium-lab.github.io/silentium/#/en/information/stream\n */\nexport class Stream<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T[]>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n v.forEach((cv) => {\n o.give(cv);\n });\n }),\n );\n return this;\n }\n}\n"],"names":["__publicField"],"mappings":";;;AAAA,MAAM,aAAA,GAAgB,CAAC,GAAqC,KAAA;AAC1D,EAAA,OAAO,OAAO,GAAA,KAAQ,QAAY,IAAA,GAAA,KAAQ,QAAQ,SAAa,IAAA,GAAA;AACjE,CAAA;AAKO,MAAM,WA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AO,KAAA;AAChB,UAAA,CAAA,CAAE,KAAK,EAAE,CAAA;AAAA,SACV,CAAA;AAAA,OACF;AAAA,KACH;AACA,IAAO,OAAA,IAAA;AAAA;AAEX;;;;"}
1
+ {"version":3,"file":"silentium.mjs","sources":["../src/base/Destroyable.ts","../src/base/DestroyFunc.ts","../src/base/TheOwner.ts","../src/base/From.ts","../src/base/TheInformation.ts","../src/helpers/isFilled.ts","../src/helpers/OwnerPool.ts","../src/base/Of.ts","../src/base/Lazy.ts","../src/base/OfFunc.ts","../src/base/Void.ts","../src/base/On.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/Chain.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromCallback.ts","../src/components/FromEvent.ts","../src/components/FromPromise.ts","../src/components/Late.ts","../src/components/LazyApplied.ts","../src/components/LazyClass.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Shared.ts","../src/components/SharedSource.ts","../src/components/Stream.ts"],"sourcesContent":["const isDestroyable = (dep: unknown): dep is Destroyable => {\n return typeof dep === \"object\" && dep !== null && \"destroy\" in dep;\n};\n\n/**\n * Representation of Destroyable object\n */\nexport class Destroyable {\n private theDeps: any[];\n public constructor(...deps: any[]) {\n this.theDeps = deps ?? [];\n }\n\n public destroy() {\n this.theDeps?.forEach((dep) => {\n if (isDestroyable(dep)) {\n dep.destroy();\n }\n });\n return this;\n }\n\n /**\n * Add dependency what can be destroyed\n */\n public addDep(dep: any) {\n this.theDeps?.push(dep);\n return this;\n }\n\n public dep(dep: any) {\n this.addDep(dep);\n return dep;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\n\n/**\n * Representation of destructor function as object\n */\nexport class DestroyFunc extends Destroyable {\n public constructor(private destructor: () => void) {\n super();\n }\n\n public destroy(): this {\n this.destructor();\n return this;\n }\n}\n","export interface OwnerType<T = unknown> {\n give(value: T): this;\n}\n\n/**\n * Representation of Information Owner\n */\nexport abstract class TheOwner<T = unknown> implements OwnerType<T> {\n public abstract give(value: T): this;\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Owner from function\n */\nexport class From<T = unknown> extends TheOwner<T> {\n public constructor(private fn: (value: T) => void) {\n super();\n }\n\n public give(value: T): this {\n this.fn(value);\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { OwnerType } from \"./TheOwner\";\n\nexport interface InformationType<T = unknown> {\n value(o: OwnerType<T>): this;\n}\n\nexport type MaybeInformationType<T = unknown> = InformationType<T> | T;\n\n/**\n * Representation of Information\n */\nexport abstract class TheInformation<T = unknown>\n extends Destroyable\n implements InformationType<T>\n{\n public abstract value(o: OwnerType<T>): this;\n}\n\nexport class MbInfo<T> extends TheInformation<T> {\n private info: InformationType<T>;\n\n public constructor(theInfo: MaybeInformationType<T>) {\n const info =\n typeof theInfo === \"object\" &&\n theInfo !== null &&\n \"value\" in theInfo &&\n typeof theInfo.value === \"function\"\n ? theInfo\n : new Of(theInfo);\n super(info);\n this.info = info;\n }\n\n public value(o: OwnerType<T>): this {\n this.info.value(o);\n return this;\n }\n}\n","export const isFilled = <T>(value?: T): value is T => {\n return value !== undefined && value !== null;\n};\n","import { From, OwnerType } from \"../base\";\n\n/**\n * Helps maintain an owner list allowing different\n * owners to get information from a common source\n * https://silentium-lab.github.io/silentium/#/en/utils/owner-pool\n */\nexport class OwnerPool<T> {\n private owners: Set<OwnerType<T>>;\n private innerOwner: OwnerType<T>;\n\n public constructor() {\n this.owners = new Set<OwnerType<T>>();\n this.innerOwner = new From((v) => {\n this.owners.forEach((g) => {\n g.give(v);\n });\n });\n }\n\n public owner() {\n return this.innerOwner;\n }\n\n public size(): number {\n return this.owners.size;\n }\n\n public has(owner: OwnerType<T>): boolean {\n return this.owners.has(owner);\n }\n\n public add(owner: OwnerType<T>) {\n this.owners.add(owner);\n return this;\n }\n\n public remove(g: OwnerType<T>) {\n this.owners.delete(g);\n return this;\n }\n\n public destroy() {\n this.owners.forEach((g) => {\n this.remove(g);\n });\n return this;\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * Information from primitive value\n */\nexport class Of<T> extends TheInformation<T> {\n public constructor(private theValue: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (isFilled(this.theValue)) {\n o.give(this.theValue);\n }\n return this;\n }\n}\n","import { Destroyable } from \"./Destroyable\";\nimport { Of } from \"./Of\";\nimport { InformationType } from \"./TheInformation\";\n\n/**\n * Ability to create information after some event\n */\nexport class Lazy<T = unknown> extends Destroyable {\n public constructor(\n protected buildFn?: (...args: InformationType[]) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]) {\n args.forEach((dep) => {\n this.addDep(dep);\n });\n return this.buildFn?.(...args) ?? (new Of(null) as InformationType<T>);\n }\n}\n","import { OwnerType } from \"./TheOwner\";\nimport { TheInformation } from \"./TheInformation\";\n\ntype DestructorFnType = () => void;\n\n/**\n * Information of function\n */\nexport class OfFunc<T> extends TheInformation<T> {\n private mbDestructor?: DestructorFnType | void;\n\n public constructor(\n private valueFn: (o: OwnerType<T>) => DestructorFnType | undefined | void,\n ) {\n super(valueFn);\n }\n\n public value(o: OwnerType<T>): this {\n this.mbDestructor = this.valueFn(o);\n return this;\n }\n\n public destroy(): this {\n super.destroy();\n this.mbDestructor?.();\n return this;\n }\n}\n","import { TheOwner } from \"./TheOwner\";\n\n/**\n * Silent owner\n */\nexport class Void extends TheOwner {\n public give(): this {\n return this;\n }\n}\n","import { Destroyable } from \"../base/Destroyable\";\nimport { From } from \"../base/From\";\nimport { InformationType } from \"../base/TheInformation\";\nimport { Void } from \"../base/Void\";\n\n/**\n * Run information with functional owner if needed\n */\nexport class On<T = unknown> extends Destroyable {\n public constructor(src: InformationType<T>, fn?: (value: T) => void) {\n super(src, fn);\n src.value(fn ? new From(fn) : new Void());\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\ntype ExtractTypeS<T> = T extends InformationType<infer U> ? U : never;\n\nexport type ExtractTypesFromArrayS<T extends InformationType<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\n/**\n * Combines multiple information sources into a single unified source\n * represented as an array containing values from all sources\n * https://silentium-lab.github.io/silentium/#/en/information/all\n */\nexport class All<const T extends InformationType[]> extends TheInformation<\n ExtractTypesFromArrayS<T>\n> {\n private keysKnown: Set<string>;\n private keysFilled = new Set();\n private infos: T;\n\n public constructor(...theInfos: T) {\n super(theInfos);\n this.infos = theInfos;\n this.keysKnown = new Set<string>(Object.keys(theInfos));\n }\n\n public value(o: OwnerType<ExtractTypesFromArrayS<T>>): this {\n const result: Record<string, unknown> = {};\n\n Object.entries(this.infos).forEach(([key, info]) => {\n this.keysKnown.add(key);\n info.value(\n new From((v) => {\n this.keysFilled.add(key);\n result[key] = v;\n if (this.isAllFilled()) {\n o.give(Object.values(result) as ExtractTypesFromArrayS<T>);\n }\n }),\n );\n });\n return this;\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * From a set of information sources we get\n * a common response from any source for a single owner\n * https://silentium-lab.github.io/silentium/#/en/information/any\n */\nexport class Any<T> extends TheInformation<T> {\n private infos: InformationType<T>[];\n\n public constructor(...theInfos: InformationType<T>[]) {\n super(theInfos);\n this.infos = theInfos;\n }\n\n public value(o: OwnerType<T>): this {\n this.infos.forEach((info) => {\n info.value(o);\n });\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which the function was applied to change the value\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Applied<T, R> extends TheInformation<R> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (v: T) => R,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<R>): this {\n this.baseSrc.value(\n new From((v) => {\n o.give(this.applier(v));\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends any[]> = T extends [...infer U, infer L] ? L : never;\n\n/**\n * The set of information sources forms a sequential chain where each source provides\n * an answer. The final answer will be the output result. If any source in the chain\n * provides a new answer, the component's overall response will be repeated.\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class Chain<T extends InformationType[]> extends TheInformation<\n Last<T>\n> {\n private theInfos: T;\n\n public constructor(...infos: T) {\n super(infos);\n this.theInfos = infos;\n }\n\n public value(o: OwnerType<Last<T>>) {\n let lastValue: Last<T> | undefined;\n\n const handleI = (index: number) => {\n const info = this.theInfos[index] as TheInformation<Last<T>>;\n const nextI = this.theInfos[index + 1] as\n | TheInformation<Last<T>>\n | undefined;\n\n info.value(\n new From((v) => {\n if (!nextI) {\n lastValue = v;\n }\n\n if (lastValue) {\n o.give(lastValue);\n }\n\n if (nextI && !lastValue) {\n handleI(index + 1);\n }\n }),\n );\n };\n\n handleI(0);\n\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information to which a function is applied in order\n * to control the value passing process\n * https://silentium-lab.github.io/silentium/#/en/information/applied\n */\nexport class ExecutorApplied<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private applier: (executor: (v: T) => void) => (v: T) => void,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From(\n this.applier((v) => {\n o.give(v);\n }),\n ),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Information whose value is being validated\n * via a predicate; if the predicate returns true, the value\n * can be passed to the output\n * https://silentium-lab.github.io/silentium/#/en/information/filtered\n */\nexport class Filtered<T> extends TheInformation<T> {\n public constructor(\n private baseSrc: InformationType<T>,\n private predicate: (v: T) => boolean,\n private defaultValue?: T,\n ) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n if (this.predicate(v)) {\n o.give(v);\n } else if (this.defaultValue !== undefined) {\n o.give(this.defaultValue);\n }\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * When receiving a reference to a function expecting a callback, the component\n * creates its own callback, and the data received in this callback\n * will become the value of the information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-callback\n */\nexport class FromCallback<T> extends TheInformation<T> {\n private theArgs: unknown[];\n\n public constructor(\n private waitForCb: (cb: (v: T) => any, ...args: unknown[]) => unknown,\n ...args: unknown[]\n ) {\n super(waitForCb);\n this.theArgs = args;\n }\n\n public value(o: OwnerType<T>): this {\n this.waitForCb(\n (v) => {\n o.give(v);\n },\n ...this.theArgs,\n );\n return this;\n }\n}\n","import { DestroyFunc } from \"../base/DestroyFunc\";\nimport { From, InformationType, Of, OwnerType, TheInformation } from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * A component that receives data from an event and\n * presents it as an information object\n * https://silentium-lab.github.io/silentium/#/en/information/from-event\n */\nexport class FromEvent<T = unknown> extends TheInformation<T> {\n public constructor(\n private emitterSrc: InformationType<any>,\n private eventNameSrc: InformationType<string>,\n private subscribeMethodSrc: InformationType<string>,\n private unsubscribeMethodSrc: InformationType<string> = new Of(\"\"),\n ) {\n super(emitterSrc, eventNameSrc, subscribeMethodSrc, unsubscribeMethodSrc);\n }\n\n public value(o: OwnerType<T>): this {\n const a = new All(\n this.emitterSrc,\n this.eventNameSrc,\n this.subscribeMethodSrc,\n this.unsubscribeMethodSrc,\n );\n const handler = (v: T) => {\n o.give(v);\n };\n a.value(\n new From(([emitter, eventName, subscribe, unsubscribe]) => {\n emitter[subscribe](eventName, handler);\n this.addDep(\n new DestroyFunc(() => {\n emitter[unsubscribe](eventName, handler);\n }),\n );\n }),\n );\n return this;\n }\n}\n","import { OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that gets a value from a promise and\n * presents it as information\n * https://silentium-lab.github.io/silentium/#/en/information/from-promise\n */\nexport class FromPromise<T> extends TheInformation<T> {\n public constructor(\n private p: Promise<T>,\n private errorOwner?: OwnerType,\n ) {\n super(p);\n }\n\n public value(o: OwnerType<T>): this {\n this.p\n .then((v) => {\n o.give(v);\n })\n .catch((e) => {\n this.errorOwner?.give(e);\n });\n return this;\n }\n}\n","import { From, OwnerType, TheInformation } from \"../base\";\nimport { isFilled } from \"../helpers\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport class Late<T> extends TheInformation<T> implements OwnerType<T> {\n private theOwner?: OwnerType<T>;\n private lateOwner = new From((v: T) => {\n this.theValue = v;\n this.notify();\n });\n\n public constructor(private theValue?: T) {\n super(theValue);\n }\n\n public value(o: OwnerType<T>): this {\n if (this.theOwner) {\n throw new Error(\n \"Late component gets new owner, when another was already connected!\",\n );\n }\n this.theOwner = o;\n this.notify();\n return this;\n }\n\n public give(v: T) {\n this.theValue = v;\n this.lateOwner.give(v);\n return this;\n }\n\n private notify() {\n if (isFilled(this.theValue) && this.theOwner) {\n this.theOwner.give(this.theValue);\n }\n return this;\n }\n}\n","import { InformationType, Lazy } from \"../base\";\n\n/**\n * Lazy with applied function to its results\n */\nexport class LazyApplied<T> extends Lazy<T> {\n public constructor(\n private baseLazy: Lazy,\n private applier: (i: InformationType) => InformationType<T>,\n ) {\n super();\n }\n\n public get(...args: InformationType[]): InformationType<T> {\n return this.applier(this.baseLazy.get(...args));\n }\n}\n","import { Lazy } from \"../base\";\n\n/**\n * Lazy instance from class constructor\n */\nexport class LazyClass<T> extends Lazy<T> {\n public constructor(constrFn: any) {\n const buildFn = (...args: unknown[]) => new constrFn(...args);\n super(buildFn);\n }\n}\n","import {\n From,\n InformationType,\n Lazy,\n Of,\n OwnerType,\n TheInformation,\n} from \"../base\";\nimport { All } from \"./All\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n * https://silentium-lab.github.io/silentium/#/en/information/map\n */\nexport class Map<T, TG> extends TheInformation<TG[]> {\n public constructor(\n private baseSrc: InformationType<T[]>,\n private targetSrc: Lazy<TG>,\n ) {\n super(baseSrc, targetSrc);\n }\n\n public value(o: OwnerType<TG[]>) {\n this.baseSrc.value(\n new From((v) => {\n const infos: InformationType<TG>[] = [];\n v.forEach((val) => {\n let valInfo: InformationType<T> | T = val;\n if (!(valInfo instanceof TheInformation)) {\n valInfo = new Of(valInfo);\n }\n const info = this.targetSrc.get(valInfo);\n infos.push(info);\n });\n const allI = new All(...infos);\n allI.value(o);\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n * https://silentium-lab.github.io/silentium/#/en/information/once\n */\nexport class Once<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T>) {\n super();\n }\n\n public value(o: OwnerType<T>): this {\n let isFilled = false;\n this.baseSrc.value(\n new From((v) => {\n if (!isFilled) {\n isFilled = true;\n o.give(v);\n }\n }),\n );\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * A component that takes one value at a time and returns\n * an array of all previous values\n * https://silentium-lab.github.io/silentium/#/en/information/sequence\n */\nexport class Sequence<T> extends TheInformation<T[]> {\n public constructor(private baseSrc: InformationType<T>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T[]>): this {\n const result: T[] = [];\n this.baseSrc.value(\n new From((v) => {\n result.push(v);\n o.give(result);\n }),\n );\n return this;\n }\n}\n","import { isFilled, OwnerPool } from \"../helpers\";\nimport {\n From,\n InformationType,\n OfFunc,\n OwnerType,\n TheInformation,\n} from \"../base\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n * https://silentium-lab.github.io/silentium/#/en/information/pool\n */\nexport class Shared<T> extends TheInformation<T> implements OwnerType<T> {\n private lastValue: T | undefined;\n private ownersPool = new OwnerPool<T>();\n\n public constructor(\n private baseSrc: InformationType<T>,\n private stateless = false,\n ) {\n super(baseSrc);\n this.addDep(this.ownersPool);\n this.baseSrc.value(\n new From((v) => {\n this.ownersPool.owner().give(v);\n this.lastValue = v;\n }),\n );\n }\n\n public value(o: OwnerType<T>): this {\n const i = new OfFunc((g: OwnerType<T>) => {\n if (\n !this.stateless &&\n isFilled(this.lastValue) &&\n !this.ownersPool.has(g)\n ) {\n g.give(this.lastValue);\n }\n this.ownersPool.add(g);\n return () => {\n this.ownersPool.remove(g);\n };\n });\n i.value(o);\n this.addDep(i);\n\n return this;\n }\n\n public pool() {\n return this.ownersPool;\n }\n\n public give(value: T) {\n this.lastValue = value;\n this.ownersPool.owner().give(value);\n return this;\n }\n}\n","import { Shared } from \"../components/Shared\";\nimport { OwnerType, SourceType, TheInformation } from \"../base\";\n\nexport class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {\n private sharedSrc: Shared<T>;\n\n public constructor(\n private baseSrc: SourceType<T>,\n stateless = false,\n ) {\n const sharedSrc = new Shared(baseSrc, stateless);\n super(sharedSrc);\n this.sharedSrc = sharedSrc;\n }\n\n public value(o: OwnerType<T>): this {\n this.sharedSrc.value(o);\n return this;\n }\n\n public give(value: T): this {\n this.baseSrc.give(value);\n this.sharedSrc.give(value);\n return this;\n }\n}\n","import { From, InformationType, OwnerType, TheInformation } from \"../base\";\n\n/**\n * Component that receives a data array and yields values one by one\n * https://silentium-lab.github.io/silentium/#/en/information/stream\n */\nexport class Stream<T> extends TheInformation<T> {\n public constructor(private baseSrc: InformationType<T[]>) {\n super(baseSrc);\n }\n\n public value(o: OwnerType<T>): this {\n this.baseSrc.value(\n new From((v) => {\n v.forEach((cv) => {\n o.give(cv);\n });\n }),\n );\n return this;\n }\n}\n"],"names":["__publicField"],"mappings":";;;AAAA,MAAM,aAAA,GAAgB,CAAC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,CAAA;AADY,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA;AAE3B,EAEO,MAAM,CAAuB,EAAA;AAClC,IAAA,IAAA,CAAK,OAAQ,CAAA,KAAA;AAAA,MACX,IAAI,IAAK,CAAA,CAAC,CAAM,KAAA;AACd,QAAE,CAAA,CAAA,OAAA,CAAQ,CAAC,EAAO,KAAA;AAChB,UAAA,CAAA,CAAE,KAAK,EAAE,CAAA;AAAA,SACV,CAAA;AAAA,OACF;AAAA,KACH;AACA,IAAO,OAAA,IAAA;AAAA;AAEX;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "silentium",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -4,7 +4,10 @@ import { OwnerType, SourceType, TheInformation } from "../base";
4
4
  export class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {
5
5
  private sharedSrc: Shared<T>;
6
6
 
7
- public constructor(baseSrc: SourceType<T>, stateless = false) {
7
+ public constructor(
8
+ private baseSrc: SourceType<T>,
9
+ stateless = false,
10
+ ) {
8
11
  const sharedSrc = new Shared(baseSrc, stateless);
9
12
  super(sharedSrc);
10
13
  this.sharedSrc = sharedSrc;
@@ -16,6 +19,7 @@ export class SharedSource<T> extends TheInformation<T> implements OwnerType<T> {
16
19
  }
17
20
 
18
21
  public give(value: T): this {
22
+ this.baseSrc.give(value);
19
23
  this.sharedSrc.give(value);
20
24
  return this;
21
25
  }