Socket
Socket
Sign inDemoInstall

rx

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx - npm Package Compare versions

Comparing version 2.2.4 to 2.2.5

dependencies.json

6

bower.json
{
"name": "rxjs",
"version": "2.2.4",
"version": "2.2.5",
"main": [
"rx.js",
"rx.compat.js",
"rx.aggregates.js",
"rx.async.js",
"rx.async.compat.js",
"rx.binding.js",
"rx.coincidence.js",
"rx.experimental.js",
"rx.lite.js",
"rx.lite.compat.js",
"rx.joinpatterns.js",

@@ -12,0 +16,0 @@ "rx.testing.js",

@@ -55,7 +55,73 @@ module.exports = function (grunt) {

'src/core/observable.js',
'src/core/linq/observable.concurrency.js',
'src/core/linq/observable.creation.js',
'src/core/linq/observable.multiple.js',
'src/core/linq/observable.single.js',
'src/core/linq/observable.standardsequenceoperators.js',
'src/core/linq/observable/observeon.js', // ObserveOnObserver
'src/core/linq/observable/subscribeon.js', // SingleAssignmentDisposable, SerialDisposable, ScheduleDisposable
'src/core/linq/observable/create.js',
'src/core/linq/observable/defer.js',
'src/core/linq/observable/empty.js',
'src/core/linq/observable/fromarray.js',
'src/core/linq/observable/generate.js',
'src/core/linq/observable/never.js',
'src/core/linq/observable/range.js',
'src/core/linq/observable/repeat.js',
'src/core/linq/observable/return.js',
'src/core/linq/observable/throw.js',
'src/core/linq/observable/using.js',
// Multiple
'src/core/linq/observable/ambproto.js',
'src/core/linq/observable/amb.js',
'src/core/linq/observable/catchproto.js',
'src/core/linq/observable/catch.js',
'src/core/linq/observable/combinelatestproto.js',
'src/core/linq/observable/combinelatest.js',
'src/core/linq/observable/concatproto.js',
'src/core/linq/observable/concat.js',
'src/core/linq/observable/concatobservable.js',
'src/core/linq/observable/mergeproto.js',
'src/core/linq/observable/merge.js',
'src/core/linq/observable/mergeobservable.js',
'src/core/linq/observable/onerrorresumenextproto.js',
'src/core/linq/observable/onerrorresumenext.js',
'src/core/linq/observable/skipuntil.js',
'src/core/linq/observable/switch.js',
'src/core/linq/observable/takeuntil.js',
'src/core/linq/observable/zipproto.js',
'src/core/linq/observable/zip.js',
'src/core/linq/observable/ziparray.js',
// Single
'src/core/linq/observable/asobservable.js',
'src/core/linq/observable/bufferwithcount.js',
'src/core/linq/observable/dematerialize.js',
'src/core/linq/observable/distinctuntilchanged.js',
'src/core/linq/observable/do.js',
'src/core/linq/observable/finally.js',
'src/core/linq/observable/ignoreelements.js',
'src/core/linq/observable/materialize.js',
'src/core/linq/observable/repeatproto.js',
'src/core/linq/observable/retry.js',
'src/core/linq/observable/scan.js',
'src/core/linq/observable/skiplast.js',
'src/core/linq/observable/startwith.js',
'src/core/linq/observable/takelast.js',
'src/core/linq/observable/takelastbuffer.js',
'src/core/linq/observable/windowwithcount.js',
// Standard query operators
'src/core/linq/observable/defaultifempty.js',
'src/core/linq/observable/distinct.js',
'src/core/linq/observable/groupby.js',
'src/core/linq/observable/groupbyuntil.js',
'src/core/linq/observable/select.js',
'src/core/linq/observable/pluck.js',
'src/core/linq/observable/selectmany.js',
'src/core/linq/observable/selectswitch.js',
'src/core/linq/observable/skip.js',
'src/core/linq/observable/skipwhile.js',
'src/core/linq/observable/take.js',
'src/core/linq/observable/takewhile.js',
'src/core/linq/observable/where.js',
'src/core/anonymousobservable.js',

@@ -104,7 +170,75 @@ 'src/core/autodetachobserver.js',

'src/core/observable.js',
'src/core/linq/observable.concurrency.js',
'src/core/linq/observable.creation.js',
'src/core/linq/observable.multiple.js',
'src/core/linq/observable.single.js',
'src/core/linq/observable.standardsequenceoperators.js',
// Concurrency
'src/core/linq/observable/observeon.js', // ObserveOnObserver
'src/core/linq/observable/subscribeon.js', // SingleAssignmentDisposable, SerialDisposable, ScheduleDisposable
// Creation
'src/core/linq/observable/create.js',
'src/core/linq/observable/defer.js',
'src/core/linq/observable/empty.js',
'src/core/linq/observable/fromarray.js',
'src/core/linq/observable/generate.js',
'src/core/linq/observable/never.js',
'src/core/linq/observable/range.js',
'src/core/linq/observable/repeat.js',
'src/core/linq/observable/return.js',
'src/core/linq/observable/throw.js',
'src/core/linq/observable/using.js',
// Multiple
'src/core/linq/observable/ambproto.js',
'src/core/linq/observable/amb.js',
'src/core/linq/observable/catchproto.js',
'src/core/linq/observable/catch.js',
'src/core/linq/observable/combinelatestproto.js',
'src/core/linq/observable/combinelatest.js',
'src/core/linq/observable/concatproto.js',
'src/core/linq/observable/concat.js',
'src/core/linq/observable/concatobservable.js',
'src/core/linq/observable/mergeproto.js',
'src/core/linq/observable/merge.js',
'src/core/linq/observable/mergeobservable.js',
'src/core/linq/observable/onerrorresumenextproto.js',
'src/core/linq/observable/onerrorresumenext.js',
'src/core/linq/observable/skipuntil.js',
'src/core/linq/observable/switch.js',
'src/core/linq/observable/takeuntil.js',
'src/core/linq/observable/zipproto.js',
'src/core/linq/observable/zip.js',
'src/core/linq/observable/ziparray.js',
// Single
'src/core/linq/observable/asobservable.js',
'src/core/linq/observable/bufferwithcount.js',
'src/core/linq/observable/dematerialize.js',
'src/core/linq/observable/distinctuntilchanged.js',
'src/core/linq/observable/do.js',
'src/core/linq/observable/finally.js',
'src/core/linq/observable/ignoreelements.js',
'src/core/linq/observable/materialize.js',
'src/core/linq/observable/repeatproto.js',
'src/core/linq/observable/retry.js',
'src/core/linq/observable/scan.js',
'src/core/linq/observable/skiplast.js',
'src/core/linq/observable/startwith.js',
'src/core/linq/observable/takelast.js',
'src/core/linq/observable/takelastbuffer.js',
'src/core/linq/observable/windowwithcount.js',
// Standard query operators
'src/core/linq/observable/defaultifempty.js',
'src/core/linq/observable/distinct.js',
'src/core/linq/observable/groupby.js',
'src/core/linq/observable/groupbyuntil.js',
'src/core/linq/observable/select.js',
'src/core/linq/observable/pluck.js',
'src/core/linq/observable/selectmany.js',
'src/core/linq/observable/selectswitch.js',
'src/core/linq/observable/skip.js',
'src/core/linq/observable/skipwhile.js',
'src/core/linq/observable/take.js',
'src/core/linq/observable/takewhile.js',
'src/core/linq/observable/where.js',
'src/core/anonymousobservable.js',

@@ -121,3 +255,286 @@ 'src/core/autodetachobserver.js',

dest: 'rx.js'
},
},
lite: {
src: [
'src/core/license.js',
'src/core/intro.js',
'src/core/liteheader.js',
'src/core/internal/deepEquals.js',
'src/core/internal/util.js',
'src/core/internal/priorityqueue.js',
'src/core/disposables/compositedisposable.js',
'src/core/disposables/disposable.js',
'src/core/disposables/booleandisposable.js',
'src/core/disposables/refcountdisposable.js',
'src/core/concurrency/scheduleditem.js',
'src/core/concurrency/scheduler-lite.js',
'src/core/concurrency/currentthreadscheduler-lite.js',
'src/core/concurrency/scheduleperiodicrecursive.js',
'src/core/concurrency/timeoutscheduler.js',
'src/core/notification.js',
'src/core/internal/enumerator.js',
'src/core/internal/enumerable.js',
'src/core/observer-lite.js',
'src/core/abstractobserver.js',
'src/core/anonymousobserver.js',
'src/core/observable.js',
'src/core/scheduledobserver.js',
// Creation
'src/core/linq/observable/create.js',
'src/core/linq/observable/defer.js',
'src/core/linq/observable/empty.js',
'src/core/linq/observable/fromarray.js',
'src/core/linq/observable/generate.js',
'src/core/linq/observable/never.js',
'src/core/linq/observable/range.js',
'src/core/linq/observable/repeat.js',
'src/core/linq/observable/return.js',
'src/core/linq/observable/throw.js',
// Multiple
'src/core/linq/observable/catchproto.js',
'src/core/linq/observable/catch.js',
'src/core/linq/observable/combinelatestproto.js',
'src/core/linq/observable/combinelatest.js',
'src/core/linq/observable/concatproto.js',
'src/core/linq/observable/concat.js',
'src/core/linq/observable/concatobservable.js',
'src/core/linq/observable/mergeproto.js',
'src/core/linq/observable/merge.js',
'src/core/linq/observable/mergeobservable.js',
'src/core/linq/observable/skipuntil.js',
'src/core/linq/observable/switch.js',
'src/core/linq/observable/takeuntil.js',
'src/core/linq/observable/zipproto.js',
'src/core/linq/observable/zip.js',
'src/core/linq/observable/ziparray.js',
// Single
'src/core/linq/observable/asobservable.js',
'src/core/linq/observable/dematerialize.js',
'src/core/linq/observable/distinctuntilchanged.js',
'src/core/linq/observable/do.js',
'src/core/linq/observable/finally.js',
'src/core/linq/observable/ignoreelements.js',
'src/core/linq/observable/materialize.js',
'src/core/linq/observable/repeatproto.js',
'src/core/linq/observable/retry.js',
'src/core/linq/observable/scan.js',
'src/core/linq/observable/skiplast.js',
'src/core/linq/observable/startwith.js',
'src/core/linq/observable/takelast.js',
'src/core/linq/observable/takelastbuffer.js',
// Standard Query Operators
'src/core/linq/observable/select.js',
'src/core/linq/observable/selectmany.js',
'src/core/linq/observable/selectswitch.js',
'src/core/linq/observable/skip.js',
'src/core/linq/observable/skipwhile.js',
'src/core/linq/observable/take.js',
'src/core/linq/observable/takewhile.js',
'src/core/linq/observable/where.js',
// Async Operators
'src/core/linq/observable/fromcallback.js', // AsyncSubject, asObservable
'src/core/linq/observable/fromnodecallback.js', // AsyncSubject, asObservable
'src/core/linq/observable/fromevent-modern.js', // publish
'src/core/linq/observable/fromeventpattern.js', // publish
'src/core/linq/observable/frompromise.js', // AsyncSubject, asObservable
// Binding Operators
'src/core/linq/observable/multicast.js', // ConnectableObservable
'src/core/linq/observable/publish.js', // mulitcast, Subject
'src/core/linq/observable/publishlast.js', // multicast, AsyncSubject
'src/core/linq/observable/publishvalue.js', // multicast, BehaviorSubject
'src/core/linq/observable/replay.js', // multicast, ReplaySubject
'src/core/linq/connectableobservable.js',
// Time operators
'src/core/linq/observable/_observabletimerdate.js', // AnonymousObservable
'src/core/linq/observable/_observabletimerdateandperiod.js', // AnonymousObservable, normalizeTime
'src/core/linq/observable/_observabletimertimespan.js', // AnonymousObservable, normalizeTime
'src/core/linq/observable/_observabletimertimespanandperiod.js', // AnonymousObservable, defer, _observabletimerdateandperiod
'src/core/linq/observable/interval.js', // timeoutScheduler, _observabletimertimespanandperiod
'src/core/linq/observable/timer.js', // timeoutScheduler, _observabletimerdate, _observabletimerdateandperiod, _observabletimertimespan, _observabletimertimespanandperiod
'src/core/linq/observable/delay.js', // AnonymousObservable, timeoutScheduler, SerialDisposable, materialize, timestamp
'src/core/linq/observable/throttle.js', // AnonymousObservable, SerialDisposable, timeoutScheduler, SingleAssignmentDisposable, CompositeDisposable
'src/core/linq/observable/timeinterval.js', // timeoutScheduler, defer, select
'src/core/linq/observable/timestamp.js', // timeoutScheduler, select
'src/core/linq/observable/sample.js', // AnonymousObservable, CompositeDisposable, interval, timeoutScheduler
'src/core/linq/observable/timeout.js', // AnonymousObservable, timeoutScheduler, throw, SingleAssignmentDisposable, SerialDisposable, CompositeDisposable
'src/core/linq/observable/generatewithabsolutetime.js', // timeoutScheduler, AnonymousObservable
'src/core/linq/observable/generatewithrelativetime.js', // timeoutScheduler, AnonymousObservable
'src/core/linq/observable/delaysubscription.js', // delayWithSelector, timer, empty
'src/core/linq/observable/delaywithselector.js',
'src/core/linq/observable/timeoutwithselector.js',
'src/core/linq/observable/throttlewithselector.js',
'src/core/linq/observable/skiplastwithtime.js',
'src/core/linq/observable/takelastwithtime.js',
'src/core/linq/observable/takelastbufferwithtime.js',
'src/core/linq/observable/takewithtime.js',
'src/core/linq/observable/skipwithtime.js',
'src/core/linq/observable/skipuntilwithtime.js',
'src/core/linq/observable/takeuntilwithtime.js',
'src/core/anonymousobservable.js',
'src/core/autodetachobserver.js',
'src/core/subjects/innersubscription.js',
'src/core/subjects/subject.js',
'src/core/subjects/asyncsubject.js',
'src/core/subjects/anonymoussubject.js',
'src/core/subjects/behaviorsubject.js',
'src/core/subjects/replaysubject.js',
'src/core/exports.js',
'src/core/outro.js'
],
dest: 'rx.lite.js'
},
litecompat: {
src: [
'src/core/license.js',
'src/core/intro.js',
'src/core/liteheader.js',
'src/core/internal/deepEquals.js',
'src/core/internal/util.js',
'src/core/internal/polyfills.js',
'src/core/internal/priorityqueue.js',
'src/core/disposables/compositedisposable.js',
'src/core/disposables/disposable.js',
'src/core/disposables/booleandisposable.js',
'src/core/disposables/refcountdisposable.js',
'src/core/concurrency/scheduleditem.js',
'src/core/concurrency/scheduler-lite.js',
'src/core/concurrency/currentthreadscheduler-lite.js',
'src/core/concurrency/scheduleperiodicrecursive.js',
'src/core/concurrency/timeoutscheduler.js',
'src/core/notification.js',
'src/core/internal/enumerator.js',
'src/core/internal/enumerable.js',
'src/core/observer-lite.js',
'src/core/abstractobserver.js',
'src/core/anonymousobserver.js',
'src/core/observable.js',
'src/core/scheduledobserver.js',
// Creation
'src/core/linq/observable/create.js',
'src/core/linq/observable/defer.js',
'src/core/linq/observable/empty.js',
'src/core/linq/observable/fromarray.js',
'src/core/linq/observable/generate.js',
'src/core/linq/observable/never.js',
'src/core/linq/observable/range.js',
'src/core/linq/observable/repeat.js',
'src/core/linq/observable/return.js',
'src/core/linq/observable/throw.js',
// Multiple
'src/core/linq/observable/catchproto.js',
'src/core/linq/observable/catch.js',
'src/core/linq/observable/combinelatestproto.js',
'src/core/linq/observable/combinelatest.js',
'src/core/linq/observable/concatproto.js',
'src/core/linq/observable/concat.js',
'src/core/linq/observable/concatobservable.js',
'src/core/linq/observable/mergeproto.js',
'src/core/linq/observable/merge.js',
'src/core/linq/observable/mergeobservable.js',
'src/core/linq/observable/skipuntil.js',
'src/core/linq/observable/switch.js',
'src/core/linq/observable/takeuntil.js',
'src/core/linq/observable/zipproto.js',
'src/core/linq/observable/zip.js',
'src/core/linq/observable/ziparray.js',
// Single
'src/core/linq/observable/asobservable.js',
'src/core/linq/observable/dematerialize.js',
'src/core/linq/observable/distinctuntilchanged.js',
'src/core/linq/observable/do.js',
'src/core/linq/observable/finally.js',
'src/core/linq/observable/ignoreelements.js',
'src/core/linq/observable/materialize.js',
'src/core/linq/observable/repeatproto.js',
'src/core/linq/observable/retry.js',
'src/core/linq/observable/scan.js',
'src/core/linq/observable/skiplast.js',
'src/core/linq/observable/startwith.js',
'src/core/linq/observable/takelast.js',
'src/core/linq/observable/takelastbuffer.js',
// Standard Query Operators
'src/core/linq/observable/select.js',
'src/core/linq/observable/selectmany.js',
'src/core/linq/observable/selectswitch.js',
'src/core/linq/observable/skip.js',
'src/core/linq/observable/skipwhile.js',
'src/core/linq/observable/take.js',
'src/core/linq/observable/takewhile.js',
'src/core/linq/observable/where.js',
// Async Operators
'src/core/linq/observable/fromcallback.js', // AsyncSubject, asObservable
'src/core/linq/observable/fromnodecallback.js', // AsyncSubject, asObservable
'src/core/linq/observable/fromevent.js', // publish
'src/core/linq/observable/fromeventpattern.js', // publish
'src/core/linq/observable/frompromise.js', // AsyncSubject, asObservable
// Binding Operators
'src/core/linq/observable/multicast.js', // ConnectableObservable
'src/core/linq/observable/publish.js', // mulitcast, Subject
'src/core/linq/observable/publishlast.js', // multicast, AsyncSubject
'src/core/linq/observable/publishvalue.js', // multicast, BehaviorSubject
'src/core/linq/observable/replay.js', // multicast, ReplaySubject
'src/core/linq/connectableobservable.js',
// Time operators
'src/core/linq/observable/_observabletimerdate.js', // AnonymousObservable
'src/core/linq/observable/_observabletimerdateandperiod.js', // AnonymousObservable, normalizeTime
'src/core/linq/observable/_observabletimertimespan.js', // AnonymousObservable, normalizeTime
'src/core/linq/observable/_observabletimertimespanandperiod.js', // AnonymousObservable, defer, _observabletimerdateandperiod
'src/core/linq/observable/interval.js', // timeoutScheduler, _observabletimertimespanandperiod
'src/core/linq/observable/timer.js', // timeoutScheduler, _observabletimerdate, _observabletimerdateandperiod, _observabletimertimespan, _observabletimertimespanandperiod
'src/core/linq/observable/delay.js', // AnonymousObservable, timeoutScheduler, SerialDisposable, materialize, timestamp
'src/core/linq/observable/throttle.js', // AnonymousObservable, SerialDisposable, timeoutScheduler, SingleAssignmentDisposable, CompositeDisposable
'src/core/linq/observable/timeinterval.js', // timeoutScheduler, defer, select
'src/core/linq/observable/timestamp.js', // timeoutScheduler, select
'src/core/linq/observable/sample.js', // AnonymousObservable, CompositeDisposable, interval, timeoutScheduler
'src/core/linq/observable/timeout.js', // AnonymousObservable, timeoutScheduler, throw, SingleAssignmentDisposable, SerialDisposable, CompositeDisposable
'src/core/linq/observable/generatewithabsolutetime.js', // timeoutScheduler, AnonymousObservable
'src/core/linq/observable/generatewithrelativetime.js', // timeoutScheduler, AnonymousObservable
'src/core/linq/observable/delaysubscription.js', // delayWithSelector, timer, empty
'src/core/linq/observable/delaywithselector.js',
'src/core/linq/observable/timeoutwithselector.js',
'src/core/linq/observable/throttlewithselector.js',
'src/core/linq/observable/skiplastwithtime.js',
'src/core/linq/observable/takelastwithtime.js',
'src/core/linq/observable/takelastbufferwithtime.js',
'src/core/linq/observable/takewithtime.js',
'src/core/linq/observable/skipwithtime.js',
'src/core/linq/observable/skipuntilwithtime.js',
'src/core/linq/observable/takeuntilwithtime.js',
'src/core/anonymousobservable.js',
'src/core/autodetachobserver.js',
'src/core/subjects/innersubscription.js',
'src/core/subjects/subject.js',
'src/core/subjects/asyncsubject.js',
'src/core/subjects/anonymoussubject.js',
'src/core/subjects/behaviorsubject.js',
'src/core/subjects/replaysubject.js',
'src/core/exports.js',
'src/core/outro.js'
],
dest: 'rx.lite.compat.js'
},
aggregates: {

@@ -219,3 +636,6 @@ src: [

'src/core/internal/dictionary.js',
'src/core/linq/observable.coincidence.js',
'src/core/linq/observable/join.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary
'src/core/linq/observable/groupjoin.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary
'src/core/linq/observable/buffer.js', // window, selectMany, toArray
'src/core/linq/observable/window.js', // CompositeDisposable, RefCountDisposable, Subject, SingleAssignmentDisposable
'src/core/suboutro.js'

@@ -230,3 +650,13 @@ ],

'src/core/experimentalheader.js',
'src/core/linq/observable.experimental.js',
'src/core/linq/enumerable/while.js', // Enumerable
'src/core/linq/observable/let.js',
'src/core/linq/observable/if.js', // defer, empty
'src/core/linq/observable/for.js', // Enumerable.forEach, concatproto
'src/core/linq/observable/while.js', // Enumerable.while, concatproto
'src/core/linq/observable/dowhile.js', // Enumerable.while, concat
'src/core/linq/observable/case.js', // defer, empty
'src/core/linq/observable/expand.js', // immediateScheduler, SerialDisposable, CompositeDisposable, SingleAssignmentDisposable
'src/core/linq/observable/forkjoin.js', // CompositeDisposable
'src/core/linq/observable/forkjoinproto.js', // SingleAssignmentDisposable, CompositeDisposable
'src/core/linq/observable/manyselect.js', // ImmediateScheduler, CurrentThreadScheduler, select, do, observeOn
'src/core/suboutro.js'

@@ -246,3 +676,5 @@ ],

'src/core/joins/joinobserver.js',
'src/core/linq/observable.joins.js',
'src/core/linq/observable/and.js', // Pattern
'src/core/linq/observable/then.js', // Pattern
'src/core/linq/observable/when.js', // CompositeDisposable
'src/core/suboutro.js'

@@ -274,3 +706,31 @@ ],

