Kargi-Sitesi/.angular/cache/18.2.11/babel-webpack/5103249b126f40297a73867352592498aafd486b0010f0787af2df36b1bdd70e.json

1 line
12 KiB
JSON
Raw Permalink Normal View History

2024-11-04 02:30:09 +00:00
{"ast":null,"code":"import { Subject } from '../Subject';\nimport { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function windowToggle(openings, closingSelector) {\n return source => source.lift(new WindowToggleOperator(openings, closingSelector));\n}\nclass WindowToggleOperator {\n constructor(openings, closingSelector) {\n this.openings = openings;\n this.closingSelector = closingSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector));\n }\n}\nclass WindowToggleSubscriber extends OuterSubscriber {\n constructor(destination, openings, closingSelector) {\n super(destination);\n this.openings = openings;\n this.closingSelector = closingSelector;\n this.contexts = [];\n this.add(this.openSubscription = subscribeToResult(this, openings, openings));\n }\n _next(value) {\n const {\n contexts\n } = this;\n if (contexts) {\n const len = contexts.length;\n for (let i = 0; i < len; i++) {\n contexts[i].window.next(value);\n }\n }\n }\n _error(err) {\n const {\n contexts\n } = this;\n this.contexts = null;\n if (contexts) {\n const len = contexts.length;\n let index = -1;\n while (++index < len) {\n const context = contexts[index];\n context.window.error(err);\n context.subscription.unsubscribe();\n }\n }\n super._error(err);\n }\n _complete() {\n const {\n contexts\n } = this;\n this.contexts = null;\n if (contexts) {\n const len = contexts.length;\n let index = -1;\n while (++index < len) {\n const context = contexts[index];\n context.window.complete();\n context.subscription.unsubscribe();\n }\n }\n super._complete();\n }\n _unsubscribe() {\n const {\n contexts\n } = this;\n this.contexts = null;\n if (contexts) {\n const len = contexts.length;\n let index = -1;\n while (++index < len) {\n const context = contexts[index];\n context.window.unsubscribe();\n context.subscription.unsubscribe();\n }\n }\n }\n notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n if (outerValue === this.openings) {\n let closingNotifier;\n try {\n const {\n closingSelector\n } = this;\n closingNotifier = closingSelector(innerValue);\n } catch (e) {\n return this.error(e);\n }\n const window = new Subject();\n const subscription = new Subscription();\n const context = {\n window,\n subscription\n };\n this.contexts.push(context);\n const innerSubscription = subscribeToResult(this, closingNotifier, context);\n if (innerSubscription.closed) {\n this.closeWindow(this.contexts.length - 1);\n } else {\n innerSubscription.context = context;\n subscription.add(innerSubscription);\n }\n this.destination.next(window);\n } else {\n this.closeWindow(this.contexts.indexOf(outerValue));\n }\n }\n notifyError(err) {\n this.error(err);\n }\n notifyComplete(inner) {\n if (inner !== this.openSubscription) {\n this.closeWindow(this.contexts.indexOf(inner.context));\n }\n }\n closeWindow(index) {\n if (index === -1) {\n return;\n }\n const {\n contexts\n } = this;\n const context = contexts[index];\n const {\n window,\n subscription\n } = context;\n contexts.splice(index, 1);\n window.complete();\n subscription.unsubscribe();\n }\n}","map":{"version":3,"names":["Subject","Subscription","OuterSubscriber","subscribeToResult","windowToggle","openings","closingSelector","source","lift","WindowToggleOperator","constructor","call","subscriber","subscribe","WindowToggleSubscriber","destination","contexts","add","openSubscription","_next","value","len","length","i",