ix
Version:
The Interactive Extensions for JavaScript
74 lines (72 loc) • 171 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['Ix'], factory) :
(factory(global.Ix = global.Ix || {}));
}(this, (function (exports) {/*
*****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
*****************************************************************************/
'use strict';function aa(c,a){aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return aa(c,a)}function n(c,a){function b(){this.constructor=c}aa(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}
function q(c,a){var b=void 0;return new (b||(b=Promise))(function(g,d){function e(c){try{h(a.next(c))}catch(l){d(l)}}function f(c){try{h(a["throw"](c))}catch(l){d(l)}}function h(a){a.done?g(a.value):(new b(function(c){c(a.value)})).then(e,f)}h((a=a.apply(c,[])).next())})}
function t(c,a){function b(a){return function(c){return g([a,c])}}function g(b){if(e)throw new TypeError("Generator is already executing.");for(;d;)try{if(e=1,f&&(h=b[0]&2?f["return"]:b[0]?f["throw"]||((h=f["return"])&&h.call(f),0):f.next)&&!(h=h.call(f,b[1])).done)return h;if(f=0,h)b=[b[0]&2,h.value];switch(b[0]){case 0:case 1:h=b;break;case 4:return d.label++,{value:b[1],done:!1};case 5:d.label++;f=b[1];b=[0];continue;case 7:b=d.ra.pop();d.c.pop();continue;default:if(!(h=d.c,h=0<h.length&&h[h.length-
1])&&(6===b[0]||2===b[0])){d=0;continue}if(3===b[0]&&(!h||b[1]>h[0]&&b[1]<h[3]))d.label=b[1];else if(6===b[0]&&d.label<h[1])d.label=h[1],h=b;else if(h&&d.label<h[2])d.label=h[2],d.ra.push(b);else{h[2]&&d.ra.pop();d.c.pop();continue}}b=a.call(c,d)}catch(m){b=[6,m],f=0}finally{e=h=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}var d={label:0,a:function(){if(h[0]&1)throw h[1];return h[1]},c:[],ra:[]},e,f,h,k;return k={next:b(0),"throw":b(1),"return":b(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=
function(){return this}),k}function u(c){var a="function"===typeof Symbol&&c[Symbol.iterator],b=0;return a?a.call(c):{next:function(){c&&b>=c.length&&(c=void 0);return{value:c&&c[b++],done:!c}}}}function v(c,a){var b="function"===typeof Symbol&&c[Symbol.iterator];if(!b)return c;c=b.call(c);var g,d=[];try{for(;(void 0===a||0<a--)&&!(g=c.next()).done;)d.push(g.value)}catch(f){var e={error:f}}finally{try{g&&!g.done&&(b=c["return"])&&b.call(c)}finally{if(e)throw e.error;}}return d}
function x(){for(var c=[],a=0;a<arguments.length;a++)c=c.concat(v(arguments[a]));return c}function y(c){return this instanceof y?(this.Ba=c,this):new y(c)}
function z(c,a,b){function g(a){k[a]&&(l[a]=function(c){return new Promise(function(b,g){1<m.push([a,c,b,g])||d(a,c)})})}function d(a,c){try{var b=k[a](c);b.value instanceof y?Promise.resolve(b.value.Ba).then(e,f):h(m[0][2],b)}catch(A){h(m[0][3],A)}}function e(a){d("next",a)}function f(a){d("throw",a)}function h(a,c){(a(c),m.shift(),m.length)&&d(m[0][0],m[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var k=b.apply(c,a||[]),l,m=[];return l={},g("next"),
g("throw"),g("return"),l[Symbol.asyncIterator]=function(){return this},l}function ba(c){function a(a,e){b[a]=c[a]?function(b){return(g=!g)?{value:y(c[a](b)),done:"return"===a}:e?e(b):b}:e}var b,g;return b={},a("next"),a("throw",function(a){throw a;}),a("return"),b[Symbol.iterator]=function(){return this},b}
function B(c){function a(a){d[a]=c[a]&&function(g){return new Promise(function(d,e){g=c[a](g);b(d,e,g.done,g.value)})}}function b(a,c,b,g){Promise.resolve(g).then(function(c){a({value:c,done:b})},c)}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=c[Symbol.asyncIterator],d;return g?g.call(c):(c="function"===typeof u?u(c):c[Symbol.iterator](),d={},a("next"),a("throw"),a("return"),d[Symbol.asyncIterator]=function(){return this},d)};function C(c,a,b){if("undefined"===typeof a)return c;switch(b){case 0:return function(){return c.call(a)};case 1:return function(b){return c.call(a,b)};case 2:return function(b,d){return c.call(a,b,d)};case 3:return function(b,d,e){return c.call(a,b,d,e)}}return function(){return c.apply(a,arguments)}};function E(c){return c}function F(c){return q(this,function(){return t(this,function(){return[2,c]})})};function ca(c){c=Number(c);return isNaN(c)?0:0!==c&&isFinite(c)?(0<c?1:-1)*Math.floor(Math.abs(c)):c};var da=Math.pow(2,53)-1;function H(c){return"function"===typeof c}function I(c){return null!=c&&Object(c)===c}function ea(c){return I(c)&&"number"===typeof c.length}function J(c){return I(c)&&H(c[Symbol.iterator])}function ja(c){return I(c)&&!H(c[Symbol.iterator])&&H(c.next)}function ka(c){return I(c)&&H(c.pipe)&&H(c._read)&&"boolean"===typeof c.readable&&I(c._readableState)}function la(c){return I(c)&&H(c.end)&&H(c._write)&&"boolean"===typeof c.writable&&I(c._writableState)};var K=function(){function c(){}c.prototype.forEach=function(a,c){var b;a=C(a,c,2);c=0;try{for(var d=u(this),e=d.next();!e.done;e=d.next())a(e.value,c++)}catch(h){var f={error:h}}finally{try{e&&!e.done&&(b=d.return)&&b.call(d)}finally{if(f)throw f.error;}}};c.prototype.pipe=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];b=-1;for(var g=a.length,d=this,e=c.as;++b<g;)d=e(a[b](d));return d};c.prototype.tee=function(){return this._getDOMStream().tee()};c.prototype.pipeTo=function(a,
c){return this._getDOMStream().pipeTo(a,c)};c.prototype.pipeThrough=function(a,c){return this._getDOMStream().pipeThrough(a,c)};c.prototype._getDOMStream=function(){return this.$||(this.$=this.publish().toDOMStream())};c.as=function(a){return a instanceof c?a:"string"===typeof a?new ma([a]):J(a)||ea(a)?new na(a,E):new ma([a])};c.from=function(a,c,g){void 0===c&&(c=E);var b;c=C(c,g,2);if(J(a)||ea(a))return new na(a,c);if(ja(a))return new na((b={},b[Symbol.iterator]=function(){return a},b),c);throw new TypeError("Input type not supported");
};c.of=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return new ma(a)};return c}(),na=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.g=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p;return t(this,function(b){switch(b.label){case 0:d=J(this.b);e=0;if(!d)return[3,9];b.label=1;case 1:b.c.push([1,6,7,8]),f=u(this.b),h=f.next(),b.label=2;case 2:if(h.done)return[3,5];k=h.value;return[4,this.g(k,e++)];case 3:b.a(),b.label=4;case 4:return h=
f.next(),[3,2];case 5:return[3,8];case 6:return l=b.a(),a={error:l},[3,8];case 7:try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error;}return[7];case 8:return[3,12];case 9:m=Math.min(Math.max(ca(this.b.length),0),da),b.label=10;case 10:if(!(e<m))return[3,12];p=this.b[e];return[4,this.g(p,e++)];case 11:return b.a(),[3,10];case 12:return[2]}})};return a}(K),ma=function(c){function a(a){var b=c.call(this)||this;b.s=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){return t(this,
function(a){switch(a.label){case 0:return[5,u(this.s)];case 1:return a.a(),[2]}})};return a}(K);
try{(function(c){if(!c){var a=K.as;K.prototype.pipe=function(){for(var c=[],g=0;g<arguments.length;g++)c[g]=arguments[g];var d=-1,e=c.length;g=this;for(var f;++d<e;)if(f=c[d],"function"===typeof f)g=a(f(g));else if(la(f)){c=(c[d+1]||{}).end;c=void 0===c?!0:c;ka(g)?g=g.pipe(f,{end:c}):(d=void 0,void 0===d&&(d=f.wa||{ya:!0}),g=g.Aa(d).pipe(f,{end:c}));break}return g}}})("object"===typeof window&&"object"===typeof document&&9===document.nodeType)}catch(c){};function oa(c,a){void 0===a&&(a=E);var b,g=0,d=0;try{for(var e=u(c),f=e.next();!f.done;f=e.next())g+=a(f.value),d++}catch(k){var h={error:k}}finally{try{f&&!f.done&&(b=e.return)&&b.call(e)}finally{if(h)throw h.error;}}if(0===d)throw Error("Empty collection");return g/d};var pa=function(c){function a(a,g,d){var b=c.call(this)||this;b.b=a;b.f=g;b.na=d;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r,w,A;return t(this,function(b){switch(b.label){case 0:f=[],h=0,b.label=1;case 1:b.c.push([1,7,8,9]),k=u(this.b),l=k.next(),b.label=2;case 2:if(l.done)return[3,6];m=l.value;0===h%this.na&&f.push([]);try{for(p=u(f),r=p.next();!r.done;r=p.next())w=r.value,w.push(m)}catch(G){d={error:G}}finally{try{r&&!r.done&&(e=p.return)&&e.call(p)}finally{if(d)throw d.error;
}}return 0<f.length&&f[0].length===this.f?[4,f.shift()]:[3,4];case 3:b.a(),b.label=4;case 4:h++,b.label=5;case 5:return l=k.next(),[3,2];case 6:return[3,9];case 7:return A=b.a(),a={error:A},[3,9];case 8:try{l&&!l.done&&(c=k.return)&&c.call(k)}finally{if(a)throw a.error;}return[7];case 9:return 0<f.length?[4,f.shift()]:[3,11];case 10:return b.a(),[3,9];case 11:return[2]}})};return a}(K);function qa(c,a,b){null==b&&(b=a);return new pa(c,a,b)};var ra=function(c){function a(a){var b=c.call(this)||this;b.g=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h;return t(this,function(b){switch(b.label){case 0:b.c.push([0,5,6,7]),d=u(this.g()),e=d.next(),b.label=1;case 1:if(e.done)return[3,4];f=e.value;return[4,f];case 2:b.a(),b.label=3;case 3:return e=d.next(),[3,1];case 4:return[3,7];case 5:return h=b.a(),a={error:h},[3,7];case 6:try{e&&!e.done&&(c=d.return)&&c.call(d)}finally{if(a)throw a.error;}return[7];case 7:return[2]}})};
return a}(K);function sa(c){return new ra(c)};var ta=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}n(a,c);a.prototype[Symbol.iterator]=function(){return t(this,function(){return[2]})};return a}(K);function L(){return new ta};function ua(c,a,b){void 0===b&&(b=L());return sa(function(){var g=c();return a.has(g)?a.get(g):b})};function N(c){"function"===typeof c.return&&c.return()}function va(c){return q(this,function(){return t(this,function(a){switch(a.label){case 0:return"function"!==typeof c.return?[3,2]:[4,c.return()];case 1:a.a(),a.label=2;case 2:return[2]}})})};var wa=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r,w,A;return t(this,function(b){switch(b.label){case 0:d=null,e=!1,b.label=1;case 1:b.c.push([1,8,9,10]),f=u(this.b),h=f.next(),b.label=2;case 2:if(h.done)return[3,7];k=h.value;l=k[Symbol.iterator]();d=null;e=!1;b.label=3;case 3:m={};try{p=l.next();r=p.done;w=p.value;if(r)return N(l),[3,5];m=w}catch(G){return d=G,e=!0,N(l),[3,5]}return[4,m];case 4:return b.a(),
[3,3];case 5:if(!e)return[3,7];b.label=6;case 6:return h=f.next(),[3,2];case 7:return[3,10];case 8:return A=b.a(),a={error:A},[3,10];case 9:try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error;}return[7];case 10:if(e)throw d;return[2]}})};return a}(K);function xa(c){for(var a=[],b=1;b<arguments.length;b++)a[b-1]=arguments[b];return new wa(x([c],a))}function ya(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return new wa(c)};var za=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.ia=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p;return t(this,function(b){switch(b.label){case 0:e=!1,f=this.b[Symbol.iterator](),b.label=1;case 1:h={};try{if(h=f.next(),h.done)return N(f),[3,3]}catch(w){return d=this.ia(w),e=!0,N(f),[3,3]}return[4,h.value];case 2:return b.a(),[3,1];case 3:if(!e)return[3,11];b.label=4;case 4:b.c.push([4,9,10,11]),k=u(d),l=k.next(),b.label=5;case 5:if(l.done)return[3,
8];m=l.value;return[4,m];case 6:b.a(),b.label=7;case 7:return l=k.next(),[3,5];case 8:return[3,11];case 9:return p=b.a(),a={error:p},[3,11];case 10:try{l&&!l.done&&(c=k.return)&&c.call(k)}finally{if(a)throw a.error;}return[7];case 11:return[2]}})};return a}(K);function Aa(c,a){return new za(c,a)};var Ba=function(c){function a(a){var b=c.call(this)||this;b.ma=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){return this.ma[Symbol.iterator]()};return a}(K);function Ca(c,a){return new Ba(a(c))};var Da=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h;return t(this,function(b){switch(b.label){case 0:b.c.push([0,5,6,7]),d=u(this.b),e=d.next(),b.label=1;case 1:if(e.done)return[3,4];f=e.value;return[5,u(f)];case 2:b.a(),b.label=3;case 3:return e=d.next(),[3,1];case 4:return[3,7];case 5:return h=b.a(),a={error:h},[3,7];case 6:try{e&&!e.done&&(c=d.return)&&c.call(d)}finally{if(a)throw a.error;}return[7];case 7:return[2]}})};
return a}(K);function Ea(c){for(var a=[],b=1;b<arguments.length;b++)a[b-1]=arguments[b];return new Da(x([c],a))}function Fa(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return new Da(c)};function Ga(c){return new Da(c)};function Ha(c,a){void 0===a&&(a=function(){return!0});var b,g=0;try{for(var d=u(c),e=d.next();!e.done;e=d.next())a(e.value)&&g++}catch(h){var f={error:h}}finally{try{e&&!e.done&&(b=d.return)&&b.call(d)}finally{if(f)throw f.error;}}return g};var Ia=function(c){function a(a){var b=c.call(this)||this;b.g=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){return this.g()};return a}(K);function Ja(c){return new Ia(c)};var Ka=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.ca=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k;return t(this,function(b){switch(b.label){case 0:d=1,b.label=1;case 1:b.c.push([1,6,7,8]),e=u(this.b),f=e.next(),b.label=2;case 2:if(f.done)return[3,5];h=f.value;d=2;return[4,h];case 3:b.a(),b.label=4;case 4:return f=e.next(),[3,2];case 5:return[3,8];case 6:return k=b.a(),a={error:k},[3,8];case 7:try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error;
}return[7];case 8:return 1!==d?[3,10]:[4,this.ca];case 9:b.a(),b.label=10;case 10:return[2]}})};return a}(K);function La(c,a){return new Ka(c,a)};function Ma(c,a,b){for(var g=0,d=c.length;g<d;g++)if(b(a,c[g]))return g;return-1}function Na(c,a,b){return q(this,function(){var g,d;return t(this,function(e){switch(e.label){case 0:g=0,d=c.length,e.label=1;case 1:return g<d?[4,b(a,c[g])]:[3,4];case 2:if(e.a())return[2,g];e.label=3;case 3:return g++,[3,1];case 4:return[2,-1]}})})};function O(c,a){return c===a||"number"===typeof c&&"number"===typeof a&&isNaN(c)&&isNaN(a)}function P(c,a){return q(this,function(){return t(this,function(){return[2,c===a||"number"===typeof c&&"number"===typeof a&&isNaN(c)&&isNaN(a)]})})};var Oa=function(c){function a(a,g,d){var b=c.call(this)||this;b.b=a;b.l=g;b.M=d;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l;return t(this,function(b){switch(b.label){case 0:d=[],b.label=1;case 1:b.c.push([1,6,7,8]),e=u(this.b),f=e.next(),b.label=2;case 2:if(f.done)return[3,5];h=f.value;k=this.l(h);if(-1!==Ma(d,k,this.M))return[3,4];d.push(k);return[4,h];case 3:b.a(),b.label=4;case 4:return f=e.next(),[3,2];case 5:return[3,8];case 6:return l=b.a(),a={error:l},[3,8];
case 7:try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error;}return[7];case 8:return[2]}})};return a}(K);function Pa(c,a,b){void 0===a&&(a=E);void 0===b&&(b=O);return new Oa(c,a,b)};var Qa=function(c){function a(a,g,d){var b=c.call(this)||this;b.b=a;b.l=g;b.h=d;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p;return t(this,function(b){switch(b.label){case 0:d={},e=!1,b.label=1;case 1:b.c.push([1,6,7,8]),f=u(this.b),h=f.next(),b.label=2;case 2:if(h.done)return[3,5];k=h.value;l=this.l(k);m=!1;e&&(m=this.h(d,l));if(e&&m)return[3,4];e=!0;d=l;return[4,k];case 3:b.a(),b.label=4;case 4:return h=f.next(),[3,2];case 5:return[3,8];case 6:return p=b.a(),a=
{error:p},[3,8];case 7:try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error;}return[7];case 8:return[2]}})};return a}(K);function Ra(c,a,b){void 0===a&&(a=E);void 0===b&&(b=O);return new Qa(c,a,b)};var Sa=function(c){function a(a,g){var b=c.call(this)||this;b.B=a;b.b=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){return t(this,function(a){switch(a.label){case 0:return this.B()?[5,u(this.b)]:[3,2];case 1:return a.a(),[3,0];case 2:return[2]}})};return a}(K);function Ta(c,a){return new Sa(c,a)};function Ua(c,a){return Fa(c,Ta(a,c))};function Va(c,a){var b;try{for(var g=u(c),d=g.next();!d.done;d=g.next()){var e=d.value;if(0===a)return e;a--}}catch(h){var f={error:h}}finally{try{d&&!d.done&&(b=g.return)&&b.call(g)}finally{if(f)throw f.error;}}};var Wa=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.s=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r,w;return t(this,function(b){switch(b.label){case 0:b.c.push([0,5,6,7]),f=u(this.b),h=f.next(),b.label=1;case 1:if(h.done)return[3,4];k=h.value;return[4,k];case 2:b.a(),b.label=3;case 3:return h=f.next(),[3,1];case 4:return[3,7];case 5:return l=b.a(),a={error:l},[3,7];case 6:try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error;}return[7];
case 7:b.c.push([7,12,13,14]),m=u(this.s),p=m.next(),b.label=8;case 8:if(p.done)return[3,11];r=p.value;return[4,r];case 9:b.a(),b.label=10;case 10:return p=m.next(),[3,8];case 11:return[3,14];case 12:return w=b.a(),d={error:w},[3,14];case 13:try{p&&!p.done&&(e=m.return)&&e.call(m)}finally{if(d)throw d.error;}return[7];case 14:return[2]}})};return a}(K);function Xa(c){for(var a=[],b=1;b<arguments.length;b++)a[b-1]=arguments[b];return new Wa(c,a)};function Ya(c,a){var b,g=0;try{for(var d=u(c),e=d.next();!e.done;e=d.next())if(!a(e.value,g++))return!1}catch(h){var f={error:h}}finally{try{e&&!e.done&&(b=d.return)&&b.call(d)}finally{if(f)throw f.error;}}return!0};var Za=function(c){function a(a,g,d){var b=c.call(this)||this;b.F=a;b.K=g;b.h=d;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r,w;return t(this,function(b){switch(b.label){case 0:f=[];try{for(h=u(this.K),k=h.next();!k.done;k=h.next())l=k.value,f.push(l)}catch(D){a={error:D}}finally{try{k&&!k.done&&(c=h.return)&&c.call(h)}finally{if(a)throw a.error;}}b.label=1;case 1:b.c.push([1,6,7,8]),m=u(this.F),p=m.next(),b.label=2;case 2:if(p.done)return[3,5];r=p.value;if(-1!==
Ma(f,r,this.h))return[3,4];f.push(r);return[4,r];case 3:b.a(),b.label=4;case 4:return p=m.next(),[3,2];case 5:return[3,8];case 6:return w=b.a(),d={error:w},[3,8];case 7:try{p&&!p.done&&(e=m.return)&&e.call(m)}finally{if(d)throw d.error;}return[7];case 8:return[2]}})};return a}(K);function $a(c,a,b){void 0===b&&(b=O);return new Za(c,a,b)};var ab=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.g=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l;return t(this,function(b){switch(b.label){case 0:d=[this.b],b.label=1;case 1:if(!(0<d.length))return[3,10];e=d.shift();b.label=2;case 2:b.c.push([2,7,8,9]),f=u(e),h=f.next(),b.label=3;case 3:if(h.done)return[3,6];k=h.value;d.push(this.g(k));return[4,k];case 4:b.a(),b.label=5;case 5:return h=f.next(),[3,3];case 6:return[3,9];case 7:return l=b.a(),a={error:l},
[3,9];case 8:try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error;}return[7];case 9:return[3,1];case 10:return[2]}})};return a}(K);function bb(c,a){return new ab(c,a)};var cb=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.v=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k;return t(this,function(b){switch(b.label){case 0:d=0,b.label=1;case 1:b.c.push([1,6,7,8]),e=u(this.b),f=e.next(),b.label=2;case 2:if(f.done)return[3,5];h=f.value;return this.v(h,d++)?[4,h]:[3,4];case 3:b.a(),b.label=4;case 4:return f=e.next(),[3,2];case 5:return[3,8];case 6:return k=b.a(),a={error:k},[3,8];case 7:try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error;
}return[7];case 8:return[2]}})};return a}(K);function db(c,a,b){return new cb(c,C(a,b,2))};var eb=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.aa=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){return t(this,function(a){switch(a.label){case 0:return a.c.push([0,,2,3]),[5,u(this.b)];case 1:return a.a(),[3,3];case 2:return this.aa(),[7];case 3:return[2]}})};return a}(K);function fb(c,a){return new eb(c,a)};function gb(c,a,b){var g;if("function"!==typeof a)throw new TypeError;a=C(a,b,2);b=0;try{for(var d=u(c),e=d.next();!e.done;e=d.next()){var f=e.value;if(a(f,b++))return f}}catch(k){var h={error:k}}finally{try{e&&!e.done&&(g=d.return)&&g.call(d)}finally{if(h)throw h.error;}}};function hb(c,a,b){var g;if("function"!==typeof a)throw new TypeError;a=C(a,b,2);b=0;try{for(var d=u(c),e=d.next();!e.done;e=d.next())if(a(e.value,b++))return b}catch(h){var f={error:h}}finally{try{e&&!e.done&&(g=d.return)&&g.call(d)}finally{if(f)throw f.error;}}return-1};function ib(c,a){void 0===a&&(a=function(){return!0});var b,g=0;try{for(var d=u(c),e=d.next();!e.done;e=d.next()){var f=e.value;if(a(f,g++))return f}}catch(k){var h={error:k}}finally{try{e&&!e.done&&(b=d.return)&&b.call(d)}finally{if(h)throw h.error;}}};var jb=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.g=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r,w;return t(this,function(b){switch(b.label){case 0:b.c.push([0,11,12,13]),f=u(this.b),h=f.next(),b.label=1;case 1:if(h.done)return[3,10];k=h.value;b.label=2;case 2:b.c.push([2,7,8,9]),l=u(this.g(k)),m=l.next(),b.label=3;case 3:if(m.done)return[3,6];p=m.value;return[4,p];case 4:b.a(),b.label=5;case 5:return m=l.next(),[3,3];case 6:return[3,9];case 7:return r=
b.a(),d={error:r},[3,9];case 8:try{m&&!m.done&&(e=l.return)&&e.call(l)}finally{if(d)throw d.error;}return[7];case 9:return h=f.next(),[3,1];case 10:return[3,13];case 11:return w=b.a(),a={error:w},[3,13];case 12:try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error;}return[7];case 13:return[2]}})};return a}(K);function kb(c,a,b){return new jb(c,C(a,b,1))};var lb=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.da=g;return b}n(a,c);a.prototype.O=function(a,c){var b,g,f,h,k,l,m,p,r,w,A,D,G,M,fa,ha,ia;return t(this,function(d){switch(d.label){case 0:if(0!==c)return[3,9];d.label=1;case 1:d.c.push([1,6,7,8]),m=u(a),p=m.next(),d.label=2;case 2:if(p.done)return[3,5];r=p.value;return[4,r];case 3:d.a(),d.label=4;case 4:return p=m.next(),[3,2];case 5:return[3,8];case 6:return w=d.a(),b={error:w},[3,8];case 7:try{p&&!p.done&&(g=m.return)&&g.call(m)}finally{if(b)throw b.error;
}return[7];case 8:return[2,void 0];case 9:d.c.push([9,23,24,25]),A=u(a),D=A.next(),d.label=10;case 10:if(D.done)return[3,22];r=D.value;if(!J(r))return[3,19];d.label=11;case 11:d.c.push([11,16,17,18]),G=u(this.O(r,c-1)),M=G.next(),d.label=12;case 12:if(M.done)return[3,15];fa=M.value;return[4,fa];case 13:d.a(),d.label=14;case 14:return M=G.next(),[3,12];case 15:return[3,18];case 16:return ha=d.a(),k={error:ha},[3,18];case 17:try{M&&!M.done&&(l=G.return)&&l.call(G)}finally{if(k)throw k.error;}return[7];
case 18:return[3,21];case 19:return[4,r];case 20:d.a(),d.label=21;case 21:return D=A.next(),[3,10];case 22:return[3,25];case 23:return ia=d.a(),f={error:ia},[3,25];case 24:try{D&&!D.done&&(h=A.return)&&h.call(A)}finally{if(f)throw f.error;}return[7];case 25:return[2]}})};a.prototype[Symbol.iterator]=function(){return this.O(this.b,this.da)[Symbol.iterator]()};return a}(K);function mb(c,a){void 0===a&&(a=Infinity);return new lb(c,a)};var nb=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.m=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k;return t(this,function(b){switch(b.label){case 0:d=0,b.label=1;case 1:b.c.push([1,6,7,8]),e=u(this.b),f=e.next(),b.label=2;case 2:if(f.done)return[3,5];h=f.value;return[4,this.m(h,d++)];case 3:b.a(),b.label=4;case 4:return f=e.next(),[3,2];case 5:return[3,8];case 6:return k=b.a(),a={error:k},[3,8];case 7:try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error;
}return[7];case 8:return[2]}})};return a}(K);function Q(c,a,b){return new nb(c,C(a,b,2))};function ob(c,a){return Ga(Q(c,a))};var pb=function(c){function a(a,g,d,e){var b=c.call(this)||this;b.P=a;b.B=g;b.R=d;b.i=e;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a;return t(this,function(c){switch(c.label){case 0:a=this.P,c.label=1;case 1:return this.B(a)?[4,this.i(a)]:[3,4];case 2:c.a(),c.label=3;case 3:return a=this.R(a),[3,1];case 4:return[2]}})};return a}(K);function qb(c,a,b,g){return new pb(c,a,b,g)};function rb(c,a,b){var g,d=new Map;try{for(var e=u(c),f=e.next();!f.done;f=e.next()){var h=f.value,k=a(h),l=d.get(k);d.has(k)||(l=[],d.set(k,l));l.push(b(h))}}catch(p){var m={error:p}}finally{try{f&&!f.done&&(g=e.return)&&g.call(e)}finally{if(m)throw m.error;}}return d};var sb=function(c){function a(a,g){var b=c.call(this)||this;b.key=a;b.b=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){return this.b[Symbol.iterator]()};return a}(K),tb=function(c){function a(a,g,d,e){var b=c.call(this)||this;b.b=a;b.l=g;b.fa=d;b.i=e;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m;return t(this,function(b){switch(b.label){case 0:d=rb(this.b,this.l,this.fa),b.label=1;case 1:b.c.push([1,6,7,8]),e=u(d),f=e.next(),b.label=2;case 2:if(f.done)return[3,
5];h=v(f.value,2);k=h[0];l=h[1];return[4,this.i(k,l)];case 3:b.a(),b.label=4;case 4:return f=e.next(),[3,2];case 5:return[3,8];case 6:return m=b.a(),a={error:m},[3,8];case 7:try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error;}return[7];case 8:return[2]}})};return a}(K);function ub(c,a){return new sb(c,a)}function vb(c,a,b,g){void 0===b&&(b=E);void 0===g&&(g=ub);return new tb(c,a,b,g)};var wb=function(c){function a(a,g,d,e,f){var b=c.call(this)||this;b.I=a;b.G=g;b.J=d;b.H=e;b.i=f;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m;return t(this,function(b){switch(b.label){case 0:d=rb(this.G,this.H,E),b.label=1;case 1:b.c.push([1,6,7,8]),e=u(this.I),f=e.next(),b.label=2;case 2:if(f.done)return[3,5];h=f.value;k=this.J(h);l=d.has(k)?d.get(k):L();return[4,this.i(h,l)];case 3:b.a(),b.label=4;case 4:return f=e.next(),[3,2];case 5:return[3,8];case 6:return m=
b.a(),a={error:m},[3,8];case 7:try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error;}return[7];case 8:return[2]}})};return a}(K);function xb(c,a,b,g,d){return new wb(c,a,b,g,d)};function yb(c,a,b){void 0===b&&(b=L());return sa(function(){return c()?a:b})};var zb=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a;return t(this,function(){for(a=this.b[Symbol.iterator]();!a.next().done;);return[2]})};return a}(K);function Ab(c){return new zb(c)};function Bb(c,a,b){void 0===b&&(b=0);var g,d=0;Math.abs(b)&&(b=0);try{for(var e=u(c),f=e.next();!f.done;f=e.next()){var h=f.value;if(d++>b&&O(h,a))return!0}}catch(l){var k={error:l}}finally{try{f&&!f.done&&(g=e.return)&&g.call(e)}finally{if(k)throw k.error;}}return!1};var Cb=function(c){function a(a,g,d,e,f){var b=c.call(this)||this;b.I=a;b.G=g;b.J=d;b.H=e;b.i=f;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r,w,A,D;return t(this,function(b){switch(b.label){case 0:f=rb(this.G,this.H,E),b.label=1;case 1:b.c.push([1,12,13,14]),h=u(this.I),k=h.next(),b.label=2;case 2:if(k.done)return[3,11];l=k.value;m=this.J(l);if(!f.has(m))return[3,10];b.label=3;case 3:b.c.push([3,8,9,10]),p=u(f.get(m)),r=p.next(),b.label=4;case 4:if(r.done)return[3,
7];w=r.value;return[4,this.i(l,w)];case 5:b.a(),b.label=6;case 6:return r=p.next(),[3,4];case 7:return[3,10];case 8:return A=b.a(),d={error:A},[3,10];case 9:try{r&&!r.done&&(e=p.return)&&e.call(p)}finally{if(d)throw d.error;}return[7];case 10:return k=h.next(),[3,2];case 11:return[3,14];case 12:return D=b.a(),a={error:D},[3,14];case 13:try{k&&!k.done&&(c=h.return)&&c.call(h)}finally{if(a)throw a.error;}return[7];case 14:return[2]}})};return a}(K);function Db(c,a,b,g,d){return new Cb(c,a,b,g,d)};var Eb=function(c){function a(a,g,d){var b=c.call(this)||this;b.F=a;b.K=g;b.h=d;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r,w;return t(this,function(b){switch(b.label){case 0:f=[];try{for(h=u(this.K),k=h.next();!k.done;k=h.next())l=k.value,f.push(l)}catch(G){a={error:G}}finally{try{k&&!k.done&&(c=h.return)&&c.call(h)}finally{if(a)throw a.error;}}b.label=1;case 1:b.c.push([1,6,7,8]),m=u(this.F),p=m.next(),b.label=2;case 2:if(p.done)return[3,5];r=p.value;b=f;var g=
Ma(b,r,this.h);-1===g?b=!1:(b.splice(g,1),b=!0);return b?[4,r]:[3,4];case 3:b.a(),b.label=4;case 4:return p=m.next(),[3,2];case 5:return[3,8];case 6:return w=b.a(),d={error:w},[3,8];case 7:try{p&&!p.done&&(e=m.return)&&e.call(m)}finally{if(d)throw d.error;}return[7];case 8:return[2]}})};return a}(K);function Fb(c,a,b){void 0===b&&(b=O);return new Eb(c,a,b)};function Gb(c){var a;try{for(var b=u(c),g=b.next();!g.done;)return!1}catch(e){var d={error:e}}finally{try{g&&!g.done&&(a=b.return)&&a.call(b)}finally{if(d)throw d.error;}}return!0};function Hb(c,a){void 0===a&&(a=function(){return!0});var b,g=0,d;try{for(var e=u(c),f=e.next();!f.done;f=e.next()){var h=f.value;a(h,g++)&&(d=h)}}catch(l){var k={error:l}}finally{try{f&&!f.done&&(b=e.return)&&b.call(e)}finally{if(k)throw k.error;}}return d};function Ib(c,a){void 0===a&&(a=E);var b,g=!1,d=-Infinity;try{for(var e=u(c),f=e.next();!f.done;f=e.next()){var h=f.value;g||(g=!0);var k=a(h);k>d&&(d=k)}}catch(m){var l={error:m}}finally{try{f&&!f.done&&(b=e.return)&&b.call(e)}finally{if(l)throw l.error;}}if(!g)throw Error("Sequence contains no elements");return d};function Jb(c,a){return c>a?1:c<a?-1:0}
var Kb=function(c){function a(a,g,d){var b=c.call(this)||this;b.b=a;b.S=g;b.M=d;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l;return t(this,function(b){switch(b.label){case 0:a=[];d=this.b[Symbol.iterator]();if((c=d.next()).done)throw Error("Sequence contains no elements");e=c.value;f=this.S(e);for(a.push(e);!(c=d.next()).done;)h=c.value,k=this.S(h),l=this.M(k,f),0===l?a.push(h):0<l&&(a=[h],f=k);return[5,u(a)];case 1:return b.a(),[2]}})};return a}(K);
function Lb(c,a,b){return new Kb(c,a,b)};function Mb(c,a,b){void 0===b&&(b=Jb);return Lb(c,a,b)};var Nb=function(){function c(){this.w=[]}c.prototype.clear=function(){this.w=[]};Object.defineProperty(c.prototype,"count",{get:function(){return this.w.length},enumerable:!0,configurable:!0});c.prototype.get=function(a){return this.w[a]};c.prototype.push=function(a){this.w.push(a)};c.prototype.done=function(){};return c}(),Ob=function(){function c(a){this.f=0;this.Y=a;this.w=new Map}c.prototype.clear=function(){this.w.clear()};Object.defineProperty(c.prototype,"count",{get:function(){return this.f},
enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"readerCount",{get:function(){return this.Y},set:function(a){this.Y=a},enumerable:!0,configurable:!0});c.prototype.done=function(){this.Y--};c.prototype.get=function(a){if(!this.w.has(a))throw Error("Element no longer available in the buffer.");var c=this.w.get(a),g=c.value;0===--c.count&&this.w.delete(a);return g};c.prototype.push=function(a){this.w.set(this.f++,{value:a,count:this.Y})};return c}();var Pb=function(c){function a(a,g){var b=c.call(this)||this;b.A=!1;b.b=a;b.j=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e;return t(this,function(b){switch(b.label){case 0:a=0,b.label=1;case 1:b.c.push([1,,7,8]),b.label=2;case 2:c=!1;d={};if(a>=this.j.count){if(!this.A)try{if(e=this.b.next(),c=!e.done)d=e.value}catch(h){this.u=h,this.A=!0}if(this.A)throw this.u;c&&this.j.push(d)}else c=!0;return c?[4,this.j.get(a)]:[3,4];case 3:return b.a(),[3,5];case 4:return[3,6];case 5:return a++,
[3,2];case 6:return[3,8];case 7:return this.j.done(),[7];case 8:return[2]}})};return a}(K);function Qb(c,a,b){void 0===a&&(a=-1);return b?Ja(function(){return b(Qb(c,a))[Symbol.iterator]()}):-1===a?new Pb(c[Symbol.iterator](),new Nb):new Pb(c[Symbol.iterator](),new Ob(a))};function Rb(c,a){void 0===a&&(a=E);var b,g=!1,d=Infinity;try{for(var e=u(c),f=e.next();!f.done;f=e.next()){var h=f.value;g||(g=!0);var k=a(h);k<d&&(d=k)}}catch(m){var l={error:m}}finally{try{f&&!f.done&&(b=e.return)&&b.call(e)}finally{if(l)throw l.error;}}if(!g)throw Error("Sequence contains no elements");return d};function Sb(c,a,b){void 0===b&&(b=Jb);return Lb(c,a,function(a,c){return-b(a,c)})};var Tb=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a=this;return Q(Object.keys(this.b),function(c){return[c,a.b[c]]})[Symbol.iterator]()};return a}(K);function Ub(c){return new Tb(c)};var Vb=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){return Object.keys(this.b)[Symbol.iterator]()};return a}(K);function Wb(c){return new Vb(c)};var Xb=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a=this;return Q(Object.keys(this.b),function(c){return a.b[c]})[Symbol.iterator]()};return a}(K);function Yb(c){return new Xb(c)};var Zb=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l;return t(this,function(b){switch(b.label){case 0:b.c.push([0,6,7,8]),d=u(this.b),e=d.next(),b.label=1;case 1:if(e.done)return[3,5];f=e.value;h=f[Symbol.iterator]();b.label=2;case 2:k=void 0;try{k=h.next()}catch(p){return[3,4]}return k.done?[3,4]:[4,k.value];case 3:return b.a(),[3,2];case 4:return e=d.next(),[3,1];case 5:return[3,8];case 6:return l=b.a(),a={error:l},
[3,8];case 7:try{e&&!e.done&&(c=d.return)&&c.call(d)}finally{if(a)throw a.error;}return[7];case 8:return[2]}})};return a}(K);function $b(c){for(var a=[],b=1;b<arguments.length;b++)a[b-1]=arguments[b];return new Zb(x([c],a))};function R(c,a){return c>a?1:c<a?-1:0};var ac=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r;return t(this,function(b){switch(b.label){case 0:d=Array.from(this.b);e=d.length;f=Array(e);h=0;for(k=d.length;h<k;h++)f[h]=h;f.sort(this._getSorter(d));b.label=1;case 1:b.c.push([1,6,7,8]),l=u(f),m=l.next(),b.label=2;case 2:if(m.done)return[3,5];p=m.value;return[4,d[p]];case 3:b.a(),b.label=4;case 4:return m=l.next(),[3,2];case 5:return[3,8];case 6:return r=
b.a(),a={error:r},[3,8];case 7:try{m&&!m.done&&(c=l.return)&&c.call(l)}finally{if(a)throw a.error;}return[7];case 8:return[2]}})};a.prototype.thenBy=function(a,c){void 0===c&&(c=R);return new S(this.b,a,c,!1,this)};a.prototype.thenByDescending=function(a,c){void 0===c&&(c=R);return new S(this.b,a,c,!0,this)};return a}(K),S=function(c){function a(a,g,d,e,f){a=c.call(this,a)||this;a.l=g;a.h=d;a.ea=e;a.la=f;return a}n(a,c);a.prototype._getSorter=function(a,c){function b(a,b){var d=f(g[a],g[b]);return 0===
d?c?c(a,b):a-b:k?-d:d}var g=a.map(this.l),f=this.h,h=this.la,k=this.ea;return h?h._getSorter(a,b):b};return a}(ac);function bc(c,a,b){void 0===b&&(b=R);return new S(c,a,b,!1)}function cc(c,a,b){void 0===b&&(b=R);return new S(c,a,b,!0)}function dc(c,a,b){void 0===b&&(b=R);return new S(c.b,a,b,!1,c)}function ec(c,a,b){void 0===b&&(b=R);return new S(c.b,a,b,!0,c)};var fc=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l;return t(this,function(b){switch(b.label){case 0:e=!1,b.label=1;case 1:b.c.push([1,8,9,10]),f=u(this.b),h=f.next(),b.label=2;case 2:if(h.done)return[3,7];k=h.value;if(e)return[3,3];e=!0;return[3,5];case 3:return[4,[d,k]];case 4:b.a(),b.label=5;case 5:d=k,b.label=6;case 6:return h=f.next(),[3,2];case 7:return[3,10];case 8:return l=b.a(),a={error:l},[3,10];case 9:try{h&&
!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error;}return[7];case 10:return[2]}})};return a}(K);function gc(c){return new fc(c)};function hc(c,a,b){return[db(c,a,b),db(c,function(c,b){return!a(c,b)},b)]};function ic(c){for(var a=[],b=1;b<arguments.length;b++)a[b-1]=arguments[b];return 0===a.length?c instanceof K?c:K.from(c):function(c){return a.reduce(function(a,c){return c(a)},c)}(c)};function jc(c,a){return function(b){var g=b;for(b=0;b<a;b++)if(g=g[c[b]],"undefined"===typeof g)return;return g}}function kc(c){for(var a=[],b=1;b<arguments.length;b++)a[b-1]=arguments[b];return Q(c,jc(a,a.length))};var lc=function(c){function a(a){var b=c.call(this)||this;b.A=!1;b.b=a;b.j=new Ob(0);return b}n(a,c);a.prototype.X=function(a){var c,b,e;return t(this,function(d){switch(d.label){case 0:d.c.push([0,,6,7]),d.label=1;case 1:c=!1;b={};if(a>=this.j.count){if(!this.A)try{if(e=this.b.next(),c=!e.done)b=e.value}catch(h){this.u=h,this.A=!0}if(this.A){if(this.u)throw this.u;return[3,5]}c&&this.j.push(b)}else c=!0;return c?[4,this.j.get(a)]:[3,3];case 2:return d.a(),[3,4];case 3:return[3,5];case 4:return a++,
[3,1];case 5:return[3,7];case 6:return this.j.done(),[7];case 7:return[2]}})};a.prototype[Symbol.iterator]=function(){this.j.za++;return this.X(this.j.count)[Symbol.iterator]()};return a}(K);function mc(c,a){return a?Ja(function(){return a(mc(c))[Symbol.iterator]()}):new lc(c[Symbol.iterator]())};var nc=function(c){function a(a,g){var b=c.call(this)||this;b.W=a;b.f=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c;return t(this,function(b){switch(b.label){case 0:a=this.W,c=this.W+this.f,b.label=1;case 1:return a<c?[4,a]:[3,4];case 2:b.a(),b.label=3;case 3:return a++,[3,1];case 4:return[2]}})};return a}(K);function oc(c,a){return new nc(c,a)};function pc(c,a){for(var b=[],g=2;g<arguments.length;g++)b[g-2]=arguments[g];var d;g=1===b.length;var e=0,f=!1;b=b[0];try{for(var h=u(c),k=h.next();!k.done;k=h.next()){var l=k.value;f||(f=g)?b=a(b,l,e++):(b=l,f=!0,e++)}}catch(p){var m={error:p}}finally{try{k&&!k.done&&(d=h.return)&&d.call(h)}finally{if(m)throw m.error;}}if(!g&&!f)throw Error("Sequence contains no elements");return b};function qc(c){var a,b=[];try{for(var g=u(c),d=g.next();!d.done;d=g.next())b.push(d.value)}catch(f){var e={error:f}}finally{try{d&&!d.done&&(a=g.return)&&a.call(g)}finally{if(e)throw e.error;}}return b};function rc(c,a){for(var b=[],g=2;g<arguments.length;g++)b[g-2]=arguments[g];g=qc(c);var d=1===b.length,e=!1;b=b[0];for(var f=g.length-1;0<=f;f--){var h=g[f];e||(e=d)?b=a(b,h,f):(b=h,e=!0)}if(!d&&!e)throw Error("Sequence contains no elements");return b};var sc=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.f=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r,w;return t(this,function(b){switch(b.label){case 0:if(-1!==this.f)return[3,11];b.label=1;case 1:b.label=2;case 2:b.c.push([2,7,8,9]),f=u(this.b),h=f.next(),b.label=3;case 3:if(h.done)return[3,6];k=h.value;return[4,k];case 4:b.a(),b.label=5;case 5:return h=f.next(),[3,3];case 6:return[3,9];case 7:return l=b.a(),a={error:l},[3,9];case 8:try{h&&!h.done&&
(c=f.return)&&c.call(f)}finally{if(a)throw a.error;}return[7];case 9:return[3,1];case 10:return[3,21];case 11:m=0,b.label=12;case 12:if(!(m<this.f))return[3,21];b.label=13;case 13:b.c.push([13,18,19,20]),p=u(this.b),r=p.next(),b.label=14;case 14:if(r.done)return[3,17];k=r.value;return[4,k];case 15:b.a(),b.label=16;case 16:return r=p.next(),[3,14];case 17:return[3,20];case 18:return w=b.a(),d={error:w},[3,20];case 19:try{r&&!r.done&&(e=p.return)&&e.call(p)}finally{if(d)throw d.error;}return[7];case 20:return m++,
[3,12];case 21:return[2]}})};return a}(K);function tc(c,a){void 0===a&&(a=-1);return new sc(c,a)}function uc(c,a){void 0===a&&(a=-1);return new sc(K.of(c),a)};function vc(c,a){void 0===a&&(a=-1);return new wa(uc(c,a))};var wc=function(c){function a(a){var b=c.call(this)||this;b.b=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h;return t(this,function(b){switch(b.label){case 0:d=[];try{for(e=u(this.b),f=e.next();!f.done;f=e.next())h=f.value,d.unshift(h)}catch(l){a={error:l}}finally{try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error;}}return[5,u(d)];case 1:return b.a(),[2]}})};return a}(K);function xc(c){return new wc(c)};var yc=function(c){function a(a,g,d){var b=c.call(this)||this;b.b=a;b.g=g;b.C=1===d.length;b.L=d[0];return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m;return t(this,function(b){switch(b.label){case 0:d=0,e=!1,f=this.L,b.label=1;case 1:b.c.push([1,7,8,9]),h=u(this.b),k=h.next(),b.label=2;case 2:if(k.done)return[3,6];l=k.value;if(!e&&!(e=this.C))return[3,4];f=this.g(f,l,d++);return[4,f];case 3:return b.a(),[3,5];case 4:f=l,e=!0,d++,b.label=5;case 5:return k=h.next(),[3,2];
case 6:return[3,9];case 7:return m=b.a(),a={error:m},[3,9];case 8:try{k&&!k.done&&(c=h.return)&&c.call(h)}finally{if(a)throw a.error;}return[7];case 9:return 1!==d||this.C?[3,11]:[4,f];case 10:b.a(),b.label=11;case 11:return[2]}})};return a}(K);function zc(c,a){for(var b=[],g=2;g<arguments.length;g++)b[g-2]=arguments[g];return new yc(c,a,b)};var Ac=function(c){function a(a,g,d){var b=c.call(this)||this;b.b=a;b.g=g;b.C=1===d.length;b.L=d[0];return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f;return t(this,function(b){switch(b.label){case 0:a=!1,c=this.L,d=qc(this.b),e=d.length-1,b.label=1;case 1:if(!(0<=e))return[3,5];f=d[e];if(!a&&!(a=this.C))return[3,3];c=this.g(c,f,e);return[4,c];case 2:return b.a(),[3,4];case 3:c=f,a=!0,b.label=4;case 4:return e--,[3,1];case 5:return[2]}})};return a}(K);
function Bc(c,a){for(var b=[],g=2;g<arguments.length;g++)b[g-2]=arguments[g];return new Ac(c,a,b)};function Cc(c,a,b){void 0===b&&(b=O);c=c[Symbol.iterator]();a=a[Symbol.iterator]();for(var g,d;!(g=c.next()).done;)if((d=a.next()).done||!b(g.value,d.value))return!1;return a.next().done};var Dc=function(c){function a(a){var b=c.call(this)||this;b.ja=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){return this.ja};return a}(K);function Ec(c,a){return a?Ja(function(){return a(new Dc(c[Symbol.iterator]()))[Symbol.iterator]()}):new Dc(c[Symbol.iterator]())};function Fc(c,a){void 0===a&&(a=function(){return!0});var b,g=!1,d=0;try{for(var e=u(c),f=e.next();!f.done;f=e.next()){var h=f.value;if(g&&a(h,d++))throw Error("More than one element was found");if(a(h,d++)){var k=h;g=!0}}}catch(m){var l={error:m}}finally{try{f&&!f.done&&(b=e.return)&&b.call(e)}finally{if(l)throw l.error;}}return k};var Gc=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.f=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d;return t(this,function(b){switch(b.label){case 0:a=this.b[Symbol.iterator]();for(c=this.f;0<c&&!(d=a.next()).done;)c--;if(!(0>=c))return[3,3];b.label=1;case 1:return(d=a.next()).done?[3,3]:[4,d.value];case 2:return b.a(),[3,1];case 3:return[2]}})};return a}(K);function Hc(c,a){return new Gc(c,a)};var Ic=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.f=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k;return t(this,function(b){switch(b.label){case 0:d=[],b.label=1;case 1:b.c.push([1,6,7,8]),e=u(this.b),f=e.next(),b.label=2;case 2:if(f.done)return[3,5];h=f.value;d.push(h);return d.length>this.f?[4,d.shift()]:[3,4];case 3:b.a(),b.label=4;case 4:return f=e.next(),[3,2];case 5:return[3,8];case 6:return k=b.a(),a={error:k},[3,8];case 7:try{f&&!f.done&&(c=
e.return)&&c.call(e)}finally{if(a)throw a.error;}return[7];case 8:return[2]}})};return a}(K);function Jc(c,a){return new Ic(c,a)};var Kc=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.v=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l;return t(this,function(b){switch(b.label){case 0:d=!1,e=0,b.label=1;case 1:b.c.push([1,6,7,8]),f=u(this.b),h=f.next(),b.label=2;case 2:if(h.done)return[3,5];k=h.value;d||this.v(k,e++)||(d=!0);return d?[4,k]:[3,4];case 3:b.a(),b.label=4;case 4:return h=f.next(),[3,2];case 5:return[3,8];case 6:return l=b.a(),a={error:l},[3,8];case 7:try{h&&!h.done&&(c=f.return)&&
c.call(f)}finally{if(a)throw a.error;}return[7];case 8:return[2]}})};return a}(K);function Lc(c,a){return new Kc(c,a)};var Mc=function(c){function a(a,g,d){var b=c.call(this)||this;b.b=a;b.ba=g;b.ga=d;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e;return t(this,function(b){switch(b.label){case 0:a=this.b[Symbol.iterator]();for(c=this.ba;0<c&&!(d=a.next()).done;)c--;e=this.ga;if(!(0<e))return[3,3];b.label=1;case 1:return(d=a.next()).done?[3,3]:[4,d.value];case 2:return b.a(),0===--e?[3,3]:[3,1];case 3:return[2]}})};return a}(K);function Nc(c,a,b){void 0===b&&(b=Infinity);return new Mc(c,a,b)};function Oc(c,a){var b,g=0;try{for(var d=u(c),e=d.next();!e.done;e=d.next())if(a(e.value,g++))return!0}catch(h){var f={error:h}}finally{try{e&&!e.done&&(b=d.return)&&b.call(d)}finally{if(f)throw f.error;}}return!1};var Pc=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.s=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k,l,m,p,r,w;return t(this,function(b){switch(b.label){case 0:b.c.push([0,5,6,7]),f=u(this.s),h=f.next(),b.label=1;case 1:if(h.done)return[3,4];k=h.value;return[4,k];case 2:b.a(),b.label=3;case 3:return h=f.next(),[3,1];case 4:return[3,7];case 5:return l=b.a(),a={error:l},[3,7];case 6:try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error;}return[7];
case 7:b.c.push([7,12,13,14]),m=u(this.b),p=m.next(),b.label=8;case 8:if(p.done)return[3,11];r=p.value;return[4,r];case 9:b.a(),b.label=10;case 10:return p=m.next(),[3,8];case 11:return[3,14];case 12:return w=b.a(),d={error:w},[3,14];case 13:try{p&&!p.done&&(e=m.return)&&e.call(m)}finally{if(d)throw d.error;}return[7];case 14:return[2]}})};return a}(K);function Qc(c){for(var a=[],b=1;b<arguments.length;b++)a[b-1]=arguments[b];return new Pc(c,a)};function Rc(c,a){void 0===a&&(a=E);var b,g=0;try{for(var d=u(c),e=d.next();!e.done;e=d.next())g+=a(e.value)}catch(h){var f={error:h}}finally{try{e&&!e.done&&(b=d.return)&&b.call(d)}finally{if(f)throw f.error;}}return g};var Sc=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.f=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k;return t(this,function(b){switch(b.label){case 0:d=this.f;if(!(0<d))return[3,8];b.label=1;case 1:b.c.push([1,6,7,8]),e=u(this.b),f=e.next(),b.label=2;case 2:if(f.done)return[3,5];h=f.value;return[4,h];case 3:b.a();if(0===--d)return[3,5];b.label=4;case 4:return f=e.next(),[3,2];case 5:return[3,8];case 6:return k=b.a(),a={error:k},[3,8];case 7:try{f&&!f.done&&
(c=e.return)&&c.call(e)}finally{if(a)throw a.error;}return[7];case 8:return[2]}})};return a}(K);function Tc(c,a){return new Sc(c,a)};var Uc=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.f=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h;return t(this,function(b){switch(b.label){case 0:if(!(0<this.f))return[3,3];d=[];try{for(e=u(this.b),f=e.next();!f.done;f=e.next())h=f.value,d.length>=this.f&&d.shift(),d.push(h)}catch(l){a={error:l}}finally{try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error;}}b.label=1;case 1:return 0<d.length?[4,d.shift()]:[3,3];case 2:return b.a(),[3,1];
case 3:return[2]}})};return a}(K);function Vc(c,a){return new Uc(c,a)};var Wc=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.v=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c,d,e,f,h,k;return t(this,function(b){switch(b.label){case 0:d=0,b.label=1;case 1:b.c.push([1,6,7,8]),e=u(this.b),f=e.next(),b.label=2;case 2:if(f.done)return[3,5];h=f.value;return this.v(h,d++)?[4,h]:[3,5];case 3:b.a(),b.label=4;case 4:return f=e.next(),[3,2];case 5:return[3,8];case 6:return k=b.a(),a={error:k},[3,8];case 7:try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error;
}return[7];case 8:return[2]}})};return a}(K);function Xc(c,a){return new Wc(c,a)};var Yc=function(c){function a(a,g){var b=c.call(this)||this;b.b=a;b.o=g;return b}n(a,c);a.prototype[Symbol.iterator]=function(){var a,c;return t(this,function(b){switch(b.label){case 0:a=this.b[Symbol.iterator](),b.label=1;case 1:c=void 0;try{if(c=a.next(),c.done)return[3,3]}catch(e){throw this.o.error&&this.o.error(e),e;}this.o.next&&this.o.next(c.value);return[4,c.value];case 2:return b.a(),[3,1];case 3:return this.o.complete&&this.o.complete(),[2]}})};return a}(K);
function Zc(c,a){return new Yc(c,a)};var $c=function(c){function a(a){var b=c.call(this)||this;b.u=a;return b}n(a,c);a.prototype[Symbol.iterator]=function(){return t(this,function(){throw this.u;})};return a}(K);function ad(c){return new $c(c)};var T=function(){function c(){this.ha=!1;this.pa=[];this.U=[]}c.prototype[Symbol.asyncIterator]=function(){return this};c.prototype.write=function(a){this._push({type:"value",value:a})};c.prototype.error=function(a){this._push({type:"error",error:a})};c.prototype._push=function(a){if(this.ha)throw Error("AsyncSink already ended");if(0<this.U.length){var c=this.U.shift(),g=c.resolve;c=c.reject;"error"===a.type?c(a.error):g({done:!1,value:a.value})}else this.pa.push(a)};c.prototype.next=function(){var a=
this;if(0<this.pa.length){var c=this.pa.shift(),g=c.value,d=c.error;return"error"===c.type?Promise.reject(d):Promise.resolve({done:!1,value:g})}return this.ha?Promise.resolve({done:!0}):new Promise(function(c,b){a.U.push({resolve:c,reject:b})})};c.prototype.end=function(){for(;0<this.U.length;)this.U.shift().resolve({done:!0});this.ha=!0};return c}();var U=function(){function c(){}c.prototype.forEach=function(a,c){return q(this,function(){var b,d,e,f,h,k,l,m;return t(this,function(g){switch(g.label){case 0:e=C(a,c,2),f=0,g.label=1;case 1:g.c.push([1,7,8,13]),h=B(this),g.label=2;case 2:return[4,h.next()];case 3:if(k=g.a(),k.done)return[3,6];l=k.value;return[4,e(l,f++)];case 4:g.a(),g.label=5;case 5