1 line
12 KiB
JSON
1 line
12 KiB
JSON
{"ast":null,"code":"import { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nexport class SubjectSubscriber extends Subscriber {\n constructor(destination) {\n super(destination);\n this.destination = destination;\n }\n\n}\nexport class Subject extends Observable {\n constructor() {\n super();\n this.observers = [];\n this.closed = false;\n this.isStopped = false;\n this.hasError = false;\n this.thrownError = null;\n }\n\n [rxSubscriberSymbol]() {\n return new SubjectSubscriber(this);\n }\n\n lift(operator) {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n }\n\n next(value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n\n if (!this.isStopped) {\n const {\n observers\n } = this;\n const len = observers.length;\n const copy = observers.slice();\n\n for (let i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n }\n\n error(err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n const {\n observers\n } = this;\n const len = observers.length;\n const copy = observers.slice();\n\n for (let i = 0; i < len; i++) {\n copy[i].error(err);\n }\n\n this.observers.length = 0;\n }\n\n complete() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n\n this.isStopped = true;\n const {\n observers\n } = this;\n const len = observers.length;\n const copy = observers.slice();\n\n for (let i = 0; i < len; i++) {\n copy[i].complete();\n }\n\n this.observers.length = 0;\n }\n\n unsubscribe() {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n }\n\n _trySubscribe(subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else {\n return super._trySubscribe(subscriber);\n }\n }\n\n _subscribe(subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n } else if (this.isStopped) {\n subscriber.complete();\n return Subscription.EMPTY;\n } else {\n this.observers.push(subscriber);\n return new SubjectSubscription(this, subscriber);\n }\n }\n\n asObservable() {\n const observable = new Observable();\n observable.source = this;\n return observable;\n }\n\n}\n\nSubject.create = (destination, source) => {\n return new AnonymousSubject(destination, source);\n};\n\nexport class AnonymousSubject extends Subject {\n constructor(destination, source) {\n super();\n this.destination = destination;\n this.source = source;\n }\n\n next(value) {\n const {\n destination\n } = this;\n\n if (destination && destination.next) {\n destination.next(value);\n }\n }\n\n error(err) {\n const {\n destination\n } = this;\n\n if (destination && destination.error) {\n this.destination.error(err);\n }\n }\n\n complete() {\n const {\n destination\n } = this;\n\n if (destination && destination.complete) {\n this.destination.complete();\n }\n }\n\n _subscribe(subscriber) {\n const {\n source\n } = this;\n\n if (source) {\n return this.source.subscribe(subscriber);\n } else {\n return Subscription.EMPTY;\n }\n }\n\n}","map":{"version":3,"names":["Observable","Subscriber","Subscription","ObjectUnsubscribedError","SubjectSubscription","rxSubscriber","rxSubscriberSymbol","SubjectSubscriber","constructor","destination","Subject","observers","closed","isStopped","hasError","thrownError","lift","operator","subject","AnonymousSubject","next","value","len","length","copy","slice","i","error","err","complete","unsubscribe","_trySubscribe","subscriber","_subscribe","EMPTY","push","asObservable","observable","source","create","subscribe"],"sources":["D:/MobileDev/WRB/WrenchBoard2023a/node_modules/rxjs/_esm2015/internal/Subject.js"],"sourcesContent":["import { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nexport class SubjectSubscriber extends Subscriber {\n constructor(destination) {\n super(destination);\n this.destination = destination;\n }\n}\nexport class Subject extends Observable {\n constructor() {\n super();\n this.observers = [];\n this.closed = false;\n this.isStopped = false;\n this.hasError = false;\n this.thrownError = null;\n }\n [rxSubscriberSymbol]() {\n return new SubjectSubscriber(this);\n }\n lift(operator) {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n }\n next(value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n }\n error(err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n }\n complete() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.isStopped = true;\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n }\n unsubscribe() {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n }\n _trySubscribe(subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else {\n return super._trySubscribe(subscriber);\n }\n }\n _subscribe(subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n }\n else if (this.isStopped) {\n subscriber.complete();\n return Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n return new SubjectSubscription(this, subscriber);\n }\n }\n asObservable() {\n const observable = new Observable();\n observable.source = this;\n return observable;\n }\n}\nSubject.create = (destination, source) => {\n return new AnonymousSubject(destination, source);\n};\nexport class AnonymousSubject extends Subject {\n constructor(destination, source) {\n super();\n this.destination = destination;\n this.source = source;\n }\n next(value) {\n const { destination } = this;\n if (destination && destination.next) {\n destination.next(value);\n }\n }\n error(err) {\n const { destination } = this;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n }\n complete() {\n const { destination } = this;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n }\n _subscribe(subscriber) {\n const { source } = this;\n if (source) {\n return this.source.subscribe(subscriber);\n }\n else {\n return Subscription.EMPTY;\n }\n }\n}\n"],"mappings":"AAAA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,uBAAT,QAAwC,gCAAxC;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,YAAY,IAAIC,kBAAzB,QAAmD,iCAAnD;AACA,OAAO,MAAMC,iBAAN,SAAgCN,UAAhC,CAA2C;EAC9CO,WAAW,CAACC,WAAD,EAAc;IACrB,MAAMA,WAAN;IACA,KAAKA,WAAL,GAAmBA,WAAnB;EACH;;AAJ6C;AAMlD,OAAO,MAAMC,OAAN,SAAsBV,UAAtB,CAAiC;EACpCQ,WAAW,GAAG;IACV;IACA,KAAKG,SAAL,GAAiB,EAAjB;IACA,KAAKC,MAAL,GAAc,KAAd;IACA,KAAKC,SAAL,GAAiB,KAAjB;IACA,KAAKC,QAAL,GAAgB,KAAhB;IACA,KAAKC,WAAL,GAAmB,IAAnB;EACH;;EACkB,CAAlBT,kBAAkB,IAAI;IACnB,OAAO,IAAIC,iBAAJ,CAAsB,IAAtB,CAAP;EACH;;EACDS,IAAI,CAACC,QAAD,EAAW;IACX,MAAMC,OAAO,GAAG,IAAIC,gBAAJ,CAAqB,IAArB,EAA2B,IAA3B,CAAhB;IACAD,OAAO,CAACD,QAAR,GAAmBA,QAAnB;IACA,OAAOC,OAAP;EACH;;EACDE,IAAI,CAACC,KAAD,EAAQ;IACR,IAAI,KAAKT,MAAT,EAAiB;MACb,MAAM,IAAIT,uBAAJ,EAAN;IACH;;IACD,IAAI,CAAC,KAAKU,SAAV,EAAqB;MACjB,MAAM;QAAEF;MAAF,IAAgB,IAAtB;MACA,MAAMW,GAAG,GAAGX,SAAS,CAACY,MAAtB;MACA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