rxjs-rails 2.4.1 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rxjs/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/rx.aggregates.js +15 -19
  4. data/vendor/assets/javascripts/rx.aggregates.map +1 -1
  5. data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
  6. data/vendor/assets/javascripts/rx.all.compat.js +1014 -566
  7. data/vendor/assets/javascripts/rx.all.compat.map +1 -1
  8. data/vendor/assets/javascripts/rx.all.compat.min.js +4 -4
  9. data/vendor/assets/javascripts/rx.all.js +1009 -563
  10. data/vendor/assets/javascripts/rx.all.map +1 -1
  11. data/vendor/assets/javascripts/rx.all.min.js +4 -4
  12. data/vendor/assets/javascripts/rx.async.compat.js +17 -15
  13. data/vendor/assets/javascripts/rx.async.compat.map +1 -1
  14. data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
  15. data/vendor/assets/javascripts/rx.async.js +17 -15
  16. data/vendor/assets/javascripts/rx.async.map +1 -1
  17. data/vendor/assets/javascripts/rx.async.min.js +1 -1
  18. data/vendor/assets/javascripts/rx.backpressure.js +53 -43
  19. data/vendor/assets/javascripts/rx.backpressure.map +1 -1
  20. data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
  21. data/vendor/assets/javascripts/rx.binding.js +31 -12
  22. data/vendor/assets/javascripts/rx.binding.map +1 -1
  23. data/vendor/assets/javascripts/rx.binding.min.js +1 -1
  24. data/vendor/assets/javascripts/rx.coincidence.js +3 -2
  25. data/vendor/assets/javascripts/rx.coincidence.map +1 -1
  26. data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
  27. data/vendor/assets/javascripts/rx.compat.js +821 -444
  28. data/vendor/assets/javascripts/rx.compat.map +1 -1
  29. data/vendor/assets/javascripts/rx.compat.min.js +2 -2
  30. data/vendor/assets/javascripts/rx.experimental.js +2 -9
  31. data/vendor/assets/javascripts/rx.experimental.map +1 -1
  32. data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
  33. data/vendor/assets/javascripts/rx.joinpatterns.js +14 -22
  34. data/vendor/assets/javascripts/rx.joinpatterns.map +1 -1
  35. data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
  36. data/vendor/assets/javascripts/rx.js +817 -442
  37. data/vendor/assets/javascripts/rx.lite.compat.js +897 -443
  38. data/vendor/assets/javascripts/rx.lite.compat.map +1 -1
  39. data/vendor/assets/javascripts/rx.lite.compat.min.js +3 -2
  40. data/vendor/assets/javascripts/rx.lite.extras.compat.js +621 -0
  41. data/vendor/assets/javascripts/rx.lite.extras.compat.map +1 -0
  42. data/vendor/assets/javascripts/rx.lite.extras.compat.min.js +3 -0
  43. data/vendor/assets/javascripts/rx.lite.extras.js +53 -76
  44. data/vendor/assets/javascripts/rx.lite.extras.map +1 -1
  45. data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
  46. data/vendor/assets/javascripts/rx.lite.js +898 -444
  47. data/vendor/assets/javascripts/rx.lite.map +1 -1
  48. data/vendor/assets/javascripts/rx.lite.min.js +3 -2
  49. data/vendor/assets/javascripts/rx.map +1 -1
  50. data/vendor/assets/javascripts/rx.min.js +2 -2
  51. data/vendor/assets/javascripts/rx.testing.js +10 -11
  52. data/vendor/assets/javascripts/rx.testing.map +1 -1
  53. data/vendor/assets/javascripts/rx.testing.min.js +1 -1
  54. data/vendor/assets/javascripts/rx.time.js +80 -40
  55. data/vendor/assets/javascripts/rx.time.map +1 -1
  56. data/vendor/assets/javascripts/rx.time.min.js +1 -1
  57. data/vendor/assets/javascripts/rx.virtualtime.js +6 -13
  58. data/vendor/assets/javascripts/rx.virtualtime.map +1 -1
  59. data/vendor/assets/javascripts/rx.virtualtime.min.js +1 -1
  60. metadata +6 -3
@@ -1 +1 @@
1
- {"version":3,"file":"rx.compat.min.js","sources":["rx.compat.js"],"names":["undefined","checkDisposed","self","isDisposed","Error","objectDisposed","cloneArray","arr","a","i","len","length","push","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","Array","thrower","IndexedItem","id","this","ScheduledDisposable","scheduler","disposable","scheduleItem","s","dispose","ToArrayObserver","observer","isStopped","StringIterable","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","TypeError","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","parent","observableOf","array","FromArrayObservable","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","zipArray","second","resultSelector","first","left","right","falseFactory","emptyArrayFactory","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","arrayIndexOfComparer","item","comparer","HashSet","set","MapObserver","flatMap","mergeAll","FilterObserver","predicate","objectTypes","boolean","function","string","window","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","noop","isScheduler","notDefined","Scheduler","identity","defaultNow","pluck","property","just","Date","now","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","err","p","then","asArray","arguments","not","isFn","argumentOutOfRange","longStackSupport","Symbol","iterator","Set","doneEnumerator","done","supportNodeClass","func","argCount","arg","collection","apply","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","obj","sources","idx","ln","prop","addRef","xs","r","CompositeDisposable","getDisposable","Function","bind","that","target","args","bound","F","concat","forEach","T","k","O","kValue","boxedString","splitString","every","fun","thisp","filter","results","t","isArray","searchElement","n","Infinity","max","keys","hasDontEnumBug","compareTo","other","c","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","disposables","CompositeDisposablePrototype","add","shouldDispose","splice","currentDisposables","Disposable","action","disposableCreate","create","disposableEmpty","empty","BooleanDisposable","current","booleanDisposablePrototype","old","RefCountDisposable","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","scheduleWithState","ScheduledItem","state","dueTime","invoke","invokeCore","isCancelled","schedule","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithRelative","scheduleWithRelativeAndState","scheduleWithAbsolute","scheduleWithAbsoluteAndState","normalize","timeSpan","invokeRecImmediate","pair","group","recursiveAction","state1","state2","isAdded","isDone","scheduler1","state3","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","_action","scheduleRecursiveWithRelative","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","scheduleRecursiveWithAbsoluteAndState","schedulePeriodic","period","schedulePeriodicWithState","setInterval","clearInterval","catchError","CatchScheduler","scheduleMethod","immediateScheduler","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_cancel","_scheduler","start","immediate","scheduleNow","notSupported","currentThreadScheduler","currentThread","runTrampoline","q","si","queue","currentScheduler","scheduleRequired","ensureTrampoline","clearMethod","localTimer","localSetTimeout","localClearTimeout","fn","time","WScript","Sleep","setTimeout","clearTimeout","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","reNative","RegExp","replace","setImmediate","clearImmediate","process","nextTick","MSG_PREFIX","random","tasks","taskId","onGlobalPostMessage","event","data","substring","handleId","addEventListener","attachEvent","currentId","MessageChannel","channel","channelTasks","channelTaskId","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","timeout","__super__","_wrap","_handler","_recursiveOriginal","_recursiveWrapper","_clone","_getRecursiveWrapper","wrapper","failed","Notification","kind","hasValue","accept","observerOrOnNext","_acceptObservable","_accept","toObservable","notification","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","exception","notificationCreateOnCompleted","createOnCompleted","Enumerator","next","_next","Enumerable","_iterator","cancelable","currentItem","currentValue","lastException","catchErrorWhen","notificationHandler","exceptions","Subject","notifier","handled","notificationDisposable","outer","inner","exn","enumerableRepeat","repeat","repeatCount","enumerableOf","of","selectorFn","Observer","toNotifier","asObserver","AnonymousObserver","checked","CheckedObserver","observerCreate","fromNotifier","notifyOn","ObserveOnObserver","makeSafe","AnonymousSafeObserver","_onNext","_onError","_onCompleted","observableProto","AbstractObserver","notImplemented","completed","fail","_super","_observer","CheckedObserverPrototype","checkAccess","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","shift","cancel","Observable","_subscribe","oldOnError","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ObservableBase","fixSubscriber","subscriber","ado","subscribeCore","AutoDetachObserver","observeOn","subscribeOn","m","fromPromise","promise","observableDefer","subject","AsyncSubject","toPromise","promiseCtor","resolve","reject","v","ToArrayObservable","toArray","createWithDisposable","defer","observableFactory","observableThrow","observableEmpty","FromObservable","iterable","mapper","sink","FromSink","run","loopRecursive","list","pow","charAt","from","mapFn","observableFromArray","fromArray","generate","initialState","condition","iterate","hasResult","observableNever","never","ofWithScheduler","pairs","RangeObservable","RangeSink","range","observableReturn","returnValue","throwError","throwException","using","resourceFactory","resource","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","previous","acc","catchException","handlerOrSecond","observableCatch","combineLatest","hasValueAll","res","values","j","subscriptions","sad","observableConcat","concatObservable","merge","maxConcurrentOrOther","observableMerge","activeCount","innerSource","mergeObservable","innerSubscription","onErrorResumeNext","pos","skipUntil","isOpen","switchLatest","hasLatest","latest","takeUntil","withLatestFrom","allValues","zip","queuedValues","queues","asObservable","bufferWithCount","skip","windowWithCount","selectMany","where","dematerialize","distinctUntilChanged","keySelector","currentKey","hasCurrentKey","comparerEquals","tap","doAction","tapObserver","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","ignoreElements","materialize","retry","retryCount","retryWhen","scan","seed","accumulator","hasSeed","hasAccumulation","accumulation","skipLast","startWith","takeLast","takeLastBuffer","createWindow","refCountDisposable","selectConcat","selectorResult","i2","concatMapObserver","selectConcatObserver","onNextFunc","onErrorFunc","onCompletedFunc","defaultIfEmpty","defaultValue","found","retValue","distinct","hashSet","MapObservable","internalMap","select","currentProp","flatMapObserver","selectManyObserver","selectSwitch","flatMapLatest","switchMap","remaining","skipWhile","running","take","RangeError","takeWhile","FilterObservable","internalFilter","shouldYield","transduce","transducer","transformForObserver","init","step","obs","input","xform","AutoDetachObserverPrototype","noError","InnerSubscription","observers","hasError","hasObservers","os","AnonymousSubject","define","amd"],"mappings":";CAEE,SAAUA,GAgEV,QAASC,GAAcC,GAAQ,GAAIA,EAAKC,WAAc,KAAM,IAAIC,OAAMC,IACtE,QAASC,GAAWC,GAAO,IAAI,GAAIC,MAAQC,EAAI,EAAGC,EAAMH,EAAII,OAAYD,EAAJD,EAASA,IAAOD,EAAEI,KAAKL,EAAIE,GAAO,OAAOD,GAe7G,QAASK,GAAmBC,EAAOC,GAG/B,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG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,WACXtD,KAAKQ,SAAS8C,eAEhBJ,QAAS,SAAU3J,GACjByG,KAAKQ,SAAS0C,QAAQ3J,IAExByJ,OAAQ,SAAUhF,GAChBgC,KAAKQ,SAASwC,OAAOhF,MAIlBgpB,GACPpM,IAEmB,mBAAVqM,SAA6C,gBAAdA,QAAOC,KAAmBD,OAAOC,KACzE9lB,EAAK4E,GAAKA,EAEVihB,OAAO,WACL,MAAOjhB,MAEAR,GAAeG,EAEpBE,GACDF,EAAWF,QAAUO,GAAIA,GAAKA,EAE/BR,EAAYQ,GAAKA,EAInB5E,EAAK4E,GAAKA,CAIZ,IAAI9K,IAAcC,MAElBgB,KAAK6D"}
1
+ {"version":3,"file":"rx.compat.min.js","sources":["rx.compat.js"],"names":["undefined","cloneArray","arr","len","length","a","Array","i","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","push","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","tryCatcher","tryCatchTarget","apply","this","arguments","errorObj","tryCatch","fn","TypeError","thrower","IndexedItem","id","ScheduledDisposable","scheduler","disposable","isDisposed","scheduleItem","s","self","dispose","ToArrayObserver","observer","isStopped","StringIterable","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","parent","observableOf","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","zipArray","second","resultSelector","first","left","right","falseFactory","emptyArrayFactory","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","arrayIndexOfComparer","item","comparer","HashSet","set","MapObserver","flatMap","mergeAll","FilterObserver","predicate","objectTypes","boolean","function","string","window","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","noop","identity","notDefined","defaultNow","pluck","property","just","Date","now","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","err","p","then","asArray","not","isFn","longStackSupport","EmptyError","message","ObjectDisposedError","ArgumentOutOfRangeError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","done","supportNodeClass","func","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","obj","sources","idx","ln","prop","addRef","xs","r","CompositeDisposable","getDisposable","Function","bind","that","target","args","bound","F","concat","forEach","T","k","O","kValue","boxedString","splitString","every","fun","thisp","filter","results","t","isArray","searchElement","n","Infinity","max","keys","hasDontEnumBug","compareTo","other","c","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","isDisposable","disposables","CompositeDisposablePrototype","add","shouldDispose","splice","currentDisposables","Disposable","action","disposableCreate","create","disposableEmpty","empty","checkDisposed","current","old","RefCountDisposable","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","scheduleWithState","ScheduledItem","state","dueTime","invoke","invokeCore","isCancelled","Scheduler","schedule","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithRelative","scheduleWithRelativeAndState","scheduleWithAbsolute","scheduleWithAbsoluteAndState","normalize","timeSpan","normalizeTime","invokeRecImmediate","pair","recursiveAction","state1","state2","isAdded","isDone","scheduler1","state3","group","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","_action","scheduleRecursiveWithRelative","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","scheduleRecursiveWithAbsoluteAndState","schedulePeriodic","period","schedulePeriodicWithState","setInterval","clearInterval","catchError","CatchScheduler","scheduleMethod","clearMethod","immediateScheduler","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_cancel","_scheduler","start","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","event","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","addEventListener","attachEvent","currentId","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","timeout","__super__","_wrap","_handler","_recursiveOriginal","_recursiveWrapper","_clone","_getRecursiveWrapper","wrapper","failed","Notification","kind","exception","accept","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","_","notification","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Enumerator","next","_next","Enumerable","_iterator","cancelable","currentItem","currentValue","lastException","catchErrorWhen","notificationHandler","exceptions","Subject","notifier","handled","notificationDisposable","outer","inner","exn","enumerableRepeat","repeat","repeatCount","enumerableOf","of","selectorFn","Observer","toNotifier","asObserver","AnonymousObserver","checked","CheckedObserver","observerCreate","fromNotifier","notifyOn","ObserveOnObserver","makeSafe","AnonymousSafeObserver","_onNext","_onError","_onCompleted","observableProto","AbstractObserver","completed","fail","_observer","CheckedObserverPrototype","checkAccess","res","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","shift","cancel","Observable","_subscribe","oldOnError","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","observeOn","subscribeOn","m","fromPromise","promise","observableDefer","subject","AsyncSubject","toPromise","promiseCtor","resolve","reject","hasValue","v","ToArrayObservable","toArray","createWithDisposable","defer","observableFactory","observableThrow","EmptyObservable","EmptySink","sink","run","observableEmpty","FromObservable","iterable","mapper","FromSink","loopRecursive","list","pow","charAt","from","mapFn","observableFromArray","fromArray","generate","initialState","condition","iterate","hasResult","NeverObservable","observableNever","never","ofWithScheduler","PairsObservable","pairs","RangeObservable","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","returnValue","ThrowSink","throwError","throwException","using","resourceFactory","resource","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","previous","acc","catchException","handlerOrSecond","observableCatch","combineLatest","hasValueAll","values","j","subscriptions","sad","observableConcat","concatObservable","merge","MergeObservable","maxConcurrent","g","MergeObserver","q","activeCount","InnerObserver","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","MergeAllObservable","MergeAllObserver","mergeObservable","CompositeError","errors","name","innerErrors","mergeDelayError","setCompletion","innerSubscription","onErrorResumeNext","pos","skipUntil","isOpen","switchLatest","hasLatest","latest","takeUntil","withLatestFrom","allValues","zip","queuedValues","queues","asObservable","bufferWithCount","skip","windowWithCount","selectMany","where","dematerialize","distinctUntilChanged","keySelector","currentKey","hasCurrentKey","comparerEquals","tap","doAction","tapObserver","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","ignoreElements","materialize","retry","retryCount","retryWhen","scan","seed","accumulator","hasSeed","hasAccumulation","accumulation","skipLast","startWith","takeLast","takeLastBuffer","createWindow","refCountDisposable","selectConcat","selectorResult","i2","concatMapObserver","selectConcatObserver","onNextFunc","onErrorFunc","onCompletedFunc","defaultIfEmpty","defaultValue","found","retValue","distinct","hashSet","MapObservable","internalMap","select","currentProp","flatMapObserver","selectManyObserver","selectSwitch","flatMapLatest","switchMap","remaining","skipWhile","running","take","takeWhile","FilterObservable","internalFilter","shouldYield","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","AutoDetachObserverPrototype","InnerSubscription","observers","hasError","hasObservers","os","AnonymousSubject","define","amd"],"mappings":";CAEE,SAAUA,GAyDR,QAASC,GAAWC,GAElB,IAAI,GADAC,GAAMD,EAAIE,OAAQC,EAAI,GAAIC,OAAMH,GAC5BI,EAAI,EAAOJ,EAAJI,EAASA,IAAOF,EAAEE,GAAKL,EAAIK,EAC1C,OAAOF,GAgBX,QAASG,GAAmBC,EAAOC,GAG/B,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG,MAAMC,QAAQC,IACtB,CAEA,IAAK,GADDC,MACKC,EAAIN,EAAcM,EAAGA,EAAIA,EAAEC,OAC9BD,EAAEJ,OACJG,EAAOG,QAAQF,EAAEJ,MAGrBG,GAAOG,QAAQT,EAAMG,MAErB,IAAIO,GAAiBJ,EAAOK,KAAK,KAAON,GAAuB,KAC/DL,GAAMG,MAAQS,EAAkBF,IAItC,QAASE,GAAkBC,GAGzB,IAAK,GAFDC,GAAQD,EAAYE,MAAM,MAC1BC,KACKlB,EAAI,EAAGJ,EAAMoB,EAAMnB,OAAYD,EAAJI,EAASA,IAAK,CAChD,GAAImB,GAAOH,EAAMhB,EAEZoB,GAAgBD,IAAUE,EAAYF,KAASA,GAClDD,EAAaI,KAAKH,GAGtB,MAA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AKY,YAAa,EAClBZ,KAAKgpB,UAAY,KACjBhpB,KAAKkX,UAAY,KACjBlX,KAAK/B,MAAQ,QAIV4e,GACPpB,IAEqB5U,EAAGuiB,iBAAoB,SAAU7S,GAGtD,QAAS5S,GAAUzC,GACjB,MAAOlB,MAAKzG,WAAWoK,UAAUzC,GAGnC,QAASkoB,GAAiBloB,EAAU3H,GAClCyG,KAAKkB,SAAWA,EAChBlB,KAAKzG,WAAaA,EAClBgd,EAAUna,KAAK4D,KAAM2D,GAevB,MAxBAsG,IAASmf,EAAkB7S,GAY3BnM,GAAcgf,EAAiBnsB,UAAWyc,GAASzc,WACjDkH,YAAa,WACXnE,KAAKkB,SAASiD,eAEhBJ,QAAS,SAAUzK,GACjB0G,KAAKkB,SAAS6C,QAAQzK,IAExBuK,OAAQ,SAAU5F,GAChB+B,KAAKkB,SAAS2C,OAAO5F,MAIlBmrB,GACP3N,IAEmB,mBAAV4N,SAA6C,gBAAdA,QAAOC,KAAmBD,OAAOC,KACzExnB,EAAK+E,GAAKA,EAEVwiB,OAAO,WACL,MAAOxiB,MAEAR,GAAeG,EAEpBE,GACDF,EAAWF,QAAUO,GAAIA,GAAKA,EAE/BR,EAAYQ,GAAKA,EAInB/E,EAAK+E,GAAKA,CAIZ,IAAI3L,IAAcC,MAElBiB,KAAK4D"}
@@ -1,4 +1,4 @@
1
1
  /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2