'src/core/timeheader.js',
'src/core/linq/observable.time.js',
'src/core/linq/observable/_observabletimerdate.js', // AnonymousObservable
'src/core/linq/observable/_observabletimerdateandperiod.js', // AnonymousObservable, normalizeTime
'src/core/linq/observable/_observabletimertimespan.js', // AnonymousObservable, normalizeTime
'src/core/linq/observable/_observabletimertimespanandperiod.js', // AnonymousObservable, defer, _observabletimerdateandperiod
'src/core/linq/observable/interval.js', // timeoutScheduler, _observabletimertimespanandperiod
'src/core/linq/observable/timer.js', // timeoutScheduler, _observabletimerdate, _observabletimerdateandperiod, _observabletimertimespan, _observabletimertimespanandperiod
'src/core/linq/observable/delay.js', // AnonymousObservable, timeoutScheduler, SerialDisposable, materialize, timestamp
'src/core/linq/observable/throttle.js', // AnonymousObservable, SerialDisposable, timeoutScheduler, SingleAssignmentDisposable, CompositeDisposable
'src/core/linq/observable/windowwithtime.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject
'src/core/linq/observable/windowwithtimeorcount.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject
'src/core/linq/observable/bufferwithtime.js', // windowwithtime, selectMany, toArray
'src/core/linq/observable/bufferwithtimeourcount.js', // windowwithtimeorcount, selectMany, toArray
'src/core/linq/observable/timeinterval.js', // timeoutScheduler, defer, select
'src/core/linq/observable/timestamp.js', // timeoutScheduler, select
'src/core/linq/observable/sample.js', // AnonymousObservable, CompositeDisposable, interval, timeoutScheduler
'src/core/linq/observable/timeout.js', // AnonymousObservable, timeoutScheduler, throw, SingleAssignmentDisposable, SerialDisposable, CompositeDisposable
'src/core/linq/observable/generatewithabsolutetime.js', // timeoutScheduler, AnonymousObservable
'src/core/linq/observable/generatewithrelativetime.js', // timeoutScheduler, AnonymousObservable
'src/core/linq/observable/delaysubscription.js', // delayWithSelector, timer, empty
'src/core/linq/observable/delaywithselector.js',
'src/core/linq/observable/timeoutwithselector.js',
'src/core/linq/observable/throttlewithselector.js',
'src/core/linq/observable/skiplastwithtime.js',
'src/core/linq/observable/takelastwithtime.js',
'src/core/linq/observable/takelastbufferwithtime.js',
'src/core/linq/observable/takewithtime.js',
'src/core/linq/observable/skipwithtime.js',
'src/core/linq/observable/skipuntilwithtime.js',
'src/core/linq/observable/takeuntilwithtime.js',
'src/core/suboutro.js'

@@ -300,3 +760,11 @@ ],

dest: 'rx.min.js'
},
},
lite: {
src: ['<banner>', 'rx.lite.js'],
dest: 'rx.lite.min.js'
},
litecompat: {
src: ['<banner>', 'rx.lite.compat.js'],
dest: 'rx.lite.compat.min.js'
},
aggregates: {

@@ -370,2 +838,5 @@ src: ['<banner>', 'rx.aggregates.js'],

}
},
'sauce-labs': {
}

@@ -379,2 +850,3 @@ });

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-saucelabs');

@@ -439,2 +911,6 @@ function createNuGetPackage(nuspec) {

grunt.registerTask('nuget-lite', 'Register NuGet-Lite', function () {
createNuGetPackage.call(this, 'nuget/RxJS-Lite/RxJS-Lite.nuspec');
});
grunt.registerTask('nuget-main', 'Register NuGet-Main', function () {

@@ -464,2 +940,3 @@ createNuGetPackage.call(this, 'nuget/RxJS-Main/RxJS-Main.nuspec');

'nuget-joinpatterns',
'nuget-lite',
'nuget-main',

@@ -506,2 +983,4 @@ 'nuget-testing',

'concat:virtualtime',
'concat:lite',
'concat:litecompat',

@@ -520,2 +999,4 @@ 'uglify:basic',

'uglify:virtualtime',
'uglify:lite',
'uglify:litecompat',

@@ -522,0 +1003,0 @@ 'qunit'

7

package.json

@@ -5,4 +5,4 @@ {

"description": "Library for composing asynchronous and event-based operations in JavaScript",
"version": "2.2.4",
"homepage": "http://rx.codeplex.com",
"version": "2.2.5",
"homepage": "https://github.com/Reactive-Extensions/RxJS",
"author": {

@@ -33,3 +33,4 @@ "name": "Cloud Programmability Team",

"grunt-contrib-qunit": "*",
"grunt-contrib-watch": "*"
"grunt-contrib-watch": "*",
"grunt-saucelabs": "*"
},

@@ -36,0 +37,0 @@ "keywords": [

[![Build Status](https://travis-ci.org/Reactive-Extensions/RxJS.png)](https://travis-ci.org/Reactive-Extensions/RxJS)
# The Reactive Extensions for JavaScript (RxJS) <sup>2.2</sup>... #
*...is a set of libraries to compose asynchronous and event-based programs using observable collections and LINQ-style query operators in JavaScript*
*...is a set of libraries to compose asynchronous and event-based programs using observable collections and Array#extras style composition in JavaScript*

@@ -16,3 +16,4 @@ The project is actively developed by Microsoft Open Technologies, Inc., in collaboration with a community of open source developers.

The Reactive Extensions for JavaScript (RxJS) is a set of libraries for composing asynchronous and event-based programs using observable sequences and fluent query operators modeled after Language Integrated Queries ([LINQ](http://en.wikipedia.org/wiki/LINQ)). Using RxJS, developers represent asynchronous data streams with Observables, query asynchronous data streams using LINQ operators, and parameterize the concurrency in the asynchronous data streams using Schedulers. Simply put, RxJS = Observables + LINQ + Schedulers.
The Reactive Extensions for JavaScript (RxJS) is a set of libraries for composing asynchronous and event-based programs using observable sequences and fluent query operators modeled after Language Integrated Queries ([LINQ](http://en.wikipedia.org/wiki/LINQ)). Using RxJS, developers represent asynchronous data streams with Observables, query asynchronous data streams using our many operators, and parameterize the concurrency in the asynchronous data streams using Schedulers. Simply put, RxJS = Observables + Operators + Schedulers.
Whether you are authoring a web-based application in JavaScript or a server-side application in Node.js, you have to deal with asynchronous and event-based programming as a matter of course. Although some patterns are emerging such as the Promise pattern, handling exceptions, cancellation, and synchronization is difficult and error-prone.

@@ -22,4 +23,51 @@

Because observable sequences are data streams, you can query them using standard LINQ query operators implemented by the Observable type. Thus you can filter, project, aggregate, compose and perform time-based operations on multiple events easily by using these static LINQ operators. In addition, there are a number of other reactive stream specific operators that allow powerful queries to be written. Cancellation, exceptions, and synchronization are also handled gracefully by using the methods on the Observable object.
Because observable sequences are data streams, you can query them using standard query operators implemented by the Observable type. Thus you can filter, project, aggregate, compose and perform time-based operations on multiple events easily by using these our many operators. In addition, there are a number of other reactive stream specific operators that allow powerful queries to be written. Cancellation, exceptions, and synchronization are also handled gracefully by using the methods on the Observable object.
But the best news of all is that you already know how to program like this. Take for example the following JavaScript code, where we get some stock data and then manipulate and then iterate the results.
```js
/* Get stock data somehow */
var source = getStockData();
source
.filter(function (quote) {
return quote.symbol === 'MSFT';
})
.map(function (quote) {
return quote.price;
})
.forEach(function (price) {
console.log('MSFT Stock Prices: $' + price);
});
```
Now what if this data were to come as some sort of event, for example a stream, such as as a WebSocket, then we could pretty much write the same query to iterate our data, with very litle change.
```js
/* Get stock data somehow */
var source = getAsyncStockData();
var subscription = source
.filter(function (quote) {
return quote.symbol === 'MSFT';
})
.map(function (quote) {
return quote.price;
})
.subscribe(
function (price) {
console.log('MSFT Stock Prices: $' + price);
},
function (err) {
console.log('Something went wrong: ' + err.message);
});
/* When we're done */
subscription.dispose();
```
The only difference is that we can handle the errors inline with our subscription. And when we're no longer interested in receiving the data as it comes steraming in, we call `dispose` on our subscription.
## Batteries Included ##
This set of libraries include:

@@ -36,5 +84,7 @@

- **rx.joinpatterns.js** - join patterns event processing query operations
- **rx.testing.js** - used to write unit tests for complex event processing queries.
- **rx.time.js** - time-based event processing query operations.
- **rx.virtualtime.js** - virtual-time-based schedulers.
- **rx.lite.js** - lite version with event bindings, creation, time and standard query operators
- **rx.lite.compat.js** - lite version with event bindings, creation, time and standard query operators with compatibility back to IE6
- **rx.testing.js** - used to write unit tests for complex event processing queries
- **rx.time.js** - time-based event processing query operations
- **rx.virtualtime.js** - virtual-time-based schedulers

@@ -50,6 +100,3 @@ ## Why RxJS? ##

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="rx.js"></script>
<script src="rx.async.js"></script>
<script src="rx.binding.js"></script>
<script src="rx.time.js"></script>
<script src="rx.lite.js"></script>

@@ -76,3 +123,3 @@ Next, we'll get the user input from an input, listening to the keyup event by using the `Rx.Observable.fromEvent` method.

/* Now get only distinct values, so we eliminate the arrows and other control characters */
var distinct = keyups
var distinct = throttled
.distinctUntilChanged();

@@ -102,5 +149,3 @@ ```

var suggestions = distinct
.flatMapLatest(function (text) {
return searchWikipedia(text);
});
.flatMapLatest(searchWikipedia);
```

@@ -146,2 +191,3 @@

- [.NET Rocks #907](http://dotnetrocks.com/default.aspx?showNum=907)
- [JavaScript Jabber #83](http://javascriptjabber.com/083-jsj-frp-and-rxjs-with-matthew-podwysocki/)

@@ -152,3 +198,3 @@ - Articles

- Tutorials
- [Learn RxJS](http://jhusain.github.io/learnrx/)
- [Learn RxJS](http://reactive-extensions.github.io/learnrx/)
- [RxJS Koans](https://github.com/mattpodwysocki/RxJSKoans)

@@ -268,3 +314,3 @@ - [Rx Workshop](http://rxworkshop.codeplex.com/)

There are lots of ways to [contribute](https://github.com/Reactive-Extensions/RxJS/wiki/Contributing) to the project, and we appreciate our [contributors](https://github.com/Reactive-Extensions/RxJS/wiki/Contributors).
There are lots of ways to [contribute](https://github.com/Reactive-Extensions/RxJS/wiki/Contributions) to the project, and we appreciate our [contributors](https://github.com/Reactive-Extensions/RxJS/wiki/Contributors).

@@ -271,0 +317,0 @@ You can contribute by reviewing and sending feedback on code checkins, suggesting and trying out new features as they are implemented, submit bugs and help us verify fixes as they are checked in, as well as submit code fixes or code contributions of your own. Note that all code submissions will be rigorously reviewed and tested by the Rx Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source.

@@ -310,2 +310,5 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

}).finalValue().select(function (s) {
if (s.count === 0) {
throw new Error('The input sequence was empty');
}
return s.sum / s.count;

@@ -312,0 +315,0 @@ });

@@ -1,1 +0,1 @@

!function(a,b){var c="object"==typeof exports&&exports,d=("object"==typeof module&&module&&module.exports==c&&module,"object"==typeof global&&global);d.global===d&&(window=d),"function"==typeof define&&define.amd?define(["rx","exports"],function(c,d){return a.Rx=b(a,d,c),a.Rx}):"object"==typeof module&&module&&module.exports===c?module.exports=b(a,module.exports,require("./rx")):a.Rx=b(a,{},a.Rx)}(this,function(a,b,c,d){function e(a,b){return t(a,b)}function f(a){return a}function g(a,b){return a>b?1:b>a?-1:0}function h(a,b,c){return new s(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return d.onError(j),void 0}if(h=0,e)try{h=c(i,f)}catch(k){return d.onError(k),void 0}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},d.onError.bind(d),function(){d.onNext(g),d.onCompleted()})})}function i(a){if(0===a.length)throw new Error(v);return a[0]}function j(a,b,c){return new s(function(d){var e=0,f=b.length;return a.subscribe(function(a){var g=!1;try{f>e&&(g=c(a,b[e++]))}catch(h){return d.onError(h),void 0}g||(d.onNext(!1),d.onCompleted())},d.onError.bind(d),function(){d.onNext(e===f),d.onCompleted()})})}function k(a,b,c,d){if(0>b)throw new Error(u);return new s(function(e){var f=b;return a.subscribe(function(a){0===f&&(e.onNext(a),e.onCompleted()),f--},e.onError.bind(e),function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Error(u))})})}function l(a,b,c){return new s(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(v))})})}function m(a,b,c){return new s(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},d.onError.bind(d),function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Error(v))})})}function n(a,b,c){return new s(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(v))})})}function o(a,b,c,e){return new s(function(f){var g=0;return a.subscribe(function(d){var h;try{h=b.call(c,d,g,a)}catch(i){return f.onError(i),void 0}h?(f.onNext(e?g:d),f.onCompleted()):g++},f.onError.bind(f),function(){f.onNext(e?-1:d),f.onCompleted()})})}var p=c.Observable,q=p.prototype,r=c.CompositeDisposable,s=c.Internals.AnonymousObservable,t=c.Internals.isEqual,u="Argument out of range",v="Sequence contains no elements.";return q.aggregate=function(){var a,b,c;return 2===arguments.length?(a=arguments[0],b=!0,c=arguments[1]):c=arguments[0],b?this.scan(a,c).startWith(a).finalValue():this.scan(c).finalValue()},q.reduce=function(a){var b,c;return 2===arguments.length&&(c=!0,b=arguments[1]),c?this.scan(b,a).startWith(b).finalValue():this.scan(a).finalValue()},q.some=q.any=function(a,b){var c=this;return a?c.where(a,b).any():new s(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},a.onError.bind(a),function(){a.onNext(!1),a.onCompleted()})})},q.isEmpty=function(){return this.any().select(function(a){return!a})},q.every=q.all=function(a,b){return this.where(function(b){return!a(b)},b).any().select(function(a){return!a})},q.contains=function(a,b){return b||(b=e),this.where(function(c){return b(c,a)}).any()},q.count=function(a,b){return a?this.where(a,b).count():this.aggregate(0,function(a){return a+1})},q.sum=function(a,b){return a?this.select(a,b).sum():this.aggregate(0,function(a,b){return a+b})},q.minBy=function(a,b){return b||(b=g),h(this,a,function(a,c){return-1*b(a,c)})},q.min=function(a){return this.minBy(f,a).select(function(a){return i(a)})},q.maxBy=function(a,b){return b||(b=g),h(this,a,b)},q.max=function(a){return this.maxBy(f,a).select(function(a){return i(a)})},q.average=function(a,b){return a?this.select(a,b).average():this.scan({sum:0,count:0},function(a,b){return{sum:a.sum+b,count:a.count+1}}).finalValue().select(function(a){return a.sum/a.count})},q.sequenceEqual=function(a,b){var c=this;return b||(b=e),Array.isArray(a)?j(c,a,b):new s(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return d.onError(i),void 0}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},d.onError.bind(d),function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))}),j=a.subscribe(function(a){var c,f;if(g.length>0){f=g.shift();try{c=b(f,a)}catch(i){return d.onError(i),void 0}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},d.onError.bind(d),function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new r(i,j)})},q.elementAt=function(a){return k(this,a,!1)},q.elementAtOrDefault=function(a,b){return k(this,a,!0,b)},q.single=function(a,b){return a?this.where(a,b).single():l(this,!1)},q.singleOrDefault=function(a,b,c){return a?this.where(a,c).singleOrDefault(null,b):l(this,!0,b)},q.first=function(a,b){return a?this.where(a,b).first():m(this,!1)},q.firstOrDefault=function(a,b){return a?this.where(a).firstOrDefault(null,b):m(this,!0,b)},q.last=function(a,b){return a?this.where(a,b).last():n(this,!1)},q.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):n(this,!0,b)},q.find=function(a,b){return o(this,a,b,!1)},q.findIndex=function(a,b){return o(this,a,b,!0)},c});
!function(a,b){var c="object"==typeof exports&&exports,d=("object"==typeof module&&module&&module.exports==c&&module,"object"==typeof global&&global);d.global===d&&(window=d),"function"==typeof define&&define.amd?define(["rx","exports"],function(c,d){return a.Rx=b(a,d,c),a.Rx}):"object"==typeof module&&module&&module.exports===c?module.exports=b(a,module.exports,require("./rx")):a.Rx=b(a,{},a.Rx)}(this,function(a,b,c,d){function e(a,b){return t(a,b)}function f(a){return a}function g(a,b){return a>b?1:b>a?-1:0}function h(a,b,c){return new s(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return d.onError(j),void 0}if(h=0,e)try{h=c(i,f)}catch(k){return d.onError(k),void 0}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},d.onError.bind(d),function(){d.onNext(g),d.onCompleted()})})}function i(a){if(0===a.length)throw new Error(v);return a[0]}function j(a,b,c){return new s(function(d){var e=0,f=b.length;return a.subscribe(function(a){var g=!1;try{f>e&&(g=c(a,b[e++]))}catch(h){return d.onError(h),void 0}g||(d.onNext(!1),d.onCompleted())},d.onError.bind(d),function(){d.onNext(e===f),d.onCompleted()})})}function k(a,b,c,d){if(0>b)throw new Error(u);return new s(function(e){var f=b;return a.subscribe(function(a){0===f&&(e.onNext(a),e.onCompleted()),f--},e.onError.bind(e),function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Error(u))})})}function l(a,b,c){return new s(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(v))})})}function m(a,b,c){return new s(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},d.onError.bind(d),function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Error(v))})})}function n(a,b,c){return new s(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(v))})})}function o(a,b,c,e){return new s(function(f){var g=0;return a.subscribe(function(d){var h;try{h=b.call(c,d,g,a)}catch(i){return f.onError(i),void 0}h?(f.onNext(e?g:d),f.onCompleted()):g++},f.onError.bind(f),function(){f.onNext(e?-1:d),f.onCompleted()})})}var p=c.Observable,q=p.prototype,r=c.CompositeDisposable,s=c.Internals.AnonymousObservable,t=c.Internals.isEqual,u="Argument out of range",v="Sequence contains no elements.";return q.aggregate=function(){var a,b,c;return 2===arguments.length?(a=arguments[0],b=!0,c=arguments[1]):c=arguments[0],b?this.scan(a,c).startWith(a).finalValue():this.scan(c).finalValue()},q.reduce=function(a){var b,c;return 2===arguments.length&&(c=!0,b=arguments[1]),c?this.scan(b,a).startWith(b).finalValue():this.scan(a).finalValue()},q.some=q.any=function(a,b){var c=this;return a?c.where(a,b).any():new s(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},a.onError.bind(a),function(){a.onNext(!1),a.onCompleted()})})},q.isEmpty=function(){return this.any().select(function(a){return!a})},q.every=q.all=function(a,b){return this.where(function(b){return!a(b)},b).any().select(function(a){return!a})},q.contains=function(a,b){return b||(b=e),this.where(function(c){return b(c,a)}).any()},q.count=function(a,b){return a?this.where(a,b).count():this.aggregate(0,function(a){return a+1})},q.sum=function(a,b){return a?this.select(a,b).sum():this.aggregate(0,function(a,b){return a+b})},q.minBy=function(a,b){return b||(b=g),h(this,a,function(a,c){return-1*b(a,c)})},q.min=function(a){return this.minBy(f,a).select(function(a){return i(a)})},q.maxBy=function(a,b){return b||(b=g),h(this,a,b)},q.max=function(a){return this.maxBy(f,a).select(function(a){return i(a)})},q.average=function(a,b){return a?this.select(a,b).average():this.scan({sum:0,count:0},function(a,b){return{sum:a.sum+b,count:a.count+1}}).finalValue().select(function(a){if(0===a.count)throw new Error("The input sequence was empty");return a.sum/a.count})},q.sequenceEqual=function(a,b){var c=this;return b||(b=e),Array.isArray(a)?j(c,a,b):new s(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return d.onError(i),void 0}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},d.onError.bind(d),function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))}),j=a.subscribe(function(a){var c,f;if(g.length>0){f=g.shift();try{c=b(f,a)}catch(i){return d.onError(i),void 0}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},d.onError.bind(d),function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new r(i,j)})},q.elementAt=function(a){return k(this,a,!1)},q.elementAtOrDefault=function(a,b){return k(this,a,!0,b)},q.single=function(a,b){return a?this.where(a,b).single():l(this,!1)},q.singleOrDefault=function(a,b,c){return a?this.where(a,c).singleOrDefault(null,b):l(this,!0,b)},q.first=function(a,b){return a?this.where(a,b).first():m(this,!1)},q.firstOrDefault=function(a,b){return a?this.where(a).firstOrDefault(null,b):m(this,!0,b)},q.last=function(a,b){return a?this.where(a,b).last():n(this,!1)},q.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):n(this,!0,b)},q.find=function(a,b){return o(this,a,b,!1)},q.findIndex=function(a,b){return o(this,a,b,!0)},c});

