1 line
No EOL
16 KiB
JSON
1 line
No EOL
16 KiB
JSON
{"ast":null,"code":"import { Subject } from '../Subject';\nimport { async } from '../scheduler/async';\nimport { Subscriber } from '../Subscriber';\nimport { isNumeric } from '../util/isNumeric';\nimport { isScheduler } from '../util/isScheduler';\nexport function windowTime(windowTimeSpan) {\n let scheduler = async;\n let windowCreationInterval = null;\n let maxWindowSize = Number.POSITIVE_INFINITY;\n if (isScheduler(arguments[3])) {\n scheduler = arguments[3];\n }\n if (isScheduler(arguments[2])) {\n scheduler = arguments[2];\n } else if (isNumeric(arguments[2])) {\n maxWindowSize = Number(arguments[2]);\n }\n if (isScheduler(arguments[1])) {\n scheduler = arguments[1];\n } else if (isNumeric(arguments[1])) {\n windowCreationInterval = Number(arguments[1]);\n }\n return function windowTimeOperatorFunction(source) {\n return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));\n };\n}\nclass WindowTimeOperator {\n constructor(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {\n this.windowTimeSpan = windowTimeSpan;\n this.windowCreationInterval = windowCreationInterval;\n this.maxWindowSize = maxWindowSize;\n this.scheduler = scheduler;\n }\n call(subscriber, source) {\n return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));\n }\n}\nclass CountedSubject extends Subject {\n constructor() {\n super(...arguments);\n this._numberOfNextedValues = 0;\n }\n next(value) {\n this._numberOfNextedValues++;\n super.next(value);\n }\n get numberOfNextedValues() {\n return this._numberOfNextedValues;\n }\n}\nclass WindowTimeSubscriber extends Subscriber {\n constructor(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {\n super(destination);\n this.destination = destination;\n this.windowTimeSpan = windowTimeSpan;\n this.windowCreationInterval = windowCreationInterval;\n this.maxWindowSize = maxWindowSize;\n this.scheduler = scheduler;\n this.windows = [];\n const window = this.openWindow();\n if (windowCreationInterval !== null && windowCreationInterval >= 0) {\n const closeState = {\n subscriber: this,\n window,\n context: null\n };\n const creationState = {\n windowTimeSpan,\n windowCreationInterval,\n subscriber: this,\n scheduler\n };\n this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));\n this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));\n } else {\n const timeSpanOnlyState = {\n subscriber: this,\n window,\n windowTimeSpan\n };\n this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));\n }\n }\n _next(value) {\n const windows = this.windows;\n const len = windows.length;\n for (let i = 0; i < len; i++) {\n const window = windows[i];\n if (!window.closed) {\n window.next(value);\n if (window.numberOfNextedValues >= this.maxWindowSize) {\n this.closeWindow(window);\n }\n }\n }\n }\n _error(err) {\n const windows = this.windows;\n while (windows.length > 0) {\n windows.shift().error(err);\n }\n this.destination.error(err);\n }\n _complete() {\n const windows = this.windows;\n while (windows.length > 0) {\n const window = windows.shift();\n if (!window.closed) {\n window.complete();\n }\n }\n this.destination.complete();\n }\n openWindow() {\n const window = new CountedSubject();\n this.windows.push(window);\n const destination = this.destination;\n destination.next(window);\n return window;\n }\n closeWindow(window) {\n window.complete();\n const windows = this.windows;\n windows.splice(windows.indexOf(window), 1);\n }\n}\nfunction dispatchWindowTimeSpanOnly(state) {\n const {\n subscriber,\n windowTimeSpan,\n window\n } = state;\n if (window) {\n subscriber.closeWindow(window);\n }\n state.window = subscriber.openWindow();\n this.schedule(state, windowTimeSpan);\n}\nfunction dispatchWindowCreation(state) {\n const {\n windowTimeSpan,\n subscriber,\n scheduler,\n windowCreationInterval\n } = state;\n const window = subscriber.openWindow();\n const action = this;\n let context = {\n action,\n subscription: null\n };\n const timeSpanState = {\n subscriber,\n window,\n context\n };\n context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);\n action.add(context.subscription);\n action.schedule(state, windowCreationInterval);\n}\nfunction dispatchWindowClose(state) {\n const {\n subscriber,\n window,\n context\n } = state;\n if (context && context.action && context.subscription) {\n context.action.remove(context.subscription);\n }\n subscriber.closeWindow(window);\n}","map":{"version":3,"names":["Subject","async","Subscriber","isNumeric","isScheduler","windowTime","windowTimeSpan","scheduler","windowCreationInterval","maxWindowSize","Number","POSITIVE_INFINITY","arguments","windowTimeOperatorFunction","source","lift","WindowTimeOperator","constructor","call","subscriber","subscribe","WindowTimeSubscriber","CountedSubject","_numberOfNextedValues","next","value","numberOfNextedValues","destination","windows","window","openWindow","closeState","context","creationState","add","schedule","dispatchWindowClose","dispatchWindowCreation","timeSpanOnlyState","dispatchWindowTimeSpanOnly","_next","len","length","i","closed","closeWindow","_error","err","shift","error","_complete","complete","push","splice","indexOf","state","action","subscription","timeSpanState","remove"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/windowTime.js"],"sourcesContent":["import { Subject } from '../Subject';\nimport { async } from '../scheduler/async';\nimport { Subscriber } from '../Subscriber';\nimport { isNumeric } from '../util/isNumeric';\nimport { isScheduler } from '../util/isScheduler';\nexport function windowTime(windowTimeSpan) {\n let scheduler = async;\n let windowCreationInterval = null;\n let maxWindowSize = Number.POSITIVE_INFINITY;\n if (isScheduler(arguments[3])) {\n scheduler = arguments[3];\n }\n if (isScheduler(arguments[2])) {\n scheduler = arguments[2];\n }\n else if (isNumeric(arguments[2])) {\n maxWindowSize = Number(arguments[2]);\n }\n if (isScheduler(arguments[1])) {\n scheduler = arguments[1];\n }\n else if (isNumeric(arguments[1])) {\n windowCreationInterval = Number(arguments[1]);\n }\n return function windowTimeOperatorFunction(source) {\n return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));\n };\n}\nclass WindowTimeOperator {\n constructor(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {\n this.windowTimeSpan = windowTimeSpan;\n this.windowCreationInterval = windowCreationInterval;\n this.maxWindowSize = maxWindowSize;\n this.scheduler = scheduler;\n }\n call(subscriber, source) {\n return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));\n }\n}\nclass CountedSubject extends Subject {\n constructor() {\n super(...arguments);\n this._numberOfNextedValues = 0;\n }\n next(value) {\n this._numberOfNextedValues++;\n super.next(value);\n }\n get numberOfNextedValues() {\n return this._numberOfNextedValues;\n }\n}\nclass WindowTimeSubscriber extends Subscriber {\n constructor(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {\n super(destination);\n this.destination = destination;\n this.windowTimeSpan = windowTimeSpan;\n this.windowCreationInterval = windowCreationInterval;\n this.maxWindowSize = maxWindowSize;\n this.scheduler = scheduler;\n this.windows = [];\n const window = this.openWindow();\n if (windowCreationInterval !== null && windowCreationInterval >= 0) {\n const closeState = { subscriber: this, window, context: null };\n const creationState = { windowTimeSpan, windowCreationInterval, subscriber: this, scheduler };\n this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));\n this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));\n }\n else {\n const timeSpanOnlyState = { subscriber: this, window, windowTimeSpan };\n this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));\n }\n }\n _next(value) {\n const windows = this.windows;\n const len = windows.length;\n for (let i = 0; i < len; i++) {\n const window = windows[i];\n if (!window.closed) {\n window.next(value);\n if (window.numberOfNextedValues >= this.maxWindowSize) {\n this.closeWindow(window);\n }\n }\n }\n }\n _error(err) {\n const windows = this.windows;\n while (windows.length > 0) {\n windows.shift().error(err);\n }\n this.destination.error(err);\n }\n _complete() {\n const windows = this.windows;\n while (windows.length > 0) {\n const window = windows.shift();\n if (!window.closed) {\n window.complete();\n }\n }\n this.destination.complete();\n }\n openWindow() {\n const window = new CountedSubject();\n this.windows.push(window);\n const destination = this.destination;\n destination.next(window);\n return window;\n }\n closeWindow(window) {\n window.complete();\n const windows = this.windows;\n windows.splice(windows.indexOf(window), 1);\n }\n}\nfunction dispatchWindowTimeSpanOnly(state) {\n const { subscriber, windowTimeSpan, window } = state;\n if (window) {\n subscriber.closeWindow(window);\n }\n state.window = subscriber.openWindow();\n this.schedule(state, windowTimeSpan);\n}\nfunction dispatchWindowCreation(state) {\n const { windowTimeSpan, subscriber, scheduler, windowCreationInterval } = state;\n const window = subscriber.openWindow();\n const action = this;\n let context = { action, subscription: null };\n const timeSpanState = { subscriber, window, context };\n context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);\n action.add(context.subscription);\n action.schedule(state, windowCreationInterval);\n}\nfunction dispatchWindowClose(state) {\n const { subscriber, window, context } = state;\n if (context && context.action && context.subscription) {\n context.action.remove(context.subscription);\n }\n subscriber.closeWindow(window);\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,WAAW,QAAQ,qBAAqB;AACjD,OAAO,SAASC,UAAUA,CAACC,cAAc,EAAE;EACvC,IAAIC,SAAS,GAAGN,KAAK;EACrB,IAAIO,sBAAsB,GAAG,IAAI;EACjC,IAAIC,aAAa,GAAGC,MAAM,CAACC,iBAAiB;EAC5C,IAAIP,WAAW,CAACQ,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;IAC3BL,SAAS,GAAGK,SAAS,CAAC,CAAC,CAAC;EAC5B;EACA,IAAIR,WAAW,CAACQ,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;IAC3BL,SAAS,GAAGK,SAAS,CAAC,CAAC,CAAC;EAC5B,CAAC,MACI,IAAIT,SAAS,CAACS,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;IAC9BH,aAAa,GAAGC,MAAM,CAACE,SAAS,CAAC,CAAC,CAAC,CAAC;EACxC;EACA,IAAIR,WAAW,CAACQ,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;IAC3BL,SAAS,GAAGK,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