angular-odata-es5
Version:
OData service for Angular (es5 version)
22 lines (20 loc) • 103 kB
JavaScript
/**
* angular-odata-es5 - OData service for Angular (es5 version)
* @version v0.11.2
* @author Stef Heyenrath
* @link https://github.com/StefH/angular-odata-es5#readme
* @license MIT
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@angular/common/http"),require("rxjs/operators"),require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/common/http","rxjs/operators","@angular/core","@angular/common"],e):"object"==typeof exports?exports.AngularODataES5=e(require("@angular/common/http"),require("rxjs/operators"),require("@angular/core"),require("@angular/common")):t.AngularODataES5=e(t.ng.commonHttp,t.Rx,t.ng.core,t.ng.common)}(this,function(t,e,r,n){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=65)}([function(t,e,r){"use strict";function n(t){if(t||(t=a.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}r.d(e,"a",function(){return c});var i=r(29),o=r(120),u=r(10),s=r(61),a=r(16),c=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,n){var i=this.operator,u=r.i(o.a)(t,e,n);if(i?u.add(i.call(u,this.source)):u.add(this.source||a.a.useDeprecatedSynchronousErrorHandling&&!u.syncErrorThrowable?this._subscribe(u):this._trySubscribe(u)),a.a.useDeprecatedSynchronousErrorHandling&&u.syncErrorThrowable&&(u.syncErrorThrowable=!1,u.syncErrorThrown))throw u.syncErrorValue;return u},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){a.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),r.i(i.a)(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=n(e))(function(e,n){var i;i=r.subscribe(function(e){try{t(e)}catch(t){n(t),i&&i.unsubscribe()}},n,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[u.a]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:r.i(s.b)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=n(t))(function(t,r){var n;e.subscribe(function(t){return n=t},function(t){return r(t)},function(){return t(n)})})},t.create=function(e){return new t(e)},t}()},function(t,e,r){"use strict";function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}e.a=n;/*! *****************************************************************************
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.
***************************************************************************** */
var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)}},function(t,e,r){"use strict";function n(t){return t.reduce(function(t,e){return t.concat(e instanceof s.a?e.errors:e)},[])}r.d(e,"a",function(){return a});var i=r(4),o=r(32),u=r(18),s=r(57),a=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var a=this,c=a._parentOrParents,f=a._unsubscribe,h=a._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,c instanceof t)c.remove(this);else if(null!==c)for(var p=0;p<c.length;++p){var l=c[p];l.remove(this)}if(r.i(u.a)(f))try{f.call(this)}catch(t){e=t instanceof s.a?n(t.errors):[t]}if(r.i(i.a)(h))for(var p=-1,y=h.length;++p<y;){var d=h[p];if(r.i(o.a)(d))try{d.unsubscribe()}catch(t){e=e||[],t instanceof s.a?e=e.concat(n(t.errors)):e.push(t)}}if(e)throw new s.a(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;r=new t,r._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return f});var n=r(1),i=r(18),o=r(48),u=r(2),s=r(28),a=r(16),c=r(30),f=function(t){function e(r,n,i){var u=t.call(this)||this;switch(u.syncErrorValue=null,u.syncErrorThrown=!1,u.syncErrorThrowable=!1,u.isStopped=!1,arguments.length){case 0:u.destination=o.a;break;case 1:if(!r){u.destination=o.a;break}if("object"==typeof r){r instanceof e?(u.syncErrorThrowable=r.syncErrorThrowable,u.destination=r,r.add(u)):(u.syncErrorThrowable=!0,u.destination=new h(u,r));break}default:u.syncErrorThrowable=!0,u.destination=new h(u,r,n,i)}return u}return n.a(e,t),e.prototype[s.a]=function(){return this},e.create=function(t,r,n){var i=new e(t,r,n);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(u.a),h=function(t){function e(e,n,u,s){var a=t.call(this)||this;a._parentSubscriber=e;var c,f=a;return r.i(i.a)(n)?c=n:n&&(c=n.next,u=n.error,s=n.complete,n!==o.a&&(f=Object.create(n),r.i(i.a)(f.unsubscribe)&&a.add(f.unsubscribe.bind(f)),f.unsubscribe=a.unsubscribe.bind(a))),a._context=f,a._next=c,a._error=u,a._complete=s,a}return n.a(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;a.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=a.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):r.i(c.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;r.i(c.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};a.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),a.a.useDeprecatedSynchronousErrorHandling)throw t;r.i(c.a)(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!a.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return a.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(r.i(c.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(f)},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var n=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}()},function(t,e,r){"use strict";function n(t){return t?i(t):u}function i(t){return new o.a(function(e){return t.schedule(function(){return e.complete()})})}r.d(e,"b",function(){return u}),e.a=n;var o=r(0),u=new o.a(function(t){return t.complete()})},function(t,e,r){"use strict";function n(t){return t&&"function"==typeof t.schedule}e.a=n},function(t,e,r){"use strict";r.d(e,"b",function(){return f}),r.d(e,"a",function(){return h});var n=r(1),i=r(0),o=r(3),u=r(2),s=r(17),a=r(50),c=r(28),f=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return n.a(e,t),e}(o.a),h=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return n.a(e,t),e.prototype[c.a]=function(){return new f(this)},e.prototype.lift=function(t){var e=new p(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new s.a;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new s.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new s.a;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new s.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new s.a;return this.hasError?(t.error(this.thrownError),u.a.EMPTY):this.isStopped?(t.complete(),u.a.EMPTY):(this.observers.push(t),new a.a(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new p(t,e)},e}(i.a),p=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return n.a(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):u.a.EMPTY},e}(h)},function(t,e,r){"use strict";function n(t,e){return e?r.i(u.a)(t,e):t instanceof i.a?t:new i.a(r.i(o.a)(t))}e.a=n;var i=r(0),o=r(34),u=r(55)},function(t,e,r){"use strict";function n(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new u(t,e))}}e.a=n;var i=r(1),o=r(3),u=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.project,this.thisArg))},t}(),s=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return i.a(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.a)},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var n=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(t,e,r){"use strict";function n(t,e){return e?r.i(u.a)(t,e):new i.a(r.i(o.a)(t))}e.a=n;var i=r(0),o=r(62),u=r(26)},function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(1),i=r(99),o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.pending=!1,n}return n.a(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(i.a)},function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(1),i=r(49),o=function(t){function e(r,n){void 0===n&&(n=i.a.now);var o=t.call(this,r,function(){return e.delegate&&e.delegate!==o?e.delegate.now():n()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return n.a(e,t),e.prototype.schedule=function(r,n,i){return void 0===n&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)return void e.push(t);var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}},e}(i.a)},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var n=function(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}()},function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(1),i=r(3),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.a(e,t),e.prototype.notifyNext=function(t,e,r,n,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(i.a)},function(t,e,r){"use strict";r.d(e,"a",function(){return i});var n=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){(new Error).stack}n=t},get useDeprecatedSynchronousErrorHandling(){return n}}},function(t,e,r){"use strict";r.d(e,"a",function(){return i});var n=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),i=n},function(t,e,r){"use strict";function n(t){return"function"==typeof t}e.a=n},function(t,e,r){"use strict";function n(t,e,n,s,a){if(void 0===a&&(a=new i.a(t,n,s)),!a.closed)return e instanceof u.a?e.subscribe(a):r.i(o.a)(e)(a)}e.a=n;var i=r(46),o=r(34),u=r(0)},function(e,r){e.exports=t},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(20),o=r(66),u=r(23),s=r(35),a=function(){function t(t,e,r){this.typeName=t,this.config=e,this.http=r,this._expand=[],this._select=[]}return t.prototype.Expand=function(t){return t&&(this._expand=this.toStringArray(t)),this},t.prototype.Select=function(t){return t&&(this._select=this.toStringArray(t)),this},t.prototype.getParams=function(){var t=this,e=new o.Dictionary,r=new o.List;this._expand.forEach(function(t){return e.set(t,new o.List)}),this._select.forEach(function(t){var n=t.split("/");if(n.length>1){var i=n[0],u=n[1];e.containsKey(i)||e.set(i,new o.List),e.get(i).push(u)}else r.push(t)});var n=new i.HttpParams,u=e.distinct().select(function(e){return e.value.any()?e.key+"("+t.config.keys.select+"="+t.toCommaString(e.value)+")":e.key});return u.any()&&(n=n.append(this.config.keys.expand,this.toCommaString(u))),r.any()&&(n=n.append(this.config.keys.select,this.toCommaString(r))),n},t.prototype.handleResponse=function(t){var e=this;return t.pipe(s.map(this.extractData),s.catchError(function(t,r){return e.config.handleError&&e.config.handleError(t,r),u.throwError(t)}))},t.prototype.getDefaultRequestOptions=function(){var t=Object.assign({},this.config.defaultRequestOptions);return t.params=this.getParams(),t},t.prototype.getPostRequestOptions=function(){var t=Object.assign({},this.config.postRequestOptions);return t.params=this.getParams(),t},t.prototype.GenerateUrl=function(t){var e=this.getParams();return e.keys().length>0?t+"?"+e:t},t.prototype.toStringArray=function(t){return t?t instanceof String||"string"==typeof t?t.split(",").map(function(t){return t.trim()}):t instanceof Array?t:t.toArray():[]},t.prototype.toCommaString=function(t){return t instanceof String||"string"==typeof t?t:t instanceof Array?t.join():t.toArray().join()},t.prototype.extractData=function(t){if(t.status<200||t.status>=300)throw new Error("Bad response status: "+t.status);return t.body||{}},t}();e.ODataOperation=a;var c=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n)||this;return o._typeName=e,o.config=r,o.http=n,o.entityKey=i,o}return n(e,t),e.prototype.getEntityUri=function(){return this.config.getEntityUri(this.entityKey,this.typeName)},e.prototype.GetUrl=function(){return this.GenerateUrl(this.getEntityUri())},e}(a);e.OperationWithKey=c;var f=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n)||this;return o._typeName=e,o.config=r,o.http=n,o.entity=i,o}return n(e,t),e.prototype.getEntitiesUri=function(){return this.config.getEntitiesUri(this._typeName)},e.prototype.GetUrl=function(){return this.GenerateUrl(this.getEntitiesUri())},e}(a);e.OperationWithEntity=f;var h=function(t){function e(e,r,n,i,o){var u=t.call(this,e,r,n,i)||this;return u._typeName=e,u.config=r,u.http=n,u.entityKey=i,u.entity=o,u}return n(e,t),e.prototype.getEntityUri=function(){return this.config.getEntityUri(this.entityKey,this._typeName)},e}(c);e.OperationWithKeyAndEntity=h;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.Exec=function(){return t.prototype.handleResponse.call(this,this.http.get(this.getEntityUri(),this.getDefaultRequestOptions()))},e}(c);e.GetOperation=p;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.Exec=function(){var e=this.entity?JSON.stringify(this.entity):null;return t.prototype.handleResponse.call(this,this.http.post(this.getEntitiesUri(),e,this.getPostRequestOptions()))},e}(f);e.PostOperation=l;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.Exec=function(){var e=this.entity?JSON.stringify(this.entity):null;return t.prototype.handleResponse.call(this,this.http.patch(this.getEntityUri(),e,this.getPostRequestOptions()))},e}(h);e.PatchOperation=y;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.Exec=function(){var e=this.entity?JSON.stringify(this.entity):null;return t.prototype.handleResponse.call(this,this.http.put(this.getEntityUri(),e,this.getPostRequestOptions()))},e}(h);e.PutOperation=d;var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.Exec=function(){return t.prototype.handleResponse.call(this,this.http.delete(this.getEntityUri(),this.config.defaultRequestOptions))},e}(c);e.DeleteOperation=v},function(t,e,r){"use strict";function n(t,e){return function(r,n){return t(r,n)||e(r,n)}}function i(t,e,r){return void 0!==r?function(e,n){return r(t(e),t(n))}:e?function(e,r){var n=t(e),i=t(r);return n<i?-1:n>i?1:0}:function(e,r){var n=t(e),i=t(r);return n<i?1:n>i?-1:0}}Object.defineProperty(e,"__esModule",{value:!0}),e.strictEqualityComparer=function(){return function(t,e){return t===e}},e.combineComparers=n,e.createComparer=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0);r.d(e,"Observable",function(){return n.a});var i=r(70);r.d(e,"ConnectableObservable",function(){return i.a});var o=r(92);r.d(e,"GroupedObservable",function(){return o.a});var u=r(10);r.d(e,"observable",function(){return u.a});var s=r(7);r.d(e,"Subject",function(){return s.a});var a=r(68);r.d(e,"BehaviorSubject",function(){return a.a});var c=r(69);r.d(e,"ReplaySubject",function(){return c.a});var f=r(24);r.d(e,"AsyncSubject",function(){return f.a});var h=r(108);r.d(e,"asapScheduler",function(){return h.a});var p=r(27);r.d(e,"asyncScheduler",function(){return p.a});var l=r(56);r.d(e,"queueScheduler",function(){return l.a});var y=r(107);r.d(e,"animationFrameScheduler",function(){return y.a});var d=r(106);r.d(e,"VirtualTimeScheduler",function(){return d.a}),r.d(e,"VirtualAction",function(){return d.b});var v=r(49);r.d(e,"Scheduler",function(){return v.a});var b=r(2);r.d(e,"Subscription",function(){return b.a});var m=r(3);r.d(e,"Subscriber",function(){return m.a});var g=r(47);r.d(e,"Notification",function(){return g.a}),r.d(e,"NotificationKind",function(){return g.b});var _=r(61);r.d(e,"pipe",function(){return _.a});var w=r(33);r.d(e,"noop",function(){return w.a});var x=r(31);r.d(e,"identity",function(){return x.a});var E=r(115);r.d(e,"isObservable",function(){return E.a});var O=r(109);r.d(e,"ArgumentOutOfRangeError",function(){return O.a});var S=r(110);r.d(e,"EmptyError",function(){return S.a});var A=r(17);r.d(e,"ObjectUnsubscribedError",function(){return A.a});var D=r(57);r.d(e,"UnsubscriptionError",function(){return D.a});var j=r(112);r.d(e,"TimeoutError",function(){return j.a});var P=r(71);r.d(e,"bindCallback",function(){return P.a});var I=r(72);r.d(e,"bindNodeCallback",function(){return I.a});var C=r(73);r.d(e,"combineLatest",function(){return C.a});var k=r(74);r.d(e,"concat",function(){return k.a});var T=r(51);r.d(e,"defer",function(){return T.a});var N=r(5);r.d(e,"empty",function(){return N.a});var R=r(75);r.d(e,"forkJoin",function(){return R.a});var V=r(8);r.d(e,"from",function(){return V.a});var q=r(76);r.d(e,"fromEvent",function(){return q.a});var U=r(77);r.d(e,"fromEventPattern",function(){return U.a});var F=r(78);r.d(e,"generate",function(){return F.a});var M=r(79);r.d(e,"iif",function(){return M.a});var W=r(80);r.d(e,"interval",function(){return W.a});var B=r(81);r.d(e,"merge",function(){return B.a});var K=r(52);r.d(e,"never",function(){return K.a});var L=r(25);r.d(e,"of",function(){return L.a});var Q=r(82);r.d(e,"onErrorResumeNext",function(){return Q.a});var H=r(83);r.d(e,"pairs",function(){return H.a});var G=r(84);r.d(e,"partition",function(){return G.a});var Y=r(85);r.d(e,"race",function(){return Y.a});var $=r(86);r.d(e,"range",function(){return $.a});var z=r(53);r.d(e,"throwError",function(){return z.a});var J=r(87);r.d(e,"timer",function(){return J.a});var Z=r(88);r.d(e,"using",function(){return Z.a});var X=r(89);r.d(e,"zip",function(){return X.a});var tt=r(55);r.d(e,"scheduled",function(){return tt.a}),r.d(e,"EMPTY",function(){return N.b}),r.d(e,"NEVER",function(){return K.b});var et=r(16);r.d(e,"config",function(){return et.a})},function(t,e,r){"use strict";r.d(e,"a",function(){return u});var n=r(1),i=r(7),o=r(2),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return n.a(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),o.a.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),o.a.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(i.a)},function(t,e,r){"use strict";function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return r.i(i.a)(n)?(t.pop(),r.i(u.a)(t,n)):r.i(o.a)(t)}e.a=n;var i=r(6),o=r(11),u=r(26)},function(t,e,r){"use strict";function n(t,e){return new i.a(function(r){var n=new o.a,i=0;return n.add(e.schedule(function(){if(i===t.length)return void r.complete();r.next(t[i++]),r.closed||n.add(this.schedule())})),n})}e.a=n;var i=r(0),o=r(2)},function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(12),i=r(13),o=new i.a(n.a)},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var n=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(t,e,r){"use strict";function n(t){for(;t;){var e=t,r=e.closed,n=e.destination,o=e.isStopped;if(r||o)return!1;t=n&&n instanceof i.a?n:null}return!0}e.a=n;var i=r(3)},function(t,e,r){"use strict";function n(t){setTimeout(function(){throw t},0)}e.a=n},function(t,e,r){"use strict";function n(t){return t}e.a=n},function(t,e,r){"use strict";function n(t){return null!==t&&"object"==typeof t}e.a=n},function(t,e,r){"use strict";function n(){}e.a=n},function(t,e,r){"use strict";r.d(e,"a",function(){return p});var n=r(62),i=r(119),o=r(117),u=r(118),s=r(58),a=r(60),c=r(32),f=r(14),h=r(10),p=function(t){if(t&&"function"==typeof t[h.a])return r.i(u.a)(t);if(r.i(s.a)(t))return r.i(n.a)(t);if(r.i(a.a)(t))return r.i(i.a)(t);if(t&&"function"==typeof t[f.a])return r.i(o.a)(t);var e=r.i(c.a)(t)?"an invalid object":"'"+t+"'",p="You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(p)}},function(t,r){t.exports=e},function(t,e){t.exports=r},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,u=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(u=(o<3?i(u):o>3?i(e,r,u):i(e,r))||u);return o>3&&u&&Object.defineProperty(e,r,u),u};Object.defineProperty(e,"__esModule",{value:!0});var i=r(20),o=r(36),u=r(39),s=r(42),a=function(){function t(){this.filter="$filter",this.top="$top",this.skip="$skip",this.orderBy="$orderby",this.select="$select",this.search="$search",this.expand="$expand",this.apply="$apply",this.count="$count",this.maxPerPage="odata.maxpagesize"}return t}();e.KeyConfigs=a;var c=function(){function t(){this._postHeaders=new i.HttpHeaders({"Content-Type":"application/json; charset=utf-8"}),this._baseUrl="http://localhost/odata",this.keys=new a,this.defaultRequestOptions={headers:new i.HttpHeaders,observe:"response"},this.postRequestOptions={headers:this._postHeaders,observe:"response"},this.customRequestOptions={headers:new i.HttpHeaders,observe:"response"}}return Object.defineProperty(t.prototype,"baseUrl",{get:function(){return this._baseUrl},set:function(t){this._baseUrl=t.replace(/\/+$/,"")},enumerable:!0,configurable:!0}),t.prototype.getEntitiesUri=function(t){return t?this.baseUrl+"/"+this.sanitizeTypeName(t):this.baseUrl},t.prototype.getEntityUri=function(t,e){return this.getEntitiesUri(e)+"("+s.ODataUtils.quoteValue(t)+")"},t.prototype.handleError=function(t,e){console.warn("OData error: ",t,e)},t.prototype.extractQueryResultDataAsNumber=function(t){if(t.status<200||t.status>=300)throw new Error("Bad response status: "+t.status);return t&&t.body},t.prototype.extractQueryResultData=function(t){if(t.status<200||t.status>=300)throw new Error("Bad response status: "+t.status);return t&&t.body&&t.body.value},t.prototype.extractQueryResultDataWithCount=function(t){var e=new u.ODataPagedResult;if(t.status<200||t.status>=300)throw new Error("Bad response status: "+t.status);var r=t.body,n=r.value;e.data=n;var i=s.ODataUtils.tryParseInt(r["@odata.count"]);return i.valid?e.count=i.value:(console.warn("Cannot determine OData entities count. Falling back to collection length."),e.count=n.length),r["@odata.nextLink"]&&(e.nextLink=r["@odata.nextLink"]),e},t.prototype.sanitizeTypeName=function(t){return t.replace(/\/+$/,"").replace(/^\/+/,"")},t=n([o.Injectable()],t)}();e.ODataConfiguration=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Array=0]="Array",t[t.Count=1]="Count",t[t.PagedResult=2]="PagedResult"}(e.ODataExecReturnType||(e.ODataExecReturnType={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t}();e.ODataPagedResult=n},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(23),o=r(35),u=r(20),s=r(38),a=r(21),c=function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i._orderBy=[],i._apply=[],i._customQueryOptions=[],i._entitiesUri=r.getEntitiesUri(i.typeName),i}return n(e,t),e.prototype.Filter=function(t){return t&&(this._filter=t),this},e.prototype.Search=function(t){return t&&(this._search=t),this},e.prototype.Top=function(t){return t>0&&(this._top=t),this},e.prototype.Skip=function(t){return t>0&&(this._skip=t),this},e.prototype.OrderBy=function(t){return t&&(this._orderBy=this.toStringArray(t)),this},e.prototype.MaxPerPage=function(t){return t>0&&(this._maxPerPage=t),this},e.prototype.Apply=function(t){return t&&(this._apply=this.toStringArray(t)),this},e.prototype.CustomQueryOptions=function(t){return t&&(this._customQueryOptions=Array.isArray(t)?t:[t]),this},e.prototype.GetUrl=function(t){var e=this._entitiesUri;t===s.ODataExecReturnType.Count&&(e=e+"/"+this.config.keys.count);var r=this.getQueryParams(t===s.ODataExecReturnType.PagedResult);return r.keys().length>0?e+"?"+r:e},e.prototype.Exec=function(t){var e=this.getQueryRequestOptions(t===s.ODataExecReturnType.PagedResult);switch(t){case s.ODataExecReturnType.Count:return this.execGetCount(e);case s.ODataExecReturnType.PagedResult:return this.execGetArrayDataWithCount(this._entitiesUri,e);default:return this.execGetArrayData(e)}},e.prototype.ExecWithCount=function(){return this.Exec(s.ODataExecReturnType.PagedResult)},e.prototype.NextPage=function(t){var e=this.getQueryRequestOptions(!1);return this.execGetArrayDataWithCount(t.nextLink,e)},e.prototype.execGetCount=function(t){var e=this,r=this._entitiesUri+"/"+this.config.keys.count;return this.http.get(r,t).pipe(o.map(function(t){return e.extractDataAsNumber(t,e.config)}),o.catchError(function(t,r){return e.config.handleError&&e.config.handleError(t,r),i.throwError(t)}))},e.prototype.execGetArrayDataWithCount=function(t,e){var r=this;return this.http.get(t,e).pipe(o.map(function(t){return r.extractArrayDataWithCount(t,r.config)}),o.catchError(function(t,e){return r.config.handleError&&r.config.handleError(t,e),i.throwError(t)}))},e.prototype.execGetArrayData=function(t){var e=this;return this.http.get(this._entitiesUri,t).pipe(o.map(function(t){return e.extractArrayData(t,e.config)}),o.catchError(function(t,r){return e.config.handleError&&e.config.handleError(t,r),i.throwError(t)}))},e.prototype.getQueryRequestOptions=function(t){var e=Object.assign({},this.config.defaultRequestOptions);return e.params=this.getQueryParams(t),this._maxPerPage>0&&(e.headers||(e.headers=new u.HttpHeaders),e.headers=e.headers.set("Prefer",this.config.keys.maxPerPage+"="+this._maxPerPage)),e},e.prototype.getQueryParams=function(e){var r=this,n=t.prototype.getParams.call(this);return this._filter&&(n=n.append(this.config.keys.filter,this._filter)),this._search&&(n=n.append(this.config.keys.search,this._search)),this._top>0&&(n=n.append(this.config.keys.top,this._top.toString())),this._skip>0&&(n=n.append(this.config.keys.skip,this._skip.toString())),this._orderBy.length>0&&(n=n.append(this.config.keys.orderBy,this.toCommaString(this._orderBy))),this._apply.length>0&&(n=n.append(this.config.keys.apply,this.toCommaString(this._apply))),this._customQueryOptions.length>0&&this._customQueryOptions.forEach(function(t){return n=n.append(r.checkReservedCustomQueryOptionKey(t.key),t.value)}),e&&(n=n.append("$count","true")),n},e.prototype.extractDataAsNumber=function(t,e){return e.extractQueryResultDataAsNumber(t)},e.prototype.extractArrayData=function(t,e){return e.extractQueryResultData(t)},e.prototype.extractArrayDataWithCount=function(t,e){return e.extractQueryResultDataWithCount(t)},e.prototype.checkReservedCustomQueryOptionKey=function(t){if(null===t||void 0===t)throw new Error("Custom query options MUST NOT be null or undefined.");if(0===t.indexOf("$")||0===t.indexOf("@"))throw new Error("Custom query options MUST NOT begin with a $ or @ character.");return t},e}(a.ODataOperation);e.ODataQuery=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(23),i=r(35),o=r(21),u=r(40),s=r(42),a=function(){function t(t,e,r){this._typeName=t,this._http=e,this.config=r,this._entitiesUri=r.getEntitiesUri(t)}return Object.defineProperty(t.prototype,"TypeName",{get:function(){return this._typeName},enumerable:!0,configurable:!0}),t.prototype.Get=function(t){return new o.GetOperation(this._typeName,this.config,this._http,t)},t.prototype.Post=function(t){return new o.PostOperation(this._typeName,this.config,this._http,t)},t.prototype.Patch=function(t,e){return new o.PatchOperation(this._typeName,this.config,this._http,e,t)},t.prototype.Put=function(t,e){return new o.PutOperation(this._typeName,this.config,this._http,e,t)},t.prototype.Delete=function(t){return new o.DeleteOperation(this._typeName,this.config,this._http,t)},t.prototype.CustomAction=function(t,e,r){var n=r?JSON.stringify(r):null;return this._http.post(this.getEntityUri(t)+"/"+e,n,this.config.customRequestOptions).pipe(i.map(function(t){return t}))},t.prototype.CustomCollectionAction=function(t,e){var r=e?JSON.stringify(e):null;return this._http.post(this._entitiesUri+"/"+t,r,this.config.customRequestOptions).pipe(i.map(function(t){return t}))},t.prototype.CustomFunction=function(t,e,r){if(r){e=e+"("+s.ODataUtils.convertObjectToString(r)+")"}else e.endsWith(")")||e.endsWith("()")||(e+="()");return this._http.get(this.getEntityUri(t)+"/"+e,this.config.defaultRequestOptions).pipe(i.map(function(t){return t}))},t.prototype.CustomCollectionFunction=function(t,e){if(e){t=t+"("+s.ODataUtils.convertObjectToString(e)+")"}else t.endsWith(")")||t.endsWith("()")||(t+="()");return this._http.get(this._entitiesUri+"/"+t,this.config.defaultRequestOptions).pipe(i.map(function(t){return t}))},t.prototype.ItemProperty=function(t,e){return this._http.get(this.getEntityUri(t)+"/"+e,this.config.defaultRequestOptions).pipe(i.map(function(t){return t.body}))},t.prototype.Query=function(){return new u.ODataQuery(this.TypeName,this.config,this._http)},t.prototype.getEntityUri=function(t){return this.config.getEntityUri(t,this._typeName)},t.prototype.handleResponse=function(t){var e=this;return t.pipe(i.map(this.extractData),i.catchError(function(t,r){return e.config.handleError&&e.config.handleError(t,r),n.throwError(t)}))},t.prototype.extractData=function(t){if(t.status<200||t.status>=300)throw new Error("Bad response status: "+t.status);return t.body||{}},t}();e.ODataService=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.convertObjectToString=function(e){var r=[];for(var n in e)if(e.hasOwnProperty(n)&&void 0!==e[n]){var i=t.quoteValue(e[n]);r.push(n+"="+i)}return r.join(", ")},t.quoteValue=function(e){if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return e;if("string"==typeof e){return"'"+e.replace(/'/g,"''")+"'"}if("boolean"==typeof e||"number"==typeof e)return""+e;var r=[];return Object.getOwnPropertyNames(e).forEach(function(n){var i=e[n];r.push(n+"="+t.quoteValue(i))}),r.length>0?r.join(", "):""+e},t.tryParseInt=function(t){if(null!==t&&!isNaN(t)){var e=parseInt(t,10);return{valid:!isNaN(e),value:e}}return{valid:!1,value:NaN}},t}();e.ODataUtils=n},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(44),o=r(22),u=function(){function t(){}return t.prototype.toList=function(){return new a(this.toArray())},t.prototype.toDictionary=function(t,e){return f.fromArray(this.toArray(),t,e)},t.prototype.reverse=function(){return new i.ReverseEnumerable(this.asEnumerable())},t.prototype.concat=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return(n=this.asEnumerable()).concat.apply(n,[t].concat(e));var n},t.prototype.contains=function(t){return this.any(function(e){return e===t})},t.prototype.where=function(t){return new i.ConditionalEnumerable(this.asEnumerable(),t)},t.prototype.select=function(t){return new i.TransformEnumerable(this.asEnumerable(),t)},t.prototype.selectMany=function(t){var e=function(e){var r=t(e);return r instanceof Array?new i.ArrayEnumerable(r):r.asEnumerable()};return this.select(e).toArray().reduce(function(t,e){return new i.ConcatEnumerable(t,e)},i.Enumerable.empty())},t.prototype.elementAt=function(t){var e=this.elementAtOrDefault(t);if(void 0===e)throw new Error("Out of bounds");return e},t.prototype.except=function(t){return this.asEnumerable().except(t)},t.prototype.first=function(t){var e;if(void 0===(e=void 0!==t?this.firstOrDefault(t):this.firstOrDefault()))throw new Error("Sequence contains no elements");return e},t.prototype.groupBy=function(t,e){for(var r=this.toArray(),n=new f,i=0;i<r.length;++i){var o=t(r[i]),u=void 0!==e?e(r[i]):r[i];n.containsKey(o)||n.set(o,new a),n.get(o).push(u)}return n.asEnumerable()},t.prototype.last=function(t){var e;if(void 0===(e=void 0!==t?this.lastOrDefault(t):this.lastOrDefault()))throw new Error("Sequence contains no elements");return e},t.prototype.single=function(t){var e;if(void 0===(e=void 0!==t?this.singleOrDefault(t):this.singleOrDefault()))throw new Error("Sequence contains no elements");return e},t.prototype.singleOrDefault=function(t){return void 0!==t?this.asEnumerable().singleOrDefault(t):this.asEnumerable().singleOrDefault()},t.prototype.skipWhile=function(t){return this.asEnumerable().skipWhile(t)},t.prototype.takeWhile=function(t){return this.asEnumerable().takeWhile(t)},t.prototype.sequenceEqual=function(t,e){return void 0!==e?this.asEnumerable().sequenceEqual(t,e):this.asEnumerable().sequenceEqual(t)},t.prototype.distinct=function(t){return new i.UniqueEnumerable(this.asEnumerable(),t)},t.prototype.min=function(t){return void 0!==t?new i.TransformEnumerable(this.asEnumerable(),t).min():this.aggregate(function(t,e){return void 0!==t&&t<e?t:e})},t.prototype.orderBy=function(t,e){return new i.OrderedEnumerable(this.asEnumerable(),o.createComparer(t,!0,e))},t.prototype.orderByDescending=function(t){return new i.OrderedEnumerable(this.asEnumerable(),o.createComparer(t,!1,void 0))},t.prototype.max=function(t){return void 0!==t?new i.TransformEnumerable(this.asEnumerable(),t).max():this.aggregate(function(t,e){return void 0!==t&&t>e?t:e})},t.prototype.sum=function(t){return this.aggregate(function(e,r){return e+t(r)},0)},t.prototype.skip=function(t){return new i.RangeEnumerable(this.asEnumerable(),t,void 0)},t.prototype.take=function(t){return new i.RangeEnumerable(this.asEnumerable(),void 0,t)},t.prototype.union=function(t){return new i.UniqueEnumerable(this.concat(t))},t.prototype.aggregate=function(t,e){return void 0!==e?this.asEnumerable().aggregate(t,e):this.asEnumerable().aggregate(t)},t.prototype.any=function(t){return void 0!==t?this.asEnumerable().any(t):this.asEnumerable().any()},t.prototype.all=function(t){return this.asEnumerable().all(t)},t.prototype.average=function(t){return this.asEnumerable().average(t)},t.prototype.count=function(t){return void 0!==t?this.asEnumerable().count(t):this.asEnumerable().count()},t.prototype.elementAtOrDefault=function(t){return this.asEnumerable().elementAtOrDefault(t)},t.prototype.firstOrDefault=function(t){return void 0!==t?this.asEnumerable().firstOrDefault(t):this.asEnumerable().firstOrDefault()},t.prototype.lastOrDefault=function(t){return void 0!==t?this.asEnumerable().lastOrDefault(t):this.asEnumerable().lastOrDefault()},t.prototype.forEach=function(t){return this.asEnumerable().forEach(t)},t.prototype.defaultIfEmpty=function(t){return void 0!==t?this.asEnumerable().defaultIfEmpty(t):this.asEnumerable().defaultIfEmpty()},t.prototype.zip=function(t,e){return this.asEnumerable().zip(t,e)},t}();e.EnumerableCollection=u;var s=function(t){function e(e){void 0===e&&(e=[]);var r=t.call(this)||this;return r.source=e,r}return n(e,t),e.prototype.asArray=function(){return this.source},e.prototype.toArray=function(){return[].concat(this.source)},e.prototype.toList=function(){return new a(this.toArray())},e.prototype.asEnumerable=function(){return new i.ArrayEnumerable(this.source)},e.prototype.aggregate=function(t,e){return void 0!==e?this.source.reduce(t,e):this.source.reduce(t)},e.prototype.any=function(t){return void 0!==t?this.source.some(t):this.source.length>0},e.prototype.all=function(t){return this.source.every(t)},e.prototype.average=function(t){if(0===this.count())throw new Error("Sequence contains no elements");for(var e=0,r=0,n=this.source.length;r<n;++r)e+=t(this.source[r]);return e/this.source.length},e.prototype.count=function(t){return void 0!==t?this.source.filter(t).length:this.source.length},e.prototype.elementAtOrDefault=function(t){if(t<0)throw new Error("Negative index is forbiden");return this.source[t]},e.prototype.firstOrDefault=function(t){return void 0!==t?this.source.filter(t)[0]:this.source[0]},e.prototype.groupBy=function(t,e){for(var r=this.asArray(),n=new f,i=0;i<r.length;++i){var o=t(r[i]),u=void 0!==e?e(r[i]):r[i];n.containsKey(o)||n.set(o,new a),n.get(o).push(u)}return n.asEnumerable()},e.prototype.lastOrDefault=function(t){if(void 0!==t){var e=this.source.filter(t);return e[e.length-1]}return this.source[this.source.length-1]},e.prototype.forEach=function(t){for(var e=0,r=this.source.length;e<r;++e)t(this.source[e],e)},e.prototype.sequenceEqual=function(t,r){if(void 0===r&&(r=o.strictEqualityComparer()),t instanceof e||t instanceof Array){var n=this.asArray(),i=t instanceof e?t.asArray():t;if(n.length!=i.length)return!1;for(var u=0;u<n.length;++u)if(!r(n[u],i[u]))return!1;return!0}return this.asEnumerable().sequenceEqual(t,r)},e}(u);e.ArrayQueryable=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.copy=function(){return new e(this.toArray())},e.prototype.asReadOnly=function(){return this},e.prototype.clear=function(){this.source=[]},e.prototype.remove=function(t){for(var e=[],r=0,n=this.source.length;r<n;++r)this.source[r]!==t&&e.push(this.source[r]);this.source=e},e.prototype.removeAt=function(t){if(t<0||void 0===this.source[t])throw new Error("Out of bounds");return this.source.splice(t,1)[0]},e.prototype.get=function(t){return this.source[t]},e.prototype.push=function(t){return this.source.push(t)},e.prototype.pushRange=function(t){return t instanceof Array||(t=t.toArray()),this.source.push.apply(this.source,t)},e.prototype.pushFront=function(t){return this.source.unshift(t)},e.prototype.pop=function(){return this.source.pop()},e.prototype.popFront=function(){return this.source.shift()},e.prototype.set=function(t,e){if(t<0)throw new Error("Out of bounds");this.source[t]=e},e.prototype.insert=function(t,e){if(t<0||t>this.source.length)throw new Error("Out of bounds");this.source.splice(t,0,e)},e.prototype.indexOf=function(t){return this.source.indexOf(t)},e}(s);e.List=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.copy=function(){return new e(this.toArray())},e.prototype.clear=function(){this.source=[]},e.prototype.peek=function(){return this.source[this.source.length-1]},e.prototype.pop=function(){return this.source.pop()},e.prototype.push=function(t){return this.source.push(t)},e}(s);e.Stack=c;var f=function(t){function e(e){var r=t.call(this)||this;if(r.clear(),void 0!==e)for(var n=0;n<e.length;++n){var i=e[n];r.set(i.key,i.value)}return r}return n(e,t),e.fromArray=function(t,r,n){return new e(t.map(function(t){return{key:r(t),value:n(t)}}))},e.fromJsObject=function(t){return new e(new a(Object.getOwnPropertyNames(t)).select(function(e){return{key:e,value:t[e]}}).toArray())},e.prototype.copy=function(){return new e(this.toArray())},e.prototype.asReadOnly=function(){return this},e.prototype.asEnumerable=function(){return new i.ArrayEnumerable(this.toArray())},e.prototype.toArray=function(){var t=this;return this.getKeys().select(function(e){return{key:e,value:t.dictionary[e]}}).toArray()},e.prototype.clear=function(){this.dictionary={}},e.prototype.containsKey=function(t){return this.dictionary.hasOwnProperty(t)},e.prototype.containsValue=function(t){for(var e=this.getKeysFast(),r=0;r<e.length;++r)if(this.dictionary[e[r]]===t)return!0;return!1},e.prototype.getKeys=function(){var t=this,e=this.getKeysFast();return new a(e.map(function(e){return"number"===t.keyType?parseFloat(e):e}))},e.prototype.getKeysFast=function(){return Object.getOwnPropertyNames(this.dictionary)},e.prototype.getValues=function(){for(var t=this.getKeysFast(),e=new Array(t.length),r=0;r<t.length;++r)e[r]=this.dictionary[t[r]];return new a(e)},e.prototype.remove=function(t){this.containsKey(t)&&delete this.dictionary[t]},e.prototype.get=function(t){if(!this.containsKey(t))throw new Error("Key doesn't exist: "+t);return this.dictionary[t]},e.prototype.set=function(t,e){if(this.containsKey(t))throw new Error("Key already exists: "+t);this.setOrUpdate(t,e)},e.prototype.setOrUpdate=function(t,e){void 0===this.keyType&&(this.keyType=typeof t),this.dictionary[t]=e},e}(u);e.Dictionary=f},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r(45),o=r(22),u=r(43),s=r(67),a=function(){function t(t){this.source=t}return t.prototype.reset=function(){this.source.reset()},t.prototype.next=function(){return this.source.next()},t.prototype.asEnumerable=function(){return this},t.prototype.toArray=function(){var t=[];for(this.reset();this.next();)t.push(this.value());return t},t.prototype.toList=function(){return new u.List(this.toArray())},t.prototype.toDictionary=function(t,e){return u.Dictionary.fromArray(this.toArray(),t,e)},t.prototype.count=function(t){if(void 0!==t)return new f(this,t).count();var e=0;for(this.reset();this.next();)++e;return e>>>0},t.prototype.any=function(t){return void 0!==t?new f(this,t).any():(this.reset(),this.next())},t.prototype.all=function(t){for(this.reset();this.next();)if(!t(this.value()))return!1;return!0},t.prototype.reverse=function(){return new b(this.copy())},t.prototype.contains=function(t){return this.any(function(e){return e===t})},t.prototype.sequenceEqual=function(t,e){void 0===e&&(e=o.strictEqualityComparer());var r=t instanceof Array?new g(t):t.asEnumerable();for(this.reset(),r.reset();this.next();)if(!r.next()||!e(this.value(),r.value()))return!1;return!r.next()},t.prototype.where=function(t){return new f(this.copy(),t)},t.prototype.select=function(t){return new v(this.copy(),t)},t.prototype.selectMany=function(t){var e=function(e){var r=t(e);return Array.isArray(r)?new g(r):r.asEnumerable()};return this.select(e).toArray().reduce(function(t,e){return new l(t,e)},c.empty())},t.prototype.skipWhile=function(t){return new h(this.copy(),t)},t.prototype.concat=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=function(t){return t instanceof Array?new g(t):t.asEnumerable()},i=new l(this.copy(),n(t).copy()),o=0,u=e.length;o<u;++o)i=new l(i,n(e[o]).copy());return i},t.prototype.defaultIfEmpty=function(t){return new _(this,t)},t.prototype.elementAt=function(t){var e=this.elementAtOrDefault(t);if(void 0===e)throw new Error("Out of bounds");return e},t.prototype.elementAtOrDefault=function(t){if(t<0)thr