@@ -564,3 +564,3 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

};
/**

@@ -576,3 +576,3 @@ * Projects each element of an observable sequence into zero or more buffers.

};
/**

@@ -579,0 +579,0 @@ * Projects each element of an observable sequence into zero or more windows.

@@ -1,2 +0,2 @@

!function(a,b){function c(){}function d(a){return a}function e(a,b){return P(a,b)}function f(a,b){return a-b}function g(a){return a.toString()}function h(a){throw a}function i(){if(this.isDisposed)throw new Error(A)}function j(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function k(a){return a&&"object"==typeof a?L.call(a)==C:!1}function l(a){return"function"==typeof a}function m(a,b,c,d){var e;if(a===b)return 0!==a||1/a==1/b;var f=typeof a,g=typeof b;if(!(a!==a||a&&B[f]||b&&B[g]))return!1;if(null==a||null==b)return a===b;var h=L.call(a),i=L.call(b);if(h==C&&(h=I),i==C&&(i=I),h!=i)return!1;switch(h){case E:case F:return+a==+b;case H:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case J:case K:return a==String(b)}var n=h==D;if(!n){if(h!=I||!v&&(j(a)||j(b)))return!1;var o=!N&&k(a)?Object:a.constructor,p=!N&&k(b)?Object:b.constructor;if(o!=p&&!(l(o)&&o instanceof o&&l(p)&&p instanceof p))return!1}for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(e=!0,c.push(a),d.push(b),n){for(q=a.length,r=b.length,e=r==a.length;r--;){var s=b[r];if(!(e=m(a[r],s,c,d)))break}return e}for(var t in b)if(M.call(b,t))return r++,e=M.call(a,t)&&m(a[t],b[t],c,d);if(e)for(var t in a)if(M.call(a,t))return e=--r>-1;return c.pop(),d.pop(),e}function n(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Q.call(a)}function o(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function p(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function q(a,b){return new Sb(function(c){var d=new cb,e=new eb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return c.onError(g),void 0}d=new cb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function r(a,b){var c=this;return new Sb(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),void 0}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function s(a){return this.select(a).mergeObservable()}var t="object"==typeof exports&&exports,u=("object"==typeof module&&module&&module.exports==t&&module,"object"==typeof global&&global);u.global===u&&(a=u);var v,w={Internals:{}},x=function(){return Date.now?Date.now:function(){return+new Date}}(),y="Sequence contains no elements.",z="Argument out of range",A="Object has been disposed",B={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},C="[object Arguments]",D="[object Array]",E="[object Boolean]",F="[object Date]",G="[object Function]",H="[object Number]",I="[object Object]",J="[object RegExp]",K="[object String]",L=Object.prototype.toString,M=Object.prototype.hasOwnProperty,N=L.call(arguments)==C;try{v=!(L.call(document)==I&&!({toString:0}+""))}catch(O){v=!0}N||(k=function(a){return a&&"object"==typeof a?M.call(a,"callee"):!1}),l(/x/)&&(l=function(a){return"function"==typeof a&&L.call(a)==G});var P=w.Internals.isEqual=function(a,b){return m(a,b,[],[])},Q=Array.prototype.slice;({}).hasOwnProperty;var R=this.inherits=w.Internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},S=w.Internals.addProperties=function(a){for(var b=Q.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},T=w.Internals.addRef=function(a,b){return new Sb(function(c){return new Z(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Q.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(Q.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Q.call(arguments)))};return d});var U=Object("a"),V="a"!=U[0]||!(0 in U);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=V&&"[object String]"=={}.toString.call(this)?this.split(""):b,d=c.length>>>0,e=arguments[1];if("[object Function]"!={}.toString.call(a))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=V&&"[object String]"=={}.toString.call(this)?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if("[object Function]"!={}.toString.call(a))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"[object Array]"==Object.prototype.toString.call(a)}),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});var W=function(a,b){this.id=a,this.value=b};W.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var X=w.Internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Y=X.prototype;Y.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Y.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)}}},Y.heapify=function(a){if(a===b&&(a=0),!(a>=this.length||0>a)){var c=2*a+1,d=2*a+2,e=a;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==a){var f=this.items[a];this.items[a]=this.items[e],this.items[e]=f,this.heapify(e)}}},Y.peek=function(){return this.items[0].value},Y.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Y.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Y.enqueue=function(a){var b=this.length++;this.items[b]=new W(X.count++,a),this.percolate(b)},Y.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},X.count=0;var Z=w.CompositeDisposable=function(){this.disposables=n(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},$=Z.prototype;$.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},$.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},$.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},$.clear=function(){var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()},$.contains=function(a){return-1!==this.disposables.indexOf(a)},$.toArray=function(){return this.disposables.slice(0)};var _=w.Disposable=function(a){this.isDisposed=!1,this.action=a||c};_.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ab=_.create=function(a){return new _(a)},bb=_.empty={dispose:c},cb=w.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null},db=cb.prototype;db.getDisposable=function(){return this.current},cb.disposable=function(a){return arguments.length?this.getDisposable():this.setDisposable(a)},db.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()},db.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()};var eb=w.SerialDisposable=function(){this.isDisposed=!1,this.current=null},fb=eb.prototype;fb.getDisposable=function(){return this.current},fb.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},fb.disposable=function(a){return a?(this.setDisposable(a),void 0):this.getDisposable()},fb.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()};var gb=w.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?bb:new a(this)},b}();p.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var hb=w.Internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||f,this.disposable=new cb};hb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},hb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},hb.prototype.isCancelled=function(){return this.disposable.isDisposed},hb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var ib=w.Scheduler=function(){function b(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function c(a,b){var c=b.first,d=b.second,e=new Z,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),bb});d||(e.add(g),c=!0)})};return f(c),e}function d(a,b,c){var d=b.first,e=b.second,f=new Z,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),bb});h||(f.add(i),e=!0)})};return g(d),f}function e(a,b){return b(),bb}var f=b.prototype;return f.catchException=f["catch"]=function(a){return new ob(this,a)},f.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},f.schedulePeriodicWithState=function(b,c,d){var e=b,f=a.setInterval(function(){e=d(e)},c);return ab(function(){a.clearInterval(f)})},f.schedule=function(a){return this._schedule(a,e)},f.scheduleWithState=function(a,b){return this._schedule(a,b)},f.scheduleWithRelative=function(a,b){return this._scheduleRelative(b,a,e)},f.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},f.scheduleWithAbsolute=function(a,b){return this._scheduleAbsolute(b,a,e)},f.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},f.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},f.scheduleRecursiveWithState=function(a,b){return this.scheduleWithState({first:a,second:b},function(a,b){return c(a,b)})},f.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,function(a,b){a(function(c){b(a,c)})})},f.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative({first:a,second:c},b,function(a,b){return d(a,b,"scheduleWithRelativeAndState")})},f.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,function(a,b){a(function(c){b(a,c)})})},f.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute({first:a,second:c},b,function(a,b){return d(a,b,"scheduleWithAbsoluteAndState")})},b.now=x,b.normalize=function(a){return 0>a&&(a=0),a},b}();w.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 cb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}();var jb,kb="Scheduler is not allowed to block the thread",lb=ib.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){if(b>0)throw new Error(kb);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ib(x,a,b,c)}(),mb=ib.currentThread=function(){function a(){e=new X(4)}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f,g=this.now()+ib.normalize(c),h=new hb(this,b,d,g);if(e)e.enqueue(h);else{f=new a;try{e.enqueue(h),f.run()}catch(i){throw i}finally{f.dispose()}}return h.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e;a.prototype.dispose=function(){e=null},a.prototype.run=function(){for(var a;e.length>0;)if(a=e.dequeue(),!a.isCancelled()){for(;a.dueTime-ib.now()>0;);a.isCancelled()||a.invoke()}};var f=new ib(x,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),nb=c;!function(){function b(){if(!a.postMessage||a.importScripts)return!1;var b=!1,c=a.onmessage;return a.onmessage=function(){b=!0},a.postMessage("","*"),a.onmessage=c,b}function c(a){if("string"==typeof a.data&&a.data.substring(0,d.length)===d){var b=a.data.substring(d.length),c=e[b];c(),delete e[b]}}if("function"==typeof a.setImmediate)jb=a.setImmediate,nb=clearImmediate;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))jb=process.nextTick;else if(b()){var d="ms.rx.schedule"+Math.random(),e={},f=0;a.addEventListener?a.addEventListener("message",c,!1):a.attachEvent("onmessage",c,!1),jb=function(b){var c=f++;e[c]=b,a.postMessage(d+c,"*")}}else if(a.MessageChannel){var g=new a.MessageChannel,h={},i=0;g.port1.onmessage=function(a){var b=a.data,c=h[b];c(),delete h[b]},jb=function(a){var b=i++;h[b]=a,g.port2.postMessage(b)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?jb=function(b){var c=a.document.createElement("script");c.onreadystatechange=function(){b(),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},a.document.documentElement.appendChild(c)}:(jb=function(b){return a.setTimeout(b,0)},nb=a.clearTimeout)}(),ib.timeout=function(){function b(a,b){var c=this,d=new cb,e=jb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Z(d,ab(function(){nb(e)}))}function c(b,c,d){var e=this,f=ib.normalize(c);if(0===f)return e.scheduleWithState(b,d);var g=new cb,h=a.setTimeout(function(){g.isDisposed||g.setDisposable(d(e,b))},f);return new Z(g,ab(function(){a.clearTimeout(h)}))}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ib(x,b,c,d)}();var ob=function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return R(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.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 bb}}},f.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},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new cb;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},f}(ib),pb=w.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}var b=a.prototype;return b.accept=function(a,b,c){return 1===arguments.length&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},b.toObservable=function(a){var b=this;return a||(a=lb),new Sb(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),qb=pb.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 pb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),rb=pb.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 pb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),sb=pb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new pb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),tb=w.Internals.Enumerator=function(a,b,c){this.moveNext=a,this.getCurrent=b,this.dispose=c},ub=tb.create=function(a,b,d){var e=!1;return d||(d=c),new tb(function(){if(e)return!1;var b=a();return b||(e=!0,d()),b},function(){return b()},function(){e||(d(),e=!0)})},vb=w.Internals.Enumerable=function(){function a(a){this.getEnumerator=a}return a.prototype.concat=function(){var a=this;return new Sb(function(b){var c=a.getEnumerator(),d=!1,e=new eb,f=lb.scheduleRecursive(function(a){var f,g,h=!1;if(!d){try{h=c.moveNext(),h?f=c.getCurrent():c.dispose()}catch(i){g=i,c.dispose()}if(g)return b.onError(g),void 0;if(!h)return b.onCompleted(),void 0;var j=new cb;e.setDisposable(j),j.setDisposable(f.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Z(e,f,ab(function(){d=!0,c.dispose()}))})},a.prototype.catchException=function(){var a=this;return new Sb(function(b){var c,d=a.getEnumerator(),e=!1,f=new eb,g=lb.scheduleRecursive(function(a){var g,h,i;if(i=!1,!e){try{i=d.moveNext(),i&&(g=d.getCurrent())}catch(j){h=j}if(h)return b.onError(h),void 0;if(!i)return c?b.onError(c):b.onCompleted(),void 0;var k=new cb;f.setDisposable(k),k.setDisposable(g.subscribe(b.onNext.bind(b),function(b){c=b,a()},b.onCompleted.bind(b)))}});return new Z(f,g,ab(function(){e=!0}))})},a}(),wb=vb.repeat=function(a,c){return c===b&&(c=-1),new vb(function(){var b,d=c;return ub(function(){return 0===d?!1:(d>0&&d--,b=a,!0)},function(){return b})})},xb=vb.forEach=function(a,b){return b||(b=d),new vb(function(){var c,d=-1;return ub(function(){return++d<a.length?(c=b(a[d],d),!0):!1},function(){return c})})},yb=w.Observer=function(){};yb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},yb.prototype.asObserver=function(){return new Cb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},yb.prototype.checked=function(){return new Db(this)};var zb=yb.create=function(a,b,d){return a||(a=c),b||(b=h),d||(d=c),new Cb(a,b,d)};yb.fromNotifier=function(a){return new Cb(function(b){return a(qb(b))},function(b){return a(rb(b))},function(){return a(sb())})},yb.notifyOn=function(a){return new Fb(a,this)};var Ab,Bb=w.Internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return R(b,a),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}(yb),Cb=w.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return R(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}(Bb),Db=function(a){function b(b){a.call(this),this._observer=b,this._state=0}R(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}(yb),Eb=w.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 eb}return R(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 b.isAcquired=!1,void 0;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}(Bb),Fb=function(a){function b(){a.apply(this,arguments)}return R(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}(Eb),Gb=w.Observable=function(){function a(a){this._subscribe=a}return Ab=a.prototype,Ab.finalValue=function(){var a=this;return new Sb(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(y))})})},Ab.subscribe=Ab.forEach=function(a,b,c){var d;return d="object"==typeof a?a:zb(a,b,c),this._subscribe(d)},Ab.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}();Ab.observeOn=function(a){var b=this;return new Sb(function(c){return b.subscribe(new Fb(a,c))})},Ab.subscribeOn=function(a){var b=this;return new Sb(function(c){var d=new cb,e=new eb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new p(a,b.subscribe(c)))})),e})},Gb.create=function(a){return new Sb(function(b){return ab(a(b))})},Gb.createWithDisposable=function(a){return new Sb(a)};var Hb=Gb.defer=function(a){return new Sb(function(b){var c;try{c=a()}catch(d){return Mb(d).subscribe(b)}return c.subscribe(b)})},Ib=Gb.empty=function(a){return a||(a=lb),new Sb(function(b){return a.schedule(function(){b.onCompleted()})})},Jb=Gb.fromArray=function(a,b){return b||(b=mb),new Sb(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Gb.generate=function(a,b,c,d,e){return e||(e=mb),new Sb(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 f.onError(j),void 0}e?(f.onNext(i),a()):f.onCompleted()})})};var Kb=Gb.never=function(){return new Sb(function(){return bb})};Gb.range=function(a,b,c){return c||(c=mb),new Sb(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Gb.repeat=function(a,b,c){return c||(c=mb),null==b&&(b=-1),Lb(a,c).repeat(b)};var Lb=Gb["return"]=Gb.returnValue=function(a,b){return b||(b=lb),new Sb(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Mb=Gb["throw"]=Gb.throwException=function(a,b){return b||(b=lb),new Sb(function(c){return b.schedule(function(){c.onError(a)})})};Gb.using=function(a,b){return new Sb(function(c){var d,e,f=bb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Z(Mb(g).subscribe(c),f)}return new Z(e.subscribe(c),f)})},Ab.amb=function(a){var b=this;return new Sb(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new cb,j=new cb;return 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 Z(i,j)})},Gb.amb=function(){function a(a,b){return a.amb(b)}for(var b=Kb(),c=n(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Ab["catch"]=Ab.catchException=function(a){return"function"==typeof a?q(this,a):Nb([this,a])};var Nb=Gb.catchException=Gb["catch"]=function(){var a=n(arguments,0);return xb(a).catchException()};Ab.combineLatest=function(){var a=Q.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Ob.apply(this,a)};var Ob=Gb.combineLatest=function(){var a=Q.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Sb(function(c){function e(a){var e;if(i[a]=!0,j||(j=i.every(d))){try{e=b.apply(null,l)}catch(f){return c.onError(f),void 0}c.onNext(e)}else k.filter(function(b,c){return c!==a}).every(d)&&c.onCompleted()}function f(a){k[a]=!0,k.every(d)&&c.onCompleted()}for(var g=function(){return!1},h=a.length,i=o(h,g),j=!1,k=o(h,g),l=new Array(h),m=new Array(h),n=0;h>n;n++)!function(b){m[b]=new cb,m[b].setDisposable(a[b].subscribe(function(a){l[b]=a,e(b)},c.onError.bind(c),function(){f(b)}))}(n);return new Z(m)})};Ab.concat=function(){var a=Q.call(arguments,0);return a.unshift(this),Pb.apply(this,a)};var Pb=Gb.concat=function(){var a=n(arguments,0);return xb(a).concat()};Ab.concatObservable=Ab.concatAll=function(){return this.merge(1)},Ab.merge=function(a){if("number"!=typeof a)return Qb(this,a);var b=this;return new Sb(function(c){var d=0,e=new Z,f=!1,g=[],h=function(a){var b=new cb;e.add(b),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){var a;e.remove(b),g.length>0?(a=g.shift(),h(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,h(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var Qb=Gb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Q.call(arguments,1)):(a=lb,b=Q.call(arguments,0)):(a=lb,b=Q.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Jb(b,a).mergeObservable()};Ab.mergeObservable=Ab.mergeAll=function(){var a=this;return new Sb(function(b){var c=new Z,d=!1,e=new cb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new cb;c.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},Ab.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Rb([this,a])};var Rb=Gb.onErrorResumeNext=function(){var a=n(arguments,0);return new Sb(function(b){var c=0,d=new eb,e=lb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],g=new cb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new Z(d,e)})};Ab.skipUntil=function(a){var b=this;return new Sb(function(c){var d=!1,e=new Z(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new cb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Ab["switch"]=Ab.switchLatest=function(){var a=this;return new Sb(function(b){var c=!1,d=new eb,e=!1,f=0,g=a.subscribe(function(a){var g=new cb,h=++f;c=!0,d.setDisposable(g),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())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new Z(g,d)})},Ab.takeUntil=function(a){var b=this;return new Sb(function(d){return new Z(b.subscribe(d),a.subscribe(d.onCompleted.bind(d),d.onError.bind(d),c))})},Ab.zip=function(){if(Array.isArray(arguments[0]))return r.apply(this,arguments);var a=this,b=Q.call(arguments),c=b.pop();return b.unshift(a),new Sb(function(e){function f(a){i[a]=!0,i.every(function(a){return a})&&e.onCompleted()}for(var g=b.length,h=o(g,function(){return[]}),i=o(g,function(){return!1}),j=function(b){var f,g;if(h.every(function(a){return a.length>0})){try{g=h.map(function(a){return a.shift()}),f=c.apply(a,g)}catch(j){return e.onError(j),void 0}e.onNext(f)}else i.filter(function(a,c){return c!==b}).every(d)&&e.onCompleted()},k=new Array(g),l=0;g>l;l++)!function(a){k[a]=new cb,k[a].setDisposable(b[a].subscribe(function(b){h[a].push(b),j(a)},e.onError.bind(e),function(){f(a)}))}(l);return new Z(k)})},Gb.zip=function(){var a=Q.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Gb.zipArray=function(){var a=Q.call(arguments);return new Sb(function(b){function c(a){if(g.every(function(a){return a.length>0})){var c=g.map(function(a){return a.shift()});b.onNext(c)}else if(h.filter(function(b,c){return c!==a}).every(d))return b.onCompleted(),void 0}function e(a){return h[a]=!0,h.every(d)?(b.onCompleted(),void 0):void 0}for(var f=a.length,g=o(f,function(){return[]}),h=o(f,function(){return!1}),i=new Array(f),j=0;f>j;j++)!function(d){i[d]=new cb,i[d].setDisposable(a[d].subscribe(function(a){g[d].push(a),c(d)},b.onError.bind(b),function(){e(d)}))}(j);var k=new Z(i);return k.add(ab(function(){for(var a=0,b=g.length;b>a;a++)g[a]=[]})),k})},Ab.asObservable=function(){var a=this;return new Sb(function(b){return a.subscribe(b)})},Ab.bufferWithCount=function(a,c){return c===b&&(c=a),this.windowWithCount(a,c).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Ab.dematerialize=function(){var a=this;return new Sb(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Ab.distinctUntilChanged=function(a,b){var c=this;return a||(a=d),b||(b=e),new Sb(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return d.onError(i),void 0}if(f)try{h=b(e,g)}catch(i){return d.onError(i),void 0}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Ab["do"]=Ab.doAction=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Sb(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b){try{b(c)}catch(d){a.onError(d)}a.onError(c)}else a.onError(c)},function(){if(c){try{c()}catch(b){a.onError(b)}a.onCompleted()}else a.onCompleted()})})},Ab["finally"]=Ab.finallyAction=function(a){var b=this;return new Sb(function(c){var d=b.subscribe(c);return ab(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Ab.ignoreElements=function(){var a=this;return new Sb(function(b){return a.subscribe(c,b.onError.bind(b),b.onCompleted.bind(b))})},Ab.materialize=function(){var a=this;return new Sb(function(b){return a.subscribe(function(a){b.onNext(qb(a))},function(a){b.onNext(rb(a)),b.onCompleted()},function(){b.onNext(sb()),b.onCompleted()})})},Ab.repeat=function(a){return wb(this,a).concat()},Ab.retry=function(a){return wb(this,a).catchException()},Ab.scan=function(){var a,b,c=!1;2===arguments.length?(a=arguments[0],b=arguments[1],c=!0):b=arguments[0];var d=this;return Hb(function(){var e,f=!1;return d.select(function(d){return f?e=b(e,d):(e=c?b(a,d):d,f=!0),e
})})},Ab.skipLast=function(a){var b=this;return new Sb(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},Ab.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=lb,a=Q.call(arguments,c),xb([Jb(a,b),this]).concat()},Ab.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Jb(a,b)})},Ab.takeLastBuffer=function(a){var b=this;return new Sb(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},Ab.windowWithCount=function(a,b){var c=this;if(0>=a)throw new Error(z);if(null==b&&(b=a),0>=b)throw new Error(z);return new Sb(function(d){var e=new cb,f=new gb(e),g=0,h=[],i=function(){var a=new Wb;h.push(a),d.onNext(T(a,f))};return i(),e.setDisposable(c.subscribe(function(c){for(var d,e=0,f=h.length;f>e;e++)h[e].onNext(c);var j=g-a+1;j>=0&&0===j%b&&(d=h.shift(),d.onCompleted()),g++,0===g%b&&i()},function(a){for(;h.length>0;)h.shift().onError(a);d.onError(a)},function(){for(;h.length>0;)h.shift().onCompleted();d.onCompleted()})),f})},Ab.defaultIfEmpty=function(a){var c=this;return a===b&&(a=null),new Sb(function(b){var d=!1;return c.subscribe(function(a){d=!0,b.onNext(a)},b.onError.bind(b),function(){d||b.onNext(a),b.onCompleted()})})},Ab.distinct=function(a,b){var c=this;return a||(a=d),b||(b=g),new Sb(function(d){var e={};return c.subscribe(function(c){var f,g,h,i=!1;try{f=a(c),g=b(f)}catch(j){return d.onError(j),void 0}for(h in e)if(g===h){i=!0;break}i||(e[g]=null,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Ab.groupBy=function(a,b,c){return this.groupByUntil(a,b,function(){return Kb()},c)},Ab.groupByUntil=function(a,b,e,f){var h=this;return b||(b=d),f||(f=g),new Sb(function(d){var g={},i=new Z,j=new gb(i);return i.add(h.subscribe(function(h){var k,l,m,n,o,p,q,r,s,t;try{p=a(h),q=f(p)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}n=!1;try{s=g[q],s||(s=new Wb,g[q]=s,n=!0)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}if(n){o=new Ub(p,s,j),l=new Ub(p,s);try{k=e(l)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}d.onNext(o),r=new cb,i.add(r);var v=function(){q in g&&(delete g[q],s.onCompleted()),i.remove(r)};r.setDisposable(k.take(1).subscribe(c,function(a){for(t in g)g[t].onError(a);d.onError(a)},function(){v()}))}try{m=b(h)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}s.onNext(m)},function(a){for(var b in g)g[b].onError(a);d.onError(a)},function(){for(var a in g)g[a].onCompleted();d.onCompleted()})),j})},Ab.select=Ab.map=function(a,b){var c=this;return new Sb(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Ab.pluck=function(a){return this.select(function(b){return b[a]})},Ab.selectMany=Ab.flatMap=function(a,b){return b?this.selectMany(function(c){return a(c).select(function(a){return b(c,a)})}):"function"==typeof a?s.call(this,a):s.call(this,function(){return a})},Ab.selectSwitch=Ab.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},Ab.skip=function(a){if(0>a)throw new Error(z);var b=this;return new Sb(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Ab.skipWhile=function(a,b){var c=this;return new Sb(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Ab.take=function(a,b){if(0>a)throw new Error(z);if(0===a)return Ib(b);var c=this;return new Sb(function(b){var d=a;return c.subscribe(function(a){d>0&&(d--,b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},Ab.takeWhile=function(a,b){var c=this;return new Sb(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},Ab.where=Ab.filter=function(a,b){var c=this;return new Sb(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})};var Sb=w.Internals.AnonymousObservable=function(a){function b(c){function d(a){var b=new Tb(a);if(mb.scheduleRequired())mb.schedule(function(){try{b.setDisposable(c(b))}catch(a){if(!b.fail(a))throw a}});else try{b.setDisposable(c(b))}catch(d){if(!b.fail(d))throw d}return b}return this instanceof b?(a.call(this,d),void 0):new b(c)}return R(b,a),b}(Gb),Tb=function(a){function b(b){a.call(this),this.observer=b,this.m=new cb}R(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Bb),Ub=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Sb(function(a){return new Z(e.getDisposable(),d.subscribe(a))}):d}return R(c,a),c}(Gb),Vb=function(a,b){this.subject=a,this.observer=b};Vb.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 Wb=w.Subject=function(a){function b(a){return i.call(this),this.isStopped?this.exception?(a.onError(this.exception),bb):(a.onCompleted(),bb):(this.observers.push(a),new Vb(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return R(c,a),S(c.prototype,yb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(i.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(i.call(this),!this.isStopped)for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),c.create=function(a,b){return new Xb(a,b)},c}(Gb);w.AsyncSubject=function(a){function b(a){if(i.call(this),!this.isStopped)return this.observers.push(a),new Vb(this,a);var b=this.exception,c=this.hasValue,d=this.value;return b?a.onError(b):c?(a.onNext(d),a.onCompleted()):a.onCompleted(),bb}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return R(c,a),S(c.prototype,yb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){var a,b,c;if(i.call(this),!this.isStopped){var d=this.observers.slice(0);this.isStopped=!0;var e=this.value,f=this.hasValue;if(f)for(b=0,c=d.length;c>b;b++)a=d[b],a.onNext(e),a.onCompleted();else for(b=0,c=d.length;c>b;b++)d[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){i.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),c}(Gb);var Xb=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){a.call(this,b),this.observer=c,this.observable=d}return R(c,a),S(c.prototype,yb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Gb);return"function"==typeof define&&"object"==typeof define.amd&&define.amd?(a.Rx=w,define(function(){return w})):(t?"object"==typeof module&&module&&module.exports==t?module.exports=w:t=w:a.Rx=w,void 0)}(this);
!function(a,b){function c(){}function d(a){return a}function e(a,b){return P(a,b)}function f(a,b){return a-b}function g(a){return a.toString()}function h(a){throw a}function i(){if(this.isDisposed)throw new Error(A)}function j(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function k(a){return a&&"object"==typeof a?L.call(a)==C:!1}function l(a){return"function"==typeof a}function m(a,b,c,d){var e;if(a===b)return 0!==a||1/a==1/b;var f=typeof a,g=typeof b;if(!(a!==a||a&&B[f]||b&&B[g]))return!1;if(null==a||null==b)return a===b;var h=L.call(a),i=L.call(b);if(h==C&&(h=I),i==C&&(i=I),h!=i)return!1;switch(h){case E:case F:return+a==+b;case H:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case J:case K:return a==String(b)}var n=h==D;if(!n){if(h!=I||!v&&(j(a)||j(b)))return!1;var o=!N&&k(a)?Object:a.constructor,p=!N&&k(b)?Object:b.constructor;if(o!=p&&!(l(o)&&o instanceof o&&l(p)&&p instanceof p))return!1}for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(e=!0,c.push(a),d.push(b),n){for(q=a.length,r=b.length,e=r==a.length;r--;){var s=b[r];if(!(e=m(a[r],s,c,d)))break}return e}for(var t in b)if(M.call(b,t))return r++,e=M.call(a,t)&&m(a[t],b[t],c,d);if(e)for(var t in a)if(M.call(a,t))return e=--r>-1;return c.pop(),d.pop(),e}function n(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Q.call(a)}function o(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function p(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function q(a,b){return new Rb(function(c){var d=new cb,e=new eb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return c.onError(g),void 0}d=new cb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function r(a,b){var c=this;return new Rb(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),void 0}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function s(a){return this.select(a).mergeObservable()}var t="object"==typeof exports&&exports,u=("object"==typeof module&&module&&module.exports==t&&module,"object"==typeof global&&global);u.global===u&&(a=u);var v,w={Internals:{}},x=function(){return Date.now?Date.now:function(){return+new Date}}(),y="Sequence contains no elements.",z="Argument out of range",A="Object has been disposed",B={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},C="[object Arguments]",D="[object Array]",E="[object Boolean]",F="[object Date]",G="[object Function]",H="[object Number]",I="[object Object]",J="[object RegExp]",K="[object String]",L=Object.prototype.toString,M=Object.prototype.hasOwnProperty,N=L.call(arguments)==C;try{v=!(L.call(document)==I&&!({toString:0}+""))}catch(O){v=!0}N||(k=function(a){return a&&"object"==typeof a?M.call(a,"callee"):!1}),l(/x/)&&(l=function(a){return"function"==typeof a&&L.call(a)==G});var P=w.Internals.isEqual=function(a,b){return m(a,b,[],[])},Q=Array.prototype.slice;({}).hasOwnProperty;var R=this.inherits=w.Internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},S=w.Internals.addProperties=function(a){for(var b=Q.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},T=w.Internals.addRef=function(a,b){return new Rb(function(c){return new Z(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Q.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(Q.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Q.call(arguments)))};return d});var U=Object("a"),V="a"!=U[0]||!(0 in U);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=V&&"[object String]"=={}.toString.call(this)?this.split(""):b,d=c.length>>>0,e=arguments[1];if("[object Function]"!={}.toString.call(a))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=V&&"[object String]"=={}.toString.call(this)?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if("[object Function]"!={}.toString.call(a))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"[object Array]"==Object.prototype.toString.call(a)}),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});var W=function(a,b){this.id=a,this.value=b};W.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var X=w.Internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Y=X.prototype;Y.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Y.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)}}},Y.heapify=function(a){if(a===b&&(a=0),!(a>=this.length||0>a)){var c=2*a+1,d=2*a+2,e=a;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==a){var f=this.items[a];this.items[a]=this.items[e],this.items[e]=f,this.heapify(e)}}},Y.peek=function(){return this.items[0].value},Y.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Y.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Y.enqueue=function(a){var b=this.length++;this.items[b]=new W(X.count++,a),this.percolate(b)},Y.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},X.count=0;var Z=w.CompositeDisposable=function(){this.disposables=n(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},$=Z.prototype;$.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},$.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},$.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},$.clear=function(){var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()},$.contains=function(a){return-1!==this.disposables.indexOf(a)},$.toArray=function(){return this.disposables.slice(0)};var _=w.Disposable=function(a){this.isDisposed=!1,this.action=a||c};_.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ab=_.create=function(a){return new _(a)},bb=_.empty={dispose:c},cb=w.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null},db=cb.prototype;db.getDisposable=function(){return this.current},cb.disposable=function(a){return arguments.length?this.getDisposable():this.setDisposable(a)},db.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()},db.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()};var eb=w.SerialDisposable=function(){this.isDisposed=!1,this.current=null},fb=eb.prototype;fb.getDisposable=function(){return this.current},fb.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},fb.disposable=function(a){return a?(this.setDisposable(a),void 0):this.getDisposable()},fb.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()};var gb=w.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?bb:new a(this)},b}();p.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var hb=w.Internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||f,this.disposable=new cb};hb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},hb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},hb.prototype.isCancelled=function(){return this.disposable.isDisposed},hb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var ib=w.Scheduler=function(){function b(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function c(a,b){var c=b.first,d=b.second,e=new Z,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),bb});d||(e.add(g),c=!0)})};return f(c),e}function d(a,b,c){var d=b.first,e=b.second,f=new Z,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),bb});h||(f.add(i),e=!0)})};return g(d),f}function e(a,b){return b(),bb}var f=b.prototype;return f.catchException=f["catch"]=function(a){return new ob(this,a)},f.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},f.schedulePeriodicWithState=function(b,c,d){var e=b,f=a.setInterval(function(){e=d(e)},c);return ab(function(){a.clearInterval(f)})},f.schedule=function(a){return this._schedule(a,e)},f.scheduleWithState=function(a,b){return this._schedule(a,b)},f.scheduleWithRelative=function(a,b){return this._scheduleRelative(b,a,e)},f.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},f.scheduleWithAbsolute=function(a,b){return this._scheduleAbsolute(b,a,e)},f.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},f.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},f.scheduleRecursiveWithState=function(a,b){return this.scheduleWithState({first:a,second:b},function(a,b){return c(a,b)})},f.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,function(a,b){a(function(c){b(a,c)})})},f.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative({first:a,second:c},b,function(a,b){return d(a,b,"scheduleWithRelativeAndState")})},f.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,function(a,b){a(function(c){b(a,c)})})},f.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute({first:a,second:c},b,function(a,b){return d(a,b,"scheduleWithAbsoluteAndState")})},b.now=x,b.normalize=function(a){return 0>a&&(a=0),a},b}();w.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 cb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}();var jb,kb="Scheduler is not allowed to block the thread",lb=ib.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){if(b>0)throw new Error(kb);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ib(x,a,b,c)}(),mb=ib.currentThread=function(){function a(){e=new X(4)}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f,g=this.now()+ib.normalize(c),h=new hb(this,b,d,g);if(e)e.enqueue(h);else{f=new a;try{e.enqueue(h),f.run()}catch(i){throw i}finally{f.dispose()}}return h.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e;a.prototype.dispose=function(){e=null},a.prototype.run=function(){for(var a;e.length>0;)if(a=e.dequeue(),!a.isCancelled()){for(;a.dueTime-ib.now()>0;);a.isCancelled()||a.invoke()}};var f=new ib(x,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),nb=c;!function(){function b(){if(!a.postMessage||a.importScripts)return!1;var b=!1,c=a.onmessage;return a.onmessage=function(){b=!0},a.postMessage("","*"),a.onmessage=c,b}function c(a){if("string"==typeof a.data&&a.data.substring(0,d.length)===d){var b=a.data.substring(d.length),c=e[b];c(),delete e[b]}}if("function"==typeof a.setImmediate)jb=a.setImmediate,nb=clearImmediate;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))jb=process.nextTick;else if(b()){var d="ms.rx.schedule"+Math.random(),e={},f=0;a.addEventListener?a.addEventListener("message",c,!1):a.attachEvent("onmessage",c,!1),jb=function(b){var c=f++;e[c]=b,a.postMessage(d+c,"*")}}else if(a.MessageChannel){var g=new a.MessageChannel,h={},i=0;g.port1.onmessage=function(a){var b=a.data,c=h[b];c(),delete h[b]},jb=function(a){var b=i++;h[b]=a,g.port2.postMessage(b)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?jb=function(b){var c=a.document.createElement("script");c.onreadystatechange=function(){b(),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},a.document.documentElement.appendChild(c)}:(jb=function(b){return a.setTimeout(b,0)},nb=a.clearTimeout)}(),ib.timeout=function(){function b(a,b){var c=this,d=new cb,e=jb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Z(d,ab(function(){nb(e)}))}function c(b,c,d){var e=this,f=ib.normalize(c);if(0===f)return e.scheduleWithState(b,d);var g=new cb,h=a.setTimeout(function(){g.isDisposed||g.setDisposable(d(e,b))},f);return new Z(g,ab(function(){a.clearTimeout(h)}))}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ib(x,b,c,d)}();var ob=function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return R(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.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 bb}}},f.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},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new cb;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},f}(ib),pb=w.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}var b=a.prototype;return b.accept=function(a,b,c){return 1===arguments.length&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},b.toObservable=function(a){var b=this;return a||(a=lb),new Rb(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),qb=pb.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 pb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),rb=pb.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 pb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),sb=pb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new pb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),tb=w.Internals.Enumerator=function(a,b,c){this.moveNext=a,this.getCurrent=b,this.dispose=c},ub=tb.create=function(a,b,d){var e=!1;return d||(d=c),new tb(function(){if(e)return!1;var b=a();return b||(e=!0,d()),b},function(){return b()},function(){e||(d(),e=!0)})},vb=w.Internals.Enumerable=function(){function a(a){this.getEnumerator=a}return a.prototype.concat=function(){var a=this;return new Rb(function(b){var c=a.getEnumerator(),d=!1,e=new eb,f=lb.scheduleRecursive(function(a){var f,g,h=!1;if(!d){try{h=c.moveNext(),h?f=c.getCurrent():c.dispose()}catch(i){g=i,c.dispose()}if(g)return b.onError(g),void 0;if(!h)return b.onCompleted(),void 0;var j=new cb;e.setDisposable(j),j.setDisposable(f.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Z(e,f,ab(function(){d=!0,c.dispose()}))})},a.prototype.catchException=function(){var a=this;return new Rb(function(b){var c,d=a.getEnumerator(),e=!1,f=new eb,g=lb.scheduleRecursive(function(a){var g,h,i;if(i=!1,!e){try{i=d.moveNext(),i&&(g=d.getCurrent())}catch(j){h=j}if(h)return b.onError(h),void 0;if(!i)return c?b.onError(c):b.onCompleted(),void 0;var k=new cb;f.setDisposable(k),k.setDisposable(g.subscribe(b.onNext.bind(b),function(b){c=b,a()},b.onCompleted.bind(b)))}});return new Z(f,g,ab(function(){e=!0}))})},a}(),wb=vb.repeat=function(a,c){return c===b&&(c=-1),new vb(function(){var b,d=c;return ub(function(){return 0===d?!1:(d>0&&d--,b=a,!0)},function(){return b})})},xb=vb.forEach=function(a,b){return b||(b=d),new vb(function(){var c,d=-1;return ub(function(){return++d<a.length?(c=b(a[d],d),!0):!1},function(){return c})})},yb=w.Observer=function(){};yb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},yb.prototype.asObserver=function(){return new Cb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},yb.prototype.checked=function(){return new Db(this)};var zb=yb.create=function(a,b,d){return a||(a=c),b||(b=h),d||(d=c),new Cb(a,b,d)};yb.fromNotifier=function(a){return new Cb(function(b){return a(qb(b))},function(b){return a(rb(b))},function(){return a(sb())})},yb.notifyOn=function(a){return new Fb(a,this)};var Ab,Bb=w.Internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return R(b,a),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}(yb),Cb=w.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return R(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}(Bb),Db=function(a){function b(b){a.call(this),this._observer=b,this._state=0}R(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}(yb),Eb=w.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 eb}return R(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 b.isAcquired=!1,void 0;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}(Bb),Fb=function(a){function b(){a.apply(this,arguments)}return R(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}(Eb),Gb=w.Observable=function(){function a(a){this._subscribe=a}return Ab=a.prototype,Ab.finalValue=function(){var a=this;return new Rb(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(y))})})},Ab.subscribe=Ab.forEach=function(a,b,c){var d;return d="object"==typeof a?a:zb(a,b,c),this._subscribe(d)},Ab.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}();Ab.observeOn=function(a){var b=this;return new Rb(function(c){return b.subscribe(new Fb(a,c))})},Ab.subscribeOn=function(a){var b=this;return new Rb(function(c){var d=new cb,e=new eb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new p(a,b.subscribe(c)))})),e})},Gb.create=Gb.createWithDisposable=function(a){return new Rb(a)},Gb.defer=function(a){return new Rb(function(b){var c;try{c=a()}catch(d){return Lb(d).subscribe(b)}return c.subscribe(b)})};var Hb=Gb.empty=function(a){return a||(a=lb),new Rb(function(b){return a.schedule(function(){b.onCompleted()})})},Ib=Gb.fromArray=function(a,b){return b||(b=mb),new Rb(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Gb.generate=function(a,b,c,d,e){return e||(e=mb),new Rb(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 f.onError(j),void 0}e?(f.onNext(i),a()):f.onCompleted()})})};var Jb=Gb.never=function(){return new Rb(function(){return bb})};Gb.range=function(a,b,c){return c||(c=mb),new Rb(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Gb.repeat=function(a,b,c){return c||(c=mb),null==b&&(b=-1),Kb(a,c).repeat(b)};var Kb=Gb["return"]=Gb.returnValue=function(a,b){return b||(b=lb),new Rb(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Lb=Gb["throw"]=Gb.throwException=function(a,b){return b||(b=lb),new Rb(function(c){return b.schedule(function(){c.onError(a)})})};Gb.using=function(a,b){return new Rb(function(c){var d,e,f=bb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Z(Lb(g).subscribe(c),f)}return new Z(e.subscribe(c),f)})},Ab.amb=function(a){var b=this;return new Rb(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new cb,j=new cb;return 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 Z(i,j)})},Gb.amb=function(){function a(a,b){return a.amb(b)}for(var b=Jb(),c=n(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Ab["catch"]=Ab.catchException=function(a){return"function"==typeof a?q(this,a):Mb([this,a])};var Mb=Gb.catchException=Gb["catch"]=function(){var a=n(arguments,0);return xb(a).catchException()};Ab.combineLatest=function(){var a=Q.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Nb.apply(this,a)};var Nb=Gb.combineLatest=function(){var a=Q.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Rb(function(c){function e(a){var e;if(i[a]=!0,j||(j=i.every(d))){try{e=b.apply(null,l)}catch(f){return c.onError(f),void 0}c.onNext(e)}else k.filter(function(b,c){return c!==a}).every(d)&&c.onCompleted()}function f(a){k[a]=!0,k.every(d)&&c.onCompleted()}for(var g=function(){return!1},h=a.length,i=o(h,g),j=!1,k=o(h,g),l=new Array(h),m=new Array(h),n=0;h>n;n++)!function(b){m[b]=new cb,m[b].setDisposable(a[b].subscribe(function(a){l[b]=a,e(b)},c.onError.bind(c),function(){f(b)}))}(n);return new Z(m)})};Ab.concat=function(){var a=Q.call(arguments,0);return a.unshift(this),Ob.apply(this,a)};var Ob=Gb.concat=function(){var a=n(arguments,0);return xb(a).concat()};Ab.concatObservable=Ab.concatAll=function(){return this.merge(1)},Ab.merge=function(a){if("number"!=typeof a)return Pb(this,a);var b=this;return new Rb(function(c){var d=0,e=new Z,f=!1,g=[],h=function(a){var b=new cb;e.add(b),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){var a;e.remove(b),g.length>0?(a=g.shift(),h(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,h(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var Pb=Gb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Q.call(arguments,1)):(a=lb,b=Q.call(arguments,0)):(a=lb,b=Q.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Ib(b,a).mergeObservable()};Ab.mergeObservable=Ab.mergeAll=function(){var a=this;return new Rb(function(b){var c=new Z,d=!1,e=new cb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new cb;c.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},Ab.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Qb([this,a])};var Qb=Gb.onErrorResumeNext=function(){var a=n(arguments,0);return new Rb(function(b){var c=0,d=new eb,e=lb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],g=new cb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new Z(d,e)})};Ab.skipUntil=function(a){var b=this;return new Rb(function(c){var d=!1,e=new Z(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new cb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Ab["switch"]=Ab.switchLatest=function(){var a=this;return new Rb(function(b){var c=!1,d=new eb,e=!1,f=0,g=a.subscribe(function(a){var g=new cb,h=++f;c=!0,d.setDisposable(g),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())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new Z(g,d)})},Ab.takeUntil=function(a){var b=this;return new Rb(function(d){return new Z(b.subscribe(d),a.subscribe(d.onCompleted.bind(d),d.onError.bind(d),c))})},Ab.zip=function(){if(Array.isArray(arguments[0]))return r.apply(this,arguments);var a=this,b=Q.call(arguments),c=b.pop();return b.unshift(a),new Rb(function(e){function f(a){i[a]=!0,i.every(function(a){return a})&&e.onCompleted()}for(var g=b.length,h=o(g,function(){return[]}),i=o(g,function(){return!1}),j=function(b){var f,g;if(h.every(function(a){return a.length>0})){try{g=h.map(function(a){return a.shift()}),f=c.apply(a,g)}catch(j){return e.onError(j),void 0}e.onNext(f)}else i.filter(function(a,c){return c!==b}).every(d)&&e.onCompleted()},k=new Array(g),l=0;g>l;l++)!function(a){k[a]=new cb,k[a].setDisposable(b[a].subscribe(function(b){h[a].push(b),j(a)},e.onError.bind(e),function(){f(a)}))}(l);return new Z(k)})},Gb.zip=function(){var a=Q.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Gb.zipArray=function(){var a=Q.call(arguments);return new Rb(function(b){function c(a){if(g.every(function(a){return a.length>0})){var c=g.map(function(a){return a.shift()});b.onNext(c)}else if(h.filter(function(b,c){return c!==a}).every(d))return b.onCompleted(),void 0}function e(a){return h[a]=!0,h.every(d)?(b.onCompleted(),void 0):void 0}for(var f=a.length,g=o(f,function(){return[]}),h=o(f,function(){return!1}),i=new Array(f),j=0;f>j;j++)!function(d){i[d]=new cb,i[d].setDisposable(a[d].subscribe(function(a){g[d].push(a),c(d)},b.onError.bind(b),function(){e(d)}))}(j);var k=new Z(i);return k.add(ab(function(){for(var a=0,b=g.length;b>a;a++)g[a]=[]})),k})},Ab.asObservable=function(){var a=this;return new Rb(function(b){return a.subscribe(b)})},Ab.bufferWithCount=function(a,b){return 1===arguments.length&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Ab.dematerialize=function(){var a=this;return new Rb(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Ab.distinctUntilChanged=function(a,b){var c=this;return a||(a=d),b||(b=e),new Rb(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return d.onError(i),void 0}if(f)try{h=b(e,g)}catch(i){return d.onError(i),void 0}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Ab["do"]=Ab.doAction=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Rb(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b){try{b(c)}catch(d){a.onError(d)}a.onError(c)}else a.onError(c)},function(){if(c){try{c()}catch(b){a.onError(b)}a.onCompleted()}else a.onCompleted()})})},Ab["finally"]=Ab.finallyAction=function(a){var b=this;return new Rb(function(c){var d=b.subscribe(c);return ab(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Ab.ignoreElements=function(){var a=this;return new Rb(function(b){return a.subscribe(c,b.onError.bind(b),b.onCompleted.bind(b))})},Ab.materialize=function(){var a=this;return new Rb(function(b){return a.subscribe(function(a){b.onNext(qb(a))},function(a){b.onNext(rb(a)),b.onCompleted()},function(){b.onNext(sb()),b.onCompleted()})})},Ab.repeat=function(a){return wb(this,a).concat()},Ab.retry=function(a){return wb(this,a).catchException()},Ab.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 Rb(function(e){var f,g,h;return d.subscribe(function(d){try{h||(h=!0),f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return e.onError(i),void 0
}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},Ab.skipLast=function(a){var b=this;return new Rb(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},Ab.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=lb,a=Q.call(arguments,c),xb([Ib(a,b),this]).concat()},Ab.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Ib(a,b)})},Ab.takeLastBuffer=function(a){var b=this;return new Rb(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},Ab.windowWithCount=function(a,b){var c=this;if(0>=a)throw new Error(z);if(1===arguments.length&&(b=a),0>=b)throw new Error(z);return new Rb(function(d){var e=new cb,f=new gb(e),g=0,h=[],i=function(){var a=new Vb;h.push(a),d.onNext(T(a,f))};return i(),e.setDisposable(c.subscribe(function(c){for(var d,e=0,f=h.length;f>e;e++)h[e].onNext(c);var j=g-a+1;j>=0&&0===j%b&&(d=h.shift(),d.onCompleted()),g++,0===g%b&&i()},function(a){for(;h.length>0;)h.shift().onError(a);d.onError(a)},function(){for(;h.length>0;)h.shift().onCompleted();d.onCompleted()})),f})},Ab.defaultIfEmpty=function(a){var c=this;return a===b&&(a=null),new Rb(function(b){var d=!1;return c.subscribe(function(a){d=!0,b.onNext(a)},b.onError.bind(b),function(){d||b.onNext(a),b.onCompleted()})})},Ab.distinct=function(a,b){var c=this;return a||(a=d),b||(b=g),new Rb(function(d){var e={};return c.subscribe(function(c){var f,g,h,i=!1;try{f=a(c),g=b(f)}catch(j){return d.onError(j),void 0}for(h in e)if(g===h){i=!0;break}i||(e[g]=null,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Ab.groupBy=function(a,b,c){return this.groupByUntil(a,b,function(){return Jb()},c)},Ab.groupByUntil=function(a,b,e,f){var h=this;return b||(b=d),f||(f=g),new Rb(function(d){var g={},i=new Z,j=new gb(i);return i.add(h.subscribe(function(h){var k,l,m,n,o,p,q,r,s,t;try{p=a(h),q=f(p)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}n=!1;try{s=g[q],s||(s=new Vb,g[q]=s,n=!0)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}if(n){o=new Tb(p,s,j),l=new Tb(p,s);try{k=e(l)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}d.onNext(o),r=new cb,i.add(r);var v=function(){q in g&&(delete g[q],s.onCompleted()),i.remove(r)};r.setDisposable(k.take(1).subscribe(c,function(a){for(t in g)g[t].onError(a);d.onError(a)},function(){v()}))}try{m=b(h)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}s.onNext(m)},function(a){for(var b in g)g[b].onError(a);d.onError(a)},function(){for(var a in g)g[a].onCompleted();d.onCompleted()})),j})},Ab.select=Ab.map=function(a,b){var c=this;return new Rb(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Ab.pluck=function(a){return this.select(function(b){return b[a]})},Ab.selectMany=Ab.flatMap=function(a,b){return b?this.selectMany(function(c){return a(c).select(function(a){return b(c,a)})}):"function"==typeof a?s.call(this,a):s.call(this,function(){return a})},Ab.selectSwitch=Ab.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},Ab.skip=function(a){if(0>a)throw new Error(z);var b=this;return new Rb(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Ab.skipWhile=function(a,b){var c=this;return new Rb(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Ab.take=function(a,b){if(0>a)throw new Error(z);if(0===a)return Hb(b);var c=this;return new Rb(function(b){var d=a;return c.subscribe(function(a){d>0&&(d--,b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},Ab.takeWhile=function(a,b){var c=this;return new Rb(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},Ab.where=Ab.filter=function(a,b){var c=this;return new Rb(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})};var Rb=w.Internals.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=bb:"function"==typeof a&&(a=ab(a)),a}function c(d){function e(a){var c=new Sb(a);if(mb.scheduleRequired())mb.schedule(function(){try{c.setDisposable(b(d(c)))}catch(a){if(!c.fail(a))throw a}});else try{c.setDisposable(b(d(c)))}catch(e){if(!c.fail(e))throw e}return c}return this instanceof c?(a.call(this,e),void 0):new c(d)}return R(c,a),c}(Gb),Sb=function(a){function b(b){a.call(this),this.observer=b,this.m=new cb}R(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Bb),Tb=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Rb(function(a){return new Z(e.getDisposable(),d.subscribe(a))}):d}return R(c,a),c}(Gb),Ub=function(a,b){this.subject=a,this.observer=b};Ub.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 Vb=w.Subject=function(a){function b(a){return i.call(this),this.isStopped?this.exception?(a.onError(this.exception),bb):(a.onCompleted(),bb):(this.observers.push(a),new Ub(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return R(c,a),S(c.prototype,yb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(i.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(i.call(this),!this.isStopped)for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),c.create=function(a,b){return new Wb(a,b)},c}(Gb);w.AsyncSubject=function(a){function b(a){if(i.call(this),!this.isStopped)return this.observers.push(a),new Ub(this,a);var b=this.exception,c=this.hasValue,d=this.value;return b?a.onError(b):c?(a.onNext(d),a.onCompleted()):a.onCompleted(),bb}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return R(c,a),S(c.prototype,yb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){var a,b,c;if(i.call(this),!this.isStopped){var d=this.observers.slice(0);this.isStopped=!0;var e=this.value,f=this.hasValue;if(f)for(b=0,c=d.length;c>b;b++)a=d[b],a.onNext(e),a.onCompleted();else for(b=0,c=d.length;c>b;b++)d[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){i.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),c}(Gb);var Wb=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){a.call(this,b),this.observer=c,this.observable=d}return R(c,a),S(c.prototype,yb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Gb);return"function"==typeof define&&"object"==typeof define.amd&&define.amd?(a.Rx=w,define(function(){return w})):(t?"object"==typeof module&&module&&module.exports==t?module.exports=w:t=w:a.Rx=w,void 0)}(this);

@@ -27,3 +27,3 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

observableProto = Observable.prototype,
observableCreateWithDisposable = Observable.createWithDisposable,
AnonymousObservable = Rx.Internals.AnonymousObservable,
observableConcat = Observable.concat,

@@ -72,4 +72,3 @@ observableDefer = Observable.defer,

* This operator allows for a fluent style of writing queries that use the same sequence multiple times.
*
* @memberOf Observable#
*
* @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.

@@ -89,4 +88,2 @@ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

* 3 - res = Rx.Observable.if(condition, obs1, scheduler);
* @static
* @memberOf Observable
* @param {Function} condition The condition which determines if the thenSource or elseSource will be run.

@@ -111,4 +108,2 @@ * @param {Observable} thenSource The observable sequence that will be run if the condition function returns true.

* There is an alias for this method called 'forIn' for browsers <IE9
* @static
* @memberOf Observable
* @param {Array} sources An array of values to turn into an observable sequence.

@@ -125,4 +120,3 @@ * @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.

* There is an alias for this method called 'whileDo' for browsers <IE9
* @static
* @memberOf Observable
*
* @param {Function} condition The condition which determines if the source will be repeated.

@@ -139,3 +133,2 @@ * @param {Observable} source The observable sequence that will be run if the condition function returns true.

*
* @memberOf Observable#
* @param {Function} condition The condition which determines if the source will be repeated.

@@ -158,4 +151,2 @@ * @param {Observable} source The observable sequence that will be run if the condition function returns true.

*
* @static
* @memberOf Observable
* @param {Function} selector The function which extracts the value for to test in a case statement.

@@ -182,3 +173,2 @@ * @param {Array} sources A object which has keys which correspond to the case statement labels.

*
* @memberOf Observable#
* @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.

@@ -191,3 +181,3 @@ * @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler.

var source = this;
return observableCreateWithDisposable(function (observer) {
return new AnonymousObservable(function (observer) {
var q = [],

@@ -251,5 +241,3 @@ m = new SerialDisposable(),

* 1 - res = Rx.Observable.forkJoin([obs1, obs2]);
* 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...);
* @static
* @memberOf Observable
* 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...);
* @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences.

@@ -259,3 +247,3 @@ */