- (function(a){function b(a){if(a.isDisposed)throw new Error(eb)}function c(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function d(a,b){if(fb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(jb)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var f=c.join("\n"+jb+"\n");a.stack=e(f)}}function e(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var h=b[d];f(h)||g(h)||!h||c.push(h)}return c.join("\n")}function f(a){var b=i(a);if(!b)return!1;var c=b[0],d=b[1];return c===hb&&d>=ib&&dd>=d}function g(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function h(){if(fb)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=i(c);if(!d)return;return hb=d[0],d[1]}}function i(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function j(a){var b=[];if(!Lb(a))return b;Kb.nonEnumArgs&&a.length&&Mb(a)&&(a=Ob.call(a));var c=Kb.enumPrototypes&&"function"==typeof a,d=Kb.enumErrorProps&&(a===Fb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Kb.nonEnumShadows&&a!==Gb){var f=a.constructor,g=-1,h=rb;if(a===(f&&f.prototype))var i=a===Hb?Bb:a===Fb?wb:Cb.call(a),j=Jb[i];for(;++g<h;)e=qb[g],j&&j[e]||!Db.call(a,e)||b.push(e)}return b}function k(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Cb.call(a),h=Cb.call(b);if(g==sb&&(g=zb),h==sb&&(h=zb),g!=h)return!1;switch(g){case ub:case vb:return+a==+b;case yb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ab:case Bb:return a==String(b)}var i=g==tb;if(!i){if(g!=zb||!Kb.nodeClass&&(m(a)||m(b)))return!1;var j=!Kb.argsObject&&Mb(a)?Object:a.constructor,k=!Kb.argsObject&&Mb(b)?Object:b.constructor;if(!(j==k||Db.call(a,"constructor")&&Db.call(b,"constructor")||cb(j)&&j instanceof j&&cb(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return Db.call(f,e)?(p++,q=Db.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return Db.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function p(a){throw a}function q(a,b){this.id=a,this.value=b}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function t(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function u(a){this.observer=a,this.a=[],this.isStopped=!1}function v(){this._s=s}function w(){this._s=s,this._l=s.length,this._i=0}function x(a){this._a=a}function y(a){this._a=a,this._l=C(a),this._i=0}function z(a){return"number"==typeof a&&Q.isFinite(a)}function A(b){var c,d=b[kb];if(!d&&"string"==typeof b)return c=new v(b),c[kb]();if(!d&&b.length!==a)return c=new x(b),c[kb]();if(!d)throw new TypeError("Object is not iterable");return b[kb]()}function B(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function C(a){var b=+a.length;return isNaN(b)?0:0!==b&&z(b)?(b=B(b)*Math.floor(Math.abs(b)),0>=b?0:b>Kc?Kc:b):b}function D(a,b){this.observer=a,this.parent=b}function E(a,b){return new Mc(b,a)}function F(a,b){return new $c(function(c){var d=new _b,e=new ac;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}bb(d)&&(d=Ec(d));var g=new _b;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function G(a,b){var c=this;return new $c(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i)}d.onNext(g)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function H(){return!1}function I(){return[]}function J(a,b,c){var d=pb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return bb(e)&&(e=Ec(e)),(nb(e)||mb(e))&&(e=Lc(e)),e}).concatAll()}function K(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function L(a){this.comparer=a,this.set=[]}function M(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function N(a,b,c){var d=pb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return bb(e)&&(e=Ec(e)),(nb(e)||mb(e))&&(e=Lc(e)),e}).mergeAll()}function O(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}var P={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Q=P[typeof window]&&window||this,R=P[typeof exports]&&exports&&!exports.nodeType&&exports,S=P[typeof module]&&module&&!module.nodeType&&module,T=S&&S.exports===R&&R,U=P[typeof global]&&global;!U||U.global!==U&&U.window!==U||(Q=U);var V={internals:{},config:{Promise:Q.Promise},helpers:{}},W=V.helpers.noop=function(){},X=(V.helpers.notDefined=function(a){return"undefined"==typeof a},V.helpers.isScheduler=function(a){return a instanceof V.Scheduler}),Y=V.helpers.identity=function(a){return a},Z=(V.helpers.pluck=function(a){return function(b){return b[a]}},V.helpers.just=function(a){return function(){return a}},V.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),$=V.helpers.defaultComparer=function(a,b){return Nb(a,b)},_=V.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ab=(V.helpers.defaultKeySerializer=function(a){return a.toString()},V.helpers.defaultError=function(a){throw a}),bb=V.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},cb=(V.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},V.helpers.not=function(a){return!a},V.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Cb.call(a)}),a}()),db="Argument out of range",eb="Object has been disposed";V.config.longStackSupport=!1;var fb=!1;try{throw new Error}catch(gb){fb=!!gb.stack}var hb,ib=h(),jb="From previous event:",kb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Q.Set&&"function"==typeof(new Q.Set)["@@iterator"]&&(kb="@@iterator");var lb=V.doneEnumerator={done:!0,value:a},mb=V.helpers.isIterable=function(b){return b[kb]!==a},nb=V.helpers.isArrayLike=function(b){return b&&b.length!==a};V.helpers.iterator=kb;var ob,pb=V.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},qb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],rb=qb.length,sb="[object Arguments]",tb="[object Array]",ub="[object Boolean]",vb="[object Date]",wb="[object Error]",xb="[object Function]",yb="[object Number]",zb="[object Object]",Ab="[object RegExp]",Bb="[object String]",Cb=Object.prototype.toString,Db=Object.prototype.hasOwnProperty,Eb=Cb.call(arguments)==sb,Fb=Error.prototype,Gb=Object.prototype,Hb=String.prototype,Ib=Gb.propertyIsEnumerable;try{ob=!(Cb.call(document)==zb&&!({toString:0}+""))}catch(gb){ob=!0}var Jb={};Jb[tb]=Jb[vb]=Jb[yb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Jb[ub]=Jb[Bb]={constructor:!0,toString:!0,valueOf:!0},Jb[wb]=Jb[xb]=Jb[Ab]={constructor:!0,toString:!0},Jb[zb]={constructor:!0};var Kb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Kb.enumErrorProps=Ib.call(Fb,"message")||Ib.call(Fb,"name"),Kb.enumPrototypes=Ib.call(a,"prototype"),Kb.nonEnumArgs=0!=c,Kb.nonEnumShadows=!/valueOf/.test(b)}(1);var Lb=V.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Mb=function(a){return a&&"object"==typeof a?Cb.call(a)==sb:!1};Eb||(Mb=function(a){return a&&"object"==typeof a?Db.call(a,"callee"):!1});var Nb=V.internals.isEqual=function(a,b){return n(a,b,[],[])},Ob=({}.hasOwnProperty,Array.prototype.slice),Pb=this.inherits=V.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Qb=V.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Rb=V.internals.addRef=function(a,b){return new $c(function(c){return new Wb(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Ob.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Ob.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Ob.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Sb=Object("a"),Tb="a"!=Sb[0]||!(0 in Sb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Tb&&{}.toString.call(this)==Bb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=xb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Tb&&{}.toString.call(this)==Bb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=xb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==tb}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;rb>e;e++)a.call(c,qb[e])&&f.push(qb[e]);return f}}()),q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Ub=V.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Vb=Ub.prototype;Vb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Vb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Vb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Vb.peek=function(){return this.items[0].value},Vb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Vb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Vb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Ub.count++,a),this.percolate(b)},Vb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Ub.count=0;var Wb=V.CompositeDisposable=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}this.disposables=a,this.isDisposed=!1,this.length=a.length},Xb=Wb.prototype;Xb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Xb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Xb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var Yb=V.Disposable=function(a){this.isDisposed=!1,this.action=a||W};Yb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Zb=Yb.create=function(a){return new Yb(a)},$b=Yb.empty={dispose:W},_b=V.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},b.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()},a}(),ac=V.SerialDisposable=_b,bc=V.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?$b:new a(this)},b}();r.prototype.dispose=function(){this.scheduler.scheduleWithState(this,t)};var cc=V.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||_,this.disposable=new _b};cc.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},cc.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},cc.prototype.isCancelled=function(){return this.disposable.isDisposed},cc.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};{var dc=V.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),$b}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=Z,a.normalize=function(a){return 0>a&&(a=0),a},a}();dc.normalize}!function(a){function b(a,b){var c=b.first,d=b.second,e=new Wb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),$b});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Wb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c](b,d,function(a,b){return e?f.remove(i):h=!0,g(b),$b});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(dc.prototype),function(){dc.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},dc.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Q.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=Q.setInterval(function(){d=c(d)},b);return Zb(function(){Q.clearInterval(e)})}}(dc.prototype),function(a){a.catchError=a["catch"]=function(a){return new lc(this,a)}}(dc.prototype);var ec,fc=(V.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new _b;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),dc.immediate=function(){function a(a,b){return b(this,a)}function b(){throw new Error("Not supported")}return new dc(Z,a,b,b)}()),gc=dc.currentThread=function(){function a(a){for(;a.length>0;){var b=a.dequeue();b.isCancelled()||!b.isCancelled()&&b.invoke()}}function b(b,c){var e=new cc(this,b,c,this.now());if(d)d.enqueue(e);else{d=new Ub(4),d.enqueue(e);try{a(d)}catch(f){throw f}finally{d=null}}return e.disposable}function c(){throw new Error("Not supported")}var d,e=new dc(Z,b,c,c);return e.scheduleRequired=function(){return!d},e.ensureTrampoline=function(a){d?a():this.schedule(a)},e}(),hc=W,ic=function(){var a,b=W;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!Q.setTimeout)throw new Error("No concurrency detected!");a=Q.setTimeout,b=Q.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),jc=ic.setTimeout,kc=ic.clearTimeout;!function(){function a(){if(!Q.postMessage||Q.importScripts)return!1;var a=!1,b=Q.onmessage;return Q.onmessage=function(){a=!0},Q.postMessage("","*"),Q.onmessage=b,a}var b=RegExp("^"+String(Cb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=U&&T&&U.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=U&&T&&U.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)ec=c,hc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))ec=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};Q.addEventListener?Q.addEventListener("message",h,!1):Q.attachEvent("onmessage",h,!1),ec=function(a){var b=g++;f[b]=a,Q.postMessage(e+b,"*")}}else if(Q.MessageChannel){var i=new Q.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},ec=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in Q&&"onreadystatechange"in Q.document.createElement("script")?ec=function(a){var b=Q.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},Q.document.documentElement.appendChild(b)}:(ec=function(a){return jc(a,0)},hc=kc)}();var lc=(dc.timeout=function(){function a(a,b){var c=this,d=new _b,e=ec(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Wb(d,Zb(function(){hc(e)}))}function b(a,b,c){var d=this,e=dc.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new _b,g=jc(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Wb(f,Zb(function(){kc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new dc(Z,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Pb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return $b}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new _b;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(dc)),mc=V.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return X(a)||(a=fc),new $c(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),nc=mc.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new mc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),oc=mc.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new mc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),pc=mc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new mc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),qc=V.internals.Enumerator=function(a){this._next=a};qc.prototype.next=function(){return this._next()},qc.prototype[kb]=function(){return this};var rc=V.internals.Enumerable=function(a){this._iterator=a};rc.prototype[kb]=function(){return this._iterator()},rc.prototype.concat=function(){var a=this;return new $c(function(b){var c,d=a[kb](),e=new ac,f=fc.scheduleRecursive(function(a){if(!c){try{var f=d.next()}catch(g){return b.onError(g)}if(f.done)return b.onCompleted();var h=f.value;bb(h)&&(h=Ec(h));var i=new _b;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new Wb(e,f,Zb(function(){c=!0}))})},rc.prototype.catchError=function(){var a=this;return new $c(function(b){var c,d=a[kb](),e=new ac,f=fc.scheduleRecursiveWithState(null,function(a,f){if(!c){try{var g=d.next()}catch(h){return observer.onError(h)}if(g.done)return void(null!==a?b.onError(a):b.onCompleted());var i=g.value;bb(i)&&(i=Ec(i));var j=new _b;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new Wb(e,f,Zb(function(){c=!0}))})},rc.prototype.catchErrorWhen=function(a){var b=this;return new $c(function(c){var d,e,f=new bd,g=new bd,h=a(f),i=h.subscribe(g),j=b[kb](),k=new ac,l=fc.scheduleRecursive(function(a){if(!d){try{var b=j.next()}catch(h){return c.onError(h)}if(b.done)return void(e?c.onError(e):c.onCompleted());var i=b.value;bb(i)&&(i=Ec(i));var l=new _b,m=new _b;k.setDisposable(new Wb(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new Wb(i,k,l,Zb(function(){d=!0}))})};var sc=rc.repeat=function(a,b){return null==b&&(b=-1),new rc(function(){var c=b;return new qc(function(){return 0===c?lb:(c>0&&c--,{done:!1,value:a})})})},tc=rc.of=function(a,b,c){if(b)var d=pb(b,c,3);return new rc(function(){var c=-1;return new qc(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:lb})})},uc=V.Observer=function(){};uc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},uc.prototype.asObserver=function(){return new yc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},uc.prototype.checked=function(){return new zc(this)};var vc=uc.create=function(a,b,c){return a||(a=W),b||(b=ab),c||(c=W),new yc(a,b,c)};uc.fromNotifier=function(a,b){return new yc(function(c){return a.call(b,nc(c))},function(c){return a.call(b,oc(c))},function(){return a.call(b,pc())})},uc.prototype.notifyOn=function(a){return new Bc(a,this)},uc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var wc,xc=V.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}function c(){throw new Error("Method not implemented")}return Pb(b,a),b.prototype.next=c,b.prototype.error=c,b.prototype.completed=c,b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(uc),yc=V.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Pb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(xc),zc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Pb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(uc),Ac=V.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new ac}return Pb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(xc),Bc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Pb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(Ac),Cc=V.Observable=function(){function a(a){if(V.config.longStackSupport&&fb){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var c=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){d(a,c),e(a)},a.call(c,b)}}else this._subscribe=a}return wc=a.prototype,wc.subscribe=wc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:vc(a,b,c))},wc.subscribeOnNext=function(a,b){return this._subscribe(vc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},wc.subscribeOnError=function(a,b){return this._subscribe(vc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},wc.subscribeOnCompleted=function(a,b){return this._subscribe(vc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Dc=V.ObservableBase=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Zb(a):$b}function c(a,c){var d=c[0],e=c[1];try{d.setDisposable(b(e.subscribeCore(d)))}catch(f){if(!d.fail(f))throw f}}function d(a){var b=new _c(a),d=[b,this];return gc.scheduleRequired()?gc.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Pb(e,a),e.prototype.subscribeCore=function(){throw new Error("Not implemeneted")},e}(Cc);wc.observeOn=function(a){var b=this;return new $c(function(c){return b.subscribe(new Bc(a,c))},b)},wc.subscribeOn=function(a){var b=this;return new $c(function(c){var d=new _b,e=new ac;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e},b)};var Ec=Cc.fromPromise=function(a){return Gc(function(){var b=new V.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};wc.toPromise=function(a){if(a||(a=V.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Fc=function(a){function b(b){this.source=b,a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new u(a))},b}(Dc);u.prototype.onNext=function(a){this.isStopped||this.a.push(a)},u.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},u.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},u.prototype.dispose=function(){this.isStopped=!0},u.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},wc.toArray=function(){return new Fc(this)},Cc.create=Cc.createWithDisposable=function(a,b){return new $c(a,b)};var Gc=Cc.defer=function(a){return new $c(function(b){var c;try{c=a()}catch(d){return Sc(d).subscribe(b)}return bb(c)&&(c=Ec(c)),c.subscribe(b)})},Hc=Cc.empty=function(a){return X(a)||(a=fc),new $c(function(b){return a.schedule(function(){b.onCompleted()})})},Ic=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){var b=new Jc(a,this);return b.run()},b}(Dc),Jc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();
3
- var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=A(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Kc=Math.pow(2,53)-1;v.prototype[kb]=function(){return new w(this._s)},w.prototype[kb]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:lb},x.prototype[kb]=function(){return new y(this._a)},y.prototype[kb]=function(){return this},y.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:lb};var Lc=Cc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!cb(b))throw new Error("mapFn when provided must be a function");if(b)var e=pb(b,c,2);return X(d)||(d=gc),new Ic(a,e,d)},Mc=function(a){function b(b,c){this.args=b,this.scheduler=c||gc,a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(Dc);D.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Nc=Cc.fromArray=function(a,b){return new Mc(a,b)};Cc.generate=function(a,b,c,d,e){return X(e)||(e=gc),new $c(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var Oc=Cc.never=function(){return new $c(function(){return $b})};Cc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Mc(b)},Cc.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new Mc(c,a)},Cc.pairs=function(a,b){return b||(b=V.Scheduler.currentThread),new $c(function(c){var d=Object.keys(a),e=d.length;return b.scheduleRecursiveWithState(0,function(b,f){if(e>b){var g=d[b];c.onNext([g,a[g]]),f(b+1)}else c.onCompleted()})})};var Pc=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){var b=new Qc(a,this);return b.run()},b}(Dc),Qc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.count,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Cc.range=function(a,b,c){return X(c)||(c=gc),new Pc(a,b,c)},Cc.repeat=function(a,b,c){return X(c)||(c=gc),Rc(a,c).repeat(null==b?-1:b)};var Rc=Cc["return"]=Cc.just=function(a,b){return X(b)||(b=fc),new $c(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};Cc.returnValue=function(){return Rc.apply(null,arguments)};var Sc=Cc["throw"]=Cc.throwError=function(a,b){return X(b)||(b=fc),new $c(function(c){return b.schedule(function(){c.onError(a)})})};Cc.throwException=function(){return Cc.throwError.apply(null,arguments)},Cc.using=function(a,b){return new $c(function(c){var d,e,f=$b;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Wb(Sc(g).subscribe(c),f)}return new Wb(e.subscribe(c),f)})},wc.amb=function(a){var b=this;return new $c(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new _b,j=new _b;return bb(a)&&(a=Ec(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Wb(i,j)})},Cc.amb=function(){function a(a,b){return a.amb(b)}var b=Oc(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},wc["catch"]=wc.catchError=wc.catchException=function(a){return"function"==typeof a?F(this,a):Tc([this,a])};var Tc=Cc.catchError=Cc["catch"]=Cc.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return tc(a).catchError()};wc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),Uc.apply(this,b)};var Uc=Cc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return a--,Array.isArray(b[0])&&(b=b[0]),new $c(function(c){function e(a){if(h[a]=!0,i||(i=h.every(Y))){try{var b=d.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(b)}else j.filter(function(b,c){return c!==a}).every(Y)&&c.onCompleted()}function f(a){j[a]=!0,j.every(Y)&&c.onCompleted()}for(var g=function(){return!1},h=o(a,g),i=!1,j=o(a,g),k=new Array(a),l=new Array(a),m=0;a>m;m++)!function(a){var d=b[a],g=new _b;bb(d)&&(d=Ec(d)),g.setDisposable(d.subscribe(function(b){k[a]=b,e(a)},function(a){c.onError(a)},function(){f(a)})),l[a]=g}(m);return new Wb(l)},this)};wc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Vc.apply(null,a)};var Vc=Cc.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return tc(a).concat()};wc.concatAll=wc.concatObservable=function(){return this.merge(1)},wc.merge=function(a){if("number"!=typeof a)return Wc(this,a);var b=this;return new $c(function(c){function d(a){var b=new _b;f.add(b),bb(a)&&(a=Ec(a)),b.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){c.onError(a)},function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Wb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},function(a){c.onError(a)},function(){g=!0,0===e&&c.onCompleted()})),f},b)};var Wc=Cc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(X(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=fc,b=0;d>b;b++)c.push(arguments[b]);else for(a=fc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),E(a,c).mergeAll()};wc.mergeAll=wc.mergeObservable=function(){var a=this;return new $c(function(b){var c=new Wb,d=!1,e=new _b;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new _b;c.add(e),bb(a)&&(a=Ec(a)),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},function(a){b.onError(a)},function(){d=!0,1===c.length&&b.onCompleted()})),c},a)},wc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Xc([this,a])};var Xc=Cc.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new $c(function(b){var c=0,d=new ac,e=fc.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],bb(f)&&(f=Ec(f)),g=new _b,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Wb(d,e)})};wc.skipUntil=function(a){var b=this;return new $c(function(c){var d=!1,e=new Wb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));bb(a)&&(a=Ec(a));var f=new _b;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},wc["switch"]=wc.switchLatest=function(){var a=this;return new $c(function(b){var c=!1,d=new ac,e=!1,f=0,g=a.subscribe(function(a){var g=new _b,h=++f;c=!0,d.setDisposable(g),bb(a)&&(a=Ec(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new Wb(g,d)},a)},wc.takeUntil=function(a){var b=this;return new $c(function(c){return bb(a)&&(a=Ec(a)),new Wb(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},W))},b)},wc.withLatestFrom=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);var d=a.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(a[0])&&(a=a[0]),new $c(function(b){for(var c=function(){return!1},f=a.length,g=o(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=a[c],e=new _b;bb(d)&&(d=Ec(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(Y)},b.onError.bind(b),function(){})),j[c]=e}(k);var l=new _b;return l.setDisposable(e.subscribe(function(a){var c,e=[a].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void b.onError(f)}b.onNext(c)}},b.onError.bind(b),function(){b.onCompleted()})),j[f]=l,new Wb(j)},this)},wc.zip=function(){if(Array.isArray(arguments[0]))return G.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new $c(function(a){function c(b){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void a.onError(g)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(Y)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=o(g,I),i=o(g,H),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new _b;bb(e)&&(e=Ec(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(b){a.onError(b)},function(){f(d)})),j[d]=g}(k);return new Wb(j)},d)},Cc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Cc.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new $c(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(Y))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Y)?void b.onCompleted():void 0}for(var e=a.length,f=o(e,function(){return[]}),g=o(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new _b,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},function(a){b.onError(a)},function(){d(e)}))}(i);return new Wb(h)})},wc.asObservable=function(){var a=this;return new $c(function(b){return a.subscribe(b)},this)},wc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},wc.dematerialize=function(){var a=this;return new $c(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},wc.distinctUntilChanged=function(a,b){var c=this;return b||(b=$),new $c(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},wc["do"]=wc.tap=wc.doAction=function(a,b,c){var d=this,e="function"==typeof a||"undefined"==typeof a?vc(a||W,b||W,c||W):a;return new $c(function(a){return d.subscribe(function(b){try{e.onNext(b)}catch(c){a.onError(c)}a.onNext(b)},function(b){try{e.onError(b)}catch(c){a.onError(c)}a.onError(b)},function(){try{e.onCompleted()}catch(b){a.onError(b)}a.onCompleted()})},this)},wc.doOnNext=wc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},wc.doOnError=wc.tapOnError=function(a,b){return this.tap(W,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},wc.doOnCompleted=wc.tapOnCompleted=function(a,b){return this.tap(W,null,"undefined"!=typeof b?function(){a.call(b)}:a)},wc["finally"]=wc.ensure=function(a){var b=this;return new $c(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Zb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},wc.finallyAction=function(a){return this.ensure(a)},wc.ignoreElements=function(){var a=this;return new $c(function(b){return a.subscribe(W,function(a){b.onError(a)},function(){b.onCompleted()})},a)},wc.materialize=function(){var a=this;return new $c(function(b){return a.subscribe(function(a){b.onNext(nc(a))},function(a){b.onNext(oc(a)),b.onCompleted()},function(){b.onNext(pc()),b.onCompleted()})},a)},wc.repeat=function(a){return sc(this,a).concat()},wc.retry=function(a){return sc(this,a).catchError()},wc.retryWhen=function(a){return sc(this).catchErrorWhen(a)},wc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new $c(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},wc.skipLast=function(a){var b=this;return new $c(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},wc.startWith=function(){var a,b=0;arguments.length&&X(arguments[0])?(a=arguments[0],b=1):a=fc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return tc([Nc(c,a),this]).concat()},wc.takeLast=function(a){var b=this;return new $c(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},wc.takeLastBuffer=function(a){var b=this;return new $c(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},wc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(db);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(db);return new $c(function(d){function e(){var a=new bd;i.push(a),d.onNext(Rb(a,g))}var f=new _b,g=new bc(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},wc.selectConcat=wc.concatMap=function(a,b,c){return cb(a)&&cb(b)?this.concatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Ec(e)),(nb(e)||mb(e))&&(e=Lc(e)),e.map(function(a,e){return b(c,a,d,e)})}):cb(a)?J(this,a,c):J(this,function(){return a})},wc.concatMapObserver=wc.selectConcatObserver=function(a,b,c,d){var e=this,f=pb(a,d,2),g=pb(b,d,1),h=pb(c,d,0);return new $c(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}bb(d)&&(d=Ec(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}bb(c)&&(c=Ec(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}bb(b)&&(b=Ec(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},wc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new $c(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},L.prototype.push=function(a){var b=-1===K(this.set,a,this.comparer);return b&&this.set.push(a),b},wc.distinct=function(a,b){var c=this;return b||(b=$),new $c(function(d){var e=new L(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var Yc=function(a){function b(b,c,d){this.source=b,this.selector=pb(c,d,3),a.call(this)}return Pb(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a(d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new M(a,this.selector,this))},b}(Dc);M.prototype.onNext=function(a){if(!this.isStopped){try{var b=this.selector(a,this.i++,this.source)}catch(c){return this.observer.onError(c)}this.observer.onNext(b)}},M.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},M.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},M.prototype.dispose=function(){this.isStopped=!0},M.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},wc.map=wc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Yc?this.internalMap(c,b):new Yc(this,c,b)},wc.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},wc.selectMany=wc.flatMap=function(a,b,c){return cb(a)&&cb(b)?this.flatMap(function(c,d){var e=a(c,d);return bb(e)&&(e=Ec(e)),(nb(e)||mb(e))&&(e=Lc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):cb(a)?N(this,a,c):N(this,function(){return a})},wc.flatMapObserver=wc.selectManyObserver=function(a,b,c,d){var e=this;return new $c(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}bb(c)&&(c=Ec(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}bb(c)&&(c=Ec(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}bb(a)&&(a=Ec(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},wc.selectSwitch=wc.flatMapLatest=wc.switchMap=function(a,b){return this.select(a,b).switchLatest()},wc.skip=function(a){if(0>a)throw new Error(db);var b=this;return new $c(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},wc.skipWhile=function(a,b){var c=this,d=pb(a,b,3);return new $c(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},wc.take=function(a,b){if(0>a)throw new RangeError(db);if(0===a)return Hc(b);var c=this;return new $c(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},wc.takeWhile=function(a,b){var c=this,d=pb(a,b,3);return new $c(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var Zc=function(a){function b(b,c,d){this.source=b,this.predicate=pb(c,d,3),a.call(this)}return Pb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new O(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a(b,c,e)},c)},b}(Dc);O.prototype.onNext=function(a){if(!this.isStopped){try{var b=this.predicate(a,this.i++,this.source)}catch(c){return this.observer.onError(c)}b&&this.observer.onNext(a)}},O.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},O.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},O.prototype.dispose=function(){this.isStopped=!0},O.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},wc.filter=wc.where=function(a,b){return this instanceof Zc?this.internalFilter(a,b):new Zc(this,a,b)},wc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new $c(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})},c)};var $c=V.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Zb(a):$b}function c(a,c){var d=c[0],e=c[1];try{d.setDisposable(b(e(d)))}catch(f){if(!d.fail(f))throw f}}function d(b,d){function e(a){var d=new _c(a),e=[d,b];return gc.scheduleRequired()?gc.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Pb(d,a),d}(Cc),_c=function(a){function b(b){a.call(this),this.observer=b,this.m=new _b}Pb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){return p(c)}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){return p(b)}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){return p(a)}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(xc),ad=function(a,b){this.subject=a,this.observer=b};ad.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var bd=V.Subject=function(a){function d(a){return b(this),this.isStopped?this.hasError?(a.onError(this.error),$b):(a.onCompleted(),$b):(this.observers.push(a),new ad(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Pb(e,a),Qb(e.prototype,uc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b(this),!this.isStopped){this.isStopped=!0;for(var a=0,d=c(this.observers),e=d.length;e>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){if(b(this),!this.isStopped)for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),e.create=function(a,b){return new cd(a,b)},e}(Cc),cd=(V.AsyncSubject=function(a){function d(a){return b(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),$b):(this.observers.push(a),new ad(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Pb(e,a),Qb(e.prototype,uc,{hasObservers:function(){return b(this),this.observers.length>0},onCompleted:function(){var a,d;if(b(this),!this.isStopped){this.isStopped=!0;var e=c(this.observers),d=e.length;if(this.hasValue)for(a=0;d>a;a++){var f=e[a];f.onNext(this.value),f.onCompleted()}else for(a=0;d>a;a++)e[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){b(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),e}(Cc),V.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Pb(c,a),Qb(c.prototype,uc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Cc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Q.Rx=V,define(function(){return V})):R&&S?T?(S.exports=V).Rx=V:R.Rx=V:Q.Rx=V;var dd=h()}).call(this);
2
+ (function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a,b){if(fb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(jb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+jb+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===hb&&d>=ib&&Ad>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(fb)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return hb=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Sb(a))return b;Rb.nonEnumArgs&&a.length&&Tb(a)&&(a=Wb.call(a));var c=Rb.enumPrototypes&&"function"==typeof a,d=Rb.enumErrorProps&&(a===Mb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Rb.nonEnumShadows&&a!==Nb){var f=a.constructor,g=-1,h=yb;if(a===(f&&f.prototype))var i=a===Ob?Ib:a===Mb?Db:Jb.call(a),j=Qb[i];for(;++g<h;)e=xb[g],j&&j[e]||!Kb.call(a,e)||b.push(e)}return b}function j(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Jb.call(a),h=Jb.call(b);if(g==zb&&(g=Gb),h==zb&&(h=Gb),g!=h)return!1;switch(g){case Bb:case Cb:return+a==+b;case Fb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Hb:case Ib:return a==String(b)}var i=g==Ab;if(!i){if(g!=Gb||!Rb.nodeClass&&(l(a)||l(b)))return!1;var j=!Rb.argsObject&&Tb(a)?Object:a.constructor,n=!Rb.argsObject&&Tb(b)?Object:b.constructor;if(!(j==n||Kb.call(a,"constructor")&&Kb.call(b,"constructor")||eb(j)&&j instanceof j&&eb(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Kb.call(f,e)?(p++,q=Kb.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Kb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return Ub.apply(this,arguments)}catch(a){return $b.e=a,$b}}function p(a){if(!eb(a))throw new TypeError("fn must be a function");return Ub=a,o}function q(a){throw a}function r(a,b){this.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this.observer=a,this.a=[],this.isStopped=!1}function w(){this._s=s}function x(){this._s=s,this._l=s.length,this._i=0}function y(a){this._a=a}function z(a){this._a=a,this._l=D(a),this._i=0}function A(a){return"number"==typeof a&&T.isFinite(a)}function B(b){var c,d=b[rb];if(!d&&"string"==typeof b)return c=new w(b),c[rb]();if(!d&&b.length!==a)return c=new y(b),c[rb]();if(!d)throw new TypeError("Object is not iterable");return b[rb]()}function C(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function D(a){var b=+a.length;return isNaN(b)?0:0!==b&&A(b)?(b=C(b)*Math.floor(Math.abs(b)),0>=b?0:b>Yc?Yc:b):b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return qc(a)||(a=uc),new $c(b,a)}function G(a,b){this.observer=a,this.parent=b}function H(a,b){this.observer=a,this.parent=b}function I(a,b){return new vd(function(c){var d=new kc,e=new lc;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}db(d)&&(d=Rc(d));var g=new kc;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function J(a,b){var c=this;return new vd(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i)}d.onNext(g)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function K(){return!1}function L(){return[]}function M(a,b,c){var d=wb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return db(e)&&(e=Rc(e)),(ub(e)||tb(e))&&(e=Zc(e)),e}).concatAll()}function N(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function O(a){this.comparer=a,this.set=[]}function P(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function Q(a,b,c){var d=wb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return db(e)&&(e=Rc(e)),(ub(e)||tb(e))&&(e=Zc(e)),e}).mergeAll()}function R(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}var S={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},T=S[typeof window]&&window||this,U=S[typeof exports]&&exports&&!exports.nodeType&&exports,V=S[typeof module]&&module&&!module.nodeType&&module,W=V&&V.exports===U&&U,X=S[typeof global]&&global;!X||X.global!==X&&X.window!==X||(T=X);var Y={internals:{},config:{Promise:T.Promise},helpers:{}},Z=Y.helpers.noop=function(){},$=(Y.helpers.notDefined=function(a){return"undefined"==typeof a},Y.helpers.identity=function(a){return a}),_=(Y.helpers.pluck=function(a){return function(b){return b[a]}},Y.helpers.just=function(a){return function(){return a}},Y.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),ab=Y.helpers.defaultComparer=function(a,b){return Vb(a,b)},bb=Y.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},cb=(Y.helpers.defaultKeySerializer=function(a){return a.toString()},Y.helpers.defaultError=function(a){throw a}),db=Y.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},eb=(Y.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Y.helpers.not=function(a){return!a},Y.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Jb.call(a)}),a}());Y.config.longStackSupport=!1;var fb=!1;try{throw new Error}catch(gb){fb=!!gb.stack}var hb,ib=g(),jb="From previous event:",kb=Y.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};kb.prototype=Error.prototype;var lb=Y.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};lb.prototype=Error.prototype;var mb=Y.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};mb.prototype=Error.prototype;var nb=Y.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};nb.prototype=Error.prototype;var ob=Y.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};ob.prototype=Error.prototype;var pb=Y.helpers.notImplemented=function(){throw new ob},qb=Y.helpers.notSupported=function(){throw new nb},rb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";T.Set&&"function"==typeof(new T.Set)["@@iterator"]&&(rb="@@iterator");var sb=Y.doneEnumerator={done:!0,value:a},tb=Y.helpers.isIterable=function(b){return b[rb]!==a},ub=Y.helpers.isArrayLike=function(b){return b&&b.length!==a};Y.helpers.iterator=rb;var vb,wb=Y.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},xb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],yb=xb.length,zb="[object Arguments]",Ab="[object Array]",Bb="[object Boolean]",Cb="[object Date]",Db="[object Error]",Eb="[object Function]",Fb="[object Number]",Gb="[object Object]",Hb="[object RegExp]",Ib="[object String]",Jb=Object.prototype.toString,Kb=Object.prototype.hasOwnProperty,Lb=Jb.call(arguments)==zb,Mb=Error.prototype,Nb=Object.prototype,Ob=String.prototype,Pb=Nb.propertyIsEnumerable;try{vb=!(Jb.call(document)==Gb&&!({toString:0}+""))}catch(gb){vb=!0}var Qb={};Qb[Ab]=Qb[Cb]=Qb[Fb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Qb[Bb]=Qb[Ib]={constructor:!0,toString:!0,valueOf:!0},Qb[Db]=Qb[Eb]=Qb[Hb]={constructor:!0,toString:!0},Qb[Gb]={constructor:!0};var Rb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Rb.enumErrorProps=Pb.call(Mb,"message")||Pb.call(Mb,"name"),Rb.enumPrototypes=Pb.call(a,"prototype"),Rb.nonEnumArgs=0!=c,Rb.nonEnumShadows=!/valueOf/.test(b)}(1);var Sb=Y.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Tb=function(a){return a&&"object"==typeof a?Jb.call(a)==zb:!1};Lb||(Tb=function(a){return a&&"object"==typeof a?Kb.call(a,"callee"):!1});var Ub,Vb=Y.internals.isEqual=function(a,b){return m(a,b,[],[])},Wb=({}.hasOwnProperty,Array.prototype.slice),Xb=this.inherits=Y.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Yb=Y.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Zb=Y.internals.addRef=function(a,b){return new vd(function(c){return new dc(b.getDisposable(),a.subscribe(c))})},$b={e:{}};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Wb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Wb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Wb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var _b=Object("a"),ac="a"!=_b[0]||!(0 in _b);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=ac&&{}.toString.call(this)==Ib?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Eb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=ac&&{}.toString.call(this)==Ib?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Eb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==Ab}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;yb>e;e++)a.call(c,xb[e])&&f.push(xb[e]);return f}}()),r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var bc=Y.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},cc=bc.prototype;cc.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},cc.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},cc.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},cc.peek=function(){return this.items[0].value},cc.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},cc.dequeue=function(){var a=this.peek();return this.removeAt(0),a},cc.enqueue=function(a){var b=this.length++;this.items[b]=new r(bc.count++,a),this.percolate(b)},cc.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},bc.count=0;var dc=Y.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!ic(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},ec=dc.prototype;ec.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},ec.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},ec.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var fc=Y.Disposable=function(a){this.isDisposed=!1,this.action=a||Z};fc.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var gc=fc.create=function(a){return new fc(a)},hc=fc.empty={dispose:Z},ic=fc.isDisposable=function(a){return a&&eb(a.dispose)},jc=fc.checkDisposed=function(a){if(a.isDisposed)throw new lb},kc=Y.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};kc.prototype.getDisposable=function(){return this.current},kc.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},kc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var lc=Y.SerialDisposable=function(){this.isDisposed=!1,this.current=null};lc.prototype.getDisposable=function(){return this.current},lc.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},lc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var mc=Y.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?hc:new a(this)},b}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var nc=Y.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||bb,this.disposable=new kc};nc.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},nc.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},nc.prototype.isCancelled=function(){return this.disposable.isDisposed},nc.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var oc=Y.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),hc}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=_,a.normalize=function(a){return 0>a&&(a=0),a},a}(),pc=oc.normalize,qc=oc.isScheduler;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),hc});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new dc;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),hc});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new dc;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,d],b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(oc.prototype),function(){oc.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},oc.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof T.setInterval)throw new nb;b=pc(b);var d=a,e=T.setInterval(function(){d=c(d)},b);return gc(function(){T.clearInterval(e)})}}(oc.prototype),function(a){a.catchError=a["catch"]=function(a){return new yc(this,a)}}(oc.prototype);var rc,sc,tc=(Y.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new kc;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),oc.immediate=function(){function a(a,b){return b(this,a)}return new oc(_,a,qb,qb)}()),uc=oc.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new nc(this,b,d,this.now());if(c)c.enqueue(e);else{c=new bc(4),c.enqueue(e);var f=p(a)();if(c=null,f===$b)return q(f.e)}return e.disposable}var c,d=new oc(_,b,qb,qb);return d.scheduleRequired=function(){return!c},d}(),vc=function(){var a,b=Z;if(T.setTimeout)a=T.setTimeout,b=T.clearTimeout;else{if(!T.WScript)throw new nb;a=function(a,b){T.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),wc=vc.setTimeout,xc=vc.clearTimeout;!function(){function a(b){if(f)wc(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(sc(b),f=!1,d===$b)return q(d.e)}}}function b(){if(!T.postMessage||T.importScripts)return!1;var a=!1,b=T.onmessage;return T.onmessage=function(){a=!0},T.postMessage("","*"),T.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;sc=function(a){delete e[a]};var g=RegExp("^"+String(Jb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=X&&W&&X.setImmediate)&&!g.test(h)&&h;if(eb(h))rc=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))rc=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();T.addEventListener?T.addEventListener("message",c,!1):T.attachEvent?T.attachEvent("onmessage",c):T.onmessage=c,rc=function(a){var b=d++;return e[b]=a,T.postMessage(i+currentId,"*"),b}}else if(T.MessageChannel){var j=new T.MessageChannel;j.port1.onmessage=function(b){a(b.data)},rc=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else rc="document"in T&&"onreadystatechange"in T.document.createElement("script")?function(b){var c=T.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},T.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,wc(function(){a(c)},0),c}}();var yc=(oc.timeout=oc["default"]=function(){function a(a,b){var c=this,d=new kc,e=rc(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new dc(d,gc(function(){sc(e)}))}function b(a,b,c){var d=this,e=oc.normalize(b),f=new kc;if(0===e)return d.scheduleWithState(a,c);var g=wc(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new dc(f,gc(function(){xc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new oc(_,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Xb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return hc}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new kc;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(oc)),zc=Y.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return qc(a)||(a=tc),new vd(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ac=zc.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new zc("N",d,null,a,b,c)}}(),Bc=zc.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new zc("E",null,d,a,b,c)}}(),Cc=zc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new zc("C",null,null,a,b,c)}}(),Dc=Y.internals.Enumerator=function(a){this._next=a};Dc.prototype.next=function(){return this._next()},Dc.prototype[rb]=function(){return this};var Ec=Y.internals.Enumerable=function(a){this._iterator=a};Ec.prototype[rb]=function(){return this._iterator()},Ec.prototype.concat=function(){var a=this;return new vd(function(b){var c,d=a[rb](),e=new lc,f=tc.scheduleRecursive(function(a){if(!c){try{var f=d.next()}catch(g){return b.onError(g)}if(f.done)return b.onCompleted();var h=f.value;db(h)&&(h=Rc(h));var i=new kc;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new dc(e,f,gc(function(){c=!0}))})},Ec.prototype.catchError=function(){var a=this;return new vd(function(b){var c,d=a[rb](),e=new lc,f=tc.scheduleRecursiveWithState(null,function(a,f){if(!c){try{var g=d.next()}catch(h){return observer.onError(h)}if(g.done)return void(null!==a?b.onError(a):b.onCompleted());var i=g.value;db(i)&&(i=Rc(i));var j=new kc;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new dc(e,f,gc(function(){c=!0}))})},Ec.prototype.catchErrorWhen=function(a){var b=this;return new vd(function(c){var d,e,f=new yd,g=new yd,h=a(f),i=h.subscribe(g),j=b[rb](),k=new lc,l=tc.scheduleRecursive(function(a){if(!d){try{var b=j.next()}catch(h){return c.onError(h)}if(b.done)return void(e?c.onError(e):c.onCompleted());var i=b.value;db(i)&&(i=Rc(i));var l=new kc,m=new kc;k.setDisposable(new dc(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new dc(i,k,l,gc(function(){d=!0}))})};var Fc=Ec.repeat=function(a,b){return null==b&&(b=-1),new Ec(function(){var c=b;return new Dc(function(){return 0===c?sb:(c>0&&c--,{done:!1,value:a})})})},Gc=Ec.of=function(a,b,c){if(b)var d=wb(b,c,3);return new Ec(function(){var c=-1;return new Dc(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:sb})})},Hc=Y.Observer=function(){};Hc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Hc.prototype.asObserver=function(){return new Lc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Hc.prototype.checked=function(){return new Mc(this)};var Ic=Hc.create=function(a,b,c){return a||(a=Z),b||(b=cb),c||(c=Z),new Lc(a,b,c)};Hc.fromNotifier=function(a,b){return new Lc(function(c){return a.call(b,Ac(c))},function(c){return a.call(b,Bc(c))},function(){return a.call(b,Cc())})},Hc.prototype.notifyOn=function(a){return new Oc(a,this)},Hc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Jc,Kc=Y.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Xb(b,a),b.prototype.next=pb,b.prototype.error=pb,b.prototype.completed=pb,b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Hc),Lc=Y.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Xb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Kc),Mc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Xb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===$b&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===$b&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===$b&&q(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(Hc),Nc=Y.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new lc}return Xb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Kc),Oc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Xb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(Nc),Pc=Y.Observable=function(){function a(a){if(Y.config.longStackSupport&&fb){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Jc=a.prototype,Jc.subscribe=Jc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Ic(a,b,c))},Jc.subscribeOnNext=function(a,b){return this._subscribe(Ic("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Jc.subscribeOnError=function(a,b){return this._subscribe(Ic(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Jc.subscribeOnCompleted=function(a,b){return this._subscribe(Ic(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Qc=Y.ObservableBase=function(a){function b(a){return a&&eb(a.dispose)?a:eb(a)?gc(a):hc}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==$b||d.fail($b.e)?void d.setDisposable(b(f)):q($b.e)}function d(a){var b=new wd(a),d=[b,this];return uc.scheduleRequired()?uc.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Xb(e,a),e.prototype.subscribeCore=pb,e}(Pc);Jc.observeOn=function(a){var b=this;return new vd(function(c){return b.subscribe(new Oc(a,c))},b)},Jc.subscribeOn=function(a){var b=this;return new vd(function(c){var d=new kc,e=new lc;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var Rc=Pc.fromPromise=function(a){return Tc(function(){var b=new Y.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};Jc.toPromise=function(a){if(a||(a=Y.config.Promise),!a)throw new nb("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Sc=function(a){function b(b){this.source=b,a.call(this)
3
+ }return Xb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new v(a))},b}(Qc);v.prototype.onNext=function(a){this.isStopped||this.a.push(a)},v.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},v.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},v.prototype.dispose=function(){this.isStopped=!0},v.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Jc.toArray=function(){return new Sc(this)},Pc.create=Pc.createWithDisposable=function(a,b){return new vd(a,b)};var Tc=Pc.defer=function(a){return new vd(function(b){var c;try{c=a()}catch(d){return id(d).subscribe(b)}return db(c)&&(c=Rc(c)),c.subscribe(b)})},Uc=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(Qc),Vc=Pc.empty=function(a){return qc(a)||(a=tc),new Uc(a)},Wc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new Xc(a,this);return b.run()},b}(Qc),Xc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=B(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Yc=Math.pow(2,53)-1;w.prototype[rb]=function(){return new x(this._s)},x.prototype[rb]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:sb},y.prototype[rb]=function(){return new z(this._a)},z.prototype[rb]=function(){return this},z.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:sb};var Zc=Pc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!eb(b))throw new Error("mapFn when provided must be a function");if(b)var e=wb(b,c,2);return qc(d)||(d=uc),new Wc(a,e,d)},$c=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Qc);E.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var _c=Pc.fromArray=function(a,b){return qc(b)||(b=uc),new $c(a,b)};Pc.generate=function(a,b,c,d,e){return qc(e)||(e=uc),new vd(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var ad=function(a){function b(){a.call(this)}return Xb(b,a),b.prototype.subscribeCore=function(){return hc},b}(Qc),bd=Pc.never=function(){return new ad};Pc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new $c(b,uc)},Pc.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new $c(c,a)};var cd=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new G(a,this);return b.run()},b}(Qc);G.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Pc.pairs=function(a,b){return b||(b=uc),new cd(a,b)};var dd=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new ed(a,this);return b.run()},b}(Qc),ed=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.count,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Pc.range=function(a,b,c){return qc(c)||(c=uc),new dd(a,b,c)};var fd=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new H(a,this);return b.run()},b}(Qc);H.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Pc.repeat=function(a,b,c){return qc(c)||(c=uc),new fd(a,b,c)};var gd=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(Qc),hd=(Pc["return"]=Pc.just=Pc.returnValue=function(a,b){return qc(b)||(b=tc),new gd(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.error,this.observer],d)},b}(Qc)),id=Pc["throw"]=Pc.throwError=Pc.throwException=function(a,b){return qc(b)||(b=tc),new hd(a,b)};Pc.using=function(a,b){return new vd(function(c){var d,e,f=hc;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new dc(id(g).subscribe(c),f)}return new dc(e.subscribe(c),f)})},Jc.amb=function(a){var b=this;return new vd(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new kc,j=new kc;return db(a)&&(a=Rc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new dc(i,j)})},Pc.amb=function(){function a(a,b){return a.amb(b)}var b=bd(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Jc["catch"]=Jc.catchError=Jc.catchException=function(a){return"function"==typeof a?I(this,a):jd([this,a])};var jd=Pc.catchError=Pc["catch"]=Pc.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Gc(a).catchError()};Jc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),kd.apply(this,b)};var kd=Pc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new vd(function(a){function c(b){if(h[b]=!0,i||(i=h.every($))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every($)&&a.onCompleted()}function e(b){j[b]=!0,j.every($)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new kc;db(f)&&(f=Rc(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new dc(l)},this)};Jc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),ld.apply(null,a)};var ld=Pc.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return Gc(a).concat()};Jc.concatAll=Jc.concatObservable=function(){return this.merge(1)};var md=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new dc;return b.add(this.source.subscribe(new nd(a,this.maxConcurrent,b))),b},b}(Qc),nd=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new kc;this.g.add(c),db(a)&&(a=Rc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Jc.merge=function(a){return"number"!=typeof a?od(this,a):new md(this,a)};var od=Pc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(qc(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=tc,b=0;d>b;b++)c.push(arguments[b]);else for(a=tc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),F(a,c).mergeAll()},pd=function(a){function b(b){this.source=b,a.call(this)}return Xb(b,a),b.prototype.subscribeCore=function(a){var b=new dc,c=new kc;return b.add(c),c.setDisposable(this.source.subscribe(new qd(a,b))),b},b}(Qc),qd=function(){function a(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function b(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return a.prototype.onNext=function(a){if(!this.isStopped){var c=new kc;this.g.add(c),db(a)&&(a=Rc(a)),c.setDisposable(a.subscribe(new b(this,this.g,c)))}},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Jc.mergeAll=Jc.mergeObservable=function(){return new pd(this)};var rd=Y.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};rd.prototype=Error.prototype,Pc.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=F(null,a);return new vd(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new rd(g))}var c=new dc,e=new kc,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new kc;c.add(e),db(d)&&(d=Rc(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},Jc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return sd([this,a])};var sd=Pc.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new vd(function(b){var c=0,d=new lc,e=tc.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],db(f)&&(f=Rc(f)),g=new kc,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new dc(d,e)})};Jc.skipUntil=function(a){var b=this;return new vd(function(c){var d=!1,e=new dc(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));db(a)&&(a=Rc(a));var f=new kc;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},Jc["switch"]=Jc.switchLatest=function(){var a=this;return new vd(function(b){var c=!1,d=new lc,e=!1,f=0,g=a.subscribe(function(a){var g=new kc,h=++f;c=!0,d.setDisposable(g),db(a)&&(a=Rc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new dc(g,d)},a)},Jc.takeUntil=function(a){var b=this;return new vd(function(c){return db(a)&&(a=Rc(a)),new dc(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},Z))},b)},Jc.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new vd(function(a){for(var c=function(){return!1},f=b.length,g=n(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=b[c],e=new kc;db(d)&&(d=Rc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every($)},a.onError.bind(a),function(){})),j[c]=e}(k);var l=new kc;return l.setDisposable(e.subscribe(function(b){var c,e=[b].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void a.onError(f)}a.onNext(c)}},a.onError.bind(a),function(){a.onCompleted()})),j[f]=l,new dc(j)},this)},Jc.zip=function(){if(Array.isArray(arguments[0]))return J.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new vd(function(a){function c(b){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void a.onError(g)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every($)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=n(g,L),i=n(g,K),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new kc;db(e)&&(e=Rc(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(b){a.onError(b)},function(){f(d)})),j[d]=g}(k);return new dc(j)},d)},Pc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Pc.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new vd(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every($))return void b.onCompleted()}function d(a){return g[a]=!0,g.every($)?void b.onCompleted():void 0}for(var e=a.length,f=n(e,function(){return[]}),g=n(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new kc,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},function(a){b.onError(a)},function(){d(e)}))}(i);return new dc(h)})},Jc.asObservable=function(){var a=this;return new vd(function(b){return a.subscribe(b)},this)},Jc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Jc.dematerialize=function(){var a=this;return new vd(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Jc.distinctUntilChanged=function(a,b){var c=this;return b||(b=ab),new vd(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},Jc["do"]=Jc.tap=Jc.doAction=function(a,b,c){var d=this;return new vd(function(e){var f=!a||eb(a)?Ic(a||Z,b||Z,c||Z):a;return d.subscribe(function(a){try{f.onNext(a)}catch(b){e.onError(b)}e.onNext(a)},function(a){try{f.onError(a)}catch(b){e.onError(b)}e.onError(a)},function(){try{f.onCompleted()}catch(a){e.onError(a)}e.onCompleted()})},this)},Jc.doOnNext=Jc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Jc.doOnError=Jc.tapOnError=function(a,b){return this.tap(Z,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Jc.doOnCompleted=Jc.tapOnCompleted=function(a,b){return this.tap(Z,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Jc["finally"]=Jc.ensure=function(a){var b=this;return new vd(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return gc(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},Jc.finallyAction=function(a){return this.ensure(a)},Jc.ignoreElements=function(){var a=this;return new vd(function(b){return a.subscribe(Z,function(a){b.onError(a)},function(){b.onCompleted()})},a)},Jc.materialize=function(){var a=this;return new vd(function(b){return a.subscribe(function(a){b.onNext(Ac(a))},function(a){b.onNext(Bc(a)),b.onCompleted()},function(){b.onNext(Cc()),b.onCompleted()})},a)},Jc.repeat=function(a){return Fc(this,a).concat()},Jc.retry=function(a){return Fc(this,a).catchError()},Jc.retryWhen=function(a){return Fc(this).catchErrorWhen(a)},Jc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new vd(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},Jc.skipLast=function(a){if(0>a)throw new mb;var b=this;return new vd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Jc.startWith=function(){var a,b=0;arguments.length&&qc(arguments[0])?(a=arguments[0],b=1):a=tc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Gc([_c(c,a),this]).concat()},Jc.takeLast=function(a){if(0>a)throw new mb;var b=this;return new vd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Jc.takeLastBuffer=function(a){var b=this;return new vd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},Jc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new mb;if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new mb;return new vd(function(d){function e(){var a=new yd;i.push(a),d.onNext(Zb(a,g))}var f=new kc,g=new mc(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},Jc.selectConcat=Jc.concatMap=function(a,b,c){return eb(a)&&eb(b)?this.concatMap(function(c,d){var e=a(c,d);return db(e)&&(e=Rc(e)),(ub(e)||tb(e))&&(e=Zc(e)),e.map(function(a,e){return b(c,a,d,e)})}):eb(a)?M(this,a,c):M(this,function(){return a})},Jc.concatMapObserver=Jc.selectConcatObserver=function(a,b,c,d){var e=this,f=wb(a,d,2),g=wb(b,d,1),h=wb(c,d,0);return new vd(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}db(d)&&(d=Rc(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}db(c)&&(c=Rc(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}db(b)&&(b=Rc(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Jc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new vd(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},O.prototype.push=function(a){var b=-1===N(this.set,a,this.comparer);return b&&this.set.push(a),b},Jc.distinct=function(a,b){var c=this;return b||(b=ab),new vd(function(d){var e=new O(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var td=function(a){function b(b,c,d){this.source=b,this.selector=wb(c,d,3),a.call(this)}return Xb(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a.call(this,d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new P(a,this.selector,this))},b}(Qc);P.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector).call(this,a,this.i++,this.source);return b===$b?this.observer.onError(b.e):void this.observer.onNext(b)}},P.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},P.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},P.prototype.dispose=function(){this.isStopped=!0},P.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Jc.map=Jc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof td?this.internalMap(c,b):new td(this,c,b)},Jc.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},Jc.selectMany=Jc.flatMap=function(a,b,c){return eb(a)&&eb(b)?this.flatMap(function(c,d){var e=a(c,d);return db(e)&&(e=Rc(e)),(ub(e)||tb(e))&&(e=Zc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):eb(a)?Q(this,a,c):Q(this,function(){return a})},Jc.flatMapObserver=Jc.selectManyObserver=function(a,b,c,d){var e=this;return new vd(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}db(c)&&(c=Rc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}db(c)&&(c=Rc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}db(a)&&(a=Rc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Jc.selectSwitch=Jc.flatMapLatest=Jc.switchMap=function(a,b){return this.select(a,b).switchLatest()},Jc.skip=function(a){if(0>a)throw new mb;var b=this;return new vd(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Jc.skipWhile=function(a,b){var c=this,d=wb(a,b,3);return new vd(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Jc.take=function(a,b){if(0>a)throw new mb;if(0===a)return Vc(b);var c=this;return new vd(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Jc.takeWhile=function(a,b){var c=this,d=wb(a,b,3);return new vd(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var ud=function(a){function b(b,c,d){this.source=b,this.predicate=wb(c,d,3),a.call(this)}return Xb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new R(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a.call(this,b,c,e)},c)},b}(Qc);R.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate).call(this,a,this.i++,this.source);return b===$b?this.observer.onError(b.e):void(b&&this.observer.onNext(a))}},R.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},R.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},R.prototype.dispose=function(){this.isStopped=!0},R.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Jc.filter=Jc.where=function(a,b){return this instanceof ud?this.internalFilter(a,b):new ud(this,a,b)},Jc.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new vd(function(d){var e=a(b(d));return c.subscribe(function(a){try{e["@@transducer/step"](d,a)}catch(b){d.onError(b)}},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var vd=Y.AnonymousObservable=function(a){function b(a){return a&&eb(a.dispose)?a:eb(a)?gc(a):hc}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==$b||d.fail($b.e)?void d.setDisposable(b(f)):q($b.e)}function d(b,d){function e(a){var d=new wd(a),e=[d,b];return uc.scheduleRequired()?uc.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Xb(d,a),d}(Pc),wd=function(a){function b(b){a.call(this),this.observer=b,this.m=new kc}Xb(b,a);var c=b.prototype;return c.next=function(a){var b=p(this.observer.onNext).call(this.observer,a);b===$b&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===$b&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===$b&&q(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Kc),xd=function(a,b){this.subject=a,this.observer=b};xd.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var yd=Y.Subject=function(a){function c(a){return jc(this),this.isStopped?this.hasError?(a.onError(this.error),hc):(a.onCompleted(),hc):(this.observers.push(a),new xd(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Xb(d,a),Yb(d.prototype,Hc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(jc(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(jc(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(jc(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new zd(a,b)},d}(Pc),zd=(Y.AsyncSubject=function(a){function c(a){return jc(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),hc):(this.observers.push(a),new xd(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Xb(d,a),Yb(d.prototype,Hc,{hasObservers:function(){return jc(this),this.observers.length>0},onCompleted:function(){var a,c;if(jc(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(jc(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){jc(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Pc),Y.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Xb(c,a),Yb(c.prototype,Hc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Pc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(T.Rx=Y,define(function(){return Y})):U&&V?W?(V.exports=Y).Rx=Y:U.Rx=Y:T.Rx=Y;var Ad=g()}).call(this);
4
4
  //# sourceMappingURL=rx.compat.map
@@ -57,16 +57,9 @@
57
57
  helpers = Rx.helpers,
58
58
  noop = helpers.noop,
59
59
  isPromise = helpers.isPromise,
60
- isScheduler = helpers.isScheduler,
60
+ isScheduler = Rx.Scheduler.isScheduler,
61
61
  observableFromPromise = Observable.fromPromise;
62
62
 
63
- // Utilities
64
- function argsOrArray(args, idx) {
65
- return args.length === 1 && Array.isArray(args[idx]) ?
66
- args[idx] :
67
- slice.call(args);
68
- }
69
-
70
63
  // Shim in iterator support
71
64
  var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
72
65
  '_es6shim_iterator_';
@@ -462,7 +455,7 @@
462
455
  this.onNext(Observable.empty());
463
456
  },
464
457
  onError: function (e) {
465
- this.onNext(Observable.throwException(e));
458
+ this.onNext(Observable.throwError(e));
466
459
  },
467
460
  onNext: function (v) {
468
461
  this.tail.onNext(v);
@@ -1 +1 @@
1
- {"version":3,"file":"rx.experimental.min.js","sources":["rx.experimental.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","enumerableWhile","condition","source","Enumerable","Enumerator","done","value","Observable","observableProto","prototype","AnonymousObservable","observableConcat","concat","observableDefer","defer","observableEmpty","empty","disposableEmpty","Disposable","CompositeDisposable","SerialDisposable","SingleAssignmentDisposable","internals","enumerableOf","of","immediateScheduler","Scheduler","immediate","currentThreadScheduler","currentThread","AsyncSubject","Array","slice","Observer","inherits","bindCallback","addProperties","helpers","noop","isPromise","isScheduler","observableFromPromise","fromPromise","$iterator$","Symbol","iterator","Set","doneEnumerator","isIterable","o","isArrayLike","length","letBind","func","ifThen","thenSource","elseSourceOrScheduler","now","forIn","sources","resultSelector","thisArg","observableWhileDo","whileDo","doWhile","switchCase","selector","defaultSourceOrScheduler","result","expand","scheduler","observer","q","m","d","activeCount","isAcquired","ensureActive","isOwner","setDisposable","scheduleRecursive","self","work","shift","m1","add","subscribe","x","onNext","e","onError","push","bind","remove","onCompleted","forkJoin","allSources","isArray","arguments","i","len","subscriber","count","group","finished","hasResults","hasCompleted","results","idx","dispose","ix","second","first","lastLeft","lastRight","leftStopped","rightStopped","hasLeft","hasRight","leftSubscription","rightSubscription","left","err","right","manySelect","chain","map","curr","ChainObservable","tap","observeOn","__super__","g","schedule","head","tail","mergeAll","throwException","v","exclusive","hasCurrent","isStopped","innerSource","innerSubscription","exclusiveMap","selectorFunc","index"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD,GAAcA,EAAWP,SAAWO,IACzER,EAAOQ,GAIW,kBAAXE,SAAyBA,OAAOC,IACvCD,QAAQ,MAAO,SAAUE,EAAIR,GACzB,MAAOZ,GAAQQ,EAAMI,EAASQ,KAET,gBAAXL,SAAuBA,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AAQD,GAInBlB,EAASiB,OAAOpB,IAElB,SAAUqB,GAAKlB,EAASmB,QAAQD,IAChC,WACE2C,EAAEvC,OAAOkD,mBACTH,GAAa,EAETC,GAA0B,IAAbT,EAAEjF,QACjBoB,EAASuB,mBAKnB,SAAUL,GAAKlB,EAASmB,QAAQD,IAChC,WACEoD,GAAY,EACK,IAAbT,EAAEjF,QAAiByF,GACrBrE,EAASuB,iBAGRsC,GACNlJ,OAGIU"}
1
+ {"version":3,"file":"rx.experimental.min.js","sources":["rx.experimental.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","enumerableWhile","condition","source","Enumerable","Enumerator","done","value","Observable","observableProto","prototype","AnonymousObservable","observableConcat","concat","observableDefer","defer","observableEmpty","empty","disposableEmpty","Disposable","CompositeDisposable","SerialDisposable","SingleAssignmentDisposable","internals","enumerableOf","of","immediateScheduler","Scheduler","immediate","currentThreadScheduler","currentThread","AsyncSubject","Array","slice","Observer","inherits","bindCallback","addProperties","helpers","noop","isPromise","isScheduler","observableFromPromise","fromPromise","$iterator$","Symbol","iterator","Set","doneEnumerator","isIterable","o","isArrayLike","length","letBind","func","ifThen","thenSource","elseSourceOrScheduler","now","forIn","sources","resultSelector","thisArg","observableWhileDo","whileDo","doWhile","switchCase","selector","defaultSourceOrScheduler","result","expand","scheduler","observer","q","m","d","activeCount","isAcquired","ensureActive","isOwner","setDisposable","scheduleRecursive","self","work","shift","m1","add","subscribe","x","onNext","e","onError","push","bind","remove","onCompleted","forkJoin","allSources","isArray","arguments","i","len","subscriber","count","group","finished","hasResults","hasCompleted","results","idx","dispose","ix","second","first","lastLeft","lastRight","leftStopped","rightStopped","hasLeft","hasRight","leftSubscription","rightSubscription","left","err","right","manySelect","chain","map","curr","ChainObservable","tap","observeOn","__super__","g","schedule","head","tail","mergeAll","throwError","v","exclusive","hasCurrent","isStopped","innerSource","innerSubscription","exclusiveMap","sel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9E,EAAUL,GACjD,GAAIF,GAAUzE,KACV+J,EAAe9G,EAAa+B,EAAUL,EAAS,EACnD,OAAO,IAAInD,GAAoB,SAAU6D,GACvC,GAAI2E,GAAQ,EACVN,GAAa,EACbC,GAAY,EACZpE,EAAI,GAAIpD,GACR+G,EAAI,GAAIjH,EA6CV,OA3CAiH,GAAE/C,IAAIZ,GAENA,EAAEM,cAAcpB,EAAQ2B,UACtB,SAAUwD,GAEHF,IACHA,GAAa,EAEbG,kBAAoB,GAAI1H,GACxB+G,EAAE/C,IAAI0D,mBAENxG,EAAUuG,KAAiBA,EAAcrG,EAAsBqG,IAE/DC,kBAAkBhE,cAAc+D,EAAYxD,UAC1C,SAAUC,GACR,GAAInB,EACJ,KACEA,EAAS6E,EAAa1D,EAAG2D,IAASJ,GAClC,MAAOrD,GAEP,WADAlB,GAASmB,QAAQD,GAInBlB,EAASiB,OAAOpB,IAElB,SAAUqB,GAAKlB,EAASmB,QAAQD,IAChC,WACE2C,EAAEvC,OAAOkD,mBACTH,GAAa,EAETC,GAA0B,IAAbT,EAAEjF,QACjBoB,EAASuB,mBAKnB,SAAUL,GAAKlB,EAASmB,QAAQD,IAChC,WACEoD,GAAY,EACK,IAAbT,EAAEjF,QAAiByF,GACrBrE,EAASuB,iBAGRsC,GACNlJ,OAGIU"}
@@ -1,3 +1,3 @@
1
1
  /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2
- (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return new q(function(){return new p(function(){return a()?{done:!1,value:b}:{done:!0,value:d}})})}var f=c.Observable,g=f.prototype,h=c.AnonymousObservable,i=f.concat,j=f.defer,k=f.empty,l=c.Disposable.empty,m=c.CompositeDisposable,n=c.SerialDisposable,o=c.SingleAssignmentDisposable,p=c.internals.Enumerator,q=c.internals.Enumerable,r=q.of,s=c.Scheduler.immediate,t=c.Scheduler.currentThread,u=(Array.prototype.slice,c.AsyncSubject),v=c.Observer,w=c.internals.inherits,x=c.internals.bindCallback,y=c.internals.addProperties,z=c.helpers,A=z.noop,B=z.isPromise,C=z.isScheduler,D=f.fromPromise,E="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";a.Set&&"function"==typeof(new a.Set)["@@iterator"]&&(E="@@iterator");c.doneEnumerator={done:!0,value:d},c.helpers.isIterable=function(a){return a[E]!==d},c.helpers.isArrayLike=function(a){return a&&a.length!==d};c.helpers.iterator=E,g.letBind=g.let=function(a){return a(this)},f["if"]=f.ifThen=function(a,b,c){return j(function(){return c||(c=k()),B(b)&&(b=D(b)),B(c)&&(c=D(c)),"function"==typeof c.now&&(c=k(c)),a()?b:c})},f["for"]=f.forIn=function(a,b,c){return r(a,b,c).concat()};var F=f["while"]=f.whileDo=function(a,b){return B(b)&&(b=D(b)),e(a,b).concat()};g.doWhile=function(a){return i([this,F(a,this)])},f["case"]=f.switchCase=function(a,b,c){return j(function(){B(c)&&(c=D(c)),c||(c=k()),"function"==typeof c.now&&(c=k(c));var d=b[a()];return B(d)&&(d=D(d)),d||c})},g.expand=function(a,b){C(b)||(b=s);var c=this;return new h(function(d){var e=[],f=new n,g=new m(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new o;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},f.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new h(function(b){var c=a.length;if(0===c)return b.onCompleted(),l;for(var d=new m,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];B(j)&&(j=D(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},g.forkJoin=function(a,b){var c=this;return new h(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new o,l=new o;return B(a)&&(a=D(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new m(k,l)},c)},g.manySelect=function(a,b){C(b)||(b=s);var c=this;return j(function(){var d;return c.map(function(a){var b=new G(a);return d&&d.onNext(a),d=b,b}).tap(A,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var G=function(a){function b(a){var b=this,c=new m;return c.add(t.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new u}return w(c,a),y(c.prototype,v,{onCompleted:function(){this.onNext(f.empty())},onError:function(a){this.onNext(f.throwException(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(f);return g.exclusive=function(){var a=this;return new h(function(b){var c=!1,d=!1,e=new o,f=new m;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,B(a)&&(a=D(a));var e=new o;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f},this)},g.exclusiveMap=function(a,b){var c=this,d=x(a,b,3);return new h(function(a){var b=0,e=!1,f=!0,g=new o,h=new m;return h.add(g),g.setDisposable(c.subscribe(function(c){e||(e=!0,innerSubscription=new o,h.add(innerSubscription),B(c)&&(c=D(c)),innerSubscription.setDisposable(c.subscribe(function(e){var f;try{f=d(e,b++,c)}catch(g){return void a.onError(g)}a.onNext(f)},function(b){a.onError(b)},function(){h.remove(innerSubscription),e=!1,f&&1===h.length&&a.onCompleted()})))},function(b){a.onError(b)},function(){f=!0,1!==h.length||e||a.onCompleted()})),h},this)},c});
2
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return new q(function(){return new p(function(){return a()?{done:!1,value:b}:{done:!0,value:d}})})}var f=c.Observable,g=f.prototype,h=c.AnonymousObservable,i=f.concat,j=f.defer,k=f.empty,l=c.Disposable.empty,m=c.CompositeDisposable,n=c.SerialDisposable,o=c.SingleAssignmentDisposable,p=c.internals.Enumerator,q=c.internals.Enumerable,r=q.of,s=c.Scheduler.immediate,t=c.Scheduler.currentThread,u=(Array.prototype.slice,c.AsyncSubject),v=c.Observer,w=c.internals.inherits,x=c.internals.bindCallback,y=c.internals.addProperties,z=c.helpers,A=z.noop,B=z.isPromise,C=c.Scheduler.isScheduler,D=f.fromPromise,E="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";a.Set&&"function"==typeof(new a.Set)["@@iterator"]&&(E="@@iterator");c.doneEnumerator={done:!0,value:d},c.helpers.isIterable=function(a){return a[E]!==d},c.helpers.isArrayLike=function(a){return a&&a.length!==d};c.helpers.iterator=E,g.letBind=g.let=function(a){return a(this)},f["if"]=f.ifThen=function(a,b,c){return j(function(){return c||(c=k()),B(b)&&(b=D(b)),B(c)&&(c=D(c)),"function"==typeof c.now&&(c=k(c)),a()?b:c})},f["for"]=f.forIn=function(a,b,c){return r(a,b,c).concat()};var F=f["while"]=f.whileDo=function(a,b){return B(b)&&(b=D(b)),e(a,b).concat()};g.doWhile=function(a){return i([this,F(a,this)])},f["case"]=f.switchCase=function(a,b,c){return j(function(){B(c)&&(c=D(c)),c||(c=k()),"function"==typeof c.now&&(c=k(c));var d=b[a()];return B(d)&&(d=D(d)),d||c})},g.expand=function(a,b){C(b)||(b=s);var c=this;return new h(function(d){var e=[],f=new n,g=new m(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new o;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},f.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new h(function(b){var c=a.length;if(0===c)return b.onCompleted(),l;for(var d=new m,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];B(j)&&(j=D(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},g.forkJoin=function(a,b){var c=this;return new h(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new o,l=new o;return B(a)&&(a=D(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new m(k,l)},c)},g.manySelect=function(a,b){C(b)||(b=s);var c=this;return j(function(){var d;return c.map(function(a){var b=new G(a);return d&&d.onNext(a),d=b,b}).tap(A,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var G=function(a){function b(a){var b=this,c=new m;return c.add(t.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new u}return w(c,a),y(c.prototype,v,{onCompleted:function(){this.onNext(f.empty())},onError:function(a){this.onNext(f.throwError(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(f);return g.exclusive=function(){var a=this;return new h(function(b){var c=!1,d=!1,e=new o,f=new m;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,B(a)&&(a=D(a));var e=new o;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f},this)},g.exclusiveMap=function(a,b){var c=this,d=x(a,b,3);return new h(function(a){var b=0,e=!1,f=!0,g=new o,h=new m;return h.add(g),g.setDisposable(c.subscribe(function(c){e||(e=!0,innerSubscription=new o,h.add(innerSubscription),B(c)&&(c=D(c)),innerSubscription.setDisposable(c.subscribe(function(e){var f;try{f=d(e,b++,c)}catch(g){return void a.onError(g)}a.onNext(f)},function(b){a.onError(b)},function(){h.remove(innerSubscription),e=!1,f&&1===h.length&&a.onCompleted()})))},function(b){a.onError(b)},function(){f=!0,1!==h.length||e||a.onCompleted()})),h},this)},c});
3
3
  //# sourceMappingURL=rx.experimental.map
@@ -34,28 +34,20 @@
34
34
 
35
35
  // Aliases
36
36
  var Observable = Rx.Observable,
37
- observableProto = Observable.prototype,
38
- AnonymousObservable = Rx.AnonymousObservable,
39
- observableThrow = Observable.throwException,
40
- observerCreate = Rx.Observer.create,
41
- SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
42
- CompositeDisposable = Rx.CompositeDisposable,
43
- AbstractObserver = Rx.internals.AbstractObserver,
44
- noop = Rx.helpers.noop,
45
- defaultComparer = Rx.internals.isEqual,
46
- inherits = Rx.internals.inherits,
47
- Enumerable = Rx.internals.Enumerable,
48
- Enumerator = Rx.internals.Enumerator,
49
- $iterator$ = Rx.iterator,
50
- doneEnumerator = Rx.doneEnumerator,
51
- slice = Array.prototype.slice;
52
-
53
- // Utilities
54
- function argsOrArray(args, idx) {
55
- return args.length === 1 && Array.isArray(args[idx]) ?
56
- args[idx] :
57
- slice.call(args);
58
- }
37
+ observableProto = Observable.prototype,
38
+ AnonymousObservable = Rx.AnonymousObservable,
39
+ observableThrow = Observable.throwError,
40
+ observerCreate = Rx.Observer.create,
41
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
42
+ CompositeDisposable = Rx.CompositeDisposable,
43
+ AbstractObserver = Rx.internals.AbstractObserver,
44
+ noop = Rx.helpers.noop,
45
+ defaultComparer = Rx.internals.isEqual,
46
+ inherits = Rx.internals.inherits,
47
+ Enumerable = Rx.internals.Enumerable,
48
+ Enumerator = Rx.internals.Enumerator,
49
+ $iterator$ = Rx.iterator,
50
+ doneEnumerator = Rx.doneEnumerator;
59
51
 
60
52
  /** @private */
61
53
  var Map = root.Map || (function () {
@@ -1 +1 @@
1
- {"version":3,"file":"rx.joinpatterns.min.js","sources":["rx.joinpatterns.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","Pattern","patterns","Plan","expression","selector","planCreateObserver","externalSubscriptions","observable","onError","entry","get","observer","JoinObserver","set","ActivePlan","joinObserverArray","onNext","onCompleted","joinObservers","Map","i","len","length","joinObserver","Observable","observableProto","prototype","AnonymousObservable","observableThrow","throwException","observerCreate","Observer","create","SingleAssignmentDisposable","CompositeDisposable","AbstractObserver","internals","noop","helpers","inherits","isEqual","Enumerable","Enumerator","iterator","doneEnumerator","Array","slice","_keys","_values","key","indexOf","value","push","forEach","callback","thisArg","and","other","concat","thenDo","activate","deactivate","self","bind","activePlan","result","apply","arguments","e","j","jlen","removeActivePlan","addActivePlan","dequeue","v","queue","shift","match","hasValues","firstValues","isCompleted","kind","values","__super__","source","activePlans","subscription","isDisposed","JoinObserverPrototype","next","notification","exception","error","completed","subscribe","setDisposable","materialize","splice","dispose","right","when","plans","isArray","o","outObserver","x","err","idx","group","add"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UA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,EAAW4E,KAAO,WAChB,GAA4BC,GAAxBhF,EAAM8C,UAAU7C,MACpB,IAAIuB,MAAMyD,QAAQnC,UAAU,IAC1BkC,EAAQlC,UAAU,OACb,CACLkC,EAAQ,GAAIxD,OAAMxB,EAClB,KAAI,GAAID,GAAI,EAAOC,EAAJD,EAASA,IAAOiF,EAAMjF,GAAK+C,UAAU/C,GAEtD,MAAO,IAAIO,GAAoB,SAAU4E,GACvC,GAAIlB,MACA/E,EAAwB,GAAIa,GAC5BqF,EAAc1E,EAChB,SAAU2E,GAAKF,EAAEvF,OAAOyF,IACxB,SAAUC,GACRpG,EAAsB+C,QAAQ,SAAUqB,GAAKA,EAAElE,QAAQkG,KACvDH,EAAE/F,QAAQkG,IAEZ,WAAeH,EAAEtF,eAEnB,KACE,IAAK,GAAIG,GAAI,EAAGC,EAAMgF,EAAM/E,OAAYD,EAAJD,EAASA,IAC3CiE,EAAYjC,KAAKiD,EAAMjF,GAAGwC,SAAStD,EAAuBkG,EAAa,SAAUxC,GAC/E,GAAI2C,GAAMtB,EAAYnC,QAAQc,EAC9BqB,GAAYY,OAAOU,EAAK,GACD,IAAvBtB,EAAY/D,QAAgBiF,EAAEtF,iBAGlC,MAAOmD,GACPxC,EAAgBwC,GAAG0B,UAAUS,GAE/B,GAAIK,GAAQ,GAAI1E,EAMhB,OALA5B,GAAsB+C,QAAQ,SAAU9B,GACtCA,EAAauE,YACbc,EAAMC,IAAItF,KAGLqF,KAIFhH"}
1
+ {"version":3,"file":"rx.joinpatterns.min.js","sources":["rx.joinpatterns.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","Pattern","patterns","Plan","expression","selector","planCreateObserver","externalSubscriptions","observable","onError","entry","get","observer","JoinObserver","set","ActivePlan","joinObserverArray","onNext","onCompleted","joinObservers","Map","i","len","length","joinObserver","Observable","observableProto","prototype","AnonymousObservable","observableThrow","throwError","observerCreate","Observer","create","SingleAssignmentDisposable","CompositeDisposable","AbstractObserver","internals","noop","helpers","inherits","isEqual","Enumerable","Enumerator","iterator","doneEnumerator","_keys","_values","key","indexOf","value","push","forEach","callback","thisArg","and","other","concat","thenDo","activate","deactivate","self","bind","activePlan","result","apply","arguments","e","j","jlen","removeActivePlan","addActivePlan","dequeue","v","queue","shift","match","hasValues","firstValues","isCompleted","kind","values","__super__","source","activePlans","subscription","isDisposed","JoinObserverPrototype","next","notification","exception","slice","error","completed","subscribe","setDisposable","materialize","splice","dispose","right","when","plans","Array","isArray","o","outObserver","x","err","idx","group","add"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD,GAAcA,EAAWP,SAAWO,IACzER,EAAOQ,GAIW,kBAAXE,SAAyBA,OAAOC,IACvCD,QAAQ,MAAO,SAAUE,EAAIR,GACzB,MAAOZ,GAAQQ,EAAMI,EAASQ,KAET,gBAAXL,SAAuBA,QAAUA,OAAOH,UAAYD,EAClEI,OAAOH,QAAUZ,EAAQQ,EAAMO,OAAOH,QAASS,QAAQ,SAEvDb,EAAKY,GAAKpB,EAAQQ,KAAUA,EAAKY,MAEvCE,KAAKZ,KAAM,SAAUF,EAAMe,EAAKH,EAAIb,GAmDpC,QAASiB,GAAQC,GACff,KAAKe,SAAWA,EAqBlB,QAASC,GAAKC,EAAYC,GACtBlB,KAAKiB,WAAaA,EAClBjB,KAAKkB,SAAWA,EA8BpB,QAASC,GAAmBC,EAAuBC,EAAYC,GAC7D,GAAIC,G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EAAuBkG,EAAa,SAAU1C,GAC/E,GAAI6C,GAAMxB,EAAYnC,QAAQc,EAC9BqB,GAAYa,OAAOW,EAAK,GACD,IAAvBxB,EAAY7D,QAAgBiF,EAAEtF,iBAGlC,MAAOiD,GACPtC,EAAgBsC,GAAG2B,UAAUU,GAE/B,GAAIK,GAAQ,GAAI1E,EAMhB,OALA5B,GAAsB6C,QAAQ,SAAU5B,GACtCA,EAAasE,YACbe,EAAMC,IAAItF,KAGLqF,KAIFhH"}
@@ -1,3 +1,3 @@
1
1
  /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2
- (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a){this.patterns=a}function f(a,b){this.expression=a,this.selector=b}function g(a,b,c){var d=a.get(b);if(!d){var e=new t(b,c);return a.set(b,e),e}return d}function h(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new s;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}var i=c.Observable,j=i.prototype,k=c.AnonymousObservable,l=i.throwException,m=c.Observer.create,n=c.SingleAssignmentDisposable,o=c.CompositeDisposable,p=c.internals.AbstractObserver,q=c.helpers.noop,r=(c.internals.isEqual,c.internals.inherits),s=(c.internals.Enumerable,c.internals.Enumerator,c.iterator,c.doneEnumerator,Array.prototype.slice,a.Map||function(){function a(){this._keys=[],this._values=[]}return a.prototype.get=function(a){var b=this._keys.indexOf(a);return-1!==b?this._values[b]:d},a.prototype.set=function(a,b){var c=this._keys.indexOf(a);-1!==c&&(this._values[c]=b),this._values[this._keys.push(a)-1]=b},a.prototype.forEach=function(a,b){for(var c=0,d=this._keys.length;d>c;c++)a.call(b,this._values[c],this._keys[c])},a}());e.prototype.and=function(a){return new e(this.patterns.concat(a))},e.prototype.thenDo=function(a){return new f(this,a)},f.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,i=this.expression.patterns.length;i>f;f++)e.push(g(a,this.expression.patterns[f],b.onError.bind(b)));var j=new h(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(j);c(j)});for(f=0,i=e.length;i>f;f++)e[f].addActivePlan(j);return j},h.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},h.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var t=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new n,this.isDisposed=!1}r(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=q,c.completed=q,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(p);return j.and=function(a){return new e([this,a])},j.thenDo=function(a){return new e([this]).thenDo(a)},i.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new k(function(b){var c=[],d=new s,e=m(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){l(h).subscribe(b)}var i=new o;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})},c});
2
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a){this.patterns=a}function f(a,b){this.expression=a,this.selector=b}function g(a,b,c){var d=a.get(b);if(!d){var e=new t(b,c);return a.set(b,e),e}return d}function h(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new s;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}var i=c.Observable,j=i.prototype,k=c.AnonymousObservable,l=i.throwError,m=c.Observer.create,n=c.SingleAssignmentDisposable,o=c.CompositeDisposable,p=c.internals.AbstractObserver,q=c.helpers.noop,r=(c.internals.isEqual,c.internals.inherits),s=(c.internals.Enumerable,c.internals.Enumerator,c.iterator,c.doneEnumerator,a.Map||function(){function a(){this._keys=[],this._values=[]}return a.prototype.get=function(a){var b=this._keys.indexOf(a);return-1!==b?this._values[b]:d},a.prototype.set=function(a,b){var c=this._keys.indexOf(a);-1!==c&&(this._values[c]=b),this._values[this._keys.push(a)-1]=b},a.prototype.forEach=function(a,b){for(var c=0,d=this._keys.length;d>c;c++)a.call(b,this._values[c],this._keys[c])},a}());e.prototype.and=function(a){return new e(this.patterns.concat(a))},e.prototype.thenDo=function(a){return new f(this,a)},f.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,i=this.expression.patterns.length;i>f;f++)e.push(g(a,this.expression.patterns[f],b.onError.bind(b)));var j=new h(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(j);c(j)});for(f=0,i=e.length;i>f;f++)e[f].addActivePlan(j);return j},h.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},h.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var t=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new n,this.isDisposed=!1}r(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=q,c.completed=q,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(p);return j.and=function(a){return new e([this,a])},j.thenDo=function(a){return new e([this]).thenDo(a)},i.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new k(function(b){var c=[],d=new s,e=m(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){l(h).subscribe(b)}var i=new o;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})},c});
3
3
  //# sourceMappingURL=rx.joinpatterns.map
@@ -32,7 +32,6 @@
32
32
  // Defaults
33
33
  var noop = Rx.helpers.noop = function () { },
34
34
  notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
35
- isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; },
36
35
  identity = Rx.helpers.identity = function (x) { return x; },
37
36
  pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
38
37
  just = Rx.helpers.just = function (value) { return function () { return value; }; },
@@ -60,11 +59,6 @@
60
59
  return isFn;
61
60
  }());
62
61
 
63
- // Errors
64
- var sequenceContainsNoElements = 'Sequence contains no elements.';
65
- var argumentOutOfRange = 'Argument out of range';
66
- var objectDisposed = 'Object has been disposed';
67
- function checkDisposed(self) { if (self.isDisposed) { throw new Error(objectDisposed); } }
68
62
  function cloneArray(arr) { for(var a = [], i = 0, len = arr.length; i < len; i++) { a.push(arr[i]); } return a;}
69
63
 
70
64
  Rx.config.longStackSupport = false;
@@ -163,6 +157,44 @@
163
157
  if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
164
158
  }
165
159
 
160
+ var EmptyError = Rx.EmptyError = function() {
161
+ this.message = 'Sequence contains no elements.';
162
+ Error.call(this);
163
+ };
164
+ EmptyError.prototype = Error.prototype;
165
+
166
+ var ObjectDisposedError = Rx.ObjectDisposedError = function() {
167
+ this.message = 'Object has been disposed';
168
+ Error.call(this);
169
+ };
170
+ ObjectDisposedError.prototype = Error.prototype;
171
+
172
+ var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
173
+ this.message = 'Argument out of range';
174
+ Error.call(this);
175
+ };
176
+ ArgumentOutOfRangeError.prototype = Error.prototype;
177
+
178
+ var NotSupportedError = Rx.NotSupportedError = function (message) {
179
+ this.message = message || 'This operation is not supported';
180
+ Error.call(this);
181
+ };
182
+ NotSupportedError.prototype = Error.prototype;
183
+
184
+ var NotImplementedError = Rx.NotImplementedError = function (message) {
185
+ this.message = message || 'This operation is not implemented';
186
+ Error.call(this);
187
+ };
188
+ NotImplementedError.prototype = Error.prototype;
189
+
190
+ var notImplemented = Rx.helpers.notImplemented = function () {
191
+ throw new NotImplementedError();
192
+ };
193
+
194
+ var notSupported = Rx.helpers.notSupported = function () {
195
+ throw new NotSupportedError();
196
+ };
197
+
166
198
  // Shim in iterator support
167
199
  var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
168
200
  '_es6shim_iterator_';
@@ -638,13 +670,17 @@
638
670
  * @constructor
639
671
  */
640
672
  var CompositeDisposable = Rx.CompositeDisposable = function () {
641
- var args = [];
673
+ var args = [], i, len;
642
674
  if (Array.isArray(arguments[0])) {
643
675
  args = arguments[0];
676
+ len = args.length;
644
677
  } else {
645
- var len = arguments.length;
678
+ len = arguments.length;
646
679
  args = new Array(len);
647
- for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
680
+ for(i = 0; i < len; i++) { args[i] = arguments[i]; }
681
+ }
682
+ for(i = 0; i < len; i++) {
683
+ if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
648
684
  }
649
685
  this.disposables = args;
650
686
  this.isDisposed = false;
@@ -731,51 +767,67 @@
731
767
  */
732
768
  var disposableEmpty = Disposable.empty = { dispose: noop };
733
769
 
734
- var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function () {
735
- function BooleanDisposable () {
736
- this.isDisposed = false;
737
- this.current = null;
738
- }
739
-
740
- var booleanDisposablePrototype = BooleanDisposable.prototype;
741
-
742
- /**
743
- * Gets the underlying disposable.
744
- * @return The underlying disposable.
745
- */
746
- booleanDisposablePrototype.getDisposable = function () {
747
- return this.current;
748
- };
770
+ /**
771
+ * Validates whether the given object is a disposable
772
+ * @param {Object} Object to test whether it has a dispose method
773
+ * @returns {Boolean} true if a disposable object, else false.
774
+ */
775
+ var isDisposable = Disposable.isDisposable = function (d) {
776
+ return d && isFunction(d.dispose);
777
+ };
749
778
 
750
- /**
751
- * Sets the underlying disposable.
752
- * @param {Disposable} value The new underlying disposable.
753
- */
754
- booleanDisposablePrototype.setDisposable = function (value) {
755
- var shouldDispose = this.isDisposed;
756
- if (!shouldDispose) {
757
- var old = this.current;
758
- this.current = value;
759
- }
760
- old && old.dispose();
761
- shouldDispose && value && value.dispose();
762
- };
779
+ var checkDisposed = Disposable.checkDisposed = function (disposable) {
780
+ if (disposable.isDisposed) { throw new ObjectDisposedError(); }
781
+ };
763
782
 
764
- /**
765
- * Disposes the underlying disposable as well as all future replacements.
766
- */
767
- booleanDisposablePrototype.dispose = function () {
768
- if (!this.isDisposed) {
769
- this.isDisposed = true;
770
- var old = this.current;
771
- this.current = null;
772
- }
773
- old && old.dispose();
774
- };
783
+ // Single assignment
784
+ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
785
+ this.isDisposed = false;
786
+ this.current = null;
787
+ };
788
+ SingleAssignmentDisposable.prototype.getDisposable = function () {
789
+ return this.current;
790
+ };
791
+ SingleAssignmentDisposable.prototype.setDisposable = function (value) {
792
+ if (this.current) { throw new Error('Disposable has already been assigned'); }
793
+ var shouldDispose = this.isDisposed;
794
+ !shouldDispose && (this.current = value);
795
+ shouldDispose && value && value.dispose();
796
+ };
797
+ SingleAssignmentDisposable.prototype.dispose = function () {
798
+ if (!this.isDisposed) {
799
+ this.isDisposed = true;
800
+ var old = this.current;
801
+ this.current = null;
802
+ }
803
+ old && old.dispose();
804
+ };
775
805
 
776
- return BooleanDisposable;
777
- }());
778
- var SerialDisposable = Rx.SerialDisposable = SingleAssignmentDisposable;
806
+ // Multiple assignment disposable
807
+ var SerialDisposable = Rx.SerialDisposable = function () {
808
+ this.isDisposed = false;
809
+ this.current = null;
810
+ };
811
+ SerialDisposable.prototype.getDisposable = function () {
812
+ return this.current;
813
+ };
814
+ SerialDisposable.prototype.setDisposable = function (value) {
815
+ var shouldDispose = this.isDisposed;
816
+ if (!shouldDispose) {
817
+ var old = this.current;
818
+ this.current = value;
819
+ }
820
+ old && old.dispose();
821
+ shouldDispose && value && value.dispose();
822
+ };
823
+ SerialDisposable.prototype.dispose = function () {
824
+ if (!this.isDisposed) {
825
+ this.isDisposed = true;
826
+ var old = this.current;
827
+ this.current = null;
828
+ }
829
+ old && old.dispose();
830
+ };
779
831
 
780
832
  /**
781
833
  * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
@@ -887,6 +939,11 @@
887
939
  this._scheduleAbsolute = scheduleAbsolute;
888
940
  }
889
941
 
942
+ /** Determines whether the given object is a scheduler */
943
+ Scheduler.isScheduler = function (s) {
944
+ return s instanceof Scheduler;
945
+ }
946
+
890
947
  function invokeAction(scheduler, action) {
891
948
  action();
892
949
  return disposableEmpty;
@@ -971,12 +1028,14 @@
971
1028
  return Scheduler;
972
1029
  }());
973
1030
 
974
- var normalizeTime = Scheduler.normalize;
1031
+ var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
975
1032
 
976
1033
  (function (schedulerProto) {
1034
+
977
1035
  function invokeRecImmediate(scheduler, pair) {
978
- var state = pair.first, action = pair.second, group = new CompositeDisposable(),
979
- recursiveAction = function (state1) {
1036
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
1037
+
1038
+ function recursiveAction(state1) {
980
1039
  action(state1, function (state2) {
981
1040
  var isAdded = false, isDone = false,
982
1041
  d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
@@ -993,14 +1052,15 @@
993
1052
  isAdded = true;
994
1053
  }
995
1054
  });
996
- };
1055
+ }
1056
+
997
1057
  recursiveAction(state);
998
1058
  return group;
999
1059
  }
1000
1060
 
1001
1061
  function invokeRecDate(scheduler, pair, method) {
1002
- var state = pair.first, action = pair.second, group = new CompositeDisposable(),
1003
- recursiveAction = function (state1) {
1062
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
1063
+ function recursiveAction(state1) {
1004
1064
  action(state1, function (state2, dueTime1) {
1005
1065
  var isAdded = false, isDone = false,
1006
1066
  d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
@@ -1043,7 +1103,7 @@
1043
1103
  * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
1044
1104
  */
1045
1105
  schedulerProto.scheduleRecursiveWithState = function (state, action) {
1046
- return this.scheduleWithState({ first: state, second: action }, invokeRecImmediate);
1106
+ return this.scheduleWithState([state, action], invokeRecImmediate);
1047
1107
  };
1048
1108
 
1049
1109
  /**
@@ -1064,7 +1124,7 @@
1064
1124
  * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
1065
1125
  */
1066
1126
  schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
1067
- return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) {
1127
+ return this._scheduleRelative([state, action], dueTime, function (s, p) {
1068
1128
  return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
1069
1129
  });
1070
1130
  };
@@ -1087,7 +1147,7 @@
1087
1147
  * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
1088
1148
  */
1089
1149
  schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
1090
- return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) {
1150
+ return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
1091
1151
  return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
1092
1152
  });
1093
1153
  };
@@ -1113,16 +1173,10 @@
1113
1173
  * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
1114
1174
  */
1115
1175
  Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
1116
- if (typeof root.setInterval === 'undefined') { throw new Error('Periodic scheduling not supported.'); }
1117
- var s = state;
1118
-
1119
- var id = root.setInterval(function () {
1120
- s = action(s);
1121
- }, period);
1122
-
1123
- return disposableCreate(function () {
1124
- root.clearInterval(id);
1125
- });
1176
+ if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
1177
+ period = normalizeTime(period);
1178
+ var s = state, id = root.setInterval(function () { s = action(s); }, period);
1179
+ return disposableCreate(function () { root.clearInterval(id); });
1126
1180
  };
1127
1181
 
1128
1182
  }(Scheduler.prototype));
@@ -1169,10 +1223,7 @@
1169
1223
 
1170
1224
  /** Gets a scheduler that schedules work immediately on the current thread. */
1171
1225
  var immediateScheduler = Scheduler.immediate = (function () {
1172
-
1173
1226
  function scheduleNow(state, action) { return action(this, state); }
1174
- function notSupported() { throw new Error('Not supported'); }
1175
-
1176
1227
  return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
1177
1228
  }());
1178
1229
 
@@ -1182,12 +1233,10 @@
1182
1233
  var currentThreadScheduler = Scheduler.currentThread = (function () {
1183
1234
  var queue;
1184
1235
 
1185
- function runTrampoline (q) {
1186
- while (q.length > 0) {
1187
- var item = q.dequeue();
1188
- if (!item.isCancelled()) {
1189
- !item.isCancelled() && item.invoke();
1190
- }
1236
+ function runTrampoline () {
1237
+ while (queue.length > 0) {
1238
+ var item = queue.dequeue();
1239
+ !item.isCancelled() && item.invoke();
1191
1240
  }
1192
1241
  }
1193
1242
 
@@ -1197,44 +1246,36 @@
1197
1246
  if (!queue) {
1198
1247
  queue = new PriorityQueue(4);
1199
1248
  queue.enqueue(si);
1200
- try {
1201
- runTrampoline(queue);
1202
- } catch (e) {
1203
- throw e;
1204
- } finally {
1205
- queue = null;
1206
- }
1249
+
1250
+ var result = tryCatch(runTrampoline)();
1251
+ queue = null;
1252
+ if (result === errorObj) { return thrower(result.e); }
1207
1253
  } else {
1208
1254
  queue.enqueue(si);
1209
1255
  }
1210
1256
  return si.disposable;
1211
1257
  }
1212
1258
 
1213
- function notSupported() { throw new Error('Not supported'); }
1214
-
1215
1259
  var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
1216
-
1217
1260
  currentScheduler.scheduleRequired = function () { return !queue; };
1218
- currentScheduler.ensureTrampoline = function (action) {
1219
- if (!queue) { this.schedule(action); } else { action(); }
1220
- };
1221
1261
 
1222
1262
  return currentScheduler;
1223
1263
  }());
1224
1264
 
1225
- var scheduleMethod, clearMethod = noop;
1265
+ var scheduleMethod, clearMethod;
1266
+
1226
1267
  var localTimer = (function () {
1227
1268
  var localSetTimeout, localClearTimeout = noop;
1228
- if ('WScript' in this) {
1269
+ if (!!root.setTimeout) {
1270
+ localSetTimeout = root.setTimeout;
1271
+ localClearTimeout = root.clearTimeout;
1272
+ } else if (!!root.WScript) {
1229
1273
  localSetTimeout = function (fn, time) {
1230
- WScript.Sleep(time);
1274
+ root.WScript.Sleep(time);
1231
1275
  fn();
1232
1276
  };
1233
- } else if (!!root.setTimeout) {
1234
- localSetTimeout = root.setTimeout;
1235
- localClearTimeout = root.clearTimeout;
1236
1277
  } else {
1237
- throw new Error('No concurrency detected!');
1278
+ throw new NotSupportedError();
1238
1279
  }
1239
1280
 
1240
1281
  return {
@@ -1247,6 +1288,27 @@
1247
1288
 
1248
1289
  (function () {
1249
1290
 
1291
+ var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
1292
+
1293
+ clearMethod = function (handle) {
1294
+ delete tasksByHandle[handle];
1295
+ };
1296
+
1297
+ function runTask(handle) {
1298
+ if (currentlyRunning) {
1299
+ localSetTimeout(function () { runTask(handle) }, 0);
1300
+ } else {
1301
+ var task = tasksByHandle[handle];
1302
+ if (task) {
1303
+ currentlyRunning = true;
1304
+ var result = tryCatch(task)();
1305
+ clearMethod(handle);
1306
+ currentlyRunning = false;
1307
+ if (result === errorObj) { return thrower(result.e); }
1308
+ }
1309
+ }
1310
+ }
1311
+
1250
1312
  var reNative = RegExp('^' +
1251
1313
  String(toString)
1252
1314
  .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
@@ -1254,15 +1316,12 @@
1254
1316
  );
1255
1317
 
1256
1318
  var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
1257
- !reNative.test(setImmediate) && setImmediate,
1258
- clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' &&
1259
- !reNative.test(clearImmediate) && clearImmediate;
1319
+ !reNative.test(setImmediate) && setImmediate;
1260
1320
 
1261
1321
  function postMessageSupported () {
1262
1322
  // Ensure not in a worker
1263
1323
  if (!root.postMessage || root.importScripts) { return false; }
1264
- var isAsync = false,
1265
- oldHandler = root.onmessage;
1324
+ var isAsync = false, oldHandler = root.onmessage;
1266
1325
  // Test for async
1267
1326
  root.onmessage = function () { isAsync = true; };
1268
1327
  root.postMessage('', '*');
@@ -1272,85 +1331,96 @@
1272
1331
  }
1273
1332
 
1274
1333
  // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
1275
- if (typeof setImmediate === 'function') {
1276
- scheduleMethod = setImmediate;
1277
- clearMethod = clearImmediate;
1334
+ if (isFunction(setImmediate)) {
1335
+ scheduleMethod = function (action) {
1336
+ var id = nextHandle++;
1337
+ tasksByHandle[id] = action;
1338
+ setImmediate(function () { runTask(id); });
1339
+
1340
+ return id;
1341
+ };
1278
1342
  } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
1279
- scheduleMethod = process.nextTick;
1343
+ scheduleMethod = function (action) {
1344
+ var id = nextHandle++;
1345
+ tasksByHandle[id] = action;
1346
+ process.nextTick(function () { runTask(id); });
1347
+
1348
+ return id;
1349
+ };
1280
1350
  } else if (postMessageSupported()) {
1281
- var MSG_PREFIX = 'ms.rx.schedule' + Math.random(),
1282
- tasks = {},
1283
- taskId = 0;
1351
+ var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
1284
1352
 
1285
- var onGlobalPostMessage = function (event) {
1353
+ function onGlobalPostMessage(event) {
1286
1354
  // Only if we're a match to avoid any other global events
1287
1355
  if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
1288
- var handleId = event.data.substring(MSG_PREFIX.length),
1289
- action = tasks[handleId];
1290
- action();
1291
- delete tasks[handleId];
1356
+ runTask(event.data.substring(MSG_PREFIX.length));
1292
1357
  }
1293
1358
  }
1294
1359
 
1295
1360
  if (root.addEventListener) {
1296
1361
  root.addEventListener('message', onGlobalPostMessage, false);
1362
+ } else if (root.attachEvent) {
1363
+ root.attachEvent('onmessage', onGlobalPostMessage);
1297
1364
  } else {
1298
- root.attachEvent('onmessage', onGlobalPostMessage, false);
1365
+ root.onmessage = onGlobalPostMessage;
1299
1366
  }
1300
1367
 
1301
1368
  scheduleMethod = function (action) {
1302
- var currentId = taskId++;
1303
- tasks[currentId] = action;
1369
+ var id = nextHandle++;
1370
+ tasksByHandle[id] = action;
1304
1371
  root.postMessage(MSG_PREFIX + currentId, '*');
1372
+ return id;
1305
1373
  };
1306
1374
  } else if (!!root.MessageChannel) {
1307
- var channel = new root.MessageChannel(),
1308
- channelTasks = {},
1309
- channelTaskId = 0;
1375
+ var channel = new root.MessageChannel();
1310
1376
 
1311
- channel.port1.onmessage = function (event) {
1312
- var id = event.data,
1313
- action = channelTasks[id];
1314
- action();
1315
- delete channelTasks[id];
1316
- };
1377
+ channel.port1.onmessage = function (e) { runTask(e.data); };
1317
1378
 
1318
1379
  scheduleMethod = function (action) {
1319
- var id = channelTaskId++;
1320
- channelTasks[id] = action;
1380
+ var id = nextHandle++;
1381
+ tasksByHandle[id] = action;
1321
1382
  channel.port2.postMessage(id);
1383
+ return id;
1322
1384
  };
1323
1385
  } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
1324
1386
 
1325
1387
  scheduleMethod = function (action) {
1326
1388
  var scriptElement = root.document.createElement('script');
1389
+ var id = nextHandle++;
1390
+ tasksByHandle[id] = action;
1391
+
1327
1392
  scriptElement.onreadystatechange = function () {
1328
- action();
1393
+ runTask(id);
1329
1394
  scriptElement.onreadystatechange = null;
1330
1395
  scriptElement.parentNode.removeChild(scriptElement);
1331
1396
  scriptElement = null;
1332
1397
  };
1333
1398
  root.document.documentElement.appendChild(scriptElement);
1399
+ return id;
1334
1400
  };
1335
1401
 
1336
1402
  } else {
1337
- scheduleMethod = function (action) { return localSetTimeout(action, 0); };
1338
- clearMethod = localClearTimeout;
1403
+ scheduleMethod = function (action) {
1404
+ var id = nextHandle++;
1405
+ tasksByHandle[id] = action;
1406
+ localSetTimeout(function () {
1407
+ runTask(id);
1408
+ }, 0);
1409
+
1410
+ return id;
1411
+ };
1339
1412
  }
1340
1413
  }());
1341
1414
 
1342
1415
  /**
1343
1416
  * Gets a scheduler that schedules work via a timed callback based upon platform.
1344
1417
  */
1345
- var timeoutScheduler = Scheduler.timeout = (function () {
1418
+ var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
1346
1419
 
1347
1420
  function scheduleNow(state, action) {
1348
- var scheduler = this,
1349
- disposable = new SingleAssignmentDisposable();
1421
+ var scheduler = this, disposable = new SingleAssignmentDisposable();
1350
1422
  var id = scheduleMethod(function () {
1351
- if (!disposable.isDisposed) {
1352
- disposable.setDisposable(action(scheduler, state));
1353
- }
1423
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
1354
1424
  });
1355
1425
  return new CompositeDisposable(disposable, disposableCreate(function () {
1356
1426
  clearMethod(id);
@@ -1358,16 +1428,10 @@
1358
1428
  }
1359
1429
 
1360
1430
  function scheduleRelative(state, dueTime, action) {
1361
- var scheduler = this,
1362
- dt = Scheduler.normalize(dueTime);
1363
- if (dt === 0) {
1364
- return scheduler.scheduleWithState(state, action);
1365
- }
1366
- var disposable = new SingleAssignmentDisposable();
1431
+ var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
1432
+ if (dt === 0) { return scheduler.scheduleWithState(state, action); }
1367
1433
  var id = localSetTimeout(function () {
1368
- if (!disposable.isDisposed) {
1369
- disposable.setDisposable(action(scheduler, state));
1370
- }
1434
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
1371
1435
  }, dt);
1372
1436
  return new CompositeDisposable(disposable, disposableCreate(function () {
1373
1437
  localClearTimeout(id);
@@ -1457,9 +1521,13 @@
1457
1521
  * Represents a notification to an observer.
1458
1522
  */
1459
1523
  var Notification = Rx.Notification = (function () {
1460
- function Notification(kind, hasValue) {
1461
- this.hasValue = hasValue == null ? false : hasValue;
1524
+ function Notification(kind, value, exception, accept, acceptObservable, toString) {
1462
1525
  this.kind = kind;
1526
+ this.value = value;
1527
+ this.exception = exception;
1528
+ this._accept = accept;
1529
+ this._acceptObservable = acceptObservable;
1530
+ this.toString = toString;
1463
1531
  }
1464
1532
 
1465
1533
  /**
@@ -1485,10 +1553,10 @@
1485
1553
  * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
1486
1554
  */
1487
1555
  Notification.prototype.toObservable = function (scheduler) {
1488
- var notification = this;
1556
+ var self = this;
1489
1557
  isScheduler(scheduler) || (scheduler = immediateScheduler);
1490
1558
  return new AnonymousObservable(function (observer) {
1491
- return scheduler.schedule(function () {
1559
+ return scheduler.scheduleWithState(self, function (_, notification) {
1492
1560
  notification._acceptObservable(observer);
1493
1561
  notification.kind === 'N' && observer.onCompleted();
1494
1562
  });
@@ -1504,18 +1572,12 @@
1504
1572
  * @returns {Notification} The OnNext notification containing the value.
1505
1573
  */
1506
1574
  var notificationCreateOnNext = Notification.createOnNext = (function () {
1507
-
1508
- function _accept (onNext) { return onNext(this.value); }
1575
+ function _accept(onNext) { return onNext(this.value); }
1509
1576
  function _acceptObservable(observer) { return observer.onNext(this.value); }
1510
- function toString () { return 'OnNext(' + this.value + ')'; }
1577
+ function toString() { return 'OnNext(' + this.value + ')'; }
1511
1578
 
1512
1579
  return function (value) {
1513
- var notification = new Notification('N', true);
1514
- notification.value = value;
1515
- notification._accept = _accept;
1516
- notification._acceptObservable = _acceptObservable;
1517
- notification.toString = toString;
1518
- return notification;
1580
+ return new Notification('N', value, null, _accept, _acceptObservable, toString);
1519
1581
  };
1520
1582
  }());
1521
1583
 
@@ -1525,18 +1587,12 @@
1525
1587
  * @returns {Notification} The OnError notification containing the exception.
1526
1588
  */
1527
1589
  var notificationCreateOnError = Notification.createOnError = (function () {
1528
-
1529
1590
  function _accept (onNext, onError) { return onError(this.exception); }
1530
1591
  function _acceptObservable(observer) { return observer.onError(this.exception); }
1531
1592
  function toString () { return 'OnError(' + this.exception + ')'; }
1532
1593
 
1533
1594
  return function (e) {
1534
- var notification = new Notification('E');
1535
- notification.exception = e;
1536
- notification._accept = _accept;
1537
- notification._acceptObservable = _acceptObservable;
1538
- notification.toString = toString;
1539
- return notification;
1595
+ return new Notification('E', null, e, _accept, _acceptObservable, toString);
1540
1596
  };
1541
1597
  }());
1542
1598
 
@@ -1545,17 +1601,12 @@
1545
1601
  * @returns {Notification} The OnCompleted notification.
1546
1602
  */
1547
1603
  var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
1548
-
1549
1604
  function _accept (onNext, onError, onCompleted) { return onCompleted(); }
1550
1605
  function _acceptObservable(observer) { return observer.onCompleted(); }
1551
1606
  function toString () { return 'OnCompleted()'; }
1552
1607
 
1553
1608
  return function () {
1554
- var notification = new Notification('C');
1555
- notification._accept = _accept;
1556
- notification._acceptObservable = _acceptObservable;
1557
- notification.toString = toString;
1558
- return notification;
1609
+ return new Notification('C', null, null, _accept, _acceptObservable, toString);
1559
1610
  };
1560
1611
  }());
1561
1612
 
@@ -1830,10 +1881,6 @@
1830
1881
  __super__.call(this);
1831
1882
  }
1832
1883
 
1833
- function notImplemented() {
1834
- throw new Error('Method not implemented');
1835
- }
1836
-
1837
1884
  // Must be implemented by other observers
1838
1885
  AbstractObserver.prototype.next = notImplemented;
1839
1886
  AbstractObserver.prototype.error = notImplemented;
@@ -1933,58 +1980,46 @@
1933
1980
  return AnonymousObserver;
1934
1981
  }(AbstractObserver));
1935
1982
 
1936
- var CheckedObserver = (function (_super) {
1937
- inherits(CheckedObserver, _super);
1983
+ var CheckedObserver = (function (__super__) {
1984
+ inherits(CheckedObserver, __super__);
1938
1985
 
1939
- function CheckedObserver(observer) {
1940
- _super.call(this);
1941
- this._observer = observer;
1942
- this._state = 0; // 0 - idle, 1 - busy, 2 - done
1943
- }
1986
+ function CheckedObserver(observer) {
1987
+ __super__.call(this);
1988
+ this._observer = observer;
1989
+ this._state = 0; // 0 - idle, 1 - busy, 2 - done
1990
+ }
1944
1991
 
1945
- var CheckedObserverPrototype = CheckedObserver.prototype;
1992
+ var CheckedObserverPrototype = CheckedObserver.prototype;
1946
1993
 
1947
- CheckedObserverPrototype.onNext = function (value) {
1948
- this.checkAccess();
1949
- try {
1950
- this._observer.onNext(value);
1951
- } catch (e) {
1952
- throw e;
1953
- } finally {
1954
- this._state = 0;
1955
- }
1956
- };
1994
+ CheckedObserverPrototype.onNext = function (value) {
1995
+ this.checkAccess();
1996
+ var res = tryCatch(this._observer.onNext).call(this._observer, value);
1997
+ this._state = 0;
1998
+ res === errorObj && thrower(res.e);
1999
+ };
1957
2000
 
1958
- CheckedObserverPrototype.onError = function (err) {
1959
- this.checkAccess();
1960
- try {
1961
- this._observer.onError(err);
1962
- } catch (e) {
1963
- throw e;
1964
- } finally {
1965
- this._state = 2;
1966
- }
1967
- };
2001
+ CheckedObserverPrototype.onError = function (err) {
2002
+ this.checkAccess();
2003
+ var res = tryCatch(this._observer.onError).call(this._observer, err);
2004
+ this._state = 2;
2005
+ res === errorObj && thrower(res.e);
2006
+ };
1968
2007
 
1969
- CheckedObserverPrototype.onCompleted = function () {
1970
- this.checkAccess();
1971
- try {
1972
- this._observer.onCompleted();
1973
- } catch (e) {
1974
- throw e;
1975
- } finally {
1976
- this._state = 2;
1977
- }
1978
- };
2008
+ CheckedObserverPrototype.onCompleted = function () {
2009
+ this.checkAccess();
2010
+ var res = tryCatch(this._observer.onCompleted).call(this._observer);
2011
+ this._state = 2;
2012
+ res === errorObj && thrower(res.e);
2013
+ };
1979
2014
 
1980
- CheckedObserverPrototype.checkAccess = function () {
1981
- if (this._state === 1) { throw new Error('Re-entrancy detected'); }
1982
- if (this._state === 2) { throw new Error('Observer completed'); }
1983
- if (this._state === 0) { this._state = 1; }
1984
- };
2015
+ CheckedObserverPrototype.checkAccess = function () {
2016
+ if (this._state === 1) { throw new Error('Re-entrancy detected'); }
2017
+ if (this._state === 2) { throw new Error('Observer completed'); }
2018
+ if (this._state === 0) { this._state = 1; }
2019
+ };
1985
2020
 
1986
- return CheckedObserver;
1987
- }(Observer));
2021
+ return CheckedObserver;
2022
+ }(Observer));
1988
2023
 
1989
2024
  var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
1990
2025
  inherits(ScheduledObserver, __super__);
@@ -2161,25 +2196,21 @@
2161
2196
  })();
2162
2197
 
2163
2198
  var ObservableBase = Rx.ObservableBase = (function (__super__) {
2199
+ inherits(ObservableBase, __super__);
2164
2200
 
2165
- inherits(ObservableBase, __super__);
2166
-
2167
- // Fix subscriber to check for undefined or function returned to decorate as Disposable
2168
- function fixSubscriber(subscriber) {
2169
- if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; }
2170
-
2171
- return typeof subscriber === 'function' ?
2172
- disposableCreate(subscriber) :
2173
- disposableEmpty;
2201
+ function fixSubscriber(subscriber) {
2202
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
2203
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
2174
2204
  }
2175
2205
 
2176
2206
  function setDisposable(s, state) {
2177
2207
  var ado = state[0], self = state[1];
2178
- try {
2179
- ado.setDisposable(fixSubscriber(self.subscribeCore(ado)));
2180
- } catch (e) {
2181
- if (!ado.fail(e)) { throw e; }
2208
+ var sub = tryCatch(self.subscribeCore).call(self, ado);
2209
+
2210
+ if (sub === errorObj) {
2211
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
2182
2212
  }
2213
+ ado.setDisposable(fixSubscriber(sub));
2183
2214
  }
2184
2215
 
2185
2216
  function subscribe(observer) {
@@ -2190,7 +2221,6 @@
2190
2221
  } else {
2191
2222
  setDisposable(null, state);
2192
2223
  }
2193
-
2194
2224
  return ado;
2195
2225
  }
2196
2226
 
@@ -2198,12 +2228,9 @@
2198
2228
  __super__.call(this, subscribe);
2199
2229
  }
2200
2230
 
2201
- ObservableBase.prototype.subscribeCore = function(observer) {
2202
- throw new Error('Not implemeneted');
2203
- }
2231
+ ObservableBase.prototype.subscribeCore = notImplemented;
2204
2232
 
2205
2233
  return ObservableBase;
2206
-
2207
2234
  }(Observable));
2208
2235
 
2209
2236
  /**
@@ -2277,7 +2304,7 @@
2277
2304
  */
2278
2305
  observableProto.toPromise = function (promiseCtor) {
2279
2306
  promiseCtor || (promiseCtor = Rx.config.Promise);
2280
- if (!promiseCtor) { throw new TypeError('Promise type not provided nor in Rx.config.Promise'); }
2307
+ if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
2281
2308
  var source = this;
2282
2309
  return new promiseCtor(function (resolve, reject) {
2283
2310
  // No cancellation can be done
@@ -2377,6 +2404,34 @@
2377
2404
  });
2378
2405
  };
2379
2406
 
2407
+ var EmptyObservable = (function(__super__) {
2408
+ inherits(EmptyObservable, __super__);
2409
+ function EmptyObservable(scheduler) {
2410
+ this.scheduler = scheduler;
2411
+ __super__.call(this);
2412
+ }
2413
+
2414
+ EmptyObservable.prototype.subscribeCore = function (observer) {
2415
+ var sink = new EmptySink(observer, this);
2416
+ return sink.run();
2417
+ };
2418
+
2419
+ function EmptySink(observer, parent) {
2420
+ this.observer = observer;
2421
+ this.parent = parent;
2422
+ }
2423
+
2424
+ function scheduleItem(s, state) {
2425
+ state.onCompleted();
2426
+ }
2427
+
2428
+ EmptySink.prototype.run = function () {
2429
+ return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
2430
+ };
2431
+
2432
+ return EmptyObservable;
2433
+ }(ObservableBase));
2434
+
2380
2435
  /**
2381
2436
  * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
2382
2437
  *
@@ -2388,11 +2443,7 @@
2388
2443
  */
2389
2444
  var observableEmpty = Observable.empty = function (scheduler) {
2390
2445
  isScheduler(scheduler) || (scheduler = immediateScheduler);
2391
- return new AnonymousObservable(function (observer) {
2392
- return scheduler.schedule(function () {
2393
- observer.onCompleted();
2394
- });
2395
- });
2446
+ return new EmptyObservable(scheduler);
2396
2447
  };
2397
2448
 
2398
2449
  var FromObservable = (function(__super__) {
@@ -2564,7 +2615,7 @@
2564
2615
  inherits(FromArrayObservable, __super__);
2565
2616
  function FromArrayObservable(args, scheduler) {
2566
2617
  this.args = args;
2567
- this.scheduler = scheduler || currentThreadScheduler;
2618
+ this.scheduler = scheduler;
2568
2619
  __super__.call(this);
2569
2620
  }
2570
2621
 
@@ -2602,6 +2653,7 @@
2602
2653
  * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
2603
2654
  */
2604
2655
  var observableFromArray = Observable.fromArray = function (array, scheduler) {
2656
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
2605
2657
  return new FromArrayObservable(array, scheduler)
2606
2658
  };
2607
2659
 
@@ -2620,9 +2672,9 @@
2620
2672
  */
2621
2673
  Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
2622
2674
  isScheduler(scheduler) || (scheduler = currentThreadScheduler);
2623
- return new AnonymousObservable(function (observer) {
2624
- var first = true, state = initialState;
2625
- return scheduler.scheduleRecursive(function (self) {
2675
+ return new AnonymousObservable(function (o) {
2676
+ var first = true;
2677
+ return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
2626
2678
  var hasResult, result;
2627
2679
  try {
2628
2680
  if (first) {
@@ -2631,34 +2683,43 @@
2631
2683
  state = iterate(state);
2632
2684
  }
2633
2685
  hasResult = condition(state);
2634
- if (hasResult) {
2635
- result = resultSelector(state);
2636
- }
2637
- } catch (exception) {
2638
- observer.onError(exception);
2639
- return;
2686
+ hasResult && (result = resultSelector(state));
2687
+ } catch (e) {
2688
+ return o.onError(e);
2640
2689
  }
2641
2690
  if (hasResult) {
2642
- observer.onNext(result);
2643
- self();
2691
+ o.onNext(result);
2692
+ self(state);
2644
2693
  } else {
2645
- observer.onCompleted();
2694
+ o.onCompleted();
2646
2695
  }
2647
2696
  });
2648
2697
  });
2649
2698
  };
2650
2699
 
2700
+ var NeverObservable = (function(__super__) {
2701
+ inherits(NeverObservable, __super__);
2702
+ function NeverObservable() {
2703
+ __super__.call(this);
2704
+ }
2705
+
2706
+ NeverObservable.prototype.subscribeCore = function (observer) {
2707
+ return disposableEmpty;
2708
+ };
2709
+
2710
+ return NeverObservable;
2711
+ }(ObservableBase));
2712
+
2651
2713
  /**
2652
- * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
2714
+ * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
2653
2715
  * @returns {Observable} An observable sequence whose observers will never get called.
2654
2716
  */
2655
2717
  var observableNever = Observable.never = function () {
2656
- return new AnonymousObservable(function () {
2657
- return disposableEmpty;
2658
- });
2718
+ return new NeverObservable();
2659
2719
  };
2660
2720
 
2661
2721
  function observableOf (scheduler, array) {
2722
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
2662
2723
  return new FromArrayObservable(array, scheduler);
2663
2724
  }
2664
2725
 
@@ -2669,7 +2730,7 @@
2669
2730
  Observable.of = function () {
2670
2731
  var len = arguments.length, args = new Array(len);
2671
2732
  for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
2672
- return new FromArrayObservable(args);
2733
+ return new FromArrayObservable(args, currentThreadScheduler);
2673
2734
  };
2674
2735
 
2675
2736
  /**
@@ -2683,6 +2744,43 @@
2683
2744
  return new FromArrayObservable(args, scheduler);
2684
2745
  };
2685
2746
 
2747
+ var PairsObservable = (function(__super__) {
2748
+ inherits(PairsObservable, __super__);
2749
+ function PairsObservable(obj, scheduler) {
2750
+ this.obj = obj;
2751
+ this.keys = Object.keys(obj);
2752
+ this.scheduler = scheduler;
2753
+ __super__.call(this);
2754
+ }
2755
+
2756
+ PairsObservable.prototype.subscribeCore = function (observer) {
2757
+ var sink = new PairsSink(observer, this);
2758
+ return sink.run();
2759
+ };
2760
+
2761
+ return PairsObservable;
2762
+ }(ObservableBase));
2763
+
2764
+ function PairsSink(observer, parent) {
2765
+ this.observer = observer;
2766
+ this.parent = parent;
2767
+ }
2768
+
2769
+ PairsSink.prototype.run = function () {
2770
+ var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
2771
+ function loopRecursive(i, recurse) {
2772
+ if (i < len) {
2773
+ var key = keys[i];
2774
+ observer.onNext([key, obj[key]]);
2775
+ recurse(i + 1);
2776
+ } else {
2777
+ observer.onCompleted();
2778
+ }
2779
+ }
2780
+
2781
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
2782
+ };
2783
+
2686
2784
  /**
2687
2785
  * Convert an object into an observable sequence of [key, value] pairs.
2688
2786
  * @param {Object} obj The object to inspect.
@@ -2690,19 +2788,8 @@
2690
2788
  * @returns {Observable} An observable sequence of [key, value] pairs from the object.
2691
2789
  */
2692
2790
  Observable.pairs = function (obj, scheduler) {
2693
- scheduler || (scheduler = Rx.Scheduler.currentThread);
2694
- return new AnonymousObservable(function (observer) {
2695
- var keys = Object.keys(obj), len = keys.length;
2696
- return scheduler.scheduleRecursiveWithState(0, function (idx, self) {
2697
- if (idx < len) {
2698
- var key = keys[idx];
2699
- observer.onNext([key, obj[key]]);
2700
- self(idx + 1);
2701
- } else {
2702
- observer.onCompleted();
2703
- }
2704
- });
2705
- });
2791
+ scheduler || (scheduler = currentThreadScheduler);
2792
+ return new PairsObservable(obj, scheduler);
2706
2793
  };
2707
2794
 
2708
2795
  var RangeObservable = (function(__super__) {
@@ -2757,14 +2844,44 @@
2757
2844
  return new RangeObservable(start, count, scheduler);
2758
2845
  };
2759
2846
 
2847
+ var RepeatObservable = (function(__super__) {
2848
+ inherits(RepeatObservable, __super__);
2849
+ function RepeatObservable(value, repeatCount, scheduler) {
2850
+ this.value = value;
2851
+ this.repeatCount = repeatCount == null ? -1 : repeatCount;
2852
+ this.scheduler = scheduler;
2853
+ __super__.call(this);
2854
+ }
2855
+
2856
+ RepeatObservable.prototype.subscribeCore = function (observer) {
2857
+ var sink = new RepeatSink(observer, this);
2858
+ return sink.run();
2859
+ };
2860
+
2861
+ return RepeatObservable;
2862
+ }(ObservableBase));
2863
+
2864
+ function RepeatSink(observer, parent) {
2865
+ this.observer = observer;
2866
+ this.parent = parent;
2867
+ }
2868
+
2869
+ RepeatSink.prototype.run = function () {
2870
+ var observer = this.observer, value = this.parent.value;
2871
+ function loopRecursive(i, recurse) {
2872
+ if (i === -1 || i > 0) {
2873
+ observer.onNext(value);
2874
+ i > 0 && i--;
2875
+ }
2876
+ if (i === 0) { return observer.onCompleted(); }
2877
+ recurse(i);
2878
+ }
2879
+
2880
+ return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
2881
+ };
2882
+
2760
2883
  /**
2761
2884
  * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
2762
- *
2763
- * @example
2764
- * var res = Rx.Observable.repeat(42);
2765
- * var res = Rx.Observable.repeat(42, 4);
2766
- * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout);
2767
- * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout);
2768
2885
  * @param {Mixed} value Element to repeat.
2769
2886
  * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
2770
2887
  * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
@@ -2772,31 +2889,81 @@
2772
2889
  */
2773
2890
  Observable.repeat = function (value, repeatCount, scheduler) {
2774
2891
  isScheduler(scheduler) || (scheduler = currentThreadScheduler);
2775
- return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount);
2892
+ return new RepeatObservable(value, repeatCount, scheduler);
2776
2893
  };
2777
2894
 
2895
+ var JustObservable = (function(__super__) {
2896
+ inherits(JustObservable, __super__);
2897
+ function JustObservable(value, scheduler) {
2898
+ this.value = value;
2899
+ this.scheduler = scheduler;
2900
+ __super__.call(this);
2901
+ }
2902
+
2903
+ JustObservable.prototype.subscribeCore = function (observer) {
2904
+ var sink = new JustSink(observer, this);
2905
+ return sink.run();
2906
+ };
2907
+
2908
+ function JustSink(observer, parent) {
2909
+ this.observer = observer;
2910
+ this.parent = parent;
2911
+ }
2912
+
2913
+ function scheduleItem(s, state) {
2914
+ var value = state[0], observer = state[1];
2915
+ observer.onNext(value);
2916
+ observer.onCompleted();
2917
+ }
2918
+
2919
+ JustSink.prototype.run = function () {
2920
+ return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
2921
+ };
2922
+
2923
+ return JustObservable;
2924
+ }(ObservableBase));
2925
+
2778
2926
  /**
2779
2927
  * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
2780
- * There is an alias called 'just', and 'returnValue' for browsers <IE9.
2928
+ * There is an alias called 'just' or browsers <IE9.
2781
2929
  * @param {Mixed} value Single element in the resulting observable sequence.
2782
2930
  * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
2783
2931
  * @returns {Observable} An observable sequence containing the single specified element.
2784
2932
  */
2785
- var observableReturn = Observable['return'] = Observable.just = function (value, scheduler) {
2933
+ var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
2786
2934
  isScheduler(scheduler) || (scheduler = immediateScheduler);
2787
- return new AnonymousObservable(function (observer) {
2788
- return scheduler.schedule(function () {
2789
- observer.onNext(value);
2790
- observer.onCompleted();
2791
- });
2792
- });
2935
+ return new JustObservable(value, scheduler);
2793
2936
  };
2794
2937
 
2795
- /** @deprecated use return or just */
2796
- Observable.returnValue = function () {
2797
- //deprecate('returnValue', 'return or just');
2798
- return observableReturn.apply(null, arguments);
2799
- };
2938
+ var ThrowObservable = (function(__super__) {
2939
+ inherits(ThrowObservable, __super__);
2940
+ function ThrowObservable(error, scheduler) {
2941
+ this.error = error;
2942
+ this.scheduler = scheduler;
2943
+ __super__.call(this);
2944
+ }
2945
+
2946
+ ThrowObservable.prototype.subscribeCore = function (observer) {
2947
+ var sink = new ThrowSink(observer, this);
2948
+ return sink.run();
2949
+ };
2950
+
2951
+ function ThrowSink(observer, parent) {
2952
+ this.observer = observer;
2953
+ this.parent = parent;
2954
+ }
2955
+
2956
+ function scheduleItem(s, state) {
2957
+ var error = state[0], observer = state[1];
2958
+ observer.onError(error);
2959
+ }
2960
+
2961
+ ThrowSink.prototype.run = function () {
2962
+ return this.parent.scheduler.scheduleWithState([this.parent.error, this.observer], scheduleItem);
2963
+ };
2964
+
2965
+ return ThrowObservable;
2966
+ }(ObservableBase));
2800
2967
 
2801
2968
  /**
2802
2969
  * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
@@ -2805,19 +2972,9 @@
2805
2972
  * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
2806
2973
  * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
2807
2974
  */
2808
- var observableThrow = Observable['throw'] = Observable.throwError = function (error, scheduler) {
2975
+ var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
2809
2976
  isScheduler(scheduler) || (scheduler = immediateScheduler);
2810
- return new AnonymousObservable(function (observer) {
2811
- return scheduler.schedule(function () {
2812
- observer.onError(error);
2813
- });
2814
- });
2815
- };
2816
-
2817
- /** @deprecated use #some instead */
2818
- Observable.throwException = function () {
2819
- //deprecate('throwException', 'throwError');
2820
- return Observable.throwError.apply(null, arguments);
2977
+ return new ThrowObservable(error, scheduler);
2821
2978
  };
2822
2979
 
2823
2980
  /**
@@ -3013,24 +3170,23 @@
3013
3170
  var len = arguments.length, args = new Array(len);
3014
3171
  for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
3015
3172
  var resultSelector = args.pop();
3016
- len--;
3017
3173
  Array.isArray(args[0]) && (args = args[0]);
3018
3174
 
3019
3175
  return new AnonymousObservable(function (o) {
3020
- var falseFactory = function () { return false; },
3021
- hasValue = arrayInitialize(len, falseFactory),
3176
+ var n = args.length,
3177
+ falseFactory = function () { return false; },
3178
+ hasValue = arrayInitialize(n, falseFactory),
3022
3179
  hasValueAll = false,
3023
- isDone = arrayInitialize(len, falseFactory),
3024
- values = new Array(len);
3180
+ isDone = arrayInitialize(n, falseFactory),
3181
+ values = new Array(n);
3025
3182
 
3026
3183
  function next(i) {
3027
3184
  hasValue[i] = true;
3028
3185
  if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
3029
3186
  try {
3030
3187
  var res = resultSelector.apply(null, values);
3031
- } catch (ex) {
3032
- o.onError(ex);
3033
- return;
3188
+ } catch (e) {
3189
+ return o.onError(e);
3034
3190
  }
3035
3191
  o.onNext(res);
3036
3192
  } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
@@ -3043,8 +3199,8 @@
3043
3199
  isDone.every(identity) && o.onCompleted();
3044
3200
  }
3045
3201
 
3046
- var subscriptions = new Array(len);
3047
- for (var idx = 0; idx < len; idx++) {
3202
+ var subscriptions = new Array(n);
3203
+ for (var idx = 0; idx < n; idx++) {
3048
3204
  (function (i) {
3049
3205
  var source = args[i], sad = new SingleAssignmentDisposable();
3050
3206
  isPromise(source) && (source = observableFromPromise(source));
@@ -3097,52 +3253,131 @@
3097
3253
  return this.merge(1);
3098
3254
  };
3099
3255
 
3100
- /**
3101
- * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
3102
- * Or merges two observable sequences into a single observable sequence.
3103
- *
3104
- * @example
3105
- * 1 - merged = sources.merge(1);
3106
- * 2 - merged = source.merge(otherSource);
3107
- * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
3108
- * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
3109
- */
3110
- observableProto.merge = function (maxConcurrentOrOther) {
3111
- if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); }
3112
- var sources = this;
3113
- return new AnonymousObservable(function (o) {
3114
- var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = [];
3256
+ var MergeObservable = (function (__super__) {
3257
+ inherits(MergeObservable, __super__);
3258
+
3259
+ function MergeObservable(source, maxConcurrent) {
3260
+ this.source = source;
3261
+ this.maxConcurrent = maxConcurrent;
3262
+ __super__.call(this);
3263
+ }
3264
+
3265
+ MergeObservable.prototype.subscribeCore = function(observer) {
3266
+ var g = new CompositeDisposable();
3267
+ g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
3268
+ return g;
3269
+ };
3270
+
3271
+ return MergeObservable;
3115
3272
 
3116
- function subscribe(xs) {
3117
- var subscription = new SingleAssignmentDisposable();
3118
- group.add(subscription);
3273
+ }(ObservableBase));
3274
+
3275
+ var MergeObserver = (function () {
3276
+ function MergeObserver(o, max, g) {
3277
+ this.o = o;
3278
+ this.max = max;
3279
+ this.g = g;
3280
+ this.done = false;
3281
+ this.q = [];
3282
+ this.activeCount = 0;
3283
+ this.isStopped = false;
3284
+ }
3285
+ MergeObserver.prototype.handleSubscribe = function (xs) {
3286
+ var sad = new SingleAssignmentDisposable();
3287
+ this.g.add(sad);
3288
+ isPromise(xs) && (xs = observableFromPromise(xs));
3289
+ sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
3290
+ };
3291
+ MergeObserver.prototype.onNext = function (innerSource) {
3292
+ if (this.isStopped) { return; }
3293
+ if(this.activeCount < this.max) {
3294
+ this.activeCount++;
3295
+ this.handleSubscribe(innerSource);
3296
+ } else {
3297
+ this.q.push(innerSource);
3298
+ }
3299
+ };
3300
+ MergeObserver.prototype.onError = function (e) {
3301
+ if (!this.isStopped) {
3302
+ this.isStopped = true;
3303
+ this.o.onError(e);
3304
+ }
3305
+ };
3306
+ MergeObserver.prototype.onCompleted = function () {
3307
+ if (!this.isStopped) {
3308
+ this.isStopped = true;
3309
+ this.done = true;
3310
+ this.activeCount === 0 && this.o.onCompleted();
3311
+ }
3312
+ };
3313
+ MergeObserver.prototype.dispose = function() { this.isStopped = true; };
3314
+ MergeObserver.prototype.fail = function (e) {
3315
+ if (!this.isStopped) {
3316
+ this.isStopped = true;
3317
+ this.o.onError(e);
3318
+ return true;
3319
+ }
3119
3320
 
3120
- // Check for promises support
3121
- isPromise(xs) && (xs = observableFromPromise(xs));
3321
+ return false;
3322
+ };
3122
3323
 
3123
- subscription.setDisposable(xs.subscribe(function (x) { o.onNext(x); }, function (e) { o.onError(e); }, function () {
3124
- group.remove(subscription);
3125
- if (q.length > 0) {
3126
- subscribe(q.shift());
3324
+ function InnerObserver(parent, sad) {
3325
+ this.parent = parent;
3326
+ this.sad = sad;
3327
+ this.isStopped = false;
3328
+ }
3329
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
3330
+ InnerObserver.prototype.onError = function (e) {
3331
+ if (!this.isStopped) {
3332
+ this.isStopped = true;
3333
+ this.parent.o.onError(e);
3334
+ }
3335
+ };
3336
+ InnerObserver.prototype.onCompleted = function () {
3337
+ if(!this.isStopped) {
3338
+ this.isStopped = true;
3339
+ var parent = this.parent;
3340
+ parent.g.remove(this.sad);
3341
+ if (parent.q.length > 0) {
3342
+ parent.handleSubscribe(parent.q.shift());
3127
3343
  } else {
3128
- activeCount--;
3129
- isStopped && activeCount === 0 && o.onCompleted();
3344
+ parent.activeCount--;
3345
+ parent.done && parent.activeCount === 0 && parent.o.onCompleted();
3130
3346
  }
3131
- }));
3132
- }
3133
- group.add(sources.subscribe(function (innerSource) {
3134
- if (activeCount < maxConcurrentOrOther) {
3135
- activeCount++;
3136
- subscribe(innerSource);
3137
- } else {
3138
- q.push(innerSource);
3139
3347
  }
3140
- }, function (e) { o.onError(e); }, function () {
3141
- isStopped = true;
3142
- activeCount === 0 && o.onCompleted();
3143
- }));
3144
- return group;
3145
- }, sources);
3348
+ };
3349
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
3350
+ InnerObserver.prototype.fail = function (e) {
3351
+ if (!this.isStopped) {
3352
+ this.isStopped = true;
3353
+ this.parent.o.onError(e);
3354
+ return true;
3355
+ }
3356
+
3357
+ return false;
3358
+ };
3359
+
3360
+ return MergeObserver;
3361
+ }());
3362
+
3363
+
3364
+
3365
+
3366
+
3367
+ /**
3368
+ * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
3369
+ * Or merges two observable sequences into a single observable sequence.
3370
+ *
3371
+ * @example
3372
+ * 1 - merged = sources.merge(1);
3373
+ * 2 - merged = source.merge(otherSource);
3374
+ * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
3375
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
3376
+ */
3377
+ observableProto.merge = function (maxConcurrentOrOther) {
3378
+ return typeof maxConcurrentOrOther !== 'number' ?
3379
+ observableMerge(this, maxConcurrentOrOther) :
3380
+ new MergeObservable(this, maxConcurrentOrOther);
3146
3381
  };
3147
3382
 
3148
3383
  /**
@@ -3168,35 +3403,188 @@
3168
3403
  return observableOf(scheduler, sources).mergeAll();
3169
3404
  };
3170
3405
 
3406
+ var CompositeError = Rx.CompositeError = function(errors) {
3407
+ this.name = "NotImplementedError";
3408
+ this.innerErrors = errors;
3409
+ this.message = 'This contains multiple errors. Check the innerErrors';
3410
+ Error.call(this);
3411
+ }
3412
+ CompositeError.prototype = Error.prototype;
3413
+
3171
3414
  /**
3172
- * Merges an observable sequence of observable sequences into an observable sequence.
3173
- * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
3174
- */
3175
- observableProto.mergeAll = observableProto.mergeObservable = function () {
3176
- var sources = this;
3415
+ * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
3416
+ * receive all successfully emitted items from all of the source Observables without being interrupted by
3417
+ * an error notification from one of them.
3418
+ *
3419
+ * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
3420
+ * error via the Observer's onError, mergeDelayError will refrain from propagating that
3421
+ * error notification until all of the merged Observables have finished emitting items.
3422
+ * @param {Array | Arguments} args Arguments or an array to merge.
3423
+ * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
3424
+ */
3425
+ Observable.mergeDelayError = function() {
3426
+ var args;
3427
+ if (Array.isArray(arguments[0])) {
3428
+ args = arguments[0];
3429
+ } else {
3430
+ var len = arguments.length;
3431
+ args = new Array(len);
3432
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
3433
+ }
3434
+ var source = observableOf(null, args);
3435
+
3177
3436
  return new AnonymousObservable(function (o) {
3178
3437
  var group = new CompositeDisposable(),
3438
+ m = new SingleAssignmentDisposable(),
3179
3439
  isStopped = false,
3180
- m = new SingleAssignmentDisposable();
3440
+ errors = [];
3181
3441
 
3182
- group.add(m);
3183
- m.setDisposable(sources.subscribe(function (innerSource) {
3184
- var innerSubscription = new SingleAssignmentDisposable();
3185
- group.add(innerSubscription);
3442
+ function setCompletion() {
3443
+ if (errors.length === 0) {
3444
+ o.onCompleted();
3445
+ } else if (errors.length === 1) {
3446
+ o.onError(errors[0]);
3447
+ } else {
3448
+ o.onError(new CompositeError(errors));
3449
+ }
3450
+ }
3186
3451
 
3187
- // Check for promises support
3188
- isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
3452
+ group.add(m);
3189
3453
 
3190
- innerSubscription.setDisposable(innerSource.subscribe(function (x) { o.onNext(x); }, function (e) { o.onError(e); }, function () {
3191
- group.remove(innerSubscription);
3192
- isStopped && group.length === 1 && o.onCompleted();
3454
+ m.setDisposable(source.subscribe(
3455
+ function (innerSource) {
3456
+ var innerSubscription = new SingleAssignmentDisposable();
3457
+ group.add(innerSubscription);
3458
+
3459
+ // Check for promises support
3460
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
3461
+
3462
+ innerSubscription.setDisposable(innerSource.subscribe(
3463
+ function (x) { o.onNext(x); },
3464
+ function (e) {
3465
+ errors.push(e);
3466
+ group.remove(innerSubscription);
3467
+ isStopped && group.length === 1 && setCompletion();
3468
+ },
3469
+ function () {
3470
+ group.remove(innerSubscription);
3471
+ isStopped && group.length === 1 && setCompletion();
3472
+ }));
3473
+ },
3474
+ function (e) {
3475
+ errors.push(e);
3476
+ isStopped = true;
3477
+ group.length === 1 && setCompletion();
3478
+ },
3479
+ function () {
3480
+ isStopped = true;
3481
+ group.length === 1 && setCompletion();
3193
3482
  }));
3194
- }, function (e) { o.onError(e); }, function () {
3195
- isStopped = true;
3196
- group.length === 1 && o.onCompleted();
3197
- }));
3198
3483
  return group;
3199
- }, sources);
3484
+ });
3485
+ };
3486
+
3487
+ var MergeAllObservable = (function (__super__) {
3488
+ inherits(MergeAllObservable, __super__);
3489
+
3490
+ function MergeAllObservable(source) {
3491
+ this.source = source;
3492
+ __super__.call(this);
3493
+ }
3494
+
3495
+ MergeAllObservable.prototype.subscribeCore = function (observer) {
3496
+ var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
3497
+ g.add(m);
3498
+ m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
3499
+ return g;
3500
+ };
3501
+
3502
+ return MergeAllObservable;
3503
+ }(ObservableBase));
3504
+
3505
+ var MergeAllObserver = (function() {
3506
+
3507
+ function MergeAllObserver(o, g) {
3508
+ this.o = o;
3509
+ this.g = g;
3510
+ this.isStopped = false;
3511
+ this.done = false;
3512
+ }
3513
+ MergeAllObserver.prototype.onNext = function(innerSource) {
3514
+ if(this.isStopped) { return; }
3515
+ var sad = new SingleAssignmentDisposable();
3516
+ this.g.add(sad);
3517
+
3518
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
3519
+
3520
+ sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
3521
+ };
3522
+ MergeAllObserver.prototype.onError = function (e) {
3523
+ if(!this.isStopped) {
3524
+ this.isStopped = true;
3525
+ this.o.onError(e);
3526
+ }
3527
+ };
3528
+ MergeAllObserver.prototype.onCompleted = function () {
3529
+ if(!this.isStopped) {
3530
+ this.isStopped = true;
3531
+ this.done = true;
3532
+ this.g.length === 1 && this.o.onCompleted();
3533
+ }
3534
+ };
3535
+ MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
3536
+ MergeAllObserver.prototype.fail = function (e) {
3537
+ if (!this.isStopped) {
3538
+ this.isStopped = true;
3539
+ this.o.onError(e);
3540
+ return true;
3541
+ }
3542
+
3543
+ return false;
3544
+ };
3545
+
3546
+ function InnerObserver(parent, g, sad) {
3547
+ this.parent = parent;
3548
+ this.g = g;
3549
+ this.sad = sad;
3550
+ this.isStopped = false;
3551
+ }
3552
+ InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
3553
+ InnerObserver.prototype.onError = function (e) {
3554
+ if(!this.isStopped) {
3555
+ this.isStopped = true;
3556
+ this.parent.o.onError(e);
3557
+ }
3558
+ };
3559
+ InnerObserver.prototype.onCompleted = function () {
3560
+ if(!this.isStopped) {
3561
+ var parent = this.parent;
3562
+ this.isStopped = true;
3563
+ parent.g.remove(this.sad);
3564
+ parent.done && parent.g.length === 1 && parent.o.onCompleted();
3565
+ }
3566
+ };
3567
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
3568
+ InnerObserver.prototype.fail = function (e) {
3569
+ if (!this.isStopped) {
3570
+ this.isStopped = true;
3571
+ this.parent.o.onError(e);
3572
+ return true;
3573
+ }
3574
+
3575
+ return false;
3576
+ };
3577
+
3578
+ return MergeAllObserver;
3579
+
3580
+ }());
3581
+
3582
+ /**
3583
+ * Merges an observable sequence of observable sequences into an observable sequence.
3584
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
3585
+ */
3586
+ observableProto.mergeAll = observableProto.mergeObservable = function () {
3587
+ return new MergeAllObservable(this);
3200
3588
  };
3201
3589
 
3202
3590
  /**
@@ -3336,7 +3724,8 @@
3336
3724
  * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
3337
3725
  */
3338
3726
  observableProto.withLatestFrom = function () {
3339
- for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
3727
+ var len = arguments.length, args = new Array(len)
3728
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
3340
3729
  var resultSelector = args.pop(), source = this;
3341
3730
 
3342
3731
  if (typeof source === 'undefined') {
@@ -3637,10 +4026,12 @@
3637
4026
  * @returns {Observable} The source sequence with the side-effecting behavior applied.
3638
4027
  */
3639
4028
  observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
3640
- var source = this, tapObserver = typeof observerOrOnNext === 'function' || typeof observerOrOnNext === 'undefined'?
3641
- observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
3642
- observerOrOnNext;
4029
+ var source = this;
3643
4030
  return new AnonymousObservable(function (observer) {
4031
+ var tapObserver = !observerOrOnNext || isFunction(observerOrOnNext) ?
4032
+ observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
4033
+ observerOrOnNext;
4034
+
3644
4035
  return source.subscribe(function (x) {
3645
4036
  try {
3646
4037
  tapObserver.onNext(x);
@@ -3856,6 +4247,7 @@
3856
4247
  * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
3857
4248
  */
3858
4249
  observableProto.skipLast = function (count) {
4250
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
3859
4251
  var source = this;
3860
4252
  return new AnonymousObservable(function (o) {
3861
4253
  var q = [];
@@ -3895,6 +4287,7 @@
3895
4287
  * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
3896
4288
  */
3897
4289
  observableProto.takeLast = function (count) {
4290
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
3898
4291
  var source = this;
3899
4292
  return new AnonymousObservable(function (o) {
3900
4293
  var q = [];
@@ -3944,12 +4337,12 @@
3944
4337
  var source = this;
3945
4338
  +count || (count = 0);
3946
4339
  Math.abs(count) === Infinity && (count = 0);
3947
- if (count <= 0) { throw new Error(argumentOutOfRange); }
4340
+ if (count <= 0) { throw new ArgumentOutOfRangeError(); }
3948
4341
  skip == null && (skip = count);
3949
4342
  +skip || (skip = 0);
3950
4343
  Math.abs(skip) === Infinity && (skip = 0);
3951
4344
 
3952
- if (skip <= 0) { throw new Error(argumentOutOfRange); }
4345
+ if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
3953
4346
  return new AnonymousObservable(function (observer) {
3954
4347
  var m = new SingleAssignmentDisposable(),
3955
4348
  refCountDisposable = new RefCountDisposable(m),
@@ -4174,7 +4567,7 @@
4174
4567
 
4175
4568
  MapObservable.prototype.internalMap = function (selector, thisArg) {
4176
4569
  var self = this;
4177
- return new MapObservable(this.source, function (x, i, o) { return selector(self.selector(x, i, o), i, o); }, thisArg)
4570
+ return new MapObservable(this.source, function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }, thisArg)
4178
4571
  };
4179
4572
 
4180
4573
  MapObservable.prototype.subscribeCore = function (observer) {
@@ -4195,10 +4588,9 @@
4195
4588
 
4196
4589
  MapObserver.prototype.onNext = function(x) {
4197
4590
  if (this.isStopped) { return; }
4198
- try {
4199
- var result = this.selector(x, this.i++, this.source);
4200
- } catch (e) {
4201
- return this.observer.onError(e);
4591
+ var result = tryCatch(this.selector).call(this, x, this.i++, this.source);
4592
+ if (result === errorObj) {
4593
+ return this.observer.onError(result.e);
4202
4594
  }
4203
4595
  this.observer.onNext(result);
4204
4596
  };
@@ -4371,7 +4763,7 @@
4371
4763
  * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
4372
4764
  */
4373
4765
  observableProto.skip = function (count) {
4374
- if (count < 0) { throw new Error(argumentOutOfRange); }
4766
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
4375
4767
  var source = this;
4376
4768
  return new AnonymousObservable(function (o) {
4377
4769
  var remaining = count;
@@ -4424,7 +4816,7 @@
4424
4816
  * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
4425
4817
  */
4426
4818
  observableProto.take = function (count, scheduler) {
4427
- if (count < 0) { throw new RangeError(argumentOutOfRange); }
4819
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
4428
4820
  if (count === 0) { return observableEmpty(scheduler); }
4429
4821
  var source = this;
4430
4822
  return new AnonymousObservable(function (o) {
@@ -4483,7 +4875,7 @@
4483
4875
 
4484
4876
  FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
4485
4877
  var self = this;
4486
- return new FilterObservable(this.source, function(x, i, o) { return self.predicate(x, i, o) && predicate(x, i, o); }, thisArg);
4878
+ return new FilterObservable(this.source, function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }, thisArg);
4487
4879
  };
4488
4880
 
4489
4881
  return FilterObservable;
@@ -4500,10 +4892,9 @@
4500
4892
 
4501
4893
  FilterObserver.prototype.onNext = function(x) {
4502
4894
  if (this.isStopped) { return; }
4503
- try {
4504
- var shouldYield = this.predicate(x, this.i++, this.source);
4505
- } catch (e) {
4506
- return this.observer.onError(e);
4895
+ var shouldYield = tryCatch(this.predicate).call(this, x, this.i++, this.source);
4896
+ if (shouldYield === errorObj) {
4897
+ return this.observer.onError(shouldYield.e);
4507
4898
  }
4508
4899
  shouldYield && this.observer.onNext(x);
4509
4900
  };
@@ -4542,32 +4933,32 @@
4542
4933
  observableProto.transduce = function(transducer) {
4543
4934
  var source = this;
4544
4935
 
4545
- function transformForObserver(observer) {
4936
+ function transformForObserver(o) {
4546
4937
  return {
4547
- init: function() {
4548
- return observer;
4938
+ '@@transducer/init': function() {
4939
+ return o;
4549
4940
  },
4550
- step: function(obs, input) {
4941
+ '@@transducer/step': function(obs, input) {
4551
4942
  return obs.onNext(input);
4552
4943
  },
4553
- result: function(obs) {
4944
+ '@@transducer/result': function(obs) {
4554
4945
  return obs.onCompleted();
4555
4946
  }
4556
4947
  };
4557
4948
  }
4558
4949
 
4559
- return new AnonymousObservable(function(observer) {
4560
- var xform = transducer(transformForObserver(observer));
4950
+ return new AnonymousObservable(function(o) {
4951
+ var xform = transducer(transformForObserver(o));
4561
4952
  return source.subscribe(
4562
4953
  function(v) {
4563
4954
  try {
4564
- xform.step(observer, v);
4955
+ xform['@@transducer/step'](o, v);
4565
4956
  } catch (e) {
4566
- observer.onError(e);
4957
+ o.onError(e);
4567
4958
  }
4568
4959
  },
4569
- observer.onError.bind(observer),
4570
- function() { xform.result(observer); }
4960
+ function (e) { o.onError(e); },
4961
+ function() { xform['@@transducer/result'](o); }
4571
4962
  );
4572
4963
  }, source);
4573
4964
  };
@@ -4577,27 +4968,24 @@
4577
4968
 
4578
4969
  // Fix subscriber to check for undefined or function returned to decorate as Disposable
4579
4970
  function fixSubscriber(subscriber) {
4580
- if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; }
4581
-
4582
- return typeof subscriber === 'function' ?
4583
- disposableCreate(subscriber) :
4584
- disposableEmpty;
4971
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
4972
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
4585
4973
  }
4586
4974
 
4587
4975
  function setDisposable(s, state) {
4588
4976
  var ado = state[0], subscribe = state[1];
4589
- try {
4590
- ado.setDisposable(fixSubscriber(subscribe(ado)));
4591
- } catch (e) {
4592
- if (!ado.fail(e)) { throw e; }
4977
+ var sub = tryCatch(subscribe)(ado);
4978
+
4979
+ if (sub === errorObj) {
4980
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
4593
4981
  }
4982
+ ado.setDisposable(fixSubscriber(sub));
4594
4983
  }
4595
4984
 
4596
4985
  function AnonymousObservable(subscribe, parent) {
4597
4986
  this.source = parent;
4598
4987
 
4599
4988
  function s(observer) {
4600
-
4601
4989
  var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
4602
4990
 
4603
4991
  if (currentThreadScheduler.scheduleRequired()) {
@@ -4605,7 +4993,6 @@
4605
4993
  } else {
4606
4994
  setDisposable(null, state);
4607
4995
  }
4608
-
4609
4996
  return ado;
4610
4997
  }
4611
4998
 
@@ -4628,35 +5015,23 @@
4628
5015
  var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
4629
5016
 
4630
5017
  AutoDetachObserverPrototype.next = function (value) {
4631
- var noError = false;
4632
- try {
4633
- this.observer.onNext(value);
4634
- noError = true;
4635
- } catch (e) {
4636
- return thrower(e);
4637
- } finally {
4638
- !noError && this.dispose();
5018
+ var result = tryCatch(this.observer.onNext).call(this.observer, value);
5019
+ if (result === errorObj) {
5020
+ this.dispose();
5021
+ thrower(result.e);
4639
5022
  }
4640
5023
  };
4641
5024
 
4642
5025
  AutoDetachObserverPrototype.error = function (err) {
4643
- try {
4644
- this.observer.onError(err);
4645
- } catch (e) {
4646
- return thrower(e);
4647
- } finally {
4648
- this.dispose();
4649
- }
5026
+ var result = tryCatch(this.observer.onError).call(this.observer, err);
5027
+ this.dispose();
5028
+ result === errorObj && thrower(result.e);
4650
5029
  };
4651
5030
 
4652
5031
  AutoDetachObserverPrototype.completed = function () {
4653
- try {
4654
- this.observer.onCompleted();
4655
- } catch (e) {
4656
- return thrower(e);
4657
- } finally {
4658
- this.dispose();
4659
- }
5032
+ var result = tryCatch(this.observer.onCompleted).call(this.observer);
5033
+ this.dispose();
5034
+ result === errorObj && thrower(result.e);
4660
5035
  };
4661
5036
 
4662
5037
  AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };