uneeq-js 2.43.0 → 2.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=36)}([function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));
1
+ !function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=37)}([function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,14 +13,14 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(23),V=n(58),o=n(4),s=n(41),a=n(13),c=n(33),u=function(t){function e(n,r,i){var o=t.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=V.a;break;case 1:if(!n){o.destination=V.a;break}if("object"==typeof n){n instanceof e?(o.syncErrorThrowable=n.syncErrorThrowable,o.destination=n,n.add(o)):(o.syncErrorThrowable=!0,o.destination=new h(o,n));break}default:o.syncErrorThrowable=!0,o.destination=new h(o,n,r,i)}return o}return r.a(e,t),e.prototype[s.a]=function(){return this},e.create=function(t,n,r){var i=new e(t,n,r);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}(o.a),h=function(t){function e(e,n,r,o){var s,a=t.call(this)||this;a._parentSubscriber=e;var c=a;return Object(i.a)(n)?s=n:n&&(s=n.next,r=n.error,o=n.complete,n!==V.a&&(c=Object.create(n),Object(i.a)(c.unsubscribe)&&a.add(c.unsubscribe.bind(c)),c.unsubscribe=a.unsubscribe.bind(a))),a._context=c,a._next=s,a._error=r,a._complete=o,a}return r.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):Object(c.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(c.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};a.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),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;Object(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):(Object(c.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(u)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return c}));var r=n(0),i=n(1),V=n(3),o=n(32),s=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,n}return r.a(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(i.a),a=(i.a,function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(i.a));i.a;function c(t,e){if(!e.closed){if(t instanceof V.a)return t.subscribe(e);var n;try{n=Object(o.a)(t)(e)}catch(t){e.error(t)}return n}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(56),i=n(1),V=n(41),o=n(58);var s=n(20),a=n(39),c=n(13),u=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,s=function(t,e,n){if(t){if(t instanceof i.a)return t;if(t[V.a])return t[V.a]()}return t||e||n?new i.a(t,e,n):new i.a(o.a)}(t,e,n);if(r?s.add(r.call(s,this.source)):s.add(this.source||c.a.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),c.a.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){c.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),Object(r.a)(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=h(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),i&&i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[s.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:Object(a.b)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=h(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function h(t){if(t||(t=c.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(7),i=n(55),V=n(23),o=n(42),s=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this._parentOrParents,s=this._ctorUnsubscribe,c=this._unsubscribe,u=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var h=0;h<n.length;++h){n[h].remove(this)}if(Object(V.a)(c)){s&&(this._unsubscribe=void 0);try{c.call(this)}catch(t){e=t instanceof o.a?a(t.errors):[t]}}if(Object(r.a)(u)){h=-1;for(var l=u.length;++h<l;){var f=u[h];if(Object(i.a)(f))try{f.unsubscribe()}catch(t){e=e||[],t instanceof o.a?e=e.concat(a(t.errors)):e.push(t)}}}if(e)throw new o.a(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var V=this._subscriptions;return null===V?this._subscriptions=[n]:V.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function a(t){return t.reduce((function(t,e){return t.concat(e instanceof o.a?e.errors:e)}),[])}},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return h}));var r=n(0),i=n(3),V=n(1),o=n(4),s=n(21),a=n(74),c=n(41),u=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.a(e,t),e}(V.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 r.a(e,t),e.prototype[c.a]=function(){return new u(this)},e.prototype.lift=function(t){var e=new l(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,n=e.length,r=e.slice(),i=0;i<n;i++)r[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,n=e.length,r=e.slice(),i=0;i<n;i++)r[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,n=t.slice(),r=0;r<e;r++)n[r].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),o.a.EMPTY):this.isStopped?(t.complete(),o.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 l(t,e)},e}(i.a),l=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.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):o.a.EMPTY},e}(h)},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return V}));var r=n(29),i=new(n(27).a)(r.a),V=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(0),i=n(1);function V(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new o(t,e))}}var o=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,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.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}(i.a)},function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.schedule}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return V}));var r=n(3),i=new r.a((function(t){return t.complete()}));function V(t){return t?function(t){return new r.a((function(e){return t.schedule((function(){return e.complete()}))}))}(t):i}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(32),V=n(73);function o(t,e){return e?Object(V.a)(t,e):t instanceof r.a?t:new r.a(Object(i.a)(t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parent=e,i.outerValue=n,i.outerIndex=r,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n(1).a),V=n(32),o=n(3);function s(t,e,n,r,s){if(void 0===s&&(s=new i(t,n,r)),!s.closed)return e instanceof o.a?e.subscribe(s):Object(V.a)(e)(s)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},function(t,e,n){"use strict";function r(t){return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(n(1).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(0),i=n(1);function V(t,e){return function(n){return n.lift(new o(t,e))}}var o=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return s}));var r,i=n(10),V=n(35),o=n(50);r||(r={});var s=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return Object(V.a)(this.value);case"E":return Object(o.a)(this.error);case"C":return Object(i.b)()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}()},function(t,e,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(e,"a",(function(){return i}));var i=r()},function(t,e,n){"use strict";function r(){}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return u}));var r=n(0),i=n(8),V=n(11),o=n(2);function s(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(s((function(n,r){return Object(V.a)(t(n,r)).pipe(Object(i.a)((function(t,i){return e(n,t,r,i)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new a(t,n))})}var a=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.concurrent))},t}(),c=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new o.a(this),n=this.destination;n.add(e);var r=Object(o.c)(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(o.b),u=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(75),V=n(57);function o(t,e){return e?Object(V.a)(t,e):new r.a(Object(i.a)(t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(0),i=n(61),V=function(t){function e(n,r){void 0===r&&(r=i.a.now);var V=t.call(this,n,(function(){return e.delegate&&e.delegate!==V?e.delegate.now():r()}))||this;return V.actions=[],V.active=!1,V.scheduled=void 0,V}return r.a(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(5),V=n(4),o=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 r.a(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),V.a.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),V.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,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return r.a(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!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 n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return r.a(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(4).a))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(7);function i(t){return!Object(r.a)(t)&&t-parseFloat(t)+1>=0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(35),i=n(69);function V(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(i.a)()(r.a.apply(void 0,t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(75),i=n(33),V=n(18),o=n(20),s=n(76),a=n(77),c=n(55),u=function(t){if(t&&"function"==typeof t[o.a])return u=t,function(t){var e=u[o.a]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Object(s.a)(t))return Object(r.a)(t);if(Object(a.a)(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,i.a),t};if(t&&"function"==typeof t[V.a])return e=t,function(t){for(var n=e[V.a]();;){var r=void 0;try{r=n.next()}catch(e){return t.error(e),t}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var e,n,u,h=Object(c.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+h+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},function(t,e,n){"use strict";function r(t){setTimeout((function(){throw t}),0)}n.d(e,"a",(function(){return r}))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(9),i=n(26),V=n(57);function o(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(r.a)(n)?(t.pop(),Object(V.a)(t,n)):Object(i.a)(t)}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),n(100);const s=V(n(82)),a=n(84);o(n(63),e);var c=n(84);Object.defineProperty(e,"Uneeq",{enumerable:!0,get:function(){return c.Uneeq}}),o(n(82),e),window.AdapterJS=s,window.Uneeq=a.Uneeq},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.logger=e.Logger=e.LogType=void 0,function(t){t.debug="debug",t.log="log",t.warn="warn",t.error="error"}(r=e.LogType||(e.LogType={}));class i{constructor(){this.enabled=!1}log(t,...e){this.emitLogMessage(r.log,t,e)}warn(t,...e){this.emitLogMessage(r.warn,t,e)}error(t,...e){this.emitLogMessage(r.error,t,e)}debug(t,...e){this.emitLogMessage(r.debug,t,e)}emitLogMessage(t,e,n){(this.enabled||t===r.error)&&(n.length>0?console[t](e,n):console[t](e))}}e.Logger=i,e.logger=new i},function(t,e){var n,r,i=t.exports={};function V(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===V||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:V}catch(t){n=V}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,h=-1;function l(){u&&a&&(u=!1,a.length?c=a.concat(c):h=-1,c.length&&f())}function f(){if(!u){var t=s(l);u=!0;for(var e=c.length;e;){for(a=c,c=[];++h<e;)a&&a[h].run();h=-1,e=c.length}a=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||u||s(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return V}));var r=n(14);function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return V(t)}function V(t){return 0===t.length?r.a:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return h})),n.d(e,"a",(function(){return l}));var r=n(0),i=1,V=function(){return Promise.resolve()}(),o={};function s(t){return t in o&&(delete o[t],!0)}var a=function(t){var e=i++;return o[e]=!0,V.then((function(){return s(e)&&t()})),e},c=function(t){s(t)},u=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.a(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=a(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(c(n),e.scheduled=void 0)},e}(n(29).a),h=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},e}(n(27).a))(u),l=h},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";const r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(t){return t.trim().split("\n").map(t=>t.trim())},r.splitSections=function(t){return t.split("\nm=").map((t,e)=>(e>0?"m="+t:t).trim()+"\r\n")},r.getDescription=function(t){const e=r.splitSections(t);return e&&e[0]},r.getMediaSections=function(t){const e=r.splitSections(t);return e.shift(),e},r.matchPrefix=function(t,e){return r.splitLines(t).filter(t=>0===t.indexOf(e))},r.parseCandidate=function(t){let e;e=0===t.indexOf("a=candidate:")?t.substring(12).split(" "):t.substring(10).split(" ");const n={foundation:e[0],component:{1:"rtp",2:"rtcp"}[e[1]]||e[1],protocol:e[2].toLowerCase(),priority:parseInt(e[3],10),ip:e[4],address:e[4],port:parseInt(e[5],10),type:e[7]};for(let t=8;t<e.length;t+=2)switch(e[t]){case"raddr":n.relatedAddress=e[t+1];break;case"rport":n.relatedPort=parseInt(e[t+1],10);break;case"tcptype":n.tcpType=e[t+1];break;case"ufrag":n.ufrag=e[t+1],n.usernameFragment=e[t+1];break;default:void 0===n[e[t]]&&(n[e[t]]=e[t+1])}return n},r.writeCandidate=function(t){const e=[];e.push(t.foundation);const n=t.component;"rtp"===n?e.push(1):"rtcp"===n?e.push(2):e.push(n),e.push(t.protocol.toUpperCase()),e.push(t.priority),e.push(t.address||t.ip),e.push(t.port);const r=t.type;return e.push("typ"),e.push(r),"host"!==r&&t.relatedAddress&&t.relatedPort&&(e.push("raddr"),e.push(t.relatedAddress),e.push("rport"),e.push(t.relatedPort)),t.tcpType&&"tcp"===t.protocol.toLowerCase()&&(e.push("tcptype"),e.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(e.push("ufrag"),e.push(t.usernameFragment||t.ufrag)),"candidate:"+e.join(" ")},r.parseIceOptions=function(t){return t.substr(14).split(" ")},r.parseRtpMap=function(t){let e=t.substr(9).split(" ");const n={payloadType:parseInt(e.shift(),10)};return e=e[0].split("/"),n.name=e[0],n.clockRate=parseInt(e[1],10),n.channels=3===e.length?parseInt(e[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(t){let e=t.payloadType;void 0!==t.preferredPayloadType&&(e=t.preferredPayloadType);const n=t.channels||t.numChannels||1;return"a=rtpmap:"+e+" "+t.name+"/"+t.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(t){const e=t.substr(9).split(" ");return{id:parseInt(e[0],10),direction:e[0].indexOf("/")>0?e[0].split("/")[1]:"sendrecv",uri:e[1]}},r.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&"sendrecv"!==t.direction?"/"+t.direction:"")+" "+t.uri+"\r\n"},r.parseFmtp=function(t){const e={};let n;const r=t.substr(t.indexOf(" ")+1).split(";");for(let t=0;t<r.length;t++)n=r[t].trim().split("="),e[n[0].trim()]=n[1];return e},r.writeFmtp=function(t){let e="",n=t.payloadType;if(void 0!==t.preferredPayloadType&&(n=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){const r=[];Object.keys(t.parameters).forEach(e=>{void 0!==t.parameters[e]?r.push(e+"="+t.parameters[e]):r.push(e)}),e+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return e},r.parseRtcpFb=function(t){const e=t.substr(t.indexOf(" ")+1).split(" ");return{type:e.shift(),parameter:e.join(" ")}},r.writeRtcpFb=function(t){let e="",n=t.payloadType;return void 0!==t.preferredPayloadType&&(n=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach(t=>{e+="a=rtcp-fb:"+n+" "+t.type+(t.parameter&&t.parameter.length?" "+t.parameter:"")+"\r\n"}),e},r.parseSsrcMedia=function(t){const e=t.indexOf(" "),n={ssrc:parseInt(t.substr(7,e-7),10)},r=t.indexOf(":",e);return r>-1?(n.attribute=t.substr(e+1,r-e-1),n.value=t.substr(r+1)):n.attribute=t.substr(e+1),n},r.parseSsrcGroup=function(t){const e=t.substr(13).split(" ");return{semantics:e.shift(),ssrcs:e.map(t=>parseInt(t,10))}},r.getMid=function(t){const e=r.matchPrefix(t,"a=mid:")[0];if(e)return e.substr(6)},r.parseFingerprint=function(t){const e=t.substr(14).split(" ");return{algorithm:e[0].toLowerCase(),value:e[1].toUpperCase()}},r.getDtlsParameters=function(t,e){return{role:"auto",fingerprints:r.matchPrefix(t+e,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(t,e){let n="a=setup:"+e+"\r\n";return t.fingerprints.forEach(t=>{n+="a=fingerprint:"+t.algorithm+" "+t.value+"\r\n"}),n},r.parseCryptoLine=function(t){const e=t.substr(9).split(" ");return{tag:parseInt(e[0],10),cryptoSuite:e[1],keyParams:e[2],sessionParams:e.slice(3)}},r.writeCryptoLine=function(t){return"a=crypto:"+t.tag+" "+t.cryptoSuite+" "+("object"==typeof t.keyParams?r.writeCryptoKeyParams(t.keyParams):t.keyParams)+(t.sessionParams?" "+t.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(t){if(0!==t.indexOf("inline:"))return null;const e=t.substr(7).split("|");return{keyMethod:"inline",keySalt:e[0],lifeTime:e[1],mkiValue:e[2]?e[2].split(":")[0]:void 0,mkiLength:e[2]?e[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(t){return t.keyMethod+":"+t.keySalt+(t.lifeTime?"|"+t.lifeTime:"")+(t.mkiValue&&t.mkiLength?"|"+t.mkiValue+":"+t.mkiLength:"")},r.getCryptoParameters=function(t,e){return r.matchPrefix(t+e,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(t,e){const n=r.matchPrefix(t+e,"a=ice-ufrag:")[0],i=r.matchPrefix(t+e,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},r.writeIceParameters=function(t){let e="a=ice-ufrag:"+t.usernameFragment+"\r\na=ice-pwd:"+t.password+"\r\n";return t.iceLite&&(e+="a=ice-lite\r\n"),e},r.parseRtpParameters=function(t){const e={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(t)[0].split(" ");for(let i=3;i<n.length;i++){const V=n[i],o=r.matchPrefix(t,"a=rtpmap:"+V+" ")[0];if(o){const n=r.parseRtpMap(o),i=r.matchPrefix(t,"a=fmtp:"+V+" ");switch(n.parameters=i.length?r.parseFmtp(i[0]):{},n.rtcpFeedback=r.matchPrefix(t,"a=rtcp-fb:"+V+" ").map(r.parseRtcpFb),e.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":e.fecMechanisms.push(n.name.toUpperCase())}}}return r.matchPrefix(t,"a=extmap:").forEach(t=>{e.headerExtensions.push(r.parseExtmap(t))}),e},r.writeRtpDescription=function(t,e){let n="";n+="m="+t+" ",n+=e.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=e.codecs.map(t=>void 0!==t.preferredPayloadType?t.preferredPayloadType:t.payloadType).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",e.codecs.forEach(t=>{n+=r.writeRtpMap(t),n+=r.writeFmtp(t),n+=r.writeRtcpFb(t)});let i=0;return e.codecs.forEach(t=>{t.maxptime>i&&(i=t.maxptime)}),i>0&&(n+="a=maxptime:"+i+"\r\n"),e.headerExtensions&&e.headerExtensions.forEach(t=>{n+=r.writeExtmap(t)}),n},r.parseRtpEncodingParameters=function(t){const e=[],n=r.parseRtpParameters(t),i=-1!==n.fecMechanisms.indexOf("RED"),V=-1!==n.fecMechanisms.indexOf("ULPFEC"),o=r.matchPrefix(t,"a=ssrc:").map(t=>r.parseSsrcMedia(t)).filter(t=>"cname"===t.attribute),s=o.length>0&&o[0].ssrc;let a;const c=r.matchPrefix(t,"a=ssrc-group:FID").map(t=>t.substr(17).split(" ").map(t=>parseInt(t,10)));c.length>0&&c[0].length>1&&c[0][0]===s&&(a=c[0][1]),n.codecs.forEach(t=>{if("RTX"===t.name.toUpperCase()&&t.parameters.apt){let n={ssrc:s,codecPayloadType:parseInt(t.parameters.apt,10)};s&&a&&(n.rtx={ssrc:a}),e.push(n),i&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:s,mechanism:V?"red+ulpfec":"red"},e.push(n))}}),0===e.length&&s&&e.push({ssrc:s});let u=r.matchPrefix(t,"b=");return u.length&&(u=0===u[0].indexOf("b=TIAS:")?parseInt(u[0].substr(7),10):0===u[0].indexOf("b=AS:")?1e3*parseInt(u[0].substr(5),10)*.95-16e3:void 0,e.forEach(t=>{t.maxBitrate=u})),e},r.parseRtcpParameters=function(t){const e={},n=r.matchPrefix(t,"a=ssrc:").map(t=>r.parseSsrcMedia(t)).filter(t=>"cname"===t.attribute)[0];n&&(e.cname=n.value,e.ssrc=n.ssrc);const i=r.matchPrefix(t,"a=rtcp-rsize");e.reducedSize=i.length>0,e.compound=0===i.length;const V=r.matchPrefix(t,"a=rtcp-mux");return e.mux=V.length>0,e},r.writeRtcpParameters=function(t){let e="";return t.reducedSize&&(e+="a=rtcp-rsize\r\n"),t.mux&&(e+="a=rtcp-mux\r\n"),void 0!==t.ssrc&&t.cname&&(e+="a=ssrc:"+t.ssrc+" cname:"+t.cname+"\r\n"),e},r.parseMsid=function(t){let e;const n=r.matchPrefix(t,"a=msid:");if(1===n.length)return e=n[0].substr(7).split(" "),{stream:e[0],track:e[1]};const i=r.matchPrefix(t,"a=ssrc:").map(t=>r.parseSsrcMedia(t)).filter(t=>"msid"===t.attribute);return i.length>0?(e=i[0].value.split(" "),{stream:e[0],track:e[1]}):void 0},r.parseSctpDescription=function(t){const e=r.parseMLine(t),n=r.matchPrefix(t,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substr(19),10)),isNaN(i)&&(i=65536);const V=r.matchPrefix(t,"a=sctp-port:");if(V.length>0)return{port:parseInt(V[0].substr(12),10),protocol:e.fmt,maxMessageSize:i};const o=r.matchPrefix(t,"a=sctpmap:");if(o.length>0){const t=o[0].substr(10).split(" ");return{port:parseInt(t[0],10),protocol:t[1],maxMessageSize:i}}},r.writeSctpDescription=function(t,e){let n=[];return n="DTLS/SCTP"!==t.protocol?["m="+t.kind+" 9 "+t.protocol+" "+e.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+e.port+"\r\n"]:["m="+t.kind+" 9 "+t.protocol+" "+e.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+e.port+" "+e.protocol+" 65535\r\n"],void 0!==e.maxMessageSize&&n.push("a=max-message-size:"+e.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(t,e,n){let i;const V=void 0!==e?e:2;i=t||r.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+V+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.getDirection=function(t,e){const n=r.splitLines(t);for(let t=0;t<n.length;t++)switch(n[t]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[t].substr(2)}return e?r.getDirection(e):"sendrecv"},r.getKind=function(t){return r.splitLines(t)[0].split(" ")[0].substr(2)},r.isRejected=function(t){return"0"===t.split(" ",2)[1]},r.parseMLine=function(t){const e=r.splitLines(t)[0].substr(2).split(" ");return{kind:e[0],port:parseInt(e[1],10),protocol:e[2],fmt:e.slice(3).join(" ")}},r.parseOLine=function(t){const e=r.matchPrefix(t,"o=")[0].substr(2).split(" ");return{username:e[0],sessionId:e[1],sessionVersion:parseInt(e[2],10),netType:e[3],addressType:e[4],address:e[5]}},r.isValidSDP=function(t){if("string"!=typeof t||0===t.length)return!1;const e=r.splitLines(t);for(let t=0;t<e.length;t++)if(e[t].length<2||"="!==e[t].charAt(1))return!1;return!0},t.exports=r},function(t,e,n){"use strict";(function(t){
16
+ var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(23),V=n(58),o=n(4),s=n(41),a=n(13),c=n(33),u=function(t){function e(n,r,i){var o=t.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=V.a;break;case 1:if(!n){o.destination=V.a;break}if("object"==typeof n){n instanceof e?(o.syncErrorThrowable=n.syncErrorThrowable,o.destination=n,n.add(o)):(o.syncErrorThrowable=!0,o.destination=new h(o,n));break}default:o.syncErrorThrowable=!0,o.destination=new h(o,n,r,i)}return o}return r.a(e,t),e.prototype[s.a]=function(){return this},e.create=function(t,n,r){var i=new e(t,n,r);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}(o.a),h=function(t){function e(e,n,r,o){var s,a=t.call(this)||this;a._parentSubscriber=e;var c=a;return Object(i.a)(n)?s=n:n&&(s=n.next,r=n.error,o=n.complete,n!==V.a&&(c=Object.create(n),Object(i.a)(c.unsubscribe)&&a.add(c.unsubscribe.bind(c)),c.unsubscribe=a.unsubscribe.bind(a))),a._context=c,a._next=s,a._error=r,a._complete=o,a}return r.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):Object(c.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(c.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};a.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),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;Object(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):(Object(c.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(u)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return c}));var r=n(0),i=n(1),V=n(3),o=n(32),s=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,n}return r.a(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(i.a),a=(i.a,function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(i.a));i.a;function c(t,e){if(!e.closed){if(t instanceof V.a)return t.subscribe(e);var n;try{n=Object(o.a)(t)(e)}catch(t){e.error(t)}return n}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(56),i=n(1),V=n(41),o=n(58);var s=n(20),a=n(39),c=n(13),u=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,s=function(t,e,n){if(t){if(t instanceof i.a)return t;if(t[V.a])return t[V.a]()}return t||e||n?new i.a(t,e,n):new i.a(o.a)}(t,e,n);if(r?s.add(r.call(s,this.source)):s.add(this.source||c.a.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),c.a.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){c.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),Object(r.a)(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=h(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),i&&i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[s.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:Object(a.b)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=h(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function h(t){if(t||(t=c.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(7),i=n(55),V=n(23),o=n(42),s=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this._parentOrParents,s=this._ctorUnsubscribe,c=this._unsubscribe,u=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var h=0;h<n.length;++h){n[h].remove(this)}if(Object(V.a)(c)){s&&(this._unsubscribe=void 0);try{c.call(this)}catch(t){e=t instanceof o.a?a(t.errors):[t]}}if(Object(r.a)(u)){h=-1;for(var l=u.length;++h<l;){var f=u[h];if(Object(i.a)(f))try{f.unsubscribe()}catch(t){e=e||[],t instanceof o.a?e=e.concat(a(t.errors)):e.push(t)}}}if(e)throw new o.a(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var V=this._subscriptions;return null===V?this._subscriptions=[n]:V.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function a(t){return t.reduce((function(t,e){return t.concat(e instanceof o.a?e.errors:e)}),[])}},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return h}));var r=n(0),i=n(3),V=n(1),o=n(4),s=n(21),a=n(74),c=n(41),u=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.a(e,t),e}(V.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 r.a(e,t),e.prototype[c.a]=function(){return new u(this)},e.prototype.lift=function(t){var e=new l(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,n=e.length,r=e.slice(),i=0;i<n;i++)r[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,n=e.length,r=e.slice(),i=0;i<n;i++)r[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,n=t.slice(),r=0;r<e;r++)n[r].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),o.a.EMPTY):this.isStopped?(t.complete(),o.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 l(t,e)},e}(i.a),l=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.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):o.a.EMPTY},e}(h)},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return V}));var r=n(29),i=new(n(27).a)(r.a),V=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(0),i=n(1);function V(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new o(t,e))}}var o=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,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.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}(i.a)},function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.schedule}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return V}));var r=n(3),i=new r.a((function(t){return t.complete()}));function V(t){return t?function(t){return new r.a((function(e){return t.schedule((function(){return e.complete()}))}))}(t):i}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(32),V=n(73);function o(t,e){return e?Object(V.a)(t,e):t instanceof r.a?t:new r.a(Object(i.a)(t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parent=e,i.outerValue=n,i.outerIndex=r,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n(1).a),V=n(32),o=n(3);function s(t,e,n,r,s){if(void 0===s&&(s=new i(t,n,r)),!s.closed)return e instanceof o.a?e.subscribe(s):Object(V.a)(e)(s)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},function(t,e,n){"use strict";function r(t){return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(n(1).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(0),i=n(1);function V(t,e){return function(n){return n.lift(new o(t,e))}}var o=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return s}));var r,i=n(10),V=n(36),o=n(50);r||(r={});var s=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return Object(V.a)(this.value);case"E":return Object(o.a)(this.error);case"C":return Object(i.b)()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}()},function(t,e,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(e,"a",(function(){return i}));var i=r()},function(t,e,n){"use strict";function r(){}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return u}));var r=n(0),i=n(8),V=n(11),o=n(2);function s(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(s((function(n,r){return Object(V.a)(t(n,r)).pipe(Object(i.a)((function(t,i){return e(n,t,r,i)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new a(t,n))})}var a=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.concurrent))},t}(),c=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new o.a(this),n=this.destination;n.add(e);var r=Object(o.c)(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(o.b),u=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(75),V=n(57);function o(t,e){return e?Object(V.a)(t,e):new r.a(Object(i.a)(t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(0),i=n(61),V=function(t){function e(n,r){void 0===r&&(r=i.a.now);var V=t.call(this,n,(function(){return e.delegate&&e.delegate!==V?e.delegate.now():r()}))||this;return V.actions=[],V.active=!1,V.scheduled=void 0,V}return r.a(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(5),V=n(4),o=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 r.a(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),V.a.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),V.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,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return r.a(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!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 n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return r.a(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(4).a))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(7);function i(t){return!Object(r.a)(t)&&t-parseFloat(t)+1>=0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(36),i=n(69);function V(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(i.a)()(r.a.apply(void 0,t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(75),i=n(33),V=n(18),o=n(20),s=n(76),a=n(77),c=n(55),u=function(t){if(t&&"function"==typeof t[o.a])return u=t,function(t){var e=u[o.a]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Object(s.a)(t))return Object(r.a)(t);if(Object(a.a)(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,i.a),t};if(t&&"function"==typeof t[V.a])return e=t,function(t){for(var n=e[V.a]();;){var r=void 0;try{r=n.next()}catch(e){return t.error(e),t}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var e,n,u,h=Object(c.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+h+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},function(t,e,n){"use strict";function r(t){setTimeout((function(){throw t}),0)}n.d(e,"a",(function(){return r}))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.logger=e.Logger=e.LogType=void 0,function(t){t.debug="debug",t.log="log",t.warn="warn",t.error="error"}(r=e.LogType||(e.LogType={}));class i{constructor(){this.enabled=!1}log(t,...e){this.emitLogMessage(r.log,t,e)}warn(t,...e){this.emitLogMessage(r.warn,t,e)}error(t,...e){this.emitLogMessage(r.error,t,e)}debug(t,...e){this.emitLogMessage(r.debug,t,e)}emitLogMessage(t,e,n){(this.enabled||t===r.error)&&(n.length>0?console[t](e,n):console[t](e))}}e.Logger=i,e.logger=new i},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(9),i=n(26),V=n(57);function o(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(r.a)(n)?(t.pop(),Object(V.a)(t,n)):Object(i.a)(t)}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),n(100);const s=V(n(82)),a=n(84);o(n(63),e);var c=n(84);Object.defineProperty(e,"Uneeq",{enumerable:!0,get:function(){return c.Uneeq}}),o(n(82),e),window.AdapterJS=s,window.Uneeq=a.Uneeq},function(t,e){var n,r,i=t.exports={};function V(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===V||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:V}catch(t){n=V}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,h=-1;function l(){u&&a&&(u=!1,a.length?c=a.concat(c):h=-1,c.length&&f())}function f(){if(!u){var t=s(l);u=!0;for(var e=c.length;e;){for(a=c,c=[];++h<e;)a&&a[h].run();h=-1,e=c.length}a=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||u||s(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return V}));var r=n(14);function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return V(t)}function V(t){return 0===t.length?r.a:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return h})),n.d(e,"a",(function(){return l}));var r=n(0),i=1,V=function(){return Promise.resolve()}(),o={};function s(t){return t in o&&(delete o[t],!0)}var a=function(t){var e=i++;return o[e]=!0,V.then((function(){return s(e)&&t()})),e},c=function(t){s(t)},u=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.a(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=a(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(c(n),e.scheduled=void 0)},e}(n(29).a),h=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},e}(n(27).a))(u),l=h},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";const r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(t){return t.trim().split("\n").map(t=>t.trim())},r.splitSections=function(t){return t.split("\nm=").map((t,e)=>(e>0?"m="+t:t).trim()+"\r\n")},r.getDescription=function(t){const e=r.splitSections(t);return e&&e[0]},r.getMediaSections=function(t){const e=r.splitSections(t);return e.shift(),e},r.matchPrefix=function(t,e){return r.splitLines(t).filter(t=>0===t.indexOf(e))},r.parseCandidate=function(t){let e;e=0===t.indexOf("a=candidate:")?t.substring(12).split(" "):t.substring(10).split(" ");const n={foundation:e[0],component:{1:"rtp",2:"rtcp"}[e[1]]||e[1],protocol:e[2].toLowerCase(),priority:parseInt(e[3],10),ip:e[4],address:e[4],port:parseInt(e[5],10),type:e[7]};for(let t=8;t<e.length;t+=2)switch(e[t]){case"raddr":n.relatedAddress=e[t+1];break;case"rport":n.relatedPort=parseInt(e[t+1],10);break;case"tcptype":n.tcpType=e[t+1];break;case"ufrag":n.ufrag=e[t+1],n.usernameFragment=e[t+1];break;default:void 0===n[e[t]]&&(n[e[t]]=e[t+1])}return n},r.writeCandidate=function(t){const e=[];e.push(t.foundation);const n=t.component;"rtp"===n?e.push(1):"rtcp"===n?e.push(2):e.push(n),e.push(t.protocol.toUpperCase()),e.push(t.priority),e.push(t.address||t.ip),e.push(t.port);const r=t.type;return e.push("typ"),e.push(r),"host"!==r&&t.relatedAddress&&t.relatedPort&&(e.push("raddr"),e.push(t.relatedAddress),e.push("rport"),e.push(t.relatedPort)),t.tcpType&&"tcp"===t.protocol.toLowerCase()&&(e.push("tcptype"),e.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(e.push("ufrag"),e.push(t.usernameFragment||t.ufrag)),"candidate:"+e.join(" ")},r.parseIceOptions=function(t){return t.substr(14).split(" ")},r.parseRtpMap=function(t){let e=t.substr(9).split(" ");const n={payloadType:parseInt(e.shift(),10)};return e=e[0].split("/"),n.name=e[0],n.clockRate=parseInt(e[1],10),n.channels=3===e.length?parseInt(e[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(t){let e=t.payloadType;void 0!==t.preferredPayloadType&&(e=t.preferredPayloadType);const n=t.channels||t.numChannels||1;return"a=rtpmap:"+e+" "+t.name+"/"+t.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(t){const e=t.substr(9).split(" ");return{id:parseInt(e[0],10),direction:e[0].indexOf("/")>0?e[0].split("/")[1]:"sendrecv",uri:e[1]}},r.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&"sendrecv"!==t.direction?"/"+t.direction:"")+" "+t.uri+"\r\n"},r.parseFmtp=function(t){const e={};let n;const r=t.substr(t.indexOf(" ")+1).split(";");for(let t=0;t<r.length;t++)n=r[t].trim().split("="),e[n[0].trim()]=n[1];return e},r.writeFmtp=function(t){let e="",n=t.payloadType;if(void 0!==t.preferredPayloadType&&(n=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){const r=[];Object.keys(t.parameters).forEach(e=>{void 0!==t.parameters[e]?r.push(e+"="+t.parameters[e]):r.push(e)}),e+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return e},r.parseRtcpFb=function(t){const e=t.substr(t.indexOf(" ")+1).split(" ");return{type:e.shift(),parameter:e.join(" ")}},r.writeRtcpFb=function(t){let e="",n=t.payloadType;return void 0!==t.preferredPayloadType&&(n=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach(t=>{e+="a=rtcp-fb:"+n+" "+t.type+(t.parameter&&t.parameter.length?" "+t.parameter:"")+"\r\n"}),e},r.parseSsrcMedia=function(t){const e=t.indexOf(" "),n={ssrc:parseInt(t.substr(7,e-7),10)},r=t.indexOf(":",e);return r>-1?(n.attribute=t.substr(e+1,r-e-1),n.value=t.substr(r+1)):n.attribute=t.substr(e+1),n},r.parseSsrcGroup=function(t){const e=t.substr(13).split(" ");return{semantics:e.shift(),ssrcs:e.map(t=>parseInt(t,10))}},r.getMid=function(t){const e=r.matchPrefix(t,"a=mid:")[0];if(e)return e.substr(6)},r.parseFingerprint=function(t){const e=t.substr(14).split(" ");return{algorithm:e[0].toLowerCase(),value:e[1].toUpperCase()}},r.getDtlsParameters=function(t,e){return{role:"auto",fingerprints:r.matchPrefix(t+e,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(t,e){let n="a=setup:"+e+"\r\n";return t.fingerprints.forEach(t=>{n+="a=fingerprint:"+t.algorithm+" "+t.value+"\r\n"}),n},r.parseCryptoLine=function(t){const e=t.substr(9).split(" ");return{tag:parseInt(e[0],10),cryptoSuite:e[1],keyParams:e[2],sessionParams:e.slice(3)}},r.writeCryptoLine=function(t){return"a=crypto:"+t.tag+" "+t.cryptoSuite+" "+("object"==typeof t.keyParams?r.writeCryptoKeyParams(t.keyParams):t.keyParams)+(t.sessionParams?" "+t.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(t){if(0!==t.indexOf("inline:"))return null;const e=t.substr(7).split("|");return{keyMethod:"inline",keySalt:e[0],lifeTime:e[1],mkiValue:e[2]?e[2].split(":")[0]:void 0,mkiLength:e[2]?e[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(t){return t.keyMethod+":"+t.keySalt+(t.lifeTime?"|"+t.lifeTime:"")+(t.mkiValue&&t.mkiLength?"|"+t.mkiValue+":"+t.mkiLength:"")},r.getCryptoParameters=function(t,e){return r.matchPrefix(t+e,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(t,e){const n=r.matchPrefix(t+e,"a=ice-ufrag:")[0],i=r.matchPrefix(t+e,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},r.writeIceParameters=function(t){let e="a=ice-ufrag:"+t.usernameFragment+"\r\na=ice-pwd:"+t.password+"\r\n";return t.iceLite&&(e+="a=ice-lite\r\n"),e},r.parseRtpParameters=function(t){const e={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(t)[0].split(" ");for(let i=3;i<n.length;i++){const V=n[i],o=r.matchPrefix(t,"a=rtpmap:"+V+" ")[0];if(o){const n=r.parseRtpMap(o),i=r.matchPrefix(t,"a=fmtp:"+V+" ");switch(n.parameters=i.length?r.parseFmtp(i[0]):{},n.rtcpFeedback=r.matchPrefix(t,"a=rtcp-fb:"+V+" ").map(r.parseRtcpFb),e.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":e.fecMechanisms.push(n.name.toUpperCase())}}}return r.matchPrefix(t,"a=extmap:").forEach(t=>{e.headerExtensions.push(r.parseExtmap(t))}),e},r.writeRtpDescription=function(t,e){let n="";n+="m="+t+" ",n+=e.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=e.codecs.map(t=>void 0!==t.preferredPayloadType?t.preferredPayloadType:t.payloadType).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",e.codecs.forEach(t=>{n+=r.writeRtpMap(t),n+=r.writeFmtp(t),n+=r.writeRtcpFb(t)});let i=0;return e.codecs.forEach(t=>{t.maxptime>i&&(i=t.maxptime)}),i>0&&(n+="a=maxptime:"+i+"\r\n"),e.headerExtensions&&e.headerExtensions.forEach(t=>{n+=r.writeExtmap(t)}),n},r.parseRtpEncodingParameters=function(t){const e=[],n=r.parseRtpParameters(t),i=-1!==n.fecMechanisms.indexOf("RED"),V=-1!==n.fecMechanisms.indexOf("ULPFEC"),o=r.matchPrefix(t,"a=ssrc:").map(t=>r.parseSsrcMedia(t)).filter(t=>"cname"===t.attribute),s=o.length>0&&o[0].ssrc;let a;const c=r.matchPrefix(t,"a=ssrc-group:FID").map(t=>t.substr(17).split(" ").map(t=>parseInt(t,10)));c.length>0&&c[0].length>1&&c[0][0]===s&&(a=c[0][1]),n.codecs.forEach(t=>{if("RTX"===t.name.toUpperCase()&&t.parameters.apt){let n={ssrc:s,codecPayloadType:parseInt(t.parameters.apt,10)};s&&a&&(n.rtx={ssrc:a}),e.push(n),i&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:s,mechanism:V?"red+ulpfec":"red"},e.push(n))}}),0===e.length&&s&&e.push({ssrc:s});let u=r.matchPrefix(t,"b=");return u.length&&(u=0===u[0].indexOf("b=TIAS:")?parseInt(u[0].substr(7),10):0===u[0].indexOf("b=AS:")?1e3*parseInt(u[0].substr(5),10)*.95-16e3:void 0,e.forEach(t=>{t.maxBitrate=u})),e},r.parseRtcpParameters=function(t){const e={},n=r.matchPrefix(t,"a=ssrc:").map(t=>r.parseSsrcMedia(t)).filter(t=>"cname"===t.attribute)[0];n&&(e.cname=n.value,e.ssrc=n.ssrc);const i=r.matchPrefix(t,"a=rtcp-rsize");e.reducedSize=i.length>0,e.compound=0===i.length;const V=r.matchPrefix(t,"a=rtcp-mux");return e.mux=V.length>0,e},r.writeRtcpParameters=function(t){let e="";return t.reducedSize&&(e+="a=rtcp-rsize\r\n"),t.mux&&(e+="a=rtcp-mux\r\n"),void 0!==t.ssrc&&t.cname&&(e+="a=ssrc:"+t.ssrc+" cname:"+t.cname+"\r\n"),e},r.parseMsid=function(t){let e;const n=r.matchPrefix(t,"a=msid:");if(1===n.length)return e=n[0].substr(7).split(" "),{stream:e[0],track:e[1]};const i=r.matchPrefix(t,"a=ssrc:").map(t=>r.parseSsrcMedia(t)).filter(t=>"msid"===t.attribute);return i.length>0?(e=i[0].value.split(" "),{stream:e[0],track:e[1]}):void 0},r.parseSctpDescription=function(t){const e=r.parseMLine(t),n=r.matchPrefix(t,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substr(19),10)),isNaN(i)&&(i=65536);const V=r.matchPrefix(t,"a=sctp-port:");if(V.length>0)return{port:parseInt(V[0].substr(12),10),protocol:e.fmt,maxMessageSize:i};const o=r.matchPrefix(t,"a=sctpmap:");if(o.length>0){const t=o[0].substr(10).split(" ");return{port:parseInt(t[0],10),protocol:t[1],maxMessageSize:i}}},r.writeSctpDescription=function(t,e){let n=[];return n="DTLS/SCTP"!==t.protocol?["m="+t.kind+" 9 "+t.protocol+" "+e.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+e.port+"\r\n"]:["m="+t.kind+" 9 "+t.protocol+" "+e.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+e.port+" "+e.protocol+" 65535\r\n"],void 0!==e.maxMessageSize&&n.push("a=max-message-size:"+e.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(t,e,n){let i;const V=void 0!==e?e:2;i=t||r.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+V+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.getDirection=function(t,e){const n=r.splitLines(t);for(let t=0;t<n.length;t++)switch(n[t]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[t].substr(2)}return e?r.getDirection(e):"sendrecv"},r.getKind=function(t){return r.splitLines(t)[0].split(" ")[0].substr(2)},r.isRejected=function(t){return"0"===t.split(" ",2)[1]},r.parseMLine=function(t){const e=r.splitLines(t)[0].substr(2).split(" ");return{kind:e[0],port:parseInt(e[1],10),protocol:e[2],fmt:e.slice(3).join(" ")}},r.parseOLine=function(t){const e=r.matchPrefix(t,"o=")[0].substr(2).split(" ");return{username:e[0],sessionId:e[1],sessionVersion:parseInt(e[2],10),netType:e[3],addressType:e[4],address:e[5]}},r.isValidSDP=function(t){if("string"!=typeof t||0===t.length)return!1;const e=r.splitLines(t);for(let t=0;t<e.length;t++)if(e[t].length<2||"="!==e[t].charAt(1))return!1;return!0},t.exports=r},function(t,e,n){"use strict";(function(t){
17
17
  /*!
18
18
  * The buffer module from node.js, for the browser.
19
19
  *
20
20
  * @author Feross Aboukhadijeh <http://feross.org>
21
21
  * @license MIT
22
22
  */
23
- var r=n(101),i=n(102),V=n(103);function o(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=l(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(a.isBuffer(e)){var n=0|f(e.length);return 0===(t=s(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?s(t,0):l(t,e);if("Buffer"===e.type&&V(e.data))return l(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(u(e),t=s(t,e<0?0:0|f(e)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function l(t,e){var n=e.length<0?0:0|f(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function f(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(t).length;default:if(r)return F(t).length;e=(""+e).toLowerCase(),r=!0}}function p(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return T(this,e,n);case"ascii":return C(this,e,n);case"latin1":case"binary":return E(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var V,o=1,s=t.length,a=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(V=n;V<s;V++)if(c(t,V)===c(e,-1===u?0:V-u)){if(-1===u&&(u=V),V-u+1===a)return u*o}else-1!==u&&(V-=V-u),u=-1}else for(n+a>s&&(n=s-a),V=n;V>=0;V--){for(var h=!0,l=0;l<a;l++)if(c(t,V+l)!==c(e,l)){h=!1;break}if(h)return V}return-1}function m(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var V=e.length;if(V%2!=0)throw new TypeError("Invalid hex string");r>V/2&&(r=V/2);for(var o=0;o<r;++o){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))return o;t[n+o]=s}return o}function b(t,e,n,r){return W(F(e,t.length-n),t,n,r)}function _(t,e,n,r){return W(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function w(t,e,n,r){return _(t,e,n,r)}function A(t,e,n,r){return W(B(e),t,n,r)}function S(t,e,n,r){return W(function(t,e){for(var n,r,i,V=[],o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,i=n%256,V.push(i),V.push(r);return V}(e,t.length-n),t,n,r)}function x(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function T(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var V,o,s,a,c=t[i],u=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(V=t[i+1]))&&(a=(31&c)<<6|63&V)>127&&(u=a);break;case 3:V=t[i+1],o=t[i+2],128==(192&V)&&128==(192&o)&&(a=(15&c)<<12|(63&V)<<6|63&o)>2047&&(a<55296||a>57343)&&(u=a);break;case 4:V=t[i+1],o=t[i+2],s=t[i+3],128==(192&V)&&128==(192&o)&&128==(192&s)&&(a=(15&c)<<18|(63&V)<<12|(63&o)<<6|63&s)>65535&&a<1114112&&(u=a)}null===u?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=o(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,n){return c(null,t,e,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,n){return function(t,e,n,r){return u(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},a.allocUnsafe=function(t){return h(null,t)},a.allocUnsafeSlow=function(t){return h(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,V=Math.min(n,r);i<V;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!V(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=a.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?T(this,0,t):p.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,n,r,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var V=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(e>>>=0),s=Math.min(V,o),c=this.slice(r,i),u=t.slice(e,n),h=0;h<s;++h)if(c[h]!==u[h]){V=c[h],o=u[h];break}return V<o?-1:o<V?1:0},a.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},a.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},a.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},a.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var V=!1;;)switch(r){case"hex":return m(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(V)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),V=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function E(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function R(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",V=e;V<n;++V)i+=U(t[V]);return i}function M(t,e,n){for(var r=t.slice(e,n),i="",V=0;V<r.length;V+=2)i+=String.fromCharCode(r[V]+256*r[V+1]);return i}function O(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,r,i,V){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<V)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function k(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,V=Math.min(t.length-n,2);i<V;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function I(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,V=Math.min(t.length-n,4);i<V;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function D(t,e,n,r,i,V){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,V){return V||D(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,V){return V||D(t,0,n,8),i.write(t,e,n,r,52,8),n+8}a.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),a.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=a.prototype;else{var i=e-t;n=new a(i,void 0);for(var V=0;V<i;++V)n[V]=this[V+t]}return n},a.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=this[t],i=1,V=0;++V<e&&(i*=256);)r+=this[t+V]*i;return r},a.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},a.prototype.readUInt8=function(t,e){return e||O(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||O(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||O(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=this[t],i=1,V=0;++V<e&&(i*=256);)r+=this[t+V]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},a.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=e,i=1,V=this[t+--r];r>0&&(i*=256);)V+=this[t+--r]*i;return V>=(i*=128)&&(V-=Math.pow(2,8*e)),V},a.prototype.readInt8=function(t,e){return e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||O(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(t,e){e||O(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(t,e){return e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||O(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||O(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||O(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||O(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,V=0;for(this[e]=255&t;++V<n&&(i*=256);)this[e+V]=t/i&255;return e+n},a.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,V=1;for(this[e+i]=255&t;--i>=0&&(V*=256);)this[e+i]=t/V&255;return e+n},a.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):k(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):k(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):I(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):I(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var V=0,o=1,s=0;for(this[e]=255&t;++V<n&&(o*=256);)t<0&&0===s&&0!==this[e+V-1]&&(s=1),this[e+V]=(t/o>>0)-s&255;return e+n},a.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var V=n-1,o=1,s=0;for(this[e+V]=255&t;--V>=0&&(o*=256);)t<0&&0===s&&0!==this[e+V+1]&&(s=1),this[e+V]=(t/o>>0)-s&255;return e+n},a.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):k(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):k(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):I(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):I(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},a.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},a.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},a.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},a.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,V=r-n;if(this===t&&n<e&&e<r)for(i=V-1;i>=0;--i)t[i+e]=this[i+n];else if(V<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<V;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+V),e);return V},a.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var V;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(V=e;V<n;++V)this[V]=t;else{var o=a.isBuffer(t)?t:F(new a(t,r).toString()),s=o.length;for(V=0;V<n-e;++V)this[V+e]=o[V%s]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var n;e=e||1/0;for(var r=t.length,i=null,V=[],o=0;o<r;++o){if((n=t.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&V.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&V.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&V.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&V.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;V.push(n)}else if(n<2048){if((e-=2)<0)break;V.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;V.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;V.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return V}function B(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(34))},function(t,e,n){"use strict";var r={};function i(t,e,n){n||(n=Error);var i=function(t){var n,r;function i(n,r,i){return t.call(this,function(t,n,r){return"string"==typeof e?e:e(t,n,r)}(n,r,i))||this}return r=t,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);i.prototype.name=n.name,i.prototype.code=t,r[t]=i}function V(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,n){var r,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(r="must not be",e=e.replace(/^not /,"")):r="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))s="The ".concat(t," ").concat(r," ").concat(V(e,"type"));else{var a=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(a," ").concat(r," ").concat(V(e,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},function(t,e,n){"use strict";(function(e){var r=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=c;var i=n(87),V=n(92);n(59)(c,i);for(var o=r(V.prototype),s=0;s<o.length;s++){var a=o[s];c.prototype[a]||(c.prototype[a]=V.prototype[a])}function c(t){if(!(this instanceof c))return new c(t);i.call(this,t),V.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||e.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this,n(38))},function(t,e,n){"use strict";n.r(e),n.d(e,"Observable",(function(){return r.a})),n.d(e,"ConnectableObservable",(function(){return i.a})),n.d(e,"GroupedObservable",(function(){return V.a})),n.d(e,"observable",(function(){return o.a})),n.d(e,"Subject",(function(){return s.a})),n.d(e,"BehaviorSubject",(function(){return a.a})),n.d(e,"ReplaySubject",(function(){return c.a})),n.d(e,"AsyncSubject",(function(){return u.a})),n.d(e,"asap",(function(){return h.a})),n.d(e,"asapScheduler",(function(){return h.b})),n.d(e,"async",(function(){return l.a})),n.d(e,"asyncScheduler",(function(){return l.b})),n.d(e,"queue",(function(){return f.a})),n.d(e,"queueScheduler",(function(){return f.b})),n.d(e,"animationFrame",(function(){return m})),n.d(e,"animationFrameScheduler",(function(){return y})),n.d(e,"VirtualTimeScheduler",(function(){return b})),n.d(e,"VirtualAction",(function(){return _})),n.d(e,"Scheduler",(function(){return w.a})),n.d(e,"Subscription",(function(){return A.a})),n.d(e,"Subscriber",(function(){return S.a})),n.d(e,"Notification",(function(){return x.a})),n.d(e,"NotificationKind",(function(){return x.b})),n.d(e,"pipe",(function(){return T.a})),n.d(e,"noop",(function(){return C.a})),n.d(e,"identity",(function(){return E.a})),n.d(e,"isObservable",(function(){return R})),n.d(e,"ArgumentOutOfRangeError",(function(){return M.a})),n.d(e,"EmptyError",(function(){return O.a})),n.d(e,"ObjectUnsubscribedError",(function(){return P.a})),n.d(e,"UnsubscriptionError",(function(){return k.a})),n.d(e,"TimeoutError",(function(){return I.a})),n.d(e,"bindCallback",(function(){return U})),n.d(e,"bindNodeCallback",(function(){return W})),n.d(e,"combineLatest",(function(){return G.b})),n.d(e,"concat",(function(){return Y.a})),n.d(e,"defer",(function(){return $.a})),n.d(e,"empty",(function(){return Q.b})),n.d(e,"forkJoin",(function(){return K})),n.d(e,"from",(function(){return Z.a})),n.d(e,"fromEvent",(function(){return et})),n.d(e,"fromEventPattern",(function(){return nt})),n.d(e,"generate",(function(){return rt})),n.d(e,"iif",(function(){return Vt})),n.d(e,"interval",(function(){return st})),n.d(e,"merge",(function(){return ct.a})),n.d(e,"never",(function(){return ht})),n.d(e,"of",(function(){return lt.a})),n.d(e,"onErrorResumeNext",(function(){return ft})),n.d(e,"pairs",(function(){return dt})),n.d(e,"partition",(function(){return mt})),n.d(e,"race",(function(){return bt.a})),n.d(e,"range",(function(){return _t})),n.d(e,"throwError",(function(){return At.a})),n.d(e,"timer",(function(){return St.a})),n.d(e,"using",(function(){return xt})),n.d(e,"zip",(function(){return Tt.b})),n.d(e,"scheduled",(function(){return Ct.a})),n.d(e,"EMPTY",(function(){return Q.a})),n.d(e,"NEVER",(function(){return ut})),n.d(e,"config",(function(){return Et.a}));var r=n(3),i=n(65),V=n(62),o=n(20),s=n(5),a=n(66),c=n(49),u=n(28),h=n(40),l=n(6),f=n(60),d=n(0),p=n(29),g=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return d.a(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},e}(p.a),v=n(27),y=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d.a(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},e}(v.a))(g),m=y,b=function(t){function e(e,n){void 0===e&&(e=_),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return d.a(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(v.a),_=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return d.a(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){void 0===n&&(n=0)},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(p.a),w=n(61),A=n(4),S=n(1),x=n(17),T=n(39),C=n(19),E=n(14);function R(t){return!!t&&(t instanceof r.a||"function"==typeof t.lift&&"function"==typeof t.subscribe)}var M=n(22),O=n(24),P=n(21),k=n(42),I=n(68),D=n(8),N=n(56),j=n(7),L=n(9);function U(t,e,n){if(e){if(!Object(L.a)(e))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return U(t,n).apply(void 0,r).pipe(Object(D.a)((function(t){return Object(j.a)(t)?e.apply(void 0,t):e(t)})))};n=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var V,o=this,s={context:o,subject:V,callbackFunc:t,scheduler:n};return new r.a((function(r){if(n){var i={args:e,subscriber:r,params:s};return n.schedule(F,0,i)}if(!V){V=new u.a;try{t.apply(o,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];V.next(t.length<=1?t[0]:t),V.complete()}]))}catch(t){Object(N.a)(V)?V.error(t):console.warn(t)}}return V.subscribe(r)}))}}function F(t){var e=this,n=t.args,r=t.subscriber,i=t.params,V=i.callbackFunc,o=i.context,s=i.scheduler,a=i.subject;if(!a){a=i.subject=new u.a;try{V.apply(o,n.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length<=1?t[0]:t;e.add(s.schedule(B,0,{value:r,subject:a}))}]))}catch(t){a.error(t)}}this.add(a.subscribe(r))}function B(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function W(t,e,n){if(e){if(!Object(L.a)(e))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return W(t,n).apply(void 0,r).pipe(Object(D.a)((function(t){return Object(j.a)(t)?e.apply(void 0,t):e(t)})))};n=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var V={subject:void 0,args:e,callbackFunc:t,scheduler:n,context:this};return new r.a((function(r){var i=V.context,o=V.subject;if(n)return n.schedule(z,0,{params:V,subscriber:r,context:i});if(!o){o=V.subject=new u.a;try{t.apply(i,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.shift();n?o.error(n):(o.next(t.length<=1?t[0]:t),o.complete())}]))}catch(t){Object(N.a)(o)?o.error(t):console.warn(t)}}return o.subscribe(r)}))}}function z(t){var e=this,n=t.params,r=t.subscriber,i=t.context,V=n.callbackFunc,o=n.args,s=n.scheduler,a=n.subject;if(!a){a=n.subject=new u.a;try{V.apply(i,o.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.shift();if(r)e.add(s.schedule(H,0,{err:r,subject:a}));else{var i=t.length<=1?t[0]:t;e.add(s.schedule(q,0,{value:i,subject:a}))}}]))}catch(t){this.add(s.schedule(H,0,{err:t,subject:a}))}}this.add(a.subscribe(r))}function q(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function H(t){var e=t.err;t.subject.error(e)}var G=n(51),Y=n(31),$=n(53),Q=n(10),X=n(55),Z=n(11);function K(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var n=t[0];if(Object(j.a)(n))return J(n,null);if(Object(X.a)(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return J(r.map((function(t){return n[t]})),r)}}if("function"==typeof t[t.length-1]){var i=t.pop();return J(t=1===t.length&&Object(j.a)(t[0])?t[0]:t,null).pipe(Object(D.a)((function(t){return i.apply(void 0,t)})))}return J(t,null)}function J(t,e){return new r.a((function(n){var r=t.length;if(0!==r)for(var i=new Array(r),V=0,o=0,s=function(s){var a=Object(Z.a)(t[s]),c=!1;n.add(a.subscribe({next:function(t){c||(c=!0,o++),i[s]=t},error:function(t){return n.error(t)},complete:function(){++V!==r&&c||(o===r&&n.next(e?e.reduce((function(t,e,n){return t[e]=i[n],t}),{}):i),n.complete())}}))},a=0;a<r;a++)s(a);else n.complete()}))}var tt=n(23);function et(t,e,n,i){return Object(tt.a)(n)&&(i=n,n=void 0),i?et(t,e,n).pipe(Object(D.a)((function(t){return Object(j.a)(t)?i.apply(void 0,t):i(t)}))):new r.a((function(r){!function t(e,n,r,i,V){var o;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var s=e;e.addEventListener(n,r,V),o=function(){return s.removeEventListener(n,r,V)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var a=e;e.on(n,r),o=function(){return a.off(n,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var c=e;e.addListener(n,r),o=function(){return c.removeListener(n,r)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var u=0,h=e.length;u<h;u++)t(e[u],n,r,i,V)}i.add(o)}(t,e,(function(t){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(t)}),r,n)}))}function nt(t,e,n){return n?nt(t,e).pipe(Object(D.a)((function(t){return Object(j.a)(t)?n.apply(void 0,t):n(t)}))):new r.a((function(n){var r,i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.next(1===t.length?t[0]:t)};try{r=t(i)}catch(t){return void n.error(t)}if(Object(tt.a)(e))return function(){return e(i,r)}}))}function rt(t,e,n,i,V){var o,s;if(1==arguments.length){var a=t;s=a.initialState,e=a.condition,n=a.iterate,o=a.resultSelector||E.a,V=a.scheduler}else void 0===i||Object(L.a)(i)?(s=t,o=E.a,V=i):(s=t,o=i);return new r.a((function(t){var r=s;if(V)return V.schedule(it,0,{subscriber:t,iterate:n,condition:e,resultSelector:o,state:r});for(;;){if(e){var i=void 0;try{i=e(r)}catch(e){return void t.error(e)}if(!i){t.complete();break}}var a=void 0;try{a=o(r)}catch(e){return void t.error(e)}if(t.next(a),t.closed)break;try{r=n(r)}catch(e){return void t.error(e)}}}))}function it(t){var e=t.subscriber,n=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(n){var r=void 0;try{r=n(t.state)}catch(t){return void e.error(t)}if(!r)return void e.complete();if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function Vt(t,e,n){return void 0===e&&(e=Q.a),void 0===n&&(n=Q.a),Object($.a)((function(){return t()?e:n}))}var ot=n(30);function st(t,e){return void 0===t&&(t=0),void 0===e&&(e=l.a),(!Object(ot.a)(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=l.a),new r.a((function(n){return n.add(e.schedule(at,t,{subscriber:n,counter:0,period:t})),n}))}function at(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}var ct=n(70),ut=new r.a(C.a);function ht(){return ut}var lt=n(35);function ft(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return Q.a;var n=t[0],i=t.slice(1);return 1===t.length&&Object(j.a)(n)?ft.apply(void 0,n):new r.a((function(t){var e=function(){return t.add(ft.apply(void 0,i).subscribe(t))};return Object(Z.a)(n).subscribe({next:function(e){t.next(e)},error:e,complete:e})}))}function dt(t,e){return e?new r.a((function(n){var r=Object.keys(t),i=new A.a;return i.add(e.schedule(pt,0,{keys:r,index:0,subscriber:n,subscription:i,obj:t})),i})):new r.a((function(e){for(var n=Object.keys(t),r=0;r<n.length&&!e.closed;r++){var i=n[r];t.hasOwnProperty(i)&&e.next([i,t[i]])}e.complete()}))}function pt(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,V=t.obj;if(!r.closed)if(n<e.length){var o=e[n];r.next([o,V[o]]),i.add(this.schedule({keys:e,index:n+1,subscriber:r,subscription:i,obj:V}))}else r.complete()}var gt=n(78),vt=n(32),yt=n(16);function mt(t,e,n){return[Object(yt.a)(e,n)(new r.a(Object(vt.a)(t))),Object(yt.a)(Object(gt.a)(e,n))(new r.a(Object(vt.a)(t)))]}var bt=n(71);function _t(t,e,n){return void 0===t&&(t=0),new r.a((function(r){void 0===e&&(e=t,t=0);var i=0,V=t;if(n)return n.schedule(wt,0,{index:i,count:e,start:t,subscriber:r});for(;;){if(i++>=e){r.complete();break}if(r.next(V++),r.closed)break}}))}function wt(t){var e=t.start,n=t.index,r=t.count,i=t.subscriber;n>=r?i.complete():(i.next(e),i.closed||(t.index=n+1,t.start=e+1,this.schedule(t)))}var At=n(50),St=n(72);function xt(t,e){return new r.a((function(n){var r,i;try{r=t()}catch(t){return void n.error(t)}try{i=e(r)}catch(t){return void n.error(t)}var V=(i?Object(Z.a)(i):Q.a).subscribe(n);return function(){V.unsubscribe(),r&&r.unsubscribe()}}))}var Tt=n(54),Ct=n(73),Et=n(13)},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(0),i=n(1);function V(){return function(t){return t.lift(new o(t))}}var o=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new s(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i},t}(),s=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.a(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(5),V=n(60),o=n(4),s=n(67),a=n(21),c=n(74),u=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return r.a(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new h(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,V=r.length;if(this.closed)throw new a.a;if(this.isStopped||this.hasError?e=o.a.EMPTY:(this.observers.push(t),e=new c.a(this,t)),i&&t.add(t=new s.a(t,i)),n)for(var u=0;u<V&&!t.closed;u++)t.next(r[u]);else for(u=0;u<V&&!t.closed;u++)t.next(r[u].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||V.a).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,V=0;V<i&&!(t-r[V].time<n);)V++;return i>e&&(V=Math.max(V,i-e)),V>0&&r.splice(0,V),r},e}(i.a),h=function(){return function(t,e){this.time=t,this.value=e}}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(3);function i(t,e){return e?new r.a((function(n){return e.schedule(V,0,{error:t,subscriber:n})})):new r.a((function(e){return e.error(t)}))}function V(t){var e=t.error;t.subscriber.error(e)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return h}));var r=n(0),i=n(9),V=n(7),o=n(15),s=n(12),a=n(26),c={};function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return Object(i.a)(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&Object(V.a)(t[0])&&(t=t[0]),Object(a.a)(t,r).lift(new h(n))}var h=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.resultSelector))},t}(),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return r.a(e,t),e.prototype._next=function(t){this.values.push(c),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Object(s.a)(this,r,void 0,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n){var r=this.values,i=r[n],V=this.toRespond?i===c?--this.toRespond:this.toRespond:0;r[n]=e,0===V&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(25),i=n(14);function V(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Object(r.b)(i.a,t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(11),V=n(10);function o(t){return new r.a((function(e){var n;try{n=t()}catch(t){return void e.error(t)}return(n?Object(i.a)(n):Object(V.b)()).subscribe(e)}))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return u}));var r=n(0),i=n(26),V=n(7),o=n(1),s=n(18),a=n(2);function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return"function"==typeof n&&t.pop(),Object(i.a)(t,void 0).lift(new u(n))}var u=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.resultSelector))},t}(),h=function(t){function e(e,n,r){void 0===r&&(r=Object.create(null));var i=t.call(this,e)||this;return i.resultSelector=n,i.iterators=[],i.active=0,i.resultSelector="function"==typeof n?n:void 0,i}return r.a(e,t),e.prototype._next=function(t){var e=this.iterators;Object(V.a)(t)?e.push(new f(t)):"function"==typeof t[s.a]?e.push(new l(t[s.a]())):e.push(new d(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var n=0;n<e;n++){var r=t[n];if(r.stillUnsubscribed)this.destination.add(r.subscribe());else this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,n=this.destination,r=0;r<e;r++){if("function"==typeof(o=t[r]).hasValue&&!o.hasValue())return}var i=!1,V=[];for(r=0;r<e;r++){var o,s=(o=t[r]).next();if(o.hasCompleted()&&(i=!0),s.done)return void n.complete();V.push(s.value)}this.resultSelector?this._tryresultSelector(V):n.next(V),i&&n.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.a),l=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),f=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[s.a]=function(){return this},t.prototype.next=function(t){var e=this.index++,n=this.array;return e<this.length?{value:n[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),d=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return r.a(e,t),e.prototype[s.a]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},e.prototype.subscribe=function(){return Object(a.c)(this.observable,new a.a(this))},e}(a.b)},function(t,e,n){"use strict";function r(t){return null!==t&&"object"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(1);function i(t){for(;t;){var e=t,n=e.closed,i=e.destination,V=e.isStopped;if(n||V)return!1;t=i&&i instanceof r.a?i:null}return!0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(3),i=n(4);function V(t,e){return new r.a((function(n){var r=new i.a,V=0;return r.add(e.schedule((function(){V!==t.length?(n.next(t[V++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(13),i=n(33),V={closed:!0,next:function(t){},error:function(t){if(r.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete:function(){}}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return V})),n.d(e,"a",(function(){return o}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.a(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(n(29).a),V=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e}(n(27).a))(i),o=V},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return l}));var r=n(0),i=n(1),V=n(4),o=n(3),s=n(5);function a(t,e,n,r){return function(i){return i.lift(new c(t,e,n,r))}}var c=function(){function t(t,e,n,r){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=r}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),u=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.keySelector=n,o.elementSelector=r,o.durationSelector=i,o.subjectSelector=V,o.groups=null,o.attemptedToUnsubscribe=!1,o.count=0,o}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,i=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!i){i=this.subjectSelector?this.subjectSelector():new s.a,n.set(e,i);var V=new l(e,i,this);if(this.destination.next(V),this.durationSelector){var o=void 0;try{o=this.durationSelector(new l(e,i))}catch(t){return void this.error(t)}this.add(o.subscribe(new h(e,i,this)))}}i.closed||i.next(r)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,n){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(i.a),h=function(t){function e(e,n,r){var i=t.call(this,n)||this;return i.key=e,i.group=n,i.parent=r,i}return r.a(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(i.a),l=function(t){function e(e,n,r){var i=t.call(this)||this;return i.key=e,i.groupSubject=n,i.refCountSubscription=r,i}return r.a(e,t),e.prototype._subscribe=function(t){var e=new V.a,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new f(n)),e.add(r.subscribe(t)),e},e}(o.a),f=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return r.a(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(V.a)},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.DigitalHumanUnmuted=e.DigitalHumanPlayedInMutedModeSuccess=e.DigitalHumanFailedToPlay=e.DigitalHumanVideoError=e.ClientPerformanceMessage=e.ClientMediaStreamUpdateMessage=e.OnlineStatusUpdateMessage=e.SessionInfoMessage=e.AvatarRequestIgnored=e.AvatarRequestCompleted=e.SessionErrorMessage=e.WebRtcStatsMessage=e.WebRtcDataMessage=e.SessionLiveMessage=e.WarningMessage=e.RecordingStoppedMessage=e.RecordingStartedMessage=e.DevicePermissionAllowedMessage=e.AvatarTextInputFinishedMessage=e.FinishedSpeakingMessage=e.StartedSpeakingMessage=e.AvatarQuestionMessage=e.InstructionsMessage=e.AvatarAnswerContentMessage=e.AvatarAnswerMessage=e.ConnectionLostMessage=e.VoiceActivityInputModeNotSupportedMessage=e.MicActivityNotSupportedMessage=e.MicActivityMessage=e.MicActivityErrorMessage=e.ServiceUnavailableMessage=e.AvatarUnavailableMessage=e.AvatarAvailableMessage=e.SessionEndedMessage=e.SessionResumedMessage=e.SessionPausedMessage=e.DeviceListUpdatedMessage=e.DeviceErrorMessage=e.SetSpeakerSuccessMessage=e.SetMicSuccessMessage=e.SetCameraSuccessMessage=e.DeviceNotFoundErrorMessage=e.ReadyMessage=e.UneeqMessageType=void 0,function(t){t.Ready="Ready",t.DeviceNotFoundError="DeviceNotFoundError",t.SetCameraSuccess="SetCameraSuccess",t.SetMicSuccess="SetMicSuccess",t.SetSpeakerSuccess="SetSpeakerSuccess",t.SessionPaused="SessionPaused",t.SessionResumed="SessionResumed",t.SessionEnded="SessionEnded",t.AvatarAvailable="AvatarAvailable",t.AvatarUnavailable="AvatarUnavailable",t.ConnectionLost="ConnectionLost",t.ServiceUnavailable="ServiceUnavailable",t.OnlineStatusUpdate="OnlineStatusUpdate",t.MicActivityNotSupported="MicActivityNotSupported",t.VoiceActivityInputModeNotSupported="VoiceActivityInputModeNotSupported",t.MicActivityError="MicActivityError",t.MicActivity="MicActivity",t.DeviceError="DeviceError",t.DeviceListUpdated="DeviceListUpdated",t.AvatarAnswer="AvatarAnswer",t.AvatarAnswerContent="AvatarAnswerContent",t.Instructions="Instructions",t.StartedSpeaking="StartedSpeaking",t.FinishedSpeaking="FinishedSpeaking",t.AvatarTextInputFinished="AvatarTextInputFinished",t.AvatarQuestionText="AvatarQuestionText",t.DevicePermissionAllowed="DevicePermissionAllowed",t.RecordingStarted="RecordingStarted",t.RecordingStopped="RecordingStopped",t.Warning="Warning",t.SessionLive="SessionLive",t.WebRtcData="WebRtcData",t.WebRtcStats="WebRtcStats",t.SessionError="SessionError",t.SessionInfo="SessionInfo",t.AvatarRequestCompleted="AvatarRequestCompleted",t.AvatarRequestIgnored="AvatarRequestIgnored",t.ClientMediaStreamUpdate="ClientMediaStreamUpdate",t.ClientPerformanceMessage="ClientPerformanceMessage",t.DigitalHumanVideoError="DigitalHumanVideoError",t.DigitalHumanFailedToPlay="DigitalHumanFailedToPlay",t.DigitalHumanPlayedInMutedModeSuccess="DigitalHumanPlayedInMutedModeSuccess",t.DigitalHumanUnmuted="DigitalHumanUnmuted"}(r=e.UneeqMessageType||(e.UneeqMessageType={}));e.ReadyMessage=class{constructor(){this.uneeqMessageType=r.Ready}};e.DeviceNotFoundErrorMessage=class{constructor(t,e){this.msg=t,this.deviceId=e,this.uneeqMessageType=r.DeviceNotFoundError}};e.SetCameraSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetCameraSuccess}};e.SetMicSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetMicSuccess}};e.SetSpeakerSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetSpeakerSuccess}};e.DeviceErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.DeviceError}};e.DeviceListUpdatedMessage=class{constructor(t){this.devices=t,this.uneeqMessageType=r.DeviceListUpdated}};e.SessionPausedMessage=class{constructor(){this.uneeqMessageType=r.SessionPaused}};e.SessionResumedMessage=class{constructor(){this.uneeqMessageType=r.SessionResumed}};e.SessionEndedMessage=class{constructor(){this.uneeqMessageType=r.SessionEnded}};e.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarAvailable}};e.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarUnavailable}};e.ServiceUnavailableMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.ServiceUnavailable}};e.MicActivityErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.MicActivityError}};e.MicActivityMessage=class{constructor(t){this.level=t,this.uneeqMessageType=r.MicActivity}};e.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.MicActivityNotSupported}};e.VoiceActivityInputModeNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.VoiceActivityInputModeNotSupported}};e.ConnectionLostMessage=class{constructor(t){this.connectionState=t,this.uneeqMessageType=r.ConnectionLost}};e.AvatarAnswerMessage=class{constructor(t,e,n,i){this.answer=t,this.answerAvatar=e,this.answerSpeech=n,this.transcriptId=i,this.uneeqMessageType=r.AvatarAnswer}};e.AvatarAnswerContentMessage=class{constructor(t,e,n=!1){this.content=t,this.transcriptId=e,this.hasDisplayHtml=n,this.uneeqMessageType=r.AvatarAnswerContent}};e.InstructionsMessage=class{constructor(t){this.instructions=t,this.uneeqMessageType=r.Instructions}};e.AvatarQuestionMessage=class{constructor(t,e){this.question=t,this.transcriptId=e,this.uneeqMessageType=r.AvatarQuestionText}};e.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.StartedSpeaking}};e.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.FinishedSpeaking}};e.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=r.AvatarTextInputFinished}};e.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=r.DevicePermissionAllowed}};e.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStarted}};e.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStopped}};e.WarningMessage=class{constructor(t){this.msg=t,this.uneeqMessageType=r.Warning}};e.SessionLiveMessage=class{constructor(t){this.showLogo=t,this.uneeqMessageType=r.SessionLive}};e.WebRtcDataMessage=class{constructor(t){this.data=t,this.uneeqMessageType=r.WebRtcData}};e.WebRtcStatsMessage=class{constructor(t){this.stats=t,this.uneeqMessageType=r.WebRtcStats}};e.SessionErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.SessionError}};e.AvatarRequestCompleted=class{constructor(t){this.reason=t,this.uneeqMessageType=r.AvatarRequestCompleted}};e.AvatarRequestIgnored=class{constructor(t){this.reason=t,this.uneeqMessageType=r.AvatarRequestIgnored}};e.SessionInfoMessage=class{constructor(t){this.info=t,this.uneeqMessageType=r.SessionInfo}};e.OnlineStatusUpdateMessage=class{constructor(t){this.online=t,this.uneeqMessageType=r.OnlineStatusUpdate}};e.ClientMediaStreamUpdateMessage=class{constructor(t,e,n,i){this.clientStreamingAudio=t,this.clientStreamingVideo=e,this.serverStreamingAudio=n,this.serverStreamingVideo=i,this.uneeqMessageType=r.ClientMediaStreamUpdate}};e.ClientPerformanceMessage=class{constructor(t){this.clientPerformance=t,this.uneeqMessageType=r.ClientPerformanceMessage}};e.DigitalHumanVideoError=class{constructor(t){this.error=t,this.uneeqMessageType=r.DigitalHumanVideoError}};e.DigitalHumanFailedToPlay=class{constructor(){this.uneeqMessageType=r.DigitalHumanFailedToPlay,this.msg="Digital Human failed to play with sound. This most likely occurred because the user has not yet interacted with the page and was blocked due to the browser's autoplay policy. Video will automatically be muted and attempted to be played again."}};e.DigitalHumanPlayedInMutedModeSuccess=class{constructor(){this.uneeqMessageType=r.DigitalHumanPlayedInMutedModeSuccess,this.msg="Digital Human was successfully played in muted mode. After the user interacts with the page you will need to call unmuteDigitalHuman() to unmute the video."}};e.DigitalHumanUnmuted=class{constructor(){this.uneeqMessageType=r.DigitalHumanUnmuted}}},function(t,e,n){(function(t,r){var i;
23
+ var r=n(101),i=n(102),V=n(103);function o(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=l(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(a.isBuffer(e)){var n=0|f(e.length);return 0===(t=s(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?s(t,0):l(t,e);if("Buffer"===e.type&&V(e.data))return l(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(u(e),t=s(t,e<0?0:0|f(e)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function l(t,e){var n=e.length<0?0:0|f(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function f(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(t).length;default:if(r)return F(t).length;e=(""+e).toLowerCase(),r=!0}}function p(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return T(this,e,n);case"ascii":return C(this,e,n);case"latin1":case"binary":return E(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:m(t,e,n,r,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,n,r,i){var V,o=1,s=t.length,a=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(V=n;V<s;V++)if(c(t,V)===c(e,-1===u?0:V-u)){if(-1===u&&(u=V),V-u+1===a)return u*o}else-1!==u&&(V-=V-u),u=-1}else for(n+a>s&&(n=s-a),V=n;V>=0;V--){for(var h=!0,l=0;l<a;l++)if(c(t,V+l)!==c(e,l)){h=!1;break}if(h)return V}return-1}function y(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var V=e.length;if(V%2!=0)throw new TypeError("Invalid hex string");r>V/2&&(r=V/2);for(var o=0;o<r;++o){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))return o;t[n+o]=s}return o}function b(t,e,n,r){return W(F(e,t.length-n),t,n,r)}function _(t,e,n,r){return W(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function w(t,e,n,r){return _(t,e,n,r)}function A(t,e,n,r){return W(B(e),t,n,r)}function S(t,e,n,r){return W(function(t,e){for(var n,r,i,V=[],o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,i=n%256,V.push(i),V.push(r);return V}(e,t.length-n),t,n,r)}function x(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function T(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var V,o,s,a,c=t[i],u=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(V=t[i+1]))&&(a=(31&c)<<6|63&V)>127&&(u=a);break;case 3:V=t[i+1],o=t[i+2],128==(192&V)&&128==(192&o)&&(a=(15&c)<<12|(63&V)<<6|63&o)>2047&&(a<55296||a>57343)&&(u=a);break;case 4:V=t[i+1],o=t[i+2],s=t[i+3],128==(192&V)&&128==(192&o)&&128==(192&s)&&(a=(15&c)<<18|(63&V)<<12|(63&o)<<6|63&s)>65535&&a<1114112&&(u=a)}null===u?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=o(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,n){return c(null,t,e,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,n){return function(t,e,n,r){return u(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},a.allocUnsafe=function(t){return h(null,t)},a.allocUnsafeSlow=function(t){return h(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,V=Math.min(n,r);i<V;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!V(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=a.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?T(this,0,t):p.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,n,r,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var V=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(e>>>=0),s=Math.min(V,o),c=this.slice(r,i),u=t.slice(e,n),h=0;h<s;++h)if(c[h]!==u[h]){V=c[h],o=u[h];break}return V<o?-1:o<V?1:0},a.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},a.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},a.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},a.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var V=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(V)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),V=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function E(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function R(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",V=e;V<n;++V)i+=U(t[V]);return i}function M(t,e,n){for(var r=t.slice(e,n),i="",V=0;V<r.length;V+=2)i+=String.fromCharCode(r[V]+256*r[V+1]);return i}function O(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,r,i,V){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<V)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function k(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,V=Math.min(t.length-n,2);i<V;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function I(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,V=Math.min(t.length-n,4);i<V;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function D(t,e,n,r,i,V){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,V){return V||D(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,V){return V||D(t,0,n,8),i.write(t,e,n,r,52,8),n+8}a.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),a.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=a.prototype;else{var i=e-t;n=new a(i,void 0);for(var V=0;V<i;++V)n[V]=this[V+t]}return n},a.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=this[t],i=1,V=0;++V<e&&(i*=256);)r+=this[t+V]*i;return r},a.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},a.prototype.readUInt8=function(t,e){return e||O(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||O(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||O(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=this[t],i=1,V=0;++V<e&&(i*=256);)r+=this[t+V]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},a.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||O(t,e,this.length);for(var r=e,i=1,V=this[t+--r];r>0&&(i*=256);)V+=this[t+--r]*i;return V>=(i*=128)&&(V-=Math.pow(2,8*e)),V},a.prototype.readInt8=function(t,e){return e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||O(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(t,e){e||O(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(t,e){return e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||O(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||O(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||O(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||O(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,V=0;for(this[e]=255&t;++V<n&&(i*=256);)this[e+V]=t/i&255;return e+n},a.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,V=1;for(this[e+i]=255&t;--i>=0&&(V*=256);)this[e+i]=t/V&255;return e+n},a.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):k(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):k(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):I(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):I(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var V=0,o=1,s=0;for(this[e]=255&t;++V<n&&(o*=256);)t<0&&0===s&&0!==this[e+V-1]&&(s=1),this[e+V]=(t/o>>0)-s&255;return e+n},a.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var V=n-1,o=1,s=0;for(this[e+V]=255&t;--V>=0&&(o*=256);)t<0&&0===s&&0!==this[e+V+1]&&(s=1),this[e+V]=(t/o>>0)-s&255;return e+n},a.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):k(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):k(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):I(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):I(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},a.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},a.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},a.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},a.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,V=r-n;if(this===t&&n<e&&e<r)for(i=V-1;i>=0;--i)t[i+e]=this[i+n];else if(V<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<V;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+V),e);return V},a.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var V;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(V=e;V<n;++V)this[V]=t;else{var o=a.isBuffer(t)?t:F(new a(t,r).toString()),s=o.length;for(V=0;V<n-e;++V)this[V+e]=o[V%s]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var n;e=e||1/0;for(var r=t.length,i=null,V=[],o=0;o<r;++o){if((n=t.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&V.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&V.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&V.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&V.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;V.push(n)}else if(n<2048){if((e-=2)<0)break;V.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;V.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;V.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return V}function B(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(34))},function(t,e,n){"use strict";var r={};function i(t,e,n){n||(n=Error);var i=function(t){var n,r;function i(n,r,i){return t.call(this,function(t,n,r){return"string"==typeof e?e:e(t,n,r)}(n,r,i))||this}return r=t,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);i.prototype.name=n.name,i.prototype.code=t,r[t]=i}function V(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,n){var r,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(r="must not be",e=e.replace(/^not /,"")):r="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))s="The ".concat(t," ").concat(r," ").concat(V(e,"type"));else{var a=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(a," ").concat(r," ").concat(V(e,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},function(t,e,n){"use strict";(function(e){var r=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=c;var i=n(87),V=n(92);n(59)(c,i);for(var o=r(V.prototype),s=0;s<o.length;s++){var a=o[s];c.prototype[a]||(c.prototype[a]=V.prototype[a])}function c(t){if(!(this instanceof c))return new c(t);i.call(this,t),V.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||e.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this,n(38))},function(t,e,n){"use strict";n.r(e),n.d(e,"Observable",(function(){return r.a})),n.d(e,"ConnectableObservable",(function(){return i.a})),n.d(e,"GroupedObservable",(function(){return V.a})),n.d(e,"observable",(function(){return o.a})),n.d(e,"Subject",(function(){return s.a})),n.d(e,"BehaviorSubject",(function(){return a.a})),n.d(e,"ReplaySubject",(function(){return c.a})),n.d(e,"AsyncSubject",(function(){return u.a})),n.d(e,"asap",(function(){return h.a})),n.d(e,"asapScheduler",(function(){return h.b})),n.d(e,"async",(function(){return l.a})),n.d(e,"asyncScheduler",(function(){return l.b})),n.d(e,"queue",(function(){return f.a})),n.d(e,"queueScheduler",(function(){return f.b})),n.d(e,"animationFrame",(function(){return y})),n.d(e,"animationFrameScheduler",(function(){return m})),n.d(e,"VirtualTimeScheduler",(function(){return b})),n.d(e,"VirtualAction",(function(){return _})),n.d(e,"Scheduler",(function(){return w.a})),n.d(e,"Subscription",(function(){return A.a})),n.d(e,"Subscriber",(function(){return S.a})),n.d(e,"Notification",(function(){return x.a})),n.d(e,"NotificationKind",(function(){return x.b})),n.d(e,"pipe",(function(){return T.a})),n.d(e,"noop",(function(){return C.a})),n.d(e,"identity",(function(){return E.a})),n.d(e,"isObservable",(function(){return R})),n.d(e,"ArgumentOutOfRangeError",(function(){return M.a})),n.d(e,"EmptyError",(function(){return O.a})),n.d(e,"ObjectUnsubscribedError",(function(){return P.a})),n.d(e,"UnsubscriptionError",(function(){return k.a})),n.d(e,"TimeoutError",(function(){return I.a})),n.d(e,"bindCallback",(function(){return U})),n.d(e,"bindNodeCallback",(function(){return W})),n.d(e,"combineLatest",(function(){return G.b})),n.d(e,"concat",(function(){return Y.a})),n.d(e,"defer",(function(){return $.a})),n.d(e,"empty",(function(){return Q.b})),n.d(e,"forkJoin",(function(){return K})),n.d(e,"from",(function(){return Z.a})),n.d(e,"fromEvent",(function(){return et})),n.d(e,"fromEventPattern",(function(){return nt})),n.d(e,"generate",(function(){return rt})),n.d(e,"iif",(function(){return Vt})),n.d(e,"interval",(function(){return st})),n.d(e,"merge",(function(){return ct.a})),n.d(e,"never",(function(){return ht})),n.d(e,"of",(function(){return lt.a})),n.d(e,"onErrorResumeNext",(function(){return ft})),n.d(e,"pairs",(function(){return dt})),n.d(e,"partition",(function(){return yt})),n.d(e,"race",(function(){return bt.a})),n.d(e,"range",(function(){return _t})),n.d(e,"throwError",(function(){return At.a})),n.d(e,"timer",(function(){return St.a})),n.d(e,"using",(function(){return xt})),n.d(e,"zip",(function(){return Tt.b})),n.d(e,"scheduled",(function(){return Ct.a})),n.d(e,"EMPTY",(function(){return Q.a})),n.d(e,"NEVER",(function(){return ut})),n.d(e,"config",(function(){return Et.a}));var r=n(3),i=n(65),V=n(62),o=n(20),s=n(5),a=n(66),c=n(49),u=n(28),h=n(40),l=n(6),f=n(60),d=n(0),p=n(29),g=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return d.a(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},e}(p.a),v=n(27),m=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d.a(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},e}(v.a))(g),y=m,b=function(t){function e(e,n){void 0===e&&(e=_),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return d.a(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(v.a),_=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return d.a(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){void 0===n&&(n=0)},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(p.a),w=n(61),A=n(4),S=n(1),x=n(17),T=n(39),C=n(19),E=n(14);function R(t){return!!t&&(t instanceof r.a||"function"==typeof t.lift&&"function"==typeof t.subscribe)}var M=n(22),O=n(24),P=n(21),k=n(42),I=n(68),D=n(8),N=n(56),j=n(7),L=n(9);function U(t,e,n){if(e){if(!Object(L.a)(e))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return U(t,n).apply(void 0,r).pipe(Object(D.a)((function(t){return Object(j.a)(t)?e.apply(void 0,t):e(t)})))};n=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var V,o=this,s={context:o,subject:V,callbackFunc:t,scheduler:n};return new r.a((function(r){if(n){var i={args:e,subscriber:r,params:s};return n.schedule(F,0,i)}if(!V){V=new u.a;try{t.apply(o,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];V.next(t.length<=1?t[0]:t),V.complete()}]))}catch(t){Object(N.a)(V)?V.error(t):console.warn(t)}}return V.subscribe(r)}))}}function F(t){var e=this,n=t.args,r=t.subscriber,i=t.params,V=i.callbackFunc,o=i.context,s=i.scheduler,a=i.subject;if(!a){a=i.subject=new u.a;try{V.apply(o,n.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length<=1?t[0]:t;e.add(s.schedule(B,0,{value:r,subject:a}))}]))}catch(t){a.error(t)}}this.add(a.subscribe(r))}function B(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function W(t,e,n){if(e){if(!Object(L.a)(e))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return W(t,n).apply(void 0,r).pipe(Object(D.a)((function(t){return Object(j.a)(t)?e.apply(void 0,t):e(t)})))};n=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var V={subject:void 0,args:e,callbackFunc:t,scheduler:n,context:this};return new r.a((function(r){var i=V.context,o=V.subject;if(n)return n.schedule(q,0,{params:V,subscriber:r,context:i});if(!o){o=V.subject=new u.a;try{t.apply(i,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.shift();n?o.error(n):(o.next(t.length<=1?t[0]:t),o.complete())}]))}catch(t){Object(N.a)(o)?o.error(t):console.warn(t)}}return o.subscribe(r)}))}}function q(t){var e=this,n=t.params,r=t.subscriber,i=t.context,V=n.callbackFunc,o=n.args,s=n.scheduler,a=n.subject;if(!a){a=n.subject=new u.a;try{V.apply(i,o.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.shift();if(r)e.add(s.schedule(H,0,{err:r,subject:a}));else{var i=t.length<=1?t[0]:t;e.add(s.schedule(z,0,{value:i,subject:a}))}}]))}catch(t){this.add(s.schedule(H,0,{err:t,subject:a}))}}this.add(a.subscribe(r))}function z(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function H(t){var e=t.err;t.subject.error(e)}var G=n(51),Y=n(31),$=n(53),Q=n(10),X=n(55),Z=n(11);function K(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var n=t[0];if(Object(j.a)(n))return J(n,null);if(Object(X.a)(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return J(r.map((function(t){return n[t]})),r)}}if("function"==typeof t[t.length-1]){var i=t.pop();return J(t=1===t.length&&Object(j.a)(t[0])?t[0]:t,null).pipe(Object(D.a)((function(t){return i.apply(void 0,t)})))}return J(t,null)}function J(t,e){return new r.a((function(n){var r=t.length;if(0!==r)for(var i=new Array(r),V=0,o=0,s=function(s){var a=Object(Z.a)(t[s]),c=!1;n.add(a.subscribe({next:function(t){c||(c=!0,o++),i[s]=t},error:function(t){return n.error(t)},complete:function(){++V!==r&&c||(o===r&&n.next(e?e.reduce((function(t,e,n){return t[e]=i[n],t}),{}):i),n.complete())}}))},a=0;a<r;a++)s(a);else n.complete()}))}var tt=n(23);function et(t,e,n,i){return Object(tt.a)(n)&&(i=n,n=void 0),i?et(t,e,n).pipe(Object(D.a)((function(t){return Object(j.a)(t)?i.apply(void 0,t):i(t)}))):new r.a((function(r){!function t(e,n,r,i,V){var o;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var s=e;e.addEventListener(n,r,V),o=function(){return s.removeEventListener(n,r,V)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var a=e;e.on(n,r),o=function(){return a.off(n,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var c=e;e.addListener(n,r),o=function(){return c.removeListener(n,r)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var u=0,h=e.length;u<h;u++)t(e[u],n,r,i,V)}i.add(o)}(t,e,(function(t){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(t)}),r,n)}))}function nt(t,e,n){return n?nt(t,e).pipe(Object(D.a)((function(t){return Object(j.a)(t)?n.apply(void 0,t):n(t)}))):new r.a((function(n){var r,i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.next(1===t.length?t[0]:t)};try{r=t(i)}catch(t){return void n.error(t)}if(Object(tt.a)(e))return function(){return e(i,r)}}))}function rt(t,e,n,i,V){var o,s;if(1==arguments.length){var a=t;s=a.initialState,e=a.condition,n=a.iterate,o=a.resultSelector||E.a,V=a.scheduler}else void 0===i||Object(L.a)(i)?(s=t,o=E.a,V=i):(s=t,o=i);return new r.a((function(t){var r=s;if(V)return V.schedule(it,0,{subscriber:t,iterate:n,condition:e,resultSelector:o,state:r});for(;;){if(e){var i=void 0;try{i=e(r)}catch(e){return void t.error(e)}if(!i){t.complete();break}}var a=void 0;try{a=o(r)}catch(e){return void t.error(e)}if(t.next(a),t.closed)break;try{r=n(r)}catch(e){return void t.error(e)}}}))}function it(t){var e=t.subscriber,n=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(n){var r=void 0;try{r=n(t.state)}catch(t){return void e.error(t)}if(!r)return void e.complete();if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function Vt(t,e,n){return void 0===e&&(e=Q.a),void 0===n&&(n=Q.a),Object($.a)((function(){return t()?e:n}))}var ot=n(30);function st(t,e){return void 0===t&&(t=0),void 0===e&&(e=l.a),(!Object(ot.a)(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=l.a),new r.a((function(n){return n.add(e.schedule(at,t,{subscriber:n,counter:0,period:t})),n}))}function at(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}var ct=n(70),ut=new r.a(C.a);function ht(){return ut}var lt=n(36);function ft(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return Q.a;var n=t[0],i=t.slice(1);return 1===t.length&&Object(j.a)(n)?ft.apply(void 0,n):new r.a((function(t){var e=function(){return t.add(ft.apply(void 0,i).subscribe(t))};return Object(Z.a)(n).subscribe({next:function(e){t.next(e)},error:e,complete:e})}))}function dt(t,e){return e?new r.a((function(n){var r=Object.keys(t),i=new A.a;return i.add(e.schedule(pt,0,{keys:r,index:0,subscriber:n,subscription:i,obj:t})),i})):new r.a((function(e){for(var n=Object.keys(t),r=0;r<n.length&&!e.closed;r++){var i=n[r];t.hasOwnProperty(i)&&e.next([i,t[i]])}e.complete()}))}function pt(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,V=t.obj;if(!r.closed)if(n<e.length){var o=e[n];r.next([o,V[o]]),i.add(this.schedule({keys:e,index:n+1,subscriber:r,subscription:i,obj:V}))}else r.complete()}var gt=n(78),vt=n(32),mt=n(16);function yt(t,e,n){return[Object(mt.a)(e,n)(new r.a(Object(vt.a)(t))),Object(mt.a)(Object(gt.a)(e,n))(new r.a(Object(vt.a)(t)))]}var bt=n(71);function _t(t,e,n){return void 0===t&&(t=0),new r.a((function(r){void 0===e&&(e=t,t=0);var i=0,V=t;if(n)return n.schedule(wt,0,{index:i,count:e,start:t,subscriber:r});for(;;){if(i++>=e){r.complete();break}if(r.next(V++),r.closed)break}}))}function wt(t){var e=t.start,n=t.index,r=t.count,i=t.subscriber;n>=r?i.complete():(i.next(e),i.closed||(t.index=n+1,t.start=e+1,this.schedule(t)))}var At=n(50),St=n(72);function xt(t,e){return new r.a((function(n){var r,i;try{r=t()}catch(t){return void n.error(t)}try{i=e(r)}catch(t){return void n.error(t)}var V=(i?Object(Z.a)(i):Q.a).subscribe(n);return function(){V.unsubscribe(),r&&r.unsubscribe()}}))}var Tt=n(54),Ct=n(73),Et=n(13)},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(0),i=n(1);function V(){return function(t){return t.lift(new o(t))}}var o=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new s(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i},t}(),s=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.a(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(5),V=n(60),o=n(4),s=n(67),a=n(21),c=n(74),u=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return r.a(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new h(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,V=r.length;if(this.closed)throw new a.a;if(this.isStopped||this.hasError?e=o.a.EMPTY:(this.observers.push(t),e=new c.a(this,t)),i&&t.add(t=new s.a(t,i)),n)for(var u=0;u<V&&!t.closed;u++)t.next(r[u]);else for(u=0;u<V&&!t.closed;u++)t.next(r[u].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||V.a).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,V=0;V<i&&!(t-r[V].time<n);)V++;return i>e&&(V=Math.max(V,i-e)),V>0&&r.splice(0,V),r},e}(i.a),h=function(){return function(t,e){this.time=t,this.value=e}}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(3);function i(t,e){return e?new r.a((function(n){return e.schedule(V,0,{error:t,subscriber:n})})):new r.a((function(e){return e.error(t)}))}function V(t){var e=t.error;t.subscriber.error(e)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return h}));var r=n(0),i=n(9),V=n(7),o=n(15),s=n(12),a=n(26),c={};function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return Object(i.a)(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&Object(V.a)(t[0])&&(t=t[0]),Object(a.a)(t,r).lift(new h(n))}var h=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.resultSelector))},t}(),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return r.a(e,t),e.prototype._next=function(t){this.values.push(c),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Object(s.a)(this,r,void 0,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n){var r=this.values,i=r[n],V=this.toRespond?i===c?--this.toRespond:this.toRespond:0;r[n]=e,0===V&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(25),i=n(14);function V(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Object(r.b)(i.a,t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(11),V=n(10);function o(t){return new r.a((function(e){var n;try{n=t()}catch(t){return void e.error(t)}return(n?Object(i.a)(n):Object(V.b)()).subscribe(e)}))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return u}));var r=n(0),i=n(26),V=n(7),o=n(1),s=n(18),a=n(2);function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return"function"==typeof n&&t.pop(),Object(i.a)(t,void 0).lift(new u(n))}var u=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.resultSelector))},t}(),h=function(t){function e(e,n,r){void 0===r&&(r=Object.create(null));var i=t.call(this,e)||this;return i.resultSelector=n,i.iterators=[],i.active=0,i.resultSelector="function"==typeof n?n:void 0,i}return r.a(e,t),e.prototype._next=function(t){var e=this.iterators;Object(V.a)(t)?e.push(new f(t)):"function"==typeof t[s.a]?e.push(new l(t[s.a]())):e.push(new d(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var n=0;n<e;n++){var r=t[n];if(r.stillUnsubscribed)this.destination.add(r.subscribe());else this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,n=this.destination,r=0;r<e;r++){if("function"==typeof(o=t[r]).hasValue&&!o.hasValue())return}var i=!1,V=[];for(r=0;r<e;r++){var o,s=(o=t[r]).next();if(o.hasCompleted()&&(i=!0),s.done)return void n.complete();V.push(s.value)}this.resultSelector?this._tryresultSelector(V):n.next(V),i&&n.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.a),l=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),f=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[s.a]=function(){return this},t.prototype.next=function(t){var e=this.index++,n=this.array;return e<this.length?{value:n[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),d=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return r.a(e,t),e.prototype[s.a]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},e.prototype.subscribe=function(){return Object(a.c)(this.observable,new a.a(this))},e}(a.b)},function(t,e,n){"use strict";function r(t){return null!==t&&"object"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(1);function i(t){for(;t;){var e=t,n=e.closed,i=e.destination,V=e.isStopped;if(n||V)return!1;t=i&&i instanceof r.a?i:null}return!0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(3),i=n(4);function V(t,e){return new r.a((function(n){var r=new i.a,V=0;return r.add(e.schedule((function(){V!==t.length?(n.next(t[V++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return V}));var r=n(13),i=n(33),V={closed:!0,next:function(t){},error:function(t){if(r.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete:function(){}}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return V})),n.d(e,"a",(function(){return o}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.a(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(n(29).a),V=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e}(n(27).a))(i),o=V},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return l}));var r=n(0),i=n(1),V=n(4),o=n(3),s=n(5);function a(t,e,n,r){return function(i){return i.lift(new c(t,e,n,r))}}var c=function(){function t(t,e,n,r){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=r}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),u=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.keySelector=n,o.elementSelector=r,o.durationSelector=i,o.subjectSelector=V,o.groups=null,o.attemptedToUnsubscribe=!1,o.count=0,o}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,i=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!i){i=this.subjectSelector?this.subjectSelector():new s.a,n.set(e,i);var V=new l(e,i,this);if(this.destination.next(V),this.durationSelector){var o=void 0;try{o=this.durationSelector(new l(e,i))}catch(t){return void this.error(t)}this.add(o.subscribe(new h(e,i,this)))}}i.closed||i.next(r)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,n){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(i.a),h=function(t){function e(e,n,r){var i=t.call(this,n)||this;return i.key=e,i.group=n,i.parent=r,i}return r.a(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(i.a),l=function(t){function e(e,n,r){var i=t.call(this)||this;return i.key=e,i.groupSubject=n,i.refCountSubscription=r,i}return r.a(e,t),e.prototype._subscribe=function(t){var e=new V.a,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new f(n)),e.add(r.subscribe(t)),e},e}(o.a),f=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return r.a(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(V.a)},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.DigitalHumanUnmuted=e.DigitalHumanPlayedInMutedModeSuccess=e.DigitalHumanFailedToPlay=e.DigitalHumanVideoError=e.ClientPerformanceMessage=e.ClientMediaStreamUpdateMessage=e.OnlineStatusUpdateMessage=e.SessionInfoMessage=e.AvatarRequestIgnored=e.AvatarRequestCompleted=e.SessionErrorMessage=e.WebRtcStatsMessage=e.WebRtcDataMessage=e.SessionLiveMessage=e.WarningMessage=e.RecordingStoppedMessage=e.RecordingStartedMessage=e.DevicePermissionAllowedMessage=e.AvatarTextInputFinishedMessage=e.FinishedSpeakingMessage=e.StartedSpeakingMessage=e.AvatarQuestionMessage=e.InstructionsMessage=e.AvatarAnswerContentMessage=e.AvatarAnswerMessage=e.ConnectionLostMessage=e.VoiceActivityInputModeNotSupportedMessage=e.MicActivityNotSupportedMessage=e.MicActivityMessage=e.MicActivityErrorMessage=e.ServiceUnavailableMessage=e.AvatarUnavailableMessage=e.AvatarAvailableMessage=e.SessionEndedMessage=e.SessionResumedMessage=e.SessionPausedMessage=e.DeviceListUpdatedMessage=e.DeviceErrorMessage=e.SetSpeakerSuccessMessage=e.SetMicSuccessMessage=e.SetCameraSuccessMessage=e.DeviceNotFoundErrorMessage=e.ReadyMessage=e.UneeqMessageType=void 0,function(t){t.Ready="Ready",t.DeviceNotFoundError="DeviceNotFoundError",t.SetCameraSuccess="SetCameraSuccess",t.SetMicSuccess="SetMicSuccess",t.SetSpeakerSuccess="SetSpeakerSuccess",t.SessionPaused="SessionPaused",t.SessionResumed="SessionResumed",t.SessionEnded="SessionEnded",t.AvatarAvailable="AvatarAvailable",t.AvatarUnavailable="AvatarUnavailable",t.ConnectionLost="ConnectionLost",t.ServiceUnavailable="ServiceUnavailable",t.OnlineStatusUpdate="OnlineStatusUpdate",t.MicActivityNotSupported="MicActivityNotSupported",t.VoiceActivityInputModeNotSupported="VoiceActivityInputModeNotSupported",t.MicActivityError="MicActivityError",t.MicActivity="MicActivity",t.DeviceError="DeviceError",t.DeviceListUpdated="DeviceListUpdated",t.AvatarAnswer="AvatarAnswer",t.AvatarAnswerContent="AvatarAnswerContent",t.Instructions="Instructions",t.StartedSpeaking="StartedSpeaking",t.FinishedSpeaking="FinishedSpeaking",t.AvatarTextInputFinished="AvatarTextInputFinished",t.AvatarQuestionText="AvatarQuestionText",t.DevicePermissionAllowed="DevicePermissionAllowed",t.RecordingStarted="RecordingStarted",t.RecordingStopped="RecordingStopped",t.Warning="Warning",t.SessionLive="SessionLive",t.WebRtcData="WebRtcData",t.WebRtcStats="WebRtcStats",t.SessionError="SessionError",t.SessionInfo="SessionInfo",t.AvatarRequestCompleted="AvatarRequestCompleted",t.AvatarRequestIgnored="AvatarRequestIgnored",t.ClientMediaStreamUpdate="ClientMediaStreamUpdate",t.ClientPerformanceMessage="ClientPerformanceMessage",t.DigitalHumanVideoError="DigitalHumanVideoError",t.DigitalHumanFailedToPlay="DigitalHumanFailedToPlay",t.DigitalHumanPlayedInMutedModeSuccess="DigitalHumanPlayedInMutedModeSuccess",t.DigitalHumanUnmuted="DigitalHumanUnmuted"}(r=e.UneeqMessageType||(e.UneeqMessageType={}));e.ReadyMessage=class{constructor(){this.uneeqMessageType=r.Ready}};e.DeviceNotFoundErrorMessage=class{constructor(t,e){this.msg=t,this.deviceId=e,this.uneeqMessageType=r.DeviceNotFoundError}};e.SetCameraSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetCameraSuccess}};e.SetMicSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetMicSuccess}};e.SetSpeakerSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetSpeakerSuccess}};e.DeviceErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.DeviceError}};e.DeviceListUpdatedMessage=class{constructor(t){this.devices=t,this.uneeqMessageType=r.DeviceListUpdated}};e.SessionPausedMessage=class{constructor(){this.uneeqMessageType=r.SessionPaused}};e.SessionResumedMessage=class{constructor(){this.uneeqMessageType=r.SessionResumed}};e.SessionEndedMessage=class{constructor(){this.uneeqMessageType=r.SessionEnded}};e.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarAvailable}};e.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarUnavailable}};e.ServiceUnavailableMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.ServiceUnavailable}};e.MicActivityErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.MicActivityError}};e.MicActivityMessage=class{constructor(t){this.level=t,this.uneeqMessageType=r.MicActivity}};e.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.MicActivityNotSupported}};e.VoiceActivityInputModeNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.VoiceActivityInputModeNotSupported}};e.ConnectionLostMessage=class{constructor(t){this.connectionState=t,this.uneeqMessageType=r.ConnectionLost}};e.AvatarAnswerMessage=class{constructor(t,e,n,i){this.answer=t,this.answerAvatar=e,this.answerSpeech=n,this.transcriptId=i,this.uneeqMessageType=r.AvatarAnswer}};e.AvatarAnswerContentMessage=class{constructor(t,e,n=!1){this.content=t,this.transcriptId=e,this.hasDisplayHtml=n,this.uneeqMessageType=r.AvatarAnswerContent}};e.InstructionsMessage=class{constructor(t){this.instructions=t,this.uneeqMessageType=r.Instructions}};e.AvatarQuestionMessage=class{constructor(t,e){this.question=t,this.transcriptId=e,this.uneeqMessageType=r.AvatarQuestionText}};e.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.StartedSpeaking}};e.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.FinishedSpeaking}};e.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=r.AvatarTextInputFinished}};e.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=r.DevicePermissionAllowed}};e.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStarted}};e.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStopped}};e.WarningMessage=class{constructor(t){this.msg=t,this.uneeqMessageType=r.Warning}};e.SessionLiveMessage=class{constructor(t,e){this.showLogo=t,this.sessionResumed=e,this.uneeqMessageType=r.SessionLive}};e.WebRtcDataMessage=class{constructor(t){this.data=t,this.uneeqMessageType=r.WebRtcData}};e.WebRtcStatsMessage=class{constructor(t){this.stats=t,this.uneeqMessageType=r.WebRtcStats}};e.SessionErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.SessionError}};e.AvatarRequestCompleted=class{constructor(t){this.reason=t,this.uneeqMessageType=r.AvatarRequestCompleted}};e.AvatarRequestIgnored=class{constructor(t){this.reason=t,this.uneeqMessageType=r.AvatarRequestIgnored}};e.SessionInfoMessage=class{constructor(t){this.info=t,this.uneeqMessageType=r.SessionInfo}};e.OnlineStatusUpdateMessage=class{constructor(t){this.online=t,this.uneeqMessageType=r.OnlineStatusUpdate}};e.ClientMediaStreamUpdateMessage=class{constructor(t,e,n,i){this.clientStreamingAudio=t,this.clientStreamingVideo=e,this.serverStreamingAudio=n,this.serverStreamingVideo=i,this.uneeqMessageType=r.ClientMediaStreamUpdate}};e.ClientPerformanceMessage=class{constructor(t){this.clientPerformance=t,this.uneeqMessageType=r.ClientPerformanceMessage}};e.DigitalHumanVideoError=class{constructor(t){this.error=t,this.uneeqMessageType=r.DigitalHumanVideoError}};e.DigitalHumanFailedToPlay=class{constructor(){this.uneeqMessageType=r.DigitalHumanFailedToPlay,this.msg="Digital Human failed to play with sound. This most likely occurred because the user has not yet interacted with the page and was blocked due to the browser's autoplay policy. Video will automatically be muted and attempted to be played again."}};e.DigitalHumanPlayedInMutedModeSuccess=class{constructor(){this.uneeqMessageType=r.DigitalHumanPlayedInMutedModeSuccess,this.msg="Digital Human was successfully played in muted mode. After the user interacts with the page you will need to call unmuteDigitalHuman() to unmute the video."}};e.DigitalHumanUnmuted=class{constructor(){this.uneeqMessageType=r.DigitalHumanUnmuted}}},function(t,e,n){(function(t,r){var i;
24
24
  /**
25
25
  * @license
26
26
  * Lodash <https://lodash.com/>
@@ -28,11 +28,11 @@ var r=n(101),i=n(102),V=n(103);function o(){return a.TYPED_ARRAY_SUPPORT?2147483
28
28
  * Released under MIT license <https://lodash.com/license>
29
29
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
30
30
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
31
- */(function(){var V="Expected a function",o="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],a="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",l="[object Error]",f="[object Function]",d="[object GeneratorFunction]",p="[object Map]",g="[object Number]",v="[object Object]",y="[object RegExp]",m="[object Set]",b="[object String]",_="[object Symbol]",w="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",x="[object Float32Array]",T="[object Float64Array]",C="[object Int8Array]",E="[object Int16Array]",R="[object Int32Array]",M="[object Uint8Array]",O="[object Uint16Array]",P="[object Uint32Array]",k=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,D=/(__e\(.*?\)|\b__t\)) \+\n'';/g,N=/&(?:amp|lt|gt|quot|#39);/g,j=/[&<>"']/g,L=RegExp(N.source),U=RegExp(j.source),F=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(G.source),$=/^\s+/,Q=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Z=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,tt=/[()=,{}\[\]\/\s]/,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,Vt=/^0b[01]+$/i,ot=/^\[object .+?Constructor\]$/,st=/^0o[0-7]+$/i,at=/^(?:0|[1-9]\d*)$/,ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ut=/($^)/,ht=/['\n\r\u2028\u2029\\]/g,lt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ft="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dt="[\\ud800-\\udfff]",pt="["+ft+"]",gt="["+lt+"]",vt="\\d+",yt="[\\u2700-\\u27bf]",mt="[a-z\\xdf-\\xf6\\xf8-\\xff]",bt="[^\\ud800-\\udfff"+ft+vt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_t="\\ud83c[\\udffb-\\udfff]",wt="[^\\ud800-\\udfff]",At="(?:\\ud83c[\\udde6-\\uddff]){2}",St="[\\ud800-\\udbff][\\udc00-\\udfff]",xt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Tt="(?:"+mt+"|"+bt+")",Ct="(?:"+xt+"|"+bt+")",Et="(?:"+gt+"|"+_t+")"+"?",Rt="[\\ufe0e\\ufe0f]?"+Et+("(?:\\u200d(?:"+[wt,At,St].join("|")+")[\\ufe0e\\ufe0f]?"+Et+")*"),Mt="(?:"+[yt,At,St].join("|")+")"+Rt,Ot="(?:"+[wt+gt+"?",gt,At,St,dt].join("|")+")",Pt=RegExp("['’]","g"),kt=RegExp(gt,"g"),It=RegExp(_t+"(?="+_t+")|"+Ot+Rt,"g"),Dt=RegExp([xt+"?"+mt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pt,xt,"$"].join("|")+")",Ct+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pt,xt+Tt,"$"].join("|")+")",xt+"?"+Tt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",xt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vt,Mt].join("|"),"g"),Nt=RegExp("[\\u200d\\ud800-\\udfff"+lt+"\\ufe0e\\ufe0f]"),jt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ut=-1,Ft={};Ft[x]=Ft[T]=Ft[C]=Ft[E]=Ft[R]=Ft[M]=Ft["[object Uint8ClampedArray]"]=Ft[O]=Ft[P]=!0,Ft[a]=Ft[c]=Ft[A]=Ft[u]=Ft[S]=Ft[h]=Ft[l]=Ft[f]=Ft[p]=Ft[g]=Ft[v]=Ft[y]=Ft[m]=Ft[b]=Ft[w]=!1;var Bt={};Bt[a]=Bt[c]=Bt[A]=Bt[S]=Bt[u]=Bt[h]=Bt[x]=Bt[T]=Bt[C]=Bt[E]=Bt[R]=Bt[p]=Bt[g]=Bt[v]=Bt[y]=Bt[m]=Bt[b]=Bt[_]=Bt[M]=Bt["[object Uint8ClampedArray]"]=Bt[O]=Bt[P]=!0,Bt[l]=Bt[f]=Bt[w]=!1;var Wt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zt=parseFloat,qt=parseInt,Ht="object"==typeof t&&t&&t.Object===Object&&t,Gt="object"==typeof self&&self&&self.Object===Object&&self,Yt=Ht||Gt||Function("return this")(),$t=e&&!e.nodeType&&e,Qt=$t&&"object"==typeof r&&r&&!r.nodeType&&r,Xt=Qt&&Qt.exports===$t,Zt=Xt&&Ht.process,Kt=function(){try{var t=Qt&&Qt.require&&Qt.require("util").types;return t||Zt&&Zt.binding&&Zt.binding("util")}catch(t){}}(),Jt=Kt&&Kt.isArrayBuffer,te=Kt&&Kt.isDate,ee=Kt&&Kt.isMap,ne=Kt&&Kt.isRegExp,re=Kt&&Kt.isSet,ie=Kt&&Kt.isTypedArray;function Ve(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function oe(t,e,n,r){for(var i=-1,V=null==t?0:t.length;++i<V;){var o=t[i];e(r,o,n(o),t)}return r}function se(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function ae(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function ce(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function ue(t,e){for(var n=-1,r=null==t?0:t.length,i=0,V=[];++n<r;){var o=t[n];e(o,n,t)&&(V[i++]=o)}return V}function he(t,e){return!!(null==t?0:t.length)&&_e(t,e,0)>-1}function le(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function fe(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function de(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function pe(t,e,n,r){var i=-1,V=null==t?0:t.length;for(r&&V&&(n=t[++i]);++i<V;)n=e(n,t[i],i,t);return n}function ge(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function ve(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var ye=xe("length");function me(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function be(t,e,n,r){for(var i=t.length,V=n+(r?1:-1);r?V--:++V<i;)if(e(t[V],V,t))return V;return-1}function _e(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):be(t,Ae,n)}function we(t,e,n,r){for(var i=n-1,V=t.length;++i<V;)if(r(t[i],e))return i;return-1}function Ae(t){return t!=t}function Se(t,e){var n=null==t?0:t.length;return n?Ee(t,e)/n:NaN}function xe(t){return function(e){return null==e?void 0:e[t]}}function Te(t){return function(e){return null==t?void 0:t[e]}}function Ce(t,e,n,r,i){return i(t,(function(t,i,V){n=r?(r=!1,t):e(n,t,i,V)})),n}function Ee(t,e){for(var n,r=-1,i=t.length;++r<i;){var V=e(t[r]);void 0!==V&&(n=void 0===n?V:n+V)}return n}function Re(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Me(t){return t?t.slice(0,$e(t)+1).replace($,""):t}function Oe(t){return function(e){return t(e)}}function Pe(t,e){return fe(e,(function(e){return t[e]}))}function ke(t,e){return t.has(e)}function Ie(t,e){for(var n=-1,r=t.length;++n<r&&_e(e,t[n],0)>-1;);return n}function De(t,e){for(var n=t.length;n--&&_e(e,t[n],0)>-1;);return n}function Ne(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var je=Te({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Le=Te({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ue(t){return"\\"+Wt[t]}function Fe(t){return Nt.test(t)}function Be(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function We(t,e){return function(n){return t(e(n))}}function ze(t,e){for(var n=-1,r=t.length,i=0,V=[];++n<r;){var s=t[n];s!==e&&s!==o||(t[n]=o,V[i++]=n)}return V}function qe(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function He(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function Ge(t){return Fe(t)?function(t){var e=It.lastIndex=0;for(;It.test(t);)++e;return e}(t):ye(t)}function Ye(t){return Fe(t)?function(t){return t.match(It)||[]}(t):function(t){return t.split("")}(t)}function $e(t){for(var e=t.length;e--&&Q.test(t.charAt(e)););return e}var Qe=Te({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Xe=function t(e){var n,r=(e=null==e?Yt:Xe.defaults(Yt.Object(),e,Xe.pick(Yt,Lt))).Array,i=e.Date,Q=e.Error,lt=e.Function,ft=e.Math,dt=e.Object,pt=e.RegExp,gt=e.String,vt=e.TypeError,yt=r.prototype,mt=lt.prototype,bt=dt.prototype,_t=e["__core-js_shared__"],wt=mt.toString,At=bt.hasOwnProperty,St=0,xt=(n=/[^.]+$/.exec(_t&&_t.keys&&_t.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Tt=bt.toString,Ct=wt.call(dt),Et=Yt._,Rt=pt("^"+wt.call(At).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=Xt?e.Buffer:void 0,Ot=e.Symbol,It=e.Uint8Array,Nt=Mt?Mt.allocUnsafe:void 0,Wt=We(dt.getPrototypeOf,dt),Ht=dt.create,Gt=bt.propertyIsEnumerable,$t=yt.splice,Qt=Ot?Ot.isConcatSpreadable:void 0,Zt=Ot?Ot.iterator:void 0,Kt=Ot?Ot.toStringTag:void 0,ye=function(){try{var t=tV(dt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Te=e.clearTimeout!==Yt.clearTimeout&&e.clearTimeout,Ze=i&&i.now!==Yt.Date.now&&i.now,Ke=e.setTimeout!==Yt.setTimeout&&e.setTimeout,Je=ft.ceil,tn=ft.floor,en=dt.getOwnPropertySymbols,nn=Mt?Mt.isBuffer:void 0,rn=e.isFinite,Vn=yt.join,on=We(dt.keys,dt),sn=ft.max,an=ft.min,cn=i.now,un=e.parseInt,hn=ft.random,ln=yt.reverse,fn=tV(e,"DataView"),dn=tV(e,"Map"),pn=tV(e,"Promise"),gn=tV(e,"Set"),vn=tV(e,"WeakMap"),yn=tV(dt,"create"),mn=vn&&new vn,bn={},_n=CV(fn),wn=CV(dn),An=CV(pn),Sn=CV(gn),xn=CV(vn),Tn=Ot?Ot.prototype:void 0,Cn=Tn?Tn.valueOf:void 0,En=Tn?Tn.toString:void 0;function Rn(t){if(Ho(t)&&!Io(t)&&!(t instanceof kn)){if(t instanceof Pn)return t;if(At.call(t,"__wrapped__"))return EV(t)}return new Pn(t)}var Mn=function(){function t(){}return function(e){if(!qo(e))return{};if(Ht)return Ht(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function On(){}function Pn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function kn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function In(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Dn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Nn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function jn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Nn;++e<n;)this.add(t[e])}function Ln(t){var e=this.__data__=new Dn(t);this.size=e.size}function Un(t,e){var n=Io(t),r=!n&&ko(t),i=!n&&!r&&Lo(t),V=!n&&!r&&!i&&Jo(t),o=n||r||i||V,s=o?Re(t.length,gt):[],a=s.length;for(var c in t)!e&&!At.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||V&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||sV(c,a))||s.push(c);return s}function Fn(t){var e=t.length;return e?t[jr(0,e-1)]:void 0}function Bn(t,e){return SV(yi(t),Xn(e,0,t.length))}function Wn(t){return SV(yi(t))}function zn(t,e,n){(void 0!==n&&!Mo(t[e],n)||void 0===n&&!(e in t))&&$n(t,e,n)}function qn(t,e,n){var r=t[e];At.call(t,e)&&Mo(r,n)&&(void 0!==n||e in t)||$n(t,e,n)}function Hn(t,e){for(var n=t.length;n--;)if(Mo(t[n][0],e))return n;return-1}function Gn(t,e,n,r){return er(t,(function(t,i,V){e(r,t,n(t),V)})),r}function Yn(t,e){return t&&mi(e,_s(e),t)}function $n(t,e,n){"__proto__"==e&&ye?ye(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Qn(t,e){for(var n=-1,i=e.length,V=r(i),o=null==t;++n<i;)V[n]=o?void 0:gs(t,e[n]);return V}function Xn(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function Zn(t,e,n,r,i,V){var o,s=1&e,c=2&e,l=4&e;if(n&&(o=i?n(t,r,i,V):n(t)),void 0!==o)return o;if(!qo(t))return t;var w=Io(t);if(w){if(o=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&At.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!s)return yi(t,o)}else{var k=rV(t),I=k==f||k==d;if(Lo(t))return li(t,s);if(k==v||k==a||I&&!i){if(o=c||I?{}:VV(t),!s)return c?function(t,e){return mi(t,nV(t),e)}(t,function(t,e){return t&&mi(e,ws(e),t)}(o,t)):function(t,e){return mi(t,eV(t),e)}(t,Yn(o,t))}else{if(!Bt[k])return i?t:{};o=function(t,e,n){var r=t.constructor;switch(e){case A:return fi(t);case u:case h:return new r(+t);case S:return function(t,e){var n=e?fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case x:case T:case C:case E:case R:case M:case"[object Uint8ClampedArray]":case O:case P:return di(t,n);case p:return new r;case g:case b:return new r(t);case y:return function(t){var e=new t.constructor(t.source,rt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return new r;case _:return i=t,Cn?dt(Cn.call(i)):{}}var i}(t,k,s)}}V||(V=new Ln);var D=V.get(t);if(D)return D;V.set(t,o),Xo(t)?t.forEach((function(r){o.add(Zn(r,e,n,r,t,V))})):Go(t)&&t.forEach((function(r,i){o.set(i,Zn(r,e,n,i,t,V))}));var N=w?void 0:(l?c?Yi:Gi:c?ws:_s)(t);return se(N||t,(function(r,i){N&&(r=t[i=r]),qn(o,i,Zn(r,e,n,i,t,V))})),o}function Kn(t,e,n){var r=n.length;if(null==t)return!r;for(t=dt(t);r--;){var i=n[r],V=e[i],o=t[i];if(void 0===o&&!(i in t)||!V(o))return!1}return!0}function Jn(t,e,n){if("function"!=typeof t)throw new vt(V);return bV((function(){t.apply(void 0,n)}),e)}function tr(t,e,n,r){var i=-1,V=he,o=!0,s=t.length,a=[],c=e.length;if(!s)return a;n&&(e=fe(e,Oe(n))),r?(V=le,o=!1):e.length>=200&&(V=ke,o=!1,e=new jn(e));t:for(;++i<s;){var u=t[i],h=null==n?u:n(u);if(u=r||0!==u?u:0,o&&h==h){for(var l=c;l--;)if(e[l]===h)continue t;a.push(u)}else V(e,h,r)||a.push(u)}return a}Rn.templateSettings={escape:F,evaluate:B,interpolate:W,variable:"",imports:{_:Rn}},Rn.prototype=On.prototype,Rn.prototype.constructor=Rn,Pn.prototype=Mn(On.prototype),Pn.prototype.constructor=Pn,kn.prototype=Mn(On.prototype),kn.prototype.constructor=kn,In.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},In.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},In.prototype.get=function(t){var e=this.__data__;if(yn){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return At.call(e,t)?e[t]:void 0},In.prototype.has=function(t){var e=this.__data__;return yn?void 0!==e[t]:At.call(e,t)},In.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=yn&&void 0===e?"__lodash_hash_undefined__":e,this},Dn.prototype.clear=function(){this.__data__=[],this.size=0},Dn.prototype.delete=function(t){var e=this.__data__,n=Hn(e,t);return!(n<0)&&(n==e.length-1?e.pop():$t.call(e,n,1),--this.size,!0)},Dn.prototype.get=function(t){var e=this.__data__,n=Hn(e,t);return n<0?void 0:e[n][1]},Dn.prototype.has=function(t){return Hn(this.__data__,t)>-1},Dn.prototype.set=function(t,e){var n=this.__data__,r=Hn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Nn.prototype.clear=function(){this.size=0,this.__data__={hash:new In,map:new(dn||Dn),string:new In}},Nn.prototype.delete=function(t){var e=Ki(this,t).delete(t);return this.size-=e?1:0,e},Nn.prototype.get=function(t){return Ki(this,t).get(t)},Nn.prototype.has=function(t){return Ki(this,t).has(t)},Nn.prototype.set=function(t,e){var n=Ki(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},jn.prototype.add=jn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},jn.prototype.has=function(t){return this.__data__.has(t)},Ln.prototype.clear=function(){this.__data__=new Dn,this.size=0},Ln.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Ln.prototype.get=function(t){return this.__data__.get(t)},Ln.prototype.has=function(t){return this.__data__.has(t)},Ln.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Dn){var r=n.__data__;if(!dn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Nn(r)}return n.set(t,e),this.size=n.size,this};var er=wi(cr),nr=wi(ur,!0);function rr(t,e){var n=!0;return er(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function ir(t,e,n){for(var r=-1,i=t.length;++r<i;){var V=t[r],o=e(V);if(null!=o&&(void 0===s?o==o&&!Ko(o):n(o,s)))var s=o,a=V}return a}function Vr(t,e){var n=[];return er(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function or(t,e,n,r,i){var V=-1,o=t.length;for(n||(n=oV),i||(i=[]);++V<o;){var s=t[V];e>0&&n(s)?e>1?or(s,e-1,n,r,i):de(i,s):r||(i[i.length]=s)}return i}var sr=Ai(),ar=Ai(!0);function cr(t,e){return t&&sr(t,e,_s)}function ur(t,e){return t&&ar(t,e,_s)}function hr(t,e){return ue(e,(function(e){return Bo(t[e])}))}function lr(t,e){for(var n=0,r=(e=ai(e,t)).length;null!=t&&n<r;)t=t[TV(e[n++])];return n&&n==r?t:void 0}function fr(t,e,n){var r=e(t);return Io(t)?r:de(r,n(t))}function dr(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Kt&&Kt in dt(t)?function(t){var e=At.call(t,Kt),n=t[Kt];try{t[Kt]=void 0;var r=!0}catch(t){}var i=Tt.call(t);r&&(e?t[Kt]=n:delete t[Kt]);return i}(t):function(t){return Tt.call(t)}(t)}function pr(t,e){return t>e}function gr(t,e){return null!=t&&At.call(t,e)}function vr(t,e){return null!=t&&e in dt(t)}function yr(t,e,n){for(var i=n?le:he,V=t[0].length,o=t.length,s=o,a=r(o),c=1/0,u=[];s--;){var h=t[s];s&&e&&(h=fe(h,Oe(e))),c=an(h.length,c),a[s]=!n&&(e||V>=120&&h.length>=120)?new jn(s&&h):void 0}h=t[0];var l=-1,f=a[0];t:for(;++l<V&&u.length<c;){var d=h[l],p=e?e(d):d;if(d=n||0!==d?d:0,!(f?ke(f,p):i(u,p,n))){for(s=o;--s;){var g=a[s];if(!(g?ke(g,p):i(t[s],p,n)))continue t}f&&f.push(p),u.push(d)}}return u}function mr(t,e,n){var r=null==(t=gV(t,e=ai(e,t)))?t:t[TV(UV(e))];return null==r?void 0:Ve(r,t,n)}function br(t){return Ho(t)&&dr(t)==a}function _r(t,e,n,r,i){return t===e||(null==t||null==e||!Ho(t)&&!Ho(e)?t!=t&&e!=e:function(t,e,n,r,i,V){var o=Io(t),s=Io(e),f=o?c:rV(t),d=s?c:rV(e),w=(f=f==a?v:f)==v,x=(d=d==a?v:d)==v,T=f==d;if(T&&Lo(t)){if(!Lo(e))return!1;o=!0,w=!1}if(T&&!w)return V||(V=new Ln),o||Jo(t)?qi(t,e,n,r,i,V):function(t,e,n,r,i,V,o){switch(n){case S:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case A:return!(t.byteLength!=e.byteLength||!V(new It(t),new It(e)));case u:case h:case g:return Mo(+t,+e);case l:return t.name==e.name&&t.message==e.message;case y:case b:return t==e+"";case p:var s=Be;case m:var a=1&r;if(s||(s=qe),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;r|=2,o.set(t,e);var f=qi(s(t),s(e),r,i,V,o);return o.delete(t),f;case _:if(Cn)return Cn.call(t)==Cn.call(e)}return!1}(t,e,f,n,r,i,V);if(!(1&n)){var C=w&&At.call(t,"__wrapped__"),E=x&&At.call(e,"__wrapped__");if(C||E){var R=C?t.value():t,M=E?e.value():e;return V||(V=new Ln),i(R,M,n,r,V)}}if(!T)return!1;return V||(V=new Ln),function(t,e,n,r,i,V){var o=1&n,s=Gi(t),a=s.length,c=Gi(e).length;if(a!=c&&!o)return!1;var u=a;for(;u--;){var h=s[u];if(!(o?h in e:At.call(e,h)))return!1}var l=V.get(t),f=V.get(e);if(l&&f)return l==e&&f==t;var d=!0;V.set(t,e),V.set(e,t);var p=o;for(;++u<a;){h=s[u];var g=t[h],v=e[h];if(r)var y=o?r(v,g,h,e,t,V):r(g,v,h,t,e,V);if(!(void 0===y?g===v||i(g,v,n,r,V):y)){d=!1;break}p||(p="constructor"==h)}if(d&&!p){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return V.delete(t),V.delete(e),d}(t,e,n,r,i,V)}(t,e,n,r,_r,i))}function wr(t,e,n,r){var i=n.length,V=i,o=!r;if(null==t)return!V;for(t=dt(t);i--;){var s=n[i];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<V;){var a=(s=n[i])[0],c=t[a],u=s[1];if(o&&s[2]){if(void 0===c&&!(a in t))return!1}else{var h=new Ln;if(r)var l=r(c,u,a,t,e,h);if(!(void 0===l?_r(u,c,3,r,h):l))return!1}}return!0}function Ar(t){return!(!qo(t)||(e=t,xt&&xt in e))&&(Bo(t)?Rt:ot).test(CV(t));var e}function Sr(t){return"function"==typeof t?t:null==t?Ys:"object"==typeof t?Io(t)?Mr(t[0],t[1]):Rr(t):na(t)}function xr(t){if(!lV(t))return on(t);var e=[];for(var n in dt(t))At.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Tr(t){if(!qo(t))return function(t){var e=[];if(null!=t)for(var n in dt(t))e.push(n);return e}(t);var e=lV(t),n=[];for(var r in t)("constructor"!=r||!e&&At.call(t,r))&&n.push(r);return n}function Cr(t,e){return t<e}function Er(t,e){var n=-1,i=No(t)?r(t.length):[];return er(t,(function(t,r,V){i[++n]=e(t,r,V)})),i}function Rr(t){var e=Ji(t);return 1==e.length&&e[0][2]?dV(e[0][0],e[0][1]):function(n){return n===t||wr(n,t,e)}}function Mr(t,e){return cV(t)&&fV(e)?dV(TV(t),e):function(n){var r=gs(n,t);return void 0===r&&r===e?vs(n,t):_r(e,r,3)}}function Or(t,e,n,r,i){t!==e&&sr(e,(function(V,o){if(i||(i=new Ln),qo(V))!function(t,e,n,r,i,V,o){var s=yV(t,n),a=yV(e,n),c=o.get(a);if(c)return void zn(t,n,c);var u=V?V(s,a,n+"",t,e,o):void 0,h=void 0===u;if(h){var l=Io(a),f=!l&&Lo(a),d=!l&&!f&&Jo(a);u=a,l||f||d?Io(s)?u=s:jo(s)?u=yi(s):f?(h=!1,u=li(a,!0)):d?(h=!1,u=di(a,!0)):u=[]:$o(a)||ko(a)?(u=s,ko(s)?u=ss(s):qo(s)&&!Bo(s)||(u=VV(a))):h=!1}h&&(o.set(a,u),i(u,a,r,V,o),o.delete(a));zn(t,n,u)}(t,e,o,n,Or,r,i);else{var s=r?r(yV(t,o),V,o+"",t,e,i):void 0;void 0===s&&(s=V),zn(t,o,s)}}),ws)}function Pr(t,e){var n=t.length;if(n)return sV(e+=e<0?n:0,n)?t[e]:void 0}function kr(t,e,n){e=e.length?fe(e,(function(t){return Io(t)?function(e){return lr(e,1===t.length?t[0]:t)}:t})):[Ys];var r=-1;return e=fe(e,Oe(Zi())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Er(t,(function(t,n,i){return{criteria:fe(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,V=e.criteria,o=i.length,s=n.length;for(;++r<o;){var a=pi(i[r],V[r]);if(a){if(r>=s)return a;var c=n[r];return a*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)}))}function Ir(t,e,n){for(var r=-1,i=e.length,V={};++r<i;){var o=e[r],s=lr(t,o);n(s,o)&&Wr(V,ai(o,t),s)}return V}function Dr(t,e,n,r){var i=r?we:_e,V=-1,o=e.length,s=t;for(t===e&&(e=yi(e)),n&&(s=fe(t,Oe(n)));++V<o;)for(var a=0,c=e[V],u=n?n(c):c;(a=i(s,u,a,r))>-1;)s!==t&&$t.call(s,a,1),$t.call(t,a,1);return t}function Nr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==V){var V=i;sV(i)?$t.call(t,i,1):ti(t,i)}}return t}function jr(t,e){return t+tn(hn()*(e-t+1))}function Lr(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=tn(e/2))&&(t+=t)}while(e);return n}function Ur(t,e){return _V(pV(t,e,Ys),t+"")}function Fr(t){return Fn(Ms(t))}function Br(t,e){var n=Ms(t);return SV(n,Xn(e,0,n.length))}function Wr(t,e,n,r){if(!qo(t))return t;for(var i=-1,V=(e=ai(e,t)).length,o=V-1,s=t;null!=s&&++i<V;){var a=TV(e[i]),c=n;if("__proto__"===a||"constructor"===a||"prototype"===a)return t;if(i!=o){var u=s[a];void 0===(c=r?r(u,a,s):void 0)&&(c=qo(u)?u:sV(e[i+1])?[]:{})}qn(s,a,c),s=s[a]}return t}var zr=mn?function(t,e){return mn.set(t,e),t}:Ys,qr=ye?function(t,e){return ye(t,"toString",{configurable:!0,enumerable:!1,value:qs(e),writable:!0})}:Ys;function Hr(t){return SV(Ms(t))}function Gr(t,e,n){var i=-1,V=t.length;e<0&&(e=-e>V?0:V+e),(n=n>V?V:n)<0&&(n+=V),V=e>n?0:n-e>>>0,e>>>=0;for(var o=r(V);++i<V;)o[i]=t[i+e];return o}function Yr(t,e){var n;return er(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function $r(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var V=r+i>>>1,o=t[V];null!==o&&!Ko(o)&&(n?o<=e:o<e)?r=V+1:i=V}return i}return Qr(t,e,Ys,n)}function Qr(t,e,n,r){var i=0,V=null==t?0:t.length;if(0===V)return 0;for(var o=(e=n(e))!=e,s=null===e,a=Ko(e),c=void 0===e;i<V;){var u=tn((i+V)/2),h=n(t[u]),l=void 0!==h,f=null===h,d=h==h,p=Ko(h);if(o)var g=r||d;else g=c?d&&(r||l):s?d&&l&&(r||!f):a?d&&l&&!f&&(r||!p):!f&&!p&&(r?h<=e:h<e);g?i=u+1:V=u}return an(V,4294967294)}function Xr(t,e){for(var n=-1,r=t.length,i=0,V=[];++n<r;){var o=t[n],s=e?e(o):o;if(!n||!Mo(s,a)){var a=s;V[i++]=0===o?0:o}}return V}function Zr(t){return"number"==typeof t?t:Ko(t)?NaN:+t}function Kr(t){if("string"==typeof t)return t;if(Io(t))return fe(t,Kr)+"";if(Ko(t))return En?En.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Jr(t,e,n){var r=-1,i=he,V=t.length,o=!0,s=[],a=s;if(n)o=!1,i=le;else if(V>=200){var c=e?null:Li(t);if(c)return qe(c);o=!1,i=ke,a=new jn}else a=e?[]:s;t:for(;++r<V;){var u=t[r],h=e?e(u):u;if(u=n||0!==u?u:0,o&&h==h){for(var l=a.length;l--;)if(a[l]===h)continue t;e&&a.push(h),s.push(u)}else i(a,h,n)||(a!==s&&a.push(h),s.push(u))}return s}function ti(t,e){return null==(t=gV(t,e=ai(e,t)))||delete t[TV(UV(e))]}function ei(t,e,n,r){return Wr(t,e,n(lr(t,e)),r)}function ni(t,e,n,r){for(var i=t.length,V=r?i:-1;(r?V--:++V<i)&&e(t[V],V,t););return n?Gr(t,r?0:V,r?V+1:i):Gr(t,r?V+1:0,r?i:V)}function ri(t,e){var n=t;return n instanceof kn&&(n=n.value()),pe(e,(function(t,e){return e.func.apply(e.thisArg,de([t],e.args))}),n)}function ii(t,e,n){var i=t.length;if(i<2)return i?Jr(t[0]):[];for(var V=-1,o=r(i);++V<i;)for(var s=t[V],a=-1;++a<i;)a!=V&&(o[V]=tr(o[V]||s,t[a],e,n));return Jr(or(o,1),e,n)}function Vi(t,e,n){for(var r=-1,i=t.length,V=e.length,o={};++r<i;){var s=r<V?e[r]:void 0;n(o,t[r],s)}return o}function oi(t){return jo(t)?t:[]}function si(t){return"function"==typeof t?t:Ys}function ai(t,e){return Io(t)?t:cV(t,e)?[t]:xV(as(t))}var ci=Ur;function ui(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:Gr(t,e,n)}var hi=Te||function(t){return Yt.clearTimeout(t)};function li(t,e){if(e)return t.slice();var n=t.length,r=Nt?Nt(n):new t.constructor(n);return t.copy(r),r}function fi(t){var e=new t.constructor(t.byteLength);return new It(e).set(new It(t)),e}function di(t,e){var n=e?fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function pi(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,V=Ko(t),o=void 0!==e,s=null===e,a=e==e,c=Ko(e);if(!s&&!c&&!V&&t>e||V&&o&&a&&!s&&!c||r&&o&&a||!n&&a||!i)return 1;if(!r&&!V&&!c&&t<e||c&&n&&i&&!r&&!V||s&&n&&i||!o&&i||!a)return-1}return 0}function gi(t,e,n,i){for(var V=-1,o=t.length,s=n.length,a=-1,c=e.length,u=sn(o-s,0),h=r(c+u),l=!i;++a<c;)h[a]=e[a];for(;++V<s;)(l||V<o)&&(h[n[V]]=t[V]);for(;u--;)h[a++]=t[V++];return h}function vi(t,e,n,i){for(var V=-1,o=t.length,s=-1,a=n.length,c=-1,u=e.length,h=sn(o-a,0),l=r(h+u),f=!i;++V<h;)l[V]=t[V];for(var d=V;++c<u;)l[d+c]=e[c];for(;++s<a;)(f||V<o)&&(l[d+n[s]]=t[V++]);return l}function yi(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function mi(t,e,n,r){var i=!n;n||(n={});for(var V=-1,o=e.length;++V<o;){var s=e[V],a=r?r(n[s],t[s],s,n,t):void 0;void 0===a&&(a=t[s]),i?$n(n,s,a):qn(n,s,a)}return n}function bi(t,e){return function(n,r){var i=Io(n)?oe:Gn,V=e?e():{};return i(n,t,Zi(r,2),V)}}function _i(t){return Ur((function(e,n){var r=-1,i=n.length,V=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(V=t.length>3&&"function"==typeof V?(i--,V):void 0,o&&aV(n[0],n[1],o)&&(V=i<3?void 0:V,i=1),e=dt(e);++r<i;){var s=n[r];s&&t(e,s,r,V)}return e}))}function wi(t,e){return function(n,r){if(null==n)return n;if(!No(n))return t(n,r);for(var i=n.length,V=e?i:-1,o=dt(n);(e?V--:++V<i)&&!1!==r(o[V],V,o););return n}}function Ai(t){return function(e,n,r){for(var i=-1,V=dt(e),o=r(e),s=o.length;s--;){var a=o[t?s:++i];if(!1===n(V[a],a,V))break}return e}}function Si(t){return function(e){var n=Fe(e=as(e))?Ye(e):void 0,r=n?n[0]:e.charAt(0),i=n?ui(n,1).join(""):e.slice(1);return r[t]()+i}}function xi(t){return function(e){return pe(Bs(ks(e).replace(Pt,"")),t,"")}}function Ti(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Mn(t.prototype),r=t.apply(n,e);return qo(r)?r:n}}function Ci(t){return function(e,n,r){var i=dt(e);if(!No(e)){var V=Zi(n,3);e=_s(e),n=function(t){return V(i[t],t,i)}}var o=t(e,n,r);return o>-1?i[V?e[o]:o]:void 0}}function Ei(t){return Hi((function(e){var n=e.length,r=n,i=Pn.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new vt(V);if(i&&!s&&"wrapper"==Qi(o))var s=new Pn([],!0)}for(r=s?r:n;++r<n;){var a=Qi(o=e[r]),c="wrapper"==a?$i(o):void 0;s=c&&uV(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?s[Qi(c[0])].apply(s,c[3]):1==o.length&&uV(o)?s[a]():s.thru(o)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&Io(r))return s.plant(r).value();for(var i=0,V=n?e[i].apply(this,t):r;++i<n;)V=e[i].call(this,V);return V}}))}function Ri(t,e,n,i,V,o,s,a,c,u){var h=128&e,l=1&e,f=2&e,d=24&e,p=512&e,g=f?void 0:Ti(t);return function v(){for(var y=arguments.length,m=r(y),b=y;b--;)m[b]=arguments[b];if(d)var _=Xi(v),w=Ne(m,_);if(i&&(m=gi(m,i,V,d)),o&&(m=vi(m,o,s,d)),y-=w,d&&y<u){var A=ze(m,_);return Ni(t,e,Ri,v.placeholder,n,m,A,a,c,u-y)}var S=l?n:this,x=f?S[t]:t;return y=m.length,a?m=vV(m,a):p&&y>1&&m.reverse(),h&&c<y&&(m.length=c),this&&this!==Yt&&this instanceof v&&(x=g||Ti(x)),x.apply(S,m)}}function Mi(t,e){return function(n,r){return function(t,e,n,r){return cr(t,(function(t,i,V){e(r,n(t),i,V)})),r}(n,t,e(r),{})}}function Oi(t,e){return function(n,r){var i;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Kr(n),r=Kr(r)):(n=Zr(n),r=Zr(r)),i=t(n,r)}return i}}function Pi(t){return Hi((function(e){return e=fe(e,Oe(Zi())),Ur((function(n){var r=this;return t(e,(function(t){return Ve(t,r,n)}))}))}))}function ki(t,e){var n=(e=void 0===e?" ":Kr(e)).length;if(n<2)return n?Lr(e,t):e;var r=Lr(e,Je(t/Ge(e)));return Fe(e)?ui(Ye(r),0,t).join(""):r.slice(0,t)}function Ii(t){return function(e,n,i){return i&&"number"!=typeof i&&aV(e,n,i)&&(n=i=void 0),e=rs(e),void 0===n?(n=e,e=0):n=rs(n),function(t,e,n,i){for(var V=-1,o=sn(Je((e-t)/(n||1)),0),s=r(o);o--;)s[i?o:++V]=t,t+=n;return s}(e,n,i=void 0===i?e<n?1:-1:rs(i),t)}}function Di(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=os(e),n=os(n)),t(e,n)}}function Ni(t,e,n,r,i,V,o,s,a,c){var u=8&e;e|=u?32:64,4&(e&=~(u?64:32))||(e&=-4);var h=[t,e,i,u?V:void 0,u?o:void 0,u?void 0:V,u?void 0:o,s,a,c],l=n.apply(void 0,h);return uV(t)&&mV(l,h),l.placeholder=r,wV(l,t,e)}function ji(t){var e=ft[t];return function(t,n){if(t=os(t),(n=null==n?0:an(is(n),292))&&rn(t)){var r=(as(t)+"e").split("e");return+((r=(as(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Li=gn&&1/qe(new gn([,-0]))[1]==1/0?function(t){return new gn(t)}:Ks;function Ui(t){return function(e){var n=rV(e);return n==p?Be(e):n==m?He(e):function(t,e){return fe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Fi(t,e,n,i,s,a,c,u){var h=2&e;if(!h&&"function"!=typeof t)throw new vt(V);var l=i?i.length:0;if(l||(e&=-97,i=s=void 0),c=void 0===c?c:sn(is(c),0),u=void 0===u?u:is(u),l-=s?s.length:0,64&e){var f=i,d=s;i=s=void 0}var p=h?void 0:$i(t),g=[t,e,n,i,s,f,d,a,c,u];if(p&&function(t,e){var n=t[1],r=e[1],i=n|r,V=i<131,s=128==r&&8==n||128==r&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!V&&!s)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var a=e[3];if(a){var c=t[3];t[3]=c?gi(c,a,e[4]):a,t[4]=c?ze(t[3],o):e[4]}(a=e[5])&&(c=t[5],t[5]=c?vi(c,a,e[6]):a,t[6]=c?ze(t[5],o):e[6]);(a=e[7])&&(t[7]=a);128&r&&(t[8]=null==t[8]?e[8]:an(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(g,p),t=g[0],e=g[1],n=g[2],i=g[3],s=g[4],!(u=g[9]=void 0===g[9]?h?0:t.length:sn(g[9]-l,0))&&24&e&&(e&=-25),e&&1!=e)v=8==e||16==e?function(t,e,n){var i=Ti(t);return function V(){for(var o=arguments.length,s=r(o),a=o,c=Xi(V);a--;)s[a]=arguments[a];var u=o<3&&s[0]!==c&&s[o-1]!==c?[]:ze(s,c);if((o-=u.length)<n)return Ni(t,e,Ri,V.placeholder,void 0,s,u,void 0,void 0,n-o);var h=this&&this!==Yt&&this instanceof V?i:t;return Ve(h,this,s)}}(t,e,u):32!=e&&33!=e||s.length?Ri.apply(void 0,g):function(t,e,n,i){var V=1&e,o=Ti(t);return function e(){for(var s=-1,a=arguments.length,c=-1,u=i.length,h=r(u+a),l=this&&this!==Yt&&this instanceof e?o:t;++c<u;)h[c]=i[c];for(;a--;)h[c++]=arguments[++s];return Ve(l,V?n:this,h)}}(t,e,n,i);else var v=function(t,e,n){var r=1&e,i=Ti(t);return function e(){var V=this&&this!==Yt&&this instanceof e?i:t;return V.apply(r?n:this,arguments)}}(t,e,n);return wV((p?zr:mV)(v,g),t,e)}function Bi(t,e,n,r){return void 0===t||Mo(t,bt[n])&&!At.call(r,n)?e:t}function Wi(t,e,n,r,i,V){return qo(t)&&qo(e)&&(V.set(e,t),Or(t,e,void 0,Wi,V),V.delete(e)),t}function zi(t){return $o(t)?void 0:t}function qi(t,e,n,r,i,V){var o=1&n,s=t.length,a=e.length;if(s!=a&&!(o&&a>s))return!1;var c=V.get(t),u=V.get(e);if(c&&u)return c==e&&u==t;var h=-1,l=!0,f=2&n?new jn:void 0;for(V.set(t,e),V.set(e,t);++h<s;){var d=t[h],p=e[h];if(r)var g=o?r(p,d,h,e,t,V):r(d,p,h,t,e,V);if(void 0!==g){if(g)continue;l=!1;break}if(f){if(!ve(e,(function(t,e){if(!ke(f,e)&&(d===t||i(d,t,n,r,V)))return f.push(e)}))){l=!1;break}}else if(d!==p&&!i(d,p,n,r,V)){l=!1;break}}return V.delete(t),V.delete(e),l}function Hi(t){return _V(pV(t,void 0,IV),t+"")}function Gi(t){return fr(t,_s,eV)}function Yi(t){return fr(t,ws,nV)}var $i=mn?function(t){return mn.get(t)}:Ks;function Qi(t){for(var e=t.name+"",n=bn[e],r=At.call(bn,e)?n.length:0;r--;){var i=n[r],V=i.func;if(null==V||V==t)return i.name}return e}function Xi(t){return(At.call(Rn,"placeholder")?Rn:t).placeholder}function Zi(){var t=Rn.iteratee||$s;return t=t===$s?Sr:t,arguments.length?t(arguments[0],arguments[1]):t}function Ki(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Ji(t){for(var e=_s(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,fV(i)]}return e}function tV(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Ar(n)?n:void 0}var eV=en?function(t){return null==t?[]:(t=dt(t),ue(en(t),(function(e){return Gt.call(t,e)})))}:Va,nV=en?function(t){for(var e=[];t;)de(e,eV(t)),t=Wt(t);return e}:Va,rV=dr;function iV(t,e,n){for(var r=-1,i=(e=ai(e,t)).length,V=!1;++r<i;){var o=TV(e[r]);if(!(V=null!=t&&n(t,o)))break;t=t[o]}return V||++r!=i?V:!!(i=null==t?0:t.length)&&zo(i)&&sV(o,i)&&(Io(t)||ko(t))}function VV(t){return"function"!=typeof t.constructor||lV(t)?{}:Mn(Wt(t))}function oV(t){return Io(t)||ko(t)||!!(Qt&&t&&t[Qt])}function sV(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&at.test(t))&&t>-1&&t%1==0&&t<e}function aV(t,e,n){if(!qo(n))return!1;var r=typeof e;return!!("number"==r?No(n)&&sV(e,n.length):"string"==r&&e in n)&&Mo(n[e],t)}function cV(t,e){if(Io(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ko(t))||(q.test(t)||!z.test(t)||null!=e&&t in dt(e))}function uV(t){var e=Qi(t),n=Rn[e];if("function"!=typeof n||!(e in kn.prototype))return!1;if(t===n)return!0;var r=$i(n);return!!r&&t===r[0]}(fn&&rV(new fn(new ArrayBuffer(1)))!=S||dn&&rV(new dn)!=p||pn&&"[object Promise]"!=rV(pn.resolve())||gn&&rV(new gn)!=m||vn&&rV(new vn)!=w)&&(rV=function(t){var e=dr(t),n=e==v?t.constructor:void 0,r=n?CV(n):"";if(r)switch(r){case _n:return S;case wn:return p;case An:return"[object Promise]";case Sn:return m;case xn:return w}return e});var hV=_t?Bo:oa;function lV(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||bt)}function fV(t){return t==t&&!qo(t)}function dV(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in dt(n)))}}function pV(t,e,n){return e=sn(void 0===e?t.length-1:e,0),function(){for(var i=arguments,V=-1,o=sn(i.length-e,0),s=r(o);++V<o;)s[V]=i[e+V];V=-1;for(var a=r(e+1);++V<e;)a[V]=i[V];return a[e]=n(s),Ve(t,this,a)}}function gV(t,e){return e.length<2?t:lr(t,Gr(e,0,-1))}function vV(t,e){for(var n=t.length,r=an(e.length,n),i=yi(t);r--;){var V=e[r];t[r]=sV(V,n)?i[V]:void 0}return t}function yV(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var mV=AV(zr),bV=Ke||function(t,e){return Yt.setTimeout(t,e)},_V=AV(qr);function wV(t,e,n){var r=e+"";return _V(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(X,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return se(s,(function(n){var r="_."+n[0];e&n[1]&&!he(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(Z);return e?e[1].split(K):[]}(r),n)))}function AV(t){var e=0,n=0;return function(){var r=cn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function SV(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n<e;){var V=jr(n,i),o=t[V];t[V]=t[n],t[n]=o}return t.length=e,t}var xV=function(t){var e=So(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(H,(function(t,n,r,i){e.push(r?i.replace(et,"$1"):n||t)})),e}));function TV(t){if("string"==typeof t||Ko(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function CV(t){if(null!=t){try{return wt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function EV(t){if(t instanceof kn)return t.clone();var e=new Pn(t.__wrapped__,t.__chain__);return e.__actions__=yi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var RV=Ur((function(t,e){return jo(t)?tr(t,or(e,1,jo,!0)):[]})),MV=Ur((function(t,e){var n=UV(e);return jo(n)&&(n=void 0),jo(t)?tr(t,or(e,1,jo,!0),Zi(n,2)):[]})),OV=Ur((function(t,e){var n=UV(e);return jo(n)&&(n=void 0),jo(t)?tr(t,or(e,1,jo,!0),void 0,n):[]}));function PV(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:is(n);return i<0&&(i=sn(r+i,0)),be(t,Zi(e,3),i)}function kV(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=is(n),i=n<0?sn(r+i,0):an(i,r-1)),be(t,Zi(e,3),i,!0)}function IV(t){return(null==t?0:t.length)?or(t,1):[]}function DV(t){return t&&t.length?t[0]:void 0}var NV=Ur((function(t){var e=fe(t,oi);return e.length&&e[0]===t[0]?yr(e):[]})),jV=Ur((function(t){var e=UV(t),n=fe(t,oi);return e===UV(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?yr(n,Zi(e,2)):[]})),LV=Ur((function(t){var e=UV(t),n=fe(t,oi);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?yr(n,void 0,e):[]}));function UV(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var FV=Ur(BV);function BV(t,e){return t&&t.length&&e&&e.length?Dr(t,e):t}var WV=Hi((function(t,e){var n=null==t?0:t.length,r=Qn(t,e);return Nr(t,fe(e,(function(t){return sV(t,n)?+t:t})).sort(pi)),r}));function zV(t){return null==t?t:ln.call(t)}var qV=Ur((function(t){return Jr(or(t,1,jo,!0))})),HV=Ur((function(t){var e=UV(t);return jo(e)&&(e=void 0),Jr(or(t,1,jo,!0),Zi(e,2))})),GV=Ur((function(t){var e=UV(t);return e="function"==typeof e?e:void 0,Jr(or(t,1,jo,!0),void 0,e)}));function YV(t){if(!t||!t.length)return[];var e=0;return t=ue(t,(function(t){if(jo(t))return e=sn(t.length,e),!0})),Re(e,(function(e){return fe(t,xe(e))}))}function $V(t,e){if(!t||!t.length)return[];var n=YV(t);return null==e?n:fe(n,(function(t){return Ve(e,void 0,t)}))}var QV=Ur((function(t,e){return jo(t)?tr(t,e):[]})),XV=Ur((function(t){return ii(ue(t,jo))})),ZV=Ur((function(t){var e=UV(t);return jo(e)&&(e=void 0),ii(ue(t,jo),Zi(e,2))})),KV=Ur((function(t){var e=UV(t);return e="function"==typeof e?e:void 0,ii(ue(t,jo),void 0,e)})),JV=Ur(YV);var to=Ur((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,$V(t,n)}));function eo(t){var e=Rn(t);return e.__chain__=!0,e}function no(t,e){return e(t)}var ro=Hi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Qn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof kn&&sV(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:no,args:[i],thisArg:void 0}),new Pn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var io=bi((function(t,e,n){At.call(t,n)?++t[n]:$n(t,n,1)}));var Vo=Ci(PV),oo=Ci(kV);function so(t,e){return(Io(t)?se:er)(t,Zi(e,3))}function ao(t,e){return(Io(t)?ae:nr)(t,Zi(e,3))}var co=bi((function(t,e,n){At.call(t,n)?t[n].push(e):$n(t,n,[e])}));var uo=Ur((function(t,e,n){var i=-1,V="function"==typeof e,o=No(t)?r(t.length):[];return er(t,(function(t){o[++i]=V?Ve(e,t,n):mr(t,e,n)})),o})),ho=bi((function(t,e,n){$n(t,n,e)}));function lo(t,e){return(Io(t)?fe:Er)(t,Zi(e,3))}var fo=bi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var po=Ur((function(t,e){if(null==t)return[];var n=e.length;return n>1&&aV(t,e[0],e[1])?e=[]:n>2&&aV(e[0],e[1],e[2])&&(e=[e[0]]),kr(t,or(e,1),[])})),go=Ze||function(){return Yt.Date.now()};function vo(t,e,n){return e=n?void 0:e,Fi(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function yo(t,e){var n;if("function"!=typeof e)throw new vt(V);return t=is(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var mo=Ur((function(t,e,n){var r=1;if(n.length){var i=ze(n,Xi(mo));r|=32}return Fi(t,r,e,n,i)})),bo=Ur((function(t,e,n){var r=3;if(n.length){var i=ze(n,Xi(bo));r|=32}return Fi(e,r,t,n,i)}));function _o(t,e,n){var r,i,o,s,a,c,u=0,h=!1,l=!1,f=!0;if("function"!=typeof t)throw new vt(V);function d(e){var n=r,V=i;return r=i=void 0,u=e,s=t.apply(V,n)}function p(t){return u=t,a=bV(v,e),h?d(t):s}function g(t){var n=t-c;return void 0===c||n>=e||n<0||l&&t-u>=o}function v(){var t=go();if(g(t))return y(t);a=bV(v,function(t){var n=e-(t-c);return l?an(n,o-(t-u)):n}(t))}function y(t){return a=void 0,f&&r?d(t):(r=i=void 0,s)}function m(){var t=go(),n=g(t);if(r=arguments,i=this,c=t,n){if(void 0===a)return p(c);if(l)return hi(a),a=bV(v,e),d(c)}return void 0===a&&(a=bV(v,e)),s}return e=os(e)||0,qo(n)&&(h=!!n.leading,o=(l="maxWait"in n)?sn(os(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f),m.cancel=function(){void 0!==a&&hi(a),u=0,r=c=i=a=void 0},m.flush=function(){return void 0===a?s:y(go())},m}var wo=Ur((function(t,e){return Jn(t,1,e)})),Ao=Ur((function(t,e,n){return Jn(t,os(e)||0,n)}));function So(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new vt(V);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],V=n.cache;if(V.has(i))return V.get(i);var o=t.apply(this,r);return n.cache=V.set(i,o)||V,o};return n.cache=new(So.Cache||Nn),n}function xo(t){if("function"!=typeof t)throw new vt(V);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}So.Cache=Nn;var To=ci((function(t,e){var n=(e=1==e.length&&Io(e[0])?fe(e[0],Oe(Zi())):fe(or(e,1),Oe(Zi()))).length;return Ur((function(r){for(var i=-1,V=an(r.length,n);++i<V;)r[i]=e[i].call(this,r[i]);return Ve(t,this,r)}))})),Co=Ur((function(t,e){return Fi(t,32,void 0,e,ze(e,Xi(Co)))})),Eo=Ur((function(t,e){return Fi(t,64,void 0,e,ze(e,Xi(Eo)))})),Ro=Hi((function(t,e){return Fi(t,256,void 0,void 0,void 0,e)}));function Mo(t,e){return t===e||t!=t&&e!=e}var Oo=Di(pr),Po=Di((function(t,e){return t>=e})),ko=br(function(){return arguments}())?br:function(t){return Ho(t)&&At.call(t,"callee")&&!Gt.call(t,"callee")},Io=r.isArray,Do=Jt?Oe(Jt):function(t){return Ho(t)&&dr(t)==A};function No(t){return null!=t&&zo(t.length)&&!Bo(t)}function jo(t){return Ho(t)&&No(t)}var Lo=nn||oa,Uo=te?Oe(te):function(t){return Ho(t)&&dr(t)==h};function Fo(t){if(!Ho(t))return!1;var e=dr(t);return e==l||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!$o(t)}function Bo(t){if(!qo(t))return!1;var e=dr(t);return e==f||e==d||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Wo(t){return"number"==typeof t&&t==is(t)}function zo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function qo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ho(t){return null!=t&&"object"==typeof t}var Go=ee?Oe(ee):function(t){return Ho(t)&&rV(t)==p};function Yo(t){return"number"==typeof t||Ho(t)&&dr(t)==g}function $o(t){if(!Ho(t)||dr(t)!=v)return!1;var e=Wt(t);if(null===e)return!0;var n=At.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&wt.call(n)==Ct}var Qo=ne?Oe(ne):function(t){return Ho(t)&&dr(t)==y};var Xo=re?Oe(re):function(t){return Ho(t)&&rV(t)==m};function Zo(t){return"string"==typeof t||!Io(t)&&Ho(t)&&dr(t)==b}function Ko(t){return"symbol"==typeof t||Ho(t)&&dr(t)==_}var Jo=ie?Oe(ie):function(t){return Ho(t)&&zo(t.length)&&!!Ft[dr(t)]};var ts=Di(Cr),es=Di((function(t,e){return t<=e}));function ns(t){if(!t)return[];if(No(t))return Zo(t)?Ye(t):yi(t);if(Zt&&t[Zt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Zt]());var e=rV(t);return(e==p?Be:e==m?qe:Ms)(t)}function rs(t){return t?(t=os(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function is(t){var e=rs(t),n=e%1;return e==e?n?e-n:e:0}function Vs(t){return t?Xn(is(t),0,4294967295):0}function os(t){if("number"==typeof t)return t;if(Ko(t))return NaN;if(qo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=qo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Me(t);var n=Vt.test(t);return n||st.test(t)?qt(t.slice(2),n?2:8):it.test(t)?NaN:+t}function ss(t){return mi(t,ws(t))}function as(t){return null==t?"":Kr(t)}var cs=_i((function(t,e){if(lV(e)||No(e))mi(e,_s(e),t);else for(var n in e)At.call(e,n)&&qn(t,n,e[n])})),us=_i((function(t,e){mi(e,ws(e),t)})),hs=_i((function(t,e,n,r){mi(e,ws(e),t,r)})),ls=_i((function(t,e,n,r){mi(e,_s(e),t,r)})),fs=Hi(Qn);var ds=Ur((function(t,e){t=dt(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&aV(e[0],e[1],i)&&(r=1);++n<r;)for(var V=e[n],o=ws(V),s=-1,a=o.length;++s<a;){var c=o[s],u=t[c];(void 0===u||Mo(u,bt[c])&&!At.call(t,c))&&(t[c]=V[c])}return t})),ps=Ur((function(t){return t.push(void 0,Wi),Ve(Ss,void 0,t)}));function gs(t,e,n){var r=null==t?void 0:lr(t,e);return void 0===r?n:r}function vs(t,e){return null!=t&&iV(t,e,vr)}var ys=Mi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Tt.call(e)),t[e]=n}),qs(Ys)),ms=Mi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Tt.call(e)),At.call(t,e)?t[e].push(n):t[e]=[n]}),Zi),bs=Ur(mr);function _s(t){return No(t)?Un(t):xr(t)}function ws(t){return No(t)?Un(t,!0):Tr(t)}var As=_i((function(t,e,n){Or(t,e,n)})),Ss=_i((function(t,e,n,r){Or(t,e,n,r)})),xs=Hi((function(t,e){var n={};if(null==t)return n;var r=!1;e=fe(e,(function(e){return e=ai(e,t),r||(r=e.length>1),e})),mi(t,Yi(t),n),r&&(n=Zn(n,7,zi));for(var i=e.length;i--;)ti(n,e[i]);return n}));var Ts=Hi((function(t,e){return null==t?{}:function(t,e){return Ir(t,e,(function(e,n){return vs(t,n)}))}(t,e)}));function Cs(t,e){if(null==t)return{};var n=fe(Yi(t),(function(t){return[t]}));return e=Zi(e),Ir(t,n,(function(t,n){return e(t,n[0])}))}var Es=Ui(_s),Rs=Ui(ws);function Ms(t){return null==t?[]:Pe(t,_s(t))}var Os=xi((function(t,e,n){return e=e.toLowerCase(),t+(n?Ps(e):e)}));function Ps(t){return Fs(as(t).toLowerCase())}function ks(t){return(t=as(t))&&t.replace(ct,je).replace(kt,"")}var Is=xi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ds=xi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ns=Si("toLowerCase");var js=xi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Ls=xi((function(t,e,n){return t+(n?" ":"")+Fs(e)}));var Us=xi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Fs=Si("toUpperCase");function Bs(t,e,n){return t=as(t),void 0===(e=n?void 0:e)?function(t){return jt.test(t)}(t)?function(t){return t.match(Dt)||[]}(t):function(t){return t.match(J)||[]}(t):t.match(e)||[]}var Ws=Ur((function(t,e){try{return Ve(t,void 0,e)}catch(t){return Fo(t)?t:new Q(t)}})),zs=Hi((function(t,e){return se(e,(function(e){e=TV(e),$n(t,e,mo(t[e],t))})),t}));function qs(t){return function(){return t}}var Hs=Ei(),Gs=Ei(!0);function Ys(t){return t}function $s(t){return Sr("function"==typeof t?t:Zn(t,1))}var Qs=Ur((function(t,e){return function(n){return mr(n,t,e)}})),Xs=Ur((function(t,e){return function(n){return mr(t,n,e)}}));function Zs(t,e,n){var r=_s(e),i=hr(e,r);null!=n||qo(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=hr(e,_s(e)));var V=!(qo(n)&&"chain"in n&&!n.chain),o=Bo(t);return se(i,(function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(V||e){var n=t(this.__wrapped__),i=n.__actions__=yi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,de([this.value()],arguments))})})),t}function Ks(){}var Js=Pi(fe),ta=Pi(ce),ea=Pi(ve);function na(t){return cV(t)?xe(TV(t)):function(t){return function(e){return lr(e,t)}}(t)}var ra=Ii(),ia=Ii(!0);function Va(){return[]}function oa(){return!1}var sa=Oi((function(t,e){return t+e}),0),aa=ji("ceil"),ca=Oi((function(t,e){return t/e}),1),ua=ji("floor");var ha,la=Oi((function(t,e){return t*e}),1),fa=ji("round"),da=Oi((function(t,e){return t-e}),0);return Rn.after=function(t,e){if("function"!=typeof e)throw new vt(V);return t=is(t),function(){if(--t<1)return e.apply(this,arguments)}},Rn.ary=vo,Rn.assign=cs,Rn.assignIn=us,Rn.assignInWith=hs,Rn.assignWith=ls,Rn.at=fs,Rn.before=yo,Rn.bind=mo,Rn.bindAll=zs,Rn.bindKey=bo,Rn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Io(t)?t:[t]},Rn.chain=eo,Rn.chunk=function(t,e,n){e=(n?aV(t,e,n):void 0===e)?1:sn(is(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var V=0,o=0,s=r(Je(i/e));V<i;)s[o++]=Gr(t,V,V+=e);return s},Rn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var V=t[e];V&&(i[r++]=V)}return i},Rn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return de(Io(n)?yi(n):[n],or(e,1))},Rn.cond=function(t){var e=null==t?0:t.length,n=Zi();return t=e?fe(t,(function(t){if("function"!=typeof t[1])throw new vt(V);return[n(t[0]),t[1]]})):[],Ur((function(n){for(var r=-1;++r<e;){var i=t[r];if(Ve(i[0],this,n))return Ve(i[1],this,n)}}))},Rn.conforms=function(t){return function(t){var e=_s(t);return function(n){return Kn(n,t,e)}}(Zn(t,1))},Rn.constant=qs,Rn.countBy=io,Rn.create=function(t,e){var n=Mn(t);return null==e?n:Yn(n,e)},Rn.curry=function t(e,n,r){var i=Fi(e,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},Rn.curryRight=function t(e,n,r){var i=Fi(e,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},Rn.debounce=_o,Rn.defaults=ds,Rn.defaultsDeep=ps,Rn.defer=wo,Rn.delay=Ao,Rn.difference=RV,Rn.differenceBy=MV,Rn.differenceWith=OV,Rn.drop=function(t,e,n){var r=null==t?0:t.length;return r?Gr(t,(e=n||void 0===e?1:is(e))<0?0:e,r):[]},Rn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?Gr(t,0,(e=r-(e=n||void 0===e?1:is(e)))<0?0:e):[]},Rn.dropRightWhile=function(t,e){return t&&t.length?ni(t,Zi(e,3),!0,!0):[]},Rn.dropWhile=function(t,e){return t&&t.length?ni(t,Zi(e,3),!0):[]},Rn.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&aV(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=is(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:is(r))<0&&(r+=i),r=n>r?0:Vs(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Rn.filter=function(t,e){return(Io(t)?ue:Vr)(t,Zi(e,3))},Rn.flatMap=function(t,e){return or(lo(t,e),1)},Rn.flatMapDeep=function(t,e){return or(lo(t,e),1/0)},Rn.flatMapDepth=function(t,e,n){return n=void 0===n?1:is(n),or(lo(t,e),n)},Rn.flatten=IV,Rn.flattenDeep=function(t){return(null==t?0:t.length)?or(t,1/0):[]},Rn.flattenDepth=function(t,e){return(null==t?0:t.length)?or(t,e=void 0===e?1:is(e)):[]},Rn.flip=function(t){return Fi(t,512)},Rn.flow=Hs,Rn.flowRight=Gs,Rn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Rn.functions=function(t){return null==t?[]:hr(t,_s(t))},Rn.functionsIn=function(t){return null==t?[]:hr(t,ws(t))},Rn.groupBy=co,Rn.initial=function(t){return(null==t?0:t.length)?Gr(t,0,-1):[]},Rn.intersection=NV,Rn.intersectionBy=jV,Rn.intersectionWith=LV,Rn.invert=ys,Rn.invertBy=ms,Rn.invokeMap=uo,Rn.iteratee=$s,Rn.keyBy=ho,Rn.keys=_s,Rn.keysIn=ws,Rn.map=lo,Rn.mapKeys=function(t,e){var n={};return e=Zi(e,3),cr(t,(function(t,r,i){$n(n,e(t,r,i),t)})),n},Rn.mapValues=function(t,e){var n={};return e=Zi(e,3),cr(t,(function(t,r,i){$n(n,r,e(t,r,i))})),n},Rn.matches=function(t){return Rr(Zn(t,1))},Rn.matchesProperty=function(t,e){return Mr(t,Zn(e,1))},Rn.memoize=So,Rn.merge=As,Rn.mergeWith=Ss,Rn.method=Qs,Rn.methodOf=Xs,Rn.mixin=Zs,Rn.negate=xo,Rn.nthArg=function(t){return t=is(t),Ur((function(e){return Pr(e,t)}))},Rn.omit=xs,Rn.omitBy=function(t,e){return Cs(t,xo(Zi(e)))},Rn.once=function(t){return yo(2,t)},Rn.orderBy=function(t,e,n,r){return null==t?[]:(Io(e)||(e=null==e?[]:[e]),Io(n=r?void 0:n)||(n=null==n?[]:[n]),kr(t,e,n))},Rn.over=Js,Rn.overArgs=To,Rn.overEvery=ta,Rn.overSome=ea,Rn.partial=Co,Rn.partialRight=Eo,Rn.partition=fo,Rn.pick=Ts,Rn.pickBy=Cs,Rn.property=na,Rn.propertyOf=function(t){return function(e){return null==t?void 0:lr(t,e)}},Rn.pull=FV,Rn.pullAll=BV,Rn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Dr(t,e,Zi(n,2)):t},Rn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Dr(t,e,void 0,n):t},Rn.pullAt=WV,Rn.range=ra,Rn.rangeRight=ia,Rn.rearg=Ro,Rn.reject=function(t,e){return(Io(t)?ue:Vr)(t,xo(Zi(e,3)))},Rn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],V=t.length;for(e=Zi(e,3);++r<V;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return Nr(t,i),n},Rn.rest=function(t,e){if("function"!=typeof t)throw new vt(V);return Ur(t,e=void 0===e?e:is(e))},Rn.reverse=zV,Rn.sampleSize=function(t,e,n){return e=(n?aV(t,e,n):void 0===e)?1:is(e),(Io(t)?Bn:Br)(t,e)},Rn.set=function(t,e,n){return null==t?t:Wr(t,e,n)},Rn.setWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Wr(t,e,n,r)},Rn.shuffle=function(t){return(Io(t)?Wn:Hr)(t)},Rn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&aV(t,e,n)?(e=0,n=r):(e=null==e?0:is(e),n=void 0===n?r:is(n)),Gr(t,e,n)):[]},Rn.sortBy=po,Rn.sortedUniq=function(t){return t&&t.length?Xr(t):[]},Rn.sortedUniqBy=function(t,e){return t&&t.length?Xr(t,Zi(e,2)):[]},Rn.split=function(t,e,n){return n&&"number"!=typeof n&&aV(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=as(t))&&("string"==typeof e||null!=e&&!Qo(e))&&!(e=Kr(e))&&Fe(t)?ui(Ye(t),0,n):t.split(e,n):[]},Rn.spread=function(t,e){if("function"!=typeof t)throw new vt(V);return e=null==e?0:sn(is(e),0),Ur((function(n){var r=n[e],i=ui(n,0,e);return r&&de(i,r),Ve(t,this,i)}))},Rn.tail=function(t){var e=null==t?0:t.length;return e?Gr(t,1,e):[]},Rn.take=function(t,e,n){return t&&t.length?Gr(t,0,(e=n||void 0===e?1:is(e))<0?0:e):[]},Rn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Gr(t,(e=r-(e=n||void 0===e?1:is(e)))<0?0:e,r):[]},Rn.takeRightWhile=function(t,e){return t&&t.length?ni(t,Zi(e,3),!1,!0):[]},Rn.takeWhile=function(t,e){return t&&t.length?ni(t,Zi(e,3)):[]},Rn.tap=function(t,e){return e(t),t},Rn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new vt(V);return qo(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),_o(t,e,{leading:r,maxWait:e,trailing:i})},Rn.thru=no,Rn.toArray=ns,Rn.toPairs=Es,Rn.toPairsIn=Rs,Rn.toPath=function(t){return Io(t)?fe(t,TV):Ko(t)?[t]:yi(xV(as(t)))},Rn.toPlainObject=ss,Rn.transform=function(t,e,n){var r=Io(t),i=r||Lo(t)||Jo(t);if(e=Zi(e,4),null==n){var V=t&&t.constructor;n=i?r?new V:[]:qo(t)&&Bo(V)?Mn(Wt(t)):{}}return(i?se:cr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Rn.unary=function(t){return vo(t,1)},Rn.union=qV,Rn.unionBy=HV,Rn.unionWith=GV,Rn.uniq=function(t){return t&&t.length?Jr(t):[]},Rn.uniqBy=function(t,e){return t&&t.length?Jr(t,Zi(e,2)):[]},Rn.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jr(t,void 0,e):[]},Rn.unset=function(t,e){return null==t||ti(t,e)},Rn.unzip=YV,Rn.unzipWith=$V,Rn.update=function(t,e,n){return null==t?t:ei(t,e,si(n))},Rn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ei(t,e,si(n),r)},Rn.values=Ms,Rn.valuesIn=function(t){return null==t?[]:Pe(t,ws(t))},Rn.without=QV,Rn.words=Bs,Rn.wrap=function(t,e){return Co(si(e),t)},Rn.xor=XV,Rn.xorBy=ZV,Rn.xorWith=KV,Rn.zip=JV,Rn.zipObject=function(t,e){return Vi(t||[],e||[],qn)},Rn.zipObjectDeep=function(t,e){return Vi(t||[],e||[],Wr)},Rn.zipWith=to,Rn.entries=Es,Rn.entriesIn=Rs,Rn.extend=us,Rn.extendWith=hs,Zs(Rn,Rn),Rn.add=sa,Rn.attempt=Ws,Rn.camelCase=Os,Rn.capitalize=Ps,Rn.ceil=aa,Rn.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=os(n))==n?n:0),void 0!==e&&(e=(e=os(e))==e?e:0),Xn(os(t),e,n)},Rn.clone=function(t){return Zn(t,4)},Rn.cloneDeep=function(t){return Zn(t,5)},Rn.cloneDeepWith=function(t,e){return Zn(t,5,e="function"==typeof e?e:void 0)},Rn.cloneWith=function(t,e){return Zn(t,4,e="function"==typeof e?e:void 0)},Rn.conformsTo=function(t,e){return null==e||Kn(t,e,_s(e))},Rn.deburr=ks,Rn.defaultTo=function(t,e){return null==t||t!=t?e:t},Rn.divide=ca,Rn.endsWith=function(t,e,n){t=as(t),e=Kr(e);var r=t.length,i=n=void 0===n?r:Xn(is(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Rn.eq=Mo,Rn.escape=function(t){return(t=as(t))&&U.test(t)?t.replace(j,Le):t},Rn.escapeRegExp=function(t){return(t=as(t))&&Y.test(t)?t.replace(G,"\\$&"):t},Rn.every=function(t,e,n){var r=Io(t)?ce:rr;return n&&aV(t,e,n)&&(e=void 0),r(t,Zi(e,3))},Rn.find=Vo,Rn.findIndex=PV,Rn.findKey=function(t,e){return me(t,Zi(e,3),cr)},Rn.findLast=oo,Rn.findLastIndex=kV,Rn.findLastKey=function(t,e){return me(t,Zi(e,3),ur)},Rn.floor=ua,Rn.forEach=so,Rn.forEachRight=ao,Rn.forIn=function(t,e){return null==t?t:sr(t,Zi(e,3),ws)},Rn.forInRight=function(t,e){return null==t?t:ar(t,Zi(e,3),ws)},Rn.forOwn=function(t,e){return t&&cr(t,Zi(e,3))},Rn.forOwnRight=function(t,e){return t&&ur(t,Zi(e,3))},Rn.get=gs,Rn.gt=Oo,Rn.gte=Po,Rn.has=function(t,e){return null!=t&&iV(t,e,gr)},Rn.hasIn=vs,Rn.head=DV,Rn.identity=Ys,Rn.includes=function(t,e,n,r){t=No(t)?t:Ms(t),n=n&&!r?is(n):0;var i=t.length;return n<0&&(n=sn(i+n,0)),Zo(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&_e(t,e,n)>-1},Rn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:is(n);return i<0&&(i=sn(r+i,0)),_e(t,e,i)},Rn.inRange=function(t,e,n){return e=rs(e),void 0===n?(n=e,e=0):n=rs(n),function(t,e,n){return t>=an(e,n)&&t<sn(e,n)}(t=os(t),e,n)},Rn.invoke=bs,Rn.isArguments=ko,Rn.isArray=Io,Rn.isArrayBuffer=Do,Rn.isArrayLike=No,Rn.isArrayLikeObject=jo,Rn.isBoolean=function(t){return!0===t||!1===t||Ho(t)&&dr(t)==u},Rn.isBuffer=Lo,Rn.isDate=Uo,Rn.isElement=function(t){return Ho(t)&&1===t.nodeType&&!$o(t)},Rn.isEmpty=function(t){if(null==t)return!0;if(No(t)&&(Io(t)||"string"==typeof t||"function"==typeof t.splice||Lo(t)||Jo(t)||ko(t)))return!t.length;var e=rV(t);if(e==p||e==m)return!t.size;if(lV(t))return!xr(t).length;for(var n in t)if(At.call(t,n))return!1;return!0},Rn.isEqual=function(t,e){return _r(t,e)},Rn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?_r(t,e,void 0,n):!!r},Rn.isError=Fo,Rn.isFinite=function(t){return"number"==typeof t&&rn(t)},Rn.isFunction=Bo,Rn.isInteger=Wo,Rn.isLength=zo,Rn.isMap=Go,Rn.isMatch=function(t,e){return t===e||wr(t,e,Ji(e))},Rn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:void 0,wr(t,e,Ji(e),n)},Rn.isNaN=function(t){return Yo(t)&&t!=+t},Rn.isNative=function(t){if(hV(t))throw new Q("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ar(t)},Rn.isNil=function(t){return null==t},Rn.isNull=function(t){return null===t},Rn.isNumber=Yo,Rn.isObject=qo,Rn.isObjectLike=Ho,Rn.isPlainObject=$o,Rn.isRegExp=Qo,Rn.isSafeInteger=function(t){return Wo(t)&&t>=-9007199254740991&&t<=9007199254740991},Rn.isSet=Xo,Rn.isString=Zo,Rn.isSymbol=Ko,Rn.isTypedArray=Jo,Rn.isUndefined=function(t){return void 0===t},Rn.isWeakMap=function(t){return Ho(t)&&rV(t)==w},Rn.isWeakSet=function(t){return Ho(t)&&"[object WeakSet]"==dr(t)},Rn.join=function(t,e){return null==t?"":Vn.call(t,e)},Rn.kebabCase=Is,Rn.last=UV,Rn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=is(n))<0?sn(r+i,0):an(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):be(t,Ae,i,!0)},Rn.lowerCase=Ds,Rn.lowerFirst=Ns,Rn.lt=ts,Rn.lte=es,Rn.max=function(t){return t&&t.length?ir(t,Ys,pr):void 0},Rn.maxBy=function(t,e){return t&&t.length?ir(t,Zi(e,2),pr):void 0},Rn.mean=function(t){return Se(t,Ys)},Rn.meanBy=function(t,e){return Se(t,Zi(e,2))},Rn.min=function(t){return t&&t.length?ir(t,Ys,Cr):void 0},Rn.minBy=function(t,e){return t&&t.length?ir(t,Zi(e,2),Cr):void 0},Rn.stubArray=Va,Rn.stubFalse=oa,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=la,Rn.nth=function(t,e){return t&&t.length?Pr(t,is(e)):void 0},Rn.noConflict=function(){return Yt._===this&&(Yt._=Et),this},Rn.noop=Ks,Rn.now=go,Rn.pad=function(t,e,n){t=as(t);var r=(e=is(e))?Ge(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return ki(tn(i),n)+t+ki(Je(i),n)},Rn.padEnd=function(t,e,n){t=as(t);var r=(e=is(e))?Ge(t):0;return e&&r<e?t+ki(e-r,n):t},Rn.padStart=function(t,e,n){t=as(t);var r=(e=is(e))?Ge(t):0;return e&&r<e?ki(e-r,n)+t:t},Rn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),un(as(t).replace($,""),e||0)},Rn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&aV(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=rs(t),void 0===e?(e=t,t=0):e=rs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=hn();return an(t+i*(e-t+zt("1e-"+((i+"").length-1))),e)}return jr(t,e)},Rn.reduce=function(t,e,n){var r=Io(t)?pe:Ce,i=arguments.length<3;return r(t,Zi(e,4),n,i,er)},Rn.reduceRight=function(t,e,n){var r=Io(t)?ge:Ce,i=arguments.length<3;return r(t,Zi(e,4),n,i,nr)},Rn.repeat=function(t,e,n){return e=(n?aV(t,e,n):void 0===e)?1:is(e),Lr(as(t),e)},Rn.replace=function(){var t=arguments,e=as(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Rn.result=function(t,e,n){var r=-1,i=(e=ai(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var V=null==t?void 0:t[TV(e[r])];void 0===V&&(r=i,V=n),t=Bo(V)?V.call(t):V}return t},Rn.round=fa,Rn.runInContext=t,Rn.sample=function(t){return(Io(t)?Fn:Fr)(t)},Rn.size=function(t){if(null==t)return 0;if(No(t))return Zo(t)?Ge(t):t.length;var e=rV(t);return e==p||e==m?t.size:xr(t).length},Rn.snakeCase=js,Rn.some=function(t,e,n){var r=Io(t)?ve:Yr;return n&&aV(t,e,n)&&(e=void 0),r(t,Zi(e,3))},Rn.sortedIndex=function(t,e){return $r(t,e)},Rn.sortedIndexBy=function(t,e,n){return Qr(t,e,Zi(n,2))},Rn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=$r(t,e);if(r<n&&Mo(t[r],e))return r}return-1},Rn.sortedLastIndex=function(t,e){return $r(t,e,!0)},Rn.sortedLastIndexBy=function(t,e,n){return Qr(t,e,Zi(n,2),!0)},Rn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=$r(t,e,!0)-1;if(Mo(t[n],e))return n}return-1},Rn.startCase=Ls,Rn.startsWith=function(t,e,n){return t=as(t),n=null==n?0:Xn(is(n),0,t.length),e=Kr(e),t.slice(n,n+e.length)==e},Rn.subtract=da,Rn.sum=function(t){return t&&t.length?Ee(t,Ys):0},Rn.sumBy=function(t,e){return t&&t.length?Ee(t,Zi(e,2)):0},Rn.template=function(t,e,n){var r=Rn.templateSettings;n&&aV(t,e,n)&&(e=void 0),t=as(t),e=hs({},e,r,Bi);var i,V,o=hs({},e.imports,r.imports,Bi),s=_s(o),a=Pe(o,s),c=0,u=e.interpolate||ut,h="__p += '",l=pt((e.escape||ut).source+"|"+u.source+"|"+(u===W?nt:ut).source+"|"+(e.evaluate||ut).source+"|$","g"),f="//# sourceURL="+(At.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(l,(function(e,n,r,o,s,a){return r||(r=o),h+=t.slice(c,a).replace(ht,Ue),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),s&&(V=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=a+e.length,e})),h+="';\n";var d=At.call(e,"variable")&&e.variable;if(d){if(tt.test(d))throw new Q("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(V?h.replace(k,""):h).replace(I,"$1").replace(D,"$1;"),h="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(V?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var p=Ws((function(){return lt(s,f+"return "+h).apply(void 0,a)}));if(p.source=h,Fo(p))throw p;return p},Rn.times=function(t,e){if((t=is(t))<1||t>9007199254740991)return[];var n=4294967295,r=an(t,4294967295);t-=4294967295;for(var i=Re(r,e=Zi(e));++n<t;)e(n);return i},Rn.toFinite=rs,Rn.toInteger=is,Rn.toLength=Vs,Rn.toLower=function(t){return as(t).toLowerCase()},Rn.toNumber=os,Rn.toSafeInteger=function(t){return t?Xn(is(t),-9007199254740991,9007199254740991):0===t?t:0},Rn.toString=as,Rn.toUpper=function(t){return as(t).toUpperCase()},Rn.trim=function(t,e,n){if((t=as(t))&&(n||void 0===e))return Me(t);if(!t||!(e=Kr(e)))return t;var r=Ye(t),i=Ye(e);return ui(r,Ie(r,i),De(r,i)+1).join("")},Rn.trimEnd=function(t,e,n){if((t=as(t))&&(n||void 0===e))return t.slice(0,$e(t)+1);if(!t||!(e=Kr(e)))return t;var r=Ye(t);return ui(r,0,De(r,Ye(e))+1).join("")},Rn.trimStart=function(t,e,n){if((t=as(t))&&(n||void 0===e))return t.replace($,"");if(!t||!(e=Kr(e)))return t;var r=Ye(t);return ui(r,Ie(r,Ye(e))).join("")},Rn.truncate=function(t,e){var n=30,r="...";if(qo(e)){var i="separator"in e?e.separator:i;n="length"in e?is(e.length):n,r="omission"in e?Kr(e.omission):r}var V=(t=as(t)).length;if(Fe(t)){var o=Ye(t);V=o.length}if(n>=V)return t;var s=n-Ge(r);if(s<1)return r;var a=o?ui(o,0,s).join(""):t.slice(0,s);if(void 0===i)return a+r;if(o&&(s+=a.length-s),Qo(i)){if(t.slice(s).search(i)){var c,u=a;for(i.global||(i=pt(i.source,as(rt.exec(i))+"g")),i.lastIndex=0;c=i.exec(u);)var h=c.index;a=a.slice(0,void 0===h?s:h)}}else if(t.indexOf(Kr(i),s)!=s){var l=a.lastIndexOf(i);l>-1&&(a=a.slice(0,l))}return a+r},Rn.unescape=function(t){return(t=as(t))&&L.test(t)?t.replace(N,Qe):t},Rn.uniqueId=function(t){var e=++St;return as(t)+e},Rn.upperCase=Us,Rn.upperFirst=Fs,Rn.each=so,Rn.eachRight=ao,Rn.first=DV,Zs(Rn,(ha={},cr(Rn,(function(t,e){At.call(Rn.prototype,e)||(ha[e]=t)})),ha),{chain:!1}),Rn.VERSION="4.17.21",se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Rn[t].placeholder=Rn})),se(["drop","take"],(function(t,e){kn.prototype[t]=function(n){n=void 0===n?1:sn(is(n),0);var r=this.__filtered__&&!e?new kn(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:t+(r.__dir__<0?"Right":"")}),r},kn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),se(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;kn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Zi(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),se(["head","last"],(function(t,e){var n="take"+(e?"Right":"");kn.prototype[t]=function(){return this[n](1).value()[0]}})),se(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");kn.prototype[t]=function(){return this.__filtered__?new kn(this):this[n](1)}})),kn.prototype.compact=function(){return this.filter(Ys)},kn.prototype.find=function(t){return this.filter(t).head()},kn.prototype.findLast=function(t){return this.reverse().find(t)},kn.prototype.invokeMap=Ur((function(t,e){return"function"==typeof t?new kn(this):this.map((function(n){return mr(n,t,e)}))})),kn.prototype.reject=function(t){return this.filter(xo(Zi(t)))},kn.prototype.slice=function(t,e){t=is(t);var n=this;return n.__filtered__&&(t>0||e<0)?new kn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=is(e))<0?n.dropRight(-e):n.take(e-t)),n)},kn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},kn.prototype.toArray=function(){return this.take(4294967295)},cr(kn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Rn[r?"take"+("last"==e?"Right":""):e],V=r||/^find/.test(e);i&&(Rn.prototype[e]=function(){var e=this.__wrapped__,o=r?[1]:arguments,s=e instanceof kn,a=o[0],c=s||Io(e),u=function(t){var e=i.apply(Rn,de([t],o));return r&&h?e[0]:e};c&&n&&"function"==typeof a&&1!=a.length&&(s=c=!1);var h=this.__chain__,l=!!this.__actions__.length,f=V&&!h,d=s&&!l;if(!V&&c){e=d?e:new kn(this);var p=t.apply(e,o);return p.__actions__.push({func:no,args:[u],thisArg:void 0}),new Pn(p,h)}return f&&d?t.apply(this,o):(p=this.thru(u),f?r?p.value()[0]:p.value():p)})})),se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=yt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Rn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Io(i)?i:[],t)}return this[n]((function(n){return e.apply(Io(n)?n:[],t)}))}})),cr(kn.prototype,(function(t,e){var n=Rn[e];if(n){var r=n.name+"";At.call(bn,r)||(bn[r]=[]),bn[r].push({name:e,func:n})}})),bn[Ri(void 0,2).name]=[{name:"wrapper",func:void 0}],kn.prototype.clone=function(){var t=new kn(this.__wrapped__);return t.__actions__=yi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=yi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=yi(this.__views__),t},kn.prototype.reverse=function(){if(this.__filtered__){var t=new kn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},kn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Io(t),r=e<0,i=n?t.length:0,V=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var V=n[r],o=V.size;switch(V.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=an(e,t+o);break;case"takeRight":t=sn(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=V.start,s=V.end,a=s-o,c=r?s:o-1,u=this.__iteratees__,h=u.length,l=0,f=an(a,this.__takeCount__);if(!n||!r&&i==a&&f==a)return ri(t,this.__actions__);var d=[];t:for(;a--&&l<f;){for(var p=-1,g=t[c+=e];++p<h;){var v=u[p],y=v.iteratee,m=v.type,b=y(g);if(2==m)g=b;else if(!b){if(1==m)continue t;break t}}d[l++]=g}return d},Rn.prototype.at=ro,Rn.prototype.chain=function(){return eo(this)},Rn.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},Rn.prototype.next=function(){void 0===this.__values__&&(this.__values__=ns(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},Rn.prototype.plant=function(t){for(var e,n=this;n instanceof On;){var r=EV(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Rn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof kn){var e=t;return this.__actions__.length&&(e=new kn(this)),(e=e.reverse()).__actions__.push({func:no,args:[zV],thisArg:void 0}),new Pn(e,this.__chain__)}return this.thru(zV)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return ri(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,Zt&&(Rn.prototype[Zt]=function(){return this}),Rn}();Yt._=Xe,void 0===(i=function(){return Xe}.call(e,n,e,r))||(r.exports=i)}).call(this)}).call(this,n(34),n(136)(t))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u}));var r=n(0),i=n(5),V=n(3),o=n(1),s=n(4),a=n(48),c=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.a(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new s.a).add(this.source.subscribe(new h(this.getSubject(),this))),t.closed&&(this._connection=null,t=s.a.EMPTY)),t},e.prototype.refCount=function(){return Object(a.a)()(this)},e}(V.a),u=function(){var t=c.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),h=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.a(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(i.b);o.a},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(5),V=n(21),o=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return r.a(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new V.a;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(0),i=n(1),V=n(17);function o(t,e){return void 0===e&&(e=0),function(n){return n.lift(new s(t,e))}}var s=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.scheduler,this.delay))},t}(),a=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return r.a(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new c(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(V.a.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(V.a.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(V.a.createComplete()),this.unsubscribe()},e}(i.a),c=function(){return function(t,e){this.notification=t,this.destination=e}}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(52);function i(){return Object(r.a)(1)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(3),i=n(9),V=n(52),o=n(26);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,s=null,a=t[t.length-1];return Object(i.a)(a)?(s=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof a&&(n=t.pop()),null===s&&1===t.length&&t[0]instanceof r.a?t[0]:Object(V.a)(n)(Object(o.a)(t,s))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(0),i=n(7),V=n(26),o=n(15),s=n(12);function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!Object(i.a)(t[0]))return t[0];t=t[0]}return Object(V.a)(t,void 0).lift(new c)}var c=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new u(t))},t}(),u=function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return r.a(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=t[n],i=Object(s.a)(this,r,void 0,n);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},e.prototype.notifyNext=function(t,e,n){if(!this.hasFirst){this.hasFirst=!0;for(var r=0;r<this.subscriptions.length;r++)if(r!==n){var i=this.subscriptions[r];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(3),i=n(6),V=n(30),o=n(9);function s(t,e,n){void 0===t&&(t=0);var s=-1;return Object(V.a)(e)?s=Number(e)<1?1:Number(e):Object(o.a)(e)&&(n=e),Object(o.a)(n)||(n=i.a),new r.a((function(e){var r=Object(V.a)(t)?t:+t-n.now();return n.schedule(a,r,{index:0,period:s,subscriber:e})}))}function a(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(3),i=n(4),V=n(20);var o=n(57),s=n(18);var a=n(77),c=n(76);function u(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[V.a]}(t))return function(t,e){return new r.a((function(n){var r=new i.a;return r.add(e.schedule((function(){var i=t[V.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}))}(t,e);if(Object(a.a)(t))return function(t,e){return new r.a((function(n){var r=new i.a;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}))}(t,e);if(Object(c.a)(t))return Object(o.a)(t,e);if(function(t){return t&&"function"==typeof t[s.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a((function(n){var r,V=new i.a;return V.add((function(){r&&"function"==typeof r.return&&r.return()})),V.add(e.schedule((function(){r=t[s.a](),V.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),V}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.a(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n(4).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},function(t,e,n){"use strict";function r(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(45).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,V){if("function"==typeof n)return t(e,null,n);n||(n={}),V=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}}(V||i);var o=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,a=function(){e.writable||u()},c=e._writableState&&e._writableState.finished,u=function(){s=!1,c=!0,o||V.call(e)},h=e._readableState&&e._readableState.endEmitted,l=function(){o=!1,h=!0,s||V.call(e)},f=function(t){V.call(e,t)},d=function(){var t;return o&&!h?(e._readableState&&e._readableState.ended||(t=new r),V.call(e,t)):s&&!c?(e._writableState&&e._writableState.ended||(t=new r),V.call(e,t)):void 0},p=function(){e.req.on("finish",u)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?s&&!e._writableState&&(e.on("end",a),e.on("close",a)):(e.on("complete",u),e.on("abort",d),e.req?p():e.on("request",p)),e.on("end",l),e.on("finish",u),!1!==n.error&&e.on("error",f),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",p),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",f),e.removeListener("close",d)}}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Prom=e.PromMessageType=void 0;const i=r(n(134));var V;!function(t){t[t.SessionStart=0]="SessionStart",t[t.WebRtcPerformance=1]="WebRtcPerformance",t[t.AvailabilityCheck=2]="AvailabilityCheck",t[t.QuestionMessageReceived=3]="QuestionMessageReceived",t[t.AnswerMessageReceived=4]="AnswerMessageReceived",t[t.SessionEnded=5]="SessionEnded"}(V=e.PromMessageType||(e.PromMessageType={}));e.Prom=class{constructor(t){this.apiUrl=t,this.prom_prefix="client_sdk_",this.registry=i.default(),this.messageTimings=[],this.metricsPushedCounter=this.registry.create("counter",this.prom_prefix+"metrics_pushed_total","A counter for showcase metrics pushed."),this.sessionStartTime=this.registry.create("histogram",this.prom_prefix+"session_start_duration_seconds","A histogram of session start times.",[1,2.5,4,5,6,7.5,8.5,10,15,30,60]),this.availabilityCheckTime=this.registry.create("histogram",this.prom_prefix+"availability_chk_duration_seconds","A histogram of availability check response times.",[.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.webRtcInboundRTT=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_rtt_duration_seconds","A histogram of client inbound round trip time.",[.001,.002,.005,.01,.02,.05,.1,.5,2,5]),this.webRtcInboundFramesPerSec=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_per_second","A histogram of client inbound frames per second.",[1,2,5,10,15,20,25,35,50]),this.webRtcInboundPacketsLost=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_packets_lost","A histogram of client packets lost.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFramesDropped=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_dropped","A histogram of frames dropped.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFrameHeight=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_height_px","A histogram of frame height in pixels",[60,180,240,360,540,720,1280]),this.webRtcFrameWidth=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_width_px","A histogram of frame width in pixels",[60,180,240,360,540,720,1280,1500,1920]),this.conversationRoundTripTime=this.registry.create("histogram",this.prom_prefix+"conversation_rtt_duration_seconds","A histogram of round trip time of a conversation",[.001,.005,.01,.03,.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.metricsIntervalId=setInterval(()=>{this.sendMetrics()},1e4)}handleMessage(t){var e,n,r,i,o,s,a;const c=Object.assign(t.labels||{},{platform:"js"});switch(t.type){case V.SessionStart:this.sessionStartTime.observe(t.value,c);break;case V.QuestionMessageReceived:this.messageTimings.push(t.value);break;case V.AnswerMessageReceived:const u=this.calculateConversationRtt(t);u>0&&this.conversationRoundTripTime.observe(u,c);break;case V.WebRtcPerformance:const h=t.value;h.outboundQualityLimitationReason?c.qualityLimitationReason=null===(e=h.outboundQualityLimitationReason)||void 0===e?void 0:e.value:c.qualityLimitationReason="unknown",h.newFramesDropped&&this.webRtcFramesDropped.observe(null===(n=h.newFramesDropped)||void 0===n?void 0:n.value,c),h.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(r=h.framesPerSec)||void 0===r?void 0:r.value,c),h.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=h.inboundNewPacketsLost)||void 0===i?void 0:i.value,c),h.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(o=h.inboundRoundTripTime)||void 0===o?void 0:o.value,c),h.frameHeight&&this.webRtcFrameHeight.observe(null===(s=h.frameHeight)||void 0===s?void 0:s.value,c),h.frameWidth&&this.webRtcFrameWidth.observe(null===(a=h.frameWidth)||void 0===a?void 0:a.value,c);break;case V.AvailabilityCheck:this.availabilityCheckTime.observe(t.value,c);break;case V.SessionEnded:this.stopSendingMetrics()}}calculateConversationRtt(t){if(t.value&&this.messageTimings){const e=this.messageTimings.find(e=>e.id===t.value.id);if(e){const n=e.receivedOn;if(n){const r=(t.value.receivedOn-n)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(e),1),r}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const t=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(t),this.registry.reset()}stopSendingMetrics(){this.metricsIntervalId&&clearInterval(this.metricsIntervalId)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"audit",(function(){return V})),n.d(e,"auditTime",(function(){return u})),n.d(e,"buffer",(function(){return h})),n.d(e,"bufferCount",(function(){return p})),n.d(e,"bufferTime",(function(){return b})),n.d(e,"bufferToggle",(function(){return M})),n.d(e,"bufferWhen",(function(){return k})),n.d(e,"catchError",(function(){return N})),n.d(e,"combineAll",(function(){return F})),n.d(e,"combineLatest",(function(){return z})),n.d(e,"concat",(function(){return H})),n.d(e,"concatAll",(function(){return G.a})),n.d(e,"concatMap",(function(){return $})),n.d(e,"concatMapTo",(function(){return Q})),n.d(e,"count",(function(){return X})),n.d(e,"debounce",(function(){return J})),n.d(e,"debounceTime",(function(){return nt})),n.d(e,"defaultIfEmpty",(function(){return ot})),n.d(e,"delay",(function(){return ht})),n.d(e,"delayWhen",(function(){return gt})),n.d(e,"dematerialize",(function(){return _t})),n.d(e,"distinct",(function(){return St})),n.d(e,"distinctUntilChanged",(function(){return Ct})),n.d(e,"distinctUntilKeyChanged",(function(){return Mt})),n.d(e,"elementAt",(function(){return Wt})),n.d(e,"endWith",(function(){return qt})),n.d(e,"every",(function(){return Ht})),n.d(e,"exhaust",(function(){return $t})),n.d(e,"exhaustMap",(function(){return Kt})),n.d(e,"expand",(function(){return ee})),n.d(e,"filter",(function(){return Pt.a})),n.d(e,"finalize",(function(){return ie})),n.d(e,"find",(function(){return se})),n.d(e,"findIndex",(function(){return ue})),n.d(e,"first",(function(){return le})),n.d(e,"groupBy",(function(){return fe.b})),n.d(e,"ignoreElements",(function(){return de})),n.d(e,"isEmpty",(function(){return ve})),n.d(e,"last",(function(){return Ae})),n.d(e,"map",(function(){return Zt.a})),n.d(e,"mapTo",(function(){return Se})),n.d(e,"materialize",(function(){return Ce})),n.d(e,"max",(function(){return De})),n.d(e,"merge",(function(){return je})),n.d(e,"mergeAll",(function(){return Le.a})),n.d(e,"mergeMap",(function(){return Y.b})),n.d(e,"flatMap",(function(){return Y.a})),n.d(e,"mergeMapTo",(function(){return Ue})),n.d(e,"mergeScan",(function(){return Fe})),n.d(e,"min",(function(){return ze})),n.d(e,"multicast",(function(){return He})),n.d(e,"observeOn",(function(){return Ye.b})),n.d(e,"onErrorResumeNext",(function(){return $e})),n.d(e,"pairwise",(function(){return Ze})),n.d(e,"partition",(function(){return en})),n.d(e,"pluck",(function(){return nn})),n.d(e,"publish",(function(){return on})),n.d(e,"publishBehavior",(function(){return an})),n.d(e,"publishLast",(function(){return un})),n.d(e,"publishReplay",(function(){return ln})),n.d(e,"race",(function(){return dn})),n.d(e,"reduce",(function(){return Ie})),n.d(e,"repeat",(function(){return pn})),n.d(e,"repeatWhen",(function(){return yn})),n.d(e,"retry",(function(){return _n})),n.d(e,"retryWhen",(function(){return Sn})),n.d(e,"refCount",(function(){return Cn.a})),n.d(e,"sample",(function(){return En})),n.d(e,"sampleTime",(function(){return On})),n.d(e,"scan",(function(){return Me})),n.d(e,"sequenceEqual",(function(){return Dn})),n.d(e,"share",(function(){return Fn})),n.d(e,"shareReplay",(function(){return Bn})),n.d(e,"single",(function(){return Wn})),n.d(e,"skip",(function(){return Hn})),n.d(e,"skipLast",(function(){return $n})),n.d(e,"skipUntil",(function(){return Zn})),n.d(e,"skipWhile",(function(){return tr})),n.d(e,"startWith",(function(){return rr})),n.d(e,"subscribeOn",(function(){return sr})),n.d(e,"switchAll",(function(){return lr})),n.d(e,"switchMap",(function(){return cr})),n.d(e,"switchMapTo",(function(){return fr})),n.d(e,"take",(function(){return Ut})),n.d(e,"takeLast",(function(){return be})),n.d(e,"takeUntil",(function(){return dr})),n.d(e,"takeWhile",(function(){return vr})),n.d(e,"tap",(function(){return wr})),n.d(e,"throttle",(function(){return Tr})),n.d(e,"throttleTime",(function(){return Rr})),n.d(e,"throwIfEmpty",(function(){return It})),n.d(e,"timeInterval",(function(){return Ir})),n.d(e,"timeout",(function(){return Br})),n.d(e,"timeoutWith",(function(){return jr})),n.d(e,"timestamp",(function(){return Wr})),n.d(e,"toArray",(function(){return Hr})),n.d(e,"window",(function(){return Gr})),n.d(e,"windowCount",(function(){return Qr})),n.d(e,"windowTime",(function(){return Kr})),n.d(e,"windowToggle",(function(){return Vi})),n.d(e,"windowWhen",(function(){return ai})),n.d(e,"withLatestFrom",(function(){return hi})),n.d(e,"zip",(function(){return pi})),n.d(e,"zipAll",(function(){return gi}));var r=n(0),i=n(2);function V(t){return function(e){return e.lift(new o(t))}}var o=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.durationSelector))},t}(),s=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=Object(i.c)(e,new i.a(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},e.prototype.clearThrottle=function(){var t=this.value,e=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),e&&(this.value=void 0,this.hasValue=!1,this.destination.next(t))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(i.b),a=n(6),c=n(72);function u(t,e){return void 0===e&&(e=a.a),V((function(){return Object(c.a)(t,e)}))}function h(t){return function(e){return e.lift(new l(t))}}var l=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.closingNotifier))},t}(),f=function(t){function e(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(Object(i.c)(n,new i.a(r))),r}return r.a(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(){var t=this.buffer;this.buffer=[],this.destination.next(t)},e}(i.b),d=n(1);function p(t,e){return void 0===e&&(e=null),function(n){return n.lift(new g(t,e))}}var g=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?y:v}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),v=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return r.a(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(d.a),y=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return r.a(e,t),e.prototype._next=function(t){var e=this.bufferSize,n=this.startBufferEvery,r=this.buffers,i=this.count;this.count++,i%n==0&&r.push([]);for(var V=r.length;V--;){var o=r[V];o.push(t),o.length===e&&(r.splice(V,1),this.destination.next(o))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(d.a),m=n(9);function b(t){var e=arguments.length,n=a.a;Object(m.a)(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new _(t,r,i,n))}}var _=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new A(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),w=function(){return function(){this.buffer=[]}}(),A=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;o.bufferTimeSpan=n,o.bufferCreationInterval=r,o.maxBufferSize=i,o.scheduler=V,o.contexts=[];var s=o.openContext();if(o.timespanOnly=null==r||r<0,o.timespanOnly){var a={subscriber:o,context:s,bufferTimeSpan:n};o.add(s.closeAction=V.schedule(S,n,a))}else{var c={subscriber:o,context:s},u={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:o,scheduler:V};o.add(s.closeAction=V.schedule(T,n,c)),o.add(V.schedule(x,r,u))}return o}return r.a(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,i=0;i<r;i++){var V=n[i],o=V.buffer;o.push(t),o.length==this.maxBufferSize&&(e=V)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,n=this.destination;e.length>0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(S,n,r))}},e.prototype.openContext=function(){var t=new w;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(d.a);function S(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function x(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,V=r.openContext();r.closed||(r.add(V.closeAction=i.schedule(T,n,{subscriber:r,context:V})),this.schedule(t,e))}function T(t){var e=t.subscriber,n=t.context;e.closeContext(n)}var C=n(4),E=n(12),R=n(15);function M(t,e){return function(n){return n.lift(new O(t,e))}}var O=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new P(t,this.openings,this.closingSelector))},t}(),P=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.closingSelector=r,i.contexts=[],i.add(Object(E.a)(i,n)),i}return r.a(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r<n;r++)e[r].buffer.push(t)},e.prototype._error=function(e){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new C.a,r={buffer:[],subscription:n};e.push(r);var i=Object(E.a)(this,t,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},e}(R.a);function k(t){return function(e){return e.lift(new I(t))}}var I=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new D(t,this.closingSelector))},t}(),D=function(t){function e(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return r.a(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new C.a,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(Object(i.c)(e,new i.a(this))),this.subscribing=!1},e}(i.b);function N(t){return function(e){var n=new j(t),r=e.lift(n);return n.caught=r}}var j=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new L(t,this.selector,this.caught))},t}(),L=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new i.a(this);this.add(r);var V=Object(i.c)(n,r);V!==r&&this.add(V)}},e}(i.b),U=n(51);function F(t){return function(e){return e.lift(new U.a(t))}}var B=n(7),W=n(11);function z(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&Object(B.a)(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(Object(W.a)([e].concat(t)),new U.a(n))}}var q=n(31);function H(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(q.a.apply(void 0,[e].concat(t)))}}var G=n(69),Y=n(25);function $(t,e){return Object(Y.b)(t,e,1)}function Q(t,e){return $((function(){return t}),e)}function X(t){return function(e){return e.lift(new Z(t,e))}}var Z=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new K(t,this.predicate,this.source))},t}(),K=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(d.a);function J(t){return function(e){return e.lift(new tt(t))}}var tt=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new et(t,this.durationSelector))},t}(),et=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=Object(i.c)(e,new i.a(this)))&&!n.closed&&this.add(this.durationSubscription=n)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(i.b);function nt(t,e){return void 0===e&&(e=a.a),function(n){return n.lift(new rt(t,e))}}var rt=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new it(t,this.dueTime,this.scheduler))},t}(),it=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return r.a(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Vt,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(d.a);function Vt(t){t.debouncedNext()}function ot(t){return void 0===t&&(t=null),function(e){return e.lift(new st(t))}}var st=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new at(t,this.defaultValue))},t}(),at=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return r.a(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(d.a);function ct(t){return t instanceof Date&&!isNaN(+t)}var ut=n(17);function ht(t,e){void 0===e&&(e=a.a);var n=ct(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new lt(n,e))}}var lt=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new ft(t,this.delay,this.scheduler))},t}(),ft=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return r.a(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,i=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var V=Math.max(0,n[0].time-r.now());this.schedule(t,V)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new dt(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(ut.a.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(ut.a.createComplete()),this.unsubscribe()},e}(d.a),dt=function(){return function(t,e){this.time=t,this.notification=e}}(),pt=n(3);function gt(t,e){return e?function(n){return new mt(n,e).lift(new vt(t))}:function(e){return e.lift(new vt(t))}}var vt=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new yt(t,this.delayDurationSelector))},t}(),yt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var n=Object(E.a)(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(R.a),mt=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return r.a(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new bt(t,this.source))},e}(pt.a),bt=function(t){function e(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return r.a(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(d.a);function _t(){return function(t){return t.lift(new wt)}}var wt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new At(t))},t}(),At=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(d.a);function St(t,e){return function(n){return n.lift(new xt(t,e))}}var xt=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new Tt(t,this.keySelector,this.flushes))},t}(),Tt=function(t){function e(e,n,r){var V=t.call(this,e)||this;return V.keySelector=n,V.values=new Set,r&&V.add(Object(i.c)(r,new i.a(V))),V}return r.a(e,t),e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(t){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(i.b);function Ct(t,e){return function(n){return n.lift(new Et(t,e))}}var Et=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Rt(t,this.compare,this.keySelector))},t}(),Rt=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return r.a(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(d.a);function Mt(t,e){return Ct((function(n,r){return e?e(n[t],r[t]):n[t]===r[t]}))}var Ot=n(22),Pt=n(16),kt=n(24);function It(t){return void 0===t&&(t=jt),function(e){return e.lift(new Dt(t))}}var Dt=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new Nt(t,this.errorFactory))},t}(),Nt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.errorFactory=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(d.a);function jt(){return new kt.a}var Lt=n(10);function Ut(t){return function(e){return 0===t?Object(Lt.b)():e.lift(new Ft(t))}}var Ft=function(){function t(t){if(this.total=t,this.total<0)throw new Ot.a}return t.prototype.call=function(t,e){return e.subscribe(new Bt(t,this.total))},t}(),Bt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(d.a);function Wt(t,e){if(t<0)throw new Ot.a;var n=arguments.length>=2;return function(r){return r.pipe(Object(Pt.a)((function(e,n){return n===t})),Ut(1),n?ot(e):It((function(){return new Ot.a})))}}var zt=n(35);function qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return Object(q.a)(e,zt.a.apply(void 0,t))}}function Ht(t,e){return function(n){return n.lift(new Gt(t,e,n))}}var Gt=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new Yt(t,this.predicate,this.thisArg,this.source))},t}(),Yt=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.predicate=n,V.thisArg=r,V.source=i,V.index=0,V.thisArg=r||V,V}return r.a(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(d.a);function $t(){return function(t){return t.lift(new Qt)}}var Qt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Xt(t))},t}(),Xt=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return r.a(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(Object(i.c)(t,new i.a(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(i.b),Zt=n(8);function Kt(t,e){return e?function(n){return n.pipe(Kt((function(n,r){return Object(W.a)(t(n,r)).pipe(Object(Zt.a)((function(t,i){return e(n,t,r,i)})))})))}:function(e){return e.lift(new Jt(t))}}var Jt=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new te(t,this.project))},t}(),te=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new i.a(this),n=this.destination;n.add(e);var r=Object(i.c)(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(i.b);function ee(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new ne(t,e,n))}}var ne=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new re(t,this.project,this.concurrent,this.scheduler))},t}(),re=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.project=n,V.concurrent=r,V.scheduler=i,V.index=0,V.active=0,V.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(V.buffer=[]),V}return r.a(e,t),e.dispatch=function(t){var e=t.subscriber,n=t.result,r=t.value,i=t.index;e.subscribeToProjection(n,r,i)},e.prototype._next=function(t){var n=this.destination;if(n.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){n.next(t);try{var i=(0,this.project)(t,r);if(this.scheduler){var V={subscriber:this,result:i,value:t,index:r};this.destination.add(this.scheduler.schedule(e.dispatch,0,V))}else this.subscribeToProjection(i,t,r)}catch(t){n.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,n){this.active++,this.destination.add(Object(i.c)(t,new i.a(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this._next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(i.b);function ie(t){return function(e){return e.lift(new Ve(t))}}var Ve=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new oe(t,this.callback))},t}(),oe=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new C.a(n)),r}return r.a(e,t),e}(d.a);function se(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new ae(t,n,!1,e))}}var ae=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new ce(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),ce=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.yieldIndex=i,o.thisArg=V,o.index=0,o}return r.a(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(d.a);function ue(t,e){return function(n){return n.lift(new ae(t,n,!0,e))}}var he=n(14);function le(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(Pt.a)((function(e,n){return t(e,n,r)})):he.a,Ut(1),n?ot(e):It((function(){return new kt.a})))}}var fe=n(62);function de(){return function(t){return t.lift(new pe)}}var pe=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ge(t))},t}(),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype._next=function(t){},e}(d.a);function ve(){return function(t){return t.lift(new ye)}}var ye=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new me(t))},t}(),me=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(d.a);function be(t){return function(e){return 0===t?Object(Lt.b)():e.lift(new _e(t))}}var _e=function(){function t(t){if(this.total=t,this.total<0)throw new Ot.a}return t.prototype.call=function(t,e){return e.subscribe(new we(t,this.total))},t}(),we=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var V=e++%n;t.next(r[V])}t.complete()},e}(d.a);function Ae(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(Pt.a)((function(e,n){return t(e,n,r)})):he.a,be(1),n?ot(e):It((function(){return new kt.a})))}}function Se(t){return function(e){return e.lift(new xe(t))}}var xe=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new Te(t,this.value))},t}(),Te=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return r.a(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(d.a);function Ce(){return function(t){return t.lift(new Ee)}}var Ee=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Re(t))},t}(),Re=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype._next=function(t){this.destination.next(ut.a.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(ut.a.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(ut.a.createComplete()),t.complete()},e}(d.a);function Me(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new Oe(t,e,n))}}var Oe=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new Pe(t,this.accumulator,this.seed,this.hasSeed))},t}(),Pe=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.accumulator=n,V._seed=r,V.hasSeed=i,V.index=0,V}return r.a(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(d.a),ke=n(39);function Ie(t,e){return arguments.length>=2?function(n){return Object(ke.a)(Me(t,e),be(1),ot(e))(n)}:function(e){return Object(ke.a)(Me((function(e,n,r){return t(e,n,r+1)})),be(1))(e)}}function De(t){return Ie("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}var Ne=n(70);function je(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Ne.a.apply(void 0,[e].concat(t)))}}var Le=n(52);function Ue(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?Object(Y.b)((function(){return t}),e,n):("number"==typeof e&&(n=e),Object(Y.b)((function(){return t}),n))}function Fe(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Be(t,e,n))}}var Be=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new We(t,this.accumulator,this.seed,this.concurrent))},t}(),We=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.accumulator=n,V.acc=r,V.concurrent=i,V.hasValue=!1,V.hasCompleted=!1,V.buffer=[],V.active=0,V.index=0,V}return r.a(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,t,e)}catch(t){return n.error(t)}this.active++,this._innerSub(r)}else this.buffer.push(t)},e.prototype._innerSub=function(t){var e=new i.a(this),n=this.destination;n.add(e);var r=Object(i.c)(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(i.b);function ze(t){return Ie("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t<e?t:e})}var qe=n(65);function He(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new Ge(r,e));var i=Object.create(n,qe.b);return i.source=n,i.subjectFactory=r,i}}var Ge=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}(),Ye=n(67);function $e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&Object(B.a)(t[0])&&(t=t[0]),function(e){return e.lift(new Qe(t))}}var Qe=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Xe(t,this.nextSources))},t}(),Xe=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return r.a(e,t),e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new i.a(this),n=this.destination;n.add(e);var r=Object(i.c)(t,e);r!==e&&n.add(r)}else this.destination.complete()},e}(i.b);function Ze(){return function(t){return t.lift(new Ke)}}var Ke=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Je(t))},t}(),Je=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return r.a(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(d.a),tn=n(78);function en(t,e){return function(n){return[Object(Pt.a)(t,e)(n),Object(Pt.a)(Object(tn.a)(t,e))(n)]}}function nn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(e){return Object(Zt.a)(rn(t,n))(e)}}function rn(t,e){return function(n){for(var r=n,i=0;i<e;i++){var V=null!=r?r[t[i]]:void 0;if(void 0===V)return;r=V}return r}}var Vn=n(5);function on(t){return t?He((function(){return new Vn.a}),t):He(new Vn.a)}var sn=n(66);function an(t){return function(e){return He(new sn.a(t))(e)}}var cn=n(28);function un(){return function(t){return He(new cn.a)(t)}}var hn=n(49);function ln(t,e,n,r){n&&"function"!=typeof n&&(r=n);var i="function"==typeof n?n:void 0,V=new hn.a(t,e,r);return function(t){return He((function(){return V}),i)(t)}}var fn=n(71);function dn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&Object(B.a)(t[0])&&(t=t[0]),e.lift.call(fn.a.apply(void 0,[e].concat(t)))}}function pn(t){return void 0===t&&(t=-1),function(e){return 0===t?Object(Lt.b)():t<0?e.lift(new gn(-1,e)):e.lift(new gn(t-1,e))}}var gn=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new vn(t,this.count,this.source))},t}(),vn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return r.a(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(d.a);function yn(t){return function(e){return e.lift(new mn(t))}}var mn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new bn(t,this.notifier,e))},t}(),bn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return r.a(e,t),e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new Vn.a;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=Object(i.c)(e,new i.a(this))},e}(i.b);function _n(t){return void 0===t&&(t=-1),function(e){return e.lift(new wn(t,e))}}var wn=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new An(t,this.count,this.source))},t}(),An=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(d.a);function Sn(t){return function(e){return e.lift(new xn(t,e))}}var xn=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Tn(t,this.notifier,this.source))},t}(),Tn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,V=this.retriesSubscription;if(r)this.errors=void 0,this.retriesSubscription=void 0;else{n=new Vn.a;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}V=Object(i.c)(r,new i.a(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=V,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var t=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=t,this.source.subscribe(this)},e}(i.b),Cn=n(48);function En(t){return function(e){return e.lift(new Rn(t))}}var Rn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Mn(t),r=e.subscribe(n);return r.add(Object(i.c)(this.notifier,new i.a(n))),r},t}(),Mn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return r.a(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(i.b);function On(t,e){return void 0===e&&(e=a.a),function(n){return n.lift(new Pn(t,e))}}var Pn=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new kn(t,this.period,this.scheduler))},t}(),kn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(In,n,{subscriber:i,period:n})),i}return r.a(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(d.a);function In(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}function Dn(t,e){return function(n){return n.lift(new Nn(t,e))}}var Nn=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new jn(t,this.compareTo,this.comparator))},t}(),jn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new Ln(e,i))),i}return r.a(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this._a,e=this._b,n=this.comparator;t.length>0&&e.length>0;){var r=t.shift(),i=e.shift(),V=!1;try{V=n?n(r,i):r===i}catch(t){this.destination.error(t)}V||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(d.a),Ln=function(t){function e(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return r.a(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(d.a);function Un(){return new Vn.a}function Fn(){return function(t){return Object(Cn.a)()(He(Un)(t))}}function Bn(t,e,n){var r;return r=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,r=t.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY:r,V=t.windowTime,o=void 0===V?Number.POSITIVE_INFINITY:V,s=t.refCount,a=t.scheduler,c=0,u=!1,h=!1;return function(t){var r;c++,!e||u?(u=!1,e=new hn.a(i,o,a),r=e.subscribe(this),n=t.subscribe({next:function(t){e.next(t)},error:function(t){u=!0,e.error(t)},complete:function(){h=!0,n=void 0,e.complete()}}),h&&(n=void 0)):r=e.subscribe(this),this.add((function(){c--,r.unsubscribe(),r=void 0,n&&!h&&s&&0===c&&(n.unsubscribe(),n=void 0,e=void 0)}))}}(r))}}function Wn(t){return function(e){return e.lift(new zn(t,e))}}var zn=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new qn(t,this.predicate,this.source))},t}(),qn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return r.a(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new kt.a)},e}(d.a);function Hn(t){return function(e){return e.lift(new Gn(t))}}var Gn=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new Yn(t,this.total))},t}(),Yn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(d.a);function $n(t){return function(e){return e.lift(new Qn(t))}}var Qn=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Ot.a}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new d.a(t)):e.subscribe(new Xn(t,this._skipCount))},t}(),Xn=function(t){function e(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return r.a(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n<e)this._ring[n]=t;else{var r=n%e,i=this._ring,V=i[r];i[r]=t,this.destination.next(V)}},e}(d.a);function Zn(t){return function(e){return e.lift(new Kn(t))}}var Kn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Jn(t,this.notifier))},t}(),Jn=function(t){function e(e,n){var r=t.call(this,e)||this;r.hasValue=!1;var V=new i.a(r);r.add(V),r.innerSubscription=V;var o=Object(i.c)(n,V);return o!==V&&(r.add(o),r.innerSubscription=o),r}return r.a(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(i.b);function tr(t){return function(e){return e.lift(new er(t))}}var er=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new nr(t,this.predicate))},t}(),nr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(d.a);function rr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(m.a)(n)?(t.pop(),function(e){return Object(q.a)(t,e,n)}):function(e){return Object(q.a)(t,e)}}var ir=n(40),Vr=n(30),or=function(t){function e(e,n,r){void 0===n&&(n=0),void 0===r&&(r=ir.a);var i=t.call(this)||this;return i.source=e,i.delayTime=n,i.scheduler=r,(!Object(Vr.a)(n)||n<0)&&(i.delayTime=0),r&&"function"==typeof r.schedule||(i.scheduler=ir.a),i}return r.a(e,t),e.create=function(t,n,r){return void 0===n&&(n=0),void 0===r&&(r=ir.a),new e(t,n,r)},e.dispatch=function(t){var e=t.source,n=t.subscriber;return this.add(e.subscribe(n))},e.prototype._subscribe=function(t){var n=this.delayTime,r=this.source;return this.scheduler.schedule(e.dispatch,n,{source:r,subscriber:t})},e}(pt.a);function sr(t,e){return void 0===e&&(e=0),function(n){return n.lift(new ar(t,e))}}var ar=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new or(e,this.delay,this.scheduler).subscribe(t)},t}();function cr(t,e){return"function"==typeof e?function(n){return n.pipe(cr((function(n,r){return Object(W.a)(t(n,r)).pipe(Object(Zt.a)((function(t,i){return e(n,t,r,i)})))})))}:function(e){return e.lift(new ur(t))}}var ur=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new hr(t,this.project))},t}(),hr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e)},e.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var n=new i.a(this),r=this.destination;r.add(n),this.innerSubscription=Object(i.c)(t,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t){this.destination.next(t)},e}(i.b);function lr(){return cr(he.a)}function fr(t,e){return e?cr((function(){return t}),e):cr((function(){return t}))}function dr(t){return function(e){return e.lift(new pr(t))}}var pr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new gr(t),r=Object(i.c)(this.notifier,new i.a(n));return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),gr=function(t){function e(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return r.a(e,t),e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(i.b);function vr(t,e){return void 0===e&&(e=!1),function(n){return n.lift(new yr(t,e))}}var yr=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new mr(t,this.predicate,this.inclusive))},t}(),mr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},e}(d.a),br=n(19),_r=n(23);function wr(t,e,n){return function(r){return r.lift(new Ar(t,e,n))}}var Ar=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new Sr(t,this.nextOrObserver,this.error,this.complete))},t}(),Sr=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V._tapNext=br.a,V._tapError=br.a,V._tapComplete=br.a,V._tapError=r||br.a,V._tapComplete=i||br.a,Object(_r.a)(n)?(V._context=V,V._tapNext=n):n&&(V._context=n,V._tapNext=n.next||br.a,V._tapError=n.error||br.a,V._tapComplete=n.complete||br.a),V}return r.a(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(d.a),xr={leading:!0,trailing:!1};function Tr(t,e){return void 0===e&&(e=xr),function(n){return n.lift(new Cr(t,!!e.leading,!!e.trailing))}}var Cr=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new Er(t,this.durationSelector,this.leading,this.trailing))},t}(),Er=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.destination=e,V.durationSelector=n,V._leading=r,V._trailing=i,V._hasValue=!1,V}return r.a(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=Object(i.c)(e,new i.a(this)))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(i.b);function Rr(t,e,n){return void 0===e&&(e=a.a),void 0===n&&(n=xr),function(r){return r.lift(new Mr(t,e,n.leading,n.trailing))}}var Mr=function(){function t(t,e,n,r){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Or(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Or=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.duration=n,o.scheduler=r,o.leading=i,o.trailing=V,o._hasTrailingValue=!1,o._trailingValue=null,o}return r.a(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Pr,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(d.a);function Pr(t){t.subscriber.clearThrottle()}var kr=n(53);function Ir(t){return void 0===t&&(t=a.a),function(e){return Object(kr.a)((function(){return e.pipe(Me((function(e,n){var r=e.current;return{value:n,current:t.now(),last:r}}),{current:t.now(),value:void 0,last:void 0}),Object(Zt.a)((function(t){var e=t.current,n=t.last,r=t.value;return new Dr(r,e-n)})))}))}}var Dr=function(){return function(t,e){this.value=t,this.interval=e}}(),Nr=n(68);function jr(t,e,n){return void 0===n&&(n=a.a),function(r){var i=ct(t),V=i?+t-n.now():Math.abs(t);return r.lift(new Lr(V,i,e,n))}}var Lr=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Ur(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Ur=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.absoluteTimeout=n,o.waitFor=r,o.withObservable=i,o.scheduler=V,o.scheduleTimeout(),o}return r.a(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(Object(i.c)(e,new i.a(t)))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(i.b),Fr=n(50);function Br(t,e){return void 0===e&&(e=a.a),jr(t,Object(Fr.a)(new Nr.a),e)}function Wr(t){return void 0===t&&(t=a.a),Object(Zt.a)((function(e){return new zr(e,t.now())}))}var zr=function(){return function(t,e){this.value=t,this.timestamp=e}}();function qr(t,e,n){return 0===n?[e]:(t.push(e),t)}function Hr(){return Ie(qr,[])}function Gr(t){return function(e){return e.lift(new Yr(t))}}var Yr=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var n=new $r(t),r=e.subscribe(n);return r.closed||n.add(Object(i.c)(this.windowBoundaries,new i.a(n))),r},t}(),$r=function(t){function e(e){var n=t.call(this,e)||this;return n.window=new Vn.a,e.next(n.window),n}return r.a(e,t),e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,n=this.window=new Vn.a;e.next(n)},e}(i.b);function Qr(t,e){return void 0===e&&(e=0),function(n){return n.lift(new Xr(t,e))}}var Xr=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new Zr(t,this.windowSize,this.startWindowEvery))},t}(),Zr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.destination=e,i.windowSize=n,i.startWindowEvery=r,i.windows=[new Vn.a],i.count=0,e.next(i.windows[0]),i}return r.a(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,V=i.length,o=0;o<V&&!this.closed;o++)i[o].next(t);var s=this.count-r+1;if(s>=0&&s%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var a=new Vn.a;i.push(a),n.next(a)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(d.a);function Kr(t){var e=a.a,n=null,r=Number.POSITIVE_INFINITY;return Object(m.a)(arguments[3])&&(e=arguments[3]),Object(m.a)(arguments[2])?e=arguments[2]:Object(Vr.a)(arguments[2])&&(r=Number(arguments[2])),Object(m.a)(arguments[1])?e=arguments[1]:Object(Vr.a)(arguments[1])&&(n=Number(arguments[1])),function(i){return i.lift(new Jr(t,n,r,e))}}var Jr=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ei(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),ti=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return r.a(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Vn.a),ei=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;o.destination=e,o.windowTimeSpan=n,o.windowCreationInterval=r,o.maxWindowSize=i,o.scheduler=V,o.windows=[];var s=o.openWindow();if(null!==r&&r>=0){var a={subscriber:o,window:s,context:null},c={windowTimeSpan:n,windowCreationInterval:r,subscriber:o,scheduler:V};o.add(V.schedule(ii,n,a)),o.add(V.schedule(ri,r,c))}else{var u={subscriber:o,window:s,windowTimeSpan:n};o.add(V.schedule(ni,n,u))}return o}return r.a(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r<n;r++){var i=e[r];i.closed||(i.next(t),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new ti;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(d.a);function ni(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function ri(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,V=n.openWindow(),o={action:this,subscription:null},s={subscriber:n,window:V,context:o};o.subscription=r.schedule(ii,e,s),this.add(o.subscription),this.schedule(t,i)}function ii(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}function Vi(t,e){return function(n){return n.lift(new oi(t,e))}}var oi=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new si(t,this.openings,this.closingSelector))},t}(),si=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=Object(E.a)(i,n,n)),i}return r.a(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r<n;r++)e[r].window.next(t)},e.prototype._error=function(e){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var V=n[i];V.window.error(e),V.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var n=e.length,r=-1;++r<n;){var i=e[r];i.window.complete(),i.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,n=-1;++n<e;){var r=t[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,n,r,i){if(t===this.openings){var V=void 0;try{V=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var o=new Vn.a,s=new C.a,a={window:o,subscription:s};this.contexts.push(a);var c=Object(E.a)(this,V,a);c.closed?this.closeWindow(this.contexts.length-1):(c.context=a,s.add(c)),this.destination.next(o)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,n=e[t],r=n.window,i=n.subscription;e.splice(t,1),r.complete(),i.unsubscribe()}},e}(R.a);function ai(t){return function(e){return e.lift(new ci(t))}}var ci=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new ui(t,this.closingSelector))},t}(),ui=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.closingSelector=n,r.openWindow(),r}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.openWindow(i)},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var n,r=this.window=new Vn.a;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=Object(E.a)(this,n))},e}(R.a);function hi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new li(r,n))}}var li=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new fi(t,this.observables,this.project))},t}(),fi=function(t){function e(e,n,r){var i=t.call(this,e)||this;i.observables=n,i.project=r,i.toRespond=[];var V=n.length;i.values=new Array(V);for(var o=0;o<V;o++)i.toRespond.push(o);for(o=0;o<V;o++){var s=n[o];i.add(Object(E.a)(i,s,void 0,o))}return i}return r.a(e,t),e.prototype.notifyNext=function(t,e,n){this.values[n]=e;var r=this.toRespond;if(r.length>0){var i=r.indexOf(n);-1!==i&&r.splice(i,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(R.a),di=n(54);function pi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(di.b.apply(void 0,[e].concat(t)))}}function gi(t){return function(e){return e.lift(new di.a(t))}}},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"shimGetUserMedia",(function(){return m})),n.d(r,"shimGetDisplayMedia",(function(){return b})),n.d(r,"shimMediaStream",(function(){return _})),n.d(r,"shimOnTrack",(function(){return w})),n.d(r,"shimGetSendersWithDtmf",(function(){return A})),n.d(r,"shimGetStats",(function(){return S})),n.d(r,"shimSenderReceiverGetStats",(function(){return x})),n.d(r,"shimAddTrackRemoveTrackWithNative",(function(){return T})),n.d(r,"shimAddTrackRemoveTrack",(function(){return C})),n.d(r,"shimPeerConnection",(function(){return E})),n.d(r,"fixNegotiationNeeded",(function(){return R}));var i={};n.r(i),n.d(i,"shimGetUserMedia",(function(){return M})),n.d(i,"shimGetDisplayMedia",(function(){return O})),n.d(i,"shimOnTrack",(function(){return P})),n.d(i,"shimPeerConnection",(function(){return k})),n.d(i,"shimSenderGetStats",(function(){return I})),n.d(i,"shimReceiverGetStats",(function(){return D})),n.d(i,"shimRemoveStream",(function(){return N})),n.d(i,"shimRTCDataChannel",(function(){return j})),n.d(i,"shimAddTransceiver",(function(){return L})),n.d(i,"shimGetParameters",(function(){return U})),n.d(i,"shimCreateOffer",(function(){return F})),n.d(i,"shimCreateAnswer",(function(){return B}));var V={};n.r(V),n.d(V,"shimLocalStreamsAPI",(function(){return W})),n.d(V,"shimRemoteStreamsAPI",(function(){return z})),n.d(V,"shimCallbacksAPI",(function(){return q})),n.d(V,"shimGetUserMedia",(function(){return H})),n.d(V,"shimConstraints",(function(){return G})),n.d(V,"shimRTCIceServerUrls",(function(){return Y})),n.d(V,"shimTrackEventTransceiver",(function(){return $})),n.d(V,"shimCreateOfferLegacy",(function(){return Q})),n.d(V,"shimAudioContext",(function(){return X}));var o={};n.r(o),n.d(o,"shimRTCIceCandidate",(function(){return J})),n.d(o,"shimMaxMessageSize",(function(){return tt})),n.d(o,"shimSendThrowTypeError",(function(){return et})),n.d(o,"shimConnectionState",(function(){return nt})),n.d(o,"removeExtmapAllowMixed",(function(){return rt})),n.d(o,"shimAddIceCandidateNullOrEmpty",(function(){return it})),n.d(o,"shimParameterlessSetLocalDescription",(function(){return Vt}));let s=!0,a=!0;function c(t,e,n){const r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function u(t,e,n){if(!t.RTCPeerConnection)return;const r=t.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(t,r){if(t!==e)return i.apply(this,arguments);const V=t=>{const e=n(t);e&&(r.handleEvent?r.handleEvent(e):r(e))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(r,V),i.apply(this,[t,V])};const V=r.removeEventListener;r.removeEventListener=function(t,n){if(t!==e||!this._eventMap||!this._eventMap[e])return V.apply(this,arguments);if(!this._eventMap[e].has(n))return V.apply(this,arguments);const r=this._eventMap[e].get(n);return this._eventMap[e].delete(n),0===this._eventMap[e].size&&delete this._eventMap[e],0===Object.keys(this._eventMap).length&&delete this._eventMap,V.apply(this,[t,r])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(t){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),t&&this.addEventListener(e,this["_on"+e]=t)},enumerable:!0,configurable:!0})}function h(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(s=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function l(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(a=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function f(){if("object"==typeof window){if(s)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function d(t,e){a&&console.warn(t+" is deprecated, please use "+e+" instead.")}function p(t){return"[object Object]"===Object.prototype.toString.call(t)}function g(t){return p(t)?Object.keys(t).reduce((function(e,n){const r=p(t[n]),i=r?g(t[n]):t[n],V=r&&!Object.keys(i).length;return void 0===i||V?e:Object.assign(e,{[n]:i})}),{}):t}function v(t,e,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===e)return i;const V=[];return t.forEach(t=>{"track"===t.type&&t.trackIdentifier===e.id&&V.push(t)}),V.forEach(e=>{t.forEach(n=>{n.type===r&&n.trackId===e.id&&function t(e,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(i=>{i.endsWith("Id")?t(e,e.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach(n=>{t(e,e.get(n),r)})}))}(t,n,i)})}),i}const y=f;function m(t,e){const n=t&&t.navigator;if(!n.mediaDevices)return;const r=function(t){if("object"!=typeof t||t.mandatory||t.optional)return t;const e={};return Object.keys(t).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof t[n]?t[n]:{ideal:t[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const i=function(t,e){return t?t+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==r.ideal){e.optional=e.optional||[];let t={};"number"==typeof r.ideal?(t[i("min",n)]=r.ideal,e.optional.push(t),t={},t[i("max",n)]=r.ideal,e.optional.push(t)):(t[i("",n)]=r.ideal,e.optional.push(t))}void 0!==r.exact&&"number"!=typeof r.exact?(e.mandatory=e.mandatory||{},e.mandatory[i("",n)]=r.exact):["min","max"].forEach(t=>{void 0!==r[t]&&(e.mandatory=e.mandatory||{},e.mandatory[i(t,n)]=r[t])})}),t.advanced&&(e.optional=(e.optional||[]).concat(t.advanced)),e},i=function(t,i){if(e.version>=61)return i(t);if((t=JSON.parse(JSON.stringify(t)))&&"object"==typeof t.audio){const e=function(t,e,n){e in t&&!(n in t)&&(t[n]=t[e],delete t[e])};e((t=JSON.parse(JSON.stringify(t))).audio,"autoGainControl","googAutoGainControl"),e(t.audio,"noiseSuppression","googNoiseSuppression"),t.audio=r(t.audio)}if(t&&"object"==typeof t.video){let V=t.video.facingMode;V=V&&("object"==typeof V?V:{ideal:V});const o=e.version<66;if(V&&("user"===V.exact||"environment"===V.exact||"user"===V.ideal||"environment"===V.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||o)){let e;if(delete t.video.facingMode,"environment"===V.exact||"environment"===V.ideal?e=["back","rear"]:"user"!==V.exact&&"user"!==V.ideal||(e=["front"]),e)return n.mediaDevices.enumerateDevices().then(n=>{let o=(n=n.filter(t=>"videoinput"===t.kind)).find(t=>e.some(e=>t.label.toLowerCase().includes(e)));return!o&&n.length&&e.includes("back")&&(o=n[n.length-1]),o&&(t.video.deviceId=V.exact?{exact:o.deviceId}:{ideal:o.deviceId}),t.video=r(t.video),y("chrome: "+JSON.stringify(t)),i(t)})}t.video=r(t.video)}return y("chrome: "+JSON.stringify(t)),i(t)},V=function(t){return e.version>=64?t:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[t.name]||t.name,message:t.message,constraint:t.constraint||t.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(t,e,r){i(t,t=>{n.webkitGetUserMedia(t,e,t=>{r&&r(V(t))})})}.bind(n),n.mediaDevices.getUserMedia){const t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return i(e,e=>t(e).then(t=>{if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(t=>{t.stop()}),new DOMException("","NotFoundError");return t},t=>Promise.reject(V(t))))}}}function b(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&("function"==typeof e?t.navigator.mediaDevices.getDisplayMedia=function(n){return e(n).then(e=>{const r=n.video&&n.video.width,i=n.video&&n.video.height,V=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxFrameRate:V||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),t.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function _(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function w(t){if("object"==typeof t&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=e=>{e.stream.addEventListener("addtrack",n=>{let r;r=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(t=>t.track&&t.track.id===n.track.id):{track:n.track};const i=new Event("track");i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[e.stream],this.dispatchEvent(i)}),e.stream.getTracks().forEach(n=>{let r;r=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(t=>t.track&&t.track.id===n.id):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[e.stream],this.dispatchEvent(i)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else u(t,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t))}function A(t){if("object"==typeof t&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(t,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=t.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:t}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,r){let i=n.apply(this,arguments);return i||(i=e(this,t),this._senders.push(i)),i};const r=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){r.apply(this,arguments);const e=this._senders.indexOf(t);-1!==e&&this._senders.splice(e,1)}}const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._senders=this._senders||[],n.apply(this,[t]),t.getTracks().forEach(t=>{this._senders.push(e(this,t))})};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){this._senders=this._senders||[],r.apply(this,[t]),t.getTracks().forEach(t=>{const e=this._senders.find(e=>e.track===t);e&&this._senders.splice(this._senders.indexOf(e),1)})}}else if("object"==typeof t&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function S(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,n,r]=arguments;if(arguments.length>0&&"function"==typeof t)return e.apply(this,arguments);if(0===e.length&&(0===arguments.length||"function"!=typeof t))return e.apply(this,[]);const i=function(t){const e={};return t.result().forEach(t=>{const n={id:t.id,timestamp:t.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[t.type]||t.type};t.names().forEach(e=>{n[e]=t.stat(e)}),e[n.id]=n}),e},V=function(t){return new Map(Object.keys(t).map(e=>[e,t[e]]))};if(arguments.length>=2){const r=function(t){n(V(i(t)))};return e.apply(this,[r,t])}return new Promise((t,n)=>{e.apply(this,[function(e){t(V(i(e)))},n])}).then(n,r)}}function x(t){if(!("object"==typeof t&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=n.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){const t=this;return this._pc.getStats().then(e=>v(e,t.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t}),u(t,"track",t=>(t.receiver._pc=t.srcElement,t)),t.RTCRtpReceiver.prototype.getStats=function(){const t=this;return this._pc.getStats().then(e=>v(e,t.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype)||!("getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const t=arguments[0];let e,n,r;return this.getSenders().forEach(n=>{n.track===t&&(e?r=!0:e=n)}),this.getReceivers().forEach(e=>(e.track===t&&(n?r=!0:n=e),e.track===t)),r||e&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):e?e.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function T(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(t=>this._shimmedLocalStreams[t][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,n){if(!n)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=e.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._shimmedLocalStreams=this._shimmedLocalStreams||{},t.getTracks().forEach(t=>{if(this.getSenders().find(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError")});const e=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter(t=>-1===e.indexOf(t));this._shimmedLocalStreams[t.id]=[t].concat(r)};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[t.id],r.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},t&&Object.keys(this._shimmedLocalStreams).forEach(e=>{const n=this._shimmedLocalStreams[e].indexOf(t);-1!==n&&this._shimmedLocalStreams[e].splice(n,1),1===this._shimmedLocalStreams[e].length&&delete this._shimmedLocalStreams[e]}),i.apply(this,arguments)}}function C(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return T(t);const n=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map(t=>this._reverseStreams[t.id])};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(e){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach(t=>{if(this.getSenders().find(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[e.id]){const n=new t.MediaStream(e.getTracks());this._streams[e.id]=n,this._reverseStreams[n.id]=e,e=n}r.apply(this,[e])};const i=t.RTCPeerConnection.prototype.removeStream;function V(t,e){let n=e.sdp;return Object.keys(t._reverseStreams||[]).forEach(e=>{const r=t._reverseStreams[e],i=t._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:e.type,sdp:n})}function o(t,e){let n=e.sdp;return Object.keys(t._reverseStreams||[]).forEach(e=>{const r=t._reverseStreams[e],i=t._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:e.type,sdp:n})}t.RTCPeerConnection.prototype.removeStream=function(t){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[t.id]||t]),delete this._reverseStreams[this._streams[t.id]?this._streams[t.id].id:t.id],delete this._streams[t.id]},t.RTCPeerConnection.prototype.addTrack=function(e,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find(t=>t===e))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find(t=>t.track===e);if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const V=this._streams[n.id];if(V)V.addTrack(e),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new t.MediaStream([e]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(t=>t.track===e)},["createOffer","createAnswer"].forEach((function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){const t=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[e=>{const n=V(this,e);t[0].apply(null,[n])},e=>{t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then(t=>V(this,t))}};t.RTCPeerConnection.prototype[e]=r[e]}));const s=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=o(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const t=a.get.apply(this);return""===t.type?t:V(this,t)}}),t.RTCPeerConnection.prototype.removeTrack=function(t){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!t._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(t._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let e;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(e=>t.track===e)&&(e=this._streams[n])}),e&&(1===e.getTracks().length?this.removeStream(this._reverseStreams[e.id]):e.removeTrack(t.track),this.dispatchEvent(new Event("negotiationneeded")))}}function E(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=r[e]}))}function R(t,e){u(t,"negotiationneeded",t=>{const n=t.target;if(!(e.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return t})}function M(t,e){const n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(t,e,r){d("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(t).then(e,r)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const t=function(t,e,n){e in t&&!(n in t)&&(t[n]=t[e],delete t[e])},e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),t(n.audio,"autoGainControl","mozAutoGainControl"),t(n.audio,"noiseSuppression","mozNoiseSuppression")),e(n)},r&&r.prototype.getSettings){const e=r.prototype.getSettings;r.prototype.getSettings=function(){const n=e.apply(this,arguments);return t(n,"mozAutoGainControl","autoGainControl"),t(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const e=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),t(n,"autoGainControl","mozAutoGainControl"),t(n,"noiseSuppression","mozNoiseSuppression")),e.apply(this,[n])}}}}function O(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const t=new DOMException("getDisplayMedia without video constraints is undefined");return t.name="NotFoundError",t.code=8,Promise.reject(t)}return!0===n.video?n.video={mediaSource:e}:n.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(n)})}function P(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function k(t,e){if("object"!=typeof t||!t.RTCPeerConnection&&!t.mozRTCPeerConnection)return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=r[e]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,i,V]=arguments;return r.apply(this,[t||null]).then(t=>{if(e.version<53&&!i)try{t.forEach(t=>{t.type=n[t.type]||t.type})}catch(e){if("TypeError"!==e.name)throw e;t.forEach((e,r)=>{t.set(r,Object.assign({},e,{type:n[e.type]||e.type}))})}return t}).then(i,V)}}function I(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=n.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function D(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t}),u(t,"track",t=>(t.receiver._pc=t.srcElement,t)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function N(t){t.RTCPeerConnection&&!("removeStream"in t.RTCPeerConnection.prototype)&&(t.RTCPeerConnection.prototype.removeStream=function(t){d("removeStream","removeTrack"),this.getSenders().forEach(e=>{e.track&&t.getTracks().includes(e.track)&&this.removeTrack(e)})})}function j(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function L(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const t=arguments[1],n=t&&"sendEncodings"in t;n&&t.sendEncodings.forEach(t=>{if("rid"in t){if(!/^[a-z0-9]{0,16}$/i.test(t.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in t&&!(parseFloat(t.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in t&&!(parseFloat(t.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=e.apply(this,arguments);if(n){const{sender:e}=r,n=e.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=t.sendEncodings,e.sendEncodings=t.sendEncodings,this.setParametersPromises.push(e.setParameters(n).then(()=>{delete e.sendEncodings}).catch(()=>{delete e.sendEncodings})))}return r})}function U(t){if("object"!=typeof t||!t.RTCRtpSender)return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const t=e.apply(this,arguments);return"encodings"in t||(t.encodings=[].concat(this.sendEncodings||[{}])),t})}function F(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function B(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function W(t){if("object"==typeof t&&t.RTCPeerConnection){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(t){this._localStreams||(this._localStreams=[]),this._localStreams.includes(t)||this._localStreams.push(t),t.getAudioTracks().forEach(n=>e.call(this,n,t)),t.getVideoTracks().forEach(n=>e.call(this,n,t))},t.RTCPeerConnection.prototype.addTrack=function(t,...n){return n&&n.forEach(t=>{this._localStreams?this._localStreams.includes(t)||this._localStreams.push(t):this._localStreams=[t]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const e=this._localStreams.indexOf(t);if(-1===e)return;this._localStreams.splice(e,1);const n=t.getTracks();this.getSenders().forEach(t=>{n.includes(t.track)&&this.removeTrack(t)})})}}function z(t){if("object"==typeof t&&t.RTCPeerConnection&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=t=>{t.streams.forEach(t=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(t))return;this._remoteStreams.push(t);const e=new Event("addstream");e.stream=t,this.dispatchEvent(e)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const t=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach(e=>{if(t._remoteStreams||(t._remoteStreams=[]),t._remoteStreams.indexOf(e)>=0)return;t._remoteStreams.push(e);const n=new Event("addstream");n.stream=e,t.dispatchEvent(n)})}),e.apply(t,arguments)}}}function q(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,V=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(t,e){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return e?(i.then(t,e),Promise.resolve()):i},e.createAnswer=function(t,e){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return e?(i.then(t,e),Promise.resolve()):i};let s=function(t,e,n){const r=i.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r};e.setLocalDescription=s,s=function(t,e,n){const r=V.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r},e.setRemoteDescription=s,s=function(t,e,n){const r=o.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r},e.addIceCandidate=s}function H(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,n=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=t=>n(G(t))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(t,n,r){e.mediaDevices.getUserMedia(t).then(n,r)}.bind(e))}function G(t){return t&&void 0!==t.video?Object.assign({},t,{video:g(t.video)}):t}function Y(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(t,n){if(t&&t.iceServers){const e=[];for(let n=0;n<t.iceServers.length;n++){let r=t.iceServers[n];!r.hasOwnProperty("urls")&&r.hasOwnProperty("url")?(d("RTCIceServer.url","RTCIceServer.urls"),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,e.push(r)):e.push(t.iceServers[n])}t.iceServers=e}return new e(t,n)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:()=>e.generateCertificate})}function $(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Q(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(t){if(t){void 0!==t.offerToReceiveAudio&&(t.offerToReceiveAudio=!!t.offerToReceiveAudio);const e=this.getTransceivers().find(t=>"audio"===t.receiver.track.kind);!1===t.offerToReceiveAudio&&e?"sendrecv"===e.direction?e.setDirection?e.setDirection("sendonly"):e.direction="sendonly":"recvonly"===e.direction&&(e.setDirection?e.setDirection("inactive"):e.direction="inactive"):!0!==t.offerToReceiveAudio||e||this.addTransceiver("audio"),void 0!==t.offerToReceiveVideo&&(t.offerToReceiveVideo=!!t.offerToReceiveVideo);const n=this.getTransceivers().find(t=>"video"===t.receiver.track.kind);!1===t.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==t.offerToReceiveVideo||n||this.addTransceiver("video")}return e.apply(this,arguments)}}function X(t){"object"!=typeof t||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var Z=n(43),K=n.n(Z);function J(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(t){if("object"==typeof t&&t.candidate&&0===t.candidate.indexOf("a=")&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substr(2)),t.candidate&&t.candidate.length){const n=new e(t),r=K.a.parseCandidate(t.candidate),i=Object.assign(n,r);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(t)},t.RTCIceCandidate.prototype=e.prototype,u(t,"icecandidate",e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new t.RTCIceCandidate(e.candidate),writable:"false"}),e))}function tt(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(t){if(!t||!t.sdp)return!1;const e=K.a.splitSections(t.sdp);return e.shift(),e.some(t=>{const e=K.a.parseMLine(t);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")})},r=function(t){const e=t.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;const n=parseInt(e[1],10);return n!=n?-1:n},i=function(t){let n=65536;return"firefox"===e.browser&&(n=e.version<57?-1===t?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),n},V=function(t,n){let r=65536;"firefox"===e.browser&&57===e.version&&(r=65535);const i=K.a.matchPrefix(t.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===e.browser&&-1!==n&&(r=2147483637),r},o=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===e.browser&&e.version>=76){const{sdpSemantics:t}=this.getConfiguration();"plan-b"===t&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const t=r(arguments[0]),e=i(t),n=V(arguments[0],t);let o;o=0===e&&0===n?Number.POSITIVE_INFINITY:0===e||0===n?Math.max(e,n):Math.min(e,n);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>o}),this._sctp=s}return o.apply(this,arguments)}}function et(t){if(!t.RTCPeerConnection||!("createDataChannel"in t.RTCPeerConnection.prototype))return;function e(t,e){const n=t.send;t.send=function(){const r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===t.readyState&&e.sctp&&i>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return n.apply(t,arguments)}}const n=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const t=n.apply(this,arguments);return e(t,this),t},u(t,"datachannel",t=>(e(t.channel,t.target),t))}function nt(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(t=>{const n=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=t=>{const e=t.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;const n=new Event("connectionstatechange",t);e.dispatchEvent(n)}return t},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function rt(t,e){if(!t.RTCPeerConnection)return;if("chrome"===e.browser&&e.version>=71)return;if("safari"===e.browser&&e.version>=605)return;const n=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(e){if(e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")){const n=e.sdp.split("\n").filter(t=>"a=extmap-allow-mixed"!==t.trim()).join("\n");t.RTCSessionDescription&&e instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:e.type,sdp:n}):e.sdp=n}return n.apply(this,arguments)}}function it(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const n=t.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===e.browser&&e.version<78||"firefox"===e.browser&&e.version<68||"safari"===e.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Vt(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const n=t.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(t.RTCPeerConnection.prototype.setLocalDescription=function(){let t=arguments[0]||{};if("object"!=typeof t||t.type&&t.sdp)return n.apply(this,arguments);if(t={type:t.type,sdp:t.sdp},!t.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":t.type="offer";break;default:t.type="answer"}if(t.sdp||"offer"!==t.type&&"answer"!==t.type)return n.apply(this,[t]);const e="offer"===t.type?this.createOffer:this.createAnswer;return e.apply(this).then(t=>n.apply(this,[t]))})}const ot=function({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=f,s=function(t){const e={browser:null,version:null};if(void 0===t||!t.navigator)return e.browser="Not a browser.",e;const{navigator:n}=t;if(n.mozGetUserMedia)e.browser="firefox",e.version=c(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===t.isSecureContext&&t.webkitRTCPeerConnection&&!t.RTCIceGatherer)e.browser="chrome",e.version=c(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!t.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=c(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype}return e}(t),a={browserDetails:s,commonShim:o,extractVersion:c,disableLog:h,disableWarnings:l,sdp:Z};switch(s.browser){case"chrome":if(!r||!E||!e.shimChrome)return n("Chrome shim is not included in this adapter release."),a;if(null===s.version)return n("Chrome shim can not determine version, not shimming."),a;n("adapter.js shimming chrome."),a.browserShim=r,it(t,s),Vt(t),m(t,s),_(t),E(t,s),w(t),C(t,s),A(t),S(t),x(t),R(t,s),J(t),nt(t),tt(t,s),et(t),rt(t,s);break;case"firefox":if(!i||!k||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),a;n("adapter.js shimming firefox."),a.browserShim=i,it(t,s),Vt(t),M(t,s),k(t,s),P(t),N(t),I(t),D(t),j(t),L(t),U(t),F(t),B(t),J(t),nt(t),tt(t,s),et(t);break;case"safari":if(!V||!e.shimSafari)return n("Safari shim is not included in this adapter release."),a;n("adapter.js shimming safari."),a.browserShim=V,it(t,s),Vt(t),Y(t),Q(t),q(t),W(t),z(t),$(t),H(t),X(t),J(t),tt(t,s),et(t),rt(t,s);break;default:n("Unsupported browser!")}return a}({window:"undefined"==typeof window?void 0:window});e.default=ot},function(t,e,n){"use strict";n.r(e),console.log("BUILD/SERIOUSLY.MODULE");let r,i,V,o,s,a,c,u={},h={},l={},f={},d=[],p={},g={},v={canvas:[],image:[],video:[]},y={},m=window.WeakMap&&new WeakMap,b=0,_=function(){},w={transparent:[0,0,0,0],black:[0,0,0,1],red:[1,0,0,1],green:[0,128/255,0,1],blue:[0,0,1,1],white:[1,1,1,1],silver:[192/255,192/255,192/255,1],gray:[128/255,128/255,128/255,1],maroon:[128/255,0,0,1],purple:[128/255,0,128/255,1],fuchsia:[1,0,1,1],lime:[0,1,0,1],olive:[128/255,128/255,0,1],yellow:[1,1,0,1],navy:[0,0,128/255,1],teal:[0,128/255,128/255,1],aqua:[0,1,1,1],orange:[1,165/255,0,1]},A=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,S=/^#(([0-9a-fA-F]{3,8}))/,x=["x","y","z","w"],T=["r","g","b","a"],C={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},E=["MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"],R=/^[\t ]*#define[\t ]+SHADER_NAME\s+([^$\n\r]+)/i,M={frustum:function(t,e,n,r,i,V,o){o||(o=M.create());var s=e-t,a=r-n,c=V-i;return o[0]=2*i/s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*i/a,o[6]=0,o[7]=0,o[8]=(e+t)/s,o[9]=(r+n)/a,o[10]=-(V+i)/c,o[11]=-1,o[12]=0,o[13]=0,o[14]=-V*i*2/c,o[15]=0,o},perspective:function(t,e,n,r,i){var V=n*Math.tan(t*Math.PI/360),o=V*e;return M.frustum(-o,o,-V,V,n,r,i)},multiply:function(t,e,n){var r=e[0],i=e[1],V=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=n[0],b=n[1],_=n[2],w=n[3];return t[0]=m*r+b*s+_*h+w*p,t[1]=m*i+b*a+_*l+w*g,t[2]=m*V+b*c+_*f+w*v,t[3]=m*o+b*u+_*d+w*y,m=n[4],b=n[5],_=n[6],w=n[7],t[4]=m*r+b*s+_*h+w*p,t[5]=m*i+b*a+_*l+w*g,t[6]=m*V+b*c+_*f+w*v,t[7]=m*o+b*u+_*d+w*y,m=n[8],b=n[9],_=n[10],w=n[11],t[8]=m*r+b*s+_*h+w*p,t[9]=m*i+b*a+_*l+w*g,t[10]=m*V+b*c+_*f+w*v,t[11]=m*o+b*u+_*d+w*y,m=n[12],b=n[13],_=n[14],w=n[15],t[12]=m*r+b*s+_*h+w*p,t[13]=m*i+b*a+_*l+w*g,t[14]=m*V+b*c+_*f+w*v,t[15]=m*o+b*u+_*d+w*y,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},O=(N=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){var e,n,r;return e=(new Date).getTime(),n=Math.max(0,16-(e-N)),r=window.setTimeout((function(){t(e+n)}),n),N=e+n,r}),P=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){window.cancelTimeout(t)},k=["alias","destroy","effect","id","initialize","inputs","isDestroyed","isReady","matte","off","on","readPixels","render","title","update"],I=["alias","destroy","id","inputs","isDestroyed","isReady","off","on","source","title","update"],D=["aliases","defaults","destroy","effect","go","id","incompatible","isDestroyed","isEffect","isNode","isSource","isTarget","isTransform","removeAlias","render","source","stop","target","transform"];var N;function j(t,e){var n,r;if("string"==typeof t)n=document.querySelector(t);else if(!t)return!1;return t.tagName&&(n=t),n?(r=n.tagName.toLowerCase(),e&&e.indexOf(r)<0?t:n):t}function L(t,e){var n,r;for(n in t.prototype&&e.prototype&&t.prototype!==e.prototype&&L(t.prototype,e.prototype),e)e.hasOwnProperty(n)&&((r=Object.getOwnPropertyDescriptor(e,n)).get||r.set?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:r.get,set:r.set}):t[n]=e[n]);return t}function U(t){var e;if(!console)return _;if("function"==typeof console[t])e=console[t];else{if("function"!=typeof console.log)return _;e=console.log}return e.bind?e.bind(console):function(){e.apply(console,arguments)}}function F(t,e){if(e||(e="HTMLElement"),t instanceof window[e])return!0;if(!t||"object"!=typeof t)return!1;for(;t;)if((t=Object.getPrototypeOf(t))&&t.constructor.name===e)return!0;return!1}function B(t,e,n,r,i){function V(t,e,n){return(n%=1)<0&&(n+=1),n<1/6?t+(e-t)*n*6:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var o,s;return o=2*n-(s=n<.5?n*(e+1):n+e-n*e),i||(i=[]),i[0]=V(o,s,t+1/3),i[1]=V(o,s,t),i[2]=V(o,s,t-1/3),i[3]=r,i}function W(t){var e,n,r,i="#",V=t[3]<1?4:3;for(e=0;e<V;e++)r=(n=Math.min(255,Math.round(255*t[e]||0))).toString(16),n<16&&(r="0"+r),i+=r;return i}function z(t){return Array.isArray(t)||t&&t.BYTES_PER_ELEMENT&&"length"in t}function q(t){if("function"!=typeof t)throw new Error("setTimeoutZero argument is not a function");d.push(t),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout((function(){d.length&&d.shift()()}),0)}function H(t,e){var n;try{n=window.WebGLDebugUtils&&e&&e.debugContext?window.WebGLDebugUtils.makeDebugContext(t.getContext("webgl",e)):t.getContext("webgl",e)}catch(t){}if(!n)try{n=t.getContext("experimental-webgl",e)}catch(t){}return n}function G(){var t;return r&&r.getError()===r.CONTEXT_LOST_WEBGL&&(r=void 0),r||!window.WebGLRenderingContext||V||(t=document.createElement("canvas"),r=H(t),r?t.addEventListener("webglcontextlost",(function e(n){n.preventDefault(),r&&r.canvas===this&&(r=void 0,t.removeEventListener("webglcontextlost",e,!1))}),!1):X.logger.warn("Unable to access WebGL.")),r}function Y(t){var e,n,r;function i(t,r){var i,V;z(t)?(i=t[0],V=t[1]||i):i=t,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),n[i]=V,r||(e.firstValue=i)}function V(t){return t}for(r in t.inputs)if(t.inputs.hasOwnProperty(r)){if(t.reserved.indexOf(r)>=0||Object.prototype[r])throw new Error("Reserved input name: "+r);(e=t.inputs[r]).name=r,isNaN(e.min)&&(e.min=-1/0),isNaN(e.max)&&(e.max=1/0),isNaN(e.minCount)&&(e.minCount=-1/0),isNaN(e.maxCount)&&(e.maxCount=1/0),isNaN(e.step)&&(e.step=0),isNaN(e.mod)&&(e.mod=0),"enum"===e.type&&e.options&&z(e.options)&&e.options.length&&(n={},e.options.forEach(i),e.options=n),"vector"===e.type?e.dimensions<2?e.dimensions=2:e.dimensions>4||!e.dimensions||isNaN(e.dimensions)?e.dimensions=4:e.dimensions=Math.round(e.dimensions):e.dimensions=1,e.shaderDirty=!!e.shaderDirty,"function"!=typeof e.validate&&(e.validate=X.inputValidators[e.type]||V),t.defaultImageInput||"image"!==e.type||(t.defaultImageInput=r)}}function $(t,e,n,r){var i,V,o,s;!0===r||r&&r.useFloat;this.type=t.UNSIGNED_BYTE,i=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,i),r&&r.texture?(this.texture=r.texture,t.bindTexture(t.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===t.FLOAT?(o=new Float32Array(e*n*4),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.FLOAT,o)):(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.UNSIGNED_BYTE,null),this.type=t.UNSIGNED_BYTE)}catch(r){this.type=t.UNSIGNED_BYTE,o=new Uint8Array(e*n*4),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.UNSIGNED_BYTE,o)}if(V=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,V),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,e,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,V),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0),(s=t.checkFramebufferStatus(t.FRAMEBUFFER))===t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(s===t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(s===t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(s===t.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(s!==t.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+s);t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.gl=t,this.frameBuffer=i,this.renderBuffer=V,this.width=e,this.height=n}function Q(t,e,n){var r,i,V,o,s,a,c,u,h="";function l(e,n){var r,i;if(r=n?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER),t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){for(e=e.split(/[\n\r]/),i=0;i<e.length;i++)e[i]=i+1+":\t"+e[i];throw e.unshift("Error compiling "+(n?"fragment":"vertex")+" shader:"),X.logger.error(e.join("\n")),new Error("Shader error: "+t.getShaderInfoLog(r))}return r}function f(e,n){if(e.type===t.SAMPLER_2D)return function(r){e.glTexture=t["TEXTURE"+r],t.uniform1i(n,r)};if(e.type===t.BOOL||e.type===t.INT)return e.size>1?function(e){t.uniform1iv(n,e)}:function(e){t.uniform1i(n,e)};if(e.type===t.FLOAT)return e.size>1?function(e){t.uniform1fv(n,e)}:function(e){t.uniform1f(n,e)};if(e.type===t.FLOAT_VEC2)return function(e){t.uniform2f(n,e[0],e[1])};if(e.type===t.FLOAT_VEC3)return function(e){t.uniform3f(n,e[0],e[1],e[2])};if(e.type===t.FLOAT_VEC4)return function(e){t.uniform4f(n,e[0],e[1],e[2],e[3])};if(e.type===t.FLOAT_MAT3)return function(e){t.uniformMatrix3fv(n,!1,e)};if(e.type===t.FLOAT_MAT4)return function(e){t.uniformMatrix4fv(n,!1,e)};throw new Error("Unknown shader uniform type: "+e.type)}function d(e){return function(){return t.getUniform(r,e)}}if(i=l(e),V=l(n,!0),r=t.createProgram(),t.attachShader(r,i),(o=t.getShaderInfoLog(i))&&(h+="Vertex shader error: "+o+"\n"),t.attachShader(r,V),(o=t.getShaderInfoLog(V))&&(h+="Fragment shader error: "+o+"\n"),t.linkProgram(r),!t.getProgramParameter(r,t.LINK_STATUS))throw h+=t.getProgramInfoLog(r),t.deleteProgram(r),t.deleteShader(i),t.deleteShader(V),(c=R.exec(e)||R.exec(n))&&(h="Shader = "+c[1]+"\n"+h),E.forEach((function(e){h+="\n"+e+": "+t.getParameter(t[e])})),new Error("Could not initialize shader:\n"+h);for(t.useProgram(r),this.uniforms={},a=t.getProgramParameter(r,t.ACTIVE_UNIFORMS),s=0;s<a;++s)(u={info:t.getActiveUniform(r,s)}).name=u.info.name.replace(/\[0\]$/,""),u.loc=t.getUniformLocation(r,u.name),u.set=f(u.info,u.loc),u.get=d(u.loc),this.uniforms[u.name]=u,this[u.name]||(this[u.name]=u);for(this.attributes={},this.location={},a=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),s=0;s<a;++s)(u={info:t.getActiveAttrib(r,s)}).name=u.info.name,u.location=t.getAttribLocation(r,u.name),this.attributes[u.name]=u,this.location[u.name]=u.location;this.gl=t,this.program=r,this.destroy=function(){var e;for(e in t&&(t.deleteProgram(r),t.deleteShader(i),t.deleteShader(V)),this)this.hasOwnProperty(e)&&delete this[e];r=null,i=null,V=null}}function X(t){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(t);var e,n,r,i,V,s,d,y,w,A,S,x,T,E,k,I=++b,N=this,U=[],B={},z=0,G=[],Z=[],K=[],J=[],tt={},et=[],nt=[],rt={},it={},Vt=!1,ot=!1;function st(t,e){var n,r,i;return!!e&&(n=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.STATIC_DRAW),n.size=3,r=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),i=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,t.coords,e.STATIC_DRAW),i.size=2,{vertex:n,index:r,texCoord:i,length:t.indices.length,mode:t.mode||e.TRIANGLES})}function at(t){var e={};return e.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),e.indices=new Uint16Array([0,1,2,0,2,3]),e.coords=new Float32Array([0,0,1,0,1,1,0,1]),st(e,t)}function ct(t){var r,o;if(!n)if(t.canvas.addEventListener("webglcontextlost",ht,!1),t.canvas.addEventListener("webglcontextrestored",ut,!1),t.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(n=t,e=t.canvas,i=at(n),V=new Q(n,"#define SHADER_NAME seriously.base\n"+a,"#define SHADER_NAME seriously.base\n"+c),r=0;r<J.length;r++)(o=J[r]).gl=n,o.initialize(),o.buildShader();for(r=0;r<G.length;r++)(o=G[r]).initialize();for(r=0;r<Z.length;r++)(o=Z[r]).model||(o.model=i,o.shader=V)}}function ut(){var t,e,i,V;if(r&&!n){if(F(e=r.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(t=H(e,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:r.debugContext})){if(t.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ct(t),r.renderToTexture?r.frameBuffer=new $(n,r.width,r.height,!1):r.frameBuffer={frameBuffer:null},i=0;i<U.length;i++)(V=U[i]).setDirty(),V.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function ht(t){var r,o;for(t&&(X.logger.warn("WebGL context lost"),t.preventDefault()),k&&(P(k),k=0),e&&e.removeEventListener("webglcontextlost",ht,!1),r=0;r<J.length;r++)(o=J[r]).gl=null,o.initialized=!1,o.baseShader=null,o.model=null,o.frameBuffer=null,o.texture=null,o.shader&&o.shader.destroy&&(o.shader.destroy(),o.effect.commonShader&&delete it[o.hook]),o.shaderDirty=!0,o.shader=null,o.effect.lostContext&&o.effect.lostContext.call(o),t&&o.emit("webglcontextlost");for(r=0;r<G.length;r++)(o=G[r]).texture=null,o.initialized=!1,o.allowRefresh=!1,t&&o.emit("webglcontextlost");for(r=0;r<K.length;r++)(o=K[r]).frameBuffer=null,o.texture=null,t&&o.emit("webglcontextlost");for(r=0;r<Z.length;r++)(o=Z[r]).model=!1,o.frameBuffer=null,t&&o.emit("webglcontextlost");V&&V.destroy&&V.destroy(),n&&(n.deleteBuffer(i.vertex),n.deleteBuffer(i.texCoord),n.deleteBuffer(i.index)),i&&(delete i.vertex,delete i.texCoord,delete i.index),i=null,V=null,n=null,e=null}function lt(t){var e,n,r=!1;if(k=0,et.length)for(r=!0,e=0;e<et.length;e++)et[e].call(N,t);if(G&&G.length)for(r=!0,e=0;e<G.length;e++)((n=G[e]).dirty||n.checkDirty&&n.checkDirty())&&(n.dirty=!1,n.setDirty());for(e=0;e<Z.length;e++)(n=Z[e]).auto&&n.dirty&&n.render();if(nt.length)for(r=!0,e=0;e<nt.length;e++)nt[e].call(N);r&&!k&&(k=O(lt))}function ft(t,e,r,i,V,o){var s,a,c,u,h,l,f,p,g,v=0,m=V&&V.gl||n;if(m){for(s in V?(u=o&&o.width||V.width||m.canvas.width,h=o&&o.height||V.height||m.canvas.height):(u=o&&o.width||m.canvas.width,h=o&&o.height||m.canvas.height),t.use(),m.viewport(0,0,u,h),m.bindFramebuffer(m.FRAMEBUFFER,i),m.enableVertexAttribArray(t.location.position),m.enableVertexAttribArray(t.location.texCoord),e.texCoord&&(m.bindBuffer(m.ARRAY_BUFFER,e.texCoord),m.vertexAttribPointer(t.location.texCoord,e.texCoord.size,m.FLOAT,!1,0,0)),m.bindBuffer(m.ARRAY_BUFFER,e.vertex),m.vertexAttribPointer(t.location.position,e.vertex.size,m.FLOAT,!1,0,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.index),o&&o.depth?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),o?void 0===o.blend||o.blend?(n.enable(n.BLEND),l=void 0===o.srcRGB?n.ONE:o.srcRGB,p=o.dstRGB||n.ZERO,f=void 0===o.srcAlpha?l:o.srcAlpha,g=void 0===o.dstAlpha?p:o.dstAlpha,n.blendFuncSeparate(l,p,f,g),n.blendEquation(o.blendEquation||n.FUNC_ADD)):n.disable(n.BLEND):(n.enable(n.BLEND),n.blendFunc(n.ONE,n.ZERO),n.blendEquation(n.FUNC_ADD)),r)r.hasOwnProperty(s)&&(a=r[s],(c=t.uniforms[s])&&(F(a,"WebGLTexture")?(m.activeTexture(m.TEXTURE0+v),m.bindTexture(m.TEXTURE_2D,a),c.set(v),v++):a instanceof d||a instanceof y||a instanceof w?a.texture&&(m.activeTexture(m.TEXTURE0+v),m.bindTexture(m.TEXTURE_2D,a.texture),c.set(v),v++):null!=a&&c.set(a)));o&&void 0!==o.clear&&!o.clear||(m.clearColor(0,0,0,0),m.clear(m.COLOR_BUFFER_BIT|m.DEPTH_BUFFER_BIT)),m.drawElements(e.mode,e.length,m.UNSIGNED_SHORT,0),n.enable(n.DEPTH_TEST)}}function dt(t,e,n){var r,i;if(("string"!=typeof t||!e&&0!==e)&&(n&&"object"==typeof n||(n=e),e=t),"string"==typeof t&&l[t]||(t=null),e instanceof d||e instanceof y||e instanceof w)r=e;else if(e instanceof S||e instanceof x||e instanceof T){if(!(r=B[e.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof e&&isNaN(e)&&(e=j(e,["canvas","img","video"])),i=0;i<G.length;i++)if(r=G[i],(!t||t===r.hook)&&r.compare&&r.compare(e,n))return r;r=new d(t,e,n)}return r}function pt(t,e){var n,r,i;if(!(t instanceof y||t instanceof w))return!1;if(t===e)return!0;for(n in i=t.sources)if(i.hasOwnProperty(n)&&((r=i[n])===e||pt(r,e)))return!0;return!1}(s=function(){this.ready=!1,this.width=1,this.height=1,this.gl=n,this.uniforms={resolution:[this.width,this.height],transform:null},this.dirty=!0,this.isDestroyed=!1,this.seriously=N,this.listeners={},this.id=z,z++}).prototype.setReady=function(){var t;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setReady()},s.prototype.setUnready=function(){var t;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setUnready()},s.prototype.setDirty=function(){var t;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setDirty()},s.prototype.initFrameBuffer=function(t){n&&(this.frameBuffer=new $(n,this.width,this.height,t))},s.prototype.readPixels=function(t,e,r,i,V){var o=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.frameBuffer||(this.initFrameBuffer(),this.setDirty()),this.render(),void 0===V)V=new Uint8Array(r*i*4);else if(!F(V,"Uint8Array"))throw new Error("Incompatible array type");return o.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),o.readPixels(t,e,r,i,n.RGBA,n.UNSIGNED_BYTE,V),V},s.prototype.resize=function(){var t,e;this.source?(t=this.source.width,e=this.source.height):this.sources&&this.sources.source?(t=this.sources.source.width,e=this.sources.source.height):this.inputs&&this.inputs.width?(t=this.inputs.width,e=this.inputs.height||t):this.inputs&&this.inputs.height?t=e=this.inputs.height:(t=1,e=1),t=Math.floor(t),e=Math.floor(e),this.width===t&&this.height===e||(this.width=t,this.height=e,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=e),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,e)},s.prototype.on=function(t,e){var n,r=-1;t&&"function"==typeof e&&((n=this.listeners[t])?r=n.indexOf(e):n=this.listeners[t]=[],r<0&&n.push(e))},s.prototype.off=function(t,e){var n,r=-1;t&&"function"==typeof e&&(n=this.listeners[t])&&(r=n.indexOf(e))>=0&&n.splice(r,1)},s.prototype.emit=function(t){var e,n=this.listeners[t];if(n&&n.length)for(e=0;e<n.length;e++)q(n[e])},s.prototype.destroy=function(){var t,e;for(e in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(e)&&delete this.listeners[e];for(t in this.uniforms)this.uniforms.hasOwnProperty(t)&&delete this.uniforms[t];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(t=U.indexOf(this))>=0&&U.splice(t,1),delete B[this.id],this.isDestroyed=!0},S=function(t){var e,n=t;function r(t,e){var r,i,V;return V=n.effect.inputs[t],r=n.inputElements[t],"string"==typeof e&&isNaN(e)&&("enum"===V.type?V.options.hasOwnProperty(e)||(e=j(e,["select"])):"number"===V.type||"boolean"===V.type?e=j(e,["input","select"]):"image"===V.type&&(e=j(e,["canvas","img","video"]))),F(e,"HTMLInputElement")||F(e,"HTMLSelectElement")?(i=e.value,r&&r.element!==e&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[t],r=null),r||(r={element:e,listener:function(t,r){return function(){var i,o;i="checkbox"===e.type?e.checked:r.value,o=n.setInput(t,i),"color"===V.type&&(o=W(o).substr(0,7)),o!==i&&(r.value=o)}}(t,e)},n.inputElements[t]=r,"range"===e.type?(e.addEventListener("input",r.listener,!0),e.addEventListener("change",r.listener,!0)):e.addEventListener("change",r.listener,!0)),r&&"checkbox"===e.type&&(i=e.checked)):(r&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[t]),i=e),n.setInput(t,i),n.inputs[t]}function i(t){return function(e){var n=r(t,e);return n&&n.pub}}function V(t){return function(){var e=n.inputs[t];return e&&e.pub}}function o(t){return function(e){return r(t,e)}}function s(t){return function(){return n.inputs[t]}}for(e in n.effect.inputs)if(n.effect.inputs.hasOwnProperty(e)){if(void 0!==this[e])throw new Error("Cannot overwrite Seriously."+e);"image"===n.effect.inputs[e].type?Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:V(e),set:i(e)}):Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:s(e),set:o(e)})}Object.defineProperties(this,{effect:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.effect.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}}}),this.render=function(){return n.render(),this},this.readPixels=function(t,e,r,i,V){return n.readPixels(t,e,r,i,V)},this.on=function(t,e){n.on(t,e)},this.off=function(t,e){n.off(t,e)},this.inputs=function(t){var e,r,i,V;if(i=n.effect.inputs,t)return(r=i[t])?(e={type:r.type,defaultValue:r.defaultValue,title:r.title||t},"number"===r.type?(e.min=r.min,e.max=r.max,e.step=r.step,e.mod=r.mod):"enum"===r.type?e.options=L({},r.options):"vector"===r.type&&(e.dimensions=r.dimensions),r.description&&(e.description=r.description),e):null;for(V in e={},i)i.hasOwnProperty(V)&&(e[V]=this.inputs(V));return e},this.alias=function(t,e){return n.alias(t,e),this},this.matte=function(t){n.matte(t)},this.destroy=function(){var t,e;for(t in n.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(y=function(t,e){var r,i,V,a,c={};for(r in s.call(this,e),this.gl=n,this.effectRef=u[t],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=t,this.options=e,this.transform=null,this.effect=L({},this.effectRef),this.effectRef.definition&&L(this.effect,this.effectRef.definition.call(this,e)),Y(this.effect),this.uniforms.transform=o,this.inputs={},a=rt[t],this.effect.inputs)this.effect.inputs.hasOwnProperty(r)&&(void 0!==(i=this.effect.inputs[r]).defaultValue&&null!==i.defaultValue||("number"===i.type?i.defaultValue=Math.min(Math.max(0,i.min),i.max):"color"===i.type?i.defaultValue=[0,0,0,0]:"boolean"===i.type?i.defaultValue=!1:"string"===i.type?i.defaultValue="":"enum"===i.type&&(i.defaultValue=i.firstValue)),V=i.validate.call(this,i.defaultValue,i),a&&void 0!==a[r]&&(V=i.validate.call(this,a[r],i,i.defaultValue,V),a[r]=V,"image"===i.type&&(c[r]=V)),this.inputs[r]=V,i.uniform&&(this.uniforms[i.uniform]=i.defaultValue));for(r in n&&(this.initialize(),this.effect.commonShader&&this.buildShader()),this.updateReady(),this.inPlace=this.effect.inPlace,this.pub=new S(this),U.push(this),B[this.id]=this,J.push(this),p[t].push(this),c)c.hasOwnProperty(r)&&this.setInput(r,c[r])}).prototype=Object.create(s.prototype),y.prototype.constructor=y,y.prototype.initialize=function(){if(!this.initialized){var t=this;this.baseShader=V,this.shape?this.model=st(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,(function(){t.initFrameBuffer(!0)}),n):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},y.prototype.resize=function(){var t;for(s.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),t=0;t<this.targets.length;t++)this.targets[t].resize()},y.prototype.updateReady=function(){var t,e,n,r,i=!0;for(e in(n=this.effect).inputs)if(n.inputs.hasOwnProperty(e)&&"image"===this.effect.inputs[e].type&&(!this.sources[e]||!this.sources[e].ready)&&(!n.requires||n.requires.call(this,e,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),r=i?"setReady":"setUnready",this.targets))for(t=0;t<this.targets.length;t++)this.targets[t][r]()},y.prototype.setReady=y.prototype.updateReady,y.prototype.setUnready=y.prototype.updateReady,y.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},y.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1)},y.prototype.removeSource=function(t){var e,n=t&&t.pub;for(e in this.inputs)!this.inputs.hasOwnProperty(e)||this.inputs[e]!==t&&this.inputs[e]!==n||(this.inputs[e]=null);for(e in this.sources)!this.sources.hasOwnProperty(e)||this.sources[e]!==t&&this.sources[e]!==n||(this.sources[e]=null)},y.prototype.buildShader=function(){var t,e=this.effect,r=this;function i(t){return R.test(t)?t:"#define SHADER_NAME seriously."+r.hook+"\n"+t}this.shaderDirty&&(e.commonShader&&it[this.hook]?(this.shader||it[this.hook].count++,this.shader=it[this.hook].shader):e.shader?(this.shader&&!e.commonShader&&this.shader.destroy(),(t=e.shader.call(this,this.inputs,{vertex:a,fragment:c},X.util))instanceof Q?this.shader=t:t&&t.vertex&&t.fragment?this.shader=new Q(n,i(t.vertex),i(t.fragment)):this.shader=V,e.commonShader&&(it[this.hook]={count:1,shader:this.shader})):this.shader=V,this.shaderDirty=!1)},y.prototype.render=function(){var t,e,r,i=this.effect,V=this;if(n){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(t in this.sources)!this.sources.hasOwnProperty(t)||i.requires&&!i.requires.call(this,t,this.inputs)||(r="function"==typeof this.inPlace?this.inPlace(t):this.inPlace,this.sources[t].render(!r));this.frameBuffer&&(e=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,e,(function(t,e,n,r,i,o){ft(t,e,n,r,i||V,o)})),this.emit("render")):e&&(ft(this.shader,this.model,this.uniforms,e,this),this.emit("render")),this.dirty=!1}return this.texture}},y.prototype.setInput=function(t,e){var n,r,i,V,s,a=this;if(this.effect.inputs.hasOwnProperty(t)){if("image"===(n=this.effect.inputs[t]).type){if(e){if((e=dt(e))!==this.sources[t]){if(function(){var e,n=a.sources[t];if(n){for(e in a.sources)if(e!==t&&a.sources.hasOwnProperty(e)&&a.sources[e]===n)return;n.removeTarget(a)}}(),pt(e,this))throw new Error("Attempt to make cyclical connection.");this.sources[t]=e,e.addTarget(this)}}else delete this.sources[t],e=!1;r=this.sources[t],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(V=this.sources[i[0]],this.uniforms.transform=V&&V.cumulativeMatrix||o):this.uniforms.transform=o}else s=rt[this.hook]&&void 0!==rt[this.hook][t]?rt[this.hook][t]:n.defaultValue,r=e=n.validate.call(this,e,n,s,this.inputs[t]);return this.inputs[t]===e&&"color"!==n.type&&"vector"!==n.type||(this.inputs[t]=e,n.uniform&&(this.uniforms[n.uniform]=r),"image"===n.type?(this.resize(),this.updateReady()):n.updateSources&&this.updateReady(),n.shaderDirty&&(this.shaderDirty=!0),this.setDirty(),n.update&&n.update.call(this,e)),e}},y.prototype.alias=function(t,e){var n=this;if(D.indexOf(e)>=0)throw new Error("'"+e+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(t)&&(e||(e=t),N.removeAlias(e),tt[e]={node:this,input:t},Object.defineProperty(N,e,{configurable:!0,enumerable:!0,get:function(){return n.inputs[t]},set:function(e){return n.setInput(t,e)}})),this},y.prototype.matte=function(t){var e,n,r,i,V,o,s,a=[],c=[],u={};function h(t){var e,n,r,i,V,o,s,u,h,l,f,d=[];if(!t.simple){for(e=0;e<t.edges.length;e++)for(r=t.edges[e],n=e+1;n<t.edges.length;n++)i=t.edges[n],p=r[0],g=r[1],v=i[0],y=i[1],m=void 0,b=void 0,_=void 0,w=void 0,A=void 0,m=(y.x-v.x)*(p.y-v.y)-(y.y-v.y)*(p.x-v.x),b=(g.x-p.x)*(p.y-v.y)-(g.y-p.y)*(p.x-v.x),(V=!!((_=(y.y-v.y)*(g.x-p.x)-(y.x-v.x)*(g.y-p.y))&&(A=b/_,(w=m/_)>0&&w<=1&&A>0&&A<=1))&&{x:p.x+w*(g.x-p.x),y:p.y+w*(g.y-p.y)})&&(V.edge1=r,V.edge2=i,d.push(V));var p,g,v,y,m,b,_,w,A;if(d.length){for(h=[],e=0;e<d.length;e++)r=(V=d[e]).edge1,i=V.edge2,l={x:V.x,y:V.y,prev:r[0],next:i[1],id:c.length},t.vertices.push(l),c.push(l),f={x:V.x,y:V.y,prev:i[0],next:r[1],id:c.length},t.vertices.push(f),c.push(l),l.prev.next=l,l.next.prev=l,f.prev.next=f,f.next.prev=f;do{o={edges:[],vertices:[],simple:!0},h.push(o),s=u=t.vertices[0];do{e=t.vertices.indexOf(u),t.vertices.splice(e,1),o.edges.push([u,u.next]),o.vertices.push(u),u=u.next}while(u!==s)}while(t.vertices.length);for(e=a.indexOf(t),a.splice(e,1),e=0;e<h.length;e++)a.push(h[e])}else t.simple=!0}}function l(t){var e,n,r,i,V=t.vertices.length,o=0;for(e=V-1,n=0;n<V;e=n,n++)r=t.vertices[e],i=t.vertices[n],o+=r.x*i.y-i.x*r.y;return o>0}function f(t){var e,r,i,V,o,s,a,c,u,h,l,f=t.vertices,d=[],p=[];function g(t,e,n,r){var i,V,o,s,a,c,u,h,l,f,d,p;return i=n.x-e.x,V=n.y-e.y,o=t.x-n.x,s=t.y-n.y,a=e.x-t.x,c=e.y-t.y,u=r.x-t.x,h=r.y-t.y,l=r.x-e.x,f=r.y-e.y,d=r.x-n.x,p=r.y-n.y,i*f-V*l>=0&&o*p-s*d>=0&&a*h-c*u>=0}function v(t,e,n,r,i){var V,o,s,a;if(o=f[i[t]],s=f[i[e]],a=f[i[n]],0>(s.x-o.x)*(a.y-o.y)-(s.y-o.y)*(a.x-o.x))return!1;for(V=0;V<r;V++)if(V!==t&&V!==e&&V!==n&&g(o,s,a,f[i[V]]))return!1;return!0}if(r=f.length,t.clockWise)for(e=0;e<r;e++)d[e]=e;else for(e=0;e<r;e++)d[e]=r-1-e;for(V=2*(i=r),e=i-1;i>2;){if(V--<=0)return p;if(i<=(o=e)&&(o=0),i<=(e=o+1)&&(e=0),i<(s=e+1)&&(s=0),v(o,e,s,i,d)){for(a=d[o],c=d[e],u=d[s],t.clockWise?(p.push(f[a]),p.push(f[c]),p.push(f[u])):(p.push(f[u]),p.push(f[c]),p.push(f[a])),h=e,l=e+1;l<i;h++,l++)d[h]=d[l];V=2*--i}}n.indices=p}for(e=function(t){return t&&t.length&&Array.isArray(t)?Array.isArray(t[0])?Array.isArray(t[0])&&!isNaN(t[0][0])?[t]:t:[t]:[]}(t),r=0;r<e.length;r++){for(t=e[r],s=null,n={vertices:[],edges:[]},i=0;i<t.length;i++)"object"!=typeof(V=t[i])||isNaN(V.x)||isNaN(V.y)?V.length>=2&&!isNaN(V[0])&&!isNaN(V[1])&&(o={x:V[0],y:V[1],id:c.length}):o={x:V.x,y:V.y,id:c.length},o&&(s?(s.next=o,o.prev=s,o.next=n.vertices[0],n.vertices[0].prev=o):(n.head=o,o.next=o,o.prev=o),c.push(o),n.vertices.push(o),s=o);if(n.vertices.length>2)for(3===n.vertices.length&&(n.simple=!0),a.push(n),i=0;i<n.vertices.length;i++)o=n.vertices[i],n.edges.push([o,o.next])}for(r=a.length-1;r>=0;r--)h(n=a[r]);for(r=0;r<a.length;r++)(n=a[r]).clockWise=l(n),f(n);for(u.vertices=[],u.coords=[],r=0;r<c.length;r++)V=c[r],u.vertices.push(2*V.x-1),u.vertices.push(-2*V.y+1),u.vertices.push(-1),u.coords.push(V.x),u.coords.push(-1*V.y+1);for(u.vertices=new Float32Array(u.vertices),u.coords=new Float32Array(u.coords),u.indices=[],r=0;r<a.length;r++)for(n=a[r],i=0;i<n.indices.length;i++)V=n.indices[i],u.indices.push(V.id);u.indices=new Uint16Array(u.indices),this.shape=u,this.gl&&st(u,this.gl)},y.prototype.destroy=function(){var t,e,n,r=this.hook;for(e in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,it[r]&&(it[r].count--,it[r].count||delete it[r]),this.shader&&this.shader.destroy&&this.shader!==V&&!it[r]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(e)&&((n=this.inputElements[e]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(e in this.sources)this.sources.hasOwnProperty(e)&&((n=this.sources[e])&&n.removeTarget&&n.removeTarget(this),delete this.sources[e]);for(;this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(e in this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];for(e in tt)tt.hasOwnProperty(e)&&(n=tt[e]).node===this&&N.removeAlias(e);(t=J.indexOf(this))>=0&&J.splice(t,1),(t=p[r].indexOf(this))>=0&&p[r].splice(t,1),s.prototype.destroy.call(this)},x=function(t){var e=t;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return e.source}},id:{enumerable:!0,configurable:!0,get:function(){return e.id}},width:{enumerable:!0,configurable:!0,get:function(){return e.width}},height:{enumerable:!0,configurable:!0,get:function(){return e.height}}}),this.render=function(){e.render()},this.update=function(){e.setDirty()},this.readPixels=function(t,n,r,i,V){return e.readPixels(t,n,r,i,V)},this.on=function(t,n){e.on(t,n)},this.off=function(t,n){e.off(t,n)},this.destroy=function(){var t,n;for(t in e.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((n=Object.getOwnPropertyDescriptor(this,t)).get||n.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return e.isDestroyed},this.isReady=function(){return e.ready}},(d=function(t,e,r){var i,V,o=r||{},a=void 0===o.flip||o.flip,c=o.width,u=o.height,h=!1,f=this,d=!1;function p(t,e,n,r){var i=l[t];if(i.definition){if(!(i=i.definition.call(f,e,n,r)))return null;i=L(L({},l[t]),i)}return i}function g(t){return f.source===t}if(s.call(this),(t&&"string"!=typeof t||!e&&0!==e)&&(r&&"object"==typeof r||(r=e),e=t),"string"==typeof e&&isNaN(e)&&(e=j(e,["canvas","img","video"])),"string"==typeof t&&l[t]&&(V=p(t,e,r,!0))&&(this.hook=t,d=!0,h=V.deferTexture,this.plugin=V,this.compare=V.compare,this.checkDirty=V.checkDirty,V.source&&(e=V.source)),!V&&F(e))"CANVAS"===e.tagName?(this.width=e.width,this.height=e.height,this.render=this.renderImageCanvas,d=!0,this.hook="canvas",this.compare=g):"IMG"===e.tagName&&(this.width=e.naturalWidth||1,this.height=e.naturalHeight||1,e.complete&&e.naturalWidth||(h=!0),e.addEventListener("load",(function(){f.isDestroyed||(f.width===e.naturalWidth&&f.height===e.naturalHeight||(f.width=e.naturalWidth,f.height=e.naturalHeight,f.resize()),f.setDirty(),f.setReady())}),!0),this.render=this.renderImageCanvas,d=!0,this.hook="image",this.compare=g);else if(!V&&F(e,"WebGLTexture")){if(n&&!n.isTexture(e))throw new Error("Not a valid WebGL texture.");isNaN(c)?isNaN(u)||(c=u):isNaN(u)&&(u=c),this.width=c,this.height=u,void 0===o.flip&&(a=!1),d=!0,this.texture=e,this.initialized=!0,this.hook="texture",this.compare=g,this.render=function(){}}if(!d&&!V)for(i in l)if(l.hasOwnProperty(i)&&l[i]&&(V=p(i,e,r,!1))){this.hook=i,d=!0,h=V.deferTexture,this.plugin=V,this.compare=V.compare,this.checkDirty=V.checkDirty,V.source&&(e=V.source);break}if(!d)throw new Error("Unknown source type");this.source=e,void 0===this.flip&&(this.flip=a),this.targets=[],h||f.setReady(),this.pub=new x(this),U.push(this),B[this.id]=this,G.push(this),v[this.hook].push(this),G.length&&!k&&lt()}).prototype=Object.create(s.prototype),d.prototype.constructor=d,d.prototype.initialize=function(){var t;n&&!this.texture&&this.ready&&(t=n.createTexture(),n.bindTexture(n.TEXTURE_2D,t),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.bindTexture(n.TEXTURE_2D,null),this.texture=t,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},d.prototype.initFrameBuffer=function(t){n&&(this.frameBuffer=new $(n,this.width,this.height,{texture:this.texture,useFloat:t}))},d.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},d.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1)},d.prototype.resize=function(){var t,e;if(this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.framebuffer&&this.framebuffer.resize(this.width,this.height),this.emit("resize"),this.setDirty(),this.targets)for(t=0;t<this.targets.length;t++)(e=this.targets[t]).resize(),e.setTransformDirty&&e.setTransformDirty()},d.prototype.setReady=function(){var t;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setReady()},d.prototype.render=function(){var t=this.source;n&&(t||0===t)&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.plugin&&this.plugin.render&&(this.dirty||this.checkDirty&&this.checkDirty())&&this.plugin.render.call(this,n,ft,i,V)&&(this.dirty=!1,this.emit("render")))},d.prototype.renderImageCanvas=function(){var t=this.source;if(n&&t&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.dirty)){n.bindTexture(n.TEXTURE_2D,this.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{return n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.dirty=!1,this.emit("render"),!0}catch(t){t.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},d.prototype.destroy=function(){var t,e,r;for(this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),n&&this.texture&&n.deleteTexture(this.texture);this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(e in(t=G.indexOf(this))>=0&&G.splice(t,1),(t=v[this.hook].indexOf(this))>=0&&v[this.hook].splice(t,1),this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];s.prototype.destroy.call(this)},E=function(t){var e=t;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(e.source)return e.source.pub},set:function(t){e.setSource(t)}},original:{enumerable:!0,configurable:!0,get:function(){return e.target}},width:{enumerable:!0,configurable:!0,get:function(){return e.width},set:function(t){!isNaN(t)&&t>0&&e.width!==t&&(e.width=t,e.resize(),e.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return e.height},set:function(t){!isNaN(t)&&t>0&&e.height!==t&&(e.height=t,e.resize(),e.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return e.id}}}),this.render=function(){e.render()},this.readPixels=function(t,n,r,i,V){return e.readPixels(t,n,r,i,V)},this.on=function(t,n){e.on(t,n)},this.off=function(t,n){e.off(t,n)},this.go=function(t){e.go(t)},this.stop=function(){e.stop()},this.getTexture=function(){return e.frameBuffer.texture},this.destroy=function(){var t,n;for(t in e.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((n=Object.getOwnPropertyDescriptor(this,t)).get||n.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.inputs=function(t){return{source:{type:"image"}}},this.isDestroyed=function(){return e.isDestroyed},this.isReady=function(){return e.ready}},((A=function(t,e,o){var u,h,l,d,p,g,v,y,b,w=this,A=!1;function S(t,e,r,o){var s=f[t];if(s.definition){if(!(s=s.definition.call(w,e,r,o)))return null;s=L(L({},f[t]),s),w.hook=b,A=!0,w.plugin=s,w.compare=s.compare,s.target&&(e=s.target),s.gl&&!w.gl&&(w.gl=s.gl,n||ct(s.gl)),w.gl===n&&(w.model=i,w.shader=V)}return s}if(s.call(this),(t&&"string"!=typeof t||!e&&0!==e)&&(o&&"object"==typeof o||(o=e),e=t),h=void 0===(u=o||{}).flip||u.flip,l=parseInt(u.width,10),d=parseInt(u.height,10),g=u.debugContext,"string"==typeof t&&f[t]&&S(t,e,u,!0),this.renderToTexture=u.renderToTexture,F(e,"WebGLFramebuffer"))if(v=e,F(u,"HTMLCanvasElement"))e=u;else if(F(u,"WebGLRenderingContext"))e=u.canvas;else if(F(u.canvas,"HTMLCanvasElement"))e=u.canvas;else{if(!F(u.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");e=u.context.canvas}if(F(e,"HTMLCanvasElement")){if(l=e.width,d=e.height,(!n||n.canvas!==e&&u.allowSecondaryWebGL)&&(p=H(e,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:g})),p)n&&n!==p?(this.gl=p,this.frameBuffer={frameBuffer:v||null},this.shader=new Q(this.gl,a,c),this.model=at.call(this,this.gl),this.pixels=null,this.texture=this.gl.createTexture(),this.gl.bindTexture(n.TEXTURE_2D,this.texture),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),this.render=this.renderSecondaryWebGL):(r||(r=this),n||ct(p),this.render=this.renderWebGL,u.renderToTexture?n&&(this.frameBuffer=new $(n,l,d,!1)):this.frameBuffer={frameBuffer:v||null});else{if(!u.allowSecondaryWebGL&&n&&n.canvas!==e)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=_,X.logger.log("Unable to create WebGL context.")}A=!0}if(!A)for(b in f)if(f.hasOwnProperty(b)&&f[b]&&S(b,e,u,!1))break;if(!A)throw new Error("Unknown target type");m&&((y=m.get(e))?X.logger.warn("Target already in use by another instance",e,Object.keys(y).map((function(t){return y[t]}))):(y={},m.set(e,y)),y[N.id]=N),this.target=e,this.transform=null,this.transformDirty=!0,this.flip=h,l&&(this.width=l),d&&(this.height=d),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==u.auto?this.auto=u.auto:this.auto=Vt,this.frames=0,this.pub=new E(this),U.push(this),B[this.id]=this,Z.push(this)}).prototype=Object.create(s.prototype)).constructor=A,A.prototype.setSource=function(t){var e;(e=dt(t))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=e,e.addTarget(this),e&&(this.resize(),e.ready?this.setReady():this.setUnready()),this.setDirty())},A.prototype.setDirty=function(){this.dirty=!0,this.auto&&!k&&(k=O(lt))},A.prototype.resize=function(){F(this.target,"HTMLCanvasElement")?this.width===this.target.width&&this.height===this.target.height||(this.target.width=this.width,this.target.height=this.height,this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.emit("resize"),this.setTransformDirty()):this.plugin&&this.plugin.resize&&this.plugin.resize.call(this),!this.source||this.source.width===this.width&&this.source.height===this.height||this.transform||(this.transform=new Float32Array(16))},A.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},A.prototype.go=function(){this.auto=!0,this.setDirty()},A.prototype.stop=function(){this.auto=!1},A.prototype.render=function(){n&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,ft,V,i)},A.prototype.renderWebGL=function(){var t,e,r;if(this.resize(),n&&this.dirty&&this.ready){if(!this.source)return;this.source.render(),this.uniforms.source=this.source.texture,this.source.width===this.width&&this.source.height===this.height?this.uniforms.transform=this.source.cumulativeMatrix||o:this.transformDirty&&(t=this.transform,M.copy(t,this.source.cumulativeMatrix||o),e=this.source.width/this.width,r=this.source.height/this.height,t[0]*=e,t[1]*=e,t[2]*=e,t[3]*=e,t[4]*=r,t[5]*=r,t[6]*=r,t[7]*=r,this.uniforms.transform=t,this.transformDirty=!1),ft(V,i,this.uniforms,this.frameBuffer.frameBuffer,this,C),this.emit("render"),this.dirty=!1}},A.prototype.renderSecondaryWebGL=function(){var t,e,n,r,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),t=this.source.width,e=this.source.height,this.pixels&&this.pixels.length===t*e*4||(this.pixels=new Uint8Array(t*e*4)),this.source.readPixels(0,0,t,e,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),t===this.width&&e===this.height?this.uniforms.transform=o:this.transformDirty&&(n=this.transform,M.copy(n,o),r=this.source.width/this.width,i=this.source.height/this.height,n[0]*=r,n[1]*=r,n[2]*=r,n[3]*=r,n[4]*=i,n[5]*=i,n[6]*=i,n[7]*=i,this.uniforms.transform=n,this.transformDirty=!1),this.uniforms.source=this.texture,ft(this.shader,this.model,this.uniforms,null,this,C),this.dirty=!1)},A.prototype.removeSource=function(t){this.source!==t&&this.source!==t.pub||(this.source=null)},A.prototype.destroy=function(){var t,n;this.source&&this.source.removeTarget&&this.source.removeTarget(this),m&&(delete(n=m.get(this.target))[N.id],Object.keys(n).length||m.delete(this.target)),this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),delete this.source,delete this.target,delete this.pub,delete this.uniforms,delete this.pixels,delete this.auto,(t=Z.indexOf(this))>=0&&Z.splice(t,1),s.prototype.destroy.call(this),this===r&&(e.removeEventListener("webglcontextrestored",ut,!1),ht(),r=null)},T=function(t){var e,n=t,r=this;function i(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){return e.get.call(n)},set:function(r){!function(t,e,r){var i,V,o;i=n.inputElements[t],"string"==typeof r&&isNaN(r)&&("enum"===e.type?e.options.hasOwnProperty(r)||(r=j(r,["select"])):"number"===e.type||"boolean"===e.type?r=j(r,["input","select"]):"image"===e.type&&(r=j(r,["canvas","img","video"]))),F(r,"HTMLInputElement")||F(r,"HTMLSelectElement")?(V=r.value,i&&i.element!==r&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[t],i=null),i||(i={element:r,listener:(o=r,function(){var e,i;e="checkbox"===r.type?r.checked:o.value,i=n.setInput(t,e),"color"===r.type&&(i=W(i)),i!==e&&(o.value=i)})},n.inputElements[t]=i,"range"===r.type?(r.addEventListener("input",i.listener,!0),r.addEventListener("change",i.listener,!0)):r.addEventListener("change",i.listener,!0)),i&&"checkbox"===r.type&&(V=r.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[t]),V=r),n.setInput(t,V)}(t,e,r)}})}function V(t){return function(){t.apply(n,arguments)&&n.setTransformDirty()}}for(e in Object.defineProperties(this,{transform:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.plugin.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}},source:{enumerable:!0,configurable:!0,get:function(){return n.source&&n.source.pub},set:function(t){n.setSource(t)}}}),n.methods)n.methods.hasOwnProperty(e)&&(this[e]=V(n.methods[e]));for(e in n.inputs)n.inputs.hasOwnProperty(e)&&i(e,n.inputs[e]);this.update=function(){n.setDirty()},this.inputs=function(t){var e,r,i,V;if(i=n.plugin.inputs,t)return!(r=i[t])||r.method?null:(e={type:r.type,defaultValue:r.defaultValue,title:r.title||t},"number"===r.type?(e.min=r.min,e.max=r.max,e.step=r.step,e.mod=r.mod):"enum"===r.type?e.options=L({},r.options):"vector"===r.type&&(e.dimensions=r.dimensions),r.description&&(e.description=r.description),e);for(V in e={},i)i.hasOwnProperty(V)&&!i[V].method&&(e[V]=this.inputs(V));return e},this.alias=function(t,e){return n.alias(t,e),this},this.on=function(t,e){n.on(t,e)},this.off=function(t,e){n.off(t,e)},this.destroy=function(){var t,e;for(t in n.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(w=function(t,e){var n,r,i,V,o;for(n in this.matrix=new Float32Array(16),this.cumulativeMatrix=new Float32Array(16),this.ready=!1,this.width=1,this.height=1,this.seriously=N,this.transformRef=h[t],this.hook=t,this.id=z,z++,this.options=e,this.sources=null,this.targets=[],this.inputElements={},this.inputs={},this.methods={},this.listeners={},this.texture=null,this.frameBuffer=null,this.uniforms=null,this.dirty=!0,this.transformDirty=!0,this.renderDirty=!1,this.isDestroyed=!1,this.transformed=!1,this.plugin=L({},this.transformRef),this.transformRef.definition&&L(this.plugin,this.transformRef.definition.call(this,e)),this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&((r=this.plugin.inputs[n]).method&&"function"==typeof r.method?this.methods[n]=r.method:"function"==typeof r.set&&"function"==typeof r.get&&(this.inputs[n]=r));for(n in Y(this.plugin),o=rt[t],this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&"function"==typeof(r=this.plugin.inputs[n]).set&&"function"==typeof r.get&&"function"!=typeof r.method&&(i=r.get.call(this),V=void 0===r.defaultValue?i:r.defaultValue,V=r.validate.call(this,V,r,i),o&&void 0!==o[n]&&(V=r.validate.call(this,o[n],r,r.defaultValue,V),o[n]=V),V!==i&&r.set.call(this,V));U.push(this),B[this.id]=this,this.pub=new T(this),K.push(this),g[t].push(this)}).prototype=Object.create(s.prototype),w.prototype.constructor=w,w.prototype.setDirty=function(){this.renderDirty=!0,s.prototype.setDirty.call(this)},w.prototype.setTransformDirty=function(){var t,e;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,t=0;t<this.targets.length;t++)(e=this.targets[t]).setTransformDirty?e.setTransformDirty():e.setDirty()},w.prototype.resize=function(){var t;for(s.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),t=0;t<this.targets.length;t++)this.targets[t].resize();this.setTransformDirty()},w.prototype.setSource=function(t){var e;if((e=dt(t))!==this.source){if(pt(e,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=e,e.addTarget(this),e&&e.ready?this.setReady():this.setUnready(),this.resize()}},w.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},w.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1),this.targets&&this.targets.length&&this.resize()},w.prototype.setInput=function(t,e){var n,r,i;if(this.plugin.inputs.hasOwnProperty(t))return n=this.plugin.inputs[t],r=rt[this.hook]&&void 0!==rt[this.hook][t]?rt[this.hook][t]:n.defaultValue,i=n.get.call(this),void 0===r&&(r=i),e=n.validate.call(this,e,n,r,i),n.set.call(this,e)&&this.setTransformDirty(),n.get.call(this)},w.prototype.alias=function(t,e){var n,r,i=this;if(D.indexOf(e)>=0)throw new Error("'"+e+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(t)&&(e||(e=t),N.removeAlias(e),(n=this.inputs[t])?(r=i.inputs[t],Object.defineProperty(N,e,{configurable:!0,enumerable:!0,get:function(){return r.get.call(i)},set:function(t){r.set.call(i,t)&&i.setTransformDirty()}})):(n=this.methods[t])&&(r=n,N[e]=function(){r.apply(i,arguments)&&i.setTransformDirty()}),n&&(tt[e]={node:this,input:t})),this},w.prototype.render=function(t){return this.source?(this.source.render(),this.transformDirty&&(this.transformed?this.source.cumulativeMatrix?M.multiply(this.cumulativeMatrix,this.matrix,this.source.cumulativeMatrix):M.copy(this.cumulativeMatrix,this.matrix):M.copy(this.cumulativeMatrix,this.source.cumulativeMatrix||o),this.transformDirty=!1),t&&n?(this.renderDirty&&(this.frameBuffer||(this.uniforms={resolution:[this.width,this.height]},this.frameBuffer=new $(n,this.width,this.height)),this.uniforms.source=this.source.texture,this.uniforms.transform=this.cumulativeMatrix||o,ft(V,i,this.uniforms,this.frameBuffer.frameBuffer,this),this.renderDirty=!1),this.texture=this.frameBuffer.texture):this.source?this.texture=this.source.texture:this.texture=null,this.dirty=!1,this.texture):(this.transformDirty&&(M.copy(this.cumulativeMatrix,this.matrix),this.transformDirty=!1),this.texture=null,void(this.dirty=!1))},w.prototype.readPixels=function(t,e,r,i,V){var o=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===V)V=new Uint8Array(r*i*4);else if(!F(V,"Uint8Array"))throw new Error("Incompatible array type");return o.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),o.readPixels(t,e,r,i,n.RGBA,n.UNSIGNED_BYTE,V),V},w.prototype.destroy=function(){var t,e,n,r=this.hook;for(t in this.plugin.destroy&&"function"==typeof this.plugin.destroy&&this.plugin.destroy.call(this),delete this.effect,this.frameBuffer&&(this.frameBuffer.destroy(),delete this.frameBuffer,delete this.texture),this.inputElements)this.inputElements.hasOwnProperty(t)&&((n=this.inputElements[t]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(this.source&&this.source.removeTarget(this);this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(e in this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];for(e in tt)tt.hasOwnProperty(e)&&(n=tt[e]).node===this&&N.removeAlias(e);(t=K.indexOf(this))>=0&&K.splice(t,1),(t=g[r].indexOf(this))>=0&&g[r].splice(t,1),s.prototype.destroy.call(this)},w.prototype.setReady=s.prototype.setReady,w.prototype.setUnready=s.prototype.setUnready,w.prototype.on=s.prototype.on,w.prototype.off=s.prototype.off,w.prototype.emit=s.prototype.emit,(t=F(t,"HTMLCanvasElement")?{canvas:t}:t||{}).canvas,this.effect=function(t,e){if(!u[t])throw new Error("Unknown effect: "+t);return new y(t,e).pub},this.source=function(t,e,n){return dt(t,e,n).pub},this.transform=function(e,n){if("string"!=typeof e&&(n=e,e=!1),e){if(!h[e])throw new Error("Unknown transform: "+e)}else if(e=t&&t.defaultTransform||"2d",!h[e])throw new Error("No transform specified");return new w(e,n).pub},this.target=function(t,e,n){var r,i,V;for(t&&"string"==typeof t&&!f[t]&&(i=document.querySelector(t)),("string"!=typeof t||!e&&0!==e||i)&&(n&&"object"==typeof n||(n=e),e=i||t,t=null),"string"==typeof e&&isNaN(e)&&(e=document.querySelector(e)),V=0;V<Z.length;V++)if(r=Z[V],(!t||t===r.hook)&&(r.target===e||r.compare&&r.compare(e,n)))return r.pub;return(r=new A(t,e,n)).pub},this.aliases=function(){return Object.keys(tt)},this.removeAlias=function(t){tt[t]&&(delete this[t],delete tt[t])},this.defaults=function(t,e){var n;if(t)if("object"!=typeof t)null===e?delete rt[t]:"object"==typeof e&&(rt[t]=L({},e));else for(n in t)t.hasOwnProperty(n)&&this.defaults(n,t[n]);else if(null===t)for(n in rt)rt.hasOwnProperty(n)&&delete rt[n]},this.go=function(t,e){var n;for("function"==typeof t&&et.indexOf(t)<0&&et.push(t),"function"==typeof e&&nt.indexOf(e)<0&&nt.push(e),Vt=!0,n=0;n<Z.length;n++)Z[n].go();k||!et.length&&!nt.length||lt()},this.stop=function(){et.length=0,nt.length=0,P(k),k=0},this.render=function(){var e;for(e=0;e<Z.length;e++)Z[e].render(t)},this.destroy=function(){for(var t,e;U.length;)U[0].pub.destroy();for(t in this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_);N=null,G=[],Z=[],J=[],U=[],et.length=0,nt.length=0,P(k),k=0,ot=!0},this.isDestroyed=function(){return ot},this.incompatible=function(t){var e,n,r;if(r=X.incompatible(t))return r;if(!t){for(e in p)if(p.hasOwnProperty(e)&&p[e].length&&(n=u[e])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"plugin-"+e;for(e in v)if(v.hasOwnProperty(e)&&v[e].length&&(n=l[e])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"source-"+e}return!1},this.isNode=function(t){var e;return!(!t||!(e=B[t.id])||e.isDestroyed)},this.isSource=function(t){return this.isNode(t)&&t instanceof x},this.isEffect=function(t){return this.isNode(t)&&t instanceof S},this.isTransform=function(t){return this.isNode(t)&&t instanceof T},this.isTarget=function(t){return this.isNode(t)&&t instanceof E},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return I}}}),this.defaults(t.defaults)}window.addEventListener("message",(function(t){t.source===window&&"seriously-timeout-message"===t.data&&(t.stopPropagation(),d.length>0&&d.shift()())}),!0),$.prototype.resize=function(t,e){var n=this.gl;this.width===t&&this.height===e||(this.width=t,this.height=e,n&&(n.bindTexture(n.TEXTURE_2D,this.texture),n.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer),n.bindRenderbuffer(n.RENDERBUFFER,this.renderBuffer),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t,e,0,n.RGBA,n.UNSIGNED_BYTE,null),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t,e),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.texture,0),n.bindTexture(n.TEXTURE_2D,null),n.bindRenderbuffer(n.RENDERBUFFER,null),n.bindFramebuffer(n.FRAMEBUFFER,null)))},$.prototype.destroy=function(){var t=this.gl;t&&(t.deleteFramebuffer(this.frameBuffer),t.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&t.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},Q.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(t){var e,n,r;if(void 0===V&&((e=document.createElement("canvas"))&&e.getContext?window.WebGLRenderingContext?(n=G())||(V="context"):V="webgl":V="canvas"),V)return V;if(t){if((r=u[t])&&"function"==typeof r.compatible&&!r.compatible(n))return"plugin-"+t;if((r=l[t])&&"function"==typeof r.compatible&&!r.compatible(n))return"source-"+t}return!1},X.plugin=function(t,e,n){var r;if(u[t])X.logger.warn("Effect ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n)return r=L({},n),"function"==typeof e&&(r.definition=e),r.reserved=k,r.inputs&&Y(r),r.title||(r.title=t),u[t]=r,p[t]=[],r},X.removePlugin=function(t){var e;if(!t)return this;if(!u[t])return this;if(e=p[t]){for(;e.length;)e.shift().destroy();delete p[t]}return delete u[t],this},X.source=function(t,e,n){var r;if(l[t])X.logger.warn("Source ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.title||(r.title=t),l[t]=r,v[t]=[],r},X.removeSource=function(t){var e;if(!t)return this;if(!l[t])return this;if(e=v[t]){for(;e.length;)e.shift().destroy();delete v[t]}return delete l[t],this},X.transform=function(t,e,n){var r;if(h[t])X.logger.warn("Transform ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.reserved=I,r.inputs&&Y(r),r.title||(r.title=t),h[t]=r,g[t]=[],r},X.removeTransform=function(t){var e;if(!t)return this;if(!h[t])return this;if(e=g[t]){for(;e.length;)e.shift().destroy();delete g[t]}return delete h[t],this},X.target=function(t,e,n){var r;if(f[t])X.logger.warn("Target ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.title||(r.title=t),f[t]=r,y[t]=[],r},X.removeTarget=function(t){var e;if(!t)return this;if(!f[t])return this;if(e=y[t]){for(;e.length;)e.shift().destroy();delete y[t]}return delete f[t],this},X.inputValidators={color:function(t,e,n,r){var V,o,s,a;if(o=r||[],"string"==typeof t){if((s=A.exec(t))&&s.length){if(s.length<3)return o[0]=o[1]=o[2]=o[3]=0,o;for(o[3]=1,a=0;a<3;a++)o[a]=parseFloat(s[a+2])/255;return isNaN(s[6])||(o[3]=parseFloat(s[6])),"hsl"===s[1].toLowerCase()?B(o[0],o[1],o[2],o[3],o):o}if((s=S.exec(t))&&s.length)return 3===(V=s[1]).length?(o[0]=parseInt(V[0],16)/15,o[1]=parseInt(V[1],16)/15,o[2]=parseInt(V[2],16)/15,o[3]=1):4===V.length?(o[0]=parseInt(V[0],16)/15,o[1]=parseInt(V[1],16)/15,o[2]=parseInt(V[2],16)/15,o[3]=parseInt(V[3],16)/15):6===V.length?(o[0]=parseInt(V.substr(0,2),16)/255,o[1]=parseInt(V.substr(2,2),16)/255,o[2]=parseInt(V.substr(4,2),16)/255,o[3]=1):8===V.length?(o[0]=parseInt(V.substr(0,2),16)/255,o[1]=parseInt(V.substr(2,2),16)/255,o[2]=parseInt(V.substr(4,2),16)/255,o[3]=parseInt(V.substr(6,2),16)/255):o[0]=o[1]=o[2]=o[3]=0,o;if(s=w[t.toLowerCase()]){for(a=0;a<4;a++)o[a]=s[a];return o}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=t,(V=i.fillStyle)&&"#000000"!==V?X.inputValidators.color(V,e,n,r):(o[0]=o[1]=o[2]=o[3]=0,o)}if(z(t)){if((o=t).length<3)return o[0]=o[1]=o[2]=o[3]=0,o;for(a=0;a<3;a++)if(isNaN(o[a]))return o[0]=o[1]=o[2]=o[3]=0,o;return o.length<4&&o.push(1),o}if("number"==typeof t)return o[0]=o[1]=o[2]=t,o[3]=1,o;if("object"==typeof t){for(a=0;a<4;a++)null===t[V=T[a]]||isNaN(t[V])?o[a]=3===a?1:0:o[a]=t[V];return o}return o[0]=o[1]=o[2]=o[3]=0,o},number:function(t,e,n){return t=parseFloat(t),isNaN(t)?n||0:(e.mod&&(t-=e.mod*Math.floor(t/e.mod)),t<e.min?e.min:t>e.max?e.max:e.step?Math.round(t/e.step)*e.step:t)},enum:function(t,e,n){var r=e.options||[];return"string"==typeof t?t=t.toLowerCase():"number"==typeof t?t=t.toString():t||(t=""),r.hasOwnProperty(t)?t:n||""},vector:function(t,e,n,r){var i,V,o,s=e.dimensions||4;if(i=r||[],z(t)){for(V=0;V<s;V++)i[V]=t[V]||0;return i}if("object"==typeof t){for(V=0;V<s;V++)void 0===t[o=x[V]]&&(o=T[V]),i[V]=t[o]||0;return i}for(t=parseFloat(t)||0,V=0;V<s;V++)i[V]=t;return i},boolean:function(t){return!!t&&(!t||!t.toLowerCase||"false"!==t.toLowerCase())},string:function(t){return"string"==typeof t?t:0===t||t?t.toString?t.toString():String(t):""}},X.prototype.effects=X.effects=function(){var t,e,n,r,i,V={};for(t in u)if(u.hasOwnProperty(t)){for(i in n={title:(e=u[t]).title||t,description:e.description||"",inputs:{}},e.inputs)e.inputs.hasOwnProperty(i)&&(r=e.inputs[i],n.inputs[i]={type:r.type,defaultValue:r.defaultValue,step:r.step,min:r.min,max:r.max,mod:r.mod,minCount:r.minCount,maxCount:r.maxCount,dimensions:r.dimensions,title:r.title||i,description:r.description||"",options:r.options||[]});V[t]=n}return V},window.Float32Array&&(o=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),window.Seriously&&"object"==typeof window.Seriously&&function(){var t;for(t in window.Seriously)window.Seriously.hasOwnProperty(t)&&"plugin"!==t&&"object"==typeof window.Seriously[t]&&X.plugin(t,window.Seriously[t])}(),X.logger={log:U("log"),info:U("info"),warn:U("warn"),error:U("error")},X.util={mat4:M,checkSource:function(t){var e,n,r,i;if(!(e=j(t,["img","canvas","video"])))return!1;if(!(n=document.createElement("canvas")))return X.logger.warn("Browser does not support canvas or Seriously.js"),!1;if(0===e.naturalWidth&&"IMG"===e.tagName)return X.logger.warn("Image not loaded"),!1;if(0===e.readyState&&0===e.videoWidth&&"VIDEO"===e.tagName)return X.logger.warn("Video not loaded"),!1;if(r=G()){(i=r.createTexture())||X.logger.error("Test WebGL context has been lost"),r.bindTexture(r.TEXTURE_2D,i);try{r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)}catch(t){return t.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+t.message),r.deleteTexture(i),!1}r.deleteTexture(i)}else{r=n.getContext("2d");try{r.drawImage(e,0,0),r.getImageData(0,0,1,1)}catch(t){return t.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+t.message),!1}}return!0},hslToRgb:B,colors:w,setTimeoutZero:q,ShaderProgram:Q,FrameBuffer:$,requestAnimationFrame:O,shader:{makeNoise:"float makeNoise(float u, float v, float timer) {\n\tfloat x = u * v * mod(timer * 1000.0, 100.0);\n\tx = mod(x, 13.0) * mod(x, 127.0);\n\tfloat dx = mod(x, 0.01);\n\treturn clamp(0.1 + dx * 100.0, 0.0, 1.0);\n}\n",random:"#ifndef RANDOM\n#define RANDOM\nfloat random(vec2 n) {\n\treturn 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n#endif\n"}},X.source("video",(function(t,e,n){var r,i,V=this,o=!1,a=!1,c=!1,u=0;function h(){t.removeEventListener("loadedmetadata",h,!0),o||(t.videoWidth?(V.width===t.videoWidth&&V.height===t.videoHeight||(V.width=t.videoWidth,V.height=t.videoHeight,V.resize()),a&&V.setReady()):(a=!0,setTimeout(h,50)))}function l(){c=!0}function f(){c=!1,V.setDirty()}if(F(t,"HTMLVideoElement"))return t.readyState?h():(a=!0,t.addEventListener("loadedmetadata",h,!0)),t.addEventListener("seeking",l,!1),t.addEventListener("seeked",f,!1),{deferTexture:a,source:t,render:function e(n){var o;if(u=t.currentTime,!t.videoHeight||!t.videoWidth)return!1;s?(i||(i=document.createElement("canvas").getContext("2d"),(r=i.canvas).width=V.width,r.height=V.height),o=r,i.drawImage(t,0,0,V.width,V.height)):o=t,n.bindTexture(n.TEXTURE_2D,V.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,V.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,o),void 0===s){if(n.getError()===n.INVALID_VALUE)return s=!0,e(n);s=!1}return!0}catch(t){t.code===window.DOMException.SECURITY_ERR?(V.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",t)}return!1},checkDirty:function(){return!c&&t.currentTime!==u},compare:function(t){return V.source===t},destroy:function(){o=!0,t.removeEventListener("seeking",l,!1),t.removeEventListener("seeked",f,!1),t.removeEventListener("loadedmetadata",h,!0)}}}),{title:"Video"}),X.transform("2d",(function(t){var e=this,n=!(t&&t.radians),r=0,i=0,V=1,o=1,s=0,a=0,c=0,u=0,h=0;function l(){var t,l,f,d,p,g,v,y,m,b,_,w=e.matrix;function A(t,e){w[12]=w[0]*t+w[4]*e+w[12],w[13]=w[1]*t+w[5]*e+w[13],w[14]=w[2]*t+w[6]*e+w[14],w[15]=w[3]*t+w[7]*e+w[15]}s||a||c||u||h||1!==V||1!==o?(M.identity(w),A(s+r,a+i),u&&(w[4]=u/e.width),h&&(w[1]=h/e.height),c&&(d=w[0],p=w[1],g=w[2],v=w[3],y=w[4],m=w[5],b=w[6],_=w[7],t=-(n?c*Math.PI/180:c),l=Math.sin(t),f=Math.cos(t),w[0]=d*f+y*l,w[1]=p*f+m*l,w[2]=g*f+b*l,w[3]=v*f+_*l,w[4]=y*f-d*l,w[5]=m*f-p*l,w[6]=b*f-g*l,w[7]=_*f-v*l),1!==V&&(w[0]*=V,w[1]*=V,w[2]*=V,w[3]*=V),1!==o&&(w[4]*=o,w[5]*=o,w[6]*=o,w[7]*=o),A(-r,-i),e.transformed=!0):e.transformed=!1}return{inputs:{reset:{method:function(){return r=0,i=0,V=1,o=1,s=0,a=0,c=0,u=0,h=0,!!e.transformed&&(e.transformed=!1,!0)}},translate:{method:function(t,e){return isNaN(t)&&(t=s),isNaN(e)&&(e=a),(t!==s||e!==a)&&(s=t,a=e,l(),!0)},type:["number","number"]},translateX:{get:function(){return s},set:function(t){return t!==s&&(s=t,l(),!0)},type:"number"},translateY:{get:function(){return a},set:function(t){return t!==a&&(a=t,l(),!0)},type:"number"},rotation:{get:function(){return c},set:function(t){return t!==c&&(c=parseFloat(t),l(),!0)},type:"number"},center:{method:function(t,e){return isNaN(t)&&(t=r),isNaN(e)&&(e=i),(t!==r||e!==i)&&(r=t,i=e,l(),!0)},type:["number","number"]},centerX:{get:function(){return r},set:function(t){return t!==r&&(r=t,l(),!0)},type:"number"},centerY:{get:function(){return i},set:function(t){return t!==i&&(i=t,l(),!0)},type:"number"},skew:{method:function(t,e){return isNaN(t)&&(t=u),isNaN(e)&&(e=h),(t!==u||e!==h)&&(u=t,h=e,l(),!0)},type:["number","number"]},skewX:{get:function(){return u},set:function(t){return t!==u&&(u=t,l(),!0)},type:"number"},skewY:{get:function(){return h},set:function(t){return t!==h&&(h=t,l(),!0)},type:"number"},scale:{method:function(t,e){var n,r;if(n=isNaN(t)?V:t,isNaN(e)){if(isNaN(t))return!1;r=n}else r=e;return(n!==V||r!==o)&&(V=n,o=r,l(),!0)},type:["number","number"]},scaleX:{get:function(){return V},set:function(t){return t!==V&&(V=t,l(),!0)},type:"number"},scaleY:{get:function(){return o},set:function(t){return t!==o&&(o=t,l(),!0)},type:"number"}}}}),{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",(function(){var t=this,e=!0;function n(){var n=t.matrix;e?(n[0]=-1,n[5]=1):(n[0]=1,n[5]=-1)}return M.identity(t.matrix),n(),t.transformDirty=!0,t.transformed=!0,{inputs:{direction:{get:function(){return e?"horizontal":"vertical"},set:function(t){var r;return(r="vertical"!==t)!==e&&(e=r,n(),!0)},type:"string"}}}}),{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",(function(){var t,e,n=this,r="contain";function i(){var i,V,o,s,a=n.matrix,c=t||n.width,u=e||n.height,h=n.source,l=h&&h.width||1,f=h&&h.height||1;"distort"===r||c===l&&u===f?n.transformed=!1:(o=l/f,s=c/u,"none"===r?(i=l/c,V=f/u):"width"===r||"contain"===r&&s<=o?(i=1,V=s/o):"height"===r||"contain"===r&&s>o?(i=o/s,V=1):s>o?(i=1,V=s/o):(i=o/s,V=1),1!==i||1!==V?(M.identity(a),1!==i&&(a[0]*=i,a[1]*=i,a[2]*=i,a[3]*=i),1!==V&&(a[4]*=V,a[5]*=V,a[6]*=V,a[7]*=V),n.transformed=!0):n.transformed=!1)}function V(){return t||n.source&&n.source.width||1}function o(){return e||n.source&&n.source.height||1}return this.resize=function(){var t,e=V(),n=o();if(this.width!==e||this.height!==n)for(this.width=e,this.height=n,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=n),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,n),t=0;t<this.targets.length;t++)this.targets[t].resize();this.setTransformDirty(),i()},{inputs:{width:{get:V,set:function(e){return(e=Math.floor(e))===t||(t=e,this.resize()),!1},type:"number"},height:{get:o,set:function(t){return(t=Math.floor(t))===e||(e=t,this.resize()),!1},type:"number"},mode:{get:function(){return r},set:function(t){return t!==r&&(r=t,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}}),{title:"Reformat",description:"Change output dimensions"}),a=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","void main(void) {","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tgl_Position.w = screenPosition.w;","\tvTexCoord = texCoord;","}\n"].join("\n"),c=["precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","void main(void) {","\t\tgl_FragColor = texture2D(source, vTexCoord);","}"].join("\n"),X.util.shader.noiseHelpers="#ifndef NOISE_HELPERS\n#define NOISE_HELPERS\nvec2 mod289(vec2 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 mod289(vec3 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 permute(vec3 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 permute(vec4 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n",X.util.shader.snoise2d="#ifndef NOISE2D\n#define NOISE2D\nfloat snoise(vec2 v) {\n\tconst vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n\t\t0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n\t\t-0.577350269189626, // -1.0 + 2.0 * C.x\n\t\t0.024390243902439); // 1.0 / 41.0\n\tvec2 i = floor(v + dot(v, C.yy));\n\tvec2 x0 = v - i + dot(i, C.xx);\n\tvec2 i1;\n\t//i1.x = step(x0.y, x0.x); // x0.x > x0.y ? 1.0 : 0.0\n\t//i1.y = 1.0 - i1.x;\n\ti1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n\t// x0 = x0 - 0.0 + 0.0 * C.xx ;\n\t// x1 = x0 - i1 + 1.0 * C.xx ;\n\t// x2 = x0 - 1.0 + 2.0 * C.xx ;\n\tvec4 x12 = x0.xyxy + C.xxzz;\n\tx12.xy -= i1;\n\ti = mod289(i); // Avoid truncation effects in permutation\n\tvec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));\n\tvec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);\n\tm = m*m ;\n\tm = m*m ;\n\tvec3 x = 2.0 * fract(p * C.www) - 1.0;\n\tvec3 h = abs(x) - 0.5;\n\tvec3 ox = floor(x + 0.5);\n\tvec3 a0 = x - ox;\n\tm *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\tvec3 g;\n\tg.x = a0.x * x0.x + h.x * x0.y;\n\tg.yz = a0.yz * x12.xz + h.yz * x12.yw;\n\treturn 130.0 * dot(m, g);\n}\n#endif\n",X.util.shader.snoise3d="#ifndef NOISE3D\n#define NOISE3D\nfloat snoise(vec3 v) {\n\tconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n\tconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\tvec3 i = floor(v + dot(v, C.yyy));\n\tvec3 x0 = v - i + dot(i, C.xxx) ;\n\tvec3 g = step(x0.yzx, x0.xyz);\n\tvec3 l = 1.0 - g;\n\tvec3 i1 = min(g.xyz, l.zxy);\n\tvec3 i2 = max(g.xyz, l.zxy);\n\t// x0 = x0 - 0.0 + 0.0 * C.xxx;\n\t// x1 = x0 - i1 + 1.0 * C.xxx;\n\t// x2 = x0 - i2 + 2.0 * C.xxx;\n\t// x3 = x0 - 1.0 + 3.0 * C.xxx;\n\tvec3 x1 = x0 - i1 + C.xxx;\n\tvec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n\tvec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\ti = mod289(i);\n\tvec4 p = permute(permute(permute(\n\t\t\t\t\t\ti.z + vec4(0.0, i1.z, i2.z, 1.0))\n\t\t\t\t\t\t+ i.y + vec4(0.0, i1.y, i2.y, 1.0))\n\t\t\t\t\t\t+ i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\tfloat n_ = 0.142857142857; // 1.0/7.0\n\tvec3 ns = n_ * D.wyz - D.xzx;\n\tvec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p, 7 * 7)\n\tvec4 x_ = floor(j * ns.z);\n\tvec4 y_ = floor(j - 7.0 * x_); // mod(j, N)\n\tvec4 x = x_ * ns.x + ns.yyyy;\n\tvec4 y = y_ * ns.x + ns.yyyy;\n\tvec4 h = 1.0 - abs(x) - abs(y);\n\tvec4 b0 = vec4(x.xy, y.xy);\n\tvec4 b1 = vec4(x.zw, y.zw);\n\t//vec4 s0 = vec4(lessThan(b0, 0.0)) * 2.0 - 1.0;\n\t//vec4 s1 = vec4(lessThan(b1, 0.0)) * 2.0 - 1.0;\n\tvec4 s0 = floor(b0) * 2.0 + 1.0;\n\tvec4 s1 = floor(b1) * 2.0 + 1.0;\n\tvec4 sh = -step(h, vec4(0.0));\n\tvec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy ;\n\tvec4 a1 = b1.xzyw + s1.xzyw * sh.zzww ;\n\tvec3 p0 = vec3(a0.xy, h.x);\n\tvec3 p1 = vec3(a0.zw, h.y);\n\tvec3 p2 = vec3(a1.xy, h.z);\n\tvec3 p3 = vec3(a1.zw, h.w);\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tvec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n\tm = m * m;\n\treturn 42.0 * dot(m*m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n#endif\n",X.util.shader.snoise4d="#ifndef NOISE4D\n#define NOISE4D\nvec4 grad4(float j, vec4 ip)\n\t{\n\tconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n\tvec4 p, s;\n\n\tp.xyz = floor(fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n\tp.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n\ts = vec4(lessThan(p, vec4(0.0)));\n\tp.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n\treturn p;\n\t}\n\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n\t{\n\tconst vec4 C = vec4(0.138196601125011, // (5 - sqrt(5))/20 G4\n\t\t\t\t\t\t0.276393202250021, // 2 * G4\n\t\t\t\t\t\t0.414589803375032, // 3 * G4\n\t\t\t\t\t\t-0.447213595499958); // -1 + 4 * G4\n\n\tvec4 i = floor(v + dot(v, vec4(F4)));\n\tvec4 x0 = v - i + dot(i, C.xxxx);\n\n\n\tvec4 i0;\n\tvec3 isX = step(x0.yzw, x0.xxx);\n\tvec3 isYZ = step(x0.zww, x0.yyz);\n\ti0.x = isX.x + isX.y + isX.z;\n\ti0.yzw = 1.0 - isX;\n\ti0.y += isYZ.x + isYZ.y;\n\ti0.zw += 1.0 - isYZ.xy;\n\ti0.z += isYZ.z;\n\ti0.w += 1.0 - isYZ.z;\n\n\tvec4 i3 = clamp(i0, 0.0, 1.0);\n\tvec4 i2 = clamp(i0 - 1.0, 0.0, 1.0);\n\tvec4 i1 = clamp(i0 - 2.0, 0.0, 1.0);\n\n\tvec4 x1 = x0 - i1 + C.xxxx;\n\tvec4 x2 = x0 - i2 + C.yyyy;\n\tvec4 x3 = x0 - i3 + C.zzzz;\n\tvec4 x4 = x0 + C.wwww;\n\n\ti = mod289(i);\n\tfloat j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);\n\tvec4 j1 = permute(permute(permute(permute (\n\t\t\t\t\ti.w + vec4(i1.w, i2.w, i3.w, 1.0))\n\t\t\t\t\t+ i.z + vec4(i1.z, i2.z, i3.z, 1.0))\n\t\t\t\t\t+ i.y + vec4(i1.y, i2.y, i3.y, 1.0))\n\t\t\t\t\t+ i.x + vec4(i1.x, i2.x, i3.x, 1.0));\n\n\tvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n\tvec4 p0 = grad4(j0, ip);\n\tvec4 p1 = grad4(j1.x, ip);\n\tvec4 p2 = grad4(j1.y, ip);\n\tvec4 p3 = grad4(j1.z, ip);\n\tvec4 p4 = grad4(j1.w, ip);\n\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tp4 *= taylorInvSqrt(dot(p4, p4));\n\n\tvec3 m0 = max(0.6 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), 0.0);\n\tvec2 m1 = max(0.6 - vec2(dot(x3, x3), dot(x4, x4)), 0.0);\n\tm0 = m0 * m0;\n\tm1 = m1 * m1;\n\treturn 49.0 * (dot(m0*m0, vec3(dot(p0, x0), dot(p1, x1), dot(p2, x2)))\n\t\t\t\t\t\t\t+ dot(m1*m1, vec2(dot(p3, x3), dot(p4, x4)))) ;\n}\n#endif\n",e.default=X},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}a((r=r.apply(t,e||[])).next())}))},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Uneeq=void 0;const V=n(47);n(104);const o=n(81),s=i(n(107)),a=n(108),c=n(109),u=n(132),h=n(37),l=n(133),f=n(140),d=n(146),p=n(148),g=n(80),v=n(149),y=n(150),m=n(63),b=n(152),_=n(85),w=n(153),A=n(99);e.Uneeq=class{constructor(t){this.ready=new V.BehaviorSubject(!1),this.version=s.default.version,this.messages=new V.Subject,this.internalMessages$=new V.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,h.logger.enabled=t.logging||!1,this.options=t,this.options.diagnostics=t.diagnostics||!1,this.options.micActivityMessages=t.micActivityMessages||!1,this.options.sendLocalVideo=void 0===t.sendLocalVideo||t.sendLocalVideo,this.options.sendLocalAudio=void 0===t.sendLocalAudio||t.sendLocalAudio,this.options.enableClientPerformanceMessage=t.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=t.enableTransparentBackground||!1,this.options.backgroundImageUrl=t.backgroundImageUrl||"",this.options.nameTagImageUrl=t.nameTagImageUrl||"",this.options.voiceInputMode=t.voiceInputMode||A.VoiceInputMode.PUSH_TO_TALK,this.api=new a.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:b.SessionType.WEB,sdkVersion:this.version,clientWidth:window.screen.availWidth,clientHeight:window.screen.availHeight},this.options.customData&&(this.startSessionData.customData=this.options.customData),h.logger.log(`Uneeq Created (version ${this.version})`),this.streamManager=new v.StreamManager,this.metricsService=new d.MetricsService(this.options,this.internalMessages$,this.messages),this.dhVideoPlayManager=new u.DigitalHumanVideoPlayManager(this.messages,()=>{this.unmuteDigitalHuman()})}setLoggerEnabled(t){h.logger.enabled=t}init(){this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then(t=>{this.session=t,this.initialize()}).catch(t=>{this.sendServiceUnavailableMessage(t)})}initWithToken(t){return r(this,void 0,void 0,(function*(){this.startSessionTime=Date.now();try{this.startSessionData.tokenId=t,this.session=yield this.api.startSessionWithToken(this.startSessionData),console.log("UneeQ Session ID: "+this.session.id),this.session.sourceApp=w.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:w.SourceApp.UNKNOWN,this.initialize()}catch(t){this.sendServiceUnavailableMessage(t)}}))}get sessionId(){return this.session?this.session.id:null}setCamera(t){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(t)}setMic(t){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(t)}setSpeaker(t){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(t)}setVoiceInputMode(t){this.serviceReadyCheck("setVoiceInputMode")&&this.voiceInputManager.setVoiceInputMode(t)}enableMicrophone(t=!0){this.deviceManager&&this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,t)}enableCamera(t=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(t,this.options.sendLocalAudio)}enableMicrophoneAndCamera(t=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(t,t)}sendTranscript(t){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new m.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(t))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new m.WarningMessage("Call to startRecording() will be ignored. Session is paused.")):this.voiceInputManager.startRecording())}stopSpeaking(){return this.api.avatarStopSpeaking()}stopRecording(){this.serviceReadyCheck("stopRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new m.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.voiceInputManager.stopRecording())}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new m.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new m.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new m.SessionResumedMessage),!0):(this.messages.next(new m.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(t){return this.api.setAvatarDebug(t)}playWelcomeMessage(){return this.api.avatarWelcome()}unmuteDigitalHuman(){this.voiceInputManager.resumeAudioContext(),this.dhVideoPlayManager.unmuteVideo()}gatherWebRtcMetrics(){var t;null===(t=this.deviceManager)||void 0===t||t.mediaHandler.gatherWebRTCStats((t,e)=>{this.metricsService.parseAndLogWebRtcStats(e)}),setTimeout(()=>{this.gatherWebRtcMetrics()},5e3)}initMessaging(){this.messages.subscribe(t=>this.messageCallback(t)),this.messaging.state$.filter(t=>t===f.MessagingState.CONNECTED).subscribe(()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new m.ReadyMessage),this.gatherWebRtcMetrics()}),this.messaging.messages$.subscribe(t=>this.internalMessages$.next(JSON.parse(t.body))),this.messageHandler=new l.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe(t=>{h.logger.log("-- Msg -- ",t)})}initDeviceManager(){this.voiceInputManager=new y.VoiceInputManager(this.options,this.api,this.messages,t=>{this.enableMicrophone(t)}),this.deviceManager=new c.DeviceManager({userMessages:this.messages,session:this.session,messages:this.messages,internalMessages$:this.internalMessages$,messaging:this.messaging,uneeqOptions:this.options,streamManager:this.streamManager,voiceInputManager:this.voiceInputManager},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new m.SessionLiveMessage(this.session.showUneeqLogo||!1)),this.options.playWelcome&&this.api.avatarWelcome();const t={type:g.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.sessionStarted=!0}}initAvatar(){this.ready.filter(Boolean).pipe(o.take(1)).subscribe(()=>{this.internalMessages$.filter(t=>"DevicePermissionAllowedInternal"===t.faceMeMessageType).pipe(o.take(1)).subscribe(t=>{this.messages.next(new m.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()}),this.initDeviceManager()}),this.internalMessages$.filter(t=>"sessionLive"===t.faceMeMessageType).pipe(o.take(1)).subscribe(t=>this.sessionLiveHandler()),this.internalMessages$.filter(t=>"sessionEnd"===t.faceMeMessageType).subscribe(()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new m.SessionEndedMessage),this.messaging.disconnect()}),this.internalMessages$.filter(t=>"remoteVideoReadyToPlay"===t.faceMeMessageType).subscribe(t=>{this.dhVideoPlayManager.play(this.deviceManager.mediaHandler.avatarVideoElement),this.streamManager.remoteVideoReadyToPlay()})}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then(t=>{if(t.available>0){const t={type:g.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new m.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground,backgroundImageUrl:this.options.backgroundImageUrl,nameTagImageUrl:this.options.nameTagImageUrl})}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new m.AvatarUnavailableMessage)),setTimeout(()=>{this.startAvatarWhenAvailable()},1e3)})}initialize(){if(this.session){this.initPromMetricsListener(),this.api.callId=this.session.id,this.initAvatar();const t={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new m.ConnectionLostMessage(_.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new f.MessagingService(this.options.url+"/api/messaging",t),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(t){const e=new m.ServiceUnavailableMessage(t);this.messages.next(e),this.messageCallback(e)}serviceReadyCheck(t){return!!this.ready.value||(this.messages.next(new m.WarningMessage("Call to "+t+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new p.OnlineStatusService(this.messages,()=>{this.messages.next(new m.ConnectionLostMessage(_.PublishSubscribeState.DISCONNECTED)),this.endSession()})}initPromMetricsListener(){const t=new g.Prom(this.options.url);this.internalMessages$.filter(t=>"prom"===t.faceMeMessageType).subscribe(e=>{t.handleMessage(e.promMsg)})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PublishSubscribeState=void 0,function(t){t.DISCONNECTED="DISCONNECTED",t.CONNECTING="CONNECTING",t.CONNECTED="CONNECTED",t.FAILED="FAILED"}(e.PublishSubscribeState||(e.PublishSubscribeState={}))},function(t,e,n){
31
+ */(function(){var V="Expected a function",o="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],a="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",l="[object Error]",f="[object Function]",d="[object GeneratorFunction]",p="[object Map]",g="[object Number]",v="[object Object]",m="[object RegExp]",y="[object Set]",b="[object String]",_="[object Symbol]",w="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",x="[object Float32Array]",T="[object Float64Array]",C="[object Int8Array]",E="[object Int16Array]",R="[object Int32Array]",M="[object Uint8Array]",O="[object Uint16Array]",P="[object Uint32Array]",k=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,D=/(__e\(.*?\)|\b__t\)) \+\n'';/g,N=/&(?:amp|lt|gt|quot|#39);/g,j=/[&<>"']/g,L=RegExp(N.source),U=RegExp(j.source),F=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(G.source),$=/^\s+/,Q=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Z=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,tt=/[()=,{}\[\]\/\s]/,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,Vt=/^0b[01]+$/i,ot=/^\[object .+?Constructor\]$/,st=/^0o[0-7]+$/i,at=/^(?:0|[1-9]\d*)$/,ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ut=/($^)/,ht=/['\n\r\u2028\u2029\\]/g,lt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ft="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dt="[\\ud800-\\udfff]",pt="["+ft+"]",gt="["+lt+"]",vt="\\d+",mt="[\\u2700-\\u27bf]",yt="[a-z\\xdf-\\xf6\\xf8-\\xff]",bt="[^\\ud800-\\udfff"+ft+vt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_t="\\ud83c[\\udffb-\\udfff]",wt="[^\\ud800-\\udfff]",At="(?:\\ud83c[\\udde6-\\uddff]){2}",St="[\\ud800-\\udbff][\\udc00-\\udfff]",xt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Tt="(?:"+yt+"|"+bt+")",Ct="(?:"+xt+"|"+bt+")",Et="(?:"+gt+"|"+_t+")"+"?",Rt="[\\ufe0e\\ufe0f]?"+Et+("(?:\\u200d(?:"+[wt,At,St].join("|")+")[\\ufe0e\\ufe0f]?"+Et+")*"),Mt="(?:"+[mt,At,St].join("|")+")"+Rt,Ot="(?:"+[wt+gt+"?",gt,At,St,dt].join("|")+")",Pt=RegExp("['’]","g"),kt=RegExp(gt,"g"),It=RegExp(_t+"(?="+_t+")|"+Ot+Rt,"g"),Dt=RegExp([xt+"?"+yt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pt,xt,"$"].join("|")+")",Ct+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pt,xt+Tt,"$"].join("|")+")",xt+"?"+Tt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",xt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vt,Mt].join("|"),"g"),Nt=RegExp("[\\u200d\\ud800-\\udfff"+lt+"\\ufe0e\\ufe0f]"),jt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ut=-1,Ft={};Ft[x]=Ft[T]=Ft[C]=Ft[E]=Ft[R]=Ft[M]=Ft["[object Uint8ClampedArray]"]=Ft[O]=Ft[P]=!0,Ft[a]=Ft[c]=Ft[A]=Ft[u]=Ft[S]=Ft[h]=Ft[l]=Ft[f]=Ft[p]=Ft[g]=Ft[v]=Ft[m]=Ft[y]=Ft[b]=Ft[w]=!1;var Bt={};Bt[a]=Bt[c]=Bt[A]=Bt[S]=Bt[u]=Bt[h]=Bt[x]=Bt[T]=Bt[C]=Bt[E]=Bt[R]=Bt[p]=Bt[g]=Bt[v]=Bt[m]=Bt[y]=Bt[b]=Bt[_]=Bt[M]=Bt["[object Uint8ClampedArray]"]=Bt[O]=Bt[P]=!0,Bt[l]=Bt[f]=Bt[w]=!1;var Wt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qt=parseFloat,zt=parseInt,Ht="object"==typeof t&&t&&t.Object===Object&&t,Gt="object"==typeof self&&self&&self.Object===Object&&self,Yt=Ht||Gt||Function("return this")(),$t=e&&!e.nodeType&&e,Qt=$t&&"object"==typeof r&&r&&!r.nodeType&&r,Xt=Qt&&Qt.exports===$t,Zt=Xt&&Ht.process,Kt=function(){try{var t=Qt&&Qt.require&&Qt.require("util").types;return t||Zt&&Zt.binding&&Zt.binding("util")}catch(t){}}(),Jt=Kt&&Kt.isArrayBuffer,te=Kt&&Kt.isDate,ee=Kt&&Kt.isMap,ne=Kt&&Kt.isRegExp,re=Kt&&Kt.isSet,ie=Kt&&Kt.isTypedArray;function Ve(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function oe(t,e,n,r){for(var i=-1,V=null==t?0:t.length;++i<V;){var o=t[i];e(r,o,n(o),t)}return r}function se(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function ae(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function ce(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function ue(t,e){for(var n=-1,r=null==t?0:t.length,i=0,V=[];++n<r;){var o=t[n];e(o,n,t)&&(V[i++]=o)}return V}function he(t,e){return!!(null==t?0:t.length)&&_e(t,e,0)>-1}function le(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function fe(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function de(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function pe(t,e,n,r){var i=-1,V=null==t?0:t.length;for(r&&V&&(n=t[++i]);++i<V;)n=e(n,t[i],i,t);return n}function ge(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function ve(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var me=xe("length");function ye(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function be(t,e,n,r){for(var i=t.length,V=n+(r?1:-1);r?V--:++V<i;)if(e(t[V],V,t))return V;return-1}function _e(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):be(t,Ae,n)}function we(t,e,n,r){for(var i=n-1,V=t.length;++i<V;)if(r(t[i],e))return i;return-1}function Ae(t){return t!=t}function Se(t,e){var n=null==t?0:t.length;return n?Ee(t,e)/n:NaN}function xe(t){return function(e){return null==e?void 0:e[t]}}function Te(t){return function(e){return null==t?void 0:t[e]}}function Ce(t,e,n,r,i){return i(t,(function(t,i,V){n=r?(r=!1,t):e(n,t,i,V)})),n}function Ee(t,e){for(var n,r=-1,i=t.length;++r<i;){var V=e(t[r]);void 0!==V&&(n=void 0===n?V:n+V)}return n}function Re(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Me(t){return t?t.slice(0,$e(t)+1).replace($,""):t}function Oe(t){return function(e){return t(e)}}function Pe(t,e){return fe(e,(function(e){return t[e]}))}function ke(t,e){return t.has(e)}function Ie(t,e){for(var n=-1,r=t.length;++n<r&&_e(e,t[n],0)>-1;);return n}function De(t,e){for(var n=t.length;n--&&_e(e,t[n],0)>-1;);return n}function Ne(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var je=Te({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Le=Te({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ue(t){return"\\"+Wt[t]}function Fe(t){return Nt.test(t)}function Be(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function We(t,e){return function(n){return t(e(n))}}function qe(t,e){for(var n=-1,r=t.length,i=0,V=[];++n<r;){var s=t[n];s!==e&&s!==o||(t[n]=o,V[i++]=n)}return V}function ze(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function He(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function Ge(t){return Fe(t)?function(t){var e=It.lastIndex=0;for(;It.test(t);)++e;return e}(t):me(t)}function Ye(t){return Fe(t)?function(t){return t.match(It)||[]}(t):function(t){return t.split("")}(t)}function $e(t){for(var e=t.length;e--&&Q.test(t.charAt(e)););return e}var Qe=Te({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Xe=function t(e){var n,r=(e=null==e?Yt:Xe.defaults(Yt.Object(),e,Xe.pick(Yt,Lt))).Array,i=e.Date,Q=e.Error,lt=e.Function,ft=e.Math,dt=e.Object,pt=e.RegExp,gt=e.String,vt=e.TypeError,mt=r.prototype,yt=lt.prototype,bt=dt.prototype,_t=e["__core-js_shared__"],wt=yt.toString,At=bt.hasOwnProperty,St=0,xt=(n=/[^.]+$/.exec(_t&&_t.keys&&_t.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Tt=bt.toString,Ct=wt.call(dt),Et=Yt._,Rt=pt("^"+wt.call(At).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=Xt?e.Buffer:void 0,Ot=e.Symbol,It=e.Uint8Array,Nt=Mt?Mt.allocUnsafe:void 0,Wt=We(dt.getPrototypeOf,dt),Ht=dt.create,Gt=bt.propertyIsEnumerable,$t=mt.splice,Qt=Ot?Ot.isConcatSpreadable:void 0,Zt=Ot?Ot.iterator:void 0,Kt=Ot?Ot.toStringTag:void 0,me=function(){try{var t=tV(dt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Te=e.clearTimeout!==Yt.clearTimeout&&e.clearTimeout,Ze=i&&i.now!==Yt.Date.now&&i.now,Ke=e.setTimeout!==Yt.setTimeout&&e.setTimeout,Je=ft.ceil,tn=ft.floor,en=dt.getOwnPropertySymbols,nn=Mt?Mt.isBuffer:void 0,rn=e.isFinite,Vn=mt.join,on=We(dt.keys,dt),sn=ft.max,an=ft.min,cn=i.now,un=e.parseInt,hn=ft.random,ln=mt.reverse,fn=tV(e,"DataView"),dn=tV(e,"Map"),pn=tV(e,"Promise"),gn=tV(e,"Set"),vn=tV(e,"WeakMap"),mn=tV(dt,"create"),yn=vn&&new vn,bn={},_n=CV(fn),wn=CV(dn),An=CV(pn),Sn=CV(gn),xn=CV(vn),Tn=Ot?Ot.prototype:void 0,Cn=Tn?Tn.valueOf:void 0,En=Tn?Tn.toString:void 0;function Rn(t){if(Ho(t)&&!Io(t)&&!(t instanceof kn)){if(t instanceof Pn)return t;if(At.call(t,"__wrapped__"))return EV(t)}return new Pn(t)}var Mn=function(){function t(){}return function(e){if(!zo(e))return{};if(Ht)return Ht(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function On(){}function Pn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function kn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function In(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Dn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Nn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function jn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Nn;++e<n;)this.add(t[e])}function Ln(t){var e=this.__data__=new Dn(t);this.size=e.size}function Un(t,e){var n=Io(t),r=!n&&ko(t),i=!n&&!r&&Lo(t),V=!n&&!r&&!i&&Jo(t),o=n||r||i||V,s=o?Re(t.length,gt):[],a=s.length;for(var c in t)!e&&!At.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||V&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||sV(c,a))||s.push(c);return s}function Fn(t){var e=t.length;return e?t[jr(0,e-1)]:void 0}function Bn(t,e){return SV(mi(t),Xn(e,0,t.length))}function Wn(t){return SV(mi(t))}function qn(t,e,n){(void 0!==n&&!Mo(t[e],n)||void 0===n&&!(e in t))&&$n(t,e,n)}function zn(t,e,n){var r=t[e];At.call(t,e)&&Mo(r,n)&&(void 0!==n||e in t)||$n(t,e,n)}function Hn(t,e){for(var n=t.length;n--;)if(Mo(t[n][0],e))return n;return-1}function Gn(t,e,n,r){return er(t,(function(t,i,V){e(r,t,n(t),V)})),r}function Yn(t,e){return t&&yi(e,_s(e),t)}function $n(t,e,n){"__proto__"==e&&me?me(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Qn(t,e){for(var n=-1,i=e.length,V=r(i),o=null==t;++n<i;)V[n]=o?void 0:gs(t,e[n]);return V}function Xn(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function Zn(t,e,n,r,i,V){var o,s=1&e,c=2&e,l=4&e;if(n&&(o=i?n(t,r,i,V):n(t)),void 0!==o)return o;if(!zo(t))return t;var w=Io(t);if(w){if(o=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&At.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!s)return mi(t,o)}else{var k=rV(t),I=k==f||k==d;if(Lo(t))return li(t,s);if(k==v||k==a||I&&!i){if(o=c||I?{}:VV(t),!s)return c?function(t,e){return yi(t,nV(t),e)}(t,function(t,e){return t&&yi(e,ws(e),t)}(o,t)):function(t,e){return yi(t,eV(t),e)}(t,Yn(o,t))}else{if(!Bt[k])return i?t:{};o=function(t,e,n){var r=t.constructor;switch(e){case A:return fi(t);case u:case h:return new r(+t);case S:return function(t,e){var n=e?fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case x:case T:case C:case E:case R:case M:case"[object Uint8ClampedArray]":case O:case P:return di(t,n);case p:return new r;case g:case b:return new r(t);case m:return function(t){var e=new t.constructor(t.source,rt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case y:return new r;case _:return i=t,Cn?dt(Cn.call(i)):{}}var i}(t,k,s)}}V||(V=new Ln);var D=V.get(t);if(D)return D;V.set(t,o),Xo(t)?t.forEach((function(r){o.add(Zn(r,e,n,r,t,V))})):Go(t)&&t.forEach((function(r,i){o.set(i,Zn(r,e,n,i,t,V))}));var N=w?void 0:(l?c?Yi:Gi:c?ws:_s)(t);return se(N||t,(function(r,i){N&&(r=t[i=r]),zn(o,i,Zn(r,e,n,i,t,V))})),o}function Kn(t,e,n){var r=n.length;if(null==t)return!r;for(t=dt(t);r--;){var i=n[r],V=e[i],o=t[i];if(void 0===o&&!(i in t)||!V(o))return!1}return!0}function Jn(t,e,n){if("function"!=typeof t)throw new vt(V);return bV((function(){t.apply(void 0,n)}),e)}function tr(t,e,n,r){var i=-1,V=he,o=!0,s=t.length,a=[],c=e.length;if(!s)return a;n&&(e=fe(e,Oe(n))),r?(V=le,o=!1):e.length>=200&&(V=ke,o=!1,e=new jn(e));t:for(;++i<s;){var u=t[i],h=null==n?u:n(u);if(u=r||0!==u?u:0,o&&h==h){for(var l=c;l--;)if(e[l]===h)continue t;a.push(u)}else V(e,h,r)||a.push(u)}return a}Rn.templateSettings={escape:F,evaluate:B,interpolate:W,variable:"",imports:{_:Rn}},Rn.prototype=On.prototype,Rn.prototype.constructor=Rn,Pn.prototype=Mn(On.prototype),Pn.prototype.constructor=Pn,kn.prototype=Mn(On.prototype),kn.prototype.constructor=kn,In.prototype.clear=function(){this.__data__=mn?mn(null):{},this.size=0},In.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},In.prototype.get=function(t){var e=this.__data__;if(mn){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return At.call(e,t)?e[t]:void 0},In.prototype.has=function(t){var e=this.__data__;return mn?void 0!==e[t]:At.call(e,t)},In.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=mn&&void 0===e?"__lodash_hash_undefined__":e,this},Dn.prototype.clear=function(){this.__data__=[],this.size=0},Dn.prototype.delete=function(t){var e=this.__data__,n=Hn(e,t);return!(n<0)&&(n==e.length-1?e.pop():$t.call(e,n,1),--this.size,!0)},Dn.prototype.get=function(t){var e=this.__data__,n=Hn(e,t);return n<0?void 0:e[n][1]},Dn.prototype.has=function(t){return Hn(this.__data__,t)>-1},Dn.prototype.set=function(t,e){var n=this.__data__,r=Hn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Nn.prototype.clear=function(){this.size=0,this.__data__={hash:new In,map:new(dn||Dn),string:new In}},Nn.prototype.delete=function(t){var e=Ki(this,t).delete(t);return this.size-=e?1:0,e},Nn.prototype.get=function(t){return Ki(this,t).get(t)},Nn.prototype.has=function(t){return Ki(this,t).has(t)},Nn.prototype.set=function(t,e){var n=Ki(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},jn.prototype.add=jn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},jn.prototype.has=function(t){return this.__data__.has(t)},Ln.prototype.clear=function(){this.__data__=new Dn,this.size=0},Ln.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Ln.prototype.get=function(t){return this.__data__.get(t)},Ln.prototype.has=function(t){return this.__data__.has(t)},Ln.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Dn){var r=n.__data__;if(!dn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Nn(r)}return n.set(t,e),this.size=n.size,this};var er=wi(cr),nr=wi(ur,!0);function rr(t,e){var n=!0;return er(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function ir(t,e,n){for(var r=-1,i=t.length;++r<i;){var V=t[r],o=e(V);if(null!=o&&(void 0===s?o==o&&!Ko(o):n(o,s)))var s=o,a=V}return a}function Vr(t,e){var n=[];return er(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function or(t,e,n,r,i){var V=-1,o=t.length;for(n||(n=oV),i||(i=[]);++V<o;){var s=t[V];e>0&&n(s)?e>1?or(s,e-1,n,r,i):de(i,s):r||(i[i.length]=s)}return i}var sr=Ai(),ar=Ai(!0);function cr(t,e){return t&&sr(t,e,_s)}function ur(t,e){return t&&ar(t,e,_s)}function hr(t,e){return ue(e,(function(e){return Bo(t[e])}))}function lr(t,e){for(var n=0,r=(e=ai(e,t)).length;null!=t&&n<r;)t=t[TV(e[n++])];return n&&n==r?t:void 0}function fr(t,e,n){var r=e(t);return Io(t)?r:de(r,n(t))}function dr(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Kt&&Kt in dt(t)?function(t){var e=At.call(t,Kt),n=t[Kt];try{t[Kt]=void 0;var r=!0}catch(t){}var i=Tt.call(t);r&&(e?t[Kt]=n:delete t[Kt]);return i}(t):function(t){return Tt.call(t)}(t)}function pr(t,e){return t>e}function gr(t,e){return null!=t&&At.call(t,e)}function vr(t,e){return null!=t&&e in dt(t)}function mr(t,e,n){for(var i=n?le:he,V=t[0].length,o=t.length,s=o,a=r(o),c=1/0,u=[];s--;){var h=t[s];s&&e&&(h=fe(h,Oe(e))),c=an(h.length,c),a[s]=!n&&(e||V>=120&&h.length>=120)?new jn(s&&h):void 0}h=t[0];var l=-1,f=a[0];t:for(;++l<V&&u.length<c;){var d=h[l],p=e?e(d):d;if(d=n||0!==d?d:0,!(f?ke(f,p):i(u,p,n))){for(s=o;--s;){var g=a[s];if(!(g?ke(g,p):i(t[s],p,n)))continue t}f&&f.push(p),u.push(d)}}return u}function yr(t,e,n){var r=null==(t=gV(t,e=ai(e,t)))?t:t[TV(UV(e))];return null==r?void 0:Ve(r,t,n)}function br(t){return Ho(t)&&dr(t)==a}function _r(t,e,n,r,i){return t===e||(null==t||null==e||!Ho(t)&&!Ho(e)?t!=t&&e!=e:function(t,e,n,r,i,V){var o=Io(t),s=Io(e),f=o?c:rV(t),d=s?c:rV(e),w=(f=f==a?v:f)==v,x=(d=d==a?v:d)==v,T=f==d;if(T&&Lo(t)){if(!Lo(e))return!1;o=!0,w=!1}if(T&&!w)return V||(V=new Ln),o||Jo(t)?zi(t,e,n,r,i,V):function(t,e,n,r,i,V,o){switch(n){case S:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case A:return!(t.byteLength!=e.byteLength||!V(new It(t),new It(e)));case u:case h:case g:return Mo(+t,+e);case l:return t.name==e.name&&t.message==e.message;case m:case b:return t==e+"";case p:var s=Be;case y:var a=1&r;if(s||(s=ze),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;r|=2,o.set(t,e);var f=zi(s(t),s(e),r,i,V,o);return o.delete(t),f;case _:if(Cn)return Cn.call(t)==Cn.call(e)}return!1}(t,e,f,n,r,i,V);if(!(1&n)){var C=w&&At.call(t,"__wrapped__"),E=x&&At.call(e,"__wrapped__");if(C||E){var R=C?t.value():t,M=E?e.value():e;return V||(V=new Ln),i(R,M,n,r,V)}}if(!T)return!1;return V||(V=new Ln),function(t,e,n,r,i,V){var o=1&n,s=Gi(t),a=s.length,c=Gi(e).length;if(a!=c&&!o)return!1;var u=a;for(;u--;){var h=s[u];if(!(o?h in e:At.call(e,h)))return!1}var l=V.get(t),f=V.get(e);if(l&&f)return l==e&&f==t;var d=!0;V.set(t,e),V.set(e,t);var p=o;for(;++u<a;){h=s[u];var g=t[h],v=e[h];if(r)var m=o?r(v,g,h,e,t,V):r(g,v,h,t,e,V);if(!(void 0===m?g===v||i(g,v,n,r,V):m)){d=!1;break}p||(p="constructor"==h)}if(d&&!p){var y=t.constructor,b=e.constructor;y==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(d=!1)}return V.delete(t),V.delete(e),d}(t,e,n,r,i,V)}(t,e,n,r,_r,i))}function wr(t,e,n,r){var i=n.length,V=i,o=!r;if(null==t)return!V;for(t=dt(t);i--;){var s=n[i];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<V;){var a=(s=n[i])[0],c=t[a],u=s[1];if(o&&s[2]){if(void 0===c&&!(a in t))return!1}else{var h=new Ln;if(r)var l=r(c,u,a,t,e,h);if(!(void 0===l?_r(u,c,3,r,h):l))return!1}}return!0}function Ar(t){return!(!zo(t)||(e=t,xt&&xt in e))&&(Bo(t)?Rt:ot).test(CV(t));var e}function Sr(t){return"function"==typeof t?t:null==t?Ys:"object"==typeof t?Io(t)?Mr(t[0],t[1]):Rr(t):na(t)}function xr(t){if(!lV(t))return on(t);var e=[];for(var n in dt(t))At.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Tr(t){if(!zo(t))return function(t){var e=[];if(null!=t)for(var n in dt(t))e.push(n);return e}(t);var e=lV(t),n=[];for(var r in t)("constructor"!=r||!e&&At.call(t,r))&&n.push(r);return n}function Cr(t,e){return t<e}function Er(t,e){var n=-1,i=No(t)?r(t.length):[];return er(t,(function(t,r,V){i[++n]=e(t,r,V)})),i}function Rr(t){var e=Ji(t);return 1==e.length&&e[0][2]?dV(e[0][0],e[0][1]):function(n){return n===t||wr(n,t,e)}}function Mr(t,e){return cV(t)&&fV(e)?dV(TV(t),e):function(n){var r=gs(n,t);return void 0===r&&r===e?vs(n,t):_r(e,r,3)}}function Or(t,e,n,r,i){t!==e&&sr(e,(function(V,o){if(i||(i=new Ln),zo(V))!function(t,e,n,r,i,V,o){var s=mV(t,n),a=mV(e,n),c=o.get(a);if(c)return void qn(t,n,c);var u=V?V(s,a,n+"",t,e,o):void 0,h=void 0===u;if(h){var l=Io(a),f=!l&&Lo(a),d=!l&&!f&&Jo(a);u=a,l||f||d?Io(s)?u=s:jo(s)?u=mi(s):f?(h=!1,u=li(a,!0)):d?(h=!1,u=di(a,!0)):u=[]:$o(a)||ko(a)?(u=s,ko(s)?u=ss(s):zo(s)&&!Bo(s)||(u=VV(a))):h=!1}h&&(o.set(a,u),i(u,a,r,V,o),o.delete(a));qn(t,n,u)}(t,e,o,n,Or,r,i);else{var s=r?r(mV(t,o),V,o+"",t,e,i):void 0;void 0===s&&(s=V),qn(t,o,s)}}),ws)}function Pr(t,e){var n=t.length;if(n)return sV(e+=e<0?n:0,n)?t[e]:void 0}function kr(t,e,n){e=e.length?fe(e,(function(t){return Io(t)?function(e){return lr(e,1===t.length?t[0]:t)}:t})):[Ys];var r=-1;return e=fe(e,Oe(Zi())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Er(t,(function(t,n,i){return{criteria:fe(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,V=e.criteria,o=i.length,s=n.length;for(;++r<o;){var a=pi(i[r],V[r]);if(a){if(r>=s)return a;var c=n[r];return a*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)}))}function Ir(t,e,n){for(var r=-1,i=e.length,V={};++r<i;){var o=e[r],s=lr(t,o);n(s,o)&&Wr(V,ai(o,t),s)}return V}function Dr(t,e,n,r){var i=r?we:_e,V=-1,o=e.length,s=t;for(t===e&&(e=mi(e)),n&&(s=fe(t,Oe(n)));++V<o;)for(var a=0,c=e[V],u=n?n(c):c;(a=i(s,u,a,r))>-1;)s!==t&&$t.call(s,a,1),$t.call(t,a,1);return t}function Nr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==V){var V=i;sV(i)?$t.call(t,i,1):ti(t,i)}}return t}function jr(t,e){return t+tn(hn()*(e-t+1))}function Lr(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=tn(e/2))&&(t+=t)}while(e);return n}function Ur(t,e){return _V(pV(t,e,Ys),t+"")}function Fr(t){return Fn(Ms(t))}function Br(t,e){var n=Ms(t);return SV(n,Xn(e,0,n.length))}function Wr(t,e,n,r){if(!zo(t))return t;for(var i=-1,V=(e=ai(e,t)).length,o=V-1,s=t;null!=s&&++i<V;){var a=TV(e[i]),c=n;if("__proto__"===a||"constructor"===a||"prototype"===a)return t;if(i!=o){var u=s[a];void 0===(c=r?r(u,a,s):void 0)&&(c=zo(u)?u:sV(e[i+1])?[]:{})}zn(s,a,c),s=s[a]}return t}var qr=yn?function(t,e){return yn.set(t,e),t}:Ys,zr=me?function(t,e){return me(t,"toString",{configurable:!0,enumerable:!1,value:zs(e),writable:!0})}:Ys;function Hr(t){return SV(Ms(t))}function Gr(t,e,n){var i=-1,V=t.length;e<0&&(e=-e>V?0:V+e),(n=n>V?V:n)<0&&(n+=V),V=e>n?0:n-e>>>0,e>>>=0;for(var o=r(V);++i<V;)o[i]=t[i+e];return o}function Yr(t,e){var n;return er(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function $r(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var V=r+i>>>1,o=t[V];null!==o&&!Ko(o)&&(n?o<=e:o<e)?r=V+1:i=V}return i}return Qr(t,e,Ys,n)}function Qr(t,e,n,r){var i=0,V=null==t?0:t.length;if(0===V)return 0;for(var o=(e=n(e))!=e,s=null===e,a=Ko(e),c=void 0===e;i<V;){var u=tn((i+V)/2),h=n(t[u]),l=void 0!==h,f=null===h,d=h==h,p=Ko(h);if(o)var g=r||d;else g=c?d&&(r||l):s?d&&l&&(r||!f):a?d&&l&&!f&&(r||!p):!f&&!p&&(r?h<=e:h<e);g?i=u+1:V=u}return an(V,4294967294)}function Xr(t,e){for(var n=-1,r=t.length,i=0,V=[];++n<r;){var o=t[n],s=e?e(o):o;if(!n||!Mo(s,a)){var a=s;V[i++]=0===o?0:o}}return V}function Zr(t){return"number"==typeof t?t:Ko(t)?NaN:+t}function Kr(t){if("string"==typeof t)return t;if(Io(t))return fe(t,Kr)+"";if(Ko(t))return En?En.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Jr(t,e,n){var r=-1,i=he,V=t.length,o=!0,s=[],a=s;if(n)o=!1,i=le;else if(V>=200){var c=e?null:Li(t);if(c)return ze(c);o=!1,i=ke,a=new jn}else a=e?[]:s;t:for(;++r<V;){var u=t[r],h=e?e(u):u;if(u=n||0!==u?u:0,o&&h==h){for(var l=a.length;l--;)if(a[l]===h)continue t;e&&a.push(h),s.push(u)}else i(a,h,n)||(a!==s&&a.push(h),s.push(u))}return s}function ti(t,e){return null==(t=gV(t,e=ai(e,t)))||delete t[TV(UV(e))]}function ei(t,e,n,r){return Wr(t,e,n(lr(t,e)),r)}function ni(t,e,n,r){for(var i=t.length,V=r?i:-1;(r?V--:++V<i)&&e(t[V],V,t););return n?Gr(t,r?0:V,r?V+1:i):Gr(t,r?V+1:0,r?i:V)}function ri(t,e){var n=t;return n instanceof kn&&(n=n.value()),pe(e,(function(t,e){return e.func.apply(e.thisArg,de([t],e.args))}),n)}function ii(t,e,n){var i=t.length;if(i<2)return i?Jr(t[0]):[];for(var V=-1,o=r(i);++V<i;)for(var s=t[V],a=-1;++a<i;)a!=V&&(o[V]=tr(o[V]||s,t[a],e,n));return Jr(or(o,1),e,n)}function Vi(t,e,n){for(var r=-1,i=t.length,V=e.length,o={};++r<i;){var s=r<V?e[r]:void 0;n(o,t[r],s)}return o}function oi(t){return jo(t)?t:[]}function si(t){return"function"==typeof t?t:Ys}function ai(t,e){return Io(t)?t:cV(t,e)?[t]:xV(as(t))}var ci=Ur;function ui(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:Gr(t,e,n)}var hi=Te||function(t){return Yt.clearTimeout(t)};function li(t,e){if(e)return t.slice();var n=t.length,r=Nt?Nt(n):new t.constructor(n);return t.copy(r),r}function fi(t){var e=new t.constructor(t.byteLength);return new It(e).set(new It(t)),e}function di(t,e){var n=e?fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function pi(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,V=Ko(t),o=void 0!==e,s=null===e,a=e==e,c=Ko(e);if(!s&&!c&&!V&&t>e||V&&o&&a&&!s&&!c||r&&o&&a||!n&&a||!i)return 1;if(!r&&!V&&!c&&t<e||c&&n&&i&&!r&&!V||s&&n&&i||!o&&i||!a)return-1}return 0}function gi(t,e,n,i){for(var V=-1,o=t.length,s=n.length,a=-1,c=e.length,u=sn(o-s,0),h=r(c+u),l=!i;++a<c;)h[a]=e[a];for(;++V<s;)(l||V<o)&&(h[n[V]]=t[V]);for(;u--;)h[a++]=t[V++];return h}function vi(t,e,n,i){for(var V=-1,o=t.length,s=-1,a=n.length,c=-1,u=e.length,h=sn(o-a,0),l=r(h+u),f=!i;++V<h;)l[V]=t[V];for(var d=V;++c<u;)l[d+c]=e[c];for(;++s<a;)(f||V<o)&&(l[d+n[s]]=t[V++]);return l}function mi(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function yi(t,e,n,r){var i=!n;n||(n={});for(var V=-1,o=e.length;++V<o;){var s=e[V],a=r?r(n[s],t[s],s,n,t):void 0;void 0===a&&(a=t[s]),i?$n(n,s,a):zn(n,s,a)}return n}function bi(t,e){return function(n,r){var i=Io(n)?oe:Gn,V=e?e():{};return i(n,t,Zi(r,2),V)}}function _i(t){return Ur((function(e,n){var r=-1,i=n.length,V=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(V=t.length>3&&"function"==typeof V?(i--,V):void 0,o&&aV(n[0],n[1],o)&&(V=i<3?void 0:V,i=1),e=dt(e);++r<i;){var s=n[r];s&&t(e,s,r,V)}return e}))}function wi(t,e){return function(n,r){if(null==n)return n;if(!No(n))return t(n,r);for(var i=n.length,V=e?i:-1,o=dt(n);(e?V--:++V<i)&&!1!==r(o[V],V,o););return n}}function Ai(t){return function(e,n,r){for(var i=-1,V=dt(e),o=r(e),s=o.length;s--;){var a=o[t?s:++i];if(!1===n(V[a],a,V))break}return e}}function Si(t){return function(e){var n=Fe(e=as(e))?Ye(e):void 0,r=n?n[0]:e.charAt(0),i=n?ui(n,1).join(""):e.slice(1);return r[t]()+i}}function xi(t){return function(e){return pe(Bs(ks(e).replace(Pt,"")),t,"")}}function Ti(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Mn(t.prototype),r=t.apply(n,e);return zo(r)?r:n}}function Ci(t){return function(e,n,r){var i=dt(e);if(!No(e)){var V=Zi(n,3);e=_s(e),n=function(t){return V(i[t],t,i)}}var o=t(e,n,r);return o>-1?i[V?e[o]:o]:void 0}}function Ei(t){return Hi((function(e){var n=e.length,r=n,i=Pn.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new vt(V);if(i&&!s&&"wrapper"==Qi(o))var s=new Pn([],!0)}for(r=s?r:n;++r<n;){var a=Qi(o=e[r]),c="wrapper"==a?$i(o):void 0;s=c&&uV(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?s[Qi(c[0])].apply(s,c[3]):1==o.length&&uV(o)?s[a]():s.thru(o)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&Io(r))return s.plant(r).value();for(var i=0,V=n?e[i].apply(this,t):r;++i<n;)V=e[i].call(this,V);return V}}))}function Ri(t,e,n,i,V,o,s,a,c,u){var h=128&e,l=1&e,f=2&e,d=24&e,p=512&e,g=f?void 0:Ti(t);return function v(){for(var m=arguments.length,y=r(m),b=m;b--;)y[b]=arguments[b];if(d)var _=Xi(v),w=Ne(y,_);if(i&&(y=gi(y,i,V,d)),o&&(y=vi(y,o,s,d)),m-=w,d&&m<u){var A=qe(y,_);return Ni(t,e,Ri,v.placeholder,n,y,A,a,c,u-m)}var S=l?n:this,x=f?S[t]:t;return m=y.length,a?y=vV(y,a):p&&m>1&&y.reverse(),h&&c<m&&(y.length=c),this&&this!==Yt&&this instanceof v&&(x=g||Ti(x)),x.apply(S,y)}}function Mi(t,e){return function(n,r){return function(t,e,n,r){return cr(t,(function(t,i,V){e(r,n(t),i,V)})),r}(n,t,e(r),{})}}function Oi(t,e){return function(n,r){var i;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Kr(n),r=Kr(r)):(n=Zr(n),r=Zr(r)),i=t(n,r)}return i}}function Pi(t){return Hi((function(e){return e=fe(e,Oe(Zi())),Ur((function(n){var r=this;return t(e,(function(t){return Ve(t,r,n)}))}))}))}function ki(t,e){var n=(e=void 0===e?" ":Kr(e)).length;if(n<2)return n?Lr(e,t):e;var r=Lr(e,Je(t/Ge(e)));return Fe(e)?ui(Ye(r),0,t).join(""):r.slice(0,t)}function Ii(t){return function(e,n,i){return i&&"number"!=typeof i&&aV(e,n,i)&&(n=i=void 0),e=rs(e),void 0===n?(n=e,e=0):n=rs(n),function(t,e,n,i){for(var V=-1,o=sn(Je((e-t)/(n||1)),0),s=r(o);o--;)s[i?o:++V]=t,t+=n;return s}(e,n,i=void 0===i?e<n?1:-1:rs(i),t)}}function Di(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=os(e),n=os(n)),t(e,n)}}function Ni(t,e,n,r,i,V,o,s,a,c){var u=8&e;e|=u?32:64,4&(e&=~(u?64:32))||(e&=-4);var h=[t,e,i,u?V:void 0,u?o:void 0,u?void 0:V,u?void 0:o,s,a,c],l=n.apply(void 0,h);return uV(t)&&yV(l,h),l.placeholder=r,wV(l,t,e)}function ji(t){var e=ft[t];return function(t,n){if(t=os(t),(n=null==n?0:an(is(n),292))&&rn(t)){var r=(as(t)+"e").split("e");return+((r=(as(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Li=gn&&1/ze(new gn([,-0]))[1]==1/0?function(t){return new gn(t)}:Ks;function Ui(t){return function(e){var n=rV(e);return n==p?Be(e):n==y?He(e):function(t,e){return fe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Fi(t,e,n,i,s,a,c,u){var h=2&e;if(!h&&"function"!=typeof t)throw new vt(V);var l=i?i.length:0;if(l||(e&=-97,i=s=void 0),c=void 0===c?c:sn(is(c),0),u=void 0===u?u:is(u),l-=s?s.length:0,64&e){var f=i,d=s;i=s=void 0}var p=h?void 0:$i(t),g=[t,e,n,i,s,f,d,a,c,u];if(p&&function(t,e){var n=t[1],r=e[1],i=n|r,V=i<131,s=128==r&&8==n||128==r&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!V&&!s)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var a=e[3];if(a){var c=t[3];t[3]=c?gi(c,a,e[4]):a,t[4]=c?qe(t[3],o):e[4]}(a=e[5])&&(c=t[5],t[5]=c?vi(c,a,e[6]):a,t[6]=c?qe(t[5],o):e[6]);(a=e[7])&&(t[7]=a);128&r&&(t[8]=null==t[8]?e[8]:an(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(g,p),t=g[0],e=g[1],n=g[2],i=g[3],s=g[4],!(u=g[9]=void 0===g[9]?h?0:t.length:sn(g[9]-l,0))&&24&e&&(e&=-25),e&&1!=e)v=8==e||16==e?function(t,e,n){var i=Ti(t);return function V(){for(var o=arguments.length,s=r(o),a=o,c=Xi(V);a--;)s[a]=arguments[a];var u=o<3&&s[0]!==c&&s[o-1]!==c?[]:qe(s,c);if((o-=u.length)<n)return Ni(t,e,Ri,V.placeholder,void 0,s,u,void 0,void 0,n-o);var h=this&&this!==Yt&&this instanceof V?i:t;return Ve(h,this,s)}}(t,e,u):32!=e&&33!=e||s.length?Ri.apply(void 0,g):function(t,e,n,i){var V=1&e,o=Ti(t);return function e(){for(var s=-1,a=arguments.length,c=-1,u=i.length,h=r(u+a),l=this&&this!==Yt&&this instanceof e?o:t;++c<u;)h[c]=i[c];for(;a--;)h[c++]=arguments[++s];return Ve(l,V?n:this,h)}}(t,e,n,i);else var v=function(t,e,n){var r=1&e,i=Ti(t);return function e(){var V=this&&this!==Yt&&this instanceof e?i:t;return V.apply(r?n:this,arguments)}}(t,e,n);return wV((p?qr:yV)(v,g),t,e)}function Bi(t,e,n,r){return void 0===t||Mo(t,bt[n])&&!At.call(r,n)?e:t}function Wi(t,e,n,r,i,V){return zo(t)&&zo(e)&&(V.set(e,t),Or(t,e,void 0,Wi,V),V.delete(e)),t}function qi(t){return $o(t)?void 0:t}function zi(t,e,n,r,i,V){var o=1&n,s=t.length,a=e.length;if(s!=a&&!(o&&a>s))return!1;var c=V.get(t),u=V.get(e);if(c&&u)return c==e&&u==t;var h=-1,l=!0,f=2&n?new jn:void 0;for(V.set(t,e),V.set(e,t);++h<s;){var d=t[h],p=e[h];if(r)var g=o?r(p,d,h,e,t,V):r(d,p,h,t,e,V);if(void 0!==g){if(g)continue;l=!1;break}if(f){if(!ve(e,(function(t,e){if(!ke(f,e)&&(d===t||i(d,t,n,r,V)))return f.push(e)}))){l=!1;break}}else if(d!==p&&!i(d,p,n,r,V)){l=!1;break}}return V.delete(t),V.delete(e),l}function Hi(t){return _V(pV(t,void 0,IV),t+"")}function Gi(t){return fr(t,_s,eV)}function Yi(t){return fr(t,ws,nV)}var $i=yn?function(t){return yn.get(t)}:Ks;function Qi(t){for(var e=t.name+"",n=bn[e],r=At.call(bn,e)?n.length:0;r--;){var i=n[r],V=i.func;if(null==V||V==t)return i.name}return e}function Xi(t){return(At.call(Rn,"placeholder")?Rn:t).placeholder}function Zi(){var t=Rn.iteratee||$s;return t=t===$s?Sr:t,arguments.length?t(arguments[0],arguments[1]):t}function Ki(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Ji(t){for(var e=_s(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,fV(i)]}return e}function tV(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Ar(n)?n:void 0}var eV=en?function(t){return null==t?[]:(t=dt(t),ue(en(t),(function(e){return Gt.call(t,e)})))}:Va,nV=en?function(t){for(var e=[];t;)de(e,eV(t)),t=Wt(t);return e}:Va,rV=dr;function iV(t,e,n){for(var r=-1,i=(e=ai(e,t)).length,V=!1;++r<i;){var o=TV(e[r]);if(!(V=null!=t&&n(t,o)))break;t=t[o]}return V||++r!=i?V:!!(i=null==t?0:t.length)&&qo(i)&&sV(o,i)&&(Io(t)||ko(t))}function VV(t){return"function"!=typeof t.constructor||lV(t)?{}:Mn(Wt(t))}function oV(t){return Io(t)||ko(t)||!!(Qt&&t&&t[Qt])}function sV(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&at.test(t))&&t>-1&&t%1==0&&t<e}function aV(t,e,n){if(!zo(n))return!1;var r=typeof e;return!!("number"==r?No(n)&&sV(e,n.length):"string"==r&&e in n)&&Mo(n[e],t)}function cV(t,e){if(Io(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ko(t))||(z.test(t)||!q.test(t)||null!=e&&t in dt(e))}function uV(t){var e=Qi(t),n=Rn[e];if("function"!=typeof n||!(e in kn.prototype))return!1;if(t===n)return!0;var r=$i(n);return!!r&&t===r[0]}(fn&&rV(new fn(new ArrayBuffer(1)))!=S||dn&&rV(new dn)!=p||pn&&"[object Promise]"!=rV(pn.resolve())||gn&&rV(new gn)!=y||vn&&rV(new vn)!=w)&&(rV=function(t){var e=dr(t),n=e==v?t.constructor:void 0,r=n?CV(n):"";if(r)switch(r){case _n:return S;case wn:return p;case An:return"[object Promise]";case Sn:return y;case xn:return w}return e});var hV=_t?Bo:oa;function lV(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||bt)}function fV(t){return t==t&&!zo(t)}function dV(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in dt(n)))}}function pV(t,e,n){return e=sn(void 0===e?t.length-1:e,0),function(){for(var i=arguments,V=-1,o=sn(i.length-e,0),s=r(o);++V<o;)s[V]=i[e+V];V=-1;for(var a=r(e+1);++V<e;)a[V]=i[V];return a[e]=n(s),Ve(t,this,a)}}function gV(t,e){return e.length<2?t:lr(t,Gr(e,0,-1))}function vV(t,e){for(var n=t.length,r=an(e.length,n),i=mi(t);r--;){var V=e[r];t[r]=sV(V,n)?i[V]:void 0}return t}function mV(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var yV=AV(qr),bV=Ke||function(t,e){return Yt.setTimeout(t,e)},_V=AV(zr);function wV(t,e,n){var r=e+"";return _V(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(X,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return se(s,(function(n){var r="_."+n[0];e&n[1]&&!he(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(Z);return e?e[1].split(K):[]}(r),n)))}function AV(t){var e=0,n=0;return function(){var r=cn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function SV(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n<e;){var V=jr(n,i),o=t[V];t[V]=t[n],t[n]=o}return t.length=e,t}var xV=function(t){var e=So(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(H,(function(t,n,r,i){e.push(r?i.replace(et,"$1"):n||t)})),e}));function TV(t){if("string"==typeof t||Ko(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function CV(t){if(null!=t){try{return wt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function EV(t){if(t instanceof kn)return t.clone();var e=new Pn(t.__wrapped__,t.__chain__);return e.__actions__=mi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var RV=Ur((function(t,e){return jo(t)?tr(t,or(e,1,jo,!0)):[]})),MV=Ur((function(t,e){var n=UV(e);return jo(n)&&(n=void 0),jo(t)?tr(t,or(e,1,jo,!0),Zi(n,2)):[]})),OV=Ur((function(t,e){var n=UV(e);return jo(n)&&(n=void 0),jo(t)?tr(t,or(e,1,jo,!0),void 0,n):[]}));function PV(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:is(n);return i<0&&(i=sn(r+i,0)),be(t,Zi(e,3),i)}function kV(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=is(n),i=n<0?sn(r+i,0):an(i,r-1)),be(t,Zi(e,3),i,!0)}function IV(t){return(null==t?0:t.length)?or(t,1):[]}function DV(t){return t&&t.length?t[0]:void 0}var NV=Ur((function(t){var e=fe(t,oi);return e.length&&e[0]===t[0]?mr(e):[]})),jV=Ur((function(t){var e=UV(t),n=fe(t,oi);return e===UV(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?mr(n,Zi(e,2)):[]})),LV=Ur((function(t){var e=UV(t),n=fe(t,oi);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?mr(n,void 0,e):[]}));function UV(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var FV=Ur(BV);function BV(t,e){return t&&t.length&&e&&e.length?Dr(t,e):t}var WV=Hi((function(t,e){var n=null==t?0:t.length,r=Qn(t,e);return Nr(t,fe(e,(function(t){return sV(t,n)?+t:t})).sort(pi)),r}));function qV(t){return null==t?t:ln.call(t)}var zV=Ur((function(t){return Jr(or(t,1,jo,!0))})),HV=Ur((function(t){var e=UV(t);return jo(e)&&(e=void 0),Jr(or(t,1,jo,!0),Zi(e,2))})),GV=Ur((function(t){var e=UV(t);return e="function"==typeof e?e:void 0,Jr(or(t,1,jo,!0),void 0,e)}));function YV(t){if(!t||!t.length)return[];var e=0;return t=ue(t,(function(t){if(jo(t))return e=sn(t.length,e),!0})),Re(e,(function(e){return fe(t,xe(e))}))}function $V(t,e){if(!t||!t.length)return[];var n=YV(t);return null==e?n:fe(n,(function(t){return Ve(e,void 0,t)}))}var QV=Ur((function(t,e){return jo(t)?tr(t,e):[]})),XV=Ur((function(t){return ii(ue(t,jo))})),ZV=Ur((function(t){var e=UV(t);return jo(e)&&(e=void 0),ii(ue(t,jo),Zi(e,2))})),KV=Ur((function(t){var e=UV(t);return e="function"==typeof e?e:void 0,ii(ue(t,jo),void 0,e)})),JV=Ur(YV);var to=Ur((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,$V(t,n)}));function eo(t){var e=Rn(t);return e.__chain__=!0,e}function no(t,e){return e(t)}var ro=Hi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Qn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof kn&&sV(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:no,args:[i],thisArg:void 0}),new Pn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var io=bi((function(t,e,n){At.call(t,n)?++t[n]:$n(t,n,1)}));var Vo=Ci(PV),oo=Ci(kV);function so(t,e){return(Io(t)?se:er)(t,Zi(e,3))}function ao(t,e){return(Io(t)?ae:nr)(t,Zi(e,3))}var co=bi((function(t,e,n){At.call(t,n)?t[n].push(e):$n(t,n,[e])}));var uo=Ur((function(t,e,n){var i=-1,V="function"==typeof e,o=No(t)?r(t.length):[];return er(t,(function(t){o[++i]=V?Ve(e,t,n):yr(t,e,n)})),o})),ho=bi((function(t,e,n){$n(t,n,e)}));function lo(t,e){return(Io(t)?fe:Er)(t,Zi(e,3))}var fo=bi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var po=Ur((function(t,e){if(null==t)return[];var n=e.length;return n>1&&aV(t,e[0],e[1])?e=[]:n>2&&aV(e[0],e[1],e[2])&&(e=[e[0]]),kr(t,or(e,1),[])})),go=Ze||function(){return Yt.Date.now()};function vo(t,e,n){return e=n?void 0:e,Fi(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function mo(t,e){var n;if("function"!=typeof e)throw new vt(V);return t=is(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var yo=Ur((function(t,e,n){var r=1;if(n.length){var i=qe(n,Xi(yo));r|=32}return Fi(t,r,e,n,i)})),bo=Ur((function(t,e,n){var r=3;if(n.length){var i=qe(n,Xi(bo));r|=32}return Fi(e,r,t,n,i)}));function _o(t,e,n){var r,i,o,s,a,c,u=0,h=!1,l=!1,f=!0;if("function"!=typeof t)throw new vt(V);function d(e){var n=r,V=i;return r=i=void 0,u=e,s=t.apply(V,n)}function p(t){return u=t,a=bV(v,e),h?d(t):s}function g(t){var n=t-c;return void 0===c||n>=e||n<0||l&&t-u>=o}function v(){var t=go();if(g(t))return m(t);a=bV(v,function(t){var n=e-(t-c);return l?an(n,o-(t-u)):n}(t))}function m(t){return a=void 0,f&&r?d(t):(r=i=void 0,s)}function y(){var t=go(),n=g(t);if(r=arguments,i=this,c=t,n){if(void 0===a)return p(c);if(l)return hi(a),a=bV(v,e),d(c)}return void 0===a&&(a=bV(v,e)),s}return e=os(e)||0,zo(n)&&(h=!!n.leading,o=(l="maxWait"in n)?sn(os(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==a&&hi(a),u=0,r=c=i=a=void 0},y.flush=function(){return void 0===a?s:m(go())},y}var wo=Ur((function(t,e){return Jn(t,1,e)})),Ao=Ur((function(t,e,n){return Jn(t,os(e)||0,n)}));function So(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new vt(V);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],V=n.cache;if(V.has(i))return V.get(i);var o=t.apply(this,r);return n.cache=V.set(i,o)||V,o};return n.cache=new(So.Cache||Nn),n}function xo(t){if("function"!=typeof t)throw new vt(V);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}So.Cache=Nn;var To=ci((function(t,e){var n=(e=1==e.length&&Io(e[0])?fe(e[0],Oe(Zi())):fe(or(e,1),Oe(Zi()))).length;return Ur((function(r){for(var i=-1,V=an(r.length,n);++i<V;)r[i]=e[i].call(this,r[i]);return Ve(t,this,r)}))})),Co=Ur((function(t,e){return Fi(t,32,void 0,e,qe(e,Xi(Co)))})),Eo=Ur((function(t,e){return Fi(t,64,void 0,e,qe(e,Xi(Eo)))})),Ro=Hi((function(t,e){return Fi(t,256,void 0,void 0,void 0,e)}));function Mo(t,e){return t===e||t!=t&&e!=e}var Oo=Di(pr),Po=Di((function(t,e){return t>=e})),ko=br(function(){return arguments}())?br:function(t){return Ho(t)&&At.call(t,"callee")&&!Gt.call(t,"callee")},Io=r.isArray,Do=Jt?Oe(Jt):function(t){return Ho(t)&&dr(t)==A};function No(t){return null!=t&&qo(t.length)&&!Bo(t)}function jo(t){return Ho(t)&&No(t)}var Lo=nn||oa,Uo=te?Oe(te):function(t){return Ho(t)&&dr(t)==h};function Fo(t){if(!Ho(t))return!1;var e=dr(t);return e==l||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!$o(t)}function Bo(t){if(!zo(t))return!1;var e=dr(t);return e==f||e==d||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Wo(t){return"number"==typeof t&&t==is(t)}function qo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function zo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ho(t){return null!=t&&"object"==typeof t}var Go=ee?Oe(ee):function(t){return Ho(t)&&rV(t)==p};function Yo(t){return"number"==typeof t||Ho(t)&&dr(t)==g}function $o(t){if(!Ho(t)||dr(t)!=v)return!1;var e=Wt(t);if(null===e)return!0;var n=At.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&wt.call(n)==Ct}var Qo=ne?Oe(ne):function(t){return Ho(t)&&dr(t)==m};var Xo=re?Oe(re):function(t){return Ho(t)&&rV(t)==y};function Zo(t){return"string"==typeof t||!Io(t)&&Ho(t)&&dr(t)==b}function Ko(t){return"symbol"==typeof t||Ho(t)&&dr(t)==_}var Jo=ie?Oe(ie):function(t){return Ho(t)&&qo(t.length)&&!!Ft[dr(t)]};var ts=Di(Cr),es=Di((function(t,e){return t<=e}));function ns(t){if(!t)return[];if(No(t))return Zo(t)?Ye(t):mi(t);if(Zt&&t[Zt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Zt]());var e=rV(t);return(e==p?Be:e==y?ze:Ms)(t)}function rs(t){return t?(t=os(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function is(t){var e=rs(t),n=e%1;return e==e?n?e-n:e:0}function Vs(t){return t?Xn(is(t),0,4294967295):0}function os(t){if("number"==typeof t)return t;if(Ko(t))return NaN;if(zo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=zo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Me(t);var n=Vt.test(t);return n||st.test(t)?zt(t.slice(2),n?2:8):it.test(t)?NaN:+t}function ss(t){return yi(t,ws(t))}function as(t){return null==t?"":Kr(t)}var cs=_i((function(t,e){if(lV(e)||No(e))yi(e,_s(e),t);else for(var n in e)At.call(e,n)&&zn(t,n,e[n])})),us=_i((function(t,e){yi(e,ws(e),t)})),hs=_i((function(t,e,n,r){yi(e,ws(e),t,r)})),ls=_i((function(t,e,n,r){yi(e,_s(e),t,r)})),fs=Hi(Qn);var ds=Ur((function(t,e){t=dt(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&aV(e[0],e[1],i)&&(r=1);++n<r;)for(var V=e[n],o=ws(V),s=-1,a=o.length;++s<a;){var c=o[s],u=t[c];(void 0===u||Mo(u,bt[c])&&!At.call(t,c))&&(t[c]=V[c])}return t})),ps=Ur((function(t){return t.push(void 0,Wi),Ve(Ss,void 0,t)}));function gs(t,e,n){var r=null==t?void 0:lr(t,e);return void 0===r?n:r}function vs(t,e){return null!=t&&iV(t,e,vr)}var ms=Mi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Tt.call(e)),t[e]=n}),zs(Ys)),ys=Mi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Tt.call(e)),At.call(t,e)?t[e].push(n):t[e]=[n]}),Zi),bs=Ur(yr);function _s(t){return No(t)?Un(t):xr(t)}function ws(t){return No(t)?Un(t,!0):Tr(t)}var As=_i((function(t,e,n){Or(t,e,n)})),Ss=_i((function(t,e,n,r){Or(t,e,n,r)})),xs=Hi((function(t,e){var n={};if(null==t)return n;var r=!1;e=fe(e,(function(e){return e=ai(e,t),r||(r=e.length>1),e})),yi(t,Yi(t),n),r&&(n=Zn(n,7,qi));for(var i=e.length;i--;)ti(n,e[i]);return n}));var Ts=Hi((function(t,e){return null==t?{}:function(t,e){return Ir(t,e,(function(e,n){return vs(t,n)}))}(t,e)}));function Cs(t,e){if(null==t)return{};var n=fe(Yi(t),(function(t){return[t]}));return e=Zi(e),Ir(t,n,(function(t,n){return e(t,n[0])}))}var Es=Ui(_s),Rs=Ui(ws);function Ms(t){return null==t?[]:Pe(t,_s(t))}var Os=xi((function(t,e,n){return e=e.toLowerCase(),t+(n?Ps(e):e)}));function Ps(t){return Fs(as(t).toLowerCase())}function ks(t){return(t=as(t))&&t.replace(ct,je).replace(kt,"")}var Is=xi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ds=xi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ns=Si("toLowerCase");var js=xi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Ls=xi((function(t,e,n){return t+(n?" ":"")+Fs(e)}));var Us=xi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Fs=Si("toUpperCase");function Bs(t,e,n){return t=as(t),void 0===(e=n?void 0:e)?function(t){return jt.test(t)}(t)?function(t){return t.match(Dt)||[]}(t):function(t){return t.match(J)||[]}(t):t.match(e)||[]}var Ws=Ur((function(t,e){try{return Ve(t,void 0,e)}catch(t){return Fo(t)?t:new Q(t)}})),qs=Hi((function(t,e){return se(e,(function(e){e=TV(e),$n(t,e,yo(t[e],t))})),t}));function zs(t){return function(){return t}}var Hs=Ei(),Gs=Ei(!0);function Ys(t){return t}function $s(t){return Sr("function"==typeof t?t:Zn(t,1))}var Qs=Ur((function(t,e){return function(n){return yr(n,t,e)}})),Xs=Ur((function(t,e){return function(n){return yr(t,n,e)}}));function Zs(t,e,n){var r=_s(e),i=hr(e,r);null!=n||zo(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=hr(e,_s(e)));var V=!(zo(n)&&"chain"in n&&!n.chain),o=Bo(t);return se(i,(function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(V||e){var n=t(this.__wrapped__),i=n.__actions__=mi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,de([this.value()],arguments))})})),t}function Ks(){}var Js=Pi(fe),ta=Pi(ce),ea=Pi(ve);function na(t){return cV(t)?xe(TV(t)):function(t){return function(e){return lr(e,t)}}(t)}var ra=Ii(),ia=Ii(!0);function Va(){return[]}function oa(){return!1}var sa=Oi((function(t,e){return t+e}),0),aa=ji("ceil"),ca=Oi((function(t,e){return t/e}),1),ua=ji("floor");var ha,la=Oi((function(t,e){return t*e}),1),fa=ji("round"),da=Oi((function(t,e){return t-e}),0);return Rn.after=function(t,e){if("function"!=typeof e)throw new vt(V);return t=is(t),function(){if(--t<1)return e.apply(this,arguments)}},Rn.ary=vo,Rn.assign=cs,Rn.assignIn=us,Rn.assignInWith=hs,Rn.assignWith=ls,Rn.at=fs,Rn.before=mo,Rn.bind=yo,Rn.bindAll=qs,Rn.bindKey=bo,Rn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Io(t)?t:[t]},Rn.chain=eo,Rn.chunk=function(t,e,n){e=(n?aV(t,e,n):void 0===e)?1:sn(is(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var V=0,o=0,s=r(Je(i/e));V<i;)s[o++]=Gr(t,V,V+=e);return s},Rn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var V=t[e];V&&(i[r++]=V)}return i},Rn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return de(Io(n)?mi(n):[n],or(e,1))},Rn.cond=function(t){var e=null==t?0:t.length,n=Zi();return t=e?fe(t,(function(t){if("function"!=typeof t[1])throw new vt(V);return[n(t[0]),t[1]]})):[],Ur((function(n){for(var r=-1;++r<e;){var i=t[r];if(Ve(i[0],this,n))return Ve(i[1],this,n)}}))},Rn.conforms=function(t){return function(t){var e=_s(t);return function(n){return Kn(n,t,e)}}(Zn(t,1))},Rn.constant=zs,Rn.countBy=io,Rn.create=function(t,e){var n=Mn(t);return null==e?n:Yn(n,e)},Rn.curry=function t(e,n,r){var i=Fi(e,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},Rn.curryRight=function t(e,n,r){var i=Fi(e,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},Rn.debounce=_o,Rn.defaults=ds,Rn.defaultsDeep=ps,Rn.defer=wo,Rn.delay=Ao,Rn.difference=RV,Rn.differenceBy=MV,Rn.differenceWith=OV,Rn.drop=function(t,e,n){var r=null==t?0:t.length;return r?Gr(t,(e=n||void 0===e?1:is(e))<0?0:e,r):[]},Rn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?Gr(t,0,(e=r-(e=n||void 0===e?1:is(e)))<0?0:e):[]},Rn.dropRightWhile=function(t,e){return t&&t.length?ni(t,Zi(e,3),!0,!0):[]},Rn.dropWhile=function(t,e){return t&&t.length?ni(t,Zi(e,3),!0):[]},Rn.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&aV(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=is(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:is(r))<0&&(r+=i),r=n>r?0:Vs(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Rn.filter=function(t,e){return(Io(t)?ue:Vr)(t,Zi(e,3))},Rn.flatMap=function(t,e){return or(lo(t,e),1)},Rn.flatMapDeep=function(t,e){return or(lo(t,e),1/0)},Rn.flatMapDepth=function(t,e,n){return n=void 0===n?1:is(n),or(lo(t,e),n)},Rn.flatten=IV,Rn.flattenDeep=function(t){return(null==t?0:t.length)?or(t,1/0):[]},Rn.flattenDepth=function(t,e){return(null==t?0:t.length)?or(t,e=void 0===e?1:is(e)):[]},Rn.flip=function(t){return Fi(t,512)},Rn.flow=Hs,Rn.flowRight=Gs,Rn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Rn.functions=function(t){return null==t?[]:hr(t,_s(t))},Rn.functionsIn=function(t){return null==t?[]:hr(t,ws(t))},Rn.groupBy=co,Rn.initial=function(t){return(null==t?0:t.length)?Gr(t,0,-1):[]},Rn.intersection=NV,Rn.intersectionBy=jV,Rn.intersectionWith=LV,Rn.invert=ms,Rn.invertBy=ys,Rn.invokeMap=uo,Rn.iteratee=$s,Rn.keyBy=ho,Rn.keys=_s,Rn.keysIn=ws,Rn.map=lo,Rn.mapKeys=function(t,e){var n={};return e=Zi(e,3),cr(t,(function(t,r,i){$n(n,e(t,r,i),t)})),n},Rn.mapValues=function(t,e){var n={};return e=Zi(e,3),cr(t,(function(t,r,i){$n(n,r,e(t,r,i))})),n},Rn.matches=function(t){return Rr(Zn(t,1))},Rn.matchesProperty=function(t,e){return Mr(t,Zn(e,1))},Rn.memoize=So,Rn.merge=As,Rn.mergeWith=Ss,Rn.method=Qs,Rn.methodOf=Xs,Rn.mixin=Zs,Rn.negate=xo,Rn.nthArg=function(t){return t=is(t),Ur((function(e){return Pr(e,t)}))},Rn.omit=xs,Rn.omitBy=function(t,e){return Cs(t,xo(Zi(e)))},Rn.once=function(t){return mo(2,t)},Rn.orderBy=function(t,e,n,r){return null==t?[]:(Io(e)||(e=null==e?[]:[e]),Io(n=r?void 0:n)||(n=null==n?[]:[n]),kr(t,e,n))},Rn.over=Js,Rn.overArgs=To,Rn.overEvery=ta,Rn.overSome=ea,Rn.partial=Co,Rn.partialRight=Eo,Rn.partition=fo,Rn.pick=Ts,Rn.pickBy=Cs,Rn.property=na,Rn.propertyOf=function(t){return function(e){return null==t?void 0:lr(t,e)}},Rn.pull=FV,Rn.pullAll=BV,Rn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Dr(t,e,Zi(n,2)):t},Rn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Dr(t,e,void 0,n):t},Rn.pullAt=WV,Rn.range=ra,Rn.rangeRight=ia,Rn.rearg=Ro,Rn.reject=function(t,e){return(Io(t)?ue:Vr)(t,xo(Zi(e,3)))},Rn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],V=t.length;for(e=Zi(e,3);++r<V;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return Nr(t,i),n},Rn.rest=function(t,e){if("function"!=typeof t)throw new vt(V);return Ur(t,e=void 0===e?e:is(e))},Rn.reverse=qV,Rn.sampleSize=function(t,e,n){return e=(n?aV(t,e,n):void 0===e)?1:is(e),(Io(t)?Bn:Br)(t,e)},Rn.set=function(t,e,n){return null==t?t:Wr(t,e,n)},Rn.setWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Wr(t,e,n,r)},Rn.shuffle=function(t){return(Io(t)?Wn:Hr)(t)},Rn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&aV(t,e,n)?(e=0,n=r):(e=null==e?0:is(e),n=void 0===n?r:is(n)),Gr(t,e,n)):[]},Rn.sortBy=po,Rn.sortedUniq=function(t){return t&&t.length?Xr(t):[]},Rn.sortedUniqBy=function(t,e){return t&&t.length?Xr(t,Zi(e,2)):[]},Rn.split=function(t,e,n){return n&&"number"!=typeof n&&aV(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=as(t))&&("string"==typeof e||null!=e&&!Qo(e))&&!(e=Kr(e))&&Fe(t)?ui(Ye(t),0,n):t.split(e,n):[]},Rn.spread=function(t,e){if("function"!=typeof t)throw new vt(V);return e=null==e?0:sn(is(e),0),Ur((function(n){var r=n[e],i=ui(n,0,e);return r&&de(i,r),Ve(t,this,i)}))},Rn.tail=function(t){var e=null==t?0:t.length;return e?Gr(t,1,e):[]},Rn.take=function(t,e,n){return t&&t.length?Gr(t,0,(e=n||void 0===e?1:is(e))<0?0:e):[]},Rn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Gr(t,(e=r-(e=n||void 0===e?1:is(e)))<0?0:e,r):[]},Rn.takeRightWhile=function(t,e){return t&&t.length?ni(t,Zi(e,3),!1,!0):[]},Rn.takeWhile=function(t,e){return t&&t.length?ni(t,Zi(e,3)):[]},Rn.tap=function(t,e){return e(t),t},Rn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new vt(V);return zo(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),_o(t,e,{leading:r,maxWait:e,trailing:i})},Rn.thru=no,Rn.toArray=ns,Rn.toPairs=Es,Rn.toPairsIn=Rs,Rn.toPath=function(t){return Io(t)?fe(t,TV):Ko(t)?[t]:mi(xV(as(t)))},Rn.toPlainObject=ss,Rn.transform=function(t,e,n){var r=Io(t),i=r||Lo(t)||Jo(t);if(e=Zi(e,4),null==n){var V=t&&t.constructor;n=i?r?new V:[]:zo(t)&&Bo(V)?Mn(Wt(t)):{}}return(i?se:cr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Rn.unary=function(t){return vo(t,1)},Rn.union=zV,Rn.unionBy=HV,Rn.unionWith=GV,Rn.uniq=function(t){return t&&t.length?Jr(t):[]},Rn.uniqBy=function(t,e){return t&&t.length?Jr(t,Zi(e,2)):[]},Rn.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jr(t,void 0,e):[]},Rn.unset=function(t,e){return null==t||ti(t,e)},Rn.unzip=YV,Rn.unzipWith=$V,Rn.update=function(t,e,n){return null==t?t:ei(t,e,si(n))},Rn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ei(t,e,si(n),r)},Rn.values=Ms,Rn.valuesIn=function(t){return null==t?[]:Pe(t,ws(t))},Rn.without=QV,Rn.words=Bs,Rn.wrap=function(t,e){return Co(si(e),t)},Rn.xor=XV,Rn.xorBy=ZV,Rn.xorWith=KV,Rn.zip=JV,Rn.zipObject=function(t,e){return Vi(t||[],e||[],zn)},Rn.zipObjectDeep=function(t,e){return Vi(t||[],e||[],Wr)},Rn.zipWith=to,Rn.entries=Es,Rn.entriesIn=Rs,Rn.extend=us,Rn.extendWith=hs,Zs(Rn,Rn),Rn.add=sa,Rn.attempt=Ws,Rn.camelCase=Os,Rn.capitalize=Ps,Rn.ceil=aa,Rn.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=os(n))==n?n:0),void 0!==e&&(e=(e=os(e))==e?e:0),Xn(os(t),e,n)},Rn.clone=function(t){return Zn(t,4)},Rn.cloneDeep=function(t){return Zn(t,5)},Rn.cloneDeepWith=function(t,e){return Zn(t,5,e="function"==typeof e?e:void 0)},Rn.cloneWith=function(t,e){return Zn(t,4,e="function"==typeof e?e:void 0)},Rn.conformsTo=function(t,e){return null==e||Kn(t,e,_s(e))},Rn.deburr=ks,Rn.defaultTo=function(t,e){return null==t||t!=t?e:t},Rn.divide=ca,Rn.endsWith=function(t,e,n){t=as(t),e=Kr(e);var r=t.length,i=n=void 0===n?r:Xn(is(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Rn.eq=Mo,Rn.escape=function(t){return(t=as(t))&&U.test(t)?t.replace(j,Le):t},Rn.escapeRegExp=function(t){return(t=as(t))&&Y.test(t)?t.replace(G,"\\$&"):t},Rn.every=function(t,e,n){var r=Io(t)?ce:rr;return n&&aV(t,e,n)&&(e=void 0),r(t,Zi(e,3))},Rn.find=Vo,Rn.findIndex=PV,Rn.findKey=function(t,e){return ye(t,Zi(e,3),cr)},Rn.findLast=oo,Rn.findLastIndex=kV,Rn.findLastKey=function(t,e){return ye(t,Zi(e,3),ur)},Rn.floor=ua,Rn.forEach=so,Rn.forEachRight=ao,Rn.forIn=function(t,e){return null==t?t:sr(t,Zi(e,3),ws)},Rn.forInRight=function(t,e){return null==t?t:ar(t,Zi(e,3),ws)},Rn.forOwn=function(t,e){return t&&cr(t,Zi(e,3))},Rn.forOwnRight=function(t,e){return t&&ur(t,Zi(e,3))},Rn.get=gs,Rn.gt=Oo,Rn.gte=Po,Rn.has=function(t,e){return null!=t&&iV(t,e,gr)},Rn.hasIn=vs,Rn.head=DV,Rn.identity=Ys,Rn.includes=function(t,e,n,r){t=No(t)?t:Ms(t),n=n&&!r?is(n):0;var i=t.length;return n<0&&(n=sn(i+n,0)),Zo(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&_e(t,e,n)>-1},Rn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:is(n);return i<0&&(i=sn(r+i,0)),_e(t,e,i)},Rn.inRange=function(t,e,n){return e=rs(e),void 0===n?(n=e,e=0):n=rs(n),function(t,e,n){return t>=an(e,n)&&t<sn(e,n)}(t=os(t),e,n)},Rn.invoke=bs,Rn.isArguments=ko,Rn.isArray=Io,Rn.isArrayBuffer=Do,Rn.isArrayLike=No,Rn.isArrayLikeObject=jo,Rn.isBoolean=function(t){return!0===t||!1===t||Ho(t)&&dr(t)==u},Rn.isBuffer=Lo,Rn.isDate=Uo,Rn.isElement=function(t){return Ho(t)&&1===t.nodeType&&!$o(t)},Rn.isEmpty=function(t){if(null==t)return!0;if(No(t)&&(Io(t)||"string"==typeof t||"function"==typeof t.splice||Lo(t)||Jo(t)||ko(t)))return!t.length;var e=rV(t);if(e==p||e==y)return!t.size;if(lV(t))return!xr(t).length;for(var n in t)if(At.call(t,n))return!1;return!0},Rn.isEqual=function(t,e){return _r(t,e)},Rn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?_r(t,e,void 0,n):!!r},Rn.isError=Fo,Rn.isFinite=function(t){return"number"==typeof t&&rn(t)},Rn.isFunction=Bo,Rn.isInteger=Wo,Rn.isLength=qo,Rn.isMap=Go,Rn.isMatch=function(t,e){return t===e||wr(t,e,Ji(e))},Rn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:void 0,wr(t,e,Ji(e),n)},Rn.isNaN=function(t){return Yo(t)&&t!=+t},Rn.isNative=function(t){if(hV(t))throw new Q("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ar(t)},Rn.isNil=function(t){return null==t},Rn.isNull=function(t){return null===t},Rn.isNumber=Yo,Rn.isObject=zo,Rn.isObjectLike=Ho,Rn.isPlainObject=$o,Rn.isRegExp=Qo,Rn.isSafeInteger=function(t){return Wo(t)&&t>=-9007199254740991&&t<=9007199254740991},Rn.isSet=Xo,Rn.isString=Zo,Rn.isSymbol=Ko,Rn.isTypedArray=Jo,Rn.isUndefined=function(t){return void 0===t},Rn.isWeakMap=function(t){return Ho(t)&&rV(t)==w},Rn.isWeakSet=function(t){return Ho(t)&&"[object WeakSet]"==dr(t)},Rn.join=function(t,e){return null==t?"":Vn.call(t,e)},Rn.kebabCase=Is,Rn.last=UV,Rn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=is(n))<0?sn(r+i,0):an(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):be(t,Ae,i,!0)},Rn.lowerCase=Ds,Rn.lowerFirst=Ns,Rn.lt=ts,Rn.lte=es,Rn.max=function(t){return t&&t.length?ir(t,Ys,pr):void 0},Rn.maxBy=function(t,e){return t&&t.length?ir(t,Zi(e,2),pr):void 0},Rn.mean=function(t){return Se(t,Ys)},Rn.meanBy=function(t,e){return Se(t,Zi(e,2))},Rn.min=function(t){return t&&t.length?ir(t,Ys,Cr):void 0},Rn.minBy=function(t,e){return t&&t.length?ir(t,Zi(e,2),Cr):void 0},Rn.stubArray=Va,Rn.stubFalse=oa,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=la,Rn.nth=function(t,e){return t&&t.length?Pr(t,is(e)):void 0},Rn.noConflict=function(){return Yt._===this&&(Yt._=Et),this},Rn.noop=Ks,Rn.now=go,Rn.pad=function(t,e,n){t=as(t);var r=(e=is(e))?Ge(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return ki(tn(i),n)+t+ki(Je(i),n)},Rn.padEnd=function(t,e,n){t=as(t);var r=(e=is(e))?Ge(t):0;return e&&r<e?t+ki(e-r,n):t},Rn.padStart=function(t,e,n){t=as(t);var r=(e=is(e))?Ge(t):0;return e&&r<e?ki(e-r,n)+t:t},Rn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),un(as(t).replace($,""),e||0)},Rn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&aV(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=rs(t),void 0===e?(e=t,t=0):e=rs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=hn();return an(t+i*(e-t+qt("1e-"+((i+"").length-1))),e)}return jr(t,e)},Rn.reduce=function(t,e,n){var r=Io(t)?pe:Ce,i=arguments.length<3;return r(t,Zi(e,4),n,i,er)},Rn.reduceRight=function(t,e,n){var r=Io(t)?ge:Ce,i=arguments.length<3;return r(t,Zi(e,4),n,i,nr)},Rn.repeat=function(t,e,n){return e=(n?aV(t,e,n):void 0===e)?1:is(e),Lr(as(t),e)},Rn.replace=function(){var t=arguments,e=as(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Rn.result=function(t,e,n){var r=-1,i=(e=ai(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var V=null==t?void 0:t[TV(e[r])];void 0===V&&(r=i,V=n),t=Bo(V)?V.call(t):V}return t},Rn.round=fa,Rn.runInContext=t,Rn.sample=function(t){return(Io(t)?Fn:Fr)(t)},Rn.size=function(t){if(null==t)return 0;if(No(t))return Zo(t)?Ge(t):t.length;var e=rV(t);return e==p||e==y?t.size:xr(t).length},Rn.snakeCase=js,Rn.some=function(t,e,n){var r=Io(t)?ve:Yr;return n&&aV(t,e,n)&&(e=void 0),r(t,Zi(e,3))},Rn.sortedIndex=function(t,e){return $r(t,e)},Rn.sortedIndexBy=function(t,e,n){return Qr(t,e,Zi(n,2))},Rn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=$r(t,e);if(r<n&&Mo(t[r],e))return r}return-1},Rn.sortedLastIndex=function(t,e){return $r(t,e,!0)},Rn.sortedLastIndexBy=function(t,e,n){return Qr(t,e,Zi(n,2),!0)},Rn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=$r(t,e,!0)-1;if(Mo(t[n],e))return n}return-1},Rn.startCase=Ls,Rn.startsWith=function(t,e,n){return t=as(t),n=null==n?0:Xn(is(n),0,t.length),e=Kr(e),t.slice(n,n+e.length)==e},Rn.subtract=da,Rn.sum=function(t){return t&&t.length?Ee(t,Ys):0},Rn.sumBy=function(t,e){return t&&t.length?Ee(t,Zi(e,2)):0},Rn.template=function(t,e,n){var r=Rn.templateSettings;n&&aV(t,e,n)&&(e=void 0),t=as(t),e=hs({},e,r,Bi);var i,V,o=hs({},e.imports,r.imports,Bi),s=_s(o),a=Pe(o,s),c=0,u=e.interpolate||ut,h="__p += '",l=pt((e.escape||ut).source+"|"+u.source+"|"+(u===W?nt:ut).source+"|"+(e.evaluate||ut).source+"|$","g"),f="//# sourceURL="+(At.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(l,(function(e,n,r,o,s,a){return r||(r=o),h+=t.slice(c,a).replace(ht,Ue),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),s&&(V=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=a+e.length,e})),h+="';\n";var d=At.call(e,"variable")&&e.variable;if(d){if(tt.test(d))throw new Q("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(V?h.replace(k,""):h).replace(I,"$1").replace(D,"$1;"),h="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(V?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var p=Ws((function(){return lt(s,f+"return "+h).apply(void 0,a)}));if(p.source=h,Fo(p))throw p;return p},Rn.times=function(t,e){if((t=is(t))<1||t>9007199254740991)return[];var n=4294967295,r=an(t,4294967295);t-=4294967295;for(var i=Re(r,e=Zi(e));++n<t;)e(n);return i},Rn.toFinite=rs,Rn.toInteger=is,Rn.toLength=Vs,Rn.toLower=function(t){return as(t).toLowerCase()},Rn.toNumber=os,Rn.toSafeInteger=function(t){return t?Xn(is(t),-9007199254740991,9007199254740991):0===t?t:0},Rn.toString=as,Rn.toUpper=function(t){return as(t).toUpperCase()},Rn.trim=function(t,e,n){if((t=as(t))&&(n||void 0===e))return Me(t);if(!t||!(e=Kr(e)))return t;var r=Ye(t),i=Ye(e);return ui(r,Ie(r,i),De(r,i)+1).join("")},Rn.trimEnd=function(t,e,n){if((t=as(t))&&(n||void 0===e))return t.slice(0,$e(t)+1);if(!t||!(e=Kr(e)))return t;var r=Ye(t);return ui(r,0,De(r,Ye(e))+1).join("")},Rn.trimStart=function(t,e,n){if((t=as(t))&&(n||void 0===e))return t.replace($,"");if(!t||!(e=Kr(e)))return t;var r=Ye(t);return ui(r,Ie(r,Ye(e))).join("")},Rn.truncate=function(t,e){var n=30,r="...";if(zo(e)){var i="separator"in e?e.separator:i;n="length"in e?is(e.length):n,r="omission"in e?Kr(e.omission):r}var V=(t=as(t)).length;if(Fe(t)){var o=Ye(t);V=o.length}if(n>=V)return t;var s=n-Ge(r);if(s<1)return r;var a=o?ui(o,0,s).join(""):t.slice(0,s);if(void 0===i)return a+r;if(o&&(s+=a.length-s),Qo(i)){if(t.slice(s).search(i)){var c,u=a;for(i.global||(i=pt(i.source,as(rt.exec(i))+"g")),i.lastIndex=0;c=i.exec(u);)var h=c.index;a=a.slice(0,void 0===h?s:h)}}else if(t.indexOf(Kr(i),s)!=s){var l=a.lastIndexOf(i);l>-1&&(a=a.slice(0,l))}return a+r},Rn.unescape=function(t){return(t=as(t))&&L.test(t)?t.replace(N,Qe):t},Rn.uniqueId=function(t){var e=++St;return as(t)+e},Rn.upperCase=Us,Rn.upperFirst=Fs,Rn.each=so,Rn.eachRight=ao,Rn.first=DV,Zs(Rn,(ha={},cr(Rn,(function(t,e){At.call(Rn.prototype,e)||(ha[e]=t)})),ha),{chain:!1}),Rn.VERSION="4.17.21",se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Rn[t].placeholder=Rn})),se(["drop","take"],(function(t,e){kn.prototype[t]=function(n){n=void 0===n?1:sn(is(n),0);var r=this.__filtered__&&!e?new kn(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:t+(r.__dir__<0?"Right":"")}),r},kn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),se(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;kn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Zi(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),se(["head","last"],(function(t,e){var n="take"+(e?"Right":"");kn.prototype[t]=function(){return this[n](1).value()[0]}})),se(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");kn.prototype[t]=function(){return this.__filtered__?new kn(this):this[n](1)}})),kn.prototype.compact=function(){return this.filter(Ys)},kn.prototype.find=function(t){return this.filter(t).head()},kn.prototype.findLast=function(t){return this.reverse().find(t)},kn.prototype.invokeMap=Ur((function(t,e){return"function"==typeof t?new kn(this):this.map((function(n){return yr(n,t,e)}))})),kn.prototype.reject=function(t){return this.filter(xo(Zi(t)))},kn.prototype.slice=function(t,e){t=is(t);var n=this;return n.__filtered__&&(t>0||e<0)?new kn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=is(e))<0?n.dropRight(-e):n.take(e-t)),n)},kn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},kn.prototype.toArray=function(){return this.take(4294967295)},cr(kn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Rn[r?"take"+("last"==e?"Right":""):e],V=r||/^find/.test(e);i&&(Rn.prototype[e]=function(){var e=this.__wrapped__,o=r?[1]:arguments,s=e instanceof kn,a=o[0],c=s||Io(e),u=function(t){var e=i.apply(Rn,de([t],o));return r&&h?e[0]:e};c&&n&&"function"==typeof a&&1!=a.length&&(s=c=!1);var h=this.__chain__,l=!!this.__actions__.length,f=V&&!h,d=s&&!l;if(!V&&c){e=d?e:new kn(this);var p=t.apply(e,o);return p.__actions__.push({func:no,args:[u],thisArg:void 0}),new Pn(p,h)}return f&&d?t.apply(this,o):(p=this.thru(u),f?r?p.value()[0]:p.value():p)})})),se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=mt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Rn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Io(i)?i:[],t)}return this[n]((function(n){return e.apply(Io(n)?n:[],t)}))}})),cr(kn.prototype,(function(t,e){var n=Rn[e];if(n){var r=n.name+"";At.call(bn,r)||(bn[r]=[]),bn[r].push({name:e,func:n})}})),bn[Ri(void 0,2).name]=[{name:"wrapper",func:void 0}],kn.prototype.clone=function(){var t=new kn(this.__wrapped__);return t.__actions__=mi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=mi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=mi(this.__views__),t},kn.prototype.reverse=function(){if(this.__filtered__){var t=new kn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},kn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Io(t),r=e<0,i=n?t.length:0,V=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var V=n[r],o=V.size;switch(V.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=an(e,t+o);break;case"takeRight":t=sn(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=V.start,s=V.end,a=s-o,c=r?s:o-1,u=this.__iteratees__,h=u.length,l=0,f=an(a,this.__takeCount__);if(!n||!r&&i==a&&f==a)return ri(t,this.__actions__);var d=[];t:for(;a--&&l<f;){for(var p=-1,g=t[c+=e];++p<h;){var v=u[p],m=v.iteratee,y=v.type,b=m(g);if(2==y)g=b;else if(!b){if(1==y)continue t;break t}}d[l++]=g}return d},Rn.prototype.at=ro,Rn.prototype.chain=function(){return eo(this)},Rn.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},Rn.prototype.next=function(){void 0===this.__values__&&(this.__values__=ns(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},Rn.prototype.plant=function(t){for(var e,n=this;n instanceof On;){var r=EV(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Rn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof kn){var e=t;return this.__actions__.length&&(e=new kn(this)),(e=e.reverse()).__actions__.push({func:no,args:[qV],thisArg:void 0}),new Pn(e,this.__chain__)}return this.thru(qV)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return ri(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,Zt&&(Rn.prototype[Zt]=function(){return this}),Rn}();Yt._=Xe,void 0===(i=function(){return Xe}.call(e,n,e,r))||(r.exports=i)}).call(this)}).call(this,n(34),n(136)(t))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u}));var r=n(0),i=n(5),V=n(3),o=n(1),s=n(4),a=n(48),c=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.a(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new s.a).add(this.source.subscribe(new h(this.getSubject(),this))),t.closed&&(this._connection=null,t=s.a.EMPTY)),t},e.prototype.refCount=function(){return Object(a.a)()(this)},e}(V.a),u=function(){var t=c.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),h=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.a(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(i.b);o.a},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(5),V=n(21),o=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return r.a(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new V.a;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(0),i=n(1),V=n(17);function o(t,e){return void 0===e&&(e=0),function(n){return n.lift(new s(t,e))}}var s=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.scheduler,this.delay))},t}(),a=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return r.a(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new c(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(V.a.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(V.a.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(V.a.createComplete()),this.unsubscribe()},e}(i.a),c=function(){return function(t,e){this.notification=t,this.destination=e}}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(52);function i(){return Object(r.a)(1)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(3),i=n(9),V=n(52),o=n(26);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,s=null,a=t[t.length-1];return Object(i.a)(a)?(s=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof a&&(n=t.pop()),null===s&&1===t.length&&t[0]instanceof r.a?t[0]:Object(V.a)(n)(Object(o.a)(t,s))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(0),i=n(7),V=n(26),o=n(15),s=n(12);function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!Object(i.a)(t[0]))return t[0];t=t[0]}return Object(V.a)(t,void 0).lift(new c)}var c=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new u(t))},t}(),u=function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return r.a(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=t[n],i=Object(s.a)(this,r,void 0,n);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},e.prototype.notifyNext=function(t,e,n){if(!this.hasFirst){this.hasFirst=!0;for(var r=0;r<this.subscriptions.length;r++)if(r!==n){var i=this.subscriptions[r];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(3),i=n(6),V=n(30),o=n(9);function s(t,e,n){void 0===t&&(t=0);var s=-1;return Object(V.a)(e)?s=Number(e)<1?1:Number(e):Object(o.a)(e)&&(n=e),Object(o.a)(n)||(n=i.a),new r.a((function(e){var r=Object(V.a)(t)?t:+t-n.now();return n.schedule(a,r,{index:0,period:s,subscriber:e})}))}function a(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(3),i=n(4),V=n(20);var o=n(57),s=n(18);var a=n(77),c=n(76);function u(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[V.a]}(t))return function(t,e){return new r.a((function(n){var r=new i.a;return r.add(e.schedule((function(){var i=t[V.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}))}(t,e);if(Object(a.a)(t))return function(t,e){return new r.a((function(n){var r=new i.a;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}))}(t,e);if(Object(c.a)(t))return Object(o.a)(t,e);if(function(t){return t&&"function"==typeof t[s.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a((function(n){var r,V=new i.a;return V.add((function(){r&&"function"==typeof r.return&&r.return()})),V.add(e.schedule((function(){r=t[s.a](),V.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),V}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.a(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n(4).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},function(t,e,n){"use strict";function r(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(45).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,V){if("function"==typeof n)return t(e,null,n);n||(n={}),V=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}}(V||i);var o=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,a=function(){e.writable||u()},c=e._writableState&&e._writableState.finished,u=function(){s=!1,c=!0,o||V.call(e)},h=e._readableState&&e._readableState.endEmitted,l=function(){o=!1,h=!0,s||V.call(e)},f=function(t){V.call(e,t)},d=function(){var t;return o&&!h?(e._readableState&&e._readableState.ended||(t=new r),V.call(e,t)):s&&!c?(e._writableState&&e._writableState.ended||(t=new r),V.call(e,t)):void 0},p=function(){e.req.on("finish",u)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?s&&!e._writableState&&(e.on("end",a),e.on("close",a)):(e.on("complete",u),e.on("abort",d),e.req?p():e.on("request",p)),e.on("end",l),e.on("finish",u),!1!==n.error&&e.on("error",f),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",p),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",f),e.removeListener("close",d)}}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Prom=e.PromMessageType=void 0;const i=r(n(134));var V;!function(t){t[t.SessionStart=0]="SessionStart",t[t.WebRtcPerformance=1]="WebRtcPerformance",t[t.AvailabilityCheck=2]="AvailabilityCheck",t[t.QuestionMessageReceived=3]="QuestionMessageReceived",t[t.AnswerMessageReceived=4]="AnswerMessageReceived",t[t.SessionEnded=5]="SessionEnded"}(V=e.PromMessageType||(e.PromMessageType={}));e.Prom=class{constructor(t){this.apiUrl=t,this.prom_prefix="client_sdk_",this.registry=i.default(),this.messageTimings=[],this.metricsPushedCounter=this.registry.create("counter",this.prom_prefix+"metrics_pushed_total","A counter for showcase metrics pushed."),this.sessionStartTime=this.registry.create("histogram",this.prom_prefix+"session_start_duration_seconds","A histogram of session start times.",[1,2.5,4,5,6,7.5,8.5,10,15,30,60]),this.availabilityCheckTime=this.registry.create("histogram",this.prom_prefix+"availability_chk_duration_seconds","A histogram of availability check response times.",[.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.webRtcInboundRTT=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_rtt_duration_seconds","A histogram of client inbound round trip time.",[.001,.002,.005,.01,.02,.05,.1,.5,2,5]),this.webRtcInboundFramesPerSec=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_per_second","A histogram of client inbound frames per second.",[1,2,5,10,15,20,25,35,50]),this.webRtcInboundPacketsLost=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_packets_lost","A histogram of client packets lost.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFramesDropped=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_dropped","A histogram of frames dropped.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFrameHeight=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_height_px","A histogram of frame height in pixels",[60,180,240,360,540,720,1280]),this.webRtcFrameWidth=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_width_px","A histogram of frame width in pixels",[60,180,240,360,540,720,1280,1500,1920]),this.conversationRoundTripTime=this.registry.create("histogram",this.prom_prefix+"conversation_rtt_duration_seconds","A histogram of round trip time of a conversation",[.001,.005,.01,.03,.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.metricsIntervalId=setInterval(()=>{this.sendMetrics()},1e4)}handleMessage(t){var e,n,r,i,o,s,a;const c=Object.assign(t.labels||{},{platform:"js"});switch(t.type){case V.SessionStart:this.sessionStartTime.observe(t.value,c);break;case V.QuestionMessageReceived:this.messageTimings.push(t.value);break;case V.AnswerMessageReceived:const u=this.calculateConversationRtt(t);u>0&&this.conversationRoundTripTime.observe(u,c);break;case V.WebRtcPerformance:const h=t.value;h.outboundQualityLimitationReason?c.qualityLimitationReason=null===(e=h.outboundQualityLimitationReason)||void 0===e?void 0:e.value:c.qualityLimitationReason="unknown",h.newFramesDropped&&this.webRtcFramesDropped.observe(null===(n=h.newFramesDropped)||void 0===n?void 0:n.value,c),h.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(r=h.framesPerSec)||void 0===r?void 0:r.value,c),h.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=h.inboundNewPacketsLost)||void 0===i?void 0:i.value,c),h.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(o=h.inboundRoundTripTime)||void 0===o?void 0:o.value,c),h.frameHeight&&this.webRtcFrameHeight.observe(null===(s=h.frameHeight)||void 0===s?void 0:s.value,c),h.frameWidth&&this.webRtcFrameWidth.observe(null===(a=h.frameWidth)||void 0===a?void 0:a.value,c);break;case V.AvailabilityCheck:this.availabilityCheckTime.observe(t.value,c);break;case V.SessionEnded:this.stopSendingMetrics()}}calculateConversationRtt(t){if(t.value&&this.messageTimings){const e=this.messageTimings.find(e=>e.id===t.value.id);if(e){const n=e.receivedOn;if(n){const r=(t.value.receivedOn-n)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(e),1),r}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const t=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(t),this.registry.reset()}stopSendingMetrics(){this.metricsIntervalId&&clearInterval(this.metricsIntervalId)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"audit",(function(){return V})),n.d(e,"auditTime",(function(){return u})),n.d(e,"buffer",(function(){return h})),n.d(e,"bufferCount",(function(){return p})),n.d(e,"bufferTime",(function(){return b})),n.d(e,"bufferToggle",(function(){return M})),n.d(e,"bufferWhen",(function(){return k})),n.d(e,"catchError",(function(){return N})),n.d(e,"combineAll",(function(){return F})),n.d(e,"combineLatest",(function(){return q})),n.d(e,"concat",(function(){return H})),n.d(e,"concatAll",(function(){return G.a})),n.d(e,"concatMap",(function(){return $})),n.d(e,"concatMapTo",(function(){return Q})),n.d(e,"count",(function(){return X})),n.d(e,"debounce",(function(){return J})),n.d(e,"debounceTime",(function(){return nt})),n.d(e,"defaultIfEmpty",(function(){return ot})),n.d(e,"delay",(function(){return ht})),n.d(e,"delayWhen",(function(){return gt})),n.d(e,"dematerialize",(function(){return _t})),n.d(e,"distinct",(function(){return St})),n.d(e,"distinctUntilChanged",(function(){return Ct})),n.d(e,"distinctUntilKeyChanged",(function(){return Mt})),n.d(e,"elementAt",(function(){return Wt})),n.d(e,"endWith",(function(){return zt})),n.d(e,"every",(function(){return Ht})),n.d(e,"exhaust",(function(){return $t})),n.d(e,"exhaustMap",(function(){return Kt})),n.d(e,"expand",(function(){return ee})),n.d(e,"filter",(function(){return Pt.a})),n.d(e,"finalize",(function(){return ie})),n.d(e,"find",(function(){return se})),n.d(e,"findIndex",(function(){return ue})),n.d(e,"first",(function(){return le})),n.d(e,"groupBy",(function(){return fe.b})),n.d(e,"ignoreElements",(function(){return de})),n.d(e,"isEmpty",(function(){return ve})),n.d(e,"last",(function(){return Ae})),n.d(e,"map",(function(){return Zt.a})),n.d(e,"mapTo",(function(){return Se})),n.d(e,"materialize",(function(){return Ce})),n.d(e,"max",(function(){return De})),n.d(e,"merge",(function(){return je})),n.d(e,"mergeAll",(function(){return Le.a})),n.d(e,"mergeMap",(function(){return Y.b})),n.d(e,"flatMap",(function(){return Y.a})),n.d(e,"mergeMapTo",(function(){return Ue})),n.d(e,"mergeScan",(function(){return Fe})),n.d(e,"min",(function(){return qe})),n.d(e,"multicast",(function(){return He})),n.d(e,"observeOn",(function(){return Ye.b})),n.d(e,"onErrorResumeNext",(function(){return $e})),n.d(e,"pairwise",(function(){return Ze})),n.d(e,"partition",(function(){return en})),n.d(e,"pluck",(function(){return nn})),n.d(e,"publish",(function(){return on})),n.d(e,"publishBehavior",(function(){return an})),n.d(e,"publishLast",(function(){return un})),n.d(e,"publishReplay",(function(){return ln})),n.d(e,"race",(function(){return dn})),n.d(e,"reduce",(function(){return Ie})),n.d(e,"repeat",(function(){return pn})),n.d(e,"repeatWhen",(function(){return mn})),n.d(e,"retry",(function(){return _n})),n.d(e,"retryWhen",(function(){return Sn})),n.d(e,"refCount",(function(){return Cn.a})),n.d(e,"sample",(function(){return En})),n.d(e,"sampleTime",(function(){return On})),n.d(e,"scan",(function(){return Me})),n.d(e,"sequenceEqual",(function(){return Dn})),n.d(e,"share",(function(){return Fn})),n.d(e,"shareReplay",(function(){return Bn})),n.d(e,"single",(function(){return Wn})),n.d(e,"skip",(function(){return Hn})),n.d(e,"skipLast",(function(){return $n})),n.d(e,"skipUntil",(function(){return Zn})),n.d(e,"skipWhile",(function(){return tr})),n.d(e,"startWith",(function(){return rr})),n.d(e,"subscribeOn",(function(){return sr})),n.d(e,"switchAll",(function(){return lr})),n.d(e,"switchMap",(function(){return cr})),n.d(e,"switchMapTo",(function(){return fr})),n.d(e,"take",(function(){return Ut})),n.d(e,"takeLast",(function(){return be})),n.d(e,"takeUntil",(function(){return dr})),n.d(e,"takeWhile",(function(){return vr})),n.d(e,"tap",(function(){return wr})),n.d(e,"throttle",(function(){return Tr})),n.d(e,"throttleTime",(function(){return Rr})),n.d(e,"throwIfEmpty",(function(){return It})),n.d(e,"timeInterval",(function(){return Ir})),n.d(e,"timeout",(function(){return Br})),n.d(e,"timeoutWith",(function(){return jr})),n.d(e,"timestamp",(function(){return Wr})),n.d(e,"toArray",(function(){return Hr})),n.d(e,"window",(function(){return Gr})),n.d(e,"windowCount",(function(){return Qr})),n.d(e,"windowTime",(function(){return Kr})),n.d(e,"windowToggle",(function(){return Vi})),n.d(e,"windowWhen",(function(){return ai})),n.d(e,"withLatestFrom",(function(){return hi})),n.d(e,"zip",(function(){return pi})),n.d(e,"zipAll",(function(){return gi}));var r=n(0),i=n(2);function V(t){return function(e){return e.lift(new o(t))}}var o=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.durationSelector))},t}(),s=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=Object(i.c)(e,new i.a(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},e.prototype.clearThrottle=function(){var t=this.value,e=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),e&&(this.value=void 0,this.hasValue=!1,this.destination.next(t))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(i.b),a=n(6),c=n(72);function u(t,e){return void 0===e&&(e=a.a),V((function(){return Object(c.a)(t,e)}))}function h(t){return function(e){return e.lift(new l(t))}}var l=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.closingNotifier))},t}(),f=function(t){function e(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(Object(i.c)(n,new i.a(r))),r}return r.a(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(){var t=this.buffer;this.buffer=[],this.destination.next(t)},e}(i.b),d=n(1);function p(t,e){return void 0===e&&(e=null),function(n){return n.lift(new g(t,e))}}var g=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?m:v}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),v=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return r.a(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(d.a),m=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return r.a(e,t),e.prototype._next=function(t){var e=this.bufferSize,n=this.startBufferEvery,r=this.buffers,i=this.count;this.count++,i%n==0&&r.push([]);for(var V=r.length;V--;){var o=r[V];o.push(t),o.length===e&&(r.splice(V,1),this.destination.next(o))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(d.a),y=n(9);function b(t){var e=arguments.length,n=a.a;Object(y.a)(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new _(t,r,i,n))}}var _=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new A(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),w=function(){return function(){this.buffer=[]}}(),A=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;o.bufferTimeSpan=n,o.bufferCreationInterval=r,o.maxBufferSize=i,o.scheduler=V,o.contexts=[];var s=o.openContext();if(o.timespanOnly=null==r||r<0,o.timespanOnly){var a={subscriber:o,context:s,bufferTimeSpan:n};o.add(s.closeAction=V.schedule(S,n,a))}else{var c={subscriber:o,context:s},u={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:o,scheduler:V};o.add(s.closeAction=V.schedule(T,n,c)),o.add(V.schedule(x,r,u))}return o}return r.a(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,i=0;i<r;i++){var V=n[i],o=V.buffer;o.push(t),o.length==this.maxBufferSize&&(e=V)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,n=this.destination;e.length>0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(S,n,r))}},e.prototype.openContext=function(){var t=new w;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(d.a);function S(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function x(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,V=r.openContext();r.closed||(r.add(V.closeAction=i.schedule(T,n,{subscriber:r,context:V})),this.schedule(t,e))}function T(t){var e=t.subscriber,n=t.context;e.closeContext(n)}var C=n(4),E=n(12),R=n(15);function M(t,e){return function(n){return n.lift(new O(t,e))}}var O=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new P(t,this.openings,this.closingSelector))},t}(),P=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.closingSelector=r,i.contexts=[],i.add(Object(E.a)(i,n)),i}return r.a(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r<n;r++)e[r].buffer.push(t)},e.prototype._error=function(e){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new C.a,r={buffer:[],subscription:n};e.push(r);var i=Object(E.a)(this,t,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},e}(R.a);function k(t){return function(e){return e.lift(new I(t))}}var I=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new D(t,this.closingSelector))},t}(),D=function(t){function e(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return r.a(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new C.a,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(Object(i.c)(e,new i.a(this))),this.subscribing=!1},e}(i.b);function N(t){return function(e){var n=new j(t),r=e.lift(n);return n.caught=r}}var j=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new L(t,this.selector,this.caught))},t}(),L=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new i.a(this);this.add(r);var V=Object(i.c)(n,r);V!==r&&this.add(V)}},e}(i.b),U=n(51);function F(t){return function(e){return e.lift(new U.a(t))}}var B=n(7),W=n(11);function q(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&Object(B.a)(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(Object(W.a)([e].concat(t)),new U.a(n))}}var z=n(31);function H(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(z.a.apply(void 0,[e].concat(t)))}}var G=n(69),Y=n(25);function $(t,e){return Object(Y.b)(t,e,1)}function Q(t,e){return $((function(){return t}),e)}function X(t){return function(e){return e.lift(new Z(t,e))}}var Z=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new K(t,this.predicate,this.source))},t}(),K=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(d.a);function J(t){return function(e){return e.lift(new tt(t))}}var tt=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new et(t,this.durationSelector))},t}(),et=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=Object(i.c)(e,new i.a(this)))&&!n.closed&&this.add(this.durationSubscription=n)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(i.b);function nt(t,e){return void 0===e&&(e=a.a),function(n){return n.lift(new rt(t,e))}}var rt=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new it(t,this.dueTime,this.scheduler))},t}(),it=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return r.a(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Vt,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(d.a);function Vt(t){t.debouncedNext()}function ot(t){return void 0===t&&(t=null),function(e){return e.lift(new st(t))}}var st=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new at(t,this.defaultValue))},t}(),at=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return r.a(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(d.a);function ct(t){return t instanceof Date&&!isNaN(+t)}var ut=n(17);function ht(t,e){void 0===e&&(e=a.a);var n=ct(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new lt(n,e))}}var lt=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new ft(t,this.delay,this.scheduler))},t}(),ft=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return r.a(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,i=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var V=Math.max(0,n[0].time-r.now());this.schedule(t,V)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new dt(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(ut.a.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(ut.a.createComplete()),this.unsubscribe()},e}(d.a),dt=function(){return function(t,e){this.time=t,this.notification=e}}(),pt=n(3);function gt(t,e){return e?function(n){return new yt(n,e).lift(new vt(t))}:function(e){return e.lift(new vt(t))}}var vt=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new mt(t,this.delayDurationSelector))},t}(),mt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var n=Object(E.a)(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(R.a),yt=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return r.a(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new bt(t,this.source))},e}(pt.a),bt=function(t){function e(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return r.a(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(d.a);function _t(){return function(t){return t.lift(new wt)}}var wt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new At(t))},t}(),At=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(d.a);function St(t,e){return function(n){return n.lift(new xt(t,e))}}var xt=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new Tt(t,this.keySelector,this.flushes))},t}(),Tt=function(t){function e(e,n,r){var V=t.call(this,e)||this;return V.keySelector=n,V.values=new Set,r&&V.add(Object(i.c)(r,new i.a(V))),V}return r.a(e,t),e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(t){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(i.b);function Ct(t,e){return function(n){return n.lift(new Et(t,e))}}var Et=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Rt(t,this.compare,this.keySelector))},t}(),Rt=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return r.a(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(d.a);function Mt(t,e){return Ct((function(n,r){return e?e(n[t],r[t]):n[t]===r[t]}))}var Ot=n(22),Pt=n(16),kt=n(24);function It(t){return void 0===t&&(t=jt),function(e){return e.lift(new Dt(t))}}var Dt=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new Nt(t,this.errorFactory))},t}(),Nt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.errorFactory=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(d.a);function jt(){return new kt.a}var Lt=n(10);function Ut(t){return function(e){return 0===t?Object(Lt.b)():e.lift(new Ft(t))}}var Ft=function(){function t(t){if(this.total=t,this.total<0)throw new Ot.a}return t.prototype.call=function(t,e){return e.subscribe(new Bt(t,this.total))},t}(),Bt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(d.a);function Wt(t,e){if(t<0)throw new Ot.a;var n=arguments.length>=2;return function(r){return r.pipe(Object(Pt.a)((function(e,n){return n===t})),Ut(1),n?ot(e):It((function(){return new Ot.a})))}}var qt=n(36);function zt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return Object(z.a)(e,qt.a.apply(void 0,t))}}function Ht(t,e){return function(n){return n.lift(new Gt(t,e,n))}}var Gt=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new Yt(t,this.predicate,this.thisArg,this.source))},t}(),Yt=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.predicate=n,V.thisArg=r,V.source=i,V.index=0,V.thisArg=r||V,V}return r.a(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(d.a);function $t(){return function(t){return t.lift(new Qt)}}var Qt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Xt(t))},t}(),Xt=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return r.a(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(Object(i.c)(t,new i.a(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(i.b),Zt=n(8);function Kt(t,e){return e?function(n){return n.pipe(Kt((function(n,r){return Object(W.a)(t(n,r)).pipe(Object(Zt.a)((function(t,i){return e(n,t,r,i)})))})))}:function(e){return e.lift(new Jt(t))}}var Jt=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new te(t,this.project))},t}(),te=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new i.a(this),n=this.destination;n.add(e);var r=Object(i.c)(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(i.b);function ee(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new ne(t,e,n))}}var ne=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new re(t,this.project,this.concurrent,this.scheduler))},t}(),re=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.project=n,V.concurrent=r,V.scheduler=i,V.index=0,V.active=0,V.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(V.buffer=[]),V}return r.a(e,t),e.dispatch=function(t){var e=t.subscriber,n=t.result,r=t.value,i=t.index;e.subscribeToProjection(n,r,i)},e.prototype._next=function(t){var n=this.destination;if(n.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){n.next(t);try{var i=(0,this.project)(t,r);if(this.scheduler){var V={subscriber:this,result:i,value:t,index:r};this.destination.add(this.scheduler.schedule(e.dispatch,0,V))}else this.subscribeToProjection(i,t,r)}catch(t){n.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,n){this.active++,this.destination.add(Object(i.c)(t,new i.a(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this._next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(i.b);function ie(t){return function(e){return e.lift(new Ve(t))}}var Ve=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new oe(t,this.callback))},t}(),oe=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new C.a(n)),r}return r.a(e,t),e}(d.a);function se(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new ae(t,n,!1,e))}}var ae=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new ce(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),ce=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.yieldIndex=i,o.thisArg=V,o.index=0,o}return r.a(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(d.a);function ue(t,e){return function(n){return n.lift(new ae(t,n,!0,e))}}var he=n(14);function le(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(Pt.a)((function(e,n){return t(e,n,r)})):he.a,Ut(1),n?ot(e):It((function(){return new kt.a})))}}var fe=n(62);function de(){return function(t){return t.lift(new pe)}}var pe=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ge(t))},t}(),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype._next=function(t){},e}(d.a);function ve(){return function(t){return t.lift(new me)}}var me=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ye(t))},t}(),ye=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(d.a);function be(t){return function(e){return 0===t?Object(Lt.b)():e.lift(new _e(t))}}var _e=function(){function t(t){if(this.total=t,this.total<0)throw new Ot.a}return t.prototype.call=function(t,e){return e.subscribe(new we(t,this.total))},t}(),we=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var V=e++%n;t.next(r[V])}t.complete()},e}(d.a);function Ae(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(Pt.a)((function(e,n){return t(e,n,r)})):he.a,be(1),n?ot(e):It((function(){return new kt.a})))}}function Se(t){return function(e){return e.lift(new xe(t))}}var xe=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new Te(t,this.value))},t}(),Te=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return r.a(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(d.a);function Ce(){return function(t){return t.lift(new Ee)}}var Ee=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Re(t))},t}(),Re=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype._next=function(t){this.destination.next(ut.a.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(ut.a.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(ut.a.createComplete()),t.complete()},e}(d.a);function Me(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new Oe(t,e,n))}}var Oe=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new Pe(t,this.accumulator,this.seed,this.hasSeed))},t}(),Pe=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.accumulator=n,V._seed=r,V.hasSeed=i,V.index=0,V}return r.a(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(d.a),ke=n(39);function Ie(t,e){return arguments.length>=2?function(n){return Object(ke.a)(Me(t,e),be(1),ot(e))(n)}:function(e){return Object(ke.a)(Me((function(e,n,r){return t(e,n,r+1)})),be(1))(e)}}function De(t){return Ie("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}var Ne=n(70);function je(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Ne.a.apply(void 0,[e].concat(t)))}}var Le=n(52);function Ue(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?Object(Y.b)((function(){return t}),e,n):("number"==typeof e&&(n=e),Object(Y.b)((function(){return t}),n))}function Fe(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Be(t,e,n))}}var Be=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new We(t,this.accumulator,this.seed,this.concurrent))},t}(),We=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.accumulator=n,V.acc=r,V.concurrent=i,V.hasValue=!1,V.hasCompleted=!1,V.buffer=[],V.active=0,V.index=0,V}return r.a(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,t,e)}catch(t){return n.error(t)}this.active++,this._innerSub(r)}else this.buffer.push(t)},e.prototype._innerSub=function(t){var e=new i.a(this),n=this.destination;n.add(e);var r=Object(i.c)(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(i.b);function qe(t){return Ie("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t<e?t:e})}var ze=n(65);function He(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new Ge(r,e));var i=Object.create(n,ze.b);return i.source=n,i.subjectFactory=r,i}}var Ge=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}(),Ye=n(67);function $e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&Object(B.a)(t[0])&&(t=t[0]),function(e){return e.lift(new Qe(t))}}var Qe=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Xe(t,this.nextSources))},t}(),Xe=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return r.a(e,t),e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new i.a(this),n=this.destination;n.add(e);var r=Object(i.c)(t,e);r!==e&&n.add(r)}else this.destination.complete()},e}(i.b);function Ze(){return function(t){return t.lift(new Ke)}}var Ke=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Je(t))},t}(),Je=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return r.a(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(d.a),tn=n(78);function en(t,e){return function(n){return[Object(Pt.a)(t,e)(n),Object(Pt.a)(Object(tn.a)(t,e))(n)]}}function nn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(e){return Object(Zt.a)(rn(t,n))(e)}}function rn(t,e){return function(n){for(var r=n,i=0;i<e;i++){var V=null!=r?r[t[i]]:void 0;if(void 0===V)return;r=V}return r}}var Vn=n(5);function on(t){return t?He((function(){return new Vn.a}),t):He(new Vn.a)}var sn=n(66);function an(t){return function(e){return He(new sn.a(t))(e)}}var cn=n(28);function un(){return function(t){return He(new cn.a)(t)}}var hn=n(49);function ln(t,e,n,r){n&&"function"!=typeof n&&(r=n);var i="function"==typeof n?n:void 0,V=new hn.a(t,e,r);return function(t){return He((function(){return V}),i)(t)}}var fn=n(71);function dn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&Object(B.a)(t[0])&&(t=t[0]),e.lift.call(fn.a.apply(void 0,[e].concat(t)))}}function pn(t){return void 0===t&&(t=-1),function(e){return 0===t?Object(Lt.b)():t<0?e.lift(new gn(-1,e)):e.lift(new gn(t-1,e))}}var gn=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new vn(t,this.count,this.source))},t}(),vn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return r.a(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(d.a);function mn(t){return function(e){return e.lift(new yn(t))}}var yn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new bn(t,this.notifier,e))},t}(),bn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return r.a(e,t),e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new Vn.a;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=Object(i.c)(e,new i.a(this))},e}(i.b);function _n(t){return void 0===t&&(t=-1),function(e){return e.lift(new wn(t,e))}}var wn=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new An(t,this.count,this.source))},t}(),An=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(d.a);function Sn(t){return function(e){return e.lift(new xn(t,e))}}var xn=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Tn(t,this.notifier,this.source))},t}(),Tn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,V=this.retriesSubscription;if(r)this.errors=void 0,this.retriesSubscription=void 0;else{n=new Vn.a;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}V=Object(i.c)(r,new i.a(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=V,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var t=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=t,this.source.subscribe(this)},e}(i.b),Cn=n(48);function En(t){return function(e){return e.lift(new Rn(t))}}var Rn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Mn(t),r=e.subscribe(n);return r.add(Object(i.c)(this.notifier,new i.a(n))),r},t}(),Mn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return r.a(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(i.b);function On(t,e){return void 0===e&&(e=a.a),function(n){return n.lift(new Pn(t,e))}}var Pn=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new kn(t,this.period,this.scheduler))},t}(),kn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(In,n,{subscriber:i,period:n})),i}return r.a(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(d.a);function In(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}function Dn(t,e){return function(n){return n.lift(new Nn(t,e))}}var Nn=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new jn(t,this.compareTo,this.comparator))},t}(),jn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new Ln(e,i))),i}return r.a(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this._a,e=this._b,n=this.comparator;t.length>0&&e.length>0;){var r=t.shift(),i=e.shift(),V=!1;try{V=n?n(r,i):r===i}catch(t){this.destination.error(t)}V||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(d.a),Ln=function(t){function e(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return r.a(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(d.a);function Un(){return new Vn.a}function Fn(){return function(t){return Object(Cn.a)()(He(Un)(t))}}function Bn(t,e,n){var r;return r=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,r=t.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY:r,V=t.windowTime,o=void 0===V?Number.POSITIVE_INFINITY:V,s=t.refCount,a=t.scheduler,c=0,u=!1,h=!1;return function(t){var r;c++,!e||u?(u=!1,e=new hn.a(i,o,a),r=e.subscribe(this),n=t.subscribe({next:function(t){e.next(t)},error:function(t){u=!0,e.error(t)},complete:function(){h=!0,n=void 0,e.complete()}}),h&&(n=void 0)):r=e.subscribe(this),this.add((function(){c--,r.unsubscribe(),r=void 0,n&&!h&&s&&0===c&&(n.unsubscribe(),n=void 0,e=void 0)}))}}(r))}}function Wn(t){return function(e){return e.lift(new qn(t,e))}}var qn=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new zn(t,this.predicate,this.source))},t}(),zn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return r.a(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new kt.a)},e}(d.a);function Hn(t){return function(e){return e.lift(new Gn(t))}}var Gn=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new Yn(t,this.total))},t}(),Yn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(d.a);function $n(t){return function(e){return e.lift(new Qn(t))}}var Qn=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Ot.a}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new d.a(t)):e.subscribe(new Xn(t,this._skipCount))},t}(),Xn=function(t){function e(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return r.a(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n<e)this._ring[n]=t;else{var r=n%e,i=this._ring,V=i[r];i[r]=t,this.destination.next(V)}},e}(d.a);function Zn(t){return function(e){return e.lift(new Kn(t))}}var Kn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Jn(t,this.notifier))},t}(),Jn=function(t){function e(e,n){var r=t.call(this,e)||this;r.hasValue=!1;var V=new i.a(r);r.add(V),r.innerSubscription=V;var o=Object(i.c)(n,V);return o!==V&&(r.add(o),r.innerSubscription=o),r}return r.a(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(i.b);function tr(t){return function(e){return e.lift(new er(t))}}var er=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new nr(t,this.predicate))},t}(),nr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(d.a);function rr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(y.a)(n)?(t.pop(),function(e){return Object(z.a)(t,e,n)}):function(e){return Object(z.a)(t,e)}}var ir=n(40),Vr=n(30),or=function(t){function e(e,n,r){void 0===n&&(n=0),void 0===r&&(r=ir.a);var i=t.call(this)||this;return i.source=e,i.delayTime=n,i.scheduler=r,(!Object(Vr.a)(n)||n<0)&&(i.delayTime=0),r&&"function"==typeof r.schedule||(i.scheduler=ir.a),i}return r.a(e,t),e.create=function(t,n,r){return void 0===n&&(n=0),void 0===r&&(r=ir.a),new e(t,n,r)},e.dispatch=function(t){var e=t.source,n=t.subscriber;return this.add(e.subscribe(n))},e.prototype._subscribe=function(t){var n=this.delayTime,r=this.source;return this.scheduler.schedule(e.dispatch,n,{source:r,subscriber:t})},e}(pt.a);function sr(t,e){return void 0===e&&(e=0),function(n){return n.lift(new ar(t,e))}}var ar=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new or(e,this.delay,this.scheduler).subscribe(t)},t}();function cr(t,e){return"function"==typeof e?function(n){return n.pipe(cr((function(n,r){return Object(W.a)(t(n,r)).pipe(Object(Zt.a)((function(t,i){return e(n,t,r,i)})))})))}:function(e){return e.lift(new ur(t))}}var ur=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new hr(t,this.project))},t}(),hr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e)},e.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var n=new i.a(this),r=this.destination;r.add(n),this.innerSubscription=Object(i.c)(t,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t){this.destination.next(t)},e}(i.b);function lr(){return cr(he.a)}function fr(t,e){return e?cr((function(){return t}),e):cr((function(){return t}))}function dr(t){return function(e){return e.lift(new pr(t))}}var pr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new gr(t),r=Object(i.c)(this.notifier,new i.a(n));return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),gr=function(t){function e(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return r.a(e,t),e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(i.b);function vr(t,e){return void 0===e&&(e=!1),function(n){return n.lift(new mr(t,e))}}var mr=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new yr(t,this.predicate,this.inclusive))},t}(),yr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},e}(d.a),br=n(19),_r=n(23);function wr(t,e,n){return function(r){return r.lift(new Ar(t,e,n))}}var Ar=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new Sr(t,this.nextOrObserver,this.error,this.complete))},t}(),Sr=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V._tapNext=br.a,V._tapError=br.a,V._tapComplete=br.a,V._tapError=r||br.a,V._tapComplete=i||br.a,Object(_r.a)(n)?(V._context=V,V._tapNext=n):n&&(V._context=n,V._tapNext=n.next||br.a,V._tapError=n.error||br.a,V._tapComplete=n.complete||br.a),V}return r.a(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(d.a),xr={leading:!0,trailing:!1};function Tr(t,e){return void 0===e&&(e=xr),function(n){return n.lift(new Cr(t,!!e.leading,!!e.trailing))}}var Cr=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new Er(t,this.durationSelector,this.leading,this.trailing))},t}(),Er=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.destination=e,V.durationSelector=n,V._leading=r,V._trailing=i,V._hasValue=!1,V}return r.a(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=Object(i.c)(e,new i.a(this)))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(i.b);function Rr(t,e,n){return void 0===e&&(e=a.a),void 0===n&&(n=xr),function(r){return r.lift(new Mr(t,e,n.leading,n.trailing))}}var Mr=function(){function t(t,e,n,r){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Or(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Or=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.duration=n,o.scheduler=r,o.leading=i,o.trailing=V,o._hasTrailingValue=!1,o._trailingValue=null,o}return r.a(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Pr,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(d.a);function Pr(t){t.subscriber.clearThrottle()}var kr=n(53);function Ir(t){return void 0===t&&(t=a.a),function(e){return Object(kr.a)((function(){return e.pipe(Me((function(e,n){var r=e.current;return{value:n,current:t.now(),last:r}}),{current:t.now(),value:void 0,last:void 0}),Object(Zt.a)((function(t){var e=t.current,n=t.last,r=t.value;return new Dr(r,e-n)})))}))}}var Dr=function(){return function(t,e){this.value=t,this.interval=e}}(),Nr=n(68);function jr(t,e,n){return void 0===n&&(n=a.a),function(r){var i=ct(t),V=i?+t-n.now():Math.abs(t);return r.lift(new Lr(V,i,e,n))}}var Lr=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Ur(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Ur=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.absoluteTimeout=n,o.waitFor=r,o.withObservable=i,o.scheduler=V,o.scheduleTimeout(),o}return r.a(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(Object(i.c)(e,new i.a(t)))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(i.b),Fr=n(50);function Br(t,e){return void 0===e&&(e=a.a),jr(t,Object(Fr.a)(new Nr.a),e)}function Wr(t){return void 0===t&&(t=a.a),Object(Zt.a)((function(e){return new qr(e,t.now())}))}var qr=function(){return function(t,e){this.value=t,this.timestamp=e}}();function zr(t,e,n){return 0===n?[e]:(t.push(e),t)}function Hr(){return Ie(zr,[])}function Gr(t){return function(e){return e.lift(new Yr(t))}}var Yr=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var n=new $r(t),r=e.subscribe(n);return r.closed||n.add(Object(i.c)(this.windowBoundaries,new i.a(n))),r},t}(),$r=function(t){function e(e){var n=t.call(this,e)||this;return n.window=new Vn.a,e.next(n.window),n}return r.a(e,t),e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,n=this.window=new Vn.a;e.next(n)},e}(i.b);function Qr(t,e){return void 0===e&&(e=0),function(n){return n.lift(new Xr(t,e))}}var Xr=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new Zr(t,this.windowSize,this.startWindowEvery))},t}(),Zr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.destination=e,i.windowSize=n,i.startWindowEvery=r,i.windows=[new Vn.a],i.count=0,e.next(i.windows[0]),i}return r.a(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,V=i.length,o=0;o<V&&!this.closed;o++)i[o].next(t);var s=this.count-r+1;if(s>=0&&s%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var a=new Vn.a;i.push(a),n.next(a)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(d.a);function Kr(t){var e=a.a,n=null,r=Number.POSITIVE_INFINITY;return Object(y.a)(arguments[3])&&(e=arguments[3]),Object(y.a)(arguments[2])?e=arguments[2]:Object(Vr.a)(arguments[2])&&(r=Number(arguments[2])),Object(y.a)(arguments[1])?e=arguments[1]:Object(Vr.a)(arguments[1])&&(n=Number(arguments[1])),function(i){return i.lift(new Jr(t,n,r,e))}}var Jr=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ei(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),ti=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return r.a(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Vn.a),ei=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;o.destination=e,o.windowTimeSpan=n,o.windowCreationInterval=r,o.maxWindowSize=i,o.scheduler=V,o.windows=[];var s=o.openWindow();if(null!==r&&r>=0){var a={subscriber:o,window:s,context:null},c={windowTimeSpan:n,windowCreationInterval:r,subscriber:o,scheduler:V};o.add(V.schedule(ii,n,a)),o.add(V.schedule(ri,r,c))}else{var u={subscriber:o,window:s,windowTimeSpan:n};o.add(V.schedule(ni,n,u))}return o}return r.a(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r<n;r++){var i=e[r];i.closed||(i.next(t),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new ti;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(d.a);function ni(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function ri(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,V=n.openWindow(),o={action:this,subscription:null},s={subscriber:n,window:V,context:o};o.subscription=r.schedule(ii,e,s),this.add(o.subscription),this.schedule(t,i)}function ii(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}function Vi(t,e){return function(n){return n.lift(new oi(t,e))}}var oi=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new si(t,this.openings,this.closingSelector))},t}(),si=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=Object(E.a)(i,n,n)),i}return r.a(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r<n;r++)e[r].window.next(t)},e.prototype._error=function(e){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var V=n[i];V.window.error(e),V.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var n=e.length,r=-1;++r<n;){var i=e[r];i.window.complete(),i.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,n=-1;++n<e;){var r=t[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,n,r,i){if(t===this.openings){var V=void 0;try{V=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var o=new Vn.a,s=new C.a,a={window:o,subscription:s};this.contexts.push(a);var c=Object(E.a)(this,V,a);c.closed?this.closeWindow(this.contexts.length-1):(c.context=a,s.add(c)),this.destination.next(o)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,n=e[t],r=n.window,i=n.subscription;e.splice(t,1),r.complete(),i.unsubscribe()}},e}(R.a);function ai(t){return function(e){return e.lift(new ci(t))}}var ci=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new ui(t,this.closingSelector))},t}(),ui=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.closingSelector=n,r.openWindow(),r}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.openWindow(i)},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var n,r=this.window=new Vn.a;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=Object(E.a)(this,n))},e}(R.a);function hi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new li(r,n))}}var li=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new fi(t,this.observables,this.project))},t}(),fi=function(t){function e(e,n,r){var i=t.call(this,e)||this;i.observables=n,i.project=r,i.toRespond=[];var V=n.length;i.values=new Array(V);for(var o=0;o<V;o++)i.toRespond.push(o);for(o=0;o<V;o++){var s=n[o];i.add(Object(E.a)(i,s,void 0,o))}return i}return r.a(e,t),e.prototype.notifyNext=function(t,e,n){this.values[n]=e;var r=this.toRespond;if(r.length>0){var i=r.indexOf(n);-1!==i&&r.splice(i,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(R.a),di=n(54);function pi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(di.b.apply(void 0,[e].concat(t)))}}function gi(t){return function(e){return e.lift(new di.a(t))}}},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"shimGetUserMedia",(function(){return y})),n.d(r,"shimGetDisplayMedia",(function(){return b})),n.d(r,"shimMediaStream",(function(){return _})),n.d(r,"shimOnTrack",(function(){return w})),n.d(r,"shimGetSendersWithDtmf",(function(){return A})),n.d(r,"shimGetStats",(function(){return S})),n.d(r,"shimSenderReceiverGetStats",(function(){return x})),n.d(r,"shimAddTrackRemoveTrackWithNative",(function(){return T})),n.d(r,"shimAddTrackRemoveTrack",(function(){return C})),n.d(r,"shimPeerConnection",(function(){return E})),n.d(r,"fixNegotiationNeeded",(function(){return R}));var i={};n.r(i),n.d(i,"shimGetUserMedia",(function(){return M})),n.d(i,"shimGetDisplayMedia",(function(){return O})),n.d(i,"shimOnTrack",(function(){return P})),n.d(i,"shimPeerConnection",(function(){return k})),n.d(i,"shimSenderGetStats",(function(){return I})),n.d(i,"shimReceiverGetStats",(function(){return D})),n.d(i,"shimRemoveStream",(function(){return N})),n.d(i,"shimRTCDataChannel",(function(){return j})),n.d(i,"shimAddTransceiver",(function(){return L})),n.d(i,"shimGetParameters",(function(){return U})),n.d(i,"shimCreateOffer",(function(){return F})),n.d(i,"shimCreateAnswer",(function(){return B}));var V={};n.r(V),n.d(V,"shimLocalStreamsAPI",(function(){return W})),n.d(V,"shimRemoteStreamsAPI",(function(){return q})),n.d(V,"shimCallbacksAPI",(function(){return z})),n.d(V,"shimGetUserMedia",(function(){return H})),n.d(V,"shimConstraints",(function(){return G})),n.d(V,"shimRTCIceServerUrls",(function(){return Y})),n.d(V,"shimTrackEventTransceiver",(function(){return $})),n.d(V,"shimCreateOfferLegacy",(function(){return Q})),n.d(V,"shimAudioContext",(function(){return X}));var o={};n.r(o),n.d(o,"shimRTCIceCandidate",(function(){return J})),n.d(o,"shimMaxMessageSize",(function(){return tt})),n.d(o,"shimSendThrowTypeError",(function(){return et})),n.d(o,"shimConnectionState",(function(){return nt})),n.d(o,"removeExtmapAllowMixed",(function(){return rt})),n.d(o,"shimAddIceCandidateNullOrEmpty",(function(){return it})),n.d(o,"shimParameterlessSetLocalDescription",(function(){return Vt}));let s=!0,a=!0;function c(t,e,n){const r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function u(t,e,n){if(!t.RTCPeerConnection)return;const r=t.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(t,r){if(t!==e)return i.apply(this,arguments);const V=t=>{const e=n(t);e&&(r.handleEvent?r.handleEvent(e):r(e))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(r,V),i.apply(this,[t,V])};const V=r.removeEventListener;r.removeEventListener=function(t,n){if(t!==e||!this._eventMap||!this._eventMap[e])return V.apply(this,arguments);if(!this._eventMap[e].has(n))return V.apply(this,arguments);const r=this._eventMap[e].get(n);return this._eventMap[e].delete(n),0===this._eventMap[e].size&&delete this._eventMap[e],0===Object.keys(this._eventMap).length&&delete this._eventMap,V.apply(this,[t,r])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(t){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),t&&this.addEventListener(e,this["_on"+e]=t)},enumerable:!0,configurable:!0})}function h(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(s=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function l(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(a=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function f(){if("object"==typeof window){if(s)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function d(t,e){a&&console.warn(t+" is deprecated, please use "+e+" instead.")}function p(t){return"[object Object]"===Object.prototype.toString.call(t)}function g(t){return p(t)?Object.keys(t).reduce((function(e,n){const r=p(t[n]),i=r?g(t[n]):t[n],V=r&&!Object.keys(i).length;return void 0===i||V?e:Object.assign(e,{[n]:i})}),{}):t}function v(t,e,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===e)return i;const V=[];return t.forEach(t=>{"track"===t.type&&t.trackIdentifier===e.id&&V.push(t)}),V.forEach(e=>{t.forEach(n=>{n.type===r&&n.trackId===e.id&&function t(e,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(i=>{i.endsWith("Id")?t(e,e.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach(n=>{t(e,e.get(n),r)})}))}(t,n,i)})}),i}const m=f;function y(t,e){const n=t&&t.navigator;if(!n.mediaDevices)return;const r=function(t){if("object"!=typeof t||t.mandatory||t.optional)return t;const e={};return Object.keys(t).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof t[n]?t[n]:{ideal:t[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const i=function(t,e){return t?t+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==r.ideal){e.optional=e.optional||[];let t={};"number"==typeof r.ideal?(t[i("min",n)]=r.ideal,e.optional.push(t),t={},t[i("max",n)]=r.ideal,e.optional.push(t)):(t[i("",n)]=r.ideal,e.optional.push(t))}void 0!==r.exact&&"number"!=typeof r.exact?(e.mandatory=e.mandatory||{},e.mandatory[i("",n)]=r.exact):["min","max"].forEach(t=>{void 0!==r[t]&&(e.mandatory=e.mandatory||{},e.mandatory[i(t,n)]=r[t])})}),t.advanced&&(e.optional=(e.optional||[]).concat(t.advanced)),e},i=function(t,i){if(e.version>=61)return i(t);if((t=JSON.parse(JSON.stringify(t)))&&"object"==typeof t.audio){const e=function(t,e,n){e in t&&!(n in t)&&(t[n]=t[e],delete t[e])};e((t=JSON.parse(JSON.stringify(t))).audio,"autoGainControl","googAutoGainControl"),e(t.audio,"noiseSuppression","googNoiseSuppression"),t.audio=r(t.audio)}if(t&&"object"==typeof t.video){let V=t.video.facingMode;V=V&&("object"==typeof V?V:{ideal:V});const o=e.version<66;if(V&&("user"===V.exact||"environment"===V.exact||"user"===V.ideal||"environment"===V.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||o)){let e;if(delete t.video.facingMode,"environment"===V.exact||"environment"===V.ideal?e=["back","rear"]:"user"!==V.exact&&"user"!==V.ideal||(e=["front"]),e)return n.mediaDevices.enumerateDevices().then(n=>{let o=(n=n.filter(t=>"videoinput"===t.kind)).find(t=>e.some(e=>t.label.toLowerCase().includes(e)));return!o&&n.length&&e.includes("back")&&(o=n[n.length-1]),o&&(t.video.deviceId=V.exact?{exact:o.deviceId}:{ideal:o.deviceId}),t.video=r(t.video),m("chrome: "+JSON.stringify(t)),i(t)})}t.video=r(t.video)}return m("chrome: "+JSON.stringify(t)),i(t)},V=function(t){return e.version>=64?t:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[t.name]||t.name,message:t.message,constraint:t.constraint||t.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(t,e,r){i(t,t=>{n.webkitGetUserMedia(t,e,t=>{r&&r(V(t))})})}.bind(n),n.mediaDevices.getUserMedia){const t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return i(e,e=>t(e).then(t=>{if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(t=>{t.stop()}),new DOMException("","NotFoundError");return t},t=>Promise.reject(V(t))))}}}function b(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&("function"==typeof e?t.navigator.mediaDevices.getDisplayMedia=function(n){return e(n).then(e=>{const r=n.video&&n.video.width,i=n.video&&n.video.height,V=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxFrameRate:V||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),t.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function _(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function w(t){if("object"==typeof t&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=e=>{e.stream.addEventListener("addtrack",n=>{let r;r=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(t=>t.track&&t.track.id===n.track.id):{track:n.track};const i=new Event("track");i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[e.stream],this.dispatchEvent(i)}),e.stream.getTracks().forEach(n=>{let r;r=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(t=>t.track&&t.track.id===n.id):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[e.stream],this.dispatchEvent(i)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else u(t,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t))}function A(t){if("object"==typeof t&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(t,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=t.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:t}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,r){let i=n.apply(this,arguments);return i||(i=e(this,t),this._senders.push(i)),i};const r=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){r.apply(this,arguments);const e=this._senders.indexOf(t);-1!==e&&this._senders.splice(e,1)}}const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._senders=this._senders||[],n.apply(this,[t]),t.getTracks().forEach(t=>{this._senders.push(e(this,t))})};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){this._senders=this._senders||[],r.apply(this,[t]),t.getTracks().forEach(t=>{const e=this._senders.find(e=>e.track===t);e&&this._senders.splice(this._senders.indexOf(e),1)})}}else if("object"==typeof t&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function S(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,n,r]=arguments;if(arguments.length>0&&"function"==typeof t)return e.apply(this,arguments);if(0===e.length&&(0===arguments.length||"function"!=typeof t))return e.apply(this,[]);const i=function(t){const e={};return t.result().forEach(t=>{const n={id:t.id,timestamp:t.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[t.type]||t.type};t.names().forEach(e=>{n[e]=t.stat(e)}),e[n.id]=n}),e},V=function(t){return new Map(Object.keys(t).map(e=>[e,t[e]]))};if(arguments.length>=2){const r=function(t){n(V(i(t)))};return e.apply(this,[r,t])}return new Promise((t,n)=>{e.apply(this,[function(e){t(V(i(e)))},n])}).then(n,r)}}function x(t){if(!("object"==typeof t&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=n.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){const t=this;return this._pc.getStats().then(e=>v(e,t.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t}),u(t,"track",t=>(t.receiver._pc=t.srcElement,t)),t.RTCRtpReceiver.prototype.getStats=function(){const t=this;return this._pc.getStats().then(e=>v(e,t.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype)||!("getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const t=arguments[0];let e,n,r;return this.getSenders().forEach(n=>{n.track===t&&(e?r=!0:e=n)}),this.getReceivers().forEach(e=>(e.track===t&&(n?r=!0:n=e),e.track===t)),r||e&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):e?e.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function T(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(t=>this._shimmedLocalStreams[t][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,n){if(!n)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=e.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._shimmedLocalStreams=this._shimmedLocalStreams||{},t.getTracks().forEach(t=>{if(this.getSenders().find(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError")});const e=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter(t=>-1===e.indexOf(t));this._shimmedLocalStreams[t.id]=[t].concat(r)};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[t.id],r.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},t&&Object.keys(this._shimmedLocalStreams).forEach(e=>{const n=this._shimmedLocalStreams[e].indexOf(t);-1!==n&&this._shimmedLocalStreams[e].splice(n,1),1===this._shimmedLocalStreams[e].length&&delete this._shimmedLocalStreams[e]}),i.apply(this,arguments)}}function C(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return T(t);const n=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map(t=>this._reverseStreams[t.id])};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(e){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach(t=>{if(this.getSenders().find(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[e.id]){const n=new t.MediaStream(e.getTracks());this._streams[e.id]=n,this._reverseStreams[n.id]=e,e=n}r.apply(this,[e])};const i=t.RTCPeerConnection.prototype.removeStream;function V(t,e){let n=e.sdp;return Object.keys(t._reverseStreams||[]).forEach(e=>{const r=t._reverseStreams[e],i=t._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:e.type,sdp:n})}function o(t,e){let n=e.sdp;return Object.keys(t._reverseStreams||[]).forEach(e=>{const r=t._reverseStreams[e],i=t._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:e.type,sdp:n})}t.RTCPeerConnection.prototype.removeStream=function(t){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[t.id]||t]),delete this._reverseStreams[this._streams[t.id]?this._streams[t.id].id:t.id],delete this._streams[t.id]},t.RTCPeerConnection.prototype.addTrack=function(e,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find(t=>t===e))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find(t=>t.track===e);if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const V=this._streams[n.id];if(V)V.addTrack(e),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new t.MediaStream([e]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(t=>t.track===e)},["createOffer","createAnswer"].forEach((function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){const t=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[e=>{const n=V(this,e);t[0].apply(null,[n])},e=>{t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then(t=>V(this,t))}};t.RTCPeerConnection.prototype[e]=r[e]}));const s=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=o(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const t=a.get.apply(this);return""===t.type?t:V(this,t)}}),t.RTCPeerConnection.prototype.removeTrack=function(t){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!t._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(t._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let e;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(e=>t.track===e)&&(e=this._streams[n])}),e&&(1===e.getTracks().length?this.removeStream(this._reverseStreams[e.id]):e.removeTrack(t.track),this.dispatchEvent(new Event("negotiationneeded")))}}function E(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=r[e]}))}function R(t,e){u(t,"negotiationneeded",t=>{const n=t.target;if(!(e.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return t})}function M(t,e){const n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(t,e,r){d("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(t).then(e,r)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const t=function(t,e,n){e in t&&!(n in t)&&(t[n]=t[e],delete t[e])},e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),t(n.audio,"autoGainControl","mozAutoGainControl"),t(n.audio,"noiseSuppression","mozNoiseSuppression")),e(n)},r&&r.prototype.getSettings){const e=r.prototype.getSettings;r.prototype.getSettings=function(){const n=e.apply(this,arguments);return t(n,"mozAutoGainControl","autoGainControl"),t(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const e=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),t(n,"autoGainControl","mozAutoGainControl"),t(n,"noiseSuppression","mozNoiseSuppression")),e.apply(this,[n])}}}}function O(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const t=new DOMException("getDisplayMedia without video constraints is undefined");return t.name="NotFoundError",t.code=8,Promise.reject(t)}return!0===n.video?n.video={mediaSource:e}:n.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(n)})}function P(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function k(t,e){if("object"!=typeof t||!t.RTCPeerConnection&&!t.mozRTCPeerConnection)return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=r[e]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,i,V]=arguments;return r.apply(this,[t||null]).then(t=>{if(e.version<53&&!i)try{t.forEach(t=>{t.type=n[t.type]||t.type})}catch(e){if("TypeError"!==e.name)throw e;t.forEach((e,r)=>{t.set(r,Object.assign({},e,{type:n[e.type]||e.type}))})}return t}).then(i,V)}}function I(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=n.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function D(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t}),u(t,"track",t=>(t.receiver._pc=t.srcElement,t)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function N(t){t.RTCPeerConnection&&!("removeStream"in t.RTCPeerConnection.prototype)&&(t.RTCPeerConnection.prototype.removeStream=function(t){d("removeStream","removeTrack"),this.getSenders().forEach(e=>{e.track&&t.getTracks().includes(e.track)&&this.removeTrack(e)})})}function j(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function L(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const t=arguments[1],n=t&&"sendEncodings"in t;n&&t.sendEncodings.forEach(t=>{if("rid"in t){if(!/^[a-z0-9]{0,16}$/i.test(t.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in t&&!(parseFloat(t.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in t&&!(parseFloat(t.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=e.apply(this,arguments);if(n){const{sender:e}=r,n=e.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=t.sendEncodings,e.sendEncodings=t.sendEncodings,this.setParametersPromises.push(e.setParameters(n).then(()=>{delete e.sendEncodings}).catch(()=>{delete e.sendEncodings})))}return r})}function U(t){if("object"!=typeof t||!t.RTCRtpSender)return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const t=e.apply(this,arguments);return"encodings"in t||(t.encodings=[].concat(this.sendEncodings||[{}])),t})}function F(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function B(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function W(t){if("object"==typeof t&&t.RTCPeerConnection){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(t){this._localStreams||(this._localStreams=[]),this._localStreams.includes(t)||this._localStreams.push(t),t.getAudioTracks().forEach(n=>e.call(this,n,t)),t.getVideoTracks().forEach(n=>e.call(this,n,t))},t.RTCPeerConnection.prototype.addTrack=function(t,...n){return n&&n.forEach(t=>{this._localStreams?this._localStreams.includes(t)||this._localStreams.push(t):this._localStreams=[t]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const e=this._localStreams.indexOf(t);if(-1===e)return;this._localStreams.splice(e,1);const n=t.getTracks();this.getSenders().forEach(t=>{n.includes(t.track)&&this.removeTrack(t)})})}}function q(t){if("object"==typeof t&&t.RTCPeerConnection&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=t=>{t.streams.forEach(t=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(t))return;this._remoteStreams.push(t);const e=new Event("addstream");e.stream=t,this.dispatchEvent(e)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const t=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach(e=>{if(t._remoteStreams||(t._remoteStreams=[]),t._remoteStreams.indexOf(e)>=0)return;t._remoteStreams.push(e);const n=new Event("addstream");n.stream=e,t.dispatchEvent(n)})}),e.apply(t,arguments)}}}function z(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,V=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(t,e){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return e?(i.then(t,e),Promise.resolve()):i},e.createAnswer=function(t,e){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return e?(i.then(t,e),Promise.resolve()):i};let s=function(t,e,n){const r=i.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r};e.setLocalDescription=s,s=function(t,e,n){const r=V.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r},e.setRemoteDescription=s,s=function(t,e,n){const r=o.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r},e.addIceCandidate=s}function H(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,n=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=t=>n(G(t))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(t,n,r){e.mediaDevices.getUserMedia(t).then(n,r)}.bind(e))}function G(t){return t&&void 0!==t.video?Object.assign({},t,{video:g(t.video)}):t}function Y(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(t,n){if(t&&t.iceServers){const e=[];for(let n=0;n<t.iceServers.length;n++){let r=t.iceServers[n];!r.hasOwnProperty("urls")&&r.hasOwnProperty("url")?(d("RTCIceServer.url","RTCIceServer.urls"),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,e.push(r)):e.push(t.iceServers[n])}t.iceServers=e}return new e(t,n)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:()=>e.generateCertificate})}function $(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Q(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(t){if(t){void 0!==t.offerToReceiveAudio&&(t.offerToReceiveAudio=!!t.offerToReceiveAudio);const e=this.getTransceivers().find(t=>"audio"===t.receiver.track.kind);!1===t.offerToReceiveAudio&&e?"sendrecv"===e.direction?e.setDirection?e.setDirection("sendonly"):e.direction="sendonly":"recvonly"===e.direction&&(e.setDirection?e.setDirection("inactive"):e.direction="inactive"):!0!==t.offerToReceiveAudio||e||this.addTransceiver("audio"),void 0!==t.offerToReceiveVideo&&(t.offerToReceiveVideo=!!t.offerToReceiveVideo);const n=this.getTransceivers().find(t=>"video"===t.receiver.track.kind);!1===t.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==t.offerToReceiveVideo||n||this.addTransceiver("video")}return e.apply(this,arguments)}}function X(t){"object"!=typeof t||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var Z=n(43),K=n.n(Z);function J(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(t){if("object"==typeof t&&t.candidate&&0===t.candidate.indexOf("a=")&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substr(2)),t.candidate&&t.candidate.length){const n=new e(t),r=K.a.parseCandidate(t.candidate),i=Object.assign(n,r);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(t)},t.RTCIceCandidate.prototype=e.prototype,u(t,"icecandidate",e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new t.RTCIceCandidate(e.candidate),writable:"false"}),e))}function tt(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(t){if(!t||!t.sdp)return!1;const e=K.a.splitSections(t.sdp);return e.shift(),e.some(t=>{const e=K.a.parseMLine(t);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")})},r=function(t){const e=t.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;const n=parseInt(e[1],10);return n!=n?-1:n},i=function(t){let n=65536;return"firefox"===e.browser&&(n=e.version<57?-1===t?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),n},V=function(t,n){let r=65536;"firefox"===e.browser&&57===e.version&&(r=65535);const i=K.a.matchPrefix(t.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===e.browser&&-1!==n&&(r=2147483637),r},o=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===e.browser&&e.version>=76){const{sdpSemantics:t}=this.getConfiguration();"plan-b"===t&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const t=r(arguments[0]),e=i(t),n=V(arguments[0],t);let o;o=0===e&&0===n?Number.POSITIVE_INFINITY:0===e||0===n?Math.max(e,n):Math.min(e,n);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>o}),this._sctp=s}return o.apply(this,arguments)}}function et(t){if(!t.RTCPeerConnection||!("createDataChannel"in t.RTCPeerConnection.prototype))return;function e(t,e){const n=t.send;t.send=function(){const r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===t.readyState&&e.sctp&&i>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return n.apply(t,arguments)}}const n=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const t=n.apply(this,arguments);return e(t,this),t},u(t,"datachannel",t=>(e(t.channel,t.target),t))}function nt(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(t=>{const n=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=t=>{const e=t.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;const n=new Event("connectionstatechange",t);e.dispatchEvent(n)}return t},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function rt(t,e){if(!t.RTCPeerConnection)return;if("chrome"===e.browser&&e.version>=71)return;if("safari"===e.browser&&e.version>=605)return;const n=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(e){if(e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")){const n=e.sdp.split("\n").filter(t=>"a=extmap-allow-mixed"!==t.trim()).join("\n");t.RTCSessionDescription&&e instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:e.type,sdp:n}):e.sdp=n}return n.apply(this,arguments)}}function it(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const n=t.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===e.browser&&e.version<78||"firefox"===e.browser&&e.version<68||"safari"===e.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Vt(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const n=t.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(t.RTCPeerConnection.prototype.setLocalDescription=function(){let t=arguments[0]||{};if("object"!=typeof t||t.type&&t.sdp)return n.apply(this,arguments);if(t={type:t.type,sdp:t.sdp},!t.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":t.type="offer";break;default:t.type="answer"}if(t.sdp||"offer"!==t.type&&"answer"!==t.type)return n.apply(this,[t]);const e="offer"===t.type?this.createOffer:this.createAnswer;return e.apply(this).then(t=>n.apply(this,[t]))})}const ot=function({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=f,s=function(t){const e={browser:null,version:null};if(void 0===t||!t.navigator)return e.browser="Not a browser.",e;const{navigator:n}=t;if(n.mozGetUserMedia)e.browser="firefox",e.version=c(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===t.isSecureContext&&t.webkitRTCPeerConnection&&!t.RTCIceGatherer)e.browser="chrome",e.version=c(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!t.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=c(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype}return e}(t),a={browserDetails:s,commonShim:o,extractVersion:c,disableLog:h,disableWarnings:l,sdp:Z};switch(s.browser){case"chrome":if(!r||!E||!e.shimChrome)return n("Chrome shim is not included in this adapter release."),a;if(null===s.version)return n("Chrome shim can not determine version, not shimming."),a;n("adapter.js shimming chrome."),a.browserShim=r,it(t,s),Vt(t),y(t,s),_(t),E(t,s),w(t),C(t,s),A(t),S(t),x(t),R(t,s),J(t),nt(t),tt(t,s),et(t),rt(t,s);break;case"firefox":if(!i||!k||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),a;n("adapter.js shimming firefox."),a.browserShim=i,it(t,s),Vt(t),M(t,s),k(t,s),P(t),N(t),I(t),D(t),j(t),L(t),U(t),F(t),B(t),J(t),nt(t),tt(t,s),et(t);break;case"safari":if(!V||!e.shimSafari)return n("Safari shim is not included in this adapter release."),a;n("adapter.js shimming safari."),a.browserShim=V,it(t,s),Vt(t),Y(t),Q(t),z(t),W(t),q(t),$(t),H(t),X(t),J(t),tt(t,s),et(t),rt(t,s);break;default:n("Unsupported browser!")}return a}({window:"undefined"==typeof window?void 0:window});e.default=ot},function(t,e,n){"use strict";n.r(e),console.log("BUILD/SERIOUSLY.MODULE");let r,i,V,o,s,a,c,u={},h={},l={},f={},d=[],p={},g={},v={canvas:[],image:[],video:[]},m={},y=window.WeakMap&&new WeakMap,b=0,_=function(){},w={transparent:[0,0,0,0],black:[0,0,0,1],red:[1,0,0,1],green:[0,128/255,0,1],blue:[0,0,1,1],white:[1,1,1,1],silver:[192/255,192/255,192/255,1],gray:[128/255,128/255,128/255,1],maroon:[128/255,0,0,1],purple:[128/255,0,128/255,1],fuchsia:[1,0,1,1],lime:[0,1,0,1],olive:[128/255,128/255,0,1],yellow:[1,1,0,1],navy:[0,0,128/255,1],teal:[0,128/255,128/255,1],aqua:[0,1,1,1],orange:[1,165/255,0,1]},A=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,S=/^#(([0-9a-fA-F]{3,8}))/,x=["x","y","z","w"],T=["r","g","b","a"],C={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},E=["MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"],R=/^[\t ]*#define[\t ]+SHADER_NAME\s+([^$\n\r]+)/i,M={frustum:function(t,e,n,r,i,V,o){o||(o=M.create());var s=e-t,a=r-n,c=V-i;return o[0]=2*i/s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*i/a,o[6]=0,o[7]=0,o[8]=(e+t)/s,o[9]=(r+n)/a,o[10]=-(V+i)/c,o[11]=-1,o[12]=0,o[13]=0,o[14]=-V*i*2/c,o[15]=0,o},perspective:function(t,e,n,r,i){var V=n*Math.tan(t*Math.PI/360),o=V*e;return M.frustum(-o,o,-V,V,n,r,i)},multiply:function(t,e,n){var r=e[0],i=e[1],V=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n[0],b=n[1],_=n[2],w=n[3];return t[0]=y*r+b*s+_*h+w*p,t[1]=y*i+b*a+_*l+w*g,t[2]=y*V+b*c+_*f+w*v,t[3]=y*o+b*u+_*d+w*m,y=n[4],b=n[5],_=n[6],w=n[7],t[4]=y*r+b*s+_*h+w*p,t[5]=y*i+b*a+_*l+w*g,t[6]=y*V+b*c+_*f+w*v,t[7]=y*o+b*u+_*d+w*m,y=n[8],b=n[9],_=n[10],w=n[11],t[8]=y*r+b*s+_*h+w*p,t[9]=y*i+b*a+_*l+w*g,t[10]=y*V+b*c+_*f+w*v,t[11]=y*o+b*u+_*d+w*m,y=n[12],b=n[13],_=n[14],w=n[15],t[12]=y*r+b*s+_*h+w*p,t[13]=y*i+b*a+_*l+w*g,t[14]=y*V+b*c+_*f+w*v,t[15]=y*o+b*u+_*d+w*m,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},O=(N=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){var e,n,r;return e=(new Date).getTime(),n=Math.max(0,16-(e-N)),r=window.setTimeout((function(){t(e+n)}),n),N=e+n,r}),P=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){window.cancelTimeout(t)},k=["alias","destroy","effect","id","initialize","inputs","isDestroyed","isReady","matte","off","on","readPixels","render","title","update"],I=["alias","destroy","id","inputs","isDestroyed","isReady","off","on","source","title","update"],D=["aliases","defaults","destroy","effect","go","id","incompatible","isDestroyed","isEffect","isNode","isSource","isTarget","isTransform","removeAlias","render","source","stop","target","transform"];var N;function j(t,e){var n,r;if("string"==typeof t)n=document.querySelector(t);else if(!t)return!1;return t.tagName&&(n=t),n?(r=n.tagName.toLowerCase(),e&&e.indexOf(r)<0?t:n):t}function L(t,e){var n,r;for(n in t.prototype&&e.prototype&&t.prototype!==e.prototype&&L(t.prototype,e.prototype),e)e.hasOwnProperty(n)&&((r=Object.getOwnPropertyDescriptor(e,n)).get||r.set?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:r.get,set:r.set}):t[n]=e[n]);return t}function U(t){var e;if(!console)return _;if("function"==typeof console[t])e=console[t];else{if("function"!=typeof console.log)return _;e=console.log}return e.bind?e.bind(console):function(){e.apply(console,arguments)}}function F(t,e){if(e||(e="HTMLElement"),t instanceof window[e])return!0;if(!t||"object"!=typeof t)return!1;for(;t;)if((t=Object.getPrototypeOf(t))&&t.constructor.name===e)return!0;return!1}function B(t,e,n,r,i){function V(t,e,n){return(n%=1)<0&&(n+=1),n<1/6?t+(e-t)*n*6:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var o,s;return o=2*n-(s=n<.5?n*(e+1):n+e-n*e),i||(i=[]),i[0]=V(o,s,t+1/3),i[1]=V(o,s,t),i[2]=V(o,s,t-1/3),i[3]=r,i}function W(t){var e,n,r,i="#",V=t[3]<1?4:3;for(e=0;e<V;e++)r=(n=Math.min(255,Math.round(255*t[e]||0))).toString(16),n<16&&(r="0"+r),i+=r;return i}function q(t){return Array.isArray(t)||t&&t.BYTES_PER_ELEMENT&&"length"in t}function z(t){if("function"!=typeof t)throw new Error("setTimeoutZero argument is not a function");d.push(t),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout((function(){d.length&&d.shift()()}),0)}function H(t,e){var n;try{n=window.WebGLDebugUtils&&e&&e.debugContext?window.WebGLDebugUtils.makeDebugContext(t.getContext("webgl",e)):t.getContext("webgl",e)}catch(t){}if(!n)try{n=t.getContext("experimental-webgl",e)}catch(t){}return n}function G(){var t;return r&&r.getError()===r.CONTEXT_LOST_WEBGL&&(r=void 0),r||!window.WebGLRenderingContext||V||(t=document.createElement("canvas"),r=H(t),r?t.addEventListener("webglcontextlost",(function e(n){n.preventDefault(),r&&r.canvas===this&&(r=void 0,t.removeEventListener("webglcontextlost",e,!1))}),!1):X.logger.warn("Unable to access WebGL.")),r}function Y(t){var e,n,r;function i(t,r){var i,V;q(t)?(i=t[0],V=t[1]||i):i=t,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),n[i]=V,r||(e.firstValue=i)}function V(t){return t}for(r in t.inputs)if(t.inputs.hasOwnProperty(r)){if(t.reserved.indexOf(r)>=0||Object.prototype[r])throw new Error("Reserved input name: "+r);(e=t.inputs[r]).name=r,isNaN(e.min)&&(e.min=-1/0),isNaN(e.max)&&(e.max=1/0),isNaN(e.minCount)&&(e.minCount=-1/0),isNaN(e.maxCount)&&(e.maxCount=1/0),isNaN(e.step)&&(e.step=0),isNaN(e.mod)&&(e.mod=0),"enum"===e.type&&e.options&&q(e.options)&&e.options.length&&(n={},e.options.forEach(i),e.options=n),"vector"===e.type?e.dimensions<2?e.dimensions=2:e.dimensions>4||!e.dimensions||isNaN(e.dimensions)?e.dimensions=4:e.dimensions=Math.round(e.dimensions):e.dimensions=1,e.shaderDirty=!!e.shaderDirty,"function"!=typeof e.validate&&(e.validate=X.inputValidators[e.type]||V),t.defaultImageInput||"image"!==e.type||(t.defaultImageInput=r)}}function $(t,e,n,r){var i,V,o,s;!0===r||r&&r.useFloat;this.type=t.UNSIGNED_BYTE,i=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,i),r&&r.texture?(this.texture=r.texture,t.bindTexture(t.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===t.FLOAT?(o=new Float32Array(e*n*4),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.FLOAT,o)):(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.UNSIGNED_BYTE,null),this.type=t.UNSIGNED_BYTE)}catch(r){this.type=t.UNSIGNED_BYTE,o=new Uint8Array(e*n*4),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.UNSIGNED_BYTE,o)}if(V=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,V),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,e,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,V),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0),(s=t.checkFramebufferStatus(t.FRAMEBUFFER))===t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(s===t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(s===t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(s===t.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(s!==t.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+s);t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.gl=t,this.frameBuffer=i,this.renderBuffer=V,this.width=e,this.height=n}function Q(t,e,n){var r,i,V,o,s,a,c,u,h="";function l(e,n){var r,i;if(r=n?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER),t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){for(e=e.split(/[\n\r]/),i=0;i<e.length;i++)e[i]=i+1+":\t"+e[i];throw e.unshift("Error compiling "+(n?"fragment":"vertex")+" shader:"),X.logger.error(e.join("\n")),new Error("Shader error: "+t.getShaderInfoLog(r))}return r}function f(e,n){if(e.type===t.SAMPLER_2D)return function(r){e.glTexture=t["TEXTURE"+r],t.uniform1i(n,r)};if(e.type===t.BOOL||e.type===t.INT)return e.size>1?function(e){t.uniform1iv(n,e)}:function(e){t.uniform1i(n,e)};if(e.type===t.FLOAT)return e.size>1?function(e){t.uniform1fv(n,e)}:function(e){t.uniform1f(n,e)};if(e.type===t.FLOAT_VEC2)return function(e){t.uniform2f(n,e[0],e[1])};if(e.type===t.FLOAT_VEC3)return function(e){t.uniform3f(n,e[0],e[1],e[2])};if(e.type===t.FLOAT_VEC4)return function(e){t.uniform4f(n,e[0],e[1],e[2],e[3])};if(e.type===t.FLOAT_MAT3)return function(e){t.uniformMatrix3fv(n,!1,e)};if(e.type===t.FLOAT_MAT4)return function(e){t.uniformMatrix4fv(n,!1,e)};throw new Error("Unknown shader uniform type: "+e.type)}function d(e){return function(){return t.getUniform(r,e)}}if(i=l(e),V=l(n,!0),r=t.createProgram(),t.attachShader(r,i),(o=t.getShaderInfoLog(i))&&(h+="Vertex shader error: "+o+"\n"),t.attachShader(r,V),(o=t.getShaderInfoLog(V))&&(h+="Fragment shader error: "+o+"\n"),t.linkProgram(r),!t.getProgramParameter(r,t.LINK_STATUS))throw h+=t.getProgramInfoLog(r),t.deleteProgram(r),t.deleteShader(i),t.deleteShader(V),(c=R.exec(e)||R.exec(n))&&(h="Shader = "+c[1]+"\n"+h),E.forEach((function(e){h+="\n"+e+": "+t.getParameter(t[e])})),new Error("Could not initialize shader:\n"+h);for(t.useProgram(r),this.uniforms={},a=t.getProgramParameter(r,t.ACTIVE_UNIFORMS),s=0;s<a;++s)(u={info:t.getActiveUniform(r,s)}).name=u.info.name.replace(/\[0\]$/,""),u.loc=t.getUniformLocation(r,u.name),u.set=f(u.info,u.loc),u.get=d(u.loc),this.uniforms[u.name]=u,this[u.name]||(this[u.name]=u);for(this.attributes={},this.location={},a=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),s=0;s<a;++s)(u={info:t.getActiveAttrib(r,s)}).name=u.info.name,u.location=t.getAttribLocation(r,u.name),this.attributes[u.name]=u,this.location[u.name]=u.location;this.gl=t,this.program=r,this.destroy=function(){var e;for(e in t&&(t.deleteProgram(r),t.deleteShader(i),t.deleteShader(V)),this)this.hasOwnProperty(e)&&delete this[e];r=null,i=null,V=null}}function X(t){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(t);var e,n,r,i,V,s,d,m,w,A,S,x,T,E,k,I=++b,N=this,U=[],B={},q=0,G=[],Z=[],K=[],J=[],tt={},et=[],nt=[],rt={},it={},Vt=!1,ot=!1;function st(t,e){var n,r,i;return!!e&&(n=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.STATIC_DRAW),n.size=3,r=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),i=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,t.coords,e.STATIC_DRAW),i.size=2,{vertex:n,index:r,texCoord:i,length:t.indices.length,mode:t.mode||e.TRIANGLES})}function at(t){var e={};return e.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),e.indices=new Uint16Array([0,1,2,0,2,3]),e.coords=new Float32Array([0,0,1,0,1,1,0,1]),st(e,t)}function ct(t){var r,o;if(!n)if(t.canvas.addEventListener("webglcontextlost",ht,!1),t.canvas.addEventListener("webglcontextrestored",ut,!1),t.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(n=t,e=t.canvas,i=at(n),V=new Q(n,"#define SHADER_NAME seriously.base\n"+a,"#define SHADER_NAME seriously.base\n"+c),r=0;r<J.length;r++)(o=J[r]).gl=n,o.initialize(),o.buildShader();for(r=0;r<G.length;r++)(o=G[r]).initialize();for(r=0;r<Z.length;r++)(o=Z[r]).model||(o.model=i,o.shader=V)}}function ut(){var t,e,i,V;if(r&&!n){if(F(e=r.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(t=H(e,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:r.debugContext})){if(t.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ct(t),r.renderToTexture?r.frameBuffer=new $(n,r.width,r.height,!1):r.frameBuffer={frameBuffer:null},i=0;i<U.length;i++)(V=U[i]).setDirty(),V.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function ht(t){var r,o;for(t&&(X.logger.warn("WebGL context lost"),t.preventDefault()),k&&(P(k),k=0),e&&e.removeEventListener("webglcontextlost",ht,!1),r=0;r<J.length;r++)(o=J[r]).gl=null,o.initialized=!1,o.baseShader=null,o.model=null,o.frameBuffer=null,o.texture=null,o.shader&&o.shader.destroy&&(o.shader.destroy(),o.effect.commonShader&&delete it[o.hook]),o.shaderDirty=!0,o.shader=null,o.effect.lostContext&&o.effect.lostContext.call(o),t&&o.emit("webglcontextlost");for(r=0;r<G.length;r++)(o=G[r]).texture=null,o.initialized=!1,o.allowRefresh=!1,t&&o.emit("webglcontextlost");for(r=0;r<K.length;r++)(o=K[r]).frameBuffer=null,o.texture=null,t&&o.emit("webglcontextlost");for(r=0;r<Z.length;r++)(o=Z[r]).model=!1,o.frameBuffer=null,t&&o.emit("webglcontextlost");V&&V.destroy&&V.destroy(),n&&(n.deleteBuffer(i.vertex),n.deleteBuffer(i.texCoord),n.deleteBuffer(i.index)),i&&(delete i.vertex,delete i.texCoord,delete i.index),i=null,V=null,n=null,e=null}function lt(t){var e,n,r=!1;if(k=0,et.length)for(r=!0,e=0;e<et.length;e++)et[e].call(N,t);if(G&&G.length)for(r=!0,e=0;e<G.length;e++)((n=G[e]).dirty||n.checkDirty&&n.checkDirty())&&(n.dirty=!1,n.setDirty());for(e=0;e<Z.length;e++)(n=Z[e]).auto&&n.dirty&&n.render();if(nt.length)for(r=!0,e=0;e<nt.length;e++)nt[e].call(N);r&&!k&&(k=O(lt))}function ft(t,e,r,i,V,o){var s,a,c,u,h,l,f,p,g,v=0,y=V&&V.gl||n;if(y){for(s in V?(u=o&&o.width||V.width||y.canvas.width,h=o&&o.height||V.height||y.canvas.height):(u=o&&o.width||y.canvas.width,h=o&&o.height||y.canvas.height),t.use(),y.viewport(0,0,u,h),y.bindFramebuffer(y.FRAMEBUFFER,i),y.enableVertexAttribArray(t.location.position),y.enableVertexAttribArray(t.location.texCoord),e.texCoord&&(y.bindBuffer(y.ARRAY_BUFFER,e.texCoord),y.vertexAttribPointer(t.location.texCoord,e.texCoord.size,y.FLOAT,!1,0,0)),y.bindBuffer(y.ARRAY_BUFFER,e.vertex),y.vertexAttribPointer(t.location.position,e.vertex.size,y.FLOAT,!1,0,0),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,e.index),o&&o.depth?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),o?void 0===o.blend||o.blend?(n.enable(n.BLEND),l=void 0===o.srcRGB?n.ONE:o.srcRGB,p=o.dstRGB||n.ZERO,f=void 0===o.srcAlpha?l:o.srcAlpha,g=void 0===o.dstAlpha?p:o.dstAlpha,n.blendFuncSeparate(l,p,f,g),n.blendEquation(o.blendEquation||n.FUNC_ADD)):n.disable(n.BLEND):(n.enable(n.BLEND),n.blendFunc(n.ONE,n.ZERO),n.blendEquation(n.FUNC_ADD)),r)r.hasOwnProperty(s)&&(a=r[s],(c=t.uniforms[s])&&(F(a,"WebGLTexture")?(y.activeTexture(y.TEXTURE0+v),y.bindTexture(y.TEXTURE_2D,a),c.set(v),v++):a instanceof d||a instanceof m||a instanceof w?a.texture&&(y.activeTexture(y.TEXTURE0+v),y.bindTexture(y.TEXTURE_2D,a.texture),c.set(v),v++):null!=a&&c.set(a)));o&&void 0!==o.clear&&!o.clear||(y.clearColor(0,0,0,0),y.clear(y.COLOR_BUFFER_BIT|y.DEPTH_BUFFER_BIT)),y.drawElements(e.mode,e.length,y.UNSIGNED_SHORT,0),n.enable(n.DEPTH_TEST)}}function dt(t,e,n){var r,i;if(("string"!=typeof t||!e&&0!==e)&&(n&&"object"==typeof n||(n=e),e=t),"string"==typeof t&&l[t]||(t=null),e instanceof d||e instanceof m||e instanceof w)r=e;else if(e instanceof S||e instanceof x||e instanceof T){if(!(r=B[e.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof e&&isNaN(e)&&(e=j(e,["canvas","img","video"])),i=0;i<G.length;i++)if(r=G[i],(!t||t===r.hook)&&r.compare&&r.compare(e,n))return r;r=new d(t,e,n)}return r}function pt(t,e){var n,r,i;if(!(t instanceof m||t instanceof w))return!1;if(t===e)return!0;for(n in i=t.sources)if(i.hasOwnProperty(n)&&((r=i[n])===e||pt(r,e)))return!0;return!1}(s=function(){this.ready=!1,this.width=1,this.height=1,this.gl=n,this.uniforms={resolution:[this.width,this.height],transform:null},this.dirty=!0,this.isDestroyed=!1,this.seriously=N,this.listeners={},this.id=q,q++}).prototype.setReady=function(){var t;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setReady()},s.prototype.setUnready=function(){var t;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setUnready()},s.prototype.setDirty=function(){var t;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setDirty()},s.prototype.initFrameBuffer=function(t){n&&(this.frameBuffer=new $(n,this.width,this.height,t))},s.prototype.readPixels=function(t,e,r,i,V){var o=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.frameBuffer||(this.initFrameBuffer(),this.setDirty()),this.render(),void 0===V)V=new Uint8Array(r*i*4);else if(!F(V,"Uint8Array"))throw new Error("Incompatible array type");return o.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),o.readPixels(t,e,r,i,n.RGBA,n.UNSIGNED_BYTE,V),V},s.prototype.resize=function(){var t,e;this.source?(t=this.source.width,e=this.source.height):this.sources&&this.sources.source?(t=this.sources.source.width,e=this.sources.source.height):this.inputs&&this.inputs.width?(t=this.inputs.width,e=this.inputs.height||t):this.inputs&&this.inputs.height?t=e=this.inputs.height:(t=1,e=1),t=Math.floor(t),e=Math.floor(e),this.width===t&&this.height===e||(this.width=t,this.height=e,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=e),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,e)},s.prototype.on=function(t,e){var n,r=-1;t&&"function"==typeof e&&((n=this.listeners[t])?r=n.indexOf(e):n=this.listeners[t]=[],r<0&&n.push(e))},s.prototype.off=function(t,e){var n,r=-1;t&&"function"==typeof e&&(n=this.listeners[t])&&(r=n.indexOf(e))>=0&&n.splice(r,1)},s.prototype.emit=function(t){var e,n=this.listeners[t];if(n&&n.length)for(e=0;e<n.length;e++)z(n[e])},s.prototype.destroy=function(){var t,e;for(e in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(e)&&delete this.listeners[e];for(t in this.uniforms)this.uniforms.hasOwnProperty(t)&&delete this.uniforms[t];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(t=U.indexOf(this))>=0&&U.splice(t,1),delete B[this.id],this.isDestroyed=!0},S=function(t){var e,n=t;function r(t,e){var r,i,V;return V=n.effect.inputs[t],r=n.inputElements[t],"string"==typeof e&&isNaN(e)&&("enum"===V.type?V.options.hasOwnProperty(e)||(e=j(e,["select"])):"number"===V.type||"boolean"===V.type?e=j(e,["input","select"]):"image"===V.type&&(e=j(e,["canvas","img","video"]))),F(e,"HTMLInputElement")||F(e,"HTMLSelectElement")?(i=e.value,r&&r.element!==e&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[t],r=null),r||(r={element:e,listener:function(t,r){return function(){var i,o;i="checkbox"===e.type?e.checked:r.value,o=n.setInput(t,i),"color"===V.type&&(o=W(o).substr(0,7)),o!==i&&(r.value=o)}}(t,e)},n.inputElements[t]=r,"range"===e.type?(e.addEventListener("input",r.listener,!0),e.addEventListener("change",r.listener,!0)):e.addEventListener("change",r.listener,!0)),r&&"checkbox"===e.type&&(i=e.checked)):(r&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[t]),i=e),n.setInput(t,i),n.inputs[t]}function i(t){return function(e){var n=r(t,e);return n&&n.pub}}function V(t){return function(){var e=n.inputs[t];return e&&e.pub}}function o(t){return function(e){return r(t,e)}}function s(t){return function(){return n.inputs[t]}}for(e in n.effect.inputs)if(n.effect.inputs.hasOwnProperty(e)){if(void 0!==this[e])throw new Error("Cannot overwrite Seriously."+e);"image"===n.effect.inputs[e].type?Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:V(e),set:i(e)}):Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:s(e),set:o(e)})}Object.defineProperties(this,{effect:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.effect.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}}}),this.render=function(){return n.render(),this},this.readPixels=function(t,e,r,i,V){return n.readPixels(t,e,r,i,V)},this.on=function(t,e){n.on(t,e)},this.off=function(t,e){n.off(t,e)},this.inputs=function(t){var e,r,i,V;if(i=n.effect.inputs,t)return(r=i[t])?(e={type:r.type,defaultValue:r.defaultValue,title:r.title||t},"number"===r.type?(e.min=r.min,e.max=r.max,e.step=r.step,e.mod=r.mod):"enum"===r.type?e.options=L({},r.options):"vector"===r.type&&(e.dimensions=r.dimensions),r.description&&(e.description=r.description),e):null;for(V in e={},i)i.hasOwnProperty(V)&&(e[V]=this.inputs(V));return e},this.alias=function(t,e){return n.alias(t,e),this},this.matte=function(t){n.matte(t)},this.destroy=function(){var t,e;for(t in n.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(m=function(t,e){var r,i,V,a,c={};for(r in s.call(this,e),this.gl=n,this.effectRef=u[t],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=t,this.options=e,this.transform=null,this.effect=L({},this.effectRef),this.effectRef.definition&&L(this.effect,this.effectRef.definition.call(this,e)),Y(this.effect),this.uniforms.transform=o,this.inputs={},a=rt[t],this.effect.inputs)this.effect.inputs.hasOwnProperty(r)&&(void 0!==(i=this.effect.inputs[r]).defaultValue&&null!==i.defaultValue||("number"===i.type?i.defaultValue=Math.min(Math.max(0,i.min),i.max):"color"===i.type?i.defaultValue=[0,0,0,0]:"boolean"===i.type?i.defaultValue=!1:"string"===i.type?i.defaultValue="":"enum"===i.type&&(i.defaultValue=i.firstValue)),V=i.validate.call(this,i.defaultValue,i),a&&void 0!==a[r]&&(V=i.validate.call(this,a[r],i,i.defaultValue,V),a[r]=V,"image"===i.type&&(c[r]=V)),this.inputs[r]=V,i.uniform&&(this.uniforms[i.uniform]=i.defaultValue));for(r in n&&(this.initialize(),this.effect.commonShader&&this.buildShader()),this.updateReady(),this.inPlace=this.effect.inPlace,this.pub=new S(this),U.push(this),B[this.id]=this,J.push(this),p[t].push(this),c)c.hasOwnProperty(r)&&this.setInput(r,c[r])}).prototype=Object.create(s.prototype),m.prototype.constructor=m,m.prototype.initialize=function(){if(!this.initialized){var t=this;this.baseShader=V,this.shape?this.model=st(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,(function(){t.initFrameBuffer(!0)}),n):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},m.prototype.resize=function(){var t;for(s.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),t=0;t<this.targets.length;t++)this.targets[t].resize()},m.prototype.updateReady=function(){var t,e,n,r,i=!0;for(e in(n=this.effect).inputs)if(n.inputs.hasOwnProperty(e)&&"image"===this.effect.inputs[e].type&&(!this.sources[e]||!this.sources[e].ready)&&(!n.requires||n.requires.call(this,e,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),r=i?"setReady":"setUnready",this.targets))for(t=0;t<this.targets.length;t++)this.targets[t][r]()},m.prototype.setReady=m.prototype.updateReady,m.prototype.setUnready=m.prototype.updateReady,m.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},m.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1)},m.prototype.removeSource=function(t){var e,n=t&&t.pub;for(e in this.inputs)!this.inputs.hasOwnProperty(e)||this.inputs[e]!==t&&this.inputs[e]!==n||(this.inputs[e]=null);for(e in this.sources)!this.sources.hasOwnProperty(e)||this.sources[e]!==t&&this.sources[e]!==n||(this.sources[e]=null)},m.prototype.buildShader=function(){var t,e=this.effect,r=this;function i(t){return R.test(t)?t:"#define SHADER_NAME seriously."+r.hook+"\n"+t}this.shaderDirty&&(e.commonShader&&it[this.hook]?(this.shader||it[this.hook].count++,this.shader=it[this.hook].shader):e.shader?(this.shader&&!e.commonShader&&this.shader.destroy(),(t=e.shader.call(this,this.inputs,{vertex:a,fragment:c},X.util))instanceof Q?this.shader=t:t&&t.vertex&&t.fragment?this.shader=new Q(n,i(t.vertex),i(t.fragment)):this.shader=V,e.commonShader&&(it[this.hook]={count:1,shader:this.shader})):this.shader=V,this.shaderDirty=!1)},m.prototype.render=function(){var t,e,r,i=this.effect,V=this;if(n){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(t in this.sources)!this.sources.hasOwnProperty(t)||i.requires&&!i.requires.call(this,t,this.inputs)||(r="function"==typeof this.inPlace?this.inPlace(t):this.inPlace,this.sources[t].render(!r));this.frameBuffer&&(e=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,e,(function(t,e,n,r,i,o){ft(t,e,n,r,i||V,o)})),this.emit("render")):e&&(ft(this.shader,this.model,this.uniforms,e,this),this.emit("render")),this.dirty=!1}return this.texture}},m.prototype.setInput=function(t,e){var n,r,i,V,s,a=this;if(this.effect.inputs.hasOwnProperty(t)){if("image"===(n=this.effect.inputs[t]).type){if(e){if((e=dt(e))!==this.sources[t]){if(function(){var e,n=a.sources[t];if(n){for(e in a.sources)if(e!==t&&a.sources.hasOwnProperty(e)&&a.sources[e]===n)return;n.removeTarget(a)}}(),pt(e,this))throw new Error("Attempt to make cyclical connection.");this.sources[t]=e,e.addTarget(this)}}else delete this.sources[t],e=!1;r=this.sources[t],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(V=this.sources[i[0]],this.uniforms.transform=V&&V.cumulativeMatrix||o):this.uniforms.transform=o}else s=rt[this.hook]&&void 0!==rt[this.hook][t]?rt[this.hook][t]:n.defaultValue,r=e=n.validate.call(this,e,n,s,this.inputs[t]);return this.inputs[t]===e&&"color"!==n.type&&"vector"!==n.type||(this.inputs[t]=e,n.uniform&&(this.uniforms[n.uniform]=r),"image"===n.type?(this.resize(),this.updateReady()):n.updateSources&&this.updateReady(),n.shaderDirty&&(this.shaderDirty=!0),this.setDirty(),n.update&&n.update.call(this,e)),e}},m.prototype.alias=function(t,e){var n=this;if(D.indexOf(e)>=0)throw new Error("'"+e+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(t)&&(e||(e=t),N.removeAlias(e),tt[e]={node:this,input:t},Object.defineProperty(N,e,{configurable:!0,enumerable:!0,get:function(){return n.inputs[t]},set:function(e){return n.setInput(t,e)}})),this},m.prototype.matte=function(t){var e,n,r,i,V,o,s,a=[],c=[],u={};function h(t){var e,n,r,i,V,o,s,u,h,l,f,d=[];if(!t.simple){for(e=0;e<t.edges.length;e++)for(r=t.edges[e],n=e+1;n<t.edges.length;n++)i=t.edges[n],p=r[0],g=r[1],v=i[0],m=i[1],y=void 0,b=void 0,_=void 0,w=void 0,A=void 0,y=(m.x-v.x)*(p.y-v.y)-(m.y-v.y)*(p.x-v.x),b=(g.x-p.x)*(p.y-v.y)-(g.y-p.y)*(p.x-v.x),(V=!!((_=(m.y-v.y)*(g.x-p.x)-(m.x-v.x)*(g.y-p.y))&&(A=b/_,(w=y/_)>0&&w<=1&&A>0&&A<=1))&&{x:p.x+w*(g.x-p.x),y:p.y+w*(g.y-p.y)})&&(V.edge1=r,V.edge2=i,d.push(V));var p,g,v,m,y,b,_,w,A;if(d.length){for(h=[],e=0;e<d.length;e++)r=(V=d[e]).edge1,i=V.edge2,l={x:V.x,y:V.y,prev:r[0],next:i[1],id:c.length},t.vertices.push(l),c.push(l),f={x:V.x,y:V.y,prev:i[0],next:r[1],id:c.length},t.vertices.push(f),c.push(l),l.prev.next=l,l.next.prev=l,f.prev.next=f,f.next.prev=f;do{o={edges:[],vertices:[],simple:!0},h.push(o),s=u=t.vertices[0];do{e=t.vertices.indexOf(u),t.vertices.splice(e,1),o.edges.push([u,u.next]),o.vertices.push(u),u=u.next}while(u!==s)}while(t.vertices.length);for(e=a.indexOf(t),a.splice(e,1),e=0;e<h.length;e++)a.push(h[e])}else t.simple=!0}}function l(t){var e,n,r,i,V=t.vertices.length,o=0;for(e=V-1,n=0;n<V;e=n,n++)r=t.vertices[e],i=t.vertices[n],o+=r.x*i.y-i.x*r.y;return o>0}function f(t){var e,r,i,V,o,s,a,c,u,h,l,f=t.vertices,d=[],p=[];function g(t,e,n,r){var i,V,o,s,a,c,u,h,l,f,d,p;return i=n.x-e.x,V=n.y-e.y,o=t.x-n.x,s=t.y-n.y,a=e.x-t.x,c=e.y-t.y,u=r.x-t.x,h=r.y-t.y,l=r.x-e.x,f=r.y-e.y,d=r.x-n.x,p=r.y-n.y,i*f-V*l>=0&&o*p-s*d>=0&&a*h-c*u>=0}function v(t,e,n,r,i){var V,o,s,a;if(o=f[i[t]],s=f[i[e]],a=f[i[n]],0>(s.x-o.x)*(a.y-o.y)-(s.y-o.y)*(a.x-o.x))return!1;for(V=0;V<r;V++)if(V!==t&&V!==e&&V!==n&&g(o,s,a,f[i[V]]))return!1;return!0}if(r=f.length,t.clockWise)for(e=0;e<r;e++)d[e]=e;else for(e=0;e<r;e++)d[e]=r-1-e;for(V=2*(i=r),e=i-1;i>2;){if(V--<=0)return p;if(i<=(o=e)&&(o=0),i<=(e=o+1)&&(e=0),i<(s=e+1)&&(s=0),v(o,e,s,i,d)){for(a=d[o],c=d[e],u=d[s],t.clockWise?(p.push(f[a]),p.push(f[c]),p.push(f[u])):(p.push(f[u]),p.push(f[c]),p.push(f[a])),h=e,l=e+1;l<i;h++,l++)d[h]=d[l];V=2*--i}}n.indices=p}for(e=function(t){return t&&t.length&&Array.isArray(t)?Array.isArray(t[0])?Array.isArray(t[0])&&!isNaN(t[0][0])?[t]:t:[t]:[]}(t),r=0;r<e.length;r++){for(t=e[r],s=null,n={vertices:[],edges:[]},i=0;i<t.length;i++)"object"!=typeof(V=t[i])||isNaN(V.x)||isNaN(V.y)?V.length>=2&&!isNaN(V[0])&&!isNaN(V[1])&&(o={x:V[0],y:V[1],id:c.length}):o={x:V.x,y:V.y,id:c.length},o&&(s?(s.next=o,o.prev=s,o.next=n.vertices[0],n.vertices[0].prev=o):(n.head=o,o.next=o,o.prev=o),c.push(o),n.vertices.push(o),s=o);if(n.vertices.length>2)for(3===n.vertices.length&&(n.simple=!0),a.push(n),i=0;i<n.vertices.length;i++)o=n.vertices[i],n.edges.push([o,o.next])}for(r=a.length-1;r>=0;r--)h(n=a[r]);for(r=0;r<a.length;r++)(n=a[r]).clockWise=l(n),f(n);for(u.vertices=[],u.coords=[],r=0;r<c.length;r++)V=c[r],u.vertices.push(2*V.x-1),u.vertices.push(-2*V.y+1),u.vertices.push(-1),u.coords.push(V.x),u.coords.push(-1*V.y+1);for(u.vertices=new Float32Array(u.vertices),u.coords=new Float32Array(u.coords),u.indices=[],r=0;r<a.length;r++)for(n=a[r],i=0;i<n.indices.length;i++)V=n.indices[i],u.indices.push(V.id);u.indices=new Uint16Array(u.indices),this.shape=u,this.gl&&st(u,this.gl)},m.prototype.destroy=function(){var t,e,n,r=this.hook;for(e in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,it[r]&&(it[r].count--,it[r].count||delete it[r]),this.shader&&this.shader.destroy&&this.shader!==V&&!it[r]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(e)&&((n=this.inputElements[e]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(e in this.sources)this.sources.hasOwnProperty(e)&&((n=this.sources[e])&&n.removeTarget&&n.removeTarget(this),delete this.sources[e]);for(;this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(e in this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];for(e in tt)tt.hasOwnProperty(e)&&(n=tt[e]).node===this&&N.removeAlias(e);(t=J.indexOf(this))>=0&&J.splice(t,1),(t=p[r].indexOf(this))>=0&&p[r].splice(t,1),s.prototype.destroy.call(this)},x=function(t){var e=t;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return e.source}},id:{enumerable:!0,configurable:!0,get:function(){return e.id}},width:{enumerable:!0,configurable:!0,get:function(){return e.width}},height:{enumerable:!0,configurable:!0,get:function(){return e.height}}}),this.render=function(){e.render()},this.update=function(){e.setDirty()},this.readPixels=function(t,n,r,i,V){return e.readPixels(t,n,r,i,V)},this.on=function(t,n){e.on(t,n)},this.off=function(t,n){e.off(t,n)},this.destroy=function(){var t,n;for(t in e.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((n=Object.getOwnPropertyDescriptor(this,t)).get||n.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return e.isDestroyed},this.isReady=function(){return e.ready}},(d=function(t,e,r){var i,V,o=r||{},a=void 0===o.flip||o.flip,c=o.width,u=o.height,h=!1,f=this,d=!1;function p(t,e,n,r){var i=l[t];if(i.definition){if(!(i=i.definition.call(f,e,n,r)))return null;i=L(L({},l[t]),i)}return i}function g(t){return f.source===t}if(s.call(this),(t&&"string"!=typeof t||!e&&0!==e)&&(r&&"object"==typeof r||(r=e),e=t),"string"==typeof e&&isNaN(e)&&(e=j(e,["canvas","img","video"])),"string"==typeof t&&l[t]&&(V=p(t,e,r,!0))&&(this.hook=t,d=!0,h=V.deferTexture,this.plugin=V,this.compare=V.compare,this.checkDirty=V.checkDirty,V.source&&(e=V.source)),!V&&F(e))"CANVAS"===e.tagName?(this.width=e.width,this.height=e.height,this.render=this.renderImageCanvas,d=!0,this.hook="canvas",this.compare=g):"IMG"===e.tagName&&(this.width=e.naturalWidth||1,this.height=e.naturalHeight||1,e.complete&&e.naturalWidth||(h=!0),e.addEventListener("load",(function(){f.isDestroyed||(f.width===e.naturalWidth&&f.height===e.naturalHeight||(f.width=e.naturalWidth,f.height=e.naturalHeight,f.resize()),f.setDirty(),f.setReady())}),!0),this.render=this.renderImageCanvas,d=!0,this.hook="image",this.compare=g);else if(!V&&F(e,"WebGLTexture")){if(n&&!n.isTexture(e))throw new Error("Not a valid WebGL texture.");isNaN(c)?isNaN(u)||(c=u):isNaN(u)&&(u=c),this.width=c,this.height=u,void 0===o.flip&&(a=!1),d=!0,this.texture=e,this.initialized=!0,this.hook="texture",this.compare=g,this.render=function(){}}if(!d&&!V)for(i in l)if(l.hasOwnProperty(i)&&l[i]&&(V=p(i,e,r,!1))){this.hook=i,d=!0,h=V.deferTexture,this.plugin=V,this.compare=V.compare,this.checkDirty=V.checkDirty,V.source&&(e=V.source);break}if(!d)throw new Error("Unknown source type");this.source=e,void 0===this.flip&&(this.flip=a),this.targets=[],h||f.setReady(),this.pub=new x(this),U.push(this),B[this.id]=this,G.push(this),v[this.hook].push(this),G.length&&!k&&lt()}).prototype=Object.create(s.prototype),d.prototype.constructor=d,d.prototype.initialize=function(){var t;n&&!this.texture&&this.ready&&(t=n.createTexture(),n.bindTexture(n.TEXTURE_2D,t),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.bindTexture(n.TEXTURE_2D,null),this.texture=t,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},d.prototype.initFrameBuffer=function(t){n&&(this.frameBuffer=new $(n,this.width,this.height,{texture:this.texture,useFloat:t}))},d.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},d.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1)},d.prototype.resize=function(){var t,e;if(this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.framebuffer&&this.framebuffer.resize(this.width,this.height),this.emit("resize"),this.setDirty(),this.targets)for(t=0;t<this.targets.length;t++)(e=this.targets[t]).resize(),e.setTransformDirty&&e.setTransformDirty()},d.prototype.setReady=function(){var t;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setReady()},d.prototype.render=function(){var t=this.source;n&&(t||0===t)&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.plugin&&this.plugin.render&&(this.dirty||this.checkDirty&&this.checkDirty())&&this.plugin.render.call(this,n,ft,i,V)&&(this.dirty=!1,this.emit("render")))},d.prototype.renderImageCanvas=function(){var t=this.source;if(n&&t&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.dirty)){n.bindTexture(n.TEXTURE_2D,this.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{return n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.dirty=!1,this.emit("render"),!0}catch(t){t.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},d.prototype.destroy=function(){var t,e,r;for(this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),n&&this.texture&&n.deleteTexture(this.texture);this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(e in(t=G.indexOf(this))>=0&&G.splice(t,1),(t=v[this.hook].indexOf(this))>=0&&v[this.hook].splice(t,1),this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];s.prototype.destroy.call(this)},E=function(t){var e=t;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(e.source)return e.source.pub},set:function(t){e.setSource(t)}},original:{enumerable:!0,configurable:!0,get:function(){return e.target}},width:{enumerable:!0,configurable:!0,get:function(){return e.width},set:function(t){!isNaN(t)&&t>0&&e.width!==t&&(e.width=t,e.resize(),e.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return e.height},set:function(t){!isNaN(t)&&t>0&&e.height!==t&&(e.height=t,e.resize(),e.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return e.id}}}),this.render=function(){e.render()},this.readPixels=function(t,n,r,i,V){return e.readPixels(t,n,r,i,V)},this.on=function(t,n){e.on(t,n)},this.off=function(t,n){e.off(t,n)},this.go=function(t){e.go(t)},this.stop=function(){e.stop()},this.getTexture=function(){return e.frameBuffer.texture},this.destroy=function(){var t,n;for(t in e.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((n=Object.getOwnPropertyDescriptor(this,t)).get||n.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.inputs=function(t){return{source:{type:"image"}}},this.isDestroyed=function(){return e.isDestroyed},this.isReady=function(){return e.ready}},((A=function(t,e,o){var u,h,l,d,p,g,v,m,b,w=this,A=!1;function S(t,e,r,o){var s=f[t];if(s.definition){if(!(s=s.definition.call(w,e,r,o)))return null;s=L(L({},f[t]),s),w.hook=b,A=!0,w.plugin=s,w.compare=s.compare,s.target&&(e=s.target),s.gl&&!w.gl&&(w.gl=s.gl,n||ct(s.gl)),w.gl===n&&(w.model=i,w.shader=V)}return s}if(s.call(this),(t&&"string"!=typeof t||!e&&0!==e)&&(o&&"object"==typeof o||(o=e),e=t),h=void 0===(u=o||{}).flip||u.flip,l=parseInt(u.width,10),d=parseInt(u.height,10),g=u.debugContext,"string"==typeof t&&f[t]&&S(t,e,u,!0),this.renderToTexture=u.renderToTexture,F(e,"WebGLFramebuffer"))if(v=e,F(u,"HTMLCanvasElement"))e=u;else if(F(u,"WebGLRenderingContext"))e=u.canvas;else if(F(u.canvas,"HTMLCanvasElement"))e=u.canvas;else{if(!F(u.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");e=u.context.canvas}if(F(e,"HTMLCanvasElement")){if(l=e.width,d=e.height,(!n||n.canvas!==e&&u.allowSecondaryWebGL)&&(p=H(e,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:g})),p)n&&n!==p?(this.gl=p,this.frameBuffer={frameBuffer:v||null},this.shader=new Q(this.gl,a,c),this.model=at.call(this,this.gl),this.pixels=null,this.texture=this.gl.createTexture(),this.gl.bindTexture(n.TEXTURE_2D,this.texture),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),this.render=this.renderSecondaryWebGL):(r||(r=this),n||ct(p),this.render=this.renderWebGL,u.renderToTexture?n&&(this.frameBuffer=new $(n,l,d,!1)):this.frameBuffer={frameBuffer:v||null});else{if(!u.allowSecondaryWebGL&&n&&n.canvas!==e)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=_,X.logger.log("Unable to create WebGL context.")}A=!0}if(!A)for(b in f)if(f.hasOwnProperty(b)&&f[b]&&S(b,e,u,!1))break;if(!A)throw new Error("Unknown target type");y&&((m=y.get(e))?X.logger.warn("Target already in use by another instance",e,Object.keys(m).map((function(t){return m[t]}))):(m={},y.set(e,m)),m[N.id]=N),this.target=e,this.transform=null,this.transformDirty=!0,this.flip=h,l&&(this.width=l),d&&(this.height=d),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==u.auto?this.auto=u.auto:this.auto=Vt,this.frames=0,this.pub=new E(this),U.push(this),B[this.id]=this,Z.push(this)}).prototype=Object.create(s.prototype)).constructor=A,A.prototype.setSource=function(t){var e;(e=dt(t))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=e,e.addTarget(this),e&&(this.resize(),e.ready?this.setReady():this.setUnready()),this.setDirty())},A.prototype.setDirty=function(){this.dirty=!0,this.auto&&!k&&(k=O(lt))},A.prototype.resize=function(){F(this.target,"HTMLCanvasElement")?this.width===this.target.width&&this.height===this.target.height||(this.target.width=this.width,this.target.height=this.height,this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.emit("resize"),this.setTransformDirty()):this.plugin&&this.plugin.resize&&this.plugin.resize.call(this),!this.source||this.source.width===this.width&&this.source.height===this.height||this.transform||(this.transform=new Float32Array(16))},A.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},A.prototype.go=function(){this.auto=!0,this.setDirty()},A.prototype.stop=function(){this.auto=!1},A.prototype.render=function(){n&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,ft,V,i)},A.prototype.renderWebGL=function(){var t,e,r;if(this.resize(),n&&this.dirty&&this.ready){if(!this.source)return;this.source.render(),this.uniforms.source=this.source.texture,this.source.width===this.width&&this.source.height===this.height?this.uniforms.transform=this.source.cumulativeMatrix||o:this.transformDirty&&(t=this.transform,M.copy(t,this.source.cumulativeMatrix||o),e=this.source.width/this.width,r=this.source.height/this.height,t[0]*=e,t[1]*=e,t[2]*=e,t[3]*=e,t[4]*=r,t[5]*=r,t[6]*=r,t[7]*=r,this.uniforms.transform=t,this.transformDirty=!1),ft(V,i,this.uniforms,this.frameBuffer.frameBuffer,this,C),this.emit("render"),this.dirty=!1}},A.prototype.renderSecondaryWebGL=function(){var t,e,n,r,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),t=this.source.width,e=this.source.height,this.pixels&&this.pixels.length===t*e*4||(this.pixels=new Uint8Array(t*e*4)),this.source.readPixels(0,0,t,e,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),t===this.width&&e===this.height?this.uniforms.transform=o:this.transformDirty&&(n=this.transform,M.copy(n,o),r=this.source.width/this.width,i=this.source.height/this.height,n[0]*=r,n[1]*=r,n[2]*=r,n[3]*=r,n[4]*=i,n[5]*=i,n[6]*=i,n[7]*=i,this.uniforms.transform=n,this.transformDirty=!1),this.uniforms.source=this.texture,ft(this.shader,this.model,this.uniforms,null,this,C),this.dirty=!1)},A.prototype.removeSource=function(t){this.source!==t&&this.source!==t.pub||(this.source=null)},A.prototype.destroy=function(){var t,n;this.source&&this.source.removeTarget&&this.source.removeTarget(this),y&&(delete(n=y.get(this.target))[N.id],Object.keys(n).length||y.delete(this.target)),this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),delete this.source,delete this.target,delete this.pub,delete this.uniforms,delete this.pixels,delete this.auto,(t=Z.indexOf(this))>=0&&Z.splice(t,1),s.prototype.destroy.call(this),this===r&&(e.removeEventListener("webglcontextrestored",ut,!1),ht(),r=null)},T=function(t){var e,n=t,r=this;function i(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){return e.get.call(n)},set:function(r){!function(t,e,r){var i,V,o;i=n.inputElements[t],"string"==typeof r&&isNaN(r)&&("enum"===e.type?e.options.hasOwnProperty(r)||(r=j(r,["select"])):"number"===e.type||"boolean"===e.type?r=j(r,["input","select"]):"image"===e.type&&(r=j(r,["canvas","img","video"]))),F(r,"HTMLInputElement")||F(r,"HTMLSelectElement")?(V=r.value,i&&i.element!==r&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[t],i=null),i||(i={element:r,listener:(o=r,function(){var e,i;e="checkbox"===r.type?r.checked:o.value,i=n.setInput(t,e),"color"===r.type&&(i=W(i)),i!==e&&(o.value=i)})},n.inputElements[t]=i,"range"===r.type?(r.addEventListener("input",i.listener,!0),r.addEventListener("change",i.listener,!0)):r.addEventListener("change",i.listener,!0)),i&&"checkbox"===r.type&&(V=r.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[t]),V=r),n.setInput(t,V)}(t,e,r)}})}function V(t){return function(){t.apply(n,arguments)&&n.setTransformDirty()}}for(e in Object.defineProperties(this,{transform:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.plugin.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}},source:{enumerable:!0,configurable:!0,get:function(){return n.source&&n.source.pub},set:function(t){n.setSource(t)}}}),n.methods)n.methods.hasOwnProperty(e)&&(this[e]=V(n.methods[e]));for(e in n.inputs)n.inputs.hasOwnProperty(e)&&i(e,n.inputs[e]);this.update=function(){n.setDirty()},this.inputs=function(t){var e,r,i,V;if(i=n.plugin.inputs,t)return!(r=i[t])||r.method?null:(e={type:r.type,defaultValue:r.defaultValue,title:r.title||t},"number"===r.type?(e.min=r.min,e.max=r.max,e.step=r.step,e.mod=r.mod):"enum"===r.type?e.options=L({},r.options):"vector"===r.type&&(e.dimensions=r.dimensions),r.description&&(e.description=r.description),e);for(V in e={},i)i.hasOwnProperty(V)&&!i[V].method&&(e[V]=this.inputs(V));return e},this.alias=function(t,e){return n.alias(t,e),this},this.on=function(t,e){n.on(t,e)},this.off=function(t,e){n.off(t,e)},this.destroy=function(){var t,e;for(t in n.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(w=function(t,e){var n,r,i,V,o;for(n in this.matrix=new Float32Array(16),this.cumulativeMatrix=new Float32Array(16),this.ready=!1,this.width=1,this.height=1,this.seriously=N,this.transformRef=h[t],this.hook=t,this.id=q,q++,this.options=e,this.sources=null,this.targets=[],this.inputElements={},this.inputs={},this.methods={},this.listeners={},this.texture=null,this.frameBuffer=null,this.uniforms=null,this.dirty=!0,this.transformDirty=!0,this.renderDirty=!1,this.isDestroyed=!1,this.transformed=!1,this.plugin=L({},this.transformRef),this.transformRef.definition&&L(this.plugin,this.transformRef.definition.call(this,e)),this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&((r=this.plugin.inputs[n]).method&&"function"==typeof r.method?this.methods[n]=r.method:"function"==typeof r.set&&"function"==typeof r.get&&(this.inputs[n]=r));for(n in Y(this.plugin),o=rt[t],this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&"function"==typeof(r=this.plugin.inputs[n]).set&&"function"==typeof r.get&&"function"!=typeof r.method&&(i=r.get.call(this),V=void 0===r.defaultValue?i:r.defaultValue,V=r.validate.call(this,V,r,i),o&&void 0!==o[n]&&(V=r.validate.call(this,o[n],r,r.defaultValue,V),o[n]=V),V!==i&&r.set.call(this,V));U.push(this),B[this.id]=this,this.pub=new T(this),K.push(this),g[t].push(this)}).prototype=Object.create(s.prototype),w.prototype.constructor=w,w.prototype.setDirty=function(){this.renderDirty=!0,s.prototype.setDirty.call(this)},w.prototype.setTransformDirty=function(){var t,e;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,t=0;t<this.targets.length;t++)(e=this.targets[t]).setTransformDirty?e.setTransformDirty():e.setDirty()},w.prototype.resize=function(){var t;for(s.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),t=0;t<this.targets.length;t++)this.targets[t].resize();this.setTransformDirty()},w.prototype.setSource=function(t){var e;if((e=dt(t))!==this.source){if(pt(e,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=e,e.addTarget(this),e&&e.ready?this.setReady():this.setUnready(),this.resize()}},w.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},w.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1),this.targets&&this.targets.length&&this.resize()},w.prototype.setInput=function(t,e){var n,r,i;if(this.plugin.inputs.hasOwnProperty(t))return n=this.plugin.inputs[t],r=rt[this.hook]&&void 0!==rt[this.hook][t]?rt[this.hook][t]:n.defaultValue,i=n.get.call(this),void 0===r&&(r=i),e=n.validate.call(this,e,n,r,i),n.set.call(this,e)&&this.setTransformDirty(),n.get.call(this)},w.prototype.alias=function(t,e){var n,r,i=this;if(D.indexOf(e)>=0)throw new Error("'"+e+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(t)&&(e||(e=t),N.removeAlias(e),(n=this.inputs[t])?(r=i.inputs[t],Object.defineProperty(N,e,{configurable:!0,enumerable:!0,get:function(){return r.get.call(i)},set:function(t){r.set.call(i,t)&&i.setTransformDirty()}})):(n=this.methods[t])&&(r=n,N[e]=function(){r.apply(i,arguments)&&i.setTransformDirty()}),n&&(tt[e]={node:this,input:t})),this},w.prototype.render=function(t){return this.source?(this.source.render(),this.transformDirty&&(this.transformed?this.source.cumulativeMatrix?M.multiply(this.cumulativeMatrix,this.matrix,this.source.cumulativeMatrix):M.copy(this.cumulativeMatrix,this.matrix):M.copy(this.cumulativeMatrix,this.source.cumulativeMatrix||o),this.transformDirty=!1),t&&n?(this.renderDirty&&(this.frameBuffer||(this.uniforms={resolution:[this.width,this.height]},this.frameBuffer=new $(n,this.width,this.height)),this.uniforms.source=this.source.texture,this.uniforms.transform=this.cumulativeMatrix||o,ft(V,i,this.uniforms,this.frameBuffer.frameBuffer,this),this.renderDirty=!1),this.texture=this.frameBuffer.texture):this.source?this.texture=this.source.texture:this.texture=null,this.dirty=!1,this.texture):(this.transformDirty&&(M.copy(this.cumulativeMatrix,this.matrix),this.transformDirty=!1),this.texture=null,void(this.dirty=!1))},w.prototype.readPixels=function(t,e,r,i,V){var o=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===V)V=new Uint8Array(r*i*4);else if(!F(V,"Uint8Array"))throw new Error("Incompatible array type");return o.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),o.readPixels(t,e,r,i,n.RGBA,n.UNSIGNED_BYTE,V),V},w.prototype.destroy=function(){var t,e,n,r=this.hook;for(t in this.plugin.destroy&&"function"==typeof this.plugin.destroy&&this.plugin.destroy.call(this),delete this.effect,this.frameBuffer&&(this.frameBuffer.destroy(),delete this.frameBuffer,delete this.texture),this.inputElements)this.inputElements.hasOwnProperty(t)&&((n=this.inputElements[t]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(this.source&&this.source.removeTarget(this);this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(e in this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];for(e in tt)tt.hasOwnProperty(e)&&(n=tt[e]).node===this&&N.removeAlias(e);(t=K.indexOf(this))>=0&&K.splice(t,1),(t=g[r].indexOf(this))>=0&&g[r].splice(t,1),s.prototype.destroy.call(this)},w.prototype.setReady=s.prototype.setReady,w.prototype.setUnready=s.prototype.setUnready,w.prototype.on=s.prototype.on,w.prototype.off=s.prototype.off,w.prototype.emit=s.prototype.emit,(t=F(t,"HTMLCanvasElement")?{canvas:t}:t||{}).canvas,this.effect=function(t,e){if(!u[t])throw new Error("Unknown effect: "+t);return new m(t,e).pub},this.source=function(t,e,n){return dt(t,e,n).pub},this.transform=function(e,n){if("string"!=typeof e&&(n=e,e=!1),e){if(!h[e])throw new Error("Unknown transform: "+e)}else if(e=t&&t.defaultTransform||"2d",!h[e])throw new Error("No transform specified");return new w(e,n).pub},this.target=function(t,e,n){var r,i,V;for(t&&"string"==typeof t&&!f[t]&&(i=document.querySelector(t)),("string"!=typeof t||!e&&0!==e||i)&&(n&&"object"==typeof n||(n=e),e=i||t,t=null),"string"==typeof e&&isNaN(e)&&(e=document.querySelector(e)),V=0;V<Z.length;V++)if(r=Z[V],(!t||t===r.hook)&&(r.target===e||r.compare&&r.compare(e,n)))return r.pub;return(r=new A(t,e,n)).pub},this.aliases=function(){return Object.keys(tt)},this.removeAlias=function(t){tt[t]&&(delete this[t],delete tt[t])},this.defaults=function(t,e){var n;if(t)if("object"!=typeof t)null===e?delete rt[t]:"object"==typeof e&&(rt[t]=L({},e));else for(n in t)t.hasOwnProperty(n)&&this.defaults(n,t[n]);else if(null===t)for(n in rt)rt.hasOwnProperty(n)&&delete rt[n]},this.go=function(t,e){var n;for("function"==typeof t&&et.indexOf(t)<0&&et.push(t),"function"==typeof e&&nt.indexOf(e)<0&&nt.push(e),Vt=!0,n=0;n<Z.length;n++)Z[n].go();k||!et.length&&!nt.length||lt()},this.stop=function(){et.length=0,nt.length=0,P(k),k=0},this.render=function(){var e;for(e=0;e<Z.length;e++)Z[e].render(t)},this.destroy=function(){for(var t,e;U.length;)U[0].pub.destroy();for(t in this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_);N=null,G=[],Z=[],J=[],U=[],et.length=0,nt.length=0,P(k),k=0,ot=!0},this.isDestroyed=function(){return ot},this.incompatible=function(t){var e,n,r;if(r=X.incompatible(t))return r;if(!t){for(e in p)if(p.hasOwnProperty(e)&&p[e].length&&(n=u[e])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"plugin-"+e;for(e in v)if(v.hasOwnProperty(e)&&v[e].length&&(n=l[e])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"source-"+e}return!1},this.isNode=function(t){var e;return!(!t||!(e=B[t.id])||e.isDestroyed)},this.isSource=function(t){return this.isNode(t)&&t instanceof x},this.isEffect=function(t){return this.isNode(t)&&t instanceof S},this.isTransform=function(t){return this.isNode(t)&&t instanceof T},this.isTarget=function(t){return this.isNode(t)&&t instanceof E},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return I}}}),this.defaults(t.defaults)}window.addEventListener("message",(function(t){t.source===window&&"seriously-timeout-message"===t.data&&(t.stopPropagation(),d.length>0&&d.shift()())}),!0),$.prototype.resize=function(t,e){var n=this.gl;this.width===t&&this.height===e||(this.width=t,this.height=e,n&&(n.bindTexture(n.TEXTURE_2D,this.texture),n.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer),n.bindRenderbuffer(n.RENDERBUFFER,this.renderBuffer),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t,e,0,n.RGBA,n.UNSIGNED_BYTE,null),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t,e),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.texture,0),n.bindTexture(n.TEXTURE_2D,null),n.bindRenderbuffer(n.RENDERBUFFER,null),n.bindFramebuffer(n.FRAMEBUFFER,null)))},$.prototype.destroy=function(){var t=this.gl;t&&(t.deleteFramebuffer(this.frameBuffer),t.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&t.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},Q.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(t){var e,n,r;if(void 0===V&&((e=document.createElement("canvas"))&&e.getContext?window.WebGLRenderingContext?(n=G())||(V="context"):V="webgl":V="canvas"),V)return V;if(t){if((r=u[t])&&"function"==typeof r.compatible&&!r.compatible(n))return"plugin-"+t;if((r=l[t])&&"function"==typeof r.compatible&&!r.compatible(n))return"source-"+t}return!1},X.plugin=function(t,e,n){var r;if(u[t])X.logger.warn("Effect ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n)return r=L({},n),"function"==typeof e&&(r.definition=e),r.reserved=k,r.inputs&&Y(r),r.title||(r.title=t),u[t]=r,p[t]=[],r},X.removePlugin=function(t){var e;if(!t)return this;if(!u[t])return this;if(e=p[t]){for(;e.length;)e.shift().destroy();delete p[t]}return delete u[t],this},X.source=function(t,e,n){var r;if(l[t])X.logger.warn("Source ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.title||(r.title=t),l[t]=r,v[t]=[],r},X.removeSource=function(t){var e;if(!t)return this;if(!l[t])return this;if(e=v[t]){for(;e.length;)e.shift().destroy();delete v[t]}return delete l[t],this},X.transform=function(t,e,n){var r;if(h[t])X.logger.warn("Transform ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.reserved=I,r.inputs&&Y(r),r.title||(r.title=t),h[t]=r,g[t]=[],r},X.removeTransform=function(t){var e;if(!t)return this;if(!h[t])return this;if(e=g[t]){for(;e.length;)e.shift().destroy();delete g[t]}return delete h[t],this},X.target=function(t,e,n){var r;if(f[t])X.logger.warn("Target ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.title||(r.title=t),f[t]=r,m[t]=[],r},X.removeTarget=function(t){var e;if(!t)return this;if(!f[t])return this;if(e=m[t]){for(;e.length;)e.shift().destroy();delete m[t]}return delete f[t],this},X.inputValidators={color:function(t,e,n,r){var V,o,s,a;if(o=r||[],"string"==typeof t){if((s=A.exec(t))&&s.length){if(s.length<3)return o[0]=o[1]=o[2]=o[3]=0,o;for(o[3]=1,a=0;a<3;a++)o[a]=parseFloat(s[a+2])/255;return isNaN(s[6])||(o[3]=parseFloat(s[6])),"hsl"===s[1].toLowerCase()?B(o[0],o[1],o[2],o[3],o):o}if((s=S.exec(t))&&s.length)return 3===(V=s[1]).length?(o[0]=parseInt(V[0],16)/15,o[1]=parseInt(V[1],16)/15,o[2]=parseInt(V[2],16)/15,o[3]=1):4===V.length?(o[0]=parseInt(V[0],16)/15,o[1]=parseInt(V[1],16)/15,o[2]=parseInt(V[2],16)/15,o[3]=parseInt(V[3],16)/15):6===V.length?(o[0]=parseInt(V.substr(0,2),16)/255,o[1]=parseInt(V.substr(2,2),16)/255,o[2]=parseInt(V.substr(4,2),16)/255,o[3]=1):8===V.length?(o[0]=parseInt(V.substr(0,2),16)/255,o[1]=parseInt(V.substr(2,2),16)/255,o[2]=parseInt(V.substr(4,2),16)/255,o[3]=parseInt(V.substr(6,2),16)/255):o[0]=o[1]=o[2]=o[3]=0,o;if(s=w[t.toLowerCase()]){for(a=0;a<4;a++)o[a]=s[a];return o}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=t,(V=i.fillStyle)&&"#000000"!==V?X.inputValidators.color(V,e,n,r):(o[0]=o[1]=o[2]=o[3]=0,o)}if(q(t)){if((o=t).length<3)return o[0]=o[1]=o[2]=o[3]=0,o;for(a=0;a<3;a++)if(isNaN(o[a]))return o[0]=o[1]=o[2]=o[3]=0,o;return o.length<4&&o.push(1),o}if("number"==typeof t)return o[0]=o[1]=o[2]=t,o[3]=1,o;if("object"==typeof t){for(a=0;a<4;a++)null===t[V=T[a]]||isNaN(t[V])?o[a]=3===a?1:0:o[a]=t[V];return o}return o[0]=o[1]=o[2]=o[3]=0,o},number:function(t,e,n){return t=parseFloat(t),isNaN(t)?n||0:(e.mod&&(t-=e.mod*Math.floor(t/e.mod)),t<e.min?e.min:t>e.max?e.max:e.step?Math.round(t/e.step)*e.step:t)},enum:function(t,e,n){var r=e.options||[];return"string"==typeof t?t=t.toLowerCase():"number"==typeof t?t=t.toString():t||(t=""),r.hasOwnProperty(t)?t:n||""},vector:function(t,e,n,r){var i,V,o,s=e.dimensions||4;if(i=r||[],q(t)){for(V=0;V<s;V++)i[V]=t[V]||0;return i}if("object"==typeof t){for(V=0;V<s;V++)void 0===t[o=x[V]]&&(o=T[V]),i[V]=t[o]||0;return i}for(t=parseFloat(t)||0,V=0;V<s;V++)i[V]=t;return i},boolean:function(t){return!!t&&(!t||!t.toLowerCase||"false"!==t.toLowerCase())},string:function(t){return"string"==typeof t?t:0===t||t?t.toString?t.toString():String(t):""}},X.prototype.effects=X.effects=function(){var t,e,n,r,i,V={};for(t in u)if(u.hasOwnProperty(t)){for(i in n={title:(e=u[t]).title||t,description:e.description||"",inputs:{}},e.inputs)e.inputs.hasOwnProperty(i)&&(r=e.inputs[i],n.inputs[i]={type:r.type,defaultValue:r.defaultValue,step:r.step,min:r.min,max:r.max,mod:r.mod,minCount:r.minCount,maxCount:r.maxCount,dimensions:r.dimensions,title:r.title||i,description:r.description||"",options:r.options||[]});V[t]=n}return V},window.Float32Array&&(o=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),window.Seriously&&"object"==typeof window.Seriously&&function(){var t;for(t in window.Seriously)window.Seriously.hasOwnProperty(t)&&"plugin"!==t&&"object"==typeof window.Seriously[t]&&X.plugin(t,window.Seriously[t])}(),X.logger={log:U("log"),info:U("info"),warn:U("warn"),error:U("error")},X.util={mat4:M,checkSource:function(t){var e,n,r,i;if(!(e=j(t,["img","canvas","video"])))return!1;if(!(n=document.createElement("canvas")))return X.logger.warn("Browser does not support canvas or Seriously.js"),!1;if(0===e.naturalWidth&&"IMG"===e.tagName)return X.logger.warn("Image not loaded"),!1;if(0===e.readyState&&0===e.videoWidth&&"VIDEO"===e.tagName)return X.logger.warn("Video not loaded"),!1;if(r=G()){(i=r.createTexture())||X.logger.error("Test WebGL context has been lost"),r.bindTexture(r.TEXTURE_2D,i);try{r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)}catch(t){return t.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+t.message),r.deleteTexture(i),!1}r.deleteTexture(i)}else{r=n.getContext("2d");try{r.drawImage(e,0,0),r.getImageData(0,0,1,1)}catch(t){return t.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+t.message),!1}}return!0},hslToRgb:B,colors:w,setTimeoutZero:z,ShaderProgram:Q,FrameBuffer:$,requestAnimationFrame:O,shader:{makeNoise:"float makeNoise(float u, float v, float timer) {\n\tfloat x = u * v * mod(timer * 1000.0, 100.0);\n\tx = mod(x, 13.0) * mod(x, 127.0);\n\tfloat dx = mod(x, 0.01);\n\treturn clamp(0.1 + dx * 100.0, 0.0, 1.0);\n}\n",random:"#ifndef RANDOM\n#define RANDOM\nfloat random(vec2 n) {\n\treturn 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n#endif\n"}},X.source("video",(function(t,e,n){var r,i,V=this,o=!1,a=!1,c=!1,u=0;function h(){t.removeEventListener("loadedmetadata",h,!0),o||(t.videoWidth?(V.width===t.videoWidth&&V.height===t.videoHeight||(V.width=t.videoWidth,V.height=t.videoHeight,V.resize()),a&&V.setReady()):(a=!0,setTimeout(h,50)))}function l(){c=!0}function f(){c=!1,V.setDirty()}if(F(t,"HTMLVideoElement"))return t.readyState?h():(a=!0,t.addEventListener("loadedmetadata",h,!0)),t.addEventListener("seeking",l,!1),t.addEventListener("seeked",f,!1),{deferTexture:a,source:t,render:function e(n){var o;if(u=t.currentTime,!t.videoHeight||!t.videoWidth)return!1;s?(i||(i=document.createElement("canvas").getContext("2d"),(r=i.canvas).width=V.width,r.height=V.height),o=r,i.drawImage(t,0,0,V.width,V.height)):o=t,n.bindTexture(n.TEXTURE_2D,V.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,V.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,o),void 0===s){if(n.getError()===n.INVALID_VALUE)return s=!0,e(n);s=!1}return!0}catch(t){t.code===window.DOMException.SECURITY_ERR?(V.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",t)}return!1},checkDirty:function(){return!c&&t.currentTime!==u},compare:function(t){return V.source===t},destroy:function(){o=!0,t.removeEventListener("seeking",l,!1),t.removeEventListener("seeked",f,!1),t.removeEventListener("loadedmetadata",h,!0)}}}),{title:"Video"}),X.transform("2d",(function(t){var e=this,n=!(t&&t.radians),r=0,i=0,V=1,o=1,s=0,a=0,c=0,u=0,h=0;function l(){var t,l,f,d,p,g,v,m,y,b,_,w=e.matrix;function A(t,e){w[12]=w[0]*t+w[4]*e+w[12],w[13]=w[1]*t+w[5]*e+w[13],w[14]=w[2]*t+w[6]*e+w[14],w[15]=w[3]*t+w[7]*e+w[15]}s||a||c||u||h||1!==V||1!==o?(M.identity(w),A(s+r,a+i),u&&(w[4]=u/e.width),h&&(w[1]=h/e.height),c&&(d=w[0],p=w[1],g=w[2],v=w[3],m=w[4],y=w[5],b=w[6],_=w[7],t=-(n?c*Math.PI/180:c),l=Math.sin(t),f=Math.cos(t),w[0]=d*f+m*l,w[1]=p*f+y*l,w[2]=g*f+b*l,w[3]=v*f+_*l,w[4]=m*f-d*l,w[5]=y*f-p*l,w[6]=b*f-g*l,w[7]=_*f-v*l),1!==V&&(w[0]*=V,w[1]*=V,w[2]*=V,w[3]*=V),1!==o&&(w[4]*=o,w[5]*=o,w[6]*=o,w[7]*=o),A(-r,-i),e.transformed=!0):e.transformed=!1}return{inputs:{reset:{method:function(){return r=0,i=0,V=1,o=1,s=0,a=0,c=0,u=0,h=0,!!e.transformed&&(e.transformed=!1,!0)}},translate:{method:function(t,e){return isNaN(t)&&(t=s),isNaN(e)&&(e=a),(t!==s||e!==a)&&(s=t,a=e,l(),!0)},type:["number","number"]},translateX:{get:function(){return s},set:function(t){return t!==s&&(s=t,l(),!0)},type:"number"},translateY:{get:function(){return a},set:function(t){return t!==a&&(a=t,l(),!0)},type:"number"},rotation:{get:function(){return c},set:function(t){return t!==c&&(c=parseFloat(t),l(),!0)},type:"number"},center:{method:function(t,e){return isNaN(t)&&(t=r),isNaN(e)&&(e=i),(t!==r||e!==i)&&(r=t,i=e,l(),!0)},type:["number","number"]},centerX:{get:function(){return r},set:function(t){return t!==r&&(r=t,l(),!0)},type:"number"},centerY:{get:function(){return i},set:function(t){return t!==i&&(i=t,l(),!0)},type:"number"},skew:{method:function(t,e){return isNaN(t)&&(t=u),isNaN(e)&&(e=h),(t!==u||e!==h)&&(u=t,h=e,l(),!0)},type:["number","number"]},skewX:{get:function(){return u},set:function(t){return t!==u&&(u=t,l(),!0)},type:"number"},skewY:{get:function(){return h},set:function(t){return t!==h&&(h=t,l(),!0)},type:"number"},scale:{method:function(t,e){var n,r;if(n=isNaN(t)?V:t,isNaN(e)){if(isNaN(t))return!1;r=n}else r=e;return(n!==V||r!==o)&&(V=n,o=r,l(),!0)},type:["number","number"]},scaleX:{get:function(){return V},set:function(t){return t!==V&&(V=t,l(),!0)},type:"number"},scaleY:{get:function(){return o},set:function(t){return t!==o&&(o=t,l(),!0)},type:"number"}}}}),{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",(function(){var t=this,e=!0;function n(){var n=t.matrix;e?(n[0]=-1,n[5]=1):(n[0]=1,n[5]=-1)}return M.identity(t.matrix),n(),t.transformDirty=!0,t.transformed=!0,{inputs:{direction:{get:function(){return e?"horizontal":"vertical"},set:function(t){var r;return(r="vertical"!==t)!==e&&(e=r,n(),!0)},type:"string"}}}}),{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",(function(){var t,e,n=this,r="contain";function i(){var i,V,o,s,a=n.matrix,c=t||n.width,u=e||n.height,h=n.source,l=h&&h.width||1,f=h&&h.height||1;"distort"===r||c===l&&u===f?n.transformed=!1:(o=l/f,s=c/u,"none"===r?(i=l/c,V=f/u):"width"===r||"contain"===r&&s<=o?(i=1,V=s/o):"height"===r||"contain"===r&&s>o?(i=o/s,V=1):s>o?(i=1,V=s/o):(i=o/s,V=1),1!==i||1!==V?(M.identity(a),1!==i&&(a[0]*=i,a[1]*=i,a[2]*=i,a[3]*=i),1!==V&&(a[4]*=V,a[5]*=V,a[6]*=V,a[7]*=V),n.transformed=!0):n.transformed=!1)}function V(){return t||n.source&&n.source.width||1}function o(){return e||n.source&&n.source.height||1}return this.resize=function(){var t,e=V(),n=o();if(this.width!==e||this.height!==n)for(this.width=e,this.height=n,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=n),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,n),t=0;t<this.targets.length;t++)this.targets[t].resize();this.setTransformDirty(),i()},{inputs:{width:{get:V,set:function(e){return(e=Math.floor(e))===t||(t=e,this.resize()),!1},type:"number"},height:{get:o,set:function(t){return(t=Math.floor(t))===e||(e=t,this.resize()),!1},type:"number"},mode:{get:function(){return r},set:function(t){return t!==r&&(r=t,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}}),{title:"Reformat",description:"Change output dimensions"}),a=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","void main(void) {","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tgl_Position.w = screenPosition.w;","\tvTexCoord = texCoord;","}\n"].join("\n"),c=["precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","void main(void) {","\t\tgl_FragColor = texture2D(source, vTexCoord);","}"].join("\n"),X.util.shader.noiseHelpers="#ifndef NOISE_HELPERS\n#define NOISE_HELPERS\nvec2 mod289(vec2 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 mod289(vec3 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 permute(vec3 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 permute(vec4 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n",X.util.shader.snoise2d="#ifndef NOISE2D\n#define NOISE2D\nfloat snoise(vec2 v) {\n\tconst vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n\t\t0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n\t\t-0.577350269189626, // -1.0 + 2.0 * C.x\n\t\t0.024390243902439); // 1.0 / 41.0\n\tvec2 i = floor(v + dot(v, C.yy));\n\tvec2 x0 = v - i + dot(i, C.xx);\n\tvec2 i1;\n\t//i1.x = step(x0.y, x0.x); // x0.x > x0.y ? 1.0 : 0.0\n\t//i1.y = 1.0 - i1.x;\n\ti1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n\t// x0 = x0 - 0.0 + 0.0 * C.xx ;\n\t// x1 = x0 - i1 + 1.0 * C.xx ;\n\t// x2 = x0 - 1.0 + 2.0 * C.xx ;\n\tvec4 x12 = x0.xyxy + C.xxzz;\n\tx12.xy -= i1;\n\ti = mod289(i); // Avoid truncation effects in permutation\n\tvec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));\n\tvec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);\n\tm = m*m ;\n\tm = m*m ;\n\tvec3 x = 2.0 * fract(p * C.www) - 1.0;\n\tvec3 h = abs(x) - 0.5;\n\tvec3 ox = floor(x + 0.5);\n\tvec3 a0 = x - ox;\n\tm *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\tvec3 g;\n\tg.x = a0.x * x0.x + h.x * x0.y;\n\tg.yz = a0.yz * x12.xz + h.yz * x12.yw;\n\treturn 130.0 * dot(m, g);\n}\n#endif\n",X.util.shader.snoise3d="#ifndef NOISE3D\n#define NOISE3D\nfloat snoise(vec3 v) {\n\tconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n\tconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\tvec3 i = floor(v + dot(v, C.yyy));\n\tvec3 x0 = v - i + dot(i, C.xxx) ;\n\tvec3 g = step(x0.yzx, x0.xyz);\n\tvec3 l = 1.0 - g;\n\tvec3 i1 = min(g.xyz, l.zxy);\n\tvec3 i2 = max(g.xyz, l.zxy);\n\t// x0 = x0 - 0.0 + 0.0 * C.xxx;\n\t// x1 = x0 - i1 + 1.0 * C.xxx;\n\t// x2 = x0 - i2 + 2.0 * C.xxx;\n\t// x3 = x0 - 1.0 + 3.0 * C.xxx;\n\tvec3 x1 = x0 - i1 + C.xxx;\n\tvec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n\tvec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\ti = mod289(i);\n\tvec4 p = permute(permute(permute(\n\t\t\t\t\t\ti.z + vec4(0.0, i1.z, i2.z, 1.0))\n\t\t\t\t\t\t+ i.y + vec4(0.0, i1.y, i2.y, 1.0))\n\t\t\t\t\t\t+ i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\tfloat n_ = 0.142857142857; // 1.0/7.0\n\tvec3 ns = n_ * D.wyz - D.xzx;\n\tvec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p, 7 * 7)\n\tvec4 x_ = floor(j * ns.z);\n\tvec4 y_ = floor(j - 7.0 * x_); // mod(j, N)\n\tvec4 x = x_ * ns.x + ns.yyyy;\n\tvec4 y = y_ * ns.x + ns.yyyy;\n\tvec4 h = 1.0 - abs(x) - abs(y);\n\tvec4 b0 = vec4(x.xy, y.xy);\n\tvec4 b1 = vec4(x.zw, y.zw);\n\t//vec4 s0 = vec4(lessThan(b0, 0.0)) * 2.0 - 1.0;\n\t//vec4 s1 = vec4(lessThan(b1, 0.0)) * 2.0 - 1.0;\n\tvec4 s0 = floor(b0) * 2.0 + 1.0;\n\tvec4 s1 = floor(b1) * 2.0 + 1.0;\n\tvec4 sh = -step(h, vec4(0.0));\n\tvec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy ;\n\tvec4 a1 = b1.xzyw + s1.xzyw * sh.zzww ;\n\tvec3 p0 = vec3(a0.xy, h.x);\n\tvec3 p1 = vec3(a0.zw, h.y);\n\tvec3 p2 = vec3(a1.xy, h.z);\n\tvec3 p3 = vec3(a1.zw, h.w);\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tvec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n\tm = m * m;\n\treturn 42.0 * dot(m*m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n#endif\n",X.util.shader.snoise4d="#ifndef NOISE4D\n#define NOISE4D\nvec4 grad4(float j, vec4 ip)\n\t{\n\tconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n\tvec4 p, s;\n\n\tp.xyz = floor(fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n\tp.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n\ts = vec4(lessThan(p, vec4(0.0)));\n\tp.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n\treturn p;\n\t}\n\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n\t{\n\tconst vec4 C = vec4(0.138196601125011, // (5 - sqrt(5))/20 G4\n\t\t\t\t\t\t0.276393202250021, // 2 * G4\n\t\t\t\t\t\t0.414589803375032, // 3 * G4\n\t\t\t\t\t\t-0.447213595499958); // -1 + 4 * G4\n\n\tvec4 i = floor(v + dot(v, vec4(F4)));\n\tvec4 x0 = v - i + dot(i, C.xxxx);\n\n\n\tvec4 i0;\n\tvec3 isX = step(x0.yzw, x0.xxx);\n\tvec3 isYZ = step(x0.zww, x0.yyz);\n\ti0.x = isX.x + isX.y + isX.z;\n\ti0.yzw = 1.0 - isX;\n\ti0.y += isYZ.x + isYZ.y;\n\ti0.zw += 1.0 - isYZ.xy;\n\ti0.z += isYZ.z;\n\ti0.w += 1.0 - isYZ.z;\n\n\tvec4 i3 = clamp(i0, 0.0, 1.0);\n\tvec4 i2 = clamp(i0 - 1.0, 0.0, 1.0);\n\tvec4 i1 = clamp(i0 - 2.0, 0.0, 1.0);\n\n\tvec4 x1 = x0 - i1 + C.xxxx;\n\tvec4 x2 = x0 - i2 + C.yyyy;\n\tvec4 x3 = x0 - i3 + C.zzzz;\n\tvec4 x4 = x0 + C.wwww;\n\n\ti = mod289(i);\n\tfloat j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);\n\tvec4 j1 = permute(permute(permute(permute (\n\t\t\t\t\ti.w + vec4(i1.w, i2.w, i3.w, 1.0))\n\t\t\t\t\t+ i.z + vec4(i1.z, i2.z, i3.z, 1.0))\n\t\t\t\t\t+ i.y + vec4(i1.y, i2.y, i3.y, 1.0))\n\t\t\t\t\t+ i.x + vec4(i1.x, i2.x, i3.x, 1.0));\n\n\tvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n\tvec4 p0 = grad4(j0, ip);\n\tvec4 p1 = grad4(j1.x, ip);\n\tvec4 p2 = grad4(j1.y, ip);\n\tvec4 p3 = grad4(j1.z, ip);\n\tvec4 p4 = grad4(j1.w, ip);\n\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tp4 *= taylorInvSqrt(dot(p4, p4));\n\n\tvec3 m0 = max(0.6 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), 0.0);\n\tvec2 m1 = max(0.6 - vec2(dot(x3, x3), dot(x4, x4)), 0.0);\n\tm0 = m0 * m0;\n\tm1 = m1 * m1;\n\treturn 49.0 * (dot(m0*m0, vec3(dot(p0, x0), dot(p1, x1), dot(p2, x2)))\n\t\t\t\t\t\t\t+ dot(m1*m1, vec2(dot(p3, x3), dot(p4, x4)))) ;\n}\n#endif\n",e.default=X},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}a((r=r.apply(t,e||[])).next())}))},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Uneeq=void 0;const V=n(47);n(104);const o=n(81),s=i(n(107)),a=n(108),c=n(109),u=n(132),h=n(35),l=n(133),f=n(140),d=n(146),p=n(148),g=n(80),v=n(149),m=n(150),y=n(151),b=n(63),_=n(153),w=n(85),A=n(154),S=n(99);e.Uneeq=class{constructor(t){this.ready=new V.BehaviorSubject(!1),this.version=s.default.version,this.messages=new V.Subject,this.internalMessages$=new V.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,this.sessionWasResumed=!1,h.logger.enabled=t.logging||!1,this.options=t,this.options.diagnostics=t.diagnostics||!1,this.options.micActivityMessages=t.micActivityMessages||!1,this.options.sendLocalVideo=void 0===t.sendLocalVideo||t.sendLocalVideo,this.options.sendLocalAudio=void 0===t.sendLocalAudio||t.sendLocalAudio,this.options.enableClientPerformanceMessage=t.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=t.enableTransparentBackground||!1,this.options.backgroundImageUrl=t.backgroundImageUrl||"",this.options.nameTagImageUrl=t.nameTagImageUrl||"",this.options.voiceInputMode=t.voiceInputMode||S.VoiceInputMode.PUSH_TO_TALK,this.api=new a.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:_.SessionType.WEB,sdkVersion:this.version,clientWidth:window.screen.availWidth,clientHeight:window.screen.availHeight},this.options.customData&&(this.startSessionData.customData=this.options.customData),h.logger.log(`Uneeq Created (version ${this.version})`),this.streamManager=new m.StreamManager,this.metricsService=new d.MetricsService(this.options,this.internalMessages$,this.messages),this.dhVideoPlayManager=new u.DigitalHumanVideoPlayManager(this.messages,()=>{this.unmuteDigitalHuman()})}setLoggerEnabled(t){h.logger.enabled=t}init(){this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then(t=>{this.session=t,this.initialize()}).catch(t=>{this.sendServiceUnavailableMessage(t)})}initWithToken(t){return r(this,void 0,void 0,(function*(){this.startSessionTime=Date.now();try{const e=v.ResumeSessionCheck.validate(this.options);!0===e.resumeSession&&(this.startSessionData.resumeSessionId=e.resumeSessionId),this.startSessionData.tokenId=t,this.session=yield this.api.startSessionWithToken(this.startSessionData),console.log("UneeQ Session ID: "+this.session.id),this.session.id===this.startSessionData.resumeSessionId?(h.logger.log("UneeQ: Session was resumed."),this.sessionWasResumed=!0):h.logger.log("UneeQ: Session was not resumed."),localStorage.setItem("uneeqResumeSessionId",this.session.id),localStorage.setItem("uneeqResumeSessionPersonaId",this.options.conversationId),this.session.sourceApp=A.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:A.SourceApp.UNKNOWN,this.initialize()}catch(t){this.sendServiceUnavailableMessage(t)}}))}get sessionId(){return this.session?this.session.id:null}setCamera(t){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(t)}setMic(t){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(t)}setSpeaker(t){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(t)}setVoiceInputMode(t){this.serviceReadyCheck("setVoiceInputMode")&&this.voiceInputManager.setVoiceInputMode(t)}enableMicrophone(t=!0){this.deviceManager&&this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,t)}enableCamera(t=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(t,this.options.sendLocalAudio)}enableMicrophoneAndCamera(t=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(t,t)}sendTranscript(t){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new b.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(t))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new b.WarningMessage("Call to startRecording() will be ignored. Session is paused.")):this.voiceInputManager.startRecording())}stopSpeaking(){return this.api.avatarStopSpeaking()}stopRecording(){this.serviceReadyCheck("stopRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new b.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.voiceInputManager.stopRecording())}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new b.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new b.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new b.SessionResumedMessage),!0):(this.messages.next(new b.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(t){return this.api.setAvatarDebug(t)}playWelcomeMessage(){return this.api.avatarWelcome()}unmuteDigitalHuman(){this.voiceInputManager.resumeAudioContext(),this.dhVideoPlayManager.unmuteVideo()}gatherWebRtcMetrics(){var t;null===(t=this.deviceManager)||void 0===t||t.mediaHandler.gatherWebRTCStats((t,e)=>{this.metricsService.parseAndLogWebRtcStats(e)}),setTimeout(()=>{this.gatherWebRtcMetrics()},5e3)}initMessaging(){this.messages.subscribe(t=>this.messageCallback(t)),this.messaging.state$.filter(t=>t===f.MessagingState.CONNECTED).subscribe(()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new b.ReadyMessage),this.gatherWebRtcMetrics()}),this.messaging.messages$.subscribe(t=>this.internalMessages$.next(JSON.parse(t.body))),this.messageHandler=new l.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe(t=>{h.logger.log("-- Msg -- ",t)})}initDeviceManager(){this.voiceInputManager=new y.VoiceInputManager(this.options,this.api,this.messages,t=>{this.enableMicrophone(t)}),this.deviceManager=new c.DeviceManager({userMessages:this.messages,session:this.session,messages:this.messages,internalMessages$:this.internalMessages$,messaging:this.messaging,uneeqOptions:this.options,streamManager:this.streamManager,voiceInputManager:this.voiceInputManager},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new b.SessionLiveMessage(this.session.showUneeqLogo||!1,this.sessionWasResumed)),this.options.playWelcome&&this.api.avatarWelcome();const t={type:g.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.sessionStarted=!0}}initAvatar(){this.ready.filter(Boolean).pipe(o.take(1)).subscribe(()=>{this.internalMessages$.filter(t=>"DevicePermissionAllowedInternal"===t.faceMeMessageType).pipe(o.take(1)).subscribe(t=>{this.messages.next(new b.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()}),this.initDeviceManager()}),this.internalMessages$.filter(t=>"sessionLive"===t.faceMeMessageType).pipe(o.take(1)).subscribe(t=>this.sessionLiveHandler()),this.internalMessages$.filter(t=>"sessionEnd"===t.faceMeMessageType).subscribe(()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new b.SessionEndedMessage),this.messaging.disconnect()}),this.internalMessages$.filter(t=>"remoteVideoReadyToPlay"===t.faceMeMessageType).subscribe(t=>{this.dhVideoPlayManager.play(this.deviceManager.mediaHandler.avatarVideoElement),this.streamManager.remoteVideoReadyToPlay()})}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then(t=>{if(t.available>0){const t={type:g.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new b.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground,resumeSession:this.sessionWasResumed,backgroundImageUrl:this.options.backgroundImageUrl,nameTagImageUrl:this.options.nameTagImageUrl}).catch(t=>{console.error("UneeQ: Digital human could not be started. Clearing resumeSession token and ending process.",t),localStorage.removeItem("uneeqResumeSessionId")})}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new b.AvatarUnavailableMessage)),setTimeout(()=>{this.startAvatarWhenAvailable()},1e3)})}initialize(){if(this.session){this.initPromMetricsListener(),this.api.callId=this.session.id,this.initAvatar();const t={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new b.ConnectionLostMessage(w.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new f.MessagingService(this.options.url+"/api/messaging",t),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(t){const e=new b.ServiceUnavailableMessage(t);this.messages.next(e),this.messageCallback(e)}serviceReadyCheck(t){return!!this.ready.value||(this.messages.next(new b.WarningMessage("Call to "+t+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new p.OnlineStatusService(this.messages,()=>{this.messages.next(new b.ConnectionLostMessage(w.PublishSubscribeState.DISCONNECTED)),this.endSession()})}initPromMetricsListener(){const t=new g.Prom(this.options.url);this.internalMessages$.filter(t=>"prom"===t.faceMeMessageType).subscribe(e=>{t.handleMessage(e.promMsg)})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PublishSubscribeState=void 0,function(t){t.DISCONNECTED="DISCONNECTED",t.CONNECTING="CONNECTING",t.CONNECTED="CONNECTED",t.FAILED="FAILED"}(e.PublishSubscribeState||(e.PublishSubscribeState={}))},function(t,e,n){
32
32
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
33
- var r=n(44),i=r.Buffer;function V(t,e){for(var n in t)e[n]=t[n]}function o(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(V(r,e),e.Buffer=o),o.prototype=Object.create(i.prototype),V(i,o),o.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},o.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){"use strict";(function(e,r){var i;t.exports=x,x.ReadableState=S;n(88).EventEmitter;var V=function(t,e){return t.listeners(e).length},o=n(89),s=n(44).Buffer,a=e.Uint8Array||function(){};var c,u=n(122);c=u&&u.debuglog?u.debuglog("stream"):function(){};var h,l,f,d=n(123),p=n(90),g=n(91).getHighWaterMark,v=n(45).codes,y=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,b=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(59)(x,o);var w=p.errorOrDestroy,A=["error","close","destroy","pause","resume"];function S(t,e,r){i=i||n(46),t=t||{},"boolean"!=typeof r&&(r=e instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",r),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=n(93).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function x(t){if(i=i||n(46),!(this instanceof x))return new x(t);var e=this instanceof i;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function T(t,e,n,r,i){c("readableAddChunk",e);var V,o=t._readableState;if(null===e)o.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,M(t)))}(t,o);else if(i||(V=function(t,e){var n;r=e,s.isBuffer(r)||r instanceof a||"string"==typeof e||void 0===e||t.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],e));var r;return n}(o,e)),V)w(t,V);else if(o.objectMode||e&&e.length>0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),r)o.endEmitted?w(t,new _):C(t,o,e,!0);else if(o.ended)w(t,new m);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(e=o.decoder.write(e),o.objectMode||0!==e.length?C(t,o,e,!1):O(t,o)):C(t,o,e,!1)}else r||(o.reading=!1,O(t,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function C(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&R(t)),O(t,e)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),x.prototype.destroy=p.destroy,x.prototype._undestroy=p.undestroy,x.prototype._destroy=function(t,e){e(t)},x.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=s.from(t,e),e=""),n=!0),T(this,t,e,!1,n)},x.prototype.unshift=function(t){return T(this,t,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(t){h||(h=n(93).StringDecoder);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function E(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(M,t))}function M(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function O(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var n=e.length;if(c("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function k(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){c("readable nexttick read 0"),t.read(0)}function D(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function L(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(U,e,t))}function U(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function F(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}x.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?L(this):R(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&L(this),null;var r,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",i=!0),e.ended||e.reading?c("reading or ended",i=!1):i&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=E(n,e))),null===(r=t>0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&L(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(t){w(this,new b("_read()"))},x.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?a:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",f),t.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",g),n.removeListener("data",l),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function a(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&V(t,"data")&&(e.flowing=!0,N(t))}}(n);t.on("drain",u);var h=!1;function l(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==F(i.pipes,t))&&!h&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function f(e){c("onerror",e),g(),t.removeListener("error",f),0===V(t,"error")&&w(t,e)}function d(){t.removeListener("finish",p),g()}function p(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",l),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",f),t.once("close",d),t.once("finish",p),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var V=0;V<i;V++)r[V].emit("unpipe",this,{hasUnpiped:!1});return this}var o=F(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n)),this},x.prototype.on=function(t,e){var n=o.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?R(this):i.reading||r.nextTick(I,this))),n},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(k,this),n},x.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(k,this),e},x.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(D,t,e))}(this,t)),t.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var V=0;V<A.length;V++)t.on(A[V],this.emit.bind(this,A[V]));return this._read=function(e){c("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=n(126)),l(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),x._fromList=j,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(t,e){return void 0===f&&(f=n(127)),f(x,t,e)})}).call(this,n(34),n(38))},function(t,e,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,V=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,V),r(n)}function V(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}v(t,e,V,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&v(t,"error",e,n)}(t,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function h(t,e,n,r){var i,V,o,s;if(c(n),void 0===(V=t._events)?(V=t._events=Object.create(null),t._eventsCount=0):(void 0!==V.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),V=t._events),o=V[e]),void 0===o)o=V[e]=n,++t._eventsCount;else if("function"==typeof o?o=V[e]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(t))>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,s=a,console&&console.warn&&console.warn(s)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):g(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function v(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(V){r.once&&t.removeEventListener(e,i),n(V)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)V(a,this,e);else{var c=a.length,u=g(a,c);for(n=0;n<c;++n)V(u[n],this,e)}return!0},s.prototype.addListener=function(t,e){return h(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return h(this,t,e,!0)},s.prototype.once=function(t,e){return c(e),this.on(t,f(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,f(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,r,i,V,o;if(c(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,V=n.length-1;V>=0;V--)if(n[V]===e||n[V].listener===e){o=n[V].listener,i=V;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,V=Object.keys(n);for(r=0;r<V.length;++r)"removeListener"!==(i=V[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){t.exports=n(88).EventEmitter},function(t,e,n){"use strict";(function(e){function n(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,V){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(V?V(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!V&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(r,o):(o._writableState.errorEmitted=!0,e.nextTick(n,o,t)):e.nextTick(n,o,t):V?(e.nextTick(r,o),V(t)):e.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this,n(38))},function(t,e,n){"use strict";var r=n(45).codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,n,i){var V=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,i,n);if(null!=V){if(!isFinite(V)||Math.floor(V)!==V||V<0)throw new r(i?n:"highWaterMark",V);return Math.floor(V)}return t.objectMode?16:16384}}},function(t,e,n){"use strict";(function(e,r){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var V;t.exports=x,x.WritableState=S;var o={deprecate:n(125)},s=n(89),a=n(44).Buffer,c=e.Uint8Array||function(){};var u,h=n(90),l=n(91).getHighWaterMark,f=n(45).codes,d=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,v=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,m=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,w=h.errorOrDestroy;function A(){}function S(t,e,o){V=V||n(46),t=t||{},"boolean"!=typeof o&&(o=e instanceof V),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,V=n.writecb;if("function"!=typeof V)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,V){--e.pendingcb,n?(r.nextTick(V,i),r.nextTick(O,t,e),t._writableState.errorEmitted=!0,w(t,i)):(V(i),t._writableState.errorEmitted=!0,w(t,i),O(t,e))}(t,n,i,e,V);else{var o=R(n)||t.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||E(t,n),i?r.nextTick(C,t,n,o,V):C(t,n,o,V)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function x(t){var e=this instanceof(V=V||n(46));if(!e&&!u.call(x,this))return new x(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function T(t,e,n,r,i,V,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new y("write")):n?t._writev(i,e.onwrite):t._write(i,V,e.onwrite),e.sync=!1}function C(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),O(t,e)}function E(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,V=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var s=0,a=!0;n;)V[s]=n,n.isBuf||(a=!1),n=n.next,s+=1;V.allBuffers=a,T(t,e,!0,e.length,V,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(T(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final((function(n){e.pendingcb--,n&&w(t,n),e.prefinished=!0,t.emit("prefinish"),O(t,e)}))}function O(t,e){var n=R(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,r.nextTick(M,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}n(59)(x,s),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(t){return!!u.call(this,t)||this===x&&(t&&t._writableState instanceof S)}})):u=function(t){return t instanceof this},x.prototype.pipe=function(){w(this,new v)},x.prototype.write=function(t,e,n){var i,V=this._writableState,o=!1,s=!V.objectMode&&(i=t,a.isBuffer(i)||i instanceof c);return s&&!a.isBuffer(t)&&(t=function(t){return a.from(t)}(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=V.defaultEncoding),"function"!=typeof n&&(n=A),V.ending?function(t,e){var n=new b;w(t,n),r.nextTick(e,n)}(this,n):(s||function(t,e,n,i){var V;return null===n?V=new m:"string"==typeof n||e.objectMode||(V=new d("chunk",["string","Buffer"],n)),!V||(w(t,V),r.nextTick(i,V),!1)}(this,V,t,n))&&(V.pendingcb++,o=function(t,e,n,r,i,V){if(!n){var o=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,n));return e}(e,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=e.objectMode?1:r.length;e.length+=s;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:V,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else T(t,e,!1,s,r,i,V);return c}(this,V,s,t,e,n)),o},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||E(this,t))},x.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(t,e,n){n(new p("_write()"))},x.prototype._writev=null,x.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,O(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),x.prototype.destroy=h.destroy,x.prototype._undestroy=h.undestroy,x.prototype._destroy=function(t,e){e(t)}}).call(this,n(34),n(38))},function(t,e,n){"use strict";var r=n(86).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function V(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=h,e=3;break;default:return this.write=l,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=V,V.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},V.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},V.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=o(e[r]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=o(e[r]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=o(e[r]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},V.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";t.exports=u;var r=n(45).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,V=r.ERR_MULTIPLE_CALLBACK,o=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,a=n(46);function c(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new V);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);a.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,n){l(t,e,n)}))}function l(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new s;if(t._transformState.transforming)throw new o;return t.push(null)}n(59)(u,a),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,n){n(new i("_transform()"))},u.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){a.prototype._destroy.call(this,t,(function(t){e(t)}))}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Counter=void 0;var c=function(t){function e(){return i(this,e),o(this,s(e).apply(this,arguments))}var n,r,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,t),n=e,(r=[{key:"inc",value:function(t){return this.add(1,t),this}},{key:"add",value:function(t,e){if(t<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(t));var n=this.get(e);return this.set(n?n.value+t:t,e),this}},{key:"reset",value:function(t){this.set(0,t)}}])&&V(n.prototype,r),c&&V(n,c),e}(n(96).Collector);e.Counter=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Collector=void 0;var r=n(64),i=n(97);function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=void 0,(n="data")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.data=[]}var e,n,o;return e=t,(n=[{key:"get",value:function(t){return(0,i.findExistingMetric)(t,this.data)}},{key:"set",value:function(t,e){var n=(0,i.findExistingMetric)(e,this.data);return n?n.value=t:this.data.push({labels:e,value:t}),this}},{key:"collect",value:function(t){return(0,r.filter)(this.data,(function(e){return(0,r.matches)(t)(e.labels)}))}},{key:"resetAll",value:function(){var t=this;return(0,r.each)(this.data,(function(e){t.reset(e.labels)})),this}}])&&V(e.prototype,n),o&&V(e,o),t}();e.Collector=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatHistogramOrSummary=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",V="",o=i(e);o.length>0?(V+="".concat(t,"_count{").concat(o,"} ").concat(e.value.count,"\n"),V+="".concat(t,"_sum{").concat(o,"} ").concat(e.value.sum,"\n")):(V+="".concat(t,"_count ").concat(e.value.count,"\n"),V+="".concat(t,"_sum ").concat(e.value.sum,"\n"));return(0,r.reduce)(e.value.entries,(function(e,r,i){return o.length>0?V+="".concat(t,"_bucket{").concat(n,'="').concat(i,'",').concat(o,"} ").concat(r,"\n"):V+="".concat(t,"_bucket{").concat(n,'="').concat(i,'"} ').concat(r,"\n"),V}),V)},e.findExistingMetric=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t)return e[0];return(0,r.find)(e,(function(e){return(0,r.isEqual)(e.labels,t)}))},e.formatCounterOrGauge=function(t,e){var n=" ".concat(e.value.toString());if(null==e.labels||0===Object.keys(e.labels).length)return"".concat(t).concat(n,"\n");var i=(0,r.map)(e.labels,(function(t,e){return"".concat(e,'="').concat(t,'"')}));return"".concat(t,"{").concat(i.join(","),"}").concat(n,"\n")};var r=n(64);function i(t){var e=(0,r.map)(t.labels,(function(t,e){return"".concat(e,'="').concat(t,'"')}));return 0===e.length?"":"".concat(e.join(","))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingState=void 0,function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(e.MessagingState||(e.MessagingState={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceInputMode=void 0,function(t){t.PUSH_TO_TALK="PUSH_TO_TALK",t.VOICE_ACTIVITY="VOICE_ACTIVITY"}(e.VoiceInputMode||(e.VoiceInputMode={}))},function(t,e,n){(function(t,e){!function(t){function n(){}function r(t,e){if(t=void 0===t?"utf-8":t,e=void 0===e?{fatal:!1}:e,-1===V.indexOf(t.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+t+"') is invalid.");if(e.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}function i(t){for(var e=0,n=Math.min(65536,t.length+1),r=new Uint16Array(n),i=[],V=0;;){var o=e<t.length;if(!o||V>=n-1){if(i.push(String.fromCharCode.apply(null,r.subarray(0,V))),!o)return i.join("");t=t.subarray(e),V=e=0}if(0==(128&(o=t[e++])))r[V++]=o;else if(192==(224&o)){var s=63&t[e++];r[V++]=(31&o)<<6|s}else if(224==(240&o)){s=63&t[e++];var a=63&t[e++];r[V++]=(31&o)<<12|s<<6|a}else if(240==(248&o)){65535<(o=(7&o)<<18|(s=63&t[e++])<<12|(a=63&t[e++])<<6|63&t[e++])&&(o-=65536,r[V++]=o>>>10&1023|55296,o=56320|1023&o),r[V++]=o}}}if(t.TextEncoder&&t.TextDecoder)return!1;var V=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),n.prototype.encode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");e=0;for(var n=t.length,r=0,i=Math.max(32,n+(n>>>1)+7),V=new Uint8Array(i>>>3<<3);e<n;){var o=t.charCodeAt(e++);if(55296<=o&&56319>=o){if(e<n){var s=t.charCodeAt(e);56320==(64512&s)&&(++e,o=((1023&o)<<10)+(1023&s)+65536)}if(55296<=o&&56319>=o)continue}if(r+4>V.length&&(i+=8,i=(i*=1+e/t.length*2)>>>3<<3,(s=new Uint8Array(i)).set(V),V=s),0==(4294967168&o))V[r++]=o;else{if(0==(4294965248&o))V[r++]=o>>>6&31|192;else if(0==(4294901760&o))V[r++]=o>>>12&15|224,V[r++]=o>>>6&63|128;else{if(0!=(4292870144&o))continue;V[r++]=o>>>18&7|240,V[r++]=o>>>12&63|128,V[r++]=o>>>6&63|128}V[r++]=63&o|128}}return V.slice?V.slice(0,r):V.subarray(0,r)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1});var o=i;"function"==typeof e&&e.from?o=function(t){return e.from(t.buffer,t.byteOffset,t.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(o=function(t){try{var e=URL.createObjectURL(new Blob([t],{type:"text/plain;charset=UTF-8"})),n=new XMLHttpRequest;return n.open("GET",e,!1),n.send(),n.responseText}catch(e){return i(t)}finally{e&&URL.revokeObjectURL(e)}}),r.prototype.decode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");return t=t instanceof Uint8Array?t:t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer):new Uint8Array(t),o(t)},t.TextEncoder=n,t.TextDecoder=r}("undefined"!=typeof window?window:void 0!==t?t:this)}).call(this,n(34),n(44).Buffer)},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),o=r[0],s=r[1],a=new V(function(t,e,n){return 3*(e+n)/4-n}(0,o,s)),u=0,h=s>0?o-4:o;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],a[u++]=e>>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,a[u++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,V=[],o=0,s=n-i;o<s;o+=16383)V.push(u(t,o,o+16383>s?s:o+16383));1===i?(e=t[n-1],V.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],V.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return V.join("")};for(var r=[],i=[],V="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,n){for(var i,V,o=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(r[(V=i)>>18&63]+r[V>>12&63]+r[V>>6&63]+r[63&V]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
33
+ var r=n(44),i=r.Buffer;function V(t,e){for(var n in t)e[n]=t[n]}function o(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(V(r,e),e.Buffer=o),o.prototype=Object.create(i.prototype),V(i,o),o.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},o.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){"use strict";(function(e,r){var i;t.exports=x,x.ReadableState=S;n(88).EventEmitter;var V=function(t,e){return t.listeners(e).length},o=n(89),s=n(44).Buffer,a=e.Uint8Array||function(){};var c,u=n(122);c=u&&u.debuglog?u.debuglog("stream"):function(){};var h,l,f,d=n(123),p=n(90),g=n(91).getHighWaterMark,v=n(45).codes,m=v.ERR_INVALID_ARG_TYPE,y=v.ERR_STREAM_PUSH_AFTER_EOF,b=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(59)(x,o);var w=p.errorOrDestroy,A=["error","close","destroy","pause","resume"];function S(t,e,r){i=i||n(46),t=t||{},"boolean"!=typeof r&&(r=e instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",r),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=n(93).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function x(t){if(i=i||n(46),!(this instanceof x))return new x(t);var e=this instanceof i;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function T(t,e,n,r,i){c("readableAddChunk",e);var V,o=t._readableState;if(null===e)o.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,M(t)))}(t,o);else if(i||(V=function(t,e){var n;r=e,s.isBuffer(r)||r instanceof a||"string"==typeof e||void 0===e||t.objectMode||(n=new m("chunk",["string","Buffer","Uint8Array"],e));var r;return n}(o,e)),V)w(t,V);else if(o.objectMode||e&&e.length>0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),r)o.endEmitted?w(t,new _):C(t,o,e,!0);else if(o.ended)w(t,new y);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(e=o.decoder.write(e),o.objectMode||0!==e.length?C(t,o,e,!1):O(t,o)):C(t,o,e,!1)}else r||(o.reading=!1,O(t,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function C(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&R(t)),O(t,e)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),x.prototype.destroy=p.destroy,x.prototype._undestroy=p.undestroy,x.prototype._destroy=function(t,e){e(t)},x.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=s.from(t,e),e=""),n=!0),T(this,t,e,!1,n)},x.prototype.unshift=function(t){return T(this,t,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(t){h||(h=n(93).StringDecoder);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function E(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(M,t))}function M(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function O(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var n=e.length;if(c("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function k(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){c("readable nexttick read 0"),t.read(0)}function D(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function L(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(U,e,t))}function U(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function F(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}x.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?L(this):R(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&L(this),null;var r,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",i=!0),e.ended||e.reading?c("reading or ended",i=!1):i&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=E(n,e))),null===(r=t>0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&L(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(t){w(this,new b("_read()"))},x.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?a:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",f),t.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",g),n.removeListener("data",l),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function a(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&V(t,"data")&&(e.flowing=!0,N(t))}}(n);t.on("drain",u);var h=!1;function l(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==F(i.pipes,t))&&!h&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function f(e){c("onerror",e),g(),t.removeListener("error",f),0===V(t,"error")&&w(t,e)}function d(){t.removeListener("finish",p),g()}function p(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",l),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",f),t.once("close",d),t.once("finish",p),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var V=0;V<i;V++)r[V].emit("unpipe",this,{hasUnpiped:!1});return this}var o=F(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n)),this},x.prototype.on=function(t,e){var n=o.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?R(this):i.reading||r.nextTick(I,this))),n},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(k,this),n},x.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(k,this),e},x.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(D,t,e))}(this,t)),t.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var V=0;V<A.length;V++)t.on(A[V],this.emit.bind(this,A[V]));return this._read=function(e){c("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=n(126)),l(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),x._fromList=j,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(t,e){return void 0===f&&(f=n(127)),f(x,t,e)})}).call(this,n(34),n(38))},function(t,e,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,V=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,V),r(n)}function V(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}v(t,e,V,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&v(t,"error",e,n)}(t,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function h(t,e,n,r){var i,V,o,s;if(c(n),void 0===(V=t._events)?(V=t._events=Object.create(null),t._eventsCount=0):(void 0!==V.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),V=t._events),o=V[e]),void 0===o)o=V[e]=n,++t._eventsCount;else if("function"==typeof o?o=V[e]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(t))>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,s=a,console&&console.warn&&console.warn(s)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):g(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function v(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(V){r.once&&t.removeEventListener(e,i),n(V)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)V(a,this,e);else{var c=a.length,u=g(a,c);for(n=0;n<c;++n)V(u[n],this,e)}return!0},s.prototype.addListener=function(t,e){return h(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return h(this,t,e,!0)},s.prototype.once=function(t,e){return c(e),this.on(t,f(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,f(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,r,i,V,o;if(c(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,V=n.length-1;V>=0;V--)if(n[V]===e||n[V].listener===e){o=n[V].listener,i=V;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,V=Object.keys(n);for(r=0;r<V.length;++r)"removeListener"!==(i=V[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){t.exports=n(88).EventEmitter},function(t,e,n){"use strict";(function(e){function n(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,V){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(V?V(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!V&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(r,o):(o._writableState.errorEmitted=!0,e.nextTick(n,o,t)):e.nextTick(n,o,t):V?(e.nextTick(r,o),V(t)):e.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this,n(38))},function(t,e,n){"use strict";var r=n(45).codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,n,i){var V=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,i,n);if(null!=V){if(!isFinite(V)||Math.floor(V)!==V||V<0)throw new r(i?n:"highWaterMark",V);return Math.floor(V)}return t.objectMode?16:16384}}},function(t,e,n){"use strict";(function(e,r){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var V;t.exports=x,x.WritableState=S;var o={deprecate:n(125)},s=n(89),a=n(44).Buffer,c=e.Uint8Array||function(){};var u,h=n(90),l=n(91).getHighWaterMark,f=n(45).codes,d=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,v=f.ERR_STREAM_CANNOT_PIPE,m=f.ERR_STREAM_DESTROYED,y=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,w=h.errorOrDestroy;function A(){}function S(t,e,o){V=V||n(46),t=t||{},"boolean"!=typeof o&&(o=e instanceof V),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,V=n.writecb;if("function"!=typeof V)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,V){--e.pendingcb,n?(r.nextTick(V,i),r.nextTick(O,t,e),t._writableState.errorEmitted=!0,w(t,i)):(V(i),t._writableState.errorEmitted=!0,w(t,i),O(t,e))}(t,n,i,e,V);else{var o=R(n)||t.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||E(t,n),i?r.nextTick(C,t,n,o,V):C(t,n,o,V)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function x(t){var e=this instanceof(V=V||n(46));if(!e&&!u.call(x,this))return new x(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function T(t,e,n,r,i,V,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):n?t._writev(i,e.onwrite):t._write(i,V,e.onwrite),e.sync=!1}function C(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),O(t,e)}function E(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,V=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var s=0,a=!0;n;)V[s]=n,n.isBuf||(a=!1),n=n.next,s+=1;V.allBuffers=a,T(t,e,!0,e.length,V,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(T(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final((function(n){e.pendingcb--,n&&w(t,n),e.prefinished=!0,t.emit("prefinish"),O(t,e)}))}function O(t,e){var n=R(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,r.nextTick(M,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}n(59)(x,s),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(t){return!!u.call(this,t)||this===x&&(t&&t._writableState instanceof S)}})):u=function(t){return t instanceof this},x.prototype.pipe=function(){w(this,new v)},x.prototype.write=function(t,e,n){var i,V=this._writableState,o=!1,s=!V.objectMode&&(i=t,a.isBuffer(i)||i instanceof c);return s&&!a.isBuffer(t)&&(t=function(t){return a.from(t)}(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=V.defaultEncoding),"function"!=typeof n&&(n=A),V.ending?function(t,e){var n=new b;w(t,n),r.nextTick(e,n)}(this,n):(s||function(t,e,n,i){var V;return null===n?V=new y:"string"==typeof n||e.objectMode||(V=new d("chunk",["string","Buffer"],n)),!V||(w(t,V),r.nextTick(i,V),!1)}(this,V,t,n))&&(V.pendingcb++,o=function(t,e,n,r,i,V){if(!n){var o=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,n));return e}(e,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=e.objectMode?1:r.length;e.length+=s;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:V,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else T(t,e,!1,s,r,i,V);return c}(this,V,s,t,e,n)),o},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||E(this,t))},x.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(t,e,n){n(new p("_write()"))},x.prototype._writev=null,x.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,O(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),x.prototype.destroy=h.destroy,x.prototype._undestroy=h.undestroy,x.prototype._destroy=function(t,e){e(t)}}).call(this,n(34),n(38))},function(t,e,n){"use strict";var r=n(86).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function V(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=h,e=3;break;default:return this.write=l,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=V,V.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},V.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},V.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=o(e[r]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=o(e[r]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=o(e[r]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},V.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";t.exports=u;var r=n(45).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,V=r.ERR_MULTIPLE_CALLBACK,o=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,a=n(46);function c(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new V);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);a.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,n){l(t,e,n)}))}function l(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new s;if(t._transformState.transforming)throw new o;return t.push(null)}n(59)(u,a),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,n){n(new i("_transform()"))},u.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){a.prototype._destroy.call(this,t,(function(t){e(t)}))}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Counter=void 0;var c=function(t){function e(){return i(this,e),o(this,s(e).apply(this,arguments))}var n,r,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,t),n=e,(r=[{key:"inc",value:function(t){return this.add(1,t),this}},{key:"add",value:function(t,e){if(t<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(t));var n=this.get(e);return this.set(n?n.value+t:t,e),this}},{key:"reset",value:function(t){this.set(0,t)}}])&&V(n.prototype,r),c&&V(n,c),e}(n(96).Collector);e.Counter=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Collector=void 0;var r=n(64),i=n(97);function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=void 0,(n="data")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.data=[]}var e,n,o;return e=t,(n=[{key:"get",value:function(t){return(0,i.findExistingMetric)(t,this.data)}},{key:"set",value:function(t,e){var n=(0,i.findExistingMetric)(e,this.data);return n?n.value=t:this.data.push({labels:e,value:t}),this}},{key:"collect",value:function(t){return(0,r.filter)(this.data,(function(e){return(0,r.matches)(t)(e.labels)}))}},{key:"resetAll",value:function(){var t=this;return(0,r.each)(this.data,(function(e){t.reset(e.labels)})),this}}])&&V(e.prototype,n),o&&V(e,o),t}();e.Collector=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatHistogramOrSummary=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",V="",o=i(e);o.length>0?(V+="".concat(t,"_count{").concat(o,"} ").concat(e.value.count,"\n"),V+="".concat(t,"_sum{").concat(o,"} ").concat(e.value.sum,"\n")):(V+="".concat(t,"_count ").concat(e.value.count,"\n"),V+="".concat(t,"_sum ").concat(e.value.sum,"\n"));return(0,r.reduce)(e.value.entries,(function(e,r,i){return o.length>0?V+="".concat(t,"_bucket{").concat(n,'="').concat(i,'",').concat(o,"} ").concat(r,"\n"):V+="".concat(t,"_bucket{").concat(n,'="').concat(i,'"} ').concat(r,"\n"),V}),V)},e.findExistingMetric=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t)return e[0];return(0,r.find)(e,(function(e){return(0,r.isEqual)(e.labels,t)}))},e.formatCounterOrGauge=function(t,e){var n=" ".concat(e.value.toString());if(null==e.labels||0===Object.keys(e.labels).length)return"".concat(t).concat(n,"\n");var i=(0,r.map)(e.labels,(function(t,e){return"".concat(e,'="').concat(t,'"')}));return"".concat(t,"{").concat(i.join(","),"}").concat(n,"\n")};var r=n(64);function i(t){var e=(0,r.map)(t.labels,(function(t,e){return"".concat(e,'="').concat(t,'"')}));return 0===e.length?"":"".concat(e.join(","))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingState=void 0,function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(e.MessagingState||(e.MessagingState={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceInputMode=void 0,function(t){t.PUSH_TO_TALK="PUSH_TO_TALK",t.VOICE_ACTIVITY="VOICE_ACTIVITY"}(e.VoiceInputMode||(e.VoiceInputMode={}))},function(t,e,n){(function(t,e){!function(t){function n(){}function r(t,e){if(t=void 0===t?"utf-8":t,e=void 0===e?{fatal:!1}:e,-1===V.indexOf(t.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+t+"') is invalid.");if(e.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}function i(t){for(var e=0,n=Math.min(65536,t.length+1),r=new Uint16Array(n),i=[],V=0;;){var o=e<t.length;if(!o||V>=n-1){if(i.push(String.fromCharCode.apply(null,r.subarray(0,V))),!o)return i.join("");t=t.subarray(e),V=e=0}if(0==(128&(o=t[e++])))r[V++]=o;else if(192==(224&o)){var s=63&t[e++];r[V++]=(31&o)<<6|s}else if(224==(240&o)){s=63&t[e++];var a=63&t[e++];r[V++]=(31&o)<<12|s<<6|a}else if(240==(248&o)){65535<(o=(7&o)<<18|(s=63&t[e++])<<12|(a=63&t[e++])<<6|63&t[e++])&&(o-=65536,r[V++]=o>>>10&1023|55296,o=56320|1023&o),r[V++]=o}}}if(t.TextEncoder&&t.TextDecoder)return!1;var V=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),n.prototype.encode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");e=0;for(var n=t.length,r=0,i=Math.max(32,n+(n>>>1)+7),V=new Uint8Array(i>>>3<<3);e<n;){var o=t.charCodeAt(e++);if(55296<=o&&56319>=o){if(e<n){var s=t.charCodeAt(e);56320==(64512&s)&&(++e,o=((1023&o)<<10)+(1023&s)+65536)}if(55296<=o&&56319>=o)continue}if(r+4>V.length&&(i+=8,i=(i*=1+e/t.length*2)>>>3<<3,(s=new Uint8Array(i)).set(V),V=s),0==(4294967168&o))V[r++]=o;else{if(0==(4294965248&o))V[r++]=o>>>6&31|192;else if(0==(4294901760&o))V[r++]=o>>>12&15|224,V[r++]=o>>>6&63|128;else{if(0!=(4292870144&o))continue;V[r++]=o>>>18&7|240,V[r++]=o>>>12&63|128,V[r++]=o>>>6&63|128}V[r++]=63&o|128}}return V.slice?V.slice(0,r):V.subarray(0,r)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1});var o=i;"function"==typeof e&&e.from?o=function(t){return e.from(t.buffer,t.byteOffset,t.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(o=function(t){try{var e=URL.createObjectURL(new Blob([t],{type:"text/plain;charset=UTF-8"})),n=new XMLHttpRequest;return n.open("GET",e,!1),n.send(),n.responseText}catch(e){return i(t)}finally{e&&URL.revokeObjectURL(e)}}),r.prototype.decode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");return t=t instanceof Uint8Array?t:t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer):new Uint8Array(t),o(t)},t.TextEncoder=n,t.TextDecoder=r}("undefined"!=typeof window?window:void 0!==t?t:this)}).call(this,n(34),n(44).Buffer)},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),o=r[0],s=r[1],a=new V(function(t,e,n){return 3*(e+n)/4-n}(0,o,s)),u=0,h=s>0?o-4:o;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],a[u++]=e>>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,a[u++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,V=[],o=0,s=n-i;o<s;o+=16383)V.push(u(t,o,o+16383>s?s:o+16383));1===i?(e=t[n-1],V.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],V.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return V.join("")};for(var r=[],i=[],V="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,n){for(var i,V,o=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(r[(V=i)>>18&63]+r[V>>12&63]+r[V>>6&63]+r[63&V]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
34
34
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
35
- e.read=function(t,e,n,r,i){var V,o,s=8*i-r-1,a=(1<<s)-1,c=a>>1,u=-7,h=n?i-1:0,l=n?-1:1,f=t[e+h];for(h+=l,V=f&(1<<-u)-1,f>>=-u,u+=s;u>0;V=256*V+t[e+h],h+=l,u-=8);for(o=V&(1<<-u)-1,V>>=-u,u+=r;u>0;o=256*o+t[e+h],h+=l,u-=8);if(0===V)V=1-c;else{if(V===a)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),V-=c}return(f?-1:1)*o*Math.pow(2,V-r)},e.write=function(t,e,n,r,i,V){var o,s,a,c=8*V-i-1,u=(1<<c)-1,h=u>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:V-1,d=r?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),(e+=o+h>=1?l/a:l*Math.pow(2,1-h))*a>=2&&(o++,a/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*a-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+f]=255&s,f+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[n+f]=255&o,f+=d,o/=256,c-=8);t[n+f-d]|=128*p}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(105)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(47),i=n(106);r.Observable.prototype.filter=i.filter},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(81);e.filter=function(t,e){return r.filter(t,e)(this)}},function(t){t.exports=JSON.parse('{"name":"uneeq-js","version":"2.43.0","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"./node_modules/karma/bin/karma start karma.conf.js -logLevel=DEBUG","test":"./node_modules/karma/bin/karma start --browsers ChromeHeadless --single-run","test:windows":"karma start karma.conf.js","build":"webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js","lint":"./node_modules/tslint/bin/tslint -p tsconfig.json --fix","docs":"./node_modules/typedoc/bin/typedoc --options"},"files":["dist","!dist/test"],"author":"","license":"ISC","dependencies":{"@stomp/stompjs":"^6.0.0","@uehreka/seriously":"^1.0.1","fast-text-encoding":"^1.0.0","intrinsic-scale":"^3.0.4","promjs":"^0.4.1","rxjs":"^6.2.2","rxjs-compat":"^6.3.2","simple-peer":"9.11.0","webrtc-adapter":"8.1.0"},"devDependencies":{"@types/jasmine":"^2.8.8","@types/node":"^10.9.4","fetch-mock":"7.7.3","ignore-styles":"^5.0.1","jasmine":"^3.2.0","jasmine-class-mock":"^1.0.1","jasmine-core":"^3.3.0","karma":"^5.0.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^2.0.1","karma-jasmine-html-reporter":"^1.4.0","karma-requirejs":"^1.1.0","karma-safari-launcher":"^1.0.0","karma-typescript":"^5.0.0","karma-typescript-es6-transform":"^5.0.0","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^5.0.0","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-no-focused-test":"^0.5.0","typedoc":"^0.18.0","typescript":"^3.9.7","webpack":"^4.17.1","webpack-cli":"^3.1.0"}}')},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}a((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.API=void 0;e.API=class{constructor(t,e="",n=(()=>{})){this.xAuthToken="",this.apiUrl=t,this.apiKey=e,this.loggedOutHandler=n}set callId(t){this._callId=t}get authToken(){return this.xAuthToken}startSession(t){return this.postRequest("/api/v1/customers/",t,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",t)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:t})}avatarStartRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/start")}avatarStopRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/stop")}avatarStopSpeaking(){return this.postRequest("/api/v1/avatar/"+this._callId+"/stopSpeaking")}getAvailableAvatarCount(){return this.getRequest("/api/v1/avatar/"+this._callId+"/available")}startSessionWithToken(t){return this.postRequest("/api/v2/clients/start-session",t,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(t){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:t})}sendMediaUnavailable(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",t)}getEdgeNodeId(t){let e=t.replace("turn:","http://");e=e.replace("turns:","https://");const n=new Request(e,{method:"GET"});return this.makeRequest(n)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(t){return r(this,void 0,void 0,(function*(){const e=yield fetch(t);if(!e.ok){401===e.status&&this.loggedOutHandler();const t=yield e.json();throw{status:e.status,body:t}}return 204===e.status?new Promise((t,e)=>{t()}):(this.xAuthToken=e.headers.get("x-auth-token")||this.xAuthToken,yield e.json())}))}getRequest(t){const e=new Request(this.apiUrl+t,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(e)}postRequest(t,e={},n={},r={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},r),body:JSON.stringify(e)},V=new Request(this.apiUrl+t,Object.assign(i,n));return this.makeRequest(V)}putRequest(t,e={},n={}){const r={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(e)},i=new Request(this.apiUrl+t,Object.assign(r,n));return this.makeRequest(i)}}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}a((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.DeviceManager=void 0;const i=n(36),V=n(110);e.DeviceManager=class{constructor(t,e){this.options=t,this.api=e,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new V.MediaHandler(this.options,()=>this.remoteVideoReady()),this.initMediaConstraints(),this.getDevices(!1)}set edgeNodeId(t){this.mediaHandler.setEdgeNodeId(t),this.getDevices(!0)}enableLocalDevices(t,e){const n=this.options.uneeqOptions.sendLocalVideo!==t,r=this.options.uneeqOptions.sendLocalAudio!==e;(n||r)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=t,this.options.uneeqOptions.sendLocalAudio=e,n&&!1===t&&this.publishStream.getVideoTracks().forEach(t=>t.stop()),r&&!1===e&&this.publishStream.getAudioTracks().forEach(t=>t.stop()),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(t=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const e=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then(e=>r(this,void 0,void 0,(function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),t){if(this.options.uneeqOptions.sendLocalVideo){const t=e.getVideoTracks();t.length>0&&(this.publishStream.getVideoTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream.addTrack(t[0]))}if(this.options.uneeqOptions.sendLocalAudio){const t=e.getAudioTracks();t.length>0&&(this.publishStream.getAudioTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream.addTrack(t[0]))}this.mediaHandler.localStream$.next(this.publishStream)}}))).catch(t=>{e.options.userMessages.next(new i.DeviceErrorMessage(t)),console.error("device error: ",t),this.sendMediaUnavailableInfo("NotAllowedError"===t.name),this.revertMediaOptions()})}setMicDevice(t,e=!0){const n=this.devices.audioInput.filter(e=>e.deviceId===t);if(n&&n.length>0)this.options.uneeqOptions.preferredMicrophoneId=t,this.audioConstraints.deviceId=t,e&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(t));else{const e="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}setCamDevice(t,e=!0){const n=this.devices.videoInput.filter(e=>e.deviceId===t);if(n&&n.length>0)this.options.uneeqOptions.preferredCameraId=t,this.videoConstraints.deviceId=t,e&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(t));else{const e="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}setAvatarSpeakerDevice(t){if(this.mediaHandler.avatarVideoElement){const e=this.devices.audioOutput.filter(e=>e.deviceId===t);if(e&&e.length>0)this.options.uneeqOptions.preferredSpeakerId=t,this.mediaHandler.avatarVideoElement.setSinkId(t).then(()=>{this.speakerConstraints.deviceId=t,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(t))}).catch(e=>{const n="Uneeq setSpeaker: Error setting device. "+e.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(n,t))});else{const e="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}}revertMediaOptions(){this.previousMediaOptions&&(this.options.uneeqOptions.sendLocalAudio=this.previousMediaOptions.sendLocalAudio,this.options.uneeqOptions.sendLocalVideo=this.previousMediaOptions.sendLocalVideo)}initMediaConstraints(){this.audioConstraints={},this.videoConstraints={facingMode:"user",width:640,height:480},this.userMediaConstraints={audio:!!this.options.uneeqOptions.sendLocalAudio&&this.audioConstraints,video:!!this.options.uneeqOptions.sendLocalVideo&&this.videoConstraints}}initStreamWithoutDevices(){this.publishStream.getTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream=new MediaStream,this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),this.mediaHandler.localStream$.next(this.publishStream)}remoteVideoReady(){this.options.uneeqOptions.preferredSpeakerId&&this.setAvatarSpeakerDevice(this.options.uneeqOptions.preferredSpeakerId)}sendMediaUnavailableInfo(t){return r(this,void 0,void 0,(function*(){const e=yield this.getMediaDevices(),n={audioInputs:e.audioInput.length,videoInputs:e.videoInput.length,hasUserDeniedPermission:t};return this.api.sendMediaUnavailable(n)}))}getMediaDevices(){return r(this,void 0,void 0,(function*(){const t=yield navigator.mediaDevices.enumerateDevices(),e={audioInput:[],audioOutput:[],videoInput:[]};return e.audioInput=t.filter(t=>"audioinput"===t.kind),e.audioOutput=t.filter(t=>"audiooutput"===t.kind),e.videoInput=t.filter(t=>"videoinput"===t.kind),e}))}initDeviceList(){return r(this,void 0,void 0,(function*(){navigator.mediaDevices.ondevicechange=t=>{this.initDeviceList()};const t=yield this.getMediaDevices();JSON.stringify(t)!==JSON.stringify(this.devices)&&(this.devices=t,this.options.uneeqOptions.preferredCameraId&&this.setCamDevice(this.options.uneeqOptions.preferredCameraId,!1),this.options.uneeqOptions.preferredMicrophoneId&&this.setMicDevice(this.options.uneeqOptions.preferredMicrophoneId,!1),this.options.userMessages.next(new i.DeviceListUpdatedMessage(this.devices)))}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MediaHandler=void 0;const r=n(47),i=n(36),V=n(111),o=n(85),s=n(113),a=n(37),c=n(114);e.MediaHandler=class{constructor(t,e){this.options=t,this.remoteVideoReady=e,this.remoteStream$=new r.BehaviorSubject(null),this.localStream$=new r.BehaviorSubject(null),this.publishState$=new r.BehaviorSubject(o.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.remoteStream$.filter(t=>null!==t).subscribe(n=>{const r=document.createElement("video");this.avatarVideoElement=r,r.srcObject=n,r.volume=1,r.controls=!1,r.autoplay=!1,r.setAttribute("playsinline","true"),r.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),t.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",t.uneeqOptions.avatarVideoContainerElement.innerHTML="",t.uneeqOptions.avatarVideoContainerElement.appendChild(r),this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(r),e()}),this.localStream$.filter(t=>null!==t).subscribe(e=>{const n=document.createElement("video");this.localVideoElement=n,n.srcObject=e,n.autoplay=!0,n.muted=!0,n.setAttribute("playsinline","true"),n.setAttribute("style","width: 100%; height: 100%;"),t.uneeqOptions.localVideoContainerElement.innerHTML="",t.uneeqOptions.localVideoContainerElement.appendChild(n),this.options.voiceInputManager.initMicActivity(e),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()}),this.options.internalMessages$.filter(t=>"AnswerMessage"===t.faceMeMessageType).subscribe(t=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(t)}),this.options.internalMessages$.filter(t=>"IceCandidateMessage"===t.faceMeMessageType).subscribe(t=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(t)})}setEdgeNodeId(t){this.options.session.edgeNodeId=t,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){a.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(o.PublishSubscribeState.DISCONNECTED)}pause(){const t=this.remoteStream$.getValue(),e=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),e&&e.getTracks().forEach(t=>t.enabled=!1),t&&t.getTracks().forEach(t=>t.enabled=!1)}resume(){const t=this.remoteStream$.getValue(),e=this.localStream$.getValue();e&&e.getTracks().forEach(t=>t.enabled=!0),t&&t.getTracks().forEach(t=>t.enabled=!0),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const t=this.localStream$.getValue();t&&t.getTracks().forEach(t=>t.stop()),this.publishingStream=!1}endSession(){this.stopAllLocalStreams(),this.options.uneeqOptions.localVideoContainerElement&&this.options.uneeqOptions.localVideoContainerElement&&(this.options.uneeqOptions.localVideoContainerElement.innerHTML=""),this.unpublishVideo(),this.options.uneeqOptions.avatarVideoContainerElement&&this.options.uneeqOptions.avatarVideoContainerElement&&(this.options.uneeqOptions.avatarVideoContainerElement.innerHTML="");const t=this.remoteStream$.getValue();t&&t.getTracks().forEach(t=>t.stop()),this.options.voiceInputManager.handleSessionEnd()}sendDataMessage(t){this.webRTC&&this.webRTC.sendDataMessage(t)}gatherWebRTCStats(t){var e;null===(e=this.webRTC)||void 0===e||e.getStats(t)}publishVideo(){const t=this.options.session.streamId,e=this.options.session.avatarStreamId,n=this.options.session.turnServerAddresses,r=this.options.session.turnUsername,V=this.options.session.turnPassword,s=this.options.session.forceTurnServerUse,u=this.publishState$,h=this.remoteStream$,l=this.localStream$.getValue();if(!l||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let f=0;a.logger.log("UserSession | publishVideo - stream:",l,"publishStreamName:",t),a.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new c.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:t,subscribeStreamName:e,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:t=>{a.logger.log("WEBRTC: onAddStream "+t.stream),h.next(t.stream)},forceTurnServerUse:s,iceServers:[{urls:n,username:r,credential:V}],onConnect:()=>{a.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected");u.getValue()===o.PublishSubscribeState.CONNECTING&&u.next(o.PublishSubscribeState.CONNECTED)},onError:t=>{a.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",f),f<3?(f++,this.performWebRTCConnection(l),this.options.userMessages.next(new i.ConnectionLostMessage(o.PublishSubscribeState.DISCONNECTED))):(a.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),u.next(o.PublishSubscribeState.FAILED),this.options.userMessages.next(new i.ConnectionLostMessage(o.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(l)):this.webRTC.updateStreamTracks(l)}performWebRTCConnection(t){this.webRTC&&(this.publishState$.next(o.PublishSubscribeState.CONNECTING),this.webRTC.connect(t))}initTransparentBackground(t){const e=new s.CanvasService(this.options.uneeqOptions).createCanvas();(new V.VideoEditor).applyChromaKeyEffect(e,t),this.avatarVideoElement.style.display="none"}}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoEditor=void 0;const o=V(n(83));e.VideoEditor=class{constructor(){}applyChromaKeyEffect(t,e){try{n(112);const r=o.default();let i,V,s;i=r.transform("reformat"),i.source=e,i.width=t.width,i.height=t.height,s=r.target(t),V=r.effect("chroma"),V.source=i,s.source=V,r.go()}catch(t){console.error(t)}}}},function(t,e,n){"use strict";n.r(e),n(83).default.plugin("chroma",{shader:function(t,e){return e.vertex=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","uniform vec4 screen;","uniform float balance;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat fmin = min(min(screen.r, screen.g), screen.b);","\tfloat fmax = max(max(screen.r, screen.g), screen.b);","\tfloat secondaryComponents;","\tscreenPrimary = step(fmax, screen.rgb);","\tsecondaryComponents = dot(1.0 - screenPrimary, screen.rgb);","\tscreenSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position = screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tvTexCoord = texCoord;","}"].join("\n"),e.fragment=[this.inputs.mask?"#define MASK":"","precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","uniform vec4 screen;","uniform float screenWeight;","uniform float balance;","uniform float clipBlack;","uniform float clipWhite;","uniform bool mask;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat pixelSat, secondaryComponents;","\tvec4 sourcePixel = texture2D(source, vTexCoord);","\tfloat fmin = min(min(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tfloat fmax = max(max(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tvec3 pixelPrimary = step(fmax, sourcePixel.rgb);","\tsecondaryComponents = dot(1.0 - pixelPrimary, sourcePixel.rgb);","\tpixelSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tfloat diffPrimary = dot(abs(pixelPrimary - screenPrimary), vec3(1.0));","\tfloat solid = step(1.0, step(pixelSat, 0.1) + step(fmax, 0.1) + diffPrimary);","\tfloat alpha = max(0.0, 1.0 - pixelSat / screenSat);","\talpha = smoothstep(clipBlack, clipWhite, alpha);","\tvec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(0.00001, alpha), alpha);","\tvec4 pixel = mix(semiTransparentPixel, sourcePixel, solid);","#ifdef MASK","\tgl_FragColor = vec4(vec3(pixel.a), 1.0);","#else","\tgl_FragColor = pixel;","#endif","}"].join("\n"),e},inPlace:!0,inputs:{source:{type:"image",uniform:"source"},screen:{type:"color",uniform:"screen",defaultValue:[66/255,195/255,31/255,1]},weight:{type:"number",uniform:"screenWeight",defaultValue:1,min:0},balance:{type:"number",uniform:"balance",defaultValue:1,min:0,max:1},clipBlack:{type:"number",uniform:"clipBlack",defaultValue:0,min:0,max:1},clipWhite:{type:"number",uniform:"clipWhite",defaultValue:1,min:0,max:1},mask:{type:"boolean",defaultValue:!1,uniform:"mask",shaderDirty:!0}},title:"Chroma Key",description:""})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasService=void 0;e.CanvasService=class{constructor(t){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=t}createCanvas(){const t=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(t),t.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),t.height=this.canvasHeight,t.width=this.canvasWidth,t}}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.UneeqWebRTC=void 0;const i=r(n(115)),V=r(n(82)),o=n(36),s=n(37);e.UneeqWebRTC=class{constructor(t){this.fakeDataChannel={},this.MESSAGING_ENDPOINT="/app/v2/webRTC",this.onStats=(t,e)=>{this.options.userMessages.next(new o.WebRtcStatsMessage(e)),this.statTimer=window.setTimeout(()=>{this.client.getStats(this.onStats)},2e3)},this.options=Object.assign({forceTurnServerUse:!1,iceServers:[]},t),this.log("Options",this.options),this.uniqueId=Math.random().toString(36).substring(2,12),RTCPeerConnection.prototype.createDataChannel||(this.warn("Implementing a fake createDataChannel"),RTCPeerConnection.prototype.createDataChannel=()=>this.fakeDataChannel)}connect(t){this.close(),this.client=new i.default({initiator:!0,config:{iceServers:this.options.iceServers},stream:t,channelName:"UneeqChannel"}),this.options.diagnostics&&this.enableDiagnostics(),this.fakeDataChannel.onopen&&(this.warn("Calling channel open on fake data channel"),this.fakeDataChannel.onopen()),this.client.on("error",t=>{this.log("error",t),void 0!==this.options.onError&&this.options.onError(t)}),this.client.on("signal",t=>{const e={payload:"",publishStreamName:this.options.publishStreamName,subscribeStreamName:this.options.subscribeStreamName,uniqueId:this.uniqueId,userAgent:navigator.userAgent,edgeNodeId:this.options.edgeNodeId};if("type"in t&&"offer"===t.type)e.payload=JSON.stringify({type:"offer",sdp:t.sdp}),e.type="OfferMessage",this.log("Offer payload ",e),this.options.messaging.send(this.MESSAGING_ENDPOINT,e);else if("candidate"in t){const n=JSON.stringify(t.candidate);this.options.forceTurnServerUse&&!n.match(/typ relay/)||n.match(/::/)||(e.payload=n,e.type="IceCandidate",this.log("IC payload ",e),this.options.messaging.send(this.MESSAGING_ENDPOINT,e))}else this.warn("WARNING Unhandled signal: ",JSON.stringify(t))}),this.client.on("connect",()=>{this.log("CONNECT"),void 0!==this.options.onConnect&&this.options.onConnect()}),this.client.on("data",t=>{this.log("data: "+t),void 0!==this.options.onData&&this.options.onData(t),this.options.userMessages.next(new o.WebRtcDataMessage(t))}),this.client.on("close",()=>{this.log("WebRTC session closed: "+this.uniqueId),this.client=null,void 0!==this.options.onClose&&this.options.onClose()}),this.client.on("stream",t=>{void 0!==this.options.onAddStream&&this.options.onAddStream({stream:t})})}close(){this.client&&(this.client.destroy(),this.client=null),this.statTimer&&clearTimeout(this.statTimer)}handleAnswerMessage(t){if(this.isMessageForUs(t)&&this.client){const e=JSON.parse(t.payload);return this.log("got answer: ",e),this.client.signal(e),!0}return this.log("ignoring answer: ",t),!1}handleIceCandidate(t){if(this.isMessageForUs(t)&&this.client){const e=JSON.parse(t.payload);if("candidate"in e&&""===e.candidate){if("edge"===V.default.browserDetails.browser){const t=this.client._pc;t.remoteDescription&&t.remoteDescription.type&&t.addIceCandidate(null)}}else this.client.signal({candidate:e});return!0}return!1}sendDataMessage(t){this.client.send(t)}getStats(t){return this.client&&this.client.getStats(t)}updateStreamTracks(t){t.getTracks().forEach(t=>{this.client._pc.getSenders().find(e=>t.kind===e.track.kind).replaceTrack(t).then(()=>{s.logger.log("Updated publish media stream track for "+t.kind)}).catch(e=>{s.logger.error("Error: updating publish media stream track failed for "+t.kind,e)})})}enableDiagnostics(){this.client._pc&&0!==this.client._pc.getStats.length&&(this.client._pc.getStats=""),this.client.getStats(this.onStats)}isMessageForUs(t){return t.requestUniqueId===this.uniqueId}log(t,...e){s.logger.log("UneeqWebRTC: "+t,e)}warn(t,...e){s.logger.warn("UneeqWebRTC: "+t,e)}}},function(t,e,n){
35
+ e.read=function(t,e,n,r,i){var V,o,s=8*i-r-1,a=(1<<s)-1,c=a>>1,u=-7,h=n?i-1:0,l=n?-1:1,f=t[e+h];for(h+=l,V=f&(1<<-u)-1,f>>=-u,u+=s;u>0;V=256*V+t[e+h],h+=l,u-=8);for(o=V&(1<<-u)-1,V>>=-u,u+=r;u>0;o=256*o+t[e+h],h+=l,u-=8);if(0===V)V=1-c;else{if(V===a)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),V-=c}return(f?-1:1)*o*Math.pow(2,V-r)},e.write=function(t,e,n,r,i,V){var o,s,a,c=8*V-i-1,u=(1<<c)-1,h=u>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:V-1,d=r?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),(e+=o+h>=1?l/a:l*Math.pow(2,1-h))*a>=2&&(o++,a/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*a-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+f]=255&s,f+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[n+f]=255&o,f+=d,o/=256,c-=8);t[n+f-d]|=128*p}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(105)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(47),i=n(106);r.Observable.prototype.filter=i.filter},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(81);e.filter=function(t,e){return r.filter(t,e)(this)}},function(t){t.exports=JSON.parse('{"name":"uneeq-js","version":"2.44.0","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"./node_modules/karma/bin/karma start karma.conf.js -logLevel=DEBUG","test":"./node_modules/karma/bin/karma start --browsers ChromeHeadless --single-run","test:windows":"karma start karma.conf.js","build":"webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js","lint":"./node_modules/tslint/bin/tslint -p tsconfig.json --fix","docs":"./node_modules/typedoc/bin/typedoc --options"},"files":["dist","!dist/test"],"author":"","license":"ISC","dependencies":{"@stomp/stompjs":"^6.0.0","@uehreka/seriously":"^1.0.1","fast-text-encoding":"^1.0.0","intrinsic-scale":"^3.0.4","promjs":"^0.4.1","rxjs":"^6.2.2","rxjs-compat":"^6.3.2","simple-peer":"9.11.0","webrtc-adapter":"8.1.0"},"devDependencies":{"@types/jasmine":"^2.8.8","@types/node":"^10.9.4","fetch-mock":"7.7.3","ignore-styles":"^5.0.1","jasmine":"^3.2.0","jasmine-class-mock":"^1.0.1","jasmine-core":"^3.3.0","karma":"^5.0.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^2.0.1","karma-jasmine-html-reporter":"^1.4.0","karma-requirejs":"^1.1.0","karma-safari-launcher":"^1.0.0","karma-typescript":"^5.0.0","karma-typescript-es6-transform":"^5.0.0","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^5.0.0","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-no-focused-test":"^0.5.0","typedoc":"^0.18.0","typescript":"^3.9.7","webpack":"^4.17.1","webpack-cli":"^3.1.0"}}')},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}a((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.API=void 0;e.API=class{constructor(t,e="",n=(()=>{})){this.xAuthToken="",this.apiUrl=t,this.apiKey=e,this.loggedOutHandler=n}set callId(t){this._callId=t}get authToken(){return this.xAuthToken}startSession(t){return this.postRequest("/api/v1/customers/",t,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",t)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:t})}avatarStartRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/start")}avatarStopRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/stop")}avatarStopSpeaking(){return this.postRequest("/api/v1/avatar/"+this._callId+"/stopSpeaking")}getAvailableAvatarCount(){return this.getRequest("/api/v1/avatar/"+this._callId+"/available")}startSessionWithToken(t){return this.postRequest("/api/v2/clients/start-session",t,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(t){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:t})}sendMediaUnavailable(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",t)}getEdgeNodeId(t){let e=t.replace("turn:","http://");e=e.replace("turns:","https://");const n=new Request(e,{method:"GET"});return this.makeRequest(n)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(t){return r(this,void 0,void 0,(function*(){const e=yield fetch(t);if(!e.ok){401===e.status&&this.loggedOutHandler();const t=yield e.json();throw{status:e.status,body:t}}return 204===e.status?new Promise((t,e)=>{t()}):(this.xAuthToken=e.headers.get("x-auth-token")||this.xAuthToken,yield e.json())}))}getRequest(t){const e=new Request(this.apiUrl+t,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(e)}postRequest(t,e={},n={},r={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},r),body:JSON.stringify(e)},V=new Request(this.apiUrl+t,Object.assign(i,n));return this.makeRequest(V)}putRequest(t,e={},n={}){const r={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(e)},i=new Request(this.apiUrl+t,Object.assign(r,n));return this.makeRequest(i)}}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}a((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.DeviceManager=void 0;const i=n(37),V=n(110);e.DeviceManager=class{constructor(t,e){this.options=t,this.api=e,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new V.MediaHandler(this.options,()=>this.remoteVideoReady()),this.initMediaConstraints(),this.getDevices(!1)}set edgeNodeId(t){this.mediaHandler.setEdgeNodeId(t),this.getDevices(!0)}enableLocalDevices(t,e){const n=this.options.uneeqOptions.sendLocalVideo!==t,r=this.options.uneeqOptions.sendLocalAudio!==e;(n||r)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=t,this.options.uneeqOptions.sendLocalAudio=e,n&&!1===t&&this.publishStream.getVideoTracks().forEach(t=>t.stop()),r&&!1===e&&this.publishStream.getAudioTracks().forEach(t=>t.stop()),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(t=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const e=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then(e=>r(this,void 0,void 0,(function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),t){if(this.options.uneeqOptions.sendLocalVideo){const t=e.getVideoTracks();t.length>0&&(this.publishStream.getVideoTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream.addTrack(t[0]))}if(this.options.uneeqOptions.sendLocalAudio){const t=e.getAudioTracks();t.length>0&&(this.publishStream.getAudioTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream.addTrack(t[0]))}this.mediaHandler.localStream$.next(this.publishStream)}}))).catch(t=>{e.options.userMessages.next(new i.DeviceErrorMessage(t)),console.error("device error: ",t),this.sendMediaUnavailableInfo("NotAllowedError"===t.name),this.revertMediaOptions()})}setMicDevice(t,e=!0){const n=this.devices.audioInput.filter(e=>e.deviceId===t);if(n&&n.length>0)this.options.uneeqOptions.preferredMicrophoneId=t,this.audioConstraints.deviceId=t,e&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(t));else{const e="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}setCamDevice(t,e=!0){const n=this.devices.videoInput.filter(e=>e.deviceId===t);if(n&&n.length>0)this.options.uneeqOptions.preferredCameraId=t,this.videoConstraints.deviceId=t,e&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(t));else{const e="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}setAvatarSpeakerDevice(t){if(this.mediaHandler.avatarVideoElement){const e=this.devices.audioOutput.filter(e=>e.deviceId===t);if(e&&e.length>0)this.options.uneeqOptions.preferredSpeakerId=t,this.mediaHandler.avatarVideoElement.setSinkId(t).then(()=>{this.speakerConstraints.deviceId=t,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(t))}).catch(e=>{const n="Uneeq setSpeaker: Error setting device. "+e.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(n,t))});else{const e="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}}revertMediaOptions(){this.previousMediaOptions&&(this.options.uneeqOptions.sendLocalAudio=this.previousMediaOptions.sendLocalAudio,this.options.uneeqOptions.sendLocalVideo=this.previousMediaOptions.sendLocalVideo)}initMediaConstraints(){this.audioConstraints={},this.videoConstraints={facingMode:"user",width:640,height:480},this.userMediaConstraints={audio:!!this.options.uneeqOptions.sendLocalAudio&&this.audioConstraints,video:!!this.options.uneeqOptions.sendLocalVideo&&this.videoConstraints}}initStreamWithoutDevices(){this.publishStream.getTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream=new MediaStream,this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),this.mediaHandler.localStream$.next(this.publishStream)}remoteVideoReady(){this.options.uneeqOptions.preferredSpeakerId&&this.setAvatarSpeakerDevice(this.options.uneeqOptions.preferredSpeakerId)}sendMediaUnavailableInfo(t){return r(this,void 0,void 0,(function*(){const e=yield this.getMediaDevices(),n={audioInputs:e.audioInput.length,videoInputs:e.videoInput.length,hasUserDeniedPermission:t};return this.api.sendMediaUnavailable(n)}))}getMediaDevices(){return r(this,void 0,void 0,(function*(){const t=yield navigator.mediaDevices.enumerateDevices(),e={audioInput:[],audioOutput:[],videoInput:[]};return e.audioInput=t.filter(t=>"audioinput"===t.kind),e.audioOutput=t.filter(t=>"audiooutput"===t.kind),e.videoInput=t.filter(t=>"videoinput"===t.kind),e}))}initDeviceList(){return r(this,void 0,void 0,(function*(){navigator.mediaDevices.ondevicechange=t=>{this.initDeviceList()};const t=yield this.getMediaDevices();JSON.stringify(t)!==JSON.stringify(this.devices)&&(this.devices=t,this.options.uneeqOptions.preferredCameraId&&this.setCamDevice(this.options.uneeqOptions.preferredCameraId,!1),this.options.uneeqOptions.preferredMicrophoneId&&this.setMicDevice(this.options.uneeqOptions.preferredMicrophoneId,!1),this.options.userMessages.next(new i.DeviceListUpdatedMessage(this.devices)))}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MediaHandler=void 0;const r=n(47),i=n(37),V=n(111),o=n(85),s=n(113),a=n(35),c=n(114);e.MediaHandler=class{constructor(t,e){this.options=t,this.remoteVideoReady=e,this.remoteStream$=new r.BehaviorSubject(null),this.localStream$=new r.BehaviorSubject(null),this.publishState$=new r.BehaviorSubject(o.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.remoteStream$.filter(t=>null!==t).subscribe(n=>{const r=document.createElement("video");this.avatarVideoElement=r,r.srcObject=n,r.volume=1,r.controls=!1,r.autoplay=!1,r.setAttribute("playsinline","true"),r.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),t.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",t.uneeqOptions.avatarVideoContainerElement.innerHTML="",t.uneeqOptions.avatarVideoContainerElement.appendChild(r),this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(r),e()}),this.localStream$.filter(t=>null!==t).subscribe(e=>{const n=document.createElement("video");this.localVideoElement=n,n.srcObject=e,n.autoplay=!0,n.muted=!0,n.setAttribute("playsinline","true"),n.setAttribute("style","width: 100%; height: 100%;"),t.uneeqOptions.localVideoContainerElement.innerHTML="",t.uneeqOptions.localVideoContainerElement.appendChild(n),this.options.voiceInputManager.initMicActivity(e),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()}),this.options.internalMessages$.filter(t=>"AnswerMessage"===t.faceMeMessageType).subscribe(t=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(t)}),this.options.internalMessages$.filter(t=>"IceCandidateMessage"===t.faceMeMessageType).subscribe(t=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(t)})}setEdgeNodeId(t){this.options.session.edgeNodeId=t,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){a.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(o.PublishSubscribeState.DISCONNECTED)}pause(){const t=this.remoteStream$.getValue(),e=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),e&&e.getTracks().forEach(t=>t.enabled=!1),t&&t.getTracks().forEach(t=>t.enabled=!1)}resume(){const t=this.remoteStream$.getValue(),e=this.localStream$.getValue();e&&e.getTracks().forEach(t=>t.enabled=!0),t&&t.getTracks().forEach(t=>t.enabled=!0),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const t=this.localStream$.getValue();t&&t.getTracks().forEach(t=>t.stop()),this.publishingStream=!1}endSession(){this.stopAllLocalStreams(),this.options.uneeqOptions.localVideoContainerElement&&this.options.uneeqOptions.localVideoContainerElement&&(this.options.uneeqOptions.localVideoContainerElement.innerHTML=""),this.unpublishVideo(),this.options.uneeqOptions.avatarVideoContainerElement&&this.options.uneeqOptions.avatarVideoContainerElement&&(this.options.uneeqOptions.avatarVideoContainerElement.innerHTML="");const t=this.remoteStream$.getValue();t&&t.getTracks().forEach(t=>t.stop()),this.options.voiceInputManager.handleSessionEnd()}sendDataMessage(t){this.webRTC&&this.webRTC.sendDataMessage(t)}gatherWebRTCStats(t){var e;null===(e=this.webRTC)||void 0===e||e.getStats(t)}publishVideo(){const t=this.options.session.streamId,e=this.options.session.avatarStreamId,n=this.options.session.turnServerAddresses,r=this.options.session.turnUsername,V=this.options.session.turnPassword,s=this.options.session.forceTurnServerUse,u=this.publishState$,h=this.remoteStream$,l=this.localStream$.getValue();if(!l||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let f=0;a.logger.log("UserSession | publishVideo - stream:",l,"publishStreamName:",t),a.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new c.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:t,subscribeStreamName:e,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:t=>{a.logger.log("WEBRTC: onAddStream "+t.stream),h.next(t.stream)},forceTurnServerUse:s,iceServers:[{urls:n,username:r,credential:V}],onConnect:()=>{a.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected");u.getValue()===o.PublishSubscribeState.CONNECTING&&u.next(o.PublishSubscribeState.CONNECTED)},onError:t=>{a.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",f),f<3?(f++,this.performWebRTCConnection(l),this.options.userMessages.next(new i.ConnectionLostMessage(o.PublishSubscribeState.DISCONNECTED))):(a.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),u.next(o.PublishSubscribeState.FAILED),this.options.userMessages.next(new i.ConnectionLostMessage(o.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(l)):this.webRTC.updateStreamTracks(l)}performWebRTCConnection(t){this.webRTC&&(this.publishState$.next(o.PublishSubscribeState.CONNECTING),this.webRTC.connect(t))}initTransparentBackground(t){const e=new s.CanvasService(this.options.uneeqOptions).createCanvas();(new V.VideoEditor).applyChromaKeyEffect(e,t),this.avatarVideoElement.style.display="none"}}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoEditor=void 0;const o=V(n(83));e.VideoEditor=class{constructor(){}applyChromaKeyEffect(t,e){try{n(112);const r=o.default();let i,V,s;i=r.transform("reformat"),i.source=e,i.width=t.width,i.height=t.height,s=r.target(t),V=r.effect("chroma"),V.source=i,s.source=V,r.go()}catch(t){console.error(t)}}}},function(t,e,n){"use strict";n.r(e),n(83).default.plugin("chroma",{shader:function(t,e){return e.vertex=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","uniform vec4 screen;","uniform float balance;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat fmin = min(min(screen.r, screen.g), screen.b);","\tfloat fmax = max(max(screen.r, screen.g), screen.b);","\tfloat secondaryComponents;","\tscreenPrimary = step(fmax, screen.rgb);","\tsecondaryComponents = dot(1.0 - screenPrimary, screen.rgb);","\tscreenSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position = screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tvTexCoord = texCoord;","}"].join("\n"),e.fragment=[this.inputs.mask?"#define MASK":"","precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","uniform vec4 screen;","uniform float screenWeight;","uniform float balance;","uniform float clipBlack;","uniform float clipWhite;","uniform bool mask;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat pixelSat, secondaryComponents;","\tvec4 sourcePixel = texture2D(source, vTexCoord);","\tfloat fmin = min(min(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tfloat fmax = max(max(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tvec3 pixelPrimary = step(fmax, sourcePixel.rgb);","\tsecondaryComponents = dot(1.0 - pixelPrimary, sourcePixel.rgb);","\tpixelSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tfloat diffPrimary = dot(abs(pixelPrimary - screenPrimary), vec3(1.0));","\tfloat solid = step(1.0, step(pixelSat, 0.1) + step(fmax, 0.1) + diffPrimary);","\tfloat alpha = max(0.0, 1.0 - pixelSat / screenSat);","\talpha = smoothstep(clipBlack, clipWhite, alpha);","\tvec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(0.00001, alpha), alpha);","\tvec4 pixel = mix(semiTransparentPixel, sourcePixel, solid);","#ifdef MASK","\tgl_FragColor = vec4(vec3(pixel.a), 1.0);","#else","\tgl_FragColor = pixel;","#endif","}"].join("\n"),e},inPlace:!0,inputs:{source:{type:"image",uniform:"source"},screen:{type:"color",uniform:"screen",defaultValue:[66/255,195/255,31/255,1]},weight:{type:"number",uniform:"screenWeight",defaultValue:1,min:0},balance:{type:"number",uniform:"balance",defaultValue:1,min:0,max:1},clipBlack:{type:"number",uniform:"clipBlack",defaultValue:0,min:0,max:1},clipWhite:{type:"number",uniform:"clipWhite",defaultValue:1,min:0,max:1},mask:{type:"boolean",defaultValue:!1,uniform:"mask",shaderDirty:!0}},title:"Chroma Key",description:""})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasService=void 0;e.CanvasService=class{constructor(t){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=t}createCanvas(){const t=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(t),t.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),t.height=this.canvasHeight,t.width=this.canvasWidth,t}}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.UneeqWebRTC=void 0;const i=r(n(115)),V=r(n(82)),o=n(37),s=n(35);e.UneeqWebRTC=class{constructor(t){this.fakeDataChannel={},this.MESSAGING_ENDPOINT="/app/v2/webRTC",this.onStats=(t,e)=>{this.options.userMessages.next(new o.WebRtcStatsMessage(e)),this.statTimer=window.setTimeout(()=>{this.client.getStats(this.onStats)},2e3)},this.options=Object.assign({forceTurnServerUse:!1,iceServers:[]},t),this.log("Options",this.options),this.uniqueId=Math.random().toString(36).substring(2,12),RTCPeerConnection.prototype.createDataChannel||(this.warn("Implementing a fake createDataChannel"),RTCPeerConnection.prototype.createDataChannel=()=>this.fakeDataChannel)}connect(t){this.close(),this.client=new i.default({initiator:!0,config:{iceServers:this.options.iceServers},stream:t,channelName:"UneeqChannel"}),this.options.diagnostics&&this.enableDiagnostics(),this.fakeDataChannel.onopen&&(this.warn("Calling channel open on fake data channel"),this.fakeDataChannel.onopen()),this.client.on("error",t=>{this.log("error",t),void 0!==this.options.onError&&this.options.onError(t)}),this.client.on("signal",t=>{const e={payload:"",publishStreamName:this.options.publishStreamName,subscribeStreamName:this.options.subscribeStreamName,uniqueId:this.uniqueId,userAgent:navigator.userAgent,edgeNodeId:this.options.edgeNodeId};if("type"in t&&"offer"===t.type)e.payload=JSON.stringify({type:"offer",sdp:t.sdp}),e.type="OfferMessage",this.log("Offer payload ",e),this.options.messaging.send(this.MESSAGING_ENDPOINT,e);else if("candidate"in t){const n=JSON.stringify(t.candidate);this.options.forceTurnServerUse&&!n.match(/typ relay/)||n.match(/::/)||(e.payload=n,e.type="IceCandidate",this.log("IC payload ",e),this.options.messaging.send(this.MESSAGING_ENDPOINT,e))}else this.warn("WARNING Unhandled signal: ",JSON.stringify(t))}),this.client.on("connect",()=>{this.log("CONNECT"),void 0!==this.options.onConnect&&this.options.onConnect()}),this.client.on("data",t=>{this.log("data: "+t),void 0!==this.options.onData&&this.options.onData(t),this.options.userMessages.next(new o.WebRtcDataMessage(t))}),this.client.on("close",()=>{this.log("WebRTC session closed: "+this.uniqueId),this.client=null,void 0!==this.options.onClose&&this.options.onClose()}),this.client.on("stream",t=>{void 0!==this.options.onAddStream&&this.options.onAddStream({stream:t})})}close(){this.client&&(this.client.destroy(),this.client=null),this.statTimer&&clearTimeout(this.statTimer)}handleAnswerMessage(t){if(this.isMessageForUs(t)&&this.client){const e=JSON.parse(t.payload);return this.log("got answer: ",e),this.client.signal(e),!0}return this.log("ignoring answer: ",t),!1}handleIceCandidate(t){if(this.isMessageForUs(t)&&this.client){const e=JSON.parse(t.payload);if("candidate"in e&&""===e.candidate){if("edge"===V.default.browserDetails.browser){const t=this.client._pc;t.remoteDescription&&t.remoteDescription.type&&t.addIceCandidate(null)}}else this.client.signal({candidate:e});return!0}return!1}sendDataMessage(t){this.client.send(t)}getStats(t){return this.client&&this.client.getStats(t)}updateStreamTracks(t){t.getTracks().forEach(t=>{this.client._pc.getSenders().find(e=>t.kind===e.track.kind).replaceTrack(t).then(()=>{s.logger.log("Updated publish media stream track for "+t.kind)}).catch(e=>{s.logger.error("Error: updating publish media stream track failed for "+t.kind,e)})})}enableDiagnostics(){this.client._pc&&0!==this.client._pc.getStats.length&&(this.client._pc.getStats=""),this.client.getStats(this.onStats)}isMessageForUs(t){return t.requestUniqueId===this.uniqueId}log(t,...e){s.logger.log("UneeqWebRTC: "+t,e)}warn(t,...e){s.logger.warn("UneeqWebRTC: "+t,e)}}},function(t,e,n){
36
36
  /*! simple-peer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
37
37
  const r=n(116)("simple-peer"),i=n(119),V=n(120),o=n(121),s=n(130),a=n(131),{Buffer:c}=n(44);function u(t){return t.replace(/a=ice-options:trickle\s\n/g,"")}class h extends o.Duplex{constructor(t){if(super(t=Object.assign({allowHalfOpen:!1},t)),this._id=V(4).toString("hex").slice(0,7),this._debug("new peer %o",t),this.channelName=t.initiator?t.channelName||V(20).toString("hex"):null,this.initiator=t.initiator||!1,this.channelConfig=t.channelConfig||h.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},h.config,t.config),this.offerOptions=t.offerOptions||{},this.answerOptions=t.answerOptions||{},this.sdpTransform=t.sdpTransform||(t=>t),this.streams=t.streams||(t.stream?[t.stream]:[]),this.trickle=void 0===t.trickle||t.trickle,this.allowHalfTrickle=void 0!==t.allowHalfTrickle&&t.allowHalfTrickle,this.iceCompleteTimeout=t.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=t.wrtc&&"object"==typeof t.wrtc?t.wrtc:i(),!this._wrtc)throw"undefined"==typeof window?a(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):a(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(t){return void this.destroy(a(t,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=t=>{this._onIceCandidate(t)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch(t=>{this.destroy(a(t,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=t=>{this._setupData(t)},this.streams&&this.streams.forEach(t=>{this.addStream(t)}),this._pc.ontrack=t=>{this._onTrack(t)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(t){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof t)try{t=JSON.parse(t)}catch(e){t={}}this._debug("signal()"),t.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),t.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(t.transceiverRequest.kind,t.transceiverRequest.init)),t.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(t.candidate):this._pendingCandidates.push(t.candidate)),t.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(t)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(t=>{this._addIceCandidate(t)}),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())}).catch(t=>{this.destroy(a(t,"ERR_SET_REMOTE_DESCRIPTION"))}),t.sdp||t.candidate||t.renegotiate||t.transceiverRequest||this.destroy(a(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(t){const e=new this._wrtc.RTCIceCandidate(t);this._pc.addIceCandidate(e).catch(t=>{var n;!e.address||e.address.endsWith(".local")?(n="Ignoring unsupported ICE candidate.",console.warn(n)):this.destroy(a(t,"ERR_ADD_ICE_CANDIDATE"))})}send(t){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(t)}}addTransceiver(t,e){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(t,e),this._needsNegotiation()}catch(t){this.destroy(a(t,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:t,init:e}})}}addStream(t){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),t.getTracks().forEach(e=>{this.addTrack(e,t)})}}addTrack(t,e){if(this.destroying)return;if(this.destroyed)throw a(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const n=this._senderMap.get(t)||new Map;let r=n.get(e);if(r)throw r.removed?a(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):a(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");r=this._pc.addTrack(t,e),n.set(e,r),this._senderMap.set(t,n),this._needsNegotiation()}replaceTrack(t,e,n){if(this.destroying)return;if(this.destroyed)throw a(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const r=this._senderMap.get(t),i=r?r.get(n):null;if(!i)throw a(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");e&&this._senderMap.set(e,r),null!=i.replaceTrack?i.replaceTrack(e):this.destroy(a(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(t,e){if(this.destroying)return;if(this.destroyed)throw a(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const n=this._senderMap.get(t),r=n?n.get(e):null;if(!r)throw a(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{r.removed=!0,this._pc.removeTrack(r)}catch(t){"NS_ERROR_UNEXPECTED"===t.name?this._sendersAwaitingStable.push(r):this.destroy(a(t,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(t){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),t.getTracks().forEach(e=>{this.removeTrack(e,t)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,s(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(t){this._destroy(t,()=>{})}_destroy(t,e){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",t&&(t.message||t)),s(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",t&&(t.message||t)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(t){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(t){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,t&&this.emit("error",t),this.emit("close"),e()}))}_setupData(t){if(!t.channel)return this.destroy(a(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=t.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=65536),this.channelName=this._channel.label,this._channel.onmessage=t=>{this._onChannelMessage(t)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=t=>{const e=t.error instanceof Error?t.error:new Error(`Datachannel error: ${t.message} ${t.filename}:${t.lineno}:${t.colno}`);this.destroy(a(e,"ERR_DATA_CHANNEL"))};let e=!1;this._closingInterval=setInterval(()=>{this._channel&&"closing"===this._channel.readyState?(e&&this._onChannelClose(),e=!0):e=!1},5e3)}_read(){}_write(t,e,n){if(this.destroyed)return n(a(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(t)}catch(t){return this.destroy(a(t,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>65536?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=t,this._cb=n}_onFinish(){if(this.destroyed)return;const t=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?t():this.once("connect",t)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(t=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(t.sdp=u(t.sdp)),t.sdp=this.sdpTransform(t.sdp);const e=()=>{if(this.destroyed)return;const e=this._pc.localDescription||t;this._debug("signal"),this.emit("signal",{type:e.type,sdp:e.sdp})};this._pc.setLocalDescription(t).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?e():this.once("_iceComplete",e))}).catch(t=>{this.destroy(a(t,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(t=>{this.destroy(a(t,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(t=>{t.mid||!t.sender.track||t.requested||(t.requested=!0,this.addTransceiver(t.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(t=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(t.sdp=u(t.sdp)),t.sdp=this.sdpTransform(t.sdp);const e=()=>{if(this.destroyed)return;const e=this._pc.localDescription||t;this._debug("signal"),this.emit("signal",{type:e.type,sdp:e.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(t).then(()=>{this.destroyed||(this.trickle||this._iceComplete?e():this.once("_iceComplete",e))}).catch(t=>{this.destroy(a(t,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(t=>{this.destroy(a(t,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(a(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const t=this._pc.iceConnectionState,e=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",t,e),this.emit("iceStateChange",t,e),"connected"!==t&&"completed"!==t||(this._pcReady=!0,this._maybeReady()),"failed"===t&&this.destroy(a(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===t&&this.destroy(a(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(t){const e=t=>("[object Array]"===Object.prototype.toString.call(t.values)&&t.values.forEach(e=>{Object.assign(t,e)}),t);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then(n=>{const r=[];n.forEach(t=>{r.push(e(t))}),t(null,r)},e=>t(e)):this._pc.getStats.length>0?this._pc.getStats(n=>{if(this.destroyed)return;const r=[];n.result().forEach(t=>{const n={};t.names().forEach(e=>{n[e]=t.stat(e)}),n.id=t.id,n.type=t.type,n.timestamp=t.timestamp,r.push(e(n))}),t(null,r)},e=>t(e)):t(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const t=()=>{this.destroyed||this.getStats((e,n)=>{if(this.destroyed)return;e&&(n=[]);const r={},i={},V={};let o=!1;n.forEach(t=>{"remotecandidate"!==t.type&&"remote-candidate"!==t.type||(r[t.id]=t),"localcandidate"!==t.type&&"local-candidate"!==t.type||(i[t.id]=t),"candidatepair"!==t.type&&"candidate-pair"!==t.type||(V[t.id]=t)});const s=t=>{o=!0;let e=i[t.localCandidateId];e&&(e.ip||e.address)?(this.localAddress=e.ip||e.address,this.localPort=Number(e.port)):e&&e.ipAddress?(this.localAddress=e.ipAddress,this.localPort=Number(e.portNumber)):"string"==typeof t.googLocalAddress&&(e=t.googLocalAddress.split(":"),this.localAddress=e[0],this.localPort=Number(e[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let n=r[t.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=Number(n.port)):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=Number(n.portNumber)):"string"==typeof t.googRemoteAddress&&(n=t.googRemoteAddress.split(":"),this.remoteAddress=n[0],this.remotePort=Number(n[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach(t=>{"transport"===t.type&&t.selectedCandidatePairId&&s(V[t.selectedCandidatePairId]),("googCandidatePair"===t.type&&"true"===t.googActiveConnection||("candidatepair"===t.type||"candidate-pair"===t.type)&&t.selected)&&s(t)}),o||Object.keys(V).length&&!Object.keys(i).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(a(e,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const t=this._cb;this._cb=null,t(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(t,100)})};t()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>65536||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(t=>{this._pc.removeTrack(t),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(t){this.destroyed||(t.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:t.candidate.candidate,sdpMLineIndex:t.candidate.sdpMLineIndex,sdpMid:t.candidate.sdpMid}}):t.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),t.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(t){if(this.destroyed)return;let e=t.data;e instanceof ArrayBuffer&&(e=c.from(e)),this.push(e)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const t=this._cb;this._cb=null,t(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(t){this.destroyed||t.streams.forEach(e=>{this._debug("on track"),this.emit("track",t.track,e),this._remoteTracks.push({track:t.track,stream:e}),this._remoteStreams.some(t=>t.id===e.id)||(this._remoteStreams.push(e),s(()=>{this._debug("on stream"),this.emit("stream",e)}))})}_debug(){const t=[].slice.call(arguments);t[0]="["+this._id+"] "+t[0],r.apply(null,t)}}h.WEBRTC_SUPPORT=!!i(),h.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},h.channelConfig={},t.exports=h},function(t,e,n){(function(r){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))}),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&void 0!==r&&"env"in r&&(t=r.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(117)(e);const{formatters:i}=t.exports;i.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,n(38))},function(t,e,n){t.exports=function(t){function e(t){let n,i,V,o=null;function s(...t){if(!s.enabled)return;const r=s,i=Number(new Date),V=i-(n||i);r.diff=V,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(n,i)=>{if("%%"===n)return"%";o++;const V=e.formatters[i];if("function"==typeof V){const e=t[o];n=V.call(r,e),t.splice(o,1),o--}return n}),e.formatArgs.call(r,t);(r.log||e.log).apply(r,t)}return s.namespace=t,s.useColors=e.useColors(),s.color=e.selectColor(t),s.extend=r,s.destroy=e.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==e.namespaces&&(i=e.namespaces,V=e.enabled(t)),V),set:t=>{o=t}}),"function"==typeof e.init&&e.init(s),s}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map(t=>"-"+t)].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(118),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(n=>{e[n]=t[n]}),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},function(t,e){var n=1e3,r=6e4,i=60*r,V=24*i;function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,e){e=e||{};var s=typeof t;if("string"===s&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var o=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*V;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*r;case"seconds":case"second":case"secs":case"sec":case"s":return o*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(t);if("number"===s&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=V)return o(t,e,V,"day");if(e>=i)return o(t,e,i,"hour");if(e>=r)return o(t,e,r,"minute");if(e>=n)return o(t,e,n,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=V)return Math.round(t/V)+"d";if(e>=i)return Math.round(t/i)+"h";if(e>=r)return Math.round(t/r)+"m";if(e>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e){t.exports=function(){if("undefined"==typeof globalThis)return null;var t={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return t.RTCPeerConnection?t:null}},function(t,e,n){"use strict";(function(e,r){var i=n(86).Buffer,V=e.crypto||e.msCrypto;V&&V.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var n=i.allocUnsafe(t);if(t>0)if(t>65536)for(var o=0;o<t;o+=65536)V.getRandomValues(n.slice(o,o+65536));else V.getRandomValues(n);if("function"==typeof e)return r.nextTick((function(){e(null,n)}));return n}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(34),n(38))},function(t,e,n){(e=t.exports=n(87)).Stream=e,e.Readable=e,e.Writable=n(92),e.Duplex=n(46),e.Transform=n(94),e.PassThrough=n(128),e.finished=n(79),e.pipeline=n(129)},function(t,e){},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(44).Buffer,s=n(124).inspect,a=s&&s.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,n,c;return e=t,(n=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,n,r,i=o.allocUnsafe(t>>>0),V=this.head,s=0;V;)e=V.data,n=i,r=s,o.prototype.copy.call(e,n,r),s+=V.data.length,V=V.next;return i}},{key:"consume",value:function(t,e){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):n=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,n=1,r=e.data;for(t-=r.length;e=e.next;){var i=e.data,V=t>i.length?i.length:t;if(V===i.length?r+=i:r+=i.slice(0,t),0==(t-=V)){V===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(V));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),n=this.head,r=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var i=n.data,V=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,V),0==(t-=V)){V===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(V));break}++r}return this.length-=r,e}},{key:a,value:function(t,e){return s(this,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&V(e.prototype,n),c&&V(e,c),t}()},function(t,e){},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(this,n(34))},function(t,e,n){"use strict";(function(e){var r;function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var V=n(79),o=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),l=Symbol("stream");function f(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var n=t[l].read();null!==n&&(t[u]=null,t[o]=null,t[s]=null,e(f(n,!1)))}}function p(t){e.nextTick(d,t)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(r={get stream(){return this[l]},next:function(){var t=this,n=this[a];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(f(void 0,!0));if(this[l].destroyed)return new Promise((function(n,r){e.nextTick((function(){t[a]?r(t[a]):n(f(void 0,!0))}))}));var r,i=this[u];if(i)r=new Promise(function(t,e){return function(n,r){t.then((function(){e[c]?n(f(void 0,!0)):e[h](n,r)}),r)}}(i,this));else{var V=this[l].read();if(null!==V)return Promise.resolve(f(V,!1));r=new Promise(this[h])}return this[u]=r,r}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var t=this;return new Promise((function(e,n){t[l].destroy(null,(function(t){t?n(t):e(f(void 0,!0))}))}))})),r),g);t.exports=function(t){var e,n=Object.create(v,(i(e={},l,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var r=n[l].read();r?(n[u]=null,n[o]=null,n[s]=null,t(f(r,!1))):(n[o]=t,n[s]=e)},writable:!0}),e));return n[u]=null,V(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[s];return null!==e&&(n[u]=null,n[o]=null,n[s]=null,e(t)),void(n[a]=t)}var r=n[o];null!==r&&(n[u]=null,n[o]=null,n[s]=null,r(f(void 0,!0))),n[c]=!0})),t.on("readable",p.bind(null,n)),n}}).call(this,n(38))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,n){"use strict";t.exports=i;var r=n(94);function i(t){if(!(this instanceof i))return new i(t);r.call(this,t)}n(59)(i,r),i.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){"use strict";var r;var i=n(45).codes,V=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function a(t,e,i,V){V=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(V);var s=!1;t.on("close",(function(){s=!0})),void 0===r&&(r=n(79)),r(t,{readable:e,writable:i},(function(t){if(t)return V(t);s=!0,V()}));var a=!1;return function(e){if(!s&&!a)return a=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void V(e||new o("pipe"))}}function c(t){t()}function u(t,e){return t.pipe(e)}function h(t){return t.length?"function"!=typeof t[t.length-1]?s:t.pop():s}t.exports=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=h(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new V("streams");var o=e.map((function(t,n){var V=n<e.length-1;return a(t,V,n>0,(function(t){r||(r=t),t&&o.forEach(c),V||(o.forEach(c),i(r))}))}));return e.reduce(u)}},function(t,e,n){(function(e){/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
38
- let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:e):t=>(n||(n=Promise.resolve())).then(t).catch(t=>setTimeout(()=>{throw t},0))}).call(this,n(34))},function(t,e,n){"use strict";function r(t,e){for(const n in e)Object.defineProperty(t,n,{value:e[n],enumerable:!0,configurable:!0});return t}t.exports=function(t,e,n){if(!t||"string"==typeof t)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof e&&(n=e,e=""),e&&(n.code=e);try{return r(t,n)}catch(e){n.message=t.message,n.stack=t.stack;const i=function(){};i.prototype=Object.create(Object.getPrototypeOf(t));return r(new i,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DigitalHumanVideoPlayManager=void 0;const r=n(63),i=n(37);e.DigitalHumanVideoPlayManager=class{constructor(t,e){this.messages=t,this.publicUnmuteDigitalHumanMethod=e,this.remoteVideoPlayCount=0}play(t){this.video=t,this.playRemoteVideo()}unmuteVideo(){this.video&&this.video.muted&&(this.video.muted=!1,this.messages.next(new r.DigitalHumanUnmuted))}playRemoteVideo(){this.video&&(this.video.onerror=t=>{this.messages.next(new r.DigitalHumanVideoError(t))},this.video.play().catch(()=>{this.messages.next(new r.DigitalHumanFailedToPlay),this.video.muted=!0,this.video.play().then(()=>{i.logger.log("Muting the digital human and playing it succeeded."),this.messages.next(new r.DigitalHumanPlayedInMutedModeSuccess),this.video.addEventListener("click",()=>{this.publicUnmuteDigitalHumanMethod()},{once:!0})}).catch(t=>{i.logger.log("Could not play digital human video even as muted, starting exponential backoff.",t),this.playRemoteVideoWithExponentialBackoff()})}))}playRemoteVideoWithExponentialBackoff(){this.video&&(this.video.autoplay=!0,this.video.play(),this.remoteVideoPlayCount++,setTimeout(()=>{this.remoteVideoPlayCount<10&&this.playRemoteVideoWithExponentialBackoff()},100*(this.remoteVideoPlayCount-1)))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;const r=n(36),i=n(80);e.MessageHandler=class{constructor(t,e){this.internalMessages$=t,this.messages=e,this.deviceManager={getDevices:(t,e)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe(t=>{const e={type:i.PromMessageType.QuestionMessageReceived,value:{id:t.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new r.AvatarQuestionMessage(t.question,t.id))}),this.getMessagesOfType("AvatarAnswerText").subscribe(t=>{const e={type:i.PromMessageType.AnswerMessageReceived,value:{id:t.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new r.AvatarAnswerMessage(t.answer,t.answerAvatar,t.answerSpeech,t.questionId))}),this.getMessagesOfType("AvatarAnswerHTML").subscribe(t=>{this.messages.next(new r.AvatarAnswerContentMessage(t.html,t.messageId,t.hasDisplayHtml)),this.messages.next(new r.InstructionsMessage(t.instructions))}),this.getMessagesOfType("AvatarTextInputStarted").subscribe(t=>this.messages.next(new r.StartedSpeakingMessage)),this.getMessagesOfType("AvatarTextInputFinished").subscribe(t=>{this.messages.next(new r.FinishedSpeakingMessage),this.messages.next(new r.AvatarTextInputFinishedMessage)}),this.getMessagesOfType("AvatarStarting").subscribe(t=>{this.deviceManager.edgeNodeId=t.edgeNodeId}),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe(t=>{this.messages.next(new r.ClientMediaStreamUpdateMessage(t.clientStreamingAudio,t.clientStreamingVideo,t.serverStreamingAudio,t.serverStreamingVideo)),t.clientStreamingAudio&&t.clientStreamingVideo&&t.serverStreamingAudio&&t.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))}),this.getMessagesOfType("SessionErrorMessage").subscribe(t=>{console.error(t.error),this.messages.next(new r.SessionErrorMessage(t.error))}),this.getMessagesOfType("SessionInfoMessage").subscribe(t=>{this.messages.next(new r.SessionInfoMessage(t.info))}),this.getMessagesOfType("SessionEndedMessage").subscribe(()=>{const t={type:i.PromMessageType.SessionEnded,value:{receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.internalMessages$.next({faceMeMessageType:"sessionEnd"})}),this.getMessagesOfType("AvatarRequestCompleted").subscribe(t=>{this.messages.next(new r.AvatarRequestCompleted(t.reason))}),this.getMessagesOfType("AvatarRequestIgnored").subscribe(t=>{this.messages.next(new r.AvatarRequestIgnored(t.reason))})}setDeviceManager(t){this.deviceManager=t}getMessagesOfType(t){return this.internalMessages$.filter(e=>e.faceMeMessageType===t)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={};e.default=void 0;var i=n(135),V=n(139);Object.keys(V).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(r,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return V[t]}}))}));e.default=function(){return new i.Registry}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Registry=void 0;var r=n(64),i=n(95),V=n(137),o=n(138),s=n(97);function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=void 0,(n="data")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.data={counter:{},gauge:{},histogram:{}}}var e,n,c;return e=t,(n=[{key:"validateInput",value:function(t,e,n,i){if(""===String(e))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(t))throw new Error("Unknown metric type ".concat(t));if("string"!=typeof n&&null!=n)throw new Error("help must be string or undefined/null");if((0,r.has)(this.data,"".concat(t,".").concat(e)))throw new Error("A metric with the name '".concat(e,"' already exists for type '").concat(t,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(t,e,r,s),"counter"===t?(n=new i.Counter,this.data.counter[e]={help:r,instance:n,type:t}):"gauge"===t?(n=new V.Gauge,this.data.gauge[e]={help:r,instance:n,type:t}):(n=new o.Histogram(s),this.data.histogram[e]={help:r,instance:n,type:t}),n}},{key:"metrics",value:function(){return(0,r.reduce)(this.data,(function(t,e,n){return t+(0,r.reduce)(e,(function(t,e,i){var V=e.instance.collect(),o=t;return e.help.length>0&&(o+="# HELP ".concat(i," ").concat(e.help,"\n")),o+="# TYPE ".concat(i," ").concat(n,"\n"),o+=(0,r.reduce)(V,(function(t,e){return t+("histogram"===n?(0,s.formatHistogramOrSummary)(i,e):(0,s.formatCounterOrGauge)(i,e))}),"")}),"")}),"")}},{key:"reset",value:function(){return(0,r.each)(this.data,(function(t){(0,r.each)(t,(function(t){t.instance.resetAll()}))})),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(t,e){var n=(null!=t?[this.data[t]]:(0,r.valuesIn)(this.data)).find((function(t){return(0,r.has)(t,e)}));return null!=n?n[e].instance:void 0}}])&&a(e.prototype,n),c&&a(e,c),t}();e.Registry=c},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Gauge=void 0;var c=function(t){function e(){return i(this,e),o(this,s(e).apply(this,arguments))}var n,r,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,t),n=e,(r=[{key:"dec",value:function(t){var e=this.get(t);return this.set(e?e.value-1:0,t),this}},{key:"sub",value:function(t,e){var n=this.get(e);return this.set(n?n.value-t:0,e),this}}])&&V(n.prototype,r),c&&V(n,c),e}(n(95).Counter);e.Gauge=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Histogram=void 0;var r=n(64);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?c(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t){return{entries:(0,r.reduce)(t,(function(t,e){return t[e.toString()]=0,t}),{"+Inf":0}),sum:0,count:0,raw:[]}}var f=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return V(this,e),h(c(t=s(this,a(e).call(this))),"buckets",void 0),t.buckets=n.sort((function(t,e){return t>e?1:-1})),t.set(l(t.buckets)),t.observe=t.observe.bind(c(t)),t}var n,i,f;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(e,t),n=e,(i=[{key:"observe",value:function(t,e){var n=this.get(e);null==n&&(n=this.set(l(this.buckets),e).get(e)),n.value.raw.push(t),n.value.entries["+Inf"]+=1;var i=function(t,e){if(e<t[t.length-1])for(var n=0;n<t.length;n+=1)if(e<=t[n])return n}(this.buckets,t);if(null!=i)for(var V=i;V<this.buckets.length;V+=1){var o=n.value.entries[this.buckets[V].toString()];n.value.entries[this.buckets[V].toString()]=o+1}return n.value.sum=(0,r.sum)(n.value.raw),n.value.count+=1,this}},{key:"reset",value:function(t){this.set(l(this.buckets),t)}}])&&o(n.prototype,i),f&&o(n,f),e}(n(96).Collector);e.Histogram=f},function(t,e,n){},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingState=e.MessagingService=void 0;const r=n(141);Object.defineProperty(e,"MessagingService",{enumerable:!0,get:function(){return r.MessagingService}});const i=n(98);Object.defineProperty(e,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingService=void 0;const r=n(154),i=n(142),V=n(144),o=n(37),s=n(98);e.MessagingService=class{constructor(t,e){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=t,this.options=Object.assign(this.options,e),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(s.MessagingState.DISCONNECTED),this.messages$=new V.Subject,console.log("connect headers messaging: ",this.options.connectionHeaders);const n={connectHeaders:this.options.connectionHeaders,reconnectDelay:0,connectionTimeout:5e3,discardWebsocketOnCommFailure:!0,brokerURL:this.url.replace("https://","wss://").replace("http://","ws://")};this.stompClient=new r.Client(n),this.stompClient.onConnect=t=>this.onStompConnected(t),this.stompClient.onDisconnect=t=>{o.logger.log("Stomp client disconnected",t)},this.stompClient.onStompError=t=>{o.logger.log("Stomp client error",t),this.onStompClientConnectionClosed(t)},this.stompClient.onWebSocketError=t=>{o.logger.log("Stomp client web socket error",t),this.onStompClientConnectionClosed(t)},this.stompClient.onWebSocketClose=t=>{o.logger.log("Stomp client web socket closed",t),this.onStompClientConnectionClosed(t)}}connect(){this.disconnect(),o.logger.log("MessagingService | connecting..."),this.state$.next(s.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const t=this.state$.getValue();if(t===s.MessagingState.CONNECTED||t===s.MessagingState.CONNECTING){o.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(s.MessagingState.DISCONNECTED)}catch(t){console.error("MessagingService | disconnect: error",t),this.state$.next(s.MessagingState.DISCONNECTED)}}}send(t,e){o.logger.log("MessagingService | send:",t,e);const n={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},r=JSON.stringify(e);this.stompClient.publish({destination:t,body:r,headers:n})}getTopic(t){o.logger.log("MessagingService | subscribeToTopic: "+t);const e=this.subscriptions[t];if(e)return o.logger.log("existing subscription... not re-subscribing to topic"),e;const n=new V.Subject;return this.stompClient.subscribe(t,t=>{n.next(t),this.messages$.next(t)}),this.subscriptions[t]=n,n}onStompConnected(t){o.logger.log("MessagingService | connected"),this.state$.next(s.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(t){this.options.autoReconnect?this.options.maxReconnectAttempts&&this.connectionAttempts<this.options.maxReconnectAttempts?setTimeout(()=>{this.connect()},this.options.reconnectTime):this.options.maxReconnectLimitReached&&(this.options.maxReconnectLimitReached(),this.disconnect()):this.disconnect()}initMessagingSubscription(){o.logger.log("MessagingService | initMessagingSubscription");this.stompClient.subscribe("/",t=>{this.messages$.next(t)})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(143))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(47);e.BehaviorSubject=r.BehaviorSubject},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(145))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(47);e.Subject=r.Subject},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetricsService=void 0;const r=n(36),i=n(147),V=n(80);e.MetricsService=class{constructor(t,e,n){this.uneeqOptions=t,this.internalMessages=e,this.messages=n,this.clientPerformanceStats={},this.options=t,this.internalMessages$=e,this.messages$=n}parseAndLogWebRtcStats(t){try{t.forEach(t=>{var e,n;if("inbound-rtp"===t.type&&"video"===t.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",t.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",t.frameWidth);const r=t.framesDropped,V=r?r-(null===(e=this.clientPerformanceStats.totalFramesDropped)||void 0===e?void 0:e.value):0;this.clientPerformanceStats.newFramesDropped=V?new i.ClientPerformanceStat("New Frames Dropped",V):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=r?new i.ClientPerformanceStat("Total Frames Dropped",r):new i.ClientPerformanceStat;const o=t.packetsLost,s=o?o-(null===(n=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===n?void 0:n.value):0;this.clientPerformanceStats.inboundNewPacketsLost=s?new i.ClientPerformanceStat("New packets lost",s):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=o?new i.ClientPerformanceStat("Total packets lost",o):new i.ClientPerformanceStat;const a=t.framesPerSecond;this.clientPerformanceStats.framesPerSec=a?new i.ClientPerformanceStat("Frames per second",a):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===t.type&&"video"===t.kind){const e=t.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=e?new i.ClientPerformanceStat("Round Trip Time",e):new i.ClientPerformanceStat}else if("outbound-rtp"===t.type&&"video"===t.kind){const e=t.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",e)}}),this.options.enableClientPerformanceMessage&&this.messages$.next(new r.ClientPerformanceMessage(this.clientPerformanceStats));const e={type:V.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e})}catch(t){console.warn("Unable to parseAndLogWebRTCStats",t)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ClientPerformanceStat=void 0;e.ClientPerformanceStat=class{constructor(t="",e=0){this.label=t,this.value=e}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OnlineStatusService=void 0;const r=n(36);e.OnlineStatusService=class{constructor(t,e){this.messages=t,this.offlineTimeoutLimitHandler=e,this.online=!0,this.offlineDisconnectTimeLimitMS=1e4,window.addEventListener("offline",()=>this.handleOffline()),window.addEventListener("online",()=>this.handleOnline())}handleOffline(){this.online=!1,this.disconnectTimer=setTimeout(()=>{this.offlineTimeoutLimitHandler()},this.offlineDisconnectTimeLimitMS),this.sendStatusUpdate()}handleOnline(){this.online=!0,window.clearTimeout(this.disconnectTimer),this.sendStatusUpdate()}sendStatusUpdate(){this.messages.next(new r.OnlineStatusUpdateMessage(this.online))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StreamManager=void 0;class r{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioElement=document.createElement("audio"),this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(t){return t.getVideoTracks().forEach(e=>t.removeTrack(e)),t.addTrack(this.canvasVideoTrack),t}addSilentAudioTrackToStream(t){return t.getAudioTracks().forEach(e=>t.removeTrack(e)),t.addTrack(this.silentAudioTrack),t}remoteVideoReadyToPlay(){null!==this.silentAudioElement&&setTimeout(()=>{this.silentAudioElement.pause(),setTimeout(()=>{this.silentAudioElement.play()},500)},500)}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){this.canvasInterval&&clearInterval(this.canvasInterval);const t=document.createElement("canvas");t.width=40,t.height=30;const e=t.getContext("2d");this.canvasInterval=setInterval(()=>(e.fillStyle="#"+(16777216+16777215*Math.random()).toString(16).substr(1,6),e.fillRect(0,0,t.width,t.height),t),1e3);return t.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){this.silentAudioElement.loop=!0,this.silentAudioElement.volume=1;const t=(t=>{const e=t.indexOf(";base64,")+";base64,".length,n=t.substring(e),r=window.atob(n),i=r.length,V=new Uint8Array(new ArrayBuffer(i));for(let t=0;t<i;t++)V[t]=r.charCodeAt(t);return V})(r.audioData),e=new Blob([t],{type:"audio/mpeg"});this.silentAudioElement.src=URL.createObjectURL(e),this.silentAudioElement.play().then().catch(t=>{console.log("UneeQ audio track could not play: ",t)});const n=new window.AudioContext;this.audioContextInstance=n,this.audioSourceDestination=n.createMediaStreamDestination(),this.audioSourceNode=n.createMediaElementSource(this.silentAudioElement),this.audioSourceNode.connect(this.audioSourceDestination),this.audioSourceNode.connect(n.destination)}return this.audioSourceDestination.stream.getAudioTracks()[0]}}e.StreamManager=r,r.audioData="data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU3LjgzLjEwMAAAAAAAAAAAAAAA//tUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAArAABBQAAICA4OFBQaGhogICYmLCwsMjI3Nz09PUNDSUlPT09VVVtbYWFhZmZsbHJycnh4fn6EhISKipCQlpaWm5uhoaenp62ts7O5ubm/v8XFy8vL0NDW1tzc3OLi6Oju7u709Pr6//8AAAAATGF2YzU3LjEwAAAAAAAAAAAAAAAAJAPAAAAAAAAAQUCaftgR//uUZAAP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAETEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceInputManager=void 0;const r=n(81),i=n(151),V=n(63),o=n(99),s=n(37);e.VoiceInputManager=class{constructor(t,e,n,r){this.options=t,this.api=e,this.messages=n,this.enableMicrophone=r,this.microphoneEngageVolume=.02,this.microphoneDisengageVolume=.02,this.voiceActivityNotSpeakingTimeoutMS=1e3,this.voiceActivityAllowInterruptions=!1,this.digitalHumanSpeaking=!1,this.recording=!1,this.setVoiceInputMode(t.voiceInputMode);try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(t){this.audioContextNotSupported()}this.handleAppMessages()}setVoiceInputMode(t){t===o.VoiceInputMode.PUSH_TO_TALK?this.options.voiceInputMode=o.VoiceInputMode.PUSH_TO_TALK:t===o.VoiceInputMode.VOICE_ACTIVITY?this.options.voiceInputMode=o.VoiceInputMode.VOICE_ACTIVITY:this.messages.next(new V.WarningMessage("Invalid voice input mode selected: "+t))}startRecording(){this.options.voiceInputMode===o.VoiceInputMode.PUSH_TO_TALK?this.apiStartRecording():this.requestNotSupportedInVoiceActivityMode("startRecording")}stopRecording(){this.options.voiceInputMode===o.VoiceInputMode.PUSH_TO_TALK?this.apiStopRecording():this.requestNotSupportedInVoiceActivityMode("stopRecording")}handleSessionEnd(){this.soundMeter&&this.soundMeter.stop()}resumeAudioContext(){s.logger.log("UneeQ: resuming publish stream audio context and initializing mic activity."),this.audioContext&&(this.audioContext.resume(),this.stream&&this.initMicActivity(this.stream))}initMicActivity(t){this.stream=t,this.soundMeter=new i.SoundMeter(this.audioContext),this.soundMeter.connectToSource(t,t=>this.micActivityConnected(t))}audioContextNotSupported(){this.options.micActivityMessages&&this.messages.next(new V.MicActivityNotSupportedMessage),this.messages.next(new V.VoiceActivityInputModeNotSupportedMessage),this.setVoiceInputMode(o.VoiceInputMode.PUSH_TO_TALK)}handleAppMessages(){this.messages.subscribe(t=>{switch(t.uneeqMessageType){case V.UneeqMessageType.StartedSpeaking:console.log("StartSpeaking message"),this.digitalHumanSpeaking=!0;break;case V.UneeqMessageType.FinishedSpeaking:this.digitalHumanSpeaking=!1;break;case V.UneeqMessageType.SessionLive:this.options.voiceInputMode===o.VoiceInputMode.VOICE_ACTIVITY&&this.enableMicrophone(!0)}})}requestNotSupportedInVoiceActivityMode(t){this.messages.next(new V.WarningMessage("Request not supported in voice activity mode: "+t))}apiStartRecording(){this.recording=!0,this.messages.next(new V.RecordingStartedMessage),this.api.avatarStartRecording().catch(()=>{this.recording=!1,this.messages.next(new V.RecordingStoppedMessage)})}apiStopRecording(){this.recording=!1,this.api.avatarStopRecording().finally(()=>this.messages.next(new V.RecordingStoppedMessage))}micActivityConnected(t){t?this.messages.next(new V.MicActivityErrorMessage(t)):this.soundMeter&&this.soundMeter.instant$.pipe(r.distinctUntilChanged()).subscribe(t=>{this.handleVoiceActivity(t)})}handleVoiceActivity(t){this.options.micActivityMessages&&this.messages.next(new V.MicActivityMessage(t)),this.options.voiceInputMode!==o.VoiceInputMode.VOICE_ACTIVITY||this.digitalHumanSpeaking&&!this.voiceActivityAllowInterruptions||(t>this.microphoneEngageVolume?(this.recording||this.apiStartRecording(),this.clearSilenceTimeout()):t<this.microphoneDisengageVolume&&this.recording&&(this.clearSilenceTimeout(),this.silenceTimeout=setTimeout(()=>{this.recording&&this.apiStopRecording()},this.voiceActivityNotSpeakingTimeoutMS)))}clearSilenceTimeout(){this.silenceTimeout&&clearTimeout(this.silenceTimeout)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SoundMeter=void 0;const r=n(47),i=n(37);e.SoundMeter=class{constructor(t){this.instant$=new r.BehaviorSubject(0),this.context=t,this.instant=0,this.slow=0,this.clip=0,this.script=t.createScriptProcessor(2048,1,1);const e=this;this.script.onaudioprocess=t=>{const n=t.inputBuffer.getChannelData(0);let r,i=0,V=0;for(r=0;r<n.length;++r)i+=n[r]*n[r],Math.abs(n[r])>.99&&(V+=1);e.instant=Math.sqrt(i/n.length),e.slow=.95*e.slow+.05*e.instant,e.clip=V/n.length,e.instant$.next(parseFloat(e.instant.toFixed(2)))}}connectToSource(t,e){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(t),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==e&&e(null)}catch(t){console.error(t),void 0!==e&&e(t)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SessionType=void 0,function(t){t[t.WEB=0]="WEB"}(e.SessionType||(e.SessionType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceApp=void 0,function(t){t.HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",t.SHOWCASE="SHOWCASE",t.SPLIT_SCREEN="SPLIT_SCREEN",t.INTERACTIONS="INTERACTIONS",t.UNKNOWN="UNKNOWN"}(e.SourceApp||(e.SourceApp={}))},function(t,e,n){"use strict";n.r(e),n.d(e,"Client",(function(){return l})),n.d(e,"FrameImpl",(function(){return V})),n.d(e,"Parser",(function(){return o})),n.d(e,"StompConfig",(function(){return f})),n.d(e,"StompHeaders",(function(){return d})),n.d(e,"StompSubscription",(function(){return p})),n.d(e,"StompSocketState",(function(){return s})),n.d(e,"ActivationState",(function(){return a})),n.d(e,"Versions",(function(){return c})),n.d(e,"CompatClient",(function(){return v})),n.d(e,"Stomp",(function(){return y}));const r="\n",i="\0";class V{constructor(t){const{command:e,headers:n,body:r,binaryBody:i,escapeHeaderValues:V,skipContentLengthHeader:o}=t;this.command=e,this.headers=Object.assign({},n||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=r||"",this.isBinaryBody=!1),this.escapeHeaderValues=V||!1,this.skipContentLengthHeader=o||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}static fromRawFrame(t,e){const n={},r=t=>t.replace(/^\s+|\s+$/g,"");for(const i of t.headers.reverse()){i.indexOf(":");const o=r(i[0]);let s=r(i[1]);e&&"CONNECT"!==t.command&&"CONNECTED"!==t.command&&(s=V.hdrValueUnEscape(s)),n[o]=s}return new V({command:t.command,headers:n,binaryBody:t.binaryBody,escapeHeaderValues:e})}toString(){return this.serializeCmdAndHeaders()}serialize(){const t=this.serializeCmdAndHeaders();return this.isBinaryBody?V.toUnit8Array(t,this._binaryBody).buffer:t+this._body+i}serializeCmdAndHeaders(){const t=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const e of Object.keys(this.headers||{})){const n=this.headers[e];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?t.push(`${e}:${V.hdrValueEscape(""+n)}`):t.push(`${e}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&t.push("content-length:"+this.bodyLength()),t.join(r)+r+r}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const t=this.binaryBody;return t?t.length:0}static sizeOfUTF8(t){return t?(new TextEncoder).encode(t).length:0}static toUnit8Array(t,e){const n=(new TextEncoder).encode(t),r=new Uint8Array([0]),i=new Uint8Array(n.length+e.length+r.length);return i.set(n),i.set(e,n.length),i.set(r,n.length+e.length),i}static marshall(t){return new V(t).serialize()}static hdrValueEscape(t){return t.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(t){return t.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}class o{constructor(t,e){this.onFrame=t,this.onIncomingPing=e,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(t,e=!1){let n;if(n=t instanceof ArrayBuffer?new Uint8Array(t):this._encoder.encode(t),e&&0!==n[n.length-1]){const t=new Uint8Array(n.length+1);t.set(n,0),t[n.length]=0,n=t}for(let t=0;t<n.length;t++){const e=n[t];this._onByte(e)}}_collectFrame(t){0!==t&&13!==t&&(10!==t?(this._onByte=this._collectCommand,this._reinjectByte(t)):this.onIncomingPing())}_collectCommand(t){if(13!==t)return 10===t?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(t)}_collectHeaders(t){13!==t&&(10!==t?(this._onByte=this._collectHeaderKey,this._reinjectByte(t)):this._setupCollectBody())}_reinjectByte(t){this._onByte(t)}_collectHeaderKey(t){if(58===t)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(t)}_collectHeaderValue(t){if(13!==t)return 10===t?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(t)}_setupCollectBody(){const t=this._results.headers.filter(t=>"content-length"===t[0])[0];t?(this._bodyBytesRemaining=parseInt(t[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(t){0!==t?this._consumeByte(t):this._retrievedBody()}_collectBodyFixedSize(t){0!=this._bodyBytesRemaining--?this._consumeByte(t):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(t){this._token.push(t)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const t=new Uint8Array(this._token);return this._token=[],t}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var s,a;!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(s||(s={})),function(t){t[t.ACTIVE=0]="ACTIVE",t[t.DEACTIVATING=1]="DEACTIVATING",t[t.INACTIVE=2]="INACTIVE"}(a||(a={}));class c{constructor(t){this.versions=t}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(t=>`v${t.replace(".","")}.stomp`)}}c.V1_0="1.0",c.V1_1="1.1",c.V1_2="1.2",c.default=new c([c.V1_0,c.V1_1,c.V1_2]);class u{constructor(t,e,n={}){this._client=t,this._webSocket=e,this._serverFrameHandlers={CONNECTED:t=>{this.debug("connected to server "+t.headers.server),this._connected=!0,this._connectedVersion=t.headers.version,this._connectedVersion===c.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(t.headers),this.onConnect(t)},MESSAGE:t=>{const e=t.headers.subscription,n=this._subscriptions[e]||this.onUnhandledMessage,r=t,i=this,V=this._connectedVersion===c.V1_2?r.headers.ack:r.headers["message-id"];r.ack=(t={})=>i.ack(V,e,t),r.nack=(t={})=>i.nack(V,e,t),n(r)},RECEIPT:t=>{const e=this._receiptWatchers[t.headers["receipt-id"]];e?(e(t),delete this._receiptWatchers[t.headers["receipt-id"]]):this.onUnhandledReceipt(t)},ERROR:t=>{this.onStompError(t)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(n)}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}configure(t){Object.assign(this,t)}start(){const t=new o(t=>{const e=V.fromRawFrame(t,this._escapeHeaderValues);this.logRawCommunication||this.debug("<<< "+e);(this._serverFrameHandlers[e.command]||this.onUnhandledFrame)(e)},()=>{this.debug("<<< PONG")});this._webSocket.onmessage=e=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const t=e.data instanceof ArrayBuffer?(new TextDecoder).decode(e.data):e.data;this.debug("<<< "+t)}t.parseChunk(e.data,this.appendMissingNULLonIncoming)},this._onclose=t=>{this.debug("Connection closed to "+this._client.brokerURL),this._cleanUp(),this.onWebSocketClose(t)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=t=>{this.onWebSocketError(t)},this._webSocket.onopen=()=>{const t=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),t["accept-version"]=this.stompVersions.supportedVersions(),t["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:t})}}_setupHeartbeat(t){if(t.version!==c.V1_1&&t.version!==c.V1_2)return;if(!t["heart-beat"])return;const[e,n]=t["heart-beat"].split(",").map(t=>parseInt(t,10));if(0!==this.heartbeatOutgoing&&0!==n){const t=Math.max(this.heartbeatOutgoing,n);this.debug(`send PING every ${t}ms`),this._pinger=setInterval(()=>{this._webSocket.readyState===s.OPEN&&(this._webSocket.send(r),this.debug(">>> PING"))},t)}if(0!==this.heartbeatIncoming&&0!==e){const t=Math.max(this.heartbeatIncoming,e);this.debug(`check PONG every ${t}ms`),this._ponger=setInterval(()=>{const e=Date.now()-this._lastServerActivityTS;e>2*t&&(this.debug(`did not receive server activity for the last ${e}ms`),this._closeOrDiscardWebsocket())},t)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this._discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}_discardWebsocket(){var t,e;this._webSocket.terminate||(t=this._webSocket,e=t=>this.debug(t),t.terminate=function(){const t=()=>{};this.onerror=t,this.onmessage=t,this.onopen=t;const n=new Date,r=this.onclose;this.onclose=t=>{const r=(new Date).getTime()-n.getTime();e(`Discarded socket closed after ${r}ms, with code/reason: ${t.code}/${t.reason}`)},this.close(),r.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(t){const{command:e,headers:n,body:r,binaryBody:i,skipContentLengthHeader:o}=t,s=new V({command:e,headers:n,body:r,binaryBody:i,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:o});let a=s.serialize();if(this.logRawCommunication?this.debug(">>> "+a):this.debug(">>> "+s),this.forceBinaryWSFrames&&"string"==typeof a&&(a=(new TextEncoder).encode(a)),"string"==typeof a&&this.splitLargeFrames){let t=a;for(;t.length>0;){const e=t.substring(0,this.maxWebSocketChunkSize);t=t.substring(this.maxWebSocketChunkSize),this._webSocket.send(e),this.debug(`chunk sent = ${e.length}, remaining = ${t.length}`)}}else this._webSocket.send(a)}dispose(){if(this.connected)try{const t=Object.assign({},this.disconnectHeaders);t.receipt||(t.receipt="close-"+this._counter++),this.watchForReceipt(t.receipt,t=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(t)}),this._transmit({command:"DISCONNECT",headers:t})}catch(t){this.debug("Ignoring error during disconnect "+t)}else this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)}publish(t){const{destination:e,headers:n,body:r,binaryBody:i,skipContentLengthHeader:V}=t,o=Object.assign({destination:e},n);this._transmit({command:"SEND",headers:o,body:r,binaryBody:i,skipContentLengthHeader:V})}watchForReceipt(t,e){this._receiptWatchers[t]=e}subscribe(t,e,n={}){(n=Object.assign({},n)).id||(n.id="sub-"+this._counter++),n.destination=t,this._subscriptions[n.id]=e,this._transmit({command:"SUBSCRIBE",headers:n});const r=this;return{id:n.id,unsubscribe:t=>r.unsubscribe(n.id,t)}}unsubscribe(t,e={}){e=Object.assign({},e),delete this._subscriptions[t],e.id=t,this._transmit({command:"UNSUBSCRIBE",headers:e})}begin(t){const e=t||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:e}});const n=this;return{id:e,commit(){n.commit(e)},abort(){n.abort(e)}}}commit(t){this._transmit({command:"COMMIT",headers:{transaction:t}})}abort(t){this._transmit({command:"ABORT",headers:{transaction:t}})}ack(t,e,n={}){n=Object.assign({},n),this._connectedVersion===c.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"ACK",headers:n})}nack(t,e,n={}){return n=Object.assign({},n),this._connectedVersion===c.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"NACK",headers:n})}}var h=function(t,e,n,r){return new(n||(n=Promise))((function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}a((r=r.apply(t,e||[])).next())}))};class l{constructor(t={}){this.stompVersions=c.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.state=a.INACTIVE;const e=()=>{};this.debug=e,this.beforeConnect=e,this.onConnect=e,this.onDisconnect=e,this.onUnhandledMessage=e,this.onUnhandledReceipt=e,this.onUnhandledFrame=e,this.onStompError=e,this.onWebSocketClose=e,this.onWebSocketError=e,this.logRawCommunication=!1,this.onChangeState=e,this.connectHeaders={},this._disconnectHeaders={},this.configure(t)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(t){this._disconnectHeaders=t,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===a.ACTIVE}_changeState(t){this.state=t,this.onChangeState(t)}configure(t){Object.assign(this,t)}activate(){if(this.state===a.DEACTIVATING)throw this.debug("Still DEACTIVATING, please await call to deactivate before trying to re-activate"),new Error("Still DEACTIVATING, can not activate now");this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(a.ACTIVE),this._connect())}_connect(){return h(this,void 0,void 0,(function*(){if(this.connected)return void this.debug("STOMP: already connected, nothing to do");if(yield this.beforeConnect(),!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout(()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())},this.connectionTimeout)),this.debug("Opening Web Socket...");const t=this._createWebSocket();this._stompHandler=new u(this,t,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:t=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(t)},onDisconnect:t=>{this.onDisconnect(t)},onStompError:t=>{this.onStompError(t)},onWebSocketClose:t=>{this._stompHandler=void 0,this.state===a.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(a.INACTIVE)),this.onWebSocketClose(t),this.active&&this._schedule_reconnect()},onWebSocketError:t=>{this.onWebSocketError(t)},onUnhandledMessage:t=>{this.onUnhandledMessage(t)},onUnhandledReceipt:t=>{this.onUnhandledReceipt(t)},onUnhandledFrame:t=>{this.onUnhandledFrame(t)}}),this._stompHandler.start()}))}_createWebSocket(){let t;return t=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions()),t.binaryType="arraybuffer",t}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout(()=>{this._connect()},this.reconnectDelay))}deactivate(){return h(this,void 0,void 0,(function*(){let t;return this.state!==a.ACTIVE?(this.debug(`Already ${a[this.state]}, ignoring call to deactivate`),Promise.resolve()):(this._changeState(a.DEACTIVATING),this._reconnector&&clearTimeout(this._reconnector),this._stompHandler&&this.webSocket.readyState!==s.CLOSED?(t=new Promise((t,e)=>{this._resolveSocketClose=t}),this._disposeStompHandler(),t):(this._changeState(a.INACTIVE),Promise.resolve()))}))}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(t){this._stompHandler.publish(t)}watchForReceipt(t,e){this._stompHandler.watchForReceipt(t,e)}subscribe(t,e,n={}){return this._stompHandler.subscribe(t,e,n)}unsubscribe(t,e={}){this._stompHandler.unsubscribe(t,e)}begin(t){return this._stompHandler.begin(t)}commit(t){this._stompHandler.commit(t)}abort(t){this._stompHandler.abort(t)}ack(t,e,n={}){this._stompHandler.ack(t,e,n)}nack(t,e,n={}){this._stompHandler.nack(t,e,n)}}class f{}class d{}class p{}class g{constructor(t){this.client=t}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(t){this.client.heartbeatOutgoing=t}get incoming(){return this.client.heartbeatIncoming}set incoming(t){this.client.heartbeatIncoming=t}}class v extends l{constructor(t){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new g(this),this.reconnect_delay=0,this.webSocketFactory=t,this.debug=(...t)=>{console.log(...t)}}_parseConnect(...t){let e,n,r,i={};if(t.length<2)throw new Error("Connect requires at least 2 arguments");if("function"==typeof t[1])[i,n,r,e]=t;else switch(t.length){case 6:[i.login,i.passcode,n,r,e,i.host]=t;break;default:[i.login,i.passcode,n,r,e]=t}return[i,n,r,e]}connect(...t){const e=this._parseConnect(...t);e[0]&&(this.connectHeaders=e[0]),e[1]&&(this.onConnect=e[1]),e[2]&&(this.onStompError=e[2]),e[3]&&(this.onWebSocketClose=e[3]),super.activate()}disconnect(t,e={}){t&&(this.onDisconnect=t),this.disconnectHeaders=e,super.deactivate()}send(t,e={},n=""){const r=!1===(e=Object.assign({},e))["content-length"];r&&delete e["content-length"],this.publish({destination:t,headers:e,body:n,skipContentLengthHeader:r})}set reconnect_delay(t){this.reconnectDelay=t}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(t){this.onUnhandledMessage=t}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(t){this.onUnhandledReceipt=t}get heartbeat(){return this._heartbeatInfo}set heartbeat(t){this.heartbeatIncoming=t.incoming,this.heartbeatOutgoing=t.outgoing}}class y{static client(t,e){null==e&&(e=c.default.protocolVersions());return new v(()=>new(y.WebSocketClass||WebSocket)(t,e))}static over(t){let e;return"function"==typeof t?e=t:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),e=()=>t),new v(e)}}y.WebSocketClass=null}]));
38
+ let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:e):t=>(n||(n=Promise.resolve())).then(t).catch(t=>setTimeout(()=>{throw t},0))}).call(this,n(34))},function(t,e,n){"use strict";function r(t,e){for(const n in e)Object.defineProperty(t,n,{value:e[n],enumerable:!0,configurable:!0});return t}t.exports=function(t,e,n){if(!t||"string"==typeof t)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof e&&(n=e,e=""),e&&(n.code=e);try{return r(t,n)}catch(e){n.message=t.message,n.stack=t.stack;const i=function(){};i.prototype=Object.create(Object.getPrototypeOf(t));return r(new i,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DigitalHumanVideoPlayManager=void 0;const r=n(63),i=n(35);e.DigitalHumanVideoPlayManager=class{constructor(t,e){this.messages=t,this.publicUnmuteDigitalHumanMethod=e,this.remoteVideoPlayCount=0}play(t){this.video=t,this.playRemoteVideo()}unmuteVideo(){this.video&&this.video.muted&&(this.video.muted=!1,this.messages.next(new r.DigitalHumanUnmuted))}playRemoteVideo(){this.video&&(this.video.onerror=t=>{this.messages.next(new r.DigitalHumanVideoError(t))},this.video.play().catch(()=>{this.messages.next(new r.DigitalHumanFailedToPlay),this.video.muted=!0,this.video.play().then(()=>{i.logger.log("Muting the digital human and playing it succeeded."),this.messages.next(new r.DigitalHumanPlayedInMutedModeSuccess),this.video.addEventListener("click",()=>{this.publicUnmuteDigitalHumanMethod()},{once:!0})}).catch(t=>{i.logger.log("Could not play digital human video even as muted, starting exponential backoff.",t),this.playRemoteVideoWithExponentialBackoff()})}))}playRemoteVideoWithExponentialBackoff(){this.video&&(this.video.autoplay=!0,this.video.play(),this.remoteVideoPlayCount++,setTimeout(()=>{this.remoteVideoPlayCount<10&&this.playRemoteVideoWithExponentialBackoff()},100*(this.remoteVideoPlayCount-1)))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;const r=n(37),i=n(80);e.MessageHandler=class{constructor(t,e){this.internalMessages$=t,this.messages=e,this.deviceManager={getDevices:(t,e)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe(t=>{const e={type:i.PromMessageType.QuestionMessageReceived,value:{id:t.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new r.AvatarQuestionMessage(t.question,t.id))}),this.getMessagesOfType("AvatarAnswerText").subscribe(t=>{const e={type:i.PromMessageType.AnswerMessageReceived,value:{id:t.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new r.AvatarAnswerMessage(t.answer,t.answerAvatar,t.answerSpeech,t.questionId))}),this.getMessagesOfType("AvatarAnswerHTML").subscribe(t=>{this.messages.next(new r.AvatarAnswerContentMessage(t.html,t.messageId,t.hasDisplayHtml)),this.messages.next(new r.InstructionsMessage(t.instructions))}),this.getMessagesOfType("AvatarTextInputStarted").subscribe(t=>this.messages.next(new r.StartedSpeakingMessage)),this.getMessagesOfType("AvatarTextInputFinished").subscribe(t=>{this.messages.next(new r.FinishedSpeakingMessage),this.messages.next(new r.AvatarTextInputFinishedMessage)}),this.getMessagesOfType("AvatarStarting").subscribe(t=>{this.deviceManager.edgeNodeId=t.edgeNodeId}),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe(t=>{this.messages.next(new r.ClientMediaStreamUpdateMessage(t.clientStreamingAudio,t.clientStreamingVideo,t.serverStreamingAudio,t.serverStreamingVideo)),t.clientStreamingAudio&&t.clientStreamingVideo&&t.serverStreamingAudio&&t.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))}),this.getMessagesOfType("SessionErrorMessage").subscribe(t=>{console.error(t.error),this.messages.next(new r.SessionErrorMessage(t.error))}),this.getMessagesOfType("SessionInfoMessage").subscribe(t=>{this.messages.next(new r.SessionInfoMessage(t.info))}),this.getMessagesOfType("SessionEndedMessage").subscribe(()=>{const t={type:i.PromMessageType.SessionEnded,value:{receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.internalMessages$.next({faceMeMessageType:"sessionEnd"})}),this.getMessagesOfType("AvatarRequestCompleted").subscribe(t=>{this.messages.next(new r.AvatarRequestCompleted(t.reason))}),this.getMessagesOfType("AvatarRequestIgnored").subscribe(t=>{this.messages.next(new r.AvatarRequestIgnored(t.reason))})}setDeviceManager(t){this.deviceManager=t}getMessagesOfType(t){return this.internalMessages$.filter(e=>e.faceMeMessageType===t)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={};e.default=void 0;var i=n(135),V=n(139);Object.keys(V).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(r,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return V[t]}}))}));e.default=function(){return new i.Registry}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Registry=void 0;var r=n(64),i=n(95),V=n(137),o=n(138),s=n(97);function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=void 0,(n="data")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.data={counter:{},gauge:{},histogram:{}}}var e,n,c;return e=t,(n=[{key:"validateInput",value:function(t,e,n,i){if(""===String(e))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(t))throw new Error("Unknown metric type ".concat(t));if("string"!=typeof n&&null!=n)throw new Error("help must be string or undefined/null");if((0,r.has)(this.data,"".concat(t,".").concat(e)))throw new Error("A metric with the name '".concat(e,"' already exists for type '").concat(t,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(t,e,r,s),"counter"===t?(n=new i.Counter,this.data.counter[e]={help:r,instance:n,type:t}):"gauge"===t?(n=new V.Gauge,this.data.gauge[e]={help:r,instance:n,type:t}):(n=new o.Histogram(s),this.data.histogram[e]={help:r,instance:n,type:t}),n}},{key:"metrics",value:function(){return(0,r.reduce)(this.data,(function(t,e,n){return t+(0,r.reduce)(e,(function(t,e,i){var V=e.instance.collect(),o=t;return e.help.length>0&&(o+="# HELP ".concat(i," ").concat(e.help,"\n")),o+="# TYPE ".concat(i," ").concat(n,"\n"),o+=(0,r.reduce)(V,(function(t,e){return t+("histogram"===n?(0,s.formatHistogramOrSummary)(i,e):(0,s.formatCounterOrGauge)(i,e))}),"")}),"")}),"")}},{key:"reset",value:function(){return(0,r.each)(this.data,(function(t){(0,r.each)(t,(function(t){t.instance.resetAll()}))})),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(t,e){var n=(null!=t?[this.data[t]]:(0,r.valuesIn)(this.data)).find((function(t){return(0,r.has)(t,e)}));return null!=n?n[e].instance:void 0}}])&&a(e.prototype,n),c&&a(e,c),t}();e.Registry=c},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Gauge=void 0;var c=function(t){function e(){return i(this,e),o(this,s(e).apply(this,arguments))}var n,r,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,t),n=e,(r=[{key:"dec",value:function(t){var e=this.get(t);return this.set(e?e.value-1:0,t),this}},{key:"sub",value:function(t,e){var n=this.get(e);return this.set(n?n.value-t:0,e),this}}])&&V(n.prototype,r),c&&V(n,c),e}(n(95).Counter);e.Gauge=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Histogram=void 0;var r=n(64);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?c(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t){return{entries:(0,r.reduce)(t,(function(t,e){return t[e.toString()]=0,t}),{"+Inf":0}),sum:0,count:0,raw:[]}}var f=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return V(this,e),h(c(t=s(this,a(e).call(this))),"buckets",void 0),t.buckets=n.sort((function(t,e){return t>e?1:-1})),t.set(l(t.buckets)),t.observe=t.observe.bind(c(t)),t}var n,i,f;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(e,t),n=e,(i=[{key:"observe",value:function(t,e){var n=this.get(e);null==n&&(n=this.set(l(this.buckets),e).get(e)),n.value.raw.push(t),n.value.entries["+Inf"]+=1;var i=function(t,e){if(e<t[t.length-1])for(var n=0;n<t.length;n+=1)if(e<=t[n])return n}(this.buckets,t);if(null!=i)for(var V=i;V<this.buckets.length;V+=1){var o=n.value.entries[this.buckets[V].toString()];n.value.entries[this.buckets[V].toString()]=o+1}return n.value.sum=(0,r.sum)(n.value.raw),n.value.count+=1,this}},{key:"reset",value:function(t){this.set(l(this.buckets),t)}}])&&o(n.prototype,i),f&&o(n,f),e}(n(96).Collector);e.Histogram=f},function(t,e,n){},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingState=e.MessagingService=void 0;const r=n(141);Object.defineProperty(e,"MessagingService",{enumerable:!0,get:function(){return r.MessagingService}});const i=n(98);Object.defineProperty(e,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingService=void 0;const r=n(155),i=n(142),V=n(144),o=n(35),s=n(98);e.MessagingService=class{constructor(t,e){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=t,this.options=Object.assign(this.options,e),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(s.MessagingState.DISCONNECTED),this.messages$=new V.Subject,console.log("connect headers messaging: ",this.options.connectionHeaders);const n={connectHeaders:this.options.connectionHeaders,reconnectDelay:0,connectionTimeout:5e3,discardWebsocketOnCommFailure:!0,brokerURL:this.url.replace("https://","wss://").replace("http://","ws://")};this.stompClient=new r.Client(n),this.stompClient.onConnect=t=>this.onStompConnected(t),this.stompClient.onDisconnect=t=>{o.logger.log("Stomp client disconnected",t)},this.stompClient.onStompError=t=>{o.logger.log("Stomp client error",t),this.onStompClientConnectionClosed(t)},this.stompClient.onWebSocketError=t=>{o.logger.log("Stomp client web socket error",t),this.onStompClientConnectionClosed(t)},this.stompClient.onWebSocketClose=t=>{o.logger.log("Stomp client web socket closed",t),this.onStompClientConnectionClosed(t)}}connect(){this.disconnect(),o.logger.log("MessagingService | connecting..."),this.state$.next(s.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const t=this.state$.getValue();if(t===s.MessagingState.CONNECTED||t===s.MessagingState.CONNECTING){o.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(s.MessagingState.DISCONNECTED)}catch(t){console.error("MessagingService | disconnect: error",t),this.state$.next(s.MessagingState.DISCONNECTED)}}}send(t,e){o.logger.log("MessagingService | send:",t,e);const n={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},r=JSON.stringify(e);this.stompClient.publish({destination:t,body:r,headers:n})}getTopic(t){o.logger.log("MessagingService | subscribeToTopic: "+t);const e=this.subscriptions[t];if(e)return o.logger.log("existing subscription... not re-subscribing to topic"),e;const n=new V.Subject;return this.stompClient.subscribe(t,t=>{n.next(t),this.messages$.next(t)}),this.subscriptions[t]=n,n}onStompConnected(t){o.logger.log("MessagingService | connected"),this.state$.next(s.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(t){this.options.autoReconnect?this.options.maxReconnectAttempts&&this.connectionAttempts<this.options.maxReconnectAttempts?setTimeout(()=>{this.connect()},this.options.reconnectTime):this.options.maxReconnectLimitReached&&(this.options.maxReconnectLimitReached(),this.disconnect()):this.disconnect()}initMessagingSubscription(){o.logger.log("MessagingService | initMessagingSubscription");this.stompClient.subscribe("/",t=>{this.messages$.next(t)})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(143))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(47);e.BehaviorSubject=r.BehaviorSubject},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(145))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(47);e.Subject=r.Subject},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetricsService=void 0;const r=n(37),i=n(147),V=n(80);e.MetricsService=class{constructor(t,e,n){this.uneeqOptions=t,this.internalMessages=e,this.messages=n,this.clientPerformanceStats={},this.options=t,this.internalMessages$=e,this.messages$=n}parseAndLogWebRtcStats(t){try{t.forEach(t=>{var e,n;if("inbound-rtp"===t.type&&"video"===t.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",t.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",t.frameWidth);const r=t.framesDropped,V=r?r-(null===(e=this.clientPerformanceStats.totalFramesDropped)||void 0===e?void 0:e.value):0;this.clientPerformanceStats.newFramesDropped=V?new i.ClientPerformanceStat("New Frames Dropped",V):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=r?new i.ClientPerformanceStat("Total Frames Dropped",r):new i.ClientPerformanceStat;const o=t.packetsLost,s=o?o-(null===(n=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===n?void 0:n.value):0;this.clientPerformanceStats.inboundNewPacketsLost=s?new i.ClientPerformanceStat("New packets lost",s):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=o?new i.ClientPerformanceStat("Total packets lost",o):new i.ClientPerformanceStat;const a=t.framesPerSecond;this.clientPerformanceStats.framesPerSec=a?new i.ClientPerformanceStat("Frames per second",a):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===t.type&&"video"===t.kind){const e=t.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=e?new i.ClientPerformanceStat("Round Trip Time",e):new i.ClientPerformanceStat}else if("outbound-rtp"===t.type&&"video"===t.kind){const e=t.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",e)}}),this.options.enableClientPerformanceMessage&&this.messages$.next(new r.ClientPerformanceMessage(this.clientPerformanceStats));const e={type:V.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e})}catch(t){console.warn("Unable to parseAndLogWebRTCStats",t)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ClientPerformanceStat=void 0;e.ClientPerformanceStat=class{constructor(t="",e=0){this.label=t,this.value=e}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OnlineStatusService=void 0;const r=n(37);e.OnlineStatusService=class{constructor(t,e){this.messages=t,this.offlineTimeoutLimitHandler=e,this.online=!0,this.offlineDisconnectTimeLimitMS=1e4,window.addEventListener("offline",()=>this.handleOffline()),window.addEventListener("online",()=>this.handleOnline())}handleOffline(){this.online=!1,this.disconnectTimer=setTimeout(()=>{this.offlineTimeoutLimitHandler()},this.offlineDisconnectTimeLimitMS),this.sendStatusUpdate()}handleOnline(){this.online=!0,window.clearTimeout(this.disconnectTimer),this.sendStatusUpdate()}sendStatusUpdate(){this.messages.next(new r.OnlineStatusUpdateMessage(this.online))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResumeSessionCheck=void 0;const r=n(35);class i{static validate(t){let e=void 0!==t.resumeSession&&t.resumeSession;localStorage.getItem("uneeqResumeSessionPersonaId")===t.conversationId||(r.logger.log("UneeQ: Persona Id's do not match, unable to resume session."),e=!1);const n=i.browserTabIsActive();if(e&&!n&&(r.logger.log("UneeQ: Browser tab is not active so unable to resume"),e=!1),e){const t=localStorage.getItem("uneeqResumeSessionId");if(null!==t)return{resumeSession:!0,resumeSessionId:t}}return{resumeSession:!1}}static browserTabIsActive(){return!document.hidden}}e.ResumeSessionCheck=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StreamManager=void 0;class r{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioElement=document.createElement("audio"),this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(t){return t.getVideoTracks().forEach(e=>t.removeTrack(e)),t.addTrack(this.canvasVideoTrack),t}addSilentAudioTrackToStream(t){return t.getAudioTracks().forEach(e=>t.removeTrack(e)),t.addTrack(this.silentAudioTrack),t}remoteVideoReadyToPlay(){null!==this.silentAudioElement&&setTimeout(()=>{this.silentAudioElement.pause(),setTimeout(()=>{this.silentAudioElement.play()},500)},500)}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){this.canvasInterval&&clearInterval(this.canvasInterval);const t=document.createElement("canvas");t.width=40,t.height=30;const e=t.getContext("2d");this.canvasInterval=setInterval(()=>(e.fillStyle="#"+(16777216+16777215*Math.random()).toString(16).substr(1,6),e.fillRect(0,0,t.width,t.height),t),1e3);return t.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){this.silentAudioElement.loop=!0,this.silentAudioElement.volume=1;const t=(t=>{const e=t.indexOf(";base64,")+";base64,".length,n=t.substring(e),r=window.atob(n),i=r.length,V=new Uint8Array(new ArrayBuffer(i));for(let t=0;t<i;t++)V[t]=r.charCodeAt(t);return V})(r.audioData),e=new Blob([t],{type:"audio/mpeg"});this.silentAudioElement.src=URL.createObjectURL(e),this.silentAudioElement.play().then().catch(t=>{console.log("UneeQ audio track could not play: ",t)});const n=new window.AudioContext;this.audioContextInstance=n,this.audioSourceDestination=n.createMediaStreamDestination(),this.audioSourceNode=n.createMediaElementSource(this.silentAudioElement),this.audioSourceNode.connect(this.audioSourceDestination),this.audioSourceNode.connect(n.destination)}return this.audioSourceDestination.stream.getAudioTracks()[0]}}e.StreamManager=r,r.audioData="data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU3LjgzLjEwMAAAAAAAAAAAAAAA//tUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAArAABBQAAICA4OFBQaGhogICYmLCwsMjI3Nz09PUNDSUlPT09VVVtbYWFhZmZsbHJycnh4fn6EhISKipCQlpaWm5uhoaenp62ts7O5ubm/v8XFy8vL0NDW1tzc3OLi6Oju7u709Pr6//8AAAAATGF2YzU3LjEwAAAAAAAAAAAAAAAAJAPAAAAAAAAAQUCaftgR//uUZAAP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAETEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceInputManager=void 0;const r=n(81),i=n(152),V=n(63),o=n(99),s=n(35);e.VoiceInputManager=class{constructor(t,e,n,r){this.options=t,this.api=e,this.messages=n,this.enableMicrophone=r,this.microphoneEngageVolume=.02,this.microphoneDisengageVolume=.02,this.voiceActivityNotSpeakingTimeoutMS=1e3,this.voiceActivityAllowInterruptions=!1,this.digitalHumanSpeaking=!1,this.recording=!1,this.setVoiceInputMode(t.voiceInputMode);try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(t){this.audioContextNotSupported()}this.handleAppMessages()}setVoiceInputMode(t){t===o.VoiceInputMode.PUSH_TO_TALK?this.options.voiceInputMode=o.VoiceInputMode.PUSH_TO_TALK:t===o.VoiceInputMode.VOICE_ACTIVITY?this.options.voiceInputMode=o.VoiceInputMode.VOICE_ACTIVITY:this.messages.next(new V.WarningMessage("Invalid voice input mode selected: "+t))}startRecording(){this.options.voiceInputMode===o.VoiceInputMode.PUSH_TO_TALK?this.apiStartRecording():this.requestNotSupportedInVoiceActivityMode("startRecording")}stopRecording(){this.options.voiceInputMode===o.VoiceInputMode.PUSH_TO_TALK?this.apiStopRecording():this.requestNotSupportedInVoiceActivityMode("stopRecording")}handleSessionEnd(){this.soundMeter&&this.soundMeter.stop()}resumeAudioContext(){s.logger.log("UneeQ: resuming publish stream audio context and initializing mic activity."),this.audioContext&&(this.audioContext.resume(),this.stream&&this.initMicActivity(this.stream))}initMicActivity(t){this.stream=t,this.soundMeter=new i.SoundMeter(this.audioContext),this.soundMeter.connectToSource(t,t=>this.micActivityConnected(t))}audioContextNotSupported(){this.options.micActivityMessages&&this.messages.next(new V.MicActivityNotSupportedMessage),this.messages.next(new V.VoiceActivityInputModeNotSupportedMessage),this.setVoiceInputMode(o.VoiceInputMode.PUSH_TO_TALK)}handleAppMessages(){this.messages.subscribe(t=>{switch(t.uneeqMessageType){case V.UneeqMessageType.StartedSpeaking:console.log("StartSpeaking message"),this.digitalHumanSpeaking=!0;break;case V.UneeqMessageType.FinishedSpeaking:this.digitalHumanSpeaking=!1;break;case V.UneeqMessageType.SessionLive:this.options.voiceInputMode===o.VoiceInputMode.VOICE_ACTIVITY&&this.enableMicrophone(!0)}})}requestNotSupportedInVoiceActivityMode(t){this.messages.next(new V.WarningMessage("Request not supported in voice activity mode: "+t))}apiStartRecording(){this.recording=!0,this.messages.next(new V.RecordingStartedMessage),this.api.avatarStartRecording().catch(()=>{this.recording=!1,this.messages.next(new V.RecordingStoppedMessage)})}apiStopRecording(){this.recording=!1,this.api.avatarStopRecording().finally(()=>this.messages.next(new V.RecordingStoppedMessage))}micActivityConnected(t){t?this.messages.next(new V.MicActivityErrorMessage(t)):this.soundMeter&&this.soundMeter.instant$.pipe(r.distinctUntilChanged()).subscribe(t=>{this.handleVoiceActivity(t)})}handleVoiceActivity(t){this.options.micActivityMessages&&this.messages.next(new V.MicActivityMessage(t)),this.options.voiceInputMode!==o.VoiceInputMode.VOICE_ACTIVITY||this.digitalHumanSpeaking&&!this.voiceActivityAllowInterruptions||(t>this.microphoneEngageVolume?(this.recording||this.apiStartRecording(),this.clearSilenceTimeout()):t<this.microphoneDisengageVolume&&this.recording&&(this.clearSilenceTimeout(),this.silenceTimeout=setTimeout(()=>{this.recording&&this.apiStopRecording()},this.voiceActivityNotSpeakingTimeoutMS)))}clearSilenceTimeout(){this.silenceTimeout&&clearTimeout(this.silenceTimeout)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SoundMeter=void 0;const r=n(47),i=n(35);e.SoundMeter=class{constructor(t){this.instant$=new r.BehaviorSubject(0),this.context=t,this.instant=0,this.slow=0,this.clip=0,this.script=t.createScriptProcessor(2048,1,1);const e=this;this.script.onaudioprocess=t=>{const n=t.inputBuffer.getChannelData(0);let r,i=0,V=0;for(r=0;r<n.length;++r)i+=n[r]*n[r],Math.abs(n[r])>.99&&(V+=1);e.instant=Math.sqrt(i/n.length),e.slow=.95*e.slow+.05*e.instant,e.clip=V/n.length,e.instant$.next(parseFloat(e.instant.toFixed(2)))}}connectToSource(t,e){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(t),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==e&&e(null)}catch(t){console.error(t),void 0!==e&&e(t)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SessionType=void 0,function(t){t[t.WEB=0]="WEB"}(e.SessionType||(e.SessionType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceApp=void 0,function(t){t.HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",t.SHOWCASE="SHOWCASE",t.SPLIT_SCREEN="SPLIT_SCREEN",t.INTERACTIONS="INTERACTIONS",t.UNKNOWN="UNKNOWN"}(e.SourceApp||(e.SourceApp={}))},function(t,e,n){"use strict";n.r(e),n.d(e,"Client",(function(){return l})),n.d(e,"FrameImpl",(function(){return V})),n.d(e,"Parser",(function(){return o})),n.d(e,"StompConfig",(function(){return f})),n.d(e,"StompHeaders",(function(){return d})),n.d(e,"StompSubscription",(function(){return p})),n.d(e,"StompSocketState",(function(){return s})),n.d(e,"ActivationState",(function(){return a})),n.d(e,"Versions",(function(){return c})),n.d(e,"CompatClient",(function(){return v})),n.d(e,"Stomp",(function(){return m}));const r="\n",i="\0";class V{constructor(t){const{command:e,headers:n,body:r,binaryBody:i,escapeHeaderValues:V,skipContentLengthHeader:o}=t;this.command=e,this.headers=Object.assign({},n||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=r||"",this.isBinaryBody=!1),this.escapeHeaderValues=V||!1,this.skipContentLengthHeader=o||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}static fromRawFrame(t,e){const n={},r=t=>t.replace(/^\s+|\s+$/g,"");for(const i of t.headers.reverse()){i.indexOf(":");const o=r(i[0]);let s=r(i[1]);e&&"CONNECT"!==t.command&&"CONNECTED"!==t.command&&(s=V.hdrValueUnEscape(s)),n[o]=s}return new V({command:t.command,headers:n,binaryBody:t.binaryBody,escapeHeaderValues:e})}toString(){return this.serializeCmdAndHeaders()}serialize(){const t=this.serializeCmdAndHeaders();return this.isBinaryBody?V.toUnit8Array(t,this._binaryBody).buffer:t+this._body+i}serializeCmdAndHeaders(){const t=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const e of Object.keys(this.headers||{})){const n=this.headers[e];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?t.push(`${e}:${V.hdrValueEscape(""+n)}`):t.push(`${e}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&t.push("content-length:"+this.bodyLength()),t.join(r)+r+r}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const t=this.binaryBody;return t?t.length:0}static sizeOfUTF8(t){return t?(new TextEncoder).encode(t).length:0}static toUnit8Array(t,e){const n=(new TextEncoder).encode(t),r=new Uint8Array([0]),i=new Uint8Array(n.length+e.length+r.length);return i.set(n),i.set(e,n.length),i.set(r,n.length+e.length),i}static marshall(t){return new V(t).serialize()}static hdrValueEscape(t){return t.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(t){return t.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}class o{constructor(t,e){this.onFrame=t,this.onIncomingPing=e,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(t,e=!1){let n;if(n=t instanceof ArrayBuffer?new Uint8Array(t):this._encoder.encode(t),e&&0!==n[n.length-1]){const t=new Uint8Array(n.length+1);t.set(n,0),t[n.length]=0,n=t}for(let t=0;t<n.length;t++){const e=n[t];this._onByte(e)}}_collectFrame(t){0!==t&&13!==t&&(10!==t?(this._onByte=this._collectCommand,this._reinjectByte(t)):this.onIncomingPing())}_collectCommand(t){if(13!==t)return 10===t?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(t)}_collectHeaders(t){13!==t&&(10!==t?(this._onByte=this._collectHeaderKey,this._reinjectByte(t)):this._setupCollectBody())}_reinjectByte(t){this._onByte(t)}_collectHeaderKey(t){if(58===t)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(t)}_collectHeaderValue(t){if(13!==t)return 10===t?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(t)}_setupCollectBody(){const t=this._results.headers.filter(t=>"content-length"===t[0])[0];t?(this._bodyBytesRemaining=parseInt(t[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(t){0!==t?this._consumeByte(t):this._retrievedBody()}_collectBodyFixedSize(t){0!=this._bodyBytesRemaining--?this._consumeByte(t):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(t){this._token.push(t)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const t=new Uint8Array(this._token);return this._token=[],t}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var s,a;!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(s||(s={})),function(t){t[t.ACTIVE=0]="ACTIVE",t[t.DEACTIVATING=1]="DEACTIVATING",t[t.INACTIVE=2]="INACTIVE"}(a||(a={}));class c{constructor(t){this.versions=t}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(t=>`v${t.replace(".","")}.stomp`)}}c.V1_0="1.0",c.V1_1="1.1",c.V1_2="1.2",c.default=new c([c.V1_0,c.V1_1,c.V1_2]);class u{constructor(t,e,n={}){this._client=t,this._webSocket=e,this._serverFrameHandlers={CONNECTED:t=>{this.debug("connected to server "+t.headers.server),this._connected=!0,this._connectedVersion=t.headers.version,this._connectedVersion===c.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(t.headers),this.onConnect(t)},MESSAGE:t=>{const e=t.headers.subscription,n=this._subscriptions[e]||this.onUnhandledMessage,r=t,i=this,V=this._connectedVersion===c.V1_2?r.headers.ack:r.headers["message-id"];r.ack=(t={})=>i.ack(V,e,t),r.nack=(t={})=>i.nack(V,e,t),n(r)},RECEIPT:t=>{const e=this._receiptWatchers[t.headers["receipt-id"]];e?(e(t),delete this._receiptWatchers[t.headers["receipt-id"]]):this.onUnhandledReceipt(t)},ERROR:t=>{this.onStompError(t)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(n)}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}configure(t){Object.assign(this,t)}start(){const t=new o(t=>{const e=V.fromRawFrame(t,this._escapeHeaderValues);this.logRawCommunication||this.debug("<<< "+e);(this._serverFrameHandlers[e.command]||this.onUnhandledFrame)(e)},()=>{this.debug("<<< PONG")});this._webSocket.onmessage=e=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const t=e.data instanceof ArrayBuffer?(new TextDecoder).decode(e.data):e.data;this.debug("<<< "+t)}t.parseChunk(e.data,this.appendMissingNULLonIncoming)},this._onclose=t=>{this.debug("Connection closed to "+this._client.brokerURL),this._cleanUp(),this.onWebSocketClose(t)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=t=>{this.onWebSocketError(t)},this._webSocket.onopen=()=>{const t=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),t["accept-version"]=this.stompVersions.supportedVersions(),t["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:t})}}_setupHeartbeat(t){if(t.version!==c.V1_1&&t.version!==c.V1_2)return;if(!t["heart-beat"])return;const[e,n]=t["heart-beat"].split(",").map(t=>parseInt(t,10));if(0!==this.heartbeatOutgoing&&0!==n){const t=Math.max(this.heartbeatOutgoing,n);this.debug(`send PING every ${t}ms`),this._pinger=setInterval(()=>{this._webSocket.readyState===s.OPEN&&(this._webSocket.send(r),this.debug(">>> PING"))},t)}if(0!==this.heartbeatIncoming&&0!==e){const t=Math.max(this.heartbeatIncoming,e);this.debug(`check PONG every ${t}ms`),this._ponger=setInterval(()=>{const e=Date.now()-this._lastServerActivityTS;e>2*t&&(this.debug(`did not receive server activity for the last ${e}ms`),this._closeOrDiscardWebsocket())},t)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this._discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}_discardWebsocket(){var t,e;this._webSocket.terminate||(t=this._webSocket,e=t=>this.debug(t),t.terminate=function(){const t=()=>{};this.onerror=t,this.onmessage=t,this.onopen=t;const n=new Date,r=this.onclose;this.onclose=t=>{const r=(new Date).getTime()-n.getTime();e(`Discarded socket closed after ${r}ms, with code/reason: ${t.code}/${t.reason}`)},this.close(),r.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(t){const{command:e,headers:n,body:r,binaryBody:i,skipContentLengthHeader:o}=t,s=new V({command:e,headers:n,body:r,binaryBody:i,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:o});let a=s.serialize();if(this.logRawCommunication?this.debug(">>> "+a):this.debug(">>> "+s),this.forceBinaryWSFrames&&"string"==typeof a&&(a=(new TextEncoder).encode(a)),"string"==typeof a&&this.splitLargeFrames){let t=a;for(;t.length>0;){const e=t.substring(0,this.maxWebSocketChunkSize);t=t.substring(this.maxWebSocketChunkSize),this._webSocket.send(e),this.debug(`chunk sent = ${e.length}, remaining = ${t.length}`)}}else this._webSocket.send(a)}dispose(){if(this.connected)try{const t=Object.assign({},this.disconnectHeaders);t.receipt||(t.receipt="close-"+this._counter++),this.watchForReceipt(t.receipt,t=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(t)}),this._transmit({command:"DISCONNECT",headers:t})}catch(t){this.debug("Ignoring error during disconnect "+t)}else this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)}publish(t){const{destination:e,headers:n,body:r,binaryBody:i,skipContentLengthHeader:V}=t,o=Object.assign({destination:e},n);this._transmit({command:"SEND",headers:o,body:r,binaryBody:i,skipContentLengthHeader:V})}watchForReceipt(t,e){this._receiptWatchers[t]=e}subscribe(t,e,n={}){(n=Object.assign({},n)).id||(n.id="sub-"+this._counter++),n.destination=t,this._subscriptions[n.id]=e,this._transmit({command:"SUBSCRIBE",headers:n});const r=this;return{id:n.id,unsubscribe:t=>r.unsubscribe(n.id,t)}}unsubscribe(t,e={}){e=Object.assign({},e),delete this._subscriptions[t],e.id=t,this._transmit({command:"UNSUBSCRIBE",headers:e})}begin(t){const e=t||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:e}});const n=this;return{id:e,commit(){n.commit(e)},abort(){n.abort(e)}}}commit(t){this._transmit({command:"COMMIT",headers:{transaction:t}})}abort(t){this._transmit({command:"ABORT",headers:{transaction:t}})}ack(t,e,n={}){n=Object.assign({},n),this._connectedVersion===c.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"ACK",headers:n})}nack(t,e,n={}){return n=Object.assign({},n),this._connectedVersion===c.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"NACK",headers:n})}}var h=function(t,e,n,r){return new(n||(n=Promise))((function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}a((r=r.apply(t,e||[])).next())}))};class l{constructor(t={}){this.stompVersions=c.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.state=a.INACTIVE;const e=()=>{};this.debug=e,this.beforeConnect=e,this.onConnect=e,this.onDisconnect=e,this.onUnhandledMessage=e,this.onUnhandledReceipt=e,this.onUnhandledFrame=e,this.onStompError=e,this.onWebSocketClose=e,this.onWebSocketError=e,this.logRawCommunication=!1,this.onChangeState=e,this.connectHeaders={},this._disconnectHeaders={},this.configure(t)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(t){this._disconnectHeaders=t,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===a.ACTIVE}_changeState(t){this.state=t,this.onChangeState(t)}configure(t){Object.assign(this,t)}activate(){if(this.state===a.DEACTIVATING)throw this.debug("Still DEACTIVATING, please await call to deactivate before trying to re-activate"),new Error("Still DEACTIVATING, can not activate now");this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(a.ACTIVE),this._connect())}_connect(){return h(this,void 0,void 0,(function*(){if(this.connected)return void this.debug("STOMP: already connected, nothing to do");if(yield this.beforeConnect(),!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout(()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())},this.connectionTimeout)),this.debug("Opening Web Socket...");const t=this._createWebSocket();this._stompHandler=new u(this,t,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:t=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(t)},onDisconnect:t=>{this.onDisconnect(t)},onStompError:t=>{this.onStompError(t)},onWebSocketClose:t=>{this._stompHandler=void 0,this.state===a.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(a.INACTIVE)),this.onWebSocketClose(t),this.active&&this._schedule_reconnect()},onWebSocketError:t=>{this.onWebSocketError(t)},onUnhandledMessage:t=>{this.onUnhandledMessage(t)},onUnhandledReceipt:t=>{this.onUnhandledReceipt(t)},onUnhandledFrame:t=>{this.onUnhandledFrame(t)}}),this._stompHandler.start()}))}_createWebSocket(){let t;return t=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions()),t.binaryType="arraybuffer",t}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout(()=>{this._connect()},this.reconnectDelay))}deactivate(){return h(this,void 0,void 0,(function*(){let t;return this.state!==a.ACTIVE?(this.debug(`Already ${a[this.state]}, ignoring call to deactivate`),Promise.resolve()):(this._changeState(a.DEACTIVATING),this._reconnector&&clearTimeout(this._reconnector),this._stompHandler&&this.webSocket.readyState!==s.CLOSED?(t=new Promise((t,e)=>{this._resolveSocketClose=t}),this._disposeStompHandler(),t):(this._changeState(a.INACTIVE),Promise.resolve()))}))}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(t){this._stompHandler.publish(t)}watchForReceipt(t,e){this._stompHandler.watchForReceipt(t,e)}subscribe(t,e,n={}){return this._stompHandler.subscribe(t,e,n)}unsubscribe(t,e={}){this._stompHandler.unsubscribe(t,e)}begin(t){return this._stompHandler.begin(t)}commit(t){this._stompHandler.commit(t)}abort(t){this._stompHandler.abort(t)}ack(t,e,n={}){this._stompHandler.ack(t,e,n)}nack(t,e,n={}){this._stompHandler.nack(t,e,n)}}class f{}class d{}class p{}class g{constructor(t){this.client=t}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(t){this.client.heartbeatOutgoing=t}get incoming(){return this.client.heartbeatIncoming}set incoming(t){this.client.heartbeatIncoming=t}}class v extends l{constructor(t){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new g(this),this.reconnect_delay=0,this.webSocketFactory=t,this.debug=(...t)=>{console.log(...t)}}_parseConnect(...t){let e,n,r,i={};if(t.length<2)throw new Error("Connect requires at least 2 arguments");if("function"==typeof t[1])[i,n,r,e]=t;else switch(t.length){case 6:[i.login,i.passcode,n,r,e,i.host]=t;break;default:[i.login,i.passcode,n,r,e]=t}return[i,n,r,e]}connect(...t){const e=this._parseConnect(...t);e[0]&&(this.connectHeaders=e[0]),e[1]&&(this.onConnect=e[1]),e[2]&&(this.onStompError=e[2]),e[3]&&(this.onWebSocketClose=e[3]),super.activate()}disconnect(t,e={}){t&&(this.onDisconnect=t),this.disconnectHeaders=e,super.deactivate()}send(t,e={},n=""){const r=!1===(e=Object.assign({},e))["content-length"];r&&delete e["content-length"],this.publish({destination:t,headers:e,body:n,skipContentLengthHeader:r})}set reconnect_delay(t){this.reconnectDelay=t}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(t){this.onUnhandledMessage=t}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(t){this.onUnhandledReceipt=t}get heartbeat(){return this._heartbeatInfo}set heartbeat(t){this.heartbeatIncoming=t.incoming,this.heartbeatOutgoing=t.outgoing}}class m{static client(t,e){null==e&&(e=c.default.protocolVersions());return new v(()=>new(m.WebSocketClass||WebSocket)(t,e))}static over(t){let e;return"function"==typeof t?e=t:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),e=()=>t),new v(e)}}m.WebSocketClass=null}]));