var allSources = argsOrArray(arguments, 0);
return observableCreateWithDisposable(function (subscriber) {
return new AnonymousObservable(function (subscriber) {
var count = allSources.length;

@@ -310,4 +298,3 @@ if (count === 0) {

* Runs two observable sequences in parallel and combines their last elemenets.
*
* @memberOf Observable#
*
* @param {Observable} second Second observable sequence.

@@ -320,3 +307,3 @@ * @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences.

return observableCreateWithDisposable(function (observer) {
return new AnonymousObservable(function (observer) {
var leftStopped = false, rightStopped = false,

@@ -398,3 +385,3 @@ hasLeft = false, hasRight = false,

var source = this;
return Observable.defer(function () {
return observableDefer(function () {
var chain;

@@ -401,0 +388,0 @@

@@ -1,1 +0,1 @@

!function(a,b){var c="object"==typeof exports&&exports,d=("object"==typeof module&&module&&module.exports==c&&module,"object"==typeof global&&global);d.global===d&&(window=d),"function"==typeof define&&define.amd?define(["rx","exports"],function(c,d){return a.Rx=b(a,d,c),a.Rx}):"object"==typeof module&&module&&module.exports===c?module.exports=b(a,module.exports,require("./rx")):a.Rx=b(a,{},a.Rx)}(this,function(a,b,c,d){function e(){}function f(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:w.call(a)}function g(a,b){return new s(function(){var c;return r(function(){return a()?(c=b,!0):!1},function(){return c})})}var h=c.Observable,i=h.prototype,j=h.createWithDisposable,k=h.concat,l=h.defer,m=h.empty,n=c.Disposable.empty,o=(c.Internals.BinaryObserver,c.CompositeDisposable),p=c.SerialDisposable,q=c.SingleAssignmentDisposable,r=c.Internals.Enumerator.create,s=c.Internals.Enumerable,t=s.forEach,u=c.Scheduler.immediate,v=c.Scheduler.currentThread,w=Array.prototype.slice,x=c.AsyncSubject,y=c.Observer,z=c.Internals.inherits,A=c.Internals.addProperties;i.letBind=i.let=function(a){return a(this)},h["if"]=h.ifThen=function(a,b,c){return l(function(){if(c||(c=m()),c.now){var d=c;c=m(d)}return a()?b:c})},h["for"]=h.forIn=function(a,b){return t(a,b).concat()};var B=h["while"]=h.whileDo=function(a,b){return g(a,b).concat()};i.doWhile=function(a){return k([this,B(a,this)])},h["case"]=h.switchCase=function(a,b,c){return l(function(){if(c||(c=m()),c.now){var e=c;c=m(e)}var f=b[a()];return f!==d?f:c})},i.expand=function(a,b){b||(b=u);var c=this;return j(function(d){var e=[],f=new p,g=new o(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 i=!1,void 0;c=e.shift();var f=new q;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})},h.forkJoin=function(){var a=f(arguments,0);return j(function(b){var c=a.length;if(0===c)return b.onCompleted(),n;for(var d=new o,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];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 b.onCompleted(),void 0;g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},i.forkJoin=function(a,b){var c=this;return j(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new q,l=new q;return 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 d.onError(c),void 0}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 d.onError(c),void 0}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new o(k,l)})},i.manySelect=function(a,b){b||(b=u);var c=this;return h.defer(function(){var d;return c.select(function(a){var b=new C(a);return d&&d.onNext(a),d=b,b}).doAction(e,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).select(function(b,c,d){return a(b,c,d)})})};var C=function(a){function b(a){var b=this,c=new o;return c.add(v.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeObservable().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new x}return z(c,a),A(c.prototype,y,{onCompleted:function(){this.onNext(h.empty())},onError:function(a){this.onNext(h.throwException(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(h);return c});
!function(a,b){var c="object"==typeof exports&&exports,d=("object"==typeof module&&module&&module.exports==c&&module,"object"==typeof global&&global);d.global===d&&(window=d),"function"==typeof define&&define.amd?define(["rx","exports"],function(c,d){return a.Rx=b(a,d,c),a.Rx}):"object"==typeof module&&module&&module.exports===c?module.exports=b(a,module.exports,require("./rx")):a.Rx=b(a,{},a.Rx)}(this,function(a,b,c,d){function e(){}function f(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:w.call(a)}function g(a,b){return new s(function(){var c;return r(function(){return a()?(c=b,!0):!1},function(){return c})})}var h=c.Observable,i=h.prototype,j=c.Internals.AnonymousObservable,k=h.concat,l=h.defer,m=h.empty,n=c.Disposable.empty,o=(c.Internals.BinaryObserver,c.CompositeDisposable),p=c.SerialDisposable,q=c.SingleAssignmentDisposable,r=c.Internals.Enumerator.create,s=c.Internals.Enumerable,t=s.forEach,u=c.Scheduler.immediate,v=c.Scheduler.currentThread,w=Array.prototype.slice,x=c.AsyncSubject,y=c.Observer,z=c.Internals.inherits,A=c.Internals.addProperties;i.letBind=i.let=function(a){return a(this)},h["if"]=h.ifThen=function(a,b,c){return l(function(){if(c||(c=m()),c.now){var d=c;c=m(d)}return a()?b:c})},h["for"]=h.forIn=function(a,b){return t(a,b).concat()};var B=h["while"]=h.whileDo=function(a,b){return g(a,b).concat()};i.doWhile=function(a){return k([this,B(a,this)])},h["case"]=h.switchCase=function(a,b,c){return l(function(){if(c||(c=m()),c.now){var e=c;c=m(e)}var f=b[a()];return f!==d?f:c})},i.expand=function(a,b){b||(b=u);var c=this;return new j(function(d){var e=[],f=new p,g=new o(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 i=!1,void 0;c=e.shift();var f=new q;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})},h.forkJoin=function(){var a=f(arguments,0);return new j(function(b){var c=a.length;if(0===c)return b.onCompleted(),n;for(var d=new o,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];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 b.onCompleted(),void 0;g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},i.forkJoin=function(a,b){var c=this;return new j(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new q,l=new q;return 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 d.onError(c),void 0}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 d.onError(c),void 0}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new o(k,l)})},i.manySelect=function(a,b){b||(b=u);var c=this;return l(function(){var d;return c.select(function(a){var b=new C(a);return d&&d.onNext(a),d=b,b}).doAction(e,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).select(function(b,c,d){return a(b,c,d)})})};var C=function(a){function b(a){var b=this,c=new o;return c.add(v.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeObservable().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new x}return z(c,a),A(c.prototype,y,{onCompleted:function(){this.onNext(h.empty())},onError:function(a){this.onNext(h.throwException(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(h);return c});

@@ -338,4 +338,2 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

// Observable extensions
/**

@@ -342,0 +340,0 @@ * Creates a pattern that matches when both observable sequences have an available value.

@@ -1,2 +0,2 @@

!function(a,b){function c(){}function d(a){return a}function e(a,b){return P(a,b)}function f(a,b){return a-b}function g(a){return a.toString()}function h(a){throw a}function i(){if(this.isDisposed)throw new Error(A)}function j(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function k(a){return a&&"object"==typeof a?L.call(a)==C:!1}function l(a){return"function"==typeof a}function m(a,b,c,d){var e;if(a===b)return 0!==a||1/a==1/b;var f=typeof a,g=typeof b;if(!(a!==a||a&&B[f]||b&&B[g]))return!1;if(null==a||null==b)return a===b;var h=L.call(a),i=L.call(b);if(h==C&&(h=I),i==C&&(i=I),h!=i)return!1;switch(h){case E:case F:return+a==+b;case H:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case J:case K:return a==String(b)}var n=h==D;if(!n){if(h!=I||!v&&(j(a)||j(b)))return!1;var o=!N&&k(a)?Object:a.constructor,p=!N&&k(b)?Object:b.constructor;if(o!=p&&!(l(o)&&o instanceof o&&l(p)&&p instanceof p))return!1}for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(e=!0,c.push(a),d.push(b),n){for(q=a.length,r=b.length,e=r==a.length;r--;){var s=b[r];if(!(e=m(a[r],s,c,d)))break}return e}for(var t in b)if(M.call(b,t))return r++,e=M.call(a,t)&&m(a[t],b[t],c,d);if(e)for(var t in a)if(M.call(a,t))return e=--r>-1;return c.pop(),d.pop(),e}function n(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Q.call(a)}function o(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function p(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function q(a,b){return new Qb(function(c){var d=new ab,e=new cb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return c.onError(g),void 0}d=new ab,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function r(a,b){var c=this;return new Qb(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),void 0}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function s(a){return this.select(a).mergeObservable()}var t="object"==typeof exports&&exports,u=("object"==typeof module&&module&&module.exports==t&&module,"object"==typeof global&&global);u.global===u&&(a=u);var v,w={Internals:{}},x=Date.now,y="Sequence contains no elements.",z="Argument out of range",A="Object has been disposed",B={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},C="[object Arguments]",D="[object Array]",E="[object Boolean]",F="[object Date]",G="[object Function]",H="[object Number]",I="[object Object]",J="[object RegExp]",K="[object String]",L=Object.prototype.toString,M=Object.prototype.hasOwnProperty,N=L.call(arguments)==C;try{v=!(L.call(document)==I&&!({toString:0}+""))}catch(O){v=!0}N||(k=function(a){return a&&"object"==typeof a?M.call(a,"callee"):!1}),l(/x/)&&(l=function(a){return"function"==typeof a&&L.call(a)==G});var P=w.Internals.isEqual=function(a,b){return m(a,b,[],[])},Q=Array.prototype.slice;({}).hasOwnProperty;var R=this.inherits=w.Internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},S=w.Internals.addProperties=function(a){for(var b=Q.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},T=w.Internals.addRef=function(a,b){return new Qb(function(c){return new X(b.getDisposable(),a.subscribe(c))})},U=function(a,b){this.id=a,this.value=b};U.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var V=w.Internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},W=V.prototype;W.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},W.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)}}},W.heapify=function(a){if(a===b&&(a=0),!(a>=this.length||0>a)){var c=2*a+1,d=2*a+2,e=a;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==a){var f=this.items[a];this.items[a]=this.items[e],this.items[e]=f,this.heapify(e)}}},W.peek=function(){return this.items[0].value},W.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},W.dequeue=function(){var a=this.peek();return this.removeAt(0),a},W.enqueue=function(a){var b=this.length++;this.items[b]=new U(V.count++,a),this.percolate(b)},W.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},V.count=0;var X=w.CompositeDisposable=function(){this.disposables=n(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Y=X.prototype;Y.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Y.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},Y.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Y.clear=function(){var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()},Y.contains=function(a){return-1!==this.disposables.indexOf(a)},Y.toArray=function(){return this.disposables.slice(0)};var Z=w.Disposable=function(a){this.isDisposed=!1,this.action=a||c};Z.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var $=Z.create=function(a){return new Z(a)},_=Z.empty={dispose:c},ab=w.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null},bb=ab.prototype;bb.getDisposable=function(){return this.current},ab.disposable=function(a){return arguments.length?this.getDisposable():this.setDisposable(a)},bb.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()},bb.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()};var cb=w.SerialDisposable=function(){this.isDisposed=!1,this.current=null},db=cb.prototype;db.getDisposable=function(){return this.current},db.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},db.disposable=function(a){return a?(this.setDisposable(a),void 0):this.getDisposable()},db.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()};var eb=w.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?_:new a(this)},b}();p.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var fb=w.Internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||f,this.disposable=new ab};fb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},fb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},fb.prototype.isCancelled=function(){return this.disposable.isDisposed},fb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var gb=w.Scheduler=function(){function b(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function c(a,b){var c=b.first,d=b.second,e=new X,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),_});d||(e.add(g),c=!0)})};return f(c),e}function d(a,b,c){var d=b.first,e=b.second,f=new X,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),_});h||(f.add(i),e=!0)})};return g(d),f}function e(a,b){return b(),_}var f=b.prototype;return f.catchException=f["catch"]=function(a){return new mb(this,a)},f.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},f.schedulePeriodicWithState=function(b,c,d){var e=b,f=a.setInterval(function(){e=d(e)},c);return $(function(){a.clearInterval(f)})},f.schedule=function(a){return this._schedule(a,e)},f.scheduleWithState=function(a,b){return this._schedule(a,b)},f.scheduleWithRelative=function(a,b){return this._scheduleRelative(b,a,e)},f.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},f.scheduleWithAbsolute=function(a,b){return this._scheduleAbsolute(b,a,e)},f.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},f.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},f.scheduleRecursiveWithState=function(a,b){return this.scheduleWithState({first:a,second:b},function(a,b){return c(a,b)})},f.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,function(a,b){a(function(c){b(a,c)})})},f.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative({first:a,second:c},b,function(a,b){return d(a,b,"scheduleWithRelativeAndState")})},f.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,function(a,b){a(function(c){b(a,c)})})},f.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute({first:a,second:c},b,function(a,b){return d(a,b,"scheduleWithAbsoluteAndState")})},b.now=x,b.normalize=function(a){return 0>a&&(a=0),a},b}();w.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 ab;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}();var hb,ib="Scheduler is not allowed to block the thread",jb=gb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){if(b>0)throw new Error(ib);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new gb(x,a,b,c)}(),kb=gb.currentThread=function(){function a(){e=new V(4)}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f,g=this.now()+gb.normalize(c),h=new fb(this,b,d,g);if(e)e.enqueue(h);else{f=new a;try{e.enqueue(h),f.run()}catch(i){throw i}finally{f.dispose()}}return h.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e;a.prototype.dispose=function(){e=null},a.prototype.run=function(){for(var a;e.length>0;)if(a=e.dequeue(),!a.isCancelled()){for(;a.dueTime-gb.now()>0;);a.isCancelled()||a.invoke()}};var f=new gb(x,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),lb=c;!function(){function b(){if(!a.postMessage||a.importScripts)return!1;var b=!1,c=a.onmessage;return a.onmessage=function(){b=!0},a.postMessage("","*"),a.onmessage=c,b}function c(a){if("string"==typeof a.data&&a.data.substring(0,d.length)===d){var b=a.data.substring(d.length),c=e[b];c(),delete e[b]}}if("function"==typeof a.setImmediate)hb=a.setImmediate,lb=clearImmediate;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))hb=process.nextTick;else if(b()){var d="ms.rx.schedule"+Math.random(),e={},f=0;a.addEventListener?a.addEventListener("message",c,!1):a.attachEvent("onmessage",c,!1),hb=function(b){var c=f++;e[c]=b,a.postMessage(d+c,"*")}}else if(a.MessageChannel){var g=new a.MessageChannel,h={},i=0;g.port1.onmessage=function(a){var b=a.data,c=h[b];c(),delete h[b]},hb=function(a){var b=i++;h[b]=a,g.port2.postMessage(b)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?hb=function(b){var c=a.document.createElement("script");c.onreadystatechange=function(){b(),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},a.document.documentElement.appendChild(c)}:(hb=function(b){return a.setTimeout(b,0)},lb=a.clearTimeout)}(),gb.timeout=function(){function b(a,b){var c=this,d=new ab,e=hb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new X(d,$(function(){lb(e)}))}function c(b,c,d){var e=this,f=gb.normalize(c);if(0===f)return e.scheduleWithState(b,d);var g=new ab,h=a.setTimeout(function(){g.isDisposed||g.setDisposable(d(e,b))},f);return new X(g,$(function(){a.clearTimeout(h)}))}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new gb(x,b,c,d)}();var mb=function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return R(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.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 _}}},f.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},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new ab;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},f}(gb),nb=w.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}var b=a.prototype;return b.accept=function(a,b,c){return 1===arguments.length&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},b.toObservable=function(a){var b=this;return a||(a=jb),new Qb(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),ob=nb.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 nb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),pb=nb.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 nb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),qb=nb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new nb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),rb=w.Internals.Enumerator=function(a,b,c){this.moveNext=a,this.getCurrent=b,this.dispose=c},sb=rb.create=function(a,b,d){var e=!1;return d||(d=c),new rb(function(){if(e)return!1;var b=a();return b||(e=!0,d()),b},function(){return b()},function(){e||(d(),e=!0)})},tb=w.Internals.Enumerable=function(){function a(a){this.getEnumerator=a}return a.prototype.concat=function(){var a=this;return new Qb(function(b){var c=a.getEnumerator(),d=!1,e=new cb,f=jb.scheduleRecursive(function(a){var f,g,h=!1;if(!d){try{h=c.moveNext(),h?f=c.getCurrent():c.dispose()}catch(i){g=i,c.dispose()}if(g)return b.onError(g),void 0;if(!h)return b.onCompleted(),void 0;var j=new ab;e.setDisposable(j),j.setDisposable(f.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new X(e,f,$(function(){d=!0,c.dispose()}))})},a.prototype.catchException=function(){var a=this;return new Qb(function(b){var c,d=a.getEnumerator(),e=!1,f=new cb,g=jb.scheduleRecursive(function(a){var g,h,i;if(i=!1,!e){try{i=d.moveNext(),i&&(g=d.getCurrent())}catch(j){h=j}if(h)return b.onError(h),void 0;if(!i)return c?b.onError(c):b.onCompleted(),void 0;var k=new ab;f.setDisposable(k),k.setDisposable(g.subscribe(b.onNext.bind(b),function(b){c=b,a()},b.onCompleted.bind(b)))}});return new X(f,g,$(function(){e=!0}))})},a}(),ub=tb.repeat=function(a,c){return c===b&&(c=-1),new tb(function(){var b,d=c;return sb(function(){return 0===d?!1:(d>0&&d--,b=a,!0)},function(){return b})})},vb=tb.forEach=function(a,b){return b||(b=d),new tb(function(){var c,d=-1;return sb(function(){return++d<a.length?(c=b(a[d],d),!0):!1},function(){return c})})},wb=w.Observer=function(){};wb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},wb.prototype.asObserver=function(){return new Ab(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},wb.prototype.checked=function(){return new Bb(this)};var xb=wb.create=function(a,b,d){return a||(a=c),b||(b=h),d||(d=c),new Ab(a,b,d)};wb.fromNotifier=function(a){return new Ab(function(b){return a(ob(b))},function(b){return a(pb(b))},function(){return a(qb())})},wb.notifyOn=function(a){return new Db(a,this)};var yb,zb=w.Internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return R(b,a),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}(wb),Ab=w.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return R(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}(zb),Bb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}R(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}(wb),Cb=w.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 cb}return R(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 b.isAcquired=!1,void 0;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}(zb),Db=function(a){function b(){a.apply(this,arguments)}return R(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}(Cb),Eb=w.Observable=function(){function a(a){this._subscribe=a}return yb=a.prototype,yb.finalValue=function(){var a=this;return new Qb(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(y))})})},yb.subscribe=yb.forEach=function(a,b,c){var d;return d="object"==typeof a?a:xb(a,b,c),this._subscribe(d)},yb.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}();yb.observeOn=function(a){var b=this;return new Qb(function(c){return b.subscribe(new Db(a,c))})},yb.subscribeOn=function(a){var b=this;return new Qb(function(c){var d=new ab,e=new cb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new p(a,b.subscribe(c)))})),e})},Eb.create=function(a){return new Qb(function(b){return $(a(b))})},Eb.createWithDisposable=function(a){return new Qb(a)};var Fb=Eb.defer=function(a){return new Qb(function(b){var c;try{c=a()}catch(d){return Kb(d).subscribe(b)}return c.subscribe(b)})},Gb=Eb.empty=function(a){return a||(a=jb),new Qb(function(b){return a.schedule(function(){b.onCompleted()})})},Hb=Eb.fromArray=function(a,b){return b||(b=kb),new Qb(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Eb.generate=function(a,b,c,d,e){return e||(e=kb),new Qb(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 f.onError(j),void 0}e?(f.onNext(i),a()):f.onCompleted()})})};var Ib=Eb.never=function(){return new Qb(function(){return _})};Eb.range=function(a,b,c){return c||(c=kb),new Qb(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Eb.repeat=function(a,b,c){return c||(c=kb),null==b&&(b=-1),Jb(a,c).repeat(b)};var Jb=Eb["return"]=Eb.returnValue=function(a,b){return b||(b=jb),new Qb(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Kb=Eb["throw"]=Eb.throwException=function(a,b){return b||(b=jb),new Qb(function(c){return b.schedule(function(){c.onError(a)})})};Eb.using=function(a,b){return new Qb(function(c){var d,e,f=_;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new X(Kb(g).subscribe(c),f)}return new X(e.subscribe(c),f)})},yb.amb=function(a){var b=this;return new Qb(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new ab,j=new ab;return 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 X(i,j)})},Eb.amb=function(){function a(a,b){return a.amb(b)}for(var b=Ib(),c=n(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},yb["catch"]=yb.catchException=function(a){return"function"==typeof a?q(this,a):Lb([this,a])};var Lb=Eb.catchException=Eb["catch"]=function(){var a=n(arguments,0);return vb(a).catchException()};yb.combineLatest=function(){var a=Q.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Mb.apply(this,a)};var Mb=Eb.combineLatest=function(){var a=Q.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Qb(function(c){function e(a){var e;if(i[a]=!0,j||(j=i.every(d))){try{e=b.apply(null,l)}catch(f){return c.onError(f),void 0}c.onNext(e)}else k.filter(function(b,c){return c!==a}).every(d)&&c.onCompleted()}function f(a){k[a]=!0,k.every(d)&&c.onCompleted()}for(var g=function(){return!1},h=a.length,i=o(h,g),j=!1,k=o(h,g),l=new Array(h),m=new Array(h),n=0;h>n;n++)!function(b){m[b]=new ab,m[b].setDisposable(a[b].subscribe(function(a){l[b]=a,e(b)},c.onError.bind(c),function(){f(b)}))}(n);return new X(m)})};yb.concat=function(){var a=Q.call(arguments,0);return a.unshift(this),Nb.apply(this,a)};var Nb=Eb.concat=function(){var a=n(arguments,0);return vb(a).concat()};yb.concatObservable=yb.concatAll=function(){return this.merge(1)},yb.merge=function(a){if("number"!=typeof a)return Ob(this,a);var b=this;return new Qb(function(c){var d=0,e=new X,f=!1,g=[],h=function(a){var b=new ab;e.add(b),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){var a;e.remove(b),g.length>0?(a=g.shift(),h(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,h(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var Ob=Eb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Q.call(arguments,1)):(a=jb,b=Q.call(arguments,0)):(a=jb,b=Q.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Hb(b,a).mergeObservable()};yb.mergeObservable=yb.mergeAll=function(){var a=this;return new Qb(function(b){var c=new X,d=!1,e=new ab;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new ab;c.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},yb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Pb([this,a])};var Pb=Eb.onErrorResumeNext=function(){var a=n(arguments,0);return new Qb(function(b){var c=0,d=new cb,e=jb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],g=new ab,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new X(d,e)})};yb.skipUntil=function(a){var b=this;return new Qb(function(c){var d=!1,e=new X(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new ab;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},yb["switch"]=yb.switchLatest=function(){var a=this;return new Qb(function(b){var c=!1,d=new cb,e=!1,f=0,g=a.subscribe(function(a){var g=new ab,h=++f;c=!0,d.setDisposable(g),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())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new X(g,d)})},yb.takeUntil=function(a){var b=this;return new Qb(function(d){return new X(b.subscribe(d),a.subscribe(d.onCompleted.bind(d),d.onError.bind(d),c))})},yb.zip=function(){if(Array.isArray(arguments[0]))return r.apply(this,arguments);var a=this,b=Q.call(arguments),c=b.pop();return b.unshift(a),new Qb(function(e){function f(a){i[a]=!0,i.every(function(a){return a})&&e.onCompleted()}for(var g=b.length,h=o(g,function(){return[]}),i=o(g,function(){return!1}),j=function(b){var f,g;if(h.every(function(a){return a.length>0})){try{g=h.map(function(a){return a.shift()}),f=c.apply(a,g)}catch(j){return e.onError(j),void 0}e.onNext(f)}else i.filter(function(a,c){return c!==b}).every(d)&&e.onCompleted()},k=new Array(g),l=0;g>l;l++)!function(a){k[a]=new ab,k[a].setDisposable(b[a].subscribe(function(b){h[a].push(b),j(a)},e.onError.bind(e),function(){f(a)}))}(l);return new X(k)})},Eb.zip=function(){var a=Q.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Eb.zipArray=function(){var a=Q.call(arguments);return new Qb(function(b){function c(a){if(g.every(function(a){return a.length>0})){var c=g.map(function(a){return a.shift()});b.onNext(c)}else if(h.filter(function(b,c){return c!==a}).every(d))return b.onCompleted(),void 0}function e(a){return h[a]=!0,h.every(d)?(b.onCompleted(),void 0):void 0}for(var f=a.length,g=o(f,function(){return[]}),h=o(f,function(){return!1}),i=new Array(f),j=0;f>j;j++)!function(d){i[d]=new ab,i[d].setDisposable(a[d].subscribe(function(a){g[d].push(a),c(d)},b.onError.bind(b),function(){e(d)}))}(j);var k=new X(i);return k.add($(function(){for(var a=0,b=g.length;b>a;a++)g[a]=[]})),k})},yb.asObservable=function(){var a=this;return new Qb(function(b){return a.subscribe(b)})},yb.bufferWithCount=function(a,c){return c===b&&(c=a),this.windowWithCount(a,c).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},yb.dematerialize=function(){var a=this;return new Qb(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},yb.distinctUntilChanged=function(a,b){var c=this;return a||(a=d),b||(b=e),new Qb(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return d.onError(i),void 0}if(f)try{h=b(e,g)}catch(i){return d.onError(i),void 0}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},yb["do"]=yb.doAction=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Qb(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b){try{b(c)}catch(d){a.onError(d)}a.onError(c)}else a.onError(c)},function(){if(c){try{c()}catch(b){a.onError(b)}a.onCompleted()}else a.onCompleted()})})},yb["finally"]=yb.finallyAction=function(a){var b=this;return new Qb(function(c){var d=b.subscribe(c);return $(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},yb.ignoreElements=function(){var a=this;return new Qb(function(b){return a.subscribe(c,b.onError.bind(b),b.onCompleted.bind(b))})},yb.materialize=function(){var a=this;return new Qb(function(b){return a.subscribe(function(a){b.onNext(ob(a))},function(a){b.onNext(pb(a)),b.onCompleted()},function(){b.onNext(qb()),b.onCompleted()})})},yb.repeat=function(a){return ub(this,a).concat()},yb.retry=function(a){return ub(this,a).catchException()},yb.scan=function(){var a,b,c=!1;2===arguments.length?(a=arguments[0],b=arguments[1],c=!0):b=arguments[0];var d=this;return Fb(function(){var e,f=!1;return d.select(function(d){return f?e=b(e,d):(e=c?b(a,d):d,f=!0),e})})},yb.skipLast=function(a){var b=this;return new Qb(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},yb.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=jb,a=Q.call(arguments,c),vb([Hb(a,b),this]).concat()},yb.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Hb(a,b)})},yb.takeLastBuffer=function(a){var b=this;return new Qb(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},yb.windowWithCount=function(a,b){var c=this;if(0>=a)throw new Error(z);if(null==b&&(b=a),0>=b)throw new Error(z);return new Qb(function(d){var e=new ab,f=new eb(e),g=0,h=[],i=function(){var a=new Ub;h.push(a),d.onNext(T(a,f))};return i(),e.setDisposable(c.subscribe(function(c){for(var d,e=0,f=h.length;f>e;e++)h[e].onNext(c);var j=g-a+1;j>=0&&0===j%b&&(d=h.shift(),d.onCompleted()),g++,0===g%b&&i()},function(a){for(;h.length>0;)h.shift().onError(a);d.onError(a)},function(){for(;h.length>0;)h.shift().onCompleted();d.onCompleted()})),f})},yb.defaultIfEmpty=function(a){var c=this;return a===b&&(a=null),new Qb(function(b){var d=!1;return c.subscribe(function(a){d=!0,b.onNext(a)},b.onError.bind(b),function(){d||b.onNext(a),b.onCompleted()})})},yb.distinct=function(a,b){var c=this;return a||(a=d),b||(b=g),new Qb(function(d){var e={};return c.subscribe(function(c){var f,g,h,i=!1;try{f=a(c),g=b(f)}catch(j){return d.onError(j),void 0}for(h in e)if(g===h){i=!0;break}i||(e[g]=null,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},yb.groupBy=function(a,b,c){return this.groupByUntil(a,b,function(){return Ib()
},c)},yb.groupByUntil=function(a,b,e,f){var h=this;return b||(b=d),f||(f=g),new Qb(function(d){var g={},i=new X,j=new eb(i);return i.add(h.subscribe(function(h){var k,l,m,n,o,p,q,r,s,t;try{p=a(h),q=f(p)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}n=!1;try{s=g[q],s||(s=new Ub,g[q]=s,n=!0)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}if(n){o=new Sb(p,s,j),l=new Sb(p,s);try{k=e(l)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}d.onNext(o),r=new ab,i.add(r);var v=function(){q in g&&(delete g[q],s.onCompleted()),i.remove(r)};r.setDisposable(k.take(1).subscribe(c,function(a){for(t in g)g[t].onError(a);d.onError(a)},function(){v()}))}try{m=b(h)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}s.onNext(m)},function(a){for(var b in g)g[b].onError(a);d.onError(a)},function(){for(var a in g)g[a].onCompleted();d.onCompleted()})),j})},yb.select=yb.map=function(a,b){var c=this;return new Qb(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},yb.pluck=function(a){return this.select(function(b){return b[a]})},yb.selectMany=yb.flatMap=function(a,b){return b?this.selectMany(function(c){return a(c).select(function(a){return b(c,a)})}):"function"==typeof a?s.call(this,a):s.call(this,function(){return a})},yb.selectSwitch=yb.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},yb.skip=function(a){if(0>a)throw new Error(z);var b=this;return new Qb(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},yb.skipWhile=function(a,b){var c=this;return new Qb(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},yb.take=function(a,b){if(0>a)throw new Error(z);if(0===a)return Gb(b);var c=this;return new Qb(function(b){var d=a;return c.subscribe(function(a){d>0&&(d--,b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},yb.takeWhile=function(a,b){var c=this;return new Qb(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},yb.where=yb.filter=function(a,b){var c=this;return new Qb(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})};var Qb=w.Internals.AnonymousObservable=function(a){function b(c){function d(a){var b=new Rb(a);if(kb.scheduleRequired())kb.schedule(function(){try{b.setDisposable(c(b))}catch(a){if(!b.fail(a))throw a}});else try{b.setDisposable(c(b))}catch(d){if(!b.fail(d))throw d}return b}return this instanceof b?(a.call(this,d),void 0):new b(c)}return R(b,a),b}(Eb),Rb=function(a){function b(b){a.call(this),this.observer=b,this.m=new ab}R(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(zb),Sb=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Qb(function(a){return new X(e.getDisposable(),d.subscribe(a))}):d}return R(c,a),c}(Eb),Tb=function(a,b){this.subject=a,this.observer=b};Tb.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 Ub=w.Subject=function(a){function b(a){return i.call(this),this.isStopped?this.exception?(a.onError(this.exception),_):(a.onCompleted(),_):(this.observers.push(a),new Tb(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return R(c,a),S(c.prototype,wb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(i.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(i.call(this),!this.isStopped)for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),c.create=function(a,b){return new Vb(a,b)},c}(Eb);w.AsyncSubject=function(a){function b(a){if(i.call(this),!this.isStopped)return this.observers.push(a),new Tb(this,a);var b=this.exception,c=this.hasValue,d=this.value;return b?a.onError(b):c?(a.onNext(d),a.onCompleted()):a.onCompleted(),_}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return R(c,a),S(c.prototype,wb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){var a,b,c;if(i.call(this),!this.isStopped){var d=this.observers.slice(0);this.isStopped=!0;var e=this.value,f=this.hasValue;if(f)for(b=0,c=d.length;c>b;b++)a=d[b],a.onNext(e),a.onCompleted();else for(b=0,c=d.length;c>b;b++)d[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){i.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),c}(Eb);var Vb=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){a.call(this,b),this.observer=c,this.observable=d}return R(c,a),S(c.prototype,wb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Eb);return"function"==typeof define&&"object"==typeof define.amd&&define.amd?(a.Rx=w,define(function(){return w})):(t?"object"==typeof module&&module&&module.exports==t?module.exports=w:t=w:a.Rx=w,void 0)}(this);
!function(a,b){function c(){}function d(a){return a}function e(a,b){return P(a,b)}function f(a,b){return a-b}function g(a){return a.toString()}function h(a){throw a}function i(){if(this.isDisposed)throw new Error(A)}function j(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function k(a){return a&&"object"==typeof a?L.call(a)==C:!1}function l(a){return"function"==typeof a}function m(a,b,c,d){var e;if(a===b)return 0!==a||1/a==1/b;var f=typeof a,g=typeof b;if(!(a!==a||a&&B[f]||b&&B[g]))return!1;if(null==a||null==b)return a===b;var h=L.call(a),i=L.call(b);if(h==C&&(h=I),i==C&&(i=I),h!=i)return!1;switch(h){case E:case F:return+a==+b;case H:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case J:case K:return a==String(b)}var n=h==D;if(!n){if(h!=I||!v&&(j(a)||j(b)))return!1;var o=!N&&k(a)?Object:a.constructor,p=!N&&k(b)?Object:b.constructor;if(o!=p&&!(l(o)&&o instanceof o&&l(p)&&p instanceof p))return!1}for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(e=!0,c.push(a),d.push(b),n){for(q=a.length,r=b.length,e=r==a.length;r--;){var s=b[r];if(!(e=m(a[r],s,c,d)))break}return e}for(var t in b)if(M.call(b,t))return r++,e=M.call(a,t)&&m(a[t],b[t],c,d);if(e)for(var t in a)if(M.call(a,t))return e=--r>-1;return c.pop(),d.pop(),e}function n(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Q.call(a)}function o(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function p(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function q(a,b){return new Pb(function(c){var d=new ab,e=new cb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return c.onError(g),void 0}d=new ab,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function r(a,b){var c=this;return new Pb(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),void 0}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function s(a){return this.select(a).mergeObservable()}var t="object"==typeof exports&&exports,u=("object"==typeof module&&module&&module.exports==t&&module,"object"==typeof global&&global);u.global===u&&(a=u);var v,w={Internals:{}},x=Date.now,y="Sequence contains no elements.",z="Argument out of range",A="Object has been disposed",B={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},C="[object Arguments]",D="[object Array]",E="[object Boolean]",F="[object Date]",G="[object Function]",H="[object Number]",I="[object Object]",J="[object RegExp]",K="[object String]",L=Object.prototype.toString,M=Object.prototype.hasOwnProperty,N=L.call(arguments)==C;try{v=!(L.call(document)==I&&!({toString:0}+""))}catch(O){v=!0}N||(k=function(a){return a&&"object"==typeof a?M.call(a,"callee"):!1}),l(/x/)&&(l=function(a){return"function"==typeof a&&L.call(a)==G});var P=w.Internals.isEqual=function(a,b){return m(a,b,[],[])},Q=Array.prototype.slice;({}).hasOwnProperty;var R=this.inherits=w.Internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},S=w.Internals.addProperties=function(a){for(var b=Q.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},T=w.Internals.addRef=function(a,b){return new Pb(function(c){return new X(b.getDisposable(),a.subscribe(c))})},U=function(a,b){this.id=a,this.value=b};U.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var V=w.Internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},W=V.prototype;W.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},W.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)}}},W.heapify=function(a){if(a===b&&(a=0),!(a>=this.length||0>a)){var c=2*a+1,d=2*a+2,e=a;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==a){var f=this.items[a];this.items[a]=this.items[e],this.items[e]=f,this.heapify(e)}}},W.peek=function(){return this.items[0].value},W.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},W.dequeue=function(){var a=this.peek();return this.removeAt(0),a},W.enqueue=function(a){var b=this.length++;this.items[b]=new U(V.count++,a),this.percolate(b)},W.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},V.count=0;var X=w.CompositeDisposable=function(){this.disposables=n(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Y=X.prototype;Y.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Y.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},Y.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Y.clear=function(){var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()},Y.contains=function(a){return-1!==this.disposables.indexOf(a)},Y.toArray=function(){return this.disposables.slice(0)};var Z=w.Disposable=function(a){this.isDisposed=!1,this.action=a||c};Z.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var $=Z.create=function(a){return new Z(a)},_=Z.empty={dispose:c},ab=w.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null},bb=ab.prototype;bb.getDisposable=function(){return this.current},ab.disposable=function(a){return arguments.length?this.getDisposable():this.setDisposable(a)},bb.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()},bb.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()};var cb=w.SerialDisposable=function(){this.isDisposed=!1,this.current=null},db=cb.prototype;db.getDisposable=function(){return this.current},db.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},db.disposable=function(a){return a?(this.setDisposable(a),void 0):this.getDisposable()},db.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()};var eb=w.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?_:new a(this)},b}();p.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var fb=w.Internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||f,this.disposable=new ab};fb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},fb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},fb.prototype.isCancelled=function(){return this.disposable.isDisposed},fb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var gb=w.Scheduler=function(){function b(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function c(a,b){var c=b.first,d=b.second,e=new X,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),_});d||(e.add(g),c=!0)})};return f(c),e}function d(a,b,c){var d=b.first,e=b.second,f=new X,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),_});h||(f.add(i),e=!0)})};return g(d),f}function e(a,b){return b(),_}var f=b.prototype;return f.catchException=f["catch"]=function(a){return new mb(this,a)},f.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},f.schedulePeriodicWithState=function(b,c,d){var e=b,f=a.setInterval(function(){e=d(e)},c);return $(function(){a.clearInterval(f)})},f.schedule=function(a){return this._schedule(a,e)},f.scheduleWithState=function(a,b){return this._schedule(a,b)},f.scheduleWithRelative=function(a,b){return this._scheduleRelative(b,a,e)},f.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},f.scheduleWithAbsolute=function(a,b){return this._scheduleAbsolute(b,a,e)},f.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},f.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},f.scheduleRecursiveWithState=function(a,b){return this.scheduleWithState({first:a,second:b},function(a,b){return c(a,b)})},f.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,function(a,b){a(function(c){b(a,c)})})},f.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative({first:a,second:c},b,function(a,b){return d(a,b,"scheduleWithRelativeAndState")})},f.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,function(a,b){a(function(c){b(a,c)})})},f.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute({first:a,second:c},b,function(a,b){return d(a,b,"scheduleWithAbsoluteAndState")})},b.now=x,b.normalize=function(a){return 0>a&&(a=0),a},b}();w.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 ab;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}();var hb,ib="Scheduler is not allowed to block the thread",jb=gb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){if(b>0)throw new Error(ib);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new gb(x,a,b,c)}(),kb=gb.currentThread=function(){function a(){e=new V(4)}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f,g=this.now()+gb.normalize(c),h=new fb(this,b,d,g);if(e)e.enqueue(h);else{f=new a;try{e.enqueue(h),f.run()}catch(i){throw i}finally{f.dispose()}}return h.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e;a.prototype.dispose=function(){e=null},a.prototype.run=function(){for(var a;e.length>0;)if(a=e.dequeue(),!a.isCancelled()){for(;a.dueTime-gb.now()>0;);a.isCancelled()||a.invoke()}};var f=new gb(x,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),lb=c;!function(){function b(){if(!a.postMessage||a.importScripts)return!1;var b=!1,c=a.onmessage;return a.onmessage=function(){b=!0},a.postMessage("","*"),a.onmessage=c,b}function c(a){if("string"==typeof a.data&&a.data.substring(0,d.length)===d){var b=a.data.substring(d.length),c=e[b];c(),delete e[b]}}if("function"==typeof a.setImmediate)hb=a.setImmediate,lb=clearImmediate;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))hb=process.nextTick;else if(b()){var d="ms.rx.schedule"+Math.random(),e={},f=0;a.addEventListener?a.addEventListener("message",c,!1):a.attachEvent("onmessage",c,!1),hb=function(b){var c=f++;e[c]=b,a.postMessage(d+c,"*")}}else if(a.MessageChannel){var g=new a.MessageChannel,h={},i=0;g.port1.onmessage=function(a){var b=a.data,c=h[b];c(),delete h[b]},hb=function(a){var b=i++;h[b]=a,g.port2.postMessage(b)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?hb=function(b){var c=a.document.createElement("script");c.onreadystatechange=function(){b(),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},a.document.documentElement.appendChild(c)}:(hb=function(b){return a.setTimeout(b,0)},lb=a.clearTimeout)}(),gb.timeout=function(){function b(a,b){var c=this,d=new ab,e=hb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new X(d,$(function(){lb(e)}))}function c(b,c,d){var e=this,f=gb.normalize(c);if(0===f)return e.scheduleWithState(b,d);var g=new ab,h=a.setTimeout(function(){g.isDisposed||g.setDisposable(d(e,b))},f);return new X(g,$(function(){a.clearTimeout(h)}))}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new gb(x,b,c,d)}();var mb=function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return R(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.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 _}}},f.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},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new ab;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},f}(gb),nb=w.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}var b=a.prototype;return b.accept=function(a,b,c){return 1===arguments.length&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},b.toObservable=function(a){var b=this;return a||(a=jb),new Pb(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),ob=nb.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 nb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),pb=nb.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 nb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),qb=nb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new nb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),rb=w.Internals.Enumerator=function(a,b,c){this.moveNext=a,this.getCurrent=b,this.dispose=c},sb=rb.create=function(a,b,d){var e=!1;return d||(d=c),new rb(function(){if(e)return!1;var b=a();return b||(e=!0,d()),b},function(){return b()},function(){e||(d(),e=!0)})},tb=w.Internals.Enumerable=function(){function a(a){this.getEnumerator=a}return a.prototype.concat=function(){var a=this;return new Pb(function(b){var c=a.getEnumerator(),d=!1,e=new cb,f=jb.scheduleRecursive(function(a){var f,g,h=!1;if(!d){try{h=c.moveNext(),h?f=c.getCurrent():c.dispose()}catch(i){g=i,c.dispose()}if(g)return b.onError(g),void 0;if(!h)return b.onCompleted(),void 0;var j=new ab;e.setDisposable(j),j.setDisposable(f.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new X(e,f,$(function(){d=!0,c.dispose()}))})},a.prototype.catchException=function(){var a=this;return new Pb(function(b){var c,d=a.getEnumerator(),e=!1,f=new cb,g=jb.scheduleRecursive(function(a){var g,h,i;if(i=!1,!e){try{i=d.moveNext(),i&&(g=d.getCurrent())}catch(j){h=j}if(h)return b.onError(h),void 0;if(!i)return c?b.onError(c):b.onCompleted(),void 0;var k=new ab;f.setDisposable(k),k.setDisposable(g.subscribe(b.onNext.bind(b),function(b){c=b,a()},b.onCompleted.bind(b)))}});return new X(f,g,$(function(){e=!0}))})},a}(),ub=tb.repeat=function(a,c){return c===b&&(c=-1),new tb(function(){var b,d=c;return sb(function(){return 0===d?!1:(d>0&&d--,b=a,!0)},function(){return b})})},vb=tb.forEach=function(a,b){return b||(b=d),new tb(function(){var c,d=-1;return sb(function(){return++d<a.length?(c=b(a[d],d),!0):!1},function(){return c})})},wb=w.Observer=function(){};wb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},wb.prototype.asObserver=function(){return new Ab(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},wb.prototype.checked=function(){return new Bb(this)};var xb=wb.create=function(a,b,d){return a||(a=c),b||(b=h),d||(d=c),new Ab(a,b,d)};wb.fromNotifier=function(a){return new Ab(function(b){return a(ob(b))},function(b){return a(pb(b))},function(){return a(qb())})},wb.notifyOn=function(a){return new Db(a,this)};var yb,zb=w.Internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return R(b,a),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}(wb),Ab=w.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return R(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}(zb),Bb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}R(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}(wb),Cb=w.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 cb}return R(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 b.isAcquired=!1,void 0;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}(zb),Db=function(a){function b(){a.apply(this,arguments)}return R(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}(Cb),Eb=w.Observable=function(){function a(a){this._subscribe=a}return yb=a.prototype,yb.finalValue=function(){var a=this;return new Pb(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(y))})})},yb.subscribe=yb.forEach=function(a,b,c){var d;return d="object"==typeof a?a:xb(a,b,c),this._subscribe(d)},yb.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}();yb.observeOn=function(a){var b=this;return new Pb(function(c){return b.subscribe(new Db(a,c))})},yb.subscribeOn=function(a){var b=this;return new Pb(function(c){var d=new ab,e=new cb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new p(a,b.subscribe(c)))})),e})},Eb.create=Eb.createWithDisposable=function(a){return new Pb(a)},Eb.defer=function(a){return new Pb(function(b){var c;try{c=a()}catch(d){return Jb(d).subscribe(b)}return c.subscribe(b)})};var Fb=Eb.empty=function(a){return a||(a=jb),new Pb(function(b){return a.schedule(function(){b.onCompleted()})})},Gb=Eb.fromArray=function(a,b){return b||(b=kb),new Pb(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Eb.generate=function(a,b,c,d,e){return e||(e=kb),new Pb(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 f.onError(j),void 0}e?(f.onNext(i),a()):f.onCompleted()})})};var Hb=Eb.never=function(){return new Pb(function(){return _})};Eb.range=function(a,b,c){return c||(c=kb),new Pb(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Eb.repeat=function(a,b,c){return c||(c=kb),null==b&&(b=-1),Ib(a,c).repeat(b)};var Ib=Eb["return"]=Eb.returnValue=function(a,b){return b||(b=jb),new Pb(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Jb=Eb["throw"]=Eb.throwException=function(a,b){return b||(b=jb),new Pb(function(c){return b.schedule(function(){c.onError(a)})})};Eb.using=function(a,b){return new Pb(function(c){var d,e,f=_;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new X(Jb(g).subscribe(c),f)}return new X(e.subscribe(c),f)})},yb.amb=function(a){var b=this;return new Pb(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new ab,j=new ab;return 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 X(i,j)})},Eb.amb=function(){function a(a,b){return a.amb(b)}for(var b=Hb(),c=n(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},yb["catch"]=yb.catchException=function(a){return"function"==typeof a?q(this,a):Kb([this,a])};var Kb=Eb.catchException=Eb["catch"]=function(){var a=n(arguments,0);return vb(a).catchException()};yb.combineLatest=function(){var a=Q.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Lb.apply(this,a)};var Lb=Eb.combineLatest=function(){var a=Q.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Pb(function(c){function e(a){var e;if(i[a]=!0,j||(j=i.every(d))){try{e=b.apply(null,l)}catch(f){return c.onError(f),void 0}c.onNext(e)}else k.filter(function(b,c){return c!==a}).every(d)&&c.onCompleted()}function f(a){k[a]=!0,k.every(d)&&c.onCompleted()}for(var g=function(){return!1},h=a.length,i=o(h,g),j=!1,k=o(h,g),l=new Array(h),m=new Array(h),n=0;h>n;n++)!function(b){m[b]=new ab,m[b].setDisposable(a[b].subscribe(function(a){l[b]=a,e(b)},c.onError.bind(c),function(){f(b)}))}(n);return new X(m)})};yb.concat=function(){var a=Q.call(arguments,0);return a.unshift(this),Mb.apply(this,a)};var Mb=Eb.concat=function(){var a=n(arguments,0);return vb(a).concat()};yb.concatObservable=yb.concatAll=function(){return this.merge(1)},yb.merge=function(a){if("number"!=typeof a)return Nb(this,a);var b=this;return new Pb(function(c){var d=0,e=new X,f=!1,g=[],h=function(a){var b=new ab;e.add(b),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){var a;e.remove(b),g.length>0?(a=g.shift(),h(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,h(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var Nb=Eb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Q.call(arguments,1)):(a=jb,b=Q.call(arguments,0)):(a=jb,b=Q.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Gb(b,a).mergeObservable()};yb.mergeObservable=yb.mergeAll=function(){var a=this;return new Pb(function(b){var c=new X,d=!1,e=new ab;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new ab;c.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},yb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Ob([this,a])};var Ob=Eb.onErrorResumeNext=function(){var a=n(arguments,0);return new Pb(function(b){var c=0,d=new cb,e=jb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],g=new ab,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new X(d,e)})};yb.skipUntil=function(a){var b=this;return new Pb(function(c){var d=!1,e=new X(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new ab;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},yb["switch"]=yb.switchLatest=function(){var a=this;return new Pb(function(b){var c=!1,d=new cb,e=!1,f=0,g=a.subscribe(function(a){var g=new ab,h=++f;c=!0,d.setDisposable(g),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())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new X(g,d)})},yb.takeUntil=function(a){var b=this;return new Pb(function(d){return new X(b.subscribe(d),a.subscribe(d.onCompleted.bind(d),d.onError.bind(d),c))})},yb.zip=function(){if(Array.isArray(arguments[0]))return r.apply(this,arguments);var a=this,b=Q.call(arguments),c=b.pop();return b.unshift(a),new Pb(function(e){function f(a){i[a]=!0,i.every(function(a){return a})&&e.onCompleted()}for(var g=b.length,h=o(g,function(){return[]}),i=o(g,function(){return!1}),j=function(b){var f,g;if(h.every(function(a){return a.length>0})){try{g=h.map(function(a){return a.shift()}),f=c.apply(a,g)}catch(j){return e.onError(j),void 0}e.onNext(f)}else i.filter(function(a,c){return c!==b}).every(d)&&e.onCompleted()},k=new Array(g),l=0;g>l;l++)!function(a){k[a]=new ab,k[a].setDisposable(b[a].subscribe(function(b){h[a].push(b),j(a)},e.onError.bind(e),function(){f(a)}))}(l);return new X(k)})},Eb.zip=function(){var a=Q.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Eb.zipArray=function(){var a=Q.call(arguments);return new Pb(function(b){function c(a){if(g.every(function(a){return a.length>0})){var c=g.map(function(a){return a.shift()});b.onNext(c)}else if(h.filter(function(b,c){return c!==a}).every(d))return b.onCompleted(),void 0}function e(a){return h[a]=!0,h.every(d)?(b.onCompleted(),void 0):void 0}for(var f=a.length,g=o(f,function(){return[]}),h=o(f,function(){return!1}),i=new Array(f),j=0;f>j;j++)!function(d){i[d]=new ab,i[d].setDisposable(a[d].subscribe(function(a){g[d].push(a),c(d)},b.onError.bind(b),function(){e(d)}))}(j);var k=new X(i);return k.add($(function(){for(var a=0,b=g.length;b>a;a++)g[a]=[]})),k})},yb.asObservable=function(){var a=this;return new Pb(function(b){return a.subscribe(b)})},yb.bufferWithCount=function(a,b){return 1===arguments.length&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},yb.dematerialize=function(){var a=this;return new Pb(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},yb.distinctUntilChanged=function(a,b){var c=this;return a||(a=d),b||(b=e),new Pb(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return d.onError(i),void 0}if(f)try{h=b(e,g)}catch(i){return d.onError(i),void 0}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},yb["do"]=yb.doAction=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Pb(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b){try{b(c)}catch(d){a.onError(d)}a.onError(c)}else a.onError(c)},function(){if(c){try{c()}catch(b){a.onError(b)}a.onCompleted()}else a.onCompleted()})})},yb["finally"]=yb.finallyAction=function(a){var b=this;return new Pb(function(c){var d=b.subscribe(c);return $(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},yb.ignoreElements=function(){var a=this;return new Pb(function(b){return a.subscribe(c,b.onError.bind(b),b.onCompleted.bind(b))})},yb.materialize=function(){var a=this;return new Pb(function(b){return a.subscribe(function(a){b.onNext(ob(a))},function(a){b.onNext(pb(a)),b.onCompleted()},function(){b.onNext(qb()),b.onCompleted()})})},yb.repeat=function(a){return ub(this,a).concat()},yb.retry=function(a){return ub(this,a).catchException()},yb.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 Pb(function(e){var f,g,h;return d.subscribe(function(d){try{h||(h=!0),f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return e.onError(i),void 0}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},yb.skipLast=function(a){var b=this;return new Pb(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},yb.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=jb,a=Q.call(arguments,c),vb([Gb(a,b),this]).concat()},yb.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Gb(a,b)})},yb.takeLastBuffer=function(a){var b=this;return new Pb(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},yb.windowWithCount=function(a,b){var c=this;if(0>=a)throw new Error(z);if(1===arguments.length&&(b=a),0>=b)throw new Error(z);return new Pb(function(d){var e=new ab,f=new eb(e),g=0,h=[],i=function(){var a=new Tb;h.push(a),d.onNext(T(a,f))};return i(),e.setDisposable(c.subscribe(function(c){for(var d,e=0,f=h.length;f>e;e++)h[e].onNext(c);var j=g-a+1;j>=0&&0===j%b&&(d=h.shift(),d.onCompleted()),g++,0===g%b&&i()},function(a){for(;h.length>0;)h.shift().onError(a);d.onError(a)},function(){for(;h.length>0;)h.shift().onCompleted();d.onCompleted()})),f})},yb.defaultIfEmpty=function(a){var c=this;return a===b&&(a=null),new Pb(function(b){var d=!1;return c.subscribe(function(a){d=!0,b.onNext(a)},b.onError.bind(b),function(){d||b.onNext(a),b.onCompleted()})})},yb.distinct=function(a,b){var c=this;return a||(a=d),b||(b=g),new Pb(function(d){var e={};return c.subscribe(function(c){var f,g,h,i=!1;try{f=a(c),g=b(f)}catch(j){return d.onError(j),void 0}for(h in e)if(g===h){i=!0;break}i||(e[g]=null,d.onNext(c))
},d.onError.bind(d),d.onCompleted.bind(d))})},yb.groupBy=function(a,b,c){return this.groupByUntil(a,b,function(){return Hb()},c)},yb.groupByUntil=function(a,b,e,f){var h=this;return b||(b=d),f||(f=g),new Pb(function(d){var g={},i=new X,j=new eb(i);return i.add(h.subscribe(function(h){var k,l,m,n,o,p,q,r,s,t;try{p=a(h),q=f(p)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}n=!1;try{s=g[q],s||(s=new Tb,g[q]=s,n=!0)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}if(n){o=new Rb(p,s,j),l=new Rb(p,s);try{k=e(l)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}d.onNext(o),r=new ab,i.add(r);var v=function(){q in g&&(delete g[q],s.onCompleted()),i.remove(r)};r.setDisposable(k.take(1).subscribe(c,function(a){for(t in g)g[t].onError(a);d.onError(a)},function(){v()}))}try{m=b(h)}catch(u){for(t in g)g[t].onError(u);return d.onError(u),void 0}s.onNext(m)},function(a){for(var b in g)g[b].onError(a);d.onError(a)},function(){for(var a in g)g[a].onCompleted();d.onCompleted()})),j})},yb.select=yb.map=function(a,b){var c=this;return new Pb(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},yb.pluck=function(a){return this.select(function(b){return b[a]})},yb.selectMany=yb.flatMap=function(a,b){return b?this.selectMany(function(c){return a(c).select(function(a){return b(c,a)})}):"function"==typeof a?s.call(this,a):s.call(this,function(){return a})},yb.selectSwitch=yb.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},yb.skip=function(a){if(0>a)throw new Error(z);var b=this;return new Pb(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},yb.skipWhile=function(a,b){var c=this;return new Pb(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},yb.take=function(a,b){if(0>a)throw new Error(z);if(0===a)return Fb(b);var c=this;return new Pb(function(b){var d=a;return c.subscribe(function(a){d>0&&(d--,b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},yb.takeWhile=function(a,b){var c=this;return new Pb(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},yb.where=yb.filter=function(a,b){var c=this;return new Pb(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})};var Pb=w.Internals.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=_:"function"==typeof a&&(a=$(a)),a}function c(d){function e(a){var c=new Qb(a);if(kb.scheduleRequired())kb.schedule(function(){try{c.setDisposable(b(d(c)))}catch(a){if(!c.fail(a))throw a}});else try{c.setDisposable(b(d(c)))}catch(e){if(!c.fail(e))throw e}return c}return this instanceof c?(a.call(this,e),void 0):new c(d)}return R(c,a),c}(Eb),Qb=function(a){function b(b){a.call(this),this.observer=b,this.m=new ab}R(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(zb),Rb=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Pb(function(a){return new X(e.getDisposable(),d.subscribe(a))}):d}return R(c,a),c}(Eb),Sb=function(a,b){this.subject=a,this.observer=b};Sb.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 Tb=w.Subject=function(a){function b(a){return i.call(this),this.isStopped?this.exception?(a.onError(this.exception),_):(a.onCompleted(),_):(this.observers.push(a),new Sb(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return R(c,a),S(c.prototype,wb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(i.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(i.call(this),!this.isStopped)for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),c.create=function(a,b){return new Ub(a,b)},c}(Eb);w.AsyncSubject=function(a){function b(a){if(i.call(this),!this.isStopped)return this.observers.push(a),new Sb(this,a);var b=this.exception,c=this.hasValue,d=this.value;return b?a.onError(b):c?(a.onNext(d),a.onCompleted()):a.onCompleted(),_}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return R(c,a),S(c.prototype,wb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){var a,b,c;if(i.call(this),!this.isStopped){var d=this.observers.slice(0);this.isStopped=!0;var e=this.value,f=this.hasValue;if(f)for(b=0,c=d.length;c>b;b++)a=d[b],a.onNext(e),a.onCompleted();else for(b=0,c=d.length;c>b;b++)d[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){i.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),c}(Eb);var Ub=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){a.call(this,b),this.observer=c,this.observable=d}return R(c,a),S(c.prototype,wb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Eb);return"function"==typeof define&&"object"==typeof define.amd&&define.amd?(a.Rx=w,define(function(){return w})):(t?"object"==typeof module&&module&&module.exports==t?module.exports=w:t=w:a.Rx=w,void 0)}(this);

@@ -22,3 +22,3 @@ var Rx = require('./rx');

*
* @param {Function} function Function to convert to an asynchronous function.
* @param {Function} func Function to convert to an asynchronous function.
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.

@@ -53,3 +53,3 @@ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.

*
* @param {EventEmitter} eventEmiiter The EventEmitter to subscribe to the given event.
* @param {EventEmitter} eventEmitter The EventEmitter to subscribe to the given event.
* @param {String} eventName The event name to subscribe

@@ -66,3 +66,3 @@ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.

* The errors are handled on the 'error' event and completion on the 'end' event.
* @param {Observable} The observable sequence to convert to an EventEmitter.
* @param {Observable} observable The observable sequence to convert to an EventEmitter.
* @param {String} eventName The event name to emit onNext calls.

@@ -69,0 +69,0 @@ * @returns {EventEmitter} An EventEmitter which emits the given eventName for each onNext call in addition to 'error' and 'end' events.

@@ -102,4 +102,2 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

*
* @static
* @memberOf Observable
* @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).

@@ -128,4 +126,2 @@ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.

*
* @static
* @memberOf Observable
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value.

@@ -258,3 +254,2 @@ * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.

*
* @memberOf Observable
* @param {Number} dueTime Duration of the throttle period for each value (specified as an integer denoting milliseconds).

@@ -308,3 +303,2 @@ * @param {Scheduler} [scheduler] Scheduler to run the throttle timers on. If not specified, the timeout scheduler is used.

*
* @memberOf Observable#
* @param {Number} timeSpan Length of each window (specified as an integer denoting milliseconds).

@@ -481,3 +475,2 @@ * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive windows (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent windows.

*
* @memberOf Observable#
* @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds).

@@ -499,3 +492,2 @@ * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers.

*
* @memberOf Observable#
* @param {Number} timeSpan Maximum time length of a buffer.

@@ -519,3 +511,2 @@ * @param {Number} count Maximum element count of a buffer.

*
* @memberOf Observable#
* @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used.

@@ -547,3 +538,2 @@ * @returns {Observable} An observable sequence with time interval information on values.

*
* @memberOf Observable#
* @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used.

@@ -597,3 +587,2 @@ * @returns {Observable} An observable sequence with timestamp information on values.

*
* @memberOf Observable#
* @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.

@@ -622,3 +611,2 @@ * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.

*
* @memberOf Observable#
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.

@@ -693,7 +681,5 @@ * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.

* function (x) { return x; },
* function (x) { return new Date();
* function (x) { return new Date(); }
* });
*
* @static
* @memberOf Observable
* @param {Mixed} initialState Initial state.

@@ -754,4 +740,2 @@ * @param {Function} condition Condition to terminate generation (upon returning false).

*
* @static
* @memberOf Observable
* @param {Mixed} initialState Initial state.

@@ -808,3 +792,2 @@ * @param {Function} condition Condition to terminate generation (upon returning false).

*
* @memberOf Observable#
* @param {Number} dueTime Absolute or relative time to perform the subscription at.

@@ -825,4 +808,3 @@ * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.

* 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
*
* @memberOf Observable#
*
* @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.

@@ -892,3 +874,2 @@ * @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.

*
* @memberOf Observable#
* @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never().

@@ -973,3 +954,2 @@ * @param {Function} [timeoutDurationSelector] Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.

*
* @memberOf Observable#
* @param {Function} throttleDurationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element.

@@ -1035,3 +1015,2 @@ * @returns {Observable} The throttled sequence.

* result sequence. This causes elements to be delayed with duration.
* @memberOf Observable#
* @param {Number} duration Duration for skipping elements from the end of the sequence.

@@ -1071,3 +1050,2 @@ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout

* result sequence. This causes elements to be delayed with duration.
* @memberOf Observable#
* @param {Number} duration Duration for taking elements from the end of the sequence.

@@ -1091,3 +1069,2 @@ * @param {Scheduler} [timerScheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.

* result sequence. This causes elements to be delayed with duration.
* @memberOf Observable#
* @param {Number} duration Duration for taking elements from the end of the sequence.

@@ -1133,3 +1110,2 @@ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.

* result sequence. This causes elements to be delayed with duration.
* @memberOf Observable#
* @param {Number} duration Duration for taking elements from the start of the sequence.

@@ -1162,4 +1138,3 @@ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.

*
* Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration.
* @memberOf Observable#
* Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration.
* @param {Number} duration Duration for skipping elements from the start of the sequence.

@@ -1191,3 +1166,2 @@ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.

* 1 - res = source.skipUntilWithTime(new Date(), [optional scheduler]);
* @memberOf Obseravble#
* @param startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped.

@@ -1218,3 +1192,2 @@ * @param scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.

* 1 - res = source.takeUntilWithTime(new Date(), [optional scheduler]);
* @memberOf Observable#
* @param {Number} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately.

@@ -1221,0 +1194,0 @@ * @param {Scheduler} scheduler Scheduler to run the timer on.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc