uneeq-js 2.46.4 → 2.46.6
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 +2 -38
- package/dist/index.js.LICENSE.txt +23 -0
- package/dist/src/service/messaging/messaging-service.d.ts +1 -2
- package/dist/src/types/FaceMeMessage.d.ts +3 -0
- package/dist/src/types/VoiceInputMode.d.ts +2 -1
- package/dist/src/uneeq.d.ts +4 -5
- package/dist/umd/index.js +22458 -25001
- package/package.json +10 -9
- package/readme.md +6 -0
package/dist/index.js
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(0),i=n(23),o=n(58),s=n(4),a=n(41),c=n(13),u=n(34),h=function(e){function t(n,r,i){var s=e.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof t?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new l(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new l(s,n,r,i)}return s}return r.a(t,e),t.prototype[a.a]=function(){return this},t.create=function(e,n,r){var i=new t(e,n,r);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(s.a),l=function(e){function t(t,n,r,s){var a,c=e.call(this)||this;c._parentSubscriber=t;var u=c;return Object(i.a)(n)?a=n:n&&(a=n.next,r=n.error,s=n.complete,n!==o.a&&(u=Object.create(n),Object(i.a)(u.unsubscribe)&&c.add(u.unsubscribe.bind(u)),u.unsubscribe=c.unsubscribe.bind(c))),c._context=u,c._next=a,c._error=r,c._complete=s,c}return r.a(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;c.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=c.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(u.a)(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;Object(u.a)(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};c.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),c.a.useDeprecatedSynchronousErrorHandling)throw e;Object(u.a)(e)}},t.prototype.__tryOrSetError=function(e,t,n){if(!c.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return c.a.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(Object(u.a)(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(h)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return u}));var r=n(0),i=n(1),o=n(3),s=n(33),a=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,n}return r.a(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(i.a),c=(i.a,function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.a(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(i.a));i.a;function u(e,t){if(!t.closed){if(e instanceof o.a)return e.subscribe(t);var n;try{n=Object(s.a)(e)(t)}catch(e){t.error(e)}return n}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(56),i=n(1),o=n(41),s=n(58);var a=n(20),c=n(39),u=n(13),h=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,a=function(e,t,n){if(e){if(e instanceof i.a)return e;if(e[o.a])return e[o.a]()}return e||t||n?new i.a(e,t,n):new i.a(s.a)}(e,t,n);if(r?a.add(r.call(a,this.source)):a.add(this.source||u.a.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.a.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){u.a.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),Object(r.a)(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=l(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),i&&i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[a.a]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:Object(c.b)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=l(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function l(e){if(e||(e=u.a.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(7),i=n(55),o=n(23),s=n(42),a=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}var t;return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this._parentOrParents,a=this._ctorUnsubscribe,u=this._unsubscribe,h=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(var l=0;l<n.length;++l){n[l].remove(this)}if(Object(o.a)(u)){a&&(this._unsubscribe=void 0);try{u.call(this)}catch(e){t=e instanceof s.a?c(e.errors):[e]}}if(Object(r.a)(h)){l=-1;for(var f=h.length;++l<f;){var d=h[l];if(Object(i.a)(d))try{d.unsubscribe()}catch(e){t=t||[],e instanceof s.a?t=t.concat(c(e.errors)):t.push(e)}}}if(t)throw new s.a(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof e){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=((t=new e).closed=!0,t),e}();function c(e){return e.reduce((function(e,t){return e.concat(t instanceof s.a?t.errors:t)}),[])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"a",(function(){return l}));var r=n(0),i=n(3),o=n(1),s=n(4),a=n(21),c=n(74),u=n(41),h=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return r.a(t,e),t}(o.a),l=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return r.a(t,e),t.prototype[u.a]=function(){return new h(this)},t.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new a.a;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new a.a;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new a.a;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new a.a;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new a.a;return this.hasError?(e.error(this.thrownError),s.a.EMPTY):this.isStopped?(e.complete(),s.a.EMPTY):(this.observers.push(e),new c.a(this,e))},t.prototype.asObservable=function(){var e=new i.a;return e.source=this,e},t.create=function(e,t){return new f(e,t)},t}(i.a),f=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return r.a(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):s.a.EMPTY},t}(l)},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var r=n(29),i=new(n(27).a)(r.a),o=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(1);function o(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(e,t))}}var s=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.project,this.thisArg))},e}(),a=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.a(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(i.a)},function(e,t,n){"use strict";function r(e){return e&&"function"==typeof e.schedule}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(3),i=new r.a((function(e){return e.complete()}));function o(e){return e?function(e){return new r.a((function(t){return e.schedule((function(){return t.complete()}))}))}(e):i}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),i=n(33),o=n(73);function s(e,t){return t?Object(o.a)(e,t):e instanceof r.a?e:new r.a(Object(i.a)(e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),i=function(e){function t(t,n,r){var i=e.call(this)||this;return i.parent=t,i.outerValue=n,i.outerIndex=r,i.index=0,i}return r.a(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(n(1).a),o=n(33),s=n(3);function a(e,t,n,r,a){if(void 0===a&&(a=new i(e,n,r)),!a.closed)return t instanceof s.a?t.subscribe(a):Object(o.a)(t)(a)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;r=e},get useDeprecatedSynchronousErrorHandling(){return r}}},function(e,t,n){"use strict";function r(e){return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.a(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(n(1).a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(1);function o(e,t){return function(n){return n.lift(new s(e,t))}}var s=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.thisArg))},e}(),a=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return r.a(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(i.a)},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var r,i=n(10),o=n(36),s=n(50);r||(r={});var a=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return Object(o.a)(this.value);case"E":return Object(s.a)(this.error);case"C":return Object(i.b)()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},function(e,t,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(t,"a",(function(){return i}));var i=r()},function(e,t,n){"use strict";function r(){}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}()},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return h}));var r=n(0),i=n(8),o=n(11),s=n(2);function a(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?function(r){return r.pipe(a((function(n,r){return Object(o.a)(e(n,r)).pipe(Object(i.a)((function(e,i){return t(n,e,r,i)})))}),n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new c(e,n))})}var c=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project,this.concurrent))},e}(),u=function(e){function t(t,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.a(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.a(this),n=this.destination;n.add(t);var r=Object(s.c)(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(s.b),h=a},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),i=n(75),o=n(57);function s(e,t){return t?Object(o.a)(e,t):new r.a(Object(i.a)(e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(61),o=function(e){function t(n,r){void 0===r&&(r=i.a.now);var o=e.call(this,n,(function(){return t.delegate&&t.delegate!==o?t.delegate.now():r()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return r.a(t,e),t.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),t.delegate&&t.delegate!==this?t.delegate.schedule(n,r,i):e.prototype.schedule.call(this,n,r,i)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(i.a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(0),i=n(5),o=n(4),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return r.a(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),o.a.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),o.a.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(i.a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),i=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return r.a(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(e){n=!0,r=!!e&&e||new Error(e)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(function(e){function t(t,n){return e.call(this)||this}return r.a(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(4).a))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(7);function i(e){return!Object(r.a)(e)&&e-parseFloat(e)+1>=0}},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.Logger=t.LogType=void 0,function(e){e.debug="debug",e.log="log",e.warn="warn",e.error="error"}(r=t.LogType||(t.LogType={}));class i{constructor(){this.enabled=!1}log(e,...t){this.emitLogMessage(r.log,e,t)}warn(e,...t){this.emitLogMessage(r.warn,e,t)}error(e,...t){this.emitLogMessage(r.error,e,t)}debug(e,...t){this.emitLogMessage(r.debug,e,t)}emitLogMessage(e,t,n){(this.enabled||e===r.error)&&(n.length>0?console[e](t,n):console[e](t))}}t.Logger=i,t.logger=new i},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(36),i=n(69);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Object(i.a)()(r.a.apply(void 0,e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(75),i=n(34),o=n(18),s=n(20),a=n(76),c=n(77),u=n(55),h=function(e){if(e&&"function"==typeof e[s.a])return h=e,function(e){var t=h[s.a]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if(Object(a.a)(e))return Object(r.a)(e);if(Object(c.a)(e))return n=e,function(e){return n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,i.a),e};if(e&&"function"==typeof e[o.a])return t=e,function(e){for(var n=t[o.a]();;){var r=void 0;try{r=n.next()}catch(t){return e.error(t),e}if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof n.return&&e.add((function(){n.return&&n.return()})),e};var t,n,h,l=Object(u.a)(e)?"an invalid object":"'"+e+"'";throw new TypeError("You provided "+l+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},function(e,t,n){"use strict";function r(e){setTimeout((function(){throw e}),0)}n.d(t,"a",(function(){return r}))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),i=n(26),o=n(57);function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return Object(r.a)(n)?(e.pop(),Object(o.a)(e,n)):Object(i.a)(e)}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(101);const a=o(n(82)),c=n(84);s(n(63),t);var u=n(84);Object.defineProperty(t,"Uneeq",{enumerable:!0,get:function(){return u.Uneeq}}),s(n(82),t),window.AdapterJS=a,window.Uneeq=c.Uneeq},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],h=!1,l=-1;function f(){h&&c&&(h=!1,c.length?u=c.concat(u):l=-1,u.length&&d())}function d(){if(!h){var e=a(f);h=!0;for(var t=u.length;t;){for(c=u,u=[];++l<t;)c&&c[l].run();l=-1,t=u.length}c=null,h=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||h||a(d)},p.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=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(14);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(e)}function o(e){return 0===e.length?r.a:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return f}));var r=n(0),i=1,o=function(){return Promise.resolve()}(),s={};function a(e){return e in s&&(delete s[e],!0)}var c=function(e){var t=i++;return s[t]=!0,o.then((function(){return a(t)&&e()})),t},u=function(e){a(e)},h=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return r.a(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=c(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(u(n),t.scheduled=void 0)},t}(n(29).a),l=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.a(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this.active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(27).a))(h),f=l},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}()},function(e,t,n){"use strict";const r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map(e=>e.trim())},r.splitSections=function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},r.getDescription=function(e){const t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){const t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter(e=>0===e.indexOf(t))},r.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":n.relatedAddress=t[e+1];break;case"rport":n.relatedPort=parseInt(t[e+1],10);break;case"tcptype":n.tcpType=t[e+1];break;case"ufrag":n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:void 0===n[t[e]]&&(n[t[e]]=t[e+1])}return n},r.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){let t=e.substr(9).split(" ");const n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){const t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){const t={};let n;const r=e.substr(e.indexOf(" ")+1).split(";");for(let e=0;e<r.length;e++)n=r[e].trim().split("="),t[n[0].trim()]=n[1];return t},r.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const r=[];Object.keys(e.parameters).forEach(t=>{void 0!==e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){const t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},r.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){const t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map(e=>parseInt(e,10))}},r.getMid=function(e){const t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){const t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},r.parseCryptoLine=function(e){const t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){const n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],i=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},r.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},r.parseRtpParameters=function(e){const t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" ");for(let i=3;i<n.length;i++){const o=n[i],s=r.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){const n=r.parseRtpMap(s),i=r.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?r.parseFmtp(i[0]):{},n.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(r.parseRtcpFb),t.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(n.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach(e=>{t.headerExtensions.push(r.parseExtmap(e))}),t},r.writeRtpDescription=function(e,t){let n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.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",t.codecs.forEach(e=>{n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)});let i=0;return t.codecs.forEach(e=>{e.maxptime>i&&(i=e.maxptime)}),i>0&&(n+="a=maxptime:"+i+"\r\n"),t.headerExtensions&&t.headerExtensions.forEach(e=>{n+=r.writeExtmap(e)}),n},r.parseRtpEncodingParameters=function(e){const t=[],n=r.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map(e=>r.parseSsrcMedia(e)).filter(e=>"cname"===e.attribute),a=s.length>0&&s[0].ssrc;let c;const u=r.matchPrefix(e,"a=ssrc-group:FID").map(e=>e.substr(17).split(" ").map(e=>parseInt(e,10)));u.length>0&&u[0].length>1&&u[0][0]===a&&(c=u[0][1]),n.codecs.forEach(e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let n={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&c&&(n.rtx={ssrc:c}),t.push(n),i&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},t.push(n))}}),0===t.length&&a&&t.push({ssrc:a});let h=r.matchPrefix(e,"b=");return h.length&&(h=0===h[0].indexOf("b=TIAS:")?parseInt(h[0].substr(7),10):0===h[0].indexOf("b=AS:")?1e3*parseInt(h[0].substr(5),10)*.95-16e3:void 0,t.forEach(e=>{e.maxBitrate=h})),t},r.parseRtcpParameters=function(e){const t={},n=r.matchPrefix(e,"a=ssrc:").map(e=>r.parseSsrcMedia(e)).filter(e=>"cname"===e.attribute)[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);const i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;const o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},r.parseMsid=function(e){let t;const n=r.matchPrefix(e,"a=msid:");if(1===n.length)return t=n[0].substr(7).split(" "),{stream:t[0],track:t[1]};const i=r.matchPrefix(e,"a=ssrc:").map(e=>r.parseSsrcMedia(e)).filter(e=>"msid"===e.attribute);return i.length>0?(t=i[0].value.split(" "),{stream:t[0],track:t[1]}):void 0},r.parseSctpDescription=function(e){const t=r.parseMLine(e),n=r.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substr(19),10)),isNaN(i)&&(i=65536);const o=r.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:t.fmt,maxMessageSize:i};const s=r.matchPrefix(e,"a=sctpmap:");if(s.length>0){const e=s[0].substr(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},r.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){let i;const o=void 0!==t?t:2;i=e||r.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.getDirection=function(e,t){const n=r.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){const t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){const t=r.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const t=r.splitLines(e);for(let e=0;e<t.length;e++)if(t[e].length<2||"="!==t[e].charAt(1))return!1;return!0},e.exports=r},function(e,t,n){"use strict";(function(e){
|
|
17
|
-
/*!
|
|
18
|
-
* The buffer module from node.js, for the browser.
|
|
19
|
-
*
|
|
20
|
-
* @author Feross Aboukhadijeh <http://feross.org>
|
|
21
|
-
* @license MIT
|
|
22
|
-
*/
|
|
23
|
-
var r=n(102),i=n(103),o=n(104);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return u(this,e,t,n)}function u(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),i=(e=a(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(c.isBuffer(t)){var n=0|d(t.length);return 0===(e=a(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?a(e,0):f(e,t);if("Buffer"===t.type&&o(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(h(t),e=a(e,t<0?0:0|d(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|d(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return M(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.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:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var h=-1;for(o=n;o<a;o++)if(u(e,o)===u(t,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===c)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){for(var l=!0,f=0;f<c;f++)if(u(e,o+f)!==u(t,f)){l=!1;break}if(l)return o}return-1}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function _(e,t,n,r){return W(B(t,e.length-n),e,n,r)}function w(e,t,n,r){return W(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return w(e,t,n,r)}function T(e,t,n,r){return W(V(t),e,n,r)}function x(e,t,n,r){return W(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,c,u=e[i],h=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l<=n)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(h=c);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(h=c)}null===h?(h=65533,l=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),i+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,n){return u(null,e,t,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,n){return function(e,t,n,r){return h(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},c.allocUnsafe=function(e){return l(null,e)},c.allocUnsafeSlow=function(e){return l(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).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}},c.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=c.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?E(this,0,e):v.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,n,r,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),h=e.slice(t,n),l=0;l<a;++l)if(u[l]!==h[l]){o=u[l],s=h[l];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function M(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function O(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=F(e[o]);return i}function A(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function I(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,o){return o||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return o||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=c.prototype;else{var i=t-e;n=new c(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},c.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},c.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||k(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||k(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);k(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);k(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<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),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},c.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=c.isBuffer(e)?e:B(new c(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(35))},function(e,t,n){"use strict";var r={};function i(e,t,n){n||(n=Error);var i=function(e){var n,r;function i(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return r=e,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function o(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,i,s,a;if("string"==typeof t&&(i="not ",t.substr(!s||s<0?0:+s,i.length)===i)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(r," ").concat(o(t,"type"));else{var c=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(o(t,"type"))}return a+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" 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(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var i=n(87),o=n(92);n(59)(u,i);for(var s=r(o.prototype),a=0;a<s.length;a++){var c=s[a];u.prototype[c]||(u.prototype[c]=o.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||t.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this,n(38))},function(e,t,n){"use strict";n.r(t),n.d(t,"Observable",(function(){return r.a})),n.d(t,"ConnectableObservable",(function(){return i.a})),n.d(t,"GroupedObservable",(function(){return o.a})),n.d(t,"observable",(function(){return s.a})),n.d(t,"Subject",(function(){return a.a})),n.d(t,"BehaviorSubject",(function(){return c.a})),n.d(t,"ReplaySubject",(function(){return u.a})),n.d(t,"AsyncSubject",(function(){return h.a})),n.d(t,"asap",(function(){return l.a})),n.d(t,"asapScheduler",(function(){return l.b})),n.d(t,"async",(function(){return f.a})),n.d(t,"asyncScheduler",(function(){return f.b})),n.d(t,"queue",(function(){return d.a})),n.d(t,"queueScheduler",(function(){return d.b})),n.d(t,"animationFrame",(function(){return b})),n.d(t,"animationFrameScheduler",(function(){return y})),n.d(t,"VirtualTimeScheduler",(function(){return _})),n.d(t,"VirtualAction",(function(){return w})),n.d(t,"Scheduler",(function(){return S.a})),n.d(t,"Subscription",(function(){return T.a})),n.d(t,"Subscriber",(function(){return x.a})),n.d(t,"Notification",(function(){return C.a})),n.d(t,"NotificationKind",(function(){return C.b})),n.d(t,"pipe",(function(){return E.a})),n.d(t,"noop",(function(){return R.a})),n.d(t,"identity",(function(){return M.a})),n.d(t,"isObservable",(function(){return O})),n.d(t,"ArgumentOutOfRangeError",(function(){return A.a})),n.d(t,"EmptyError",(function(){return P.a})),n.d(t,"ObjectUnsubscribedError",(function(){return k.a})),n.d(t,"UnsubscriptionError",(function(){return I.a})),n.d(t,"TimeoutError",(function(){return D.a})),n.d(t,"bindCallback",(function(){return F})),n.d(t,"bindNodeCallback",(function(){return W})),n.d(t,"combineLatest",(function(){return G.b})),n.d(t,"concat",(function(){return Y.a})),n.d(t,"defer",(function(){return $.a})),n.d(t,"empty",(function(){return K.b})),n.d(t,"forkJoin",(function(){return J})),n.d(t,"from",(function(){return Z.a})),n.d(t,"fromEvent",(function(){return te})),n.d(t,"fromEventPattern",(function(){return ne})),n.d(t,"generate",(function(){return re})),n.d(t,"iif",(function(){return oe})),n.d(t,"interval",(function(){return ae})),n.d(t,"merge",(function(){return ue.a})),n.d(t,"never",(function(){return le})),n.d(t,"of",(function(){return fe.a})),n.d(t,"onErrorResumeNext",(function(){return de})),n.d(t,"pairs",(function(){return pe})),n.d(t,"partition",(function(){return be})),n.d(t,"race",(function(){return _e.a})),n.d(t,"range",(function(){return we})),n.d(t,"throwError",(function(){return Te.a})),n.d(t,"timer",(function(){return xe.a})),n.d(t,"using",(function(){return Ce})),n.d(t,"zip",(function(){return Ee.b})),n.d(t,"scheduled",(function(){return Re.a})),n.d(t,"EMPTY",(function(){return K.a})),n.d(t,"NEVER",(function(){return he})),n.d(t,"config",(function(){return Me.a}));var r=n(3),i=n(65),o=n(62),s=n(20),a=n(5),c=n(66),u=n(49),h=n(28),l=n(40),f=n(6),d=n(60),p=n(0),v=n(29),g=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return p.a(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame((function(){return t.flush(null)}))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(cancelAnimationFrame(n),t.scheduled=void 0)},t}(v.a),m=n(27),y=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p.a(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this.active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(m.a))(g),b=y,_=function(e){function t(t,n){void 0===t&&(t=w),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=e.call(this,t,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return p.a(t,e),t.prototype.flush=function(){for(var e,t,n=this.actions,r=this.maxFrames;(t=n[0])&&t.delay<=r&&(n.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=n.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(m.a),w=function(e){function t(t,n,r){void 0===r&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return p.a(t,e),t.prototype.schedule=function(n,r){if(void 0===r&&(r=0),!this.id)return e.prototype.schedule.call(this,n,r);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},t.prototype.requestAsyncId=function(e,n,r){void 0===r&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,n){void 0===n&&(n=0)},t.prototype._execute=function(t,n){if(!0===this.active)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(v.a),S=n(61),T=n(4),x=n(1),C=n(17),E=n(39),R=n(19),M=n(14);function O(e){return!!e&&(e instanceof r.a||"function"==typeof e.lift&&"function"==typeof e.subscribe)}var A=n(22),P=n(24),k=n(21),I=n(42),D=n(68),N=n(8),j=n(56),L=n(7),U=n(9);function F(e,t,n){if(t){if(!Object(U.a)(t))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return F(e,n).apply(void 0,r).pipe(Object(N.a)((function(e){return Object(L.a)(e)?t.apply(void 0,e):t(e)})))};n=t}return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var o,s=this,a={context:s,subject:o,callbackFunc:e,scheduler:n};return new r.a((function(r){if(n){var i={args:t,subscriber:r,params:a};return n.schedule(B,0,i)}if(!o){o=new h.a;try{e.apply(s,t.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o.next(e.length<=1?e[0]:e),o.complete()}]))}catch(e){Object(j.a)(o)?o.error(e):console.warn(e)}}return o.subscribe(r)}))}}function B(e){var t=this,n=e.args,r=e.subscriber,i=e.params,o=i.callbackFunc,s=i.context,a=i.scheduler,c=i.subject;if(!c){c=i.subject=new h.a;try{o.apply(s,n.concat([function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length<=1?e[0]:e;t.add(a.schedule(V,0,{value:r,subject:c}))}]))}catch(e){c.error(e)}}this.add(c.subscribe(r))}function V(e){var t=e.value,n=e.subject;n.next(t),n.complete()}function W(e,t,n){if(t){if(!Object(U.a)(t))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return W(e,n).apply(void 0,r).pipe(Object(N.a)((function(e){return Object(L.a)(e)?t.apply(void 0,e):t(e)})))};n=t}return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var o={subject:void 0,args:t,callbackFunc:e,scheduler:n,context:this};return new r.a((function(r){var i=o.context,s=o.subject;if(n)return n.schedule(H,0,{params:o,subscriber:r,context:i});if(!s){s=o.subject=new h.a;try{e.apply(i,t.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.shift();n?s.error(n):(s.next(e.length<=1?e[0]:e),s.complete())}]))}catch(e){Object(j.a)(s)?s.error(e):console.warn(e)}}return s.subscribe(r)}))}}function H(e){var t=this,n=e.params,r=e.subscriber,i=e.context,o=n.callbackFunc,s=n.args,a=n.scheduler,c=n.subject;if(!c){c=n.subject=new h.a;try{o.apply(i,s.concat([function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.shift();if(r)t.add(a.schedule(z,0,{err:r,subject:c}));else{var i=e.length<=1?e[0]:e;t.add(a.schedule(q,0,{value:i,subject:c}))}}]))}catch(e){this.add(a.schedule(z,0,{err:e,subject:c}))}}this.add(c.subscribe(r))}function q(e){var t=e.value,n=e.subject;n.next(t),n.complete()}function z(e){var t=e.err;e.subject.error(t)}var G=n(51),Y=n(32),$=n(53),K=n(10),X=n(55),Z=n(11);function J(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var n=e[0];if(Object(L.a)(n))return Q(n,null);if(Object(X.a)(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return Q(r.map((function(e){return n[e]})),r)}}if("function"==typeof e[e.length-1]){var i=e.pop();return Q(e=1===e.length&&Object(L.a)(e[0])?e[0]:e,null).pipe(Object(N.a)((function(e){return i.apply(void 0,e)})))}return Q(e,null)}function Q(e,t){return new r.a((function(n){var r=e.length;if(0!==r)for(var i=new Array(r),o=0,s=0,a=function(a){var c=Object(Z.a)(e[a]),u=!1;n.add(c.subscribe({next:function(e){u||(u=!0,s++),i[a]=e},error:function(e){return n.error(e)},complete:function(){++o!==r&&u||(s===r&&n.next(t?t.reduce((function(e,t,n){return e[t]=i[n],e}),{}):i),n.complete())}}))},c=0;c<r;c++)a(c);else n.complete()}))}var ee=n(23);function te(e,t,n,i){return Object(ee.a)(n)&&(i=n,n=void 0),i?te(e,t,n).pipe(Object(N.a)((function(e){return Object(L.a)(e)?i.apply(void 0,e):i(e)}))):new r.a((function(r){!function e(t,n,r,i,o){var s;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){var a=t;t.addEventListener(n,r,o),s=function(){return a.removeEventListener(n,r,o)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){var c=t;t.on(n,r),s=function(){return c.off(n,r)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){var u=t;t.addListener(n,r),s=function(){return u.removeListener(n,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var h=0,l=t.length;h<l;h++)e(t[h],n,r,i,o)}i.add(s)}(e,t,(function(e){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(e)}),r,n)}))}function ne(e,t,n){return n?ne(e,t).pipe(Object(N.a)((function(e){return Object(L.a)(e)?n.apply(void 0,e):n(e)}))):new r.a((function(n){var r,i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.next(1===e.length?e[0]:e)};try{r=e(i)}catch(e){return void n.error(e)}if(Object(ee.a)(t))return function(){return t(i,r)}}))}function re(e,t,n,i,o){var s,a;if(1==arguments.length){var c=e;a=c.initialState,t=c.condition,n=c.iterate,s=c.resultSelector||M.a,o=c.scheduler}else void 0===i||Object(U.a)(i)?(a=e,s=M.a,o=i):(a=e,s=i);return new r.a((function(e){var r=a;if(o)return o.schedule(ie,0,{subscriber:e,iterate:n,condition:t,resultSelector:s,state:r});for(;;){if(t){var i=void 0;try{i=t(r)}catch(t){return void e.error(t)}if(!i){e.complete();break}}var c=void 0;try{c=s(r)}catch(t){return void e.error(t)}if(e.next(c),e.closed)break;try{r=n(r)}catch(t){return void e.error(t)}}}))}function ie(e){var t=e.subscriber,n=e.condition;if(!t.closed){if(e.needIterate)try{e.state=e.iterate(e.state)}catch(e){return void t.error(e)}else e.needIterate=!0;if(n){var r=void 0;try{r=n(e.state)}catch(e){return void t.error(e)}if(!r)return void t.complete();if(t.closed)return}var i;try{i=e.resultSelector(e.state)}catch(e){return void t.error(e)}if(!t.closed&&(t.next(i),!t.closed))return this.schedule(e)}}function oe(e,t,n){return void 0===t&&(t=K.a),void 0===n&&(n=K.a),Object($.a)((function(){return e()?t:n}))}var se=n(30);function ae(e,t){return void 0===e&&(e=0),void 0===t&&(t=f.a),(!Object(se.a)(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=f.a),new r.a((function(n){return n.add(t.schedule(ce,e,{subscriber:n,counter:0,period:e})),n}))}function ce(e){var t=e.subscriber,n=e.counter,r=e.period;t.next(n),this.schedule({subscriber:t,counter:n+1,period:r},r)}var ue=n(70),he=new r.a(R.a);function le(){return he}var fe=n(36);function de(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)return K.a;var n=e[0],i=e.slice(1);return 1===e.length&&Object(L.a)(n)?de.apply(void 0,n):new r.a((function(e){var t=function(){return e.add(de.apply(void 0,i).subscribe(e))};return Object(Z.a)(n).subscribe({next:function(t){e.next(t)},error:t,complete:t})}))}function pe(e,t){return t?new r.a((function(n){var r=Object.keys(e),i=new T.a;return i.add(t.schedule(ve,0,{keys:r,index:0,subscriber:n,subscription:i,obj:e})),i})):new r.a((function(t){for(var n=Object.keys(e),r=0;r<n.length&&!t.closed;r++){var i=n[r];e.hasOwnProperty(i)&&t.next([i,e[i]])}t.complete()}))}function ve(e){var t=e.keys,n=e.index,r=e.subscriber,i=e.subscription,o=e.obj;if(!r.closed)if(n<t.length){var s=t[n];r.next([s,o[s]]),i.add(this.schedule({keys:t,index:n+1,subscriber:r,subscription:i,obj:o}))}else r.complete()}var ge=n(78),me=n(33),ye=n(16);function be(e,t,n){return[Object(ye.a)(t,n)(new r.a(Object(me.a)(e))),Object(ye.a)(Object(ge.a)(t,n))(new r.a(Object(me.a)(e)))]}var _e=n(71);function we(e,t,n){return void 0===e&&(e=0),new r.a((function(r){void 0===t&&(t=e,e=0);var i=0,o=e;if(n)return n.schedule(Se,0,{index:i,count:t,start:e,subscriber:r});for(;;){if(i++>=t){r.complete();break}if(r.next(o++),r.closed)break}}))}function Se(e){var t=e.start,n=e.index,r=e.count,i=e.subscriber;n>=r?i.complete():(i.next(t),i.closed||(e.index=n+1,e.start=t+1,this.schedule(e)))}var Te=n(50),xe=n(72);function Ce(e,t){return new r.a((function(n){var r,i;try{r=e()}catch(e){return void n.error(e)}try{i=t(r)}catch(e){return void n.error(e)}var o=(i?Object(Z.a)(i):K.a).subscribe(n);return function(){o.unsubscribe(),r&&r.unsubscribe()}}))}var Ee=n(54),Re=n(73),Me=n(13)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(1);function o(){return function(e){return e.lift(new s(e))}}var s=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new a(e,n),i=t.subscribe(r);return r.closed||(r.connection=n.connect()),i},e}(),a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return r.a(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},t}(i.a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(0),i=n(5),o=n(60),s=n(4),a=n(67),c=n(21),u=n(74),h=function(e){function t(t,n,r){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,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(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new l(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=r.length;if(this.closed)throw new c.a;if(this.isStopped||this.hasError?t=s.a.EMPTY:(this.observers.push(e),t=new u.a(this,e)),i&&e.add(e=new a.a(e,i)),n)for(var h=0;h<o&&!e.closed;h++)e.next(r[h]);else for(h=0;h<o&&!e.closed;h++)e.next(r[h].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||o.a).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(e-r[o].time<n);)o++;return i>t&&(o=Math.max(o,i-t)),o>0&&r.splice(0,o),r},t}(i.a),l=function(){return function(e,t){this.time=e,this.value=t}}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3);function i(e,t){return t?new r.a((function(n){return t.schedule(o,0,{error:e,subscriber:n})})):new r.a((function(t){return t.error(e)}))}function o(e){var t=e.error;e.subscriber.error(t)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"a",(function(){return l}));var r=n(0),i=n(9),o=n(7),s=n(15),a=n(12),c=n(26),u={};function h(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=void 0,r=void 0;return Object(i.a)(e[e.length-1])&&(r=e.pop()),"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&Object(o.a)(e[0])&&(e=e[0]),Object(c.a)(e,r).lift(new l(n))}var l=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.resultSelector))},e}(),f=function(e){function t(t,n){var r=e.call(this,t)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return r.a(t,e),t.prototype._next=function(e){this.values.push(u),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var n=0;n<t;n++){var r=e[n];this.add(Object(a.a)(this,r,void 0,n))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n){var r=this.values,i=r[n],o=this.toRespond?i===u?--this.toRespond:this.toRespond:0;r[n]=t,0===o&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(s.a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(25),i=n(14);function o(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),Object(r.b)(i.a,e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),i=n(11),o=n(10);function s(e){return new r.a((function(t){var n;try{n=e()}catch(e){return void t.error(e)}return(n?Object(i.a)(n):Object(o.b)()).subscribe(t)}))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return h}));var r=n(0),i=n(26),o=n(7),s=n(1),a=n(18),c=n(2);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return"function"==typeof n&&e.pop(),Object(i.a)(e,void 0).lift(new h(n))}var h=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.resultSelector))},e}(),l=function(e){function t(t,n,r){void 0===r&&(r=Object.create(null));var i=e.call(this,t)||this;return i.resultSelector=n,i.iterators=[],i.active=0,i.resultSelector="function"==typeof n?n:void 0,i}return r.a(t,e),t.prototype._next=function(e){var t=this.iterators;Object(o.a)(e)?t.push(new d(e)):"function"==typeof e[a.a]?t.push(new f(e[a.a]())):t.push(new p(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0!==t){this.active=t;for(var n=0;n<t;n++){var r=e[n];if(r.stillUnsubscribed)this.destination.add(r.subscribe());else this.active--}}else this.destination.complete()},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,n=this.destination,r=0;r<t;r++){if("function"==typeof(s=e[r]).hasValue&&!s.hasValue())return}var i=!1,o=[];for(r=0;r<t;r++){var s,a=(s=e[r]).next();if(s.hasCompleted()&&(i=!0),a.done)return void n.complete();o.push(a.value)}this.resultSelector?this._tryresultSelector(o):n.next(o),i&&n.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(s.a),f=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return Boolean(e&&e.done)},e}(),d=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[a.a]=function(){return this},e.prototype.next=function(e){var t=this.index++,n=this.array;return t<this.length?{value:n[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),p=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return r.a(t,e),t.prototype[a.a]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return Object(c.c)(this.observable,new c.a(this))},t}(c.b)},function(e,t,n){"use strict";function r(e){return null!==e&&"object"==typeof e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(1);function i(e){for(;e;){var t=e,n=t.closed,i=t.destination,o=t.isStopped;if(n||o)return!1;e=i&&i instanceof r.a?i:null}return!0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),i=n(4);function o(e,t){return new r.a((function(n){var r=new i.a,o=0;return r.add(t.schedule((function(){o!==e.length?(n.next(e[o++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(13),i=n(34),o={closed:!0,next:function(e){},error:function(e){if(r.a.useDeprecatedSynchronousErrorHandling)throw e;Object(i.a)(e)},complete:function(){}}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return s}));var r=n(0),i=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return r.a(t,e),t.prototype.schedule=function(t,n){return void 0===n&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):t.flush(this)},t}(n(29).a),o=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.a(t,e),t}(n(27).a))(i),s=o},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}()},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return f}));var r=n(0),i=n(1),o=n(4),s=n(3),a=n(5);function c(e,t,n,r){return function(i){return i.lift(new u(e,t,n,r))}}var u=function(){function e(e,t,n,r){this.keySelector=e,this.elementSelector=t,this.durationSelector=n,this.subjectSelector=r}return e.prototype.call=function(e,t){return t.subscribe(new h(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),h=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;return s.keySelector=n,s.elementSelector=r,s.durationSelector=i,s.subjectSelector=o,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return r.a(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){return void this.error(e)}this._group(e,t)},t.prototype._group=function(e,t){var n=this.groups;n||(n=this.groups=new Map);var r,i=n.get(t);if(this.elementSelector)try{r=this.elementSelector(e)}catch(e){this.error(e)}else r=e;if(!i){i=this.subjectSelector?this.subjectSelector():new a.a,n.set(t,i);var o=new f(t,i,this);if(this.destination.next(o),this.durationSelector){var s=void 0;try{s=this.durationSelector(new f(t,i))}catch(e){return void this.error(e)}this.add(s.subscribe(new l(t,i,this)))}}i.closed||i.next(r)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach((function(t,n){t.error(e)})),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach((function(e,t){e.complete()})),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(i.a),l=function(e){function t(t,n,r){var i=e.call(this,n)||this;return i.key=t,i.group=n,i.parent=r,i}return r.a(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(i.a),f=function(e){function t(t,n,r){var i=e.call(this)||this;return i.key=t,i.groupSubject=n,i.refCountSubscription=r,i}return r.a(t,e),t.prototype._subscribe=function(e){var t=new o.a,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&t.add(new d(n)),t.add(r.subscribe(e)),t},t}(s.a),d=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,t.count++,n}return r.a(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(o.a)},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanUnmuted=t.DigitalHumanPlayedInMutedModeSuccess=t.DigitalHumanFailedToPlay=t.DigitalHumanVideoError=t.ClientPerformanceMessage=t.ClientMediaStreamUpdateMessage=t.OnlineStatusUpdateMessage=t.SessionInfoMessage=t.AvatarRequestIgnored=t.AvatarRequestCompleted=t.SessionErrorMessage=t.WebRtcStatsMessage=t.WebRtcDataMessage=t.SessionLiveMessage=t.WarningMessage=t.RecordingStoppedMessage=t.RecordingStartedMessage=t.DevicePermissionAllowedMessage=t.AvatarTextInputFinishedMessage=t.FinishedSpeakingMessage=t.StartedSpeakingMessage=t.AvatarQuestionMessage=t.InstructionsMessage=t.AvatarAnswerContentMessage=t.AvatarAnswerMessage=t.ResumeSessionUnavailable=t.ConnectionLostMessage=t.VoiceActivityInputModeNotSupportedMessage=t.MicActivityNotSupportedMessage=t.MicActivityMessage=t.MicActivityErrorMessage=t.ServiceUnavailableMessage=t.AvatarUnavailableMessage=t.AvatarAvailableMessage=t.SessionEndedMessage=t.SessionResumedMessage=t.SessionPausedMessage=t.DeviceListUpdatedMessage=t.DeviceErrorMessage=t.SetSpeakerSuccessMessage=t.SetMicSuccessMessage=t.SetCameraSuccessMessage=t.DeviceNotFoundErrorMessage=t.ReadyMessage=t.UneeqMessageType=void 0,function(e){e.Ready="Ready",e.DeviceNotFoundError="DeviceNotFoundError",e.SetCameraSuccess="SetCameraSuccess",e.SetMicSuccess="SetMicSuccess",e.SetSpeakerSuccess="SetSpeakerSuccess",e.SessionPaused="SessionPaused",e.SessionResumed="SessionResumed",e.SessionEnded="SessionEnded",e.AvatarAvailable="AvatarAvailable",e.AvatarUnavailable="AvatarUnavailable",e.ConnectionLost="ConnectionLost",e.ResumeSessionUnavailable="ResumeSessionUnavailable",e.ServiceUnavailable="ServiceUnavailable",e.OnlineStatusUpdate="OnlineStatusUpdate",e.MicActivityNotSupported="MicActivityNotSupported",e.VoiceActivityInputModeNotSupported="VoiceActivityInputModeNotSupported",e.MicActivityError="MicActivityError",e.MicActivity="MicActivity",e.DeviceError="DeviceError",e.DeviceListUpdated="DeviceListUpdated",e.AvatarAnswer="AvatarAnswer",e.AvatarAnswerContent="AvatarAnswerContent",e.Instructions="Instructions",e.StartedSpeaking="StartedSpeaking",e.FinishedSpeaking="FinishedSpeaking",e.AvatarTextInputFinished="AvatarTextInputFinished",e.AvatarQuestionText="AvatarQuestionText",e.DevicePermissionAllowed="DevicePermissionAllowed",e.RecordingStarted="RecordingStarted",e.RecordingStopped="RecordingStopped",e.Warning="Warning",e.SessionLive="SessionLive",e.WebRtcData="WebRtcData",e.WebRtcStats="WebRtcStats",e.SessionError="SessionError",e.SessionInfo="SessionInfo",e.AvatarRequestCompleted="AvatarRequestCompleted",e.AvatarRequestIgnored="AvatarRequestIgnored",e.ClientMediaStreamUpdate="ClientMediaStreamUpdate",e.ClientPerformanceMessage="ClientPerformanceMessage",e.DigitalHumanVideoError="DigitalHumanVideoError",e.DigitalHumanFailedToPlay="DigitalHumanFailedToPlay",e.DigitalHumanPlayedInMutedModeSuccess="DigitalHumanPlayedInMutedModeSuccess",e.DigitalHumanUnmuted="DigitalHumanUnmuted"}(r=t.UneeqMessageType||(t.UneeqMessageType={}));t.ReadyMessage=class{constructor(){this.uneeqMessageType=r.Ready}};t.DeviceNotFoundErrorMessage=class{constructor(e,t){this.msg=e,this.deviceId=t,this.uneeqMessageType=r.DeviceNotFoundError}};t.SetCameraSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetCameraSuccess}};t.SetMicSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetMicSuccess}};t.SetSpeakerSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetSpeakerSuccess}};t.DeviceErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.DeviceError}};t.DeviceListUpdatedMessage=class{constructor(e){this.devices=e,this.uneeqMessageType=r.DeviceListUpdated}};t.SessionPausedMessage=class{constructor(){this.uneeqMessageType=r.SessionPaused}};t.SessionResumedMessage=class{constructor(){this.uneeqMessageType=r.SessionResumed}};t.SessionEndedMessage=class{constructor(){this.uneeqMessageType=r.SessionEnded}};t.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarAvailable}};t.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarUnavailable}};t.ServiceUnavailableMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.ServiceUnavailable}};t.MicActivityErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.MicActivityError}};t.MicActivityMessage=class{constructor(e){this.level=e,this.uneeqMessageType=r.MicActivity}};t.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.MicActivityNotSupported}};t.VoiceActivityInputModeNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.VoiceActivityInputModeNotSupported}};t.ConnectionLostMessage=class{constructor(e){this.connectionState=e,this.uneeqMessageType=r.ConnectionLost}};t.ResumeSessionUnavailable=class{constructor(){this.uneeqMessageType=r.ResumeSessionUnavailable}};t.AvatarAnswerMessage=class{constructor(e,t,n,i){this.answer=e,this.answerAvatar=t,this.answerSpeech=n,this.transcriptId=i,this.uneeqMessageType=r.AvatarAnswer}};t.AvatarAnswerContentMessage=class{constructor(e,t,n=!1){this.content=e,this.transcriptId=t,this.hasDisplayHtml=n,this.uneeqMessageType=r.AvatarAnswerContent}};t.InstructionsMessage=class{constructor(e){this.instructions=e,this.uneeqMessageType=r.Instructions}};t.AvatarQuestionMessage=class{constructor(e,t){this.question=e,this.transcriptId=t,this.uneeqMessageType=r.AvatarQuestionText}};t.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.StartedSpeaking}};t.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.FinishedSpeaking}};t.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=r.AvatarTextInputFinished}};t.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=r.DevicePermissionAllowed}};t.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStarted}};t.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStopped}};t.WarningMessage=class{constructor(e){this.msg=e,this.uneeqMessageType=r.Warning}};t.SessionLiveMessage=class{constructor(e,t){this.showLogo=e,this.sessionResumed=t,this.uneeqMessageType=r.SessionLive}};t.WebRtcDataMessage=class{constructor(e){this.data=e,this.uneeqMessageType=r.WebRtcData}};t.WebRtcStatsMessage=class{constructor(e){this.stats=e,this.uneeqMessageType=r.WebRtcStats}};t.SessionErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.SessionError}};t.AvatarRequestCompleted=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestCompleted}};t.AvatarRequestIgnored=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestIgnored}};t.SessionInfoMessage=class{constructor(e){this.info=e,this.uneeqMessageType=r.SessionInfo}};t.OnlineStatusUpdateMessage=class{constructor(e){this.online=e,this.uneeqMessageType=r.OnlineStatusUpdate}};t.ClientMediaStreamUpdateMessage=class{constructor(e,t,n,i){this.clientStreamingAudio=e,this.clientStreamingVideo=t,this.serverStreamingAudio=n,this.serverStreamingVideo=i,this.uneeqMessageType=r.ClientMediaStreamUpdate}};t.ClientPerformanceMessage=class{constructor(e){this.clientPerformance=e,this.uneeqMessageType=r.ClientPerformanceMessage}};t.DigitalHumanVideoError=class{constructor(e){this.error=e,this.uneeqMessageType=r.DigitalHumanVideoError}};t.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."}};t.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."}};t.DigitalHumanUnmuted=class{constructor(){this.uneeqMessageType=r.DigitalHumanUnmuted}}},function(e,t,n){(function(e,r){var i;
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Lodash <https://lodash.com/>
|
|
27
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
28
|
-
* Released under MIT license <https://lodash.com/license>
|
|
29
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
30
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
31
|
-
*/(function(){var o="Expected a function",s="__lodash_placeholder__",a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",u="[object Array]",h="[object Boolean]",l="[object Date]",f="[object Error]",d="[object Function]",p="[object GeneratorFunction]",v="[object Map]",g="[object Number]",m="[object Object]",y="[object RegExp]",b="[object Set]",_="[object String]",w="[object Symbol]",S="[object WeakMap]",T="[object ArrayBuffer]",x="[object DataView]",C="[object Float32Array]",E="[object Float64Array]",R="[object Int8Array]",M="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",P="[object Uint16Array]",k="[object Uint32Array]",I=/\b__p \+= '';/g,D=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,U=RegExp(j.source),F=RegExp(L.source),B=/<%-([\s\S]+?)%>/g,V=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(G.source),$=/^\s+/,K=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Z=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/[()=,{}\[\]\/\s]/,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,ie=/^[-+]0x[0-9a-f]+$/i,oe=/^0b[01]+$/i,se=/^\[object .+?Constructor\]$/,ae=/^0o[0-7]+$/i,ce=/^(?:0|[1-9]\d*)$/,ue=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,he=/($^)/,le=/['\n\r\u2028\u2029\\]/g,fe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\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",pe="[\\ud800-\\udfff]",ve="["+de+"]",ge="["+fe+"]",me="\\d+",ye="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",_e="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",we="\\ud83c[\\udffb-\\udfff]",Se="[^\\ud800-\\udfff]",Te="(?:\\ud83c[\\udde6-\\uddff]){2}",xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="(?:"+be+"|"+_e+")",Re="(?:"+Ce+"|"+_e+")",Me="(?:"+ge+"|"+we+")"+"?",Oe="[\\ufe0e\\ufe0f]?"+Me+("(?:\\u200d(?:"+[Se,Te,xe].join("|")+")[\\ufe0e\\ufe0f]?"+Me+")*"),Ae="(?:"+[ye,Te,xe].join("|")+")"+Oe,Pe="(?:"+[Se+ge+"?",ge,Te,xe,pe].join("|")+")",ke=RegExp("['’]","g"),Ie=RegExp(ge,"g"),De=RegExp(we+"(?="+we+")|"+Pe+Oe,"g"),Ne=RegExp([Ce+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Ce,"$"].join("|")+")",Re+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Ce+Ee,"$"].join("|")+")",Ce+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ce+"+(?:['’](?: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_])",me,Ae].join("|"),"g"),je=RegExp("[\\u200d\\ud800-\\udfff"+fe+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ue=["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"],Fe=-1,Be={};Be[C]=Be[E]=Be[R]=Be[M]=Be[O]=Be[A]=Be["[object Uint8ClampedArray]"]=Be[P]=Be[k]=!0,Be[c]=Be[u]=Be[T]=Be[h]=Be[x]=Be[l]=Be[f]=Be[d]=Be[v]=Be[g]=Be[m]=Be[y]=Be[b]=Be[_]=Be[S]=!1;var Ve={};Ve[c]=Ve[u]=Ve[T]=Ve[x]=Ve[h]=Ve[l]=Ve[C]=Ve[E]=Ve[R]=Ve[M]=Ve[O]=Ve[v]=Ve[g]=Ve[m]=Ve[y]=Ve[b]=Ve[_]=Ve[w]=Ve[A]=Ve["[object Uint8ClampedArray]"]=Ve[P]=Ve[k]=!0,Ve[f]=Ve[d]=Ve[S]=!1;var We={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},He=parseFloat,qe=parseInt,ze="object"==typeof e&&e&&e.Object===Object&&e,Ge="object"==typeof self&&self&&self.Object===Object&&self,Ye=ze||Ge||Function("return this")(),$e=t&&!t.nodeType&&t,Ke=$e&&"object"==typeof r&&r&&!r.nodeType&&r,Xe=Ke&&Ke.exports===$e,Ze=Xe&&ze.process,Je=function(){try{var e=Ke&&Ke.require&&Ke.require("util").types;return e||Ze&&Ze.binding&&Ze.binding("util")}catch(e){}}(),Qe=Je&&Je.isArrayBuffer,et=Je&&Je.isDate,tt=Je&&Je.isMap,nt=Je&&Je.isRegExp,rt=Je&&Je.isSet,it=Je&&Je.isTypedArray;function ot(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function st(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function at(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ct(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ut(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function ht(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function lt(e,t){return!!(null==e?0:e.length)&&wt(e,t,0)>-1}function ft(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function dt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function pt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function vt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function gt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var yt=Ct("length");function bt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function _t(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function wt(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):_t(e,Tt,n)}function St(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Tt(e){return e!=e}function xt(e,t){var n=null==e?0:e.length;return n?Mt(e,t)/n:NaN}function Ct(e){return function(t){return null==t?void 0:t[e]}}function Et(e){return function(t){return null==e?void 0:e[t]}}function Rt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Mt(e,t){for(var n,r=-1,i=e.length;++r<i;){var o=t(e[r]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Ot(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function At(e){return e?e.slice(0,$t(e)+1).replace($,""):e}function Pt(e){return function(t){return e(t)}}function kt(e,t){return dt(t,(function(t){return e[t]}))}function It(e,t){return e.has(t)}function Dt(e,t){for(var n=-1,r=e.length;++n<r&&wt(t,e[n],0)>-1;);return n}function Nt(e,t){for(var n=e.length;n--&&wt(t,e[n],0)>-1;);return n}function jt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Lt=Et({"À":"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"}),Ut=Et({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+We[e]}function Bt(e){return je.test(e)}function Vt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Wt(e,t){return function(n){return e(t(n))}}function Ht(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function qt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function zt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function Gt(e){return Bt(e)?function(e){var t=De.lastIndex=0;for(;De.test(e);)++t;return t}(e):yt(e)}function Yt(e){return Bt(e)?function(e){return e.match(De)||[]}(e):function(e){return e.split("")}(e)}function $t(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Kt=Et({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Xt=function e(t){var n,r=(t=null==t?Ye:Xt.defaults(Ye.Object(),t,Xt.pick(Ye,Ue))).Array,i=t.Date,K=t.Error,fe=t.Function,de=t.Math,pe=t.Object,ve=t.RegExp,ge=t.String,me=t.TypeError,ye=r.prototype,be=fe.prototype,_e=pe.prototype,we=t["__core-js_shared__"],Se=be.toString,Te=_e.hasOwnProperty,xe=0,Ce=(n=/[^.]+$/.exec(we&&we.keys&&we.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ee=_e.toString,Re=Se.call(pe),Me=Ye._,Oe=ve("^"+Se.call(Te).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ae=Xe?t.Buffer:void 0,Pe=t.Symbol,De=t.Uint8Array,je=Ae?Ae.allocUnsafe:void 0,We=Wt(pe.getPrototypeOf,pe),ze=pe.create,Ge=_e.propertyIsEnumerable,$e=ye.splice,Ke=Pe?Pe.isConcatSpreadable:void 0,Ze=Pe?Pe.iterator:void 0,Je=Pe?Pe.toStringTag:void 0,yt=function(){try{var e=eo(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Et=t.clearTimeout!==Ye.clearTimeout&&t.clearTimeout,Zt=i&&i.now!==Ye.Date.now&&i.now,Jt=t.setTimeout!==Ye.setTimeout&&t.setTimeout,Qt=de.ceil,en=de.floor,tn=pe.getOwnPropertySymbols,nn=Ae?Ae.isBuffer:void 0,rn=t.isFinite,on=ye.join,sn=Wt(pe.keys,pe),an=de.max,cn=de.min,un=i.now,hn=t.parseInt,ln=de.random,fn=ye.reverse,dn=eo(t,"DataView"),pn=eo(t,"Map"),vn=eo(t,"Promise"),gn=eo(t,"Set"),mn=eo(t,"WeakMap"),yn=eo(pe,"create"),bn=mn&&new mn,_n={},wn=Mo(dn),Sn=Mo(pn),Tn=Mo(vn),xn=Mo(gn),Cn=Mo(mn),En=Pe?Pe.prototype:void 0,Rn=En?En.valueOf:void 0,Mn=En?En.toString:void 0;function On(e){if(zs(e)&&!Ds(e)&&!(e instanceof In)){if(e instanceof kn)return e;if(Te.call(e,"__wrapped__"))return Oo(e)}return new kn(e)}var An=function(){function e(){}return function(t){if(!qs(t))return{};if(ze)return ze(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Pn(){}function kn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function In(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Dn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function jn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new jn;++t<n;)this.add(e[t])}function Un(e){var t=this.__data__=new Nn(e);this.size=t.size}function Fn(e,t){var n=Ds(e),r=!n&&Is(e),i=!n&&!r&&Us(e),o=!n&&!r&&!i&&Qs(e),s=n||r||i||o,a=s?Ot(e.length,ge):[],c=a.length;for(var u in e)!t&&!Te.call(e,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ao(u,c))||a.push(u);return a}function Bn(e){var t=e.length;return t?e[Lr(0,t-1)]:void 0}function Vn(e,t){return Co(yi(e),Xn(t,0,e.length))}function Wn(e){return Co(yi(e))}function Hn(e,t,n){(void 0!==n&&!As(e[t],n)||void 0===n&&!(t in e))&&$n(e,t,n)}function qn(e,t,n){var r=e[t];Te.call(e,t)&&As(r,n)&&(void 0!==n||t in e)||$n(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(As(e[n][0],t))return n;return-1}function Gn(e,t,n,r){return tr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function Yn(e,t){return e&&bi(t,wa(t),e)}function $n(e,t,n){"__proto__"==t&&yt?yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Kn(e,t){for(var n=-1,i=t.length,o=r(i),s=null==e;++n<i;)o[n]=s?void 0:ga(e,t[n]);return o}function Xn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Zn(e,t,n,r,i,o){var s,a=1&t,u=2&t,f=4&t;if(n&&(s=i?n(e,r,i,o):n(e)),void 0!==s)return s;if(!qs(e))return e;var S=Ds(e);if(S){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Te.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!a)return yi(e,s)}else{var I=ro(e),D=I==d||I==p;if(Us(e))return fi(e,a);if(I==m||I==c||D&&!i){if(s=u||D?{}:oo(e),!a)return u?function(e,t){return bi(e,no(e),t)}(e,function(e,t){return e&&bi(t,Sa(t),e)}(s,e)):function(e,t){return bi(e,to(e),t)}(e,Yn(s,e))}else{if(!Ve[I])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case T:return di(e);case h:case l:return new r(+e);case x:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case C:case E:case R:case M:case O:case A:case"[object Uint8ClampedArray]":case P:case k:return pi(e,n);case v:return new r;case g:case _:return new r(e);case y:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new r;case w:return i=e,Rn?pe(Rn.call(i)):{}}var i}(e,I,a)}}o||(o=new Un);var N=o.get(e);if(N)return N;o.set(e,s),Xs(e)?e.forEach((function(r){s.add(Zn(r,t,n,r,e,o))})):Gs(e)&&e.forEach((function(r,i){s.set(i,Zn(r,t,n,i,e,o))}));var j=S?void 0:(f?u?Yi:Gi:u?Sa:wa)(e);return at(j||e,(function(r,i){j&&(r=e[i=r]),qn(s,i,Zn(r,t,n,i,e,o))})),s}function Jn(e,t,n){var r=n.length;if(null==e)return!r;for(e=pe(e);r--;){var i=n[r],o=t[i],s=e[i];if(void 0===s&&!(i in e)||!o(s))return!1}return!0}function Qn(e,t,n){if("function"!=typeof e)throw new me(o);return wo((function(){e.apply(void 0,n)}),t)}function er(e,t,n,r){var i=-1,o=lt,s=!0,a=e.length,c=[],u=t.length;if(!a)return c;n&&(t=dt(t,Pt(n))),r?(o=ft,s=!1):t.length>=200&&(o=It,s=!1,t=new Ln(t));e:for(;++i<a;){var h=e[i],l=null==n?h:n(h);if(h=r||0!==h?h:0,s&&l==l){for(var f=u;f--;)if(t[f]===l)continue e;c.push(h)}else o(t,l,r)||c.push(h)}return c}On.templateSettings={escape:B,evaluate:V,interpolate:W,variable:"",imports:{_:On}},On.prototype=Pn.prototype,On.prototype.constructor=On,kn.prototype=An(Pn.prototype),kn.prototype.constructor=kn,In.prototype=An(Pn.prototype),In.prototype.constructor=In,Dn.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},Dn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Dn.prototype.get=function(e){var t=this.__data__;if(yn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Te.call(t,e)?t[e]:void 0},Dn.prototype.has=function(e){var t=this.__data__;return yn?void 0!==t[e]:Te.call(t,e)},Dn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yn&&void 0===t?"__lodash_hash_undefined__":t,this},Nn.prototype.clear=function(){this.__data__=[],this.size=0},Nn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0)&&(n==t.length-1?t.pop():$e.call(t,n,1),--this.size,!0)},Nn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Nn.prototype.has=function(e){return zn(this.__data__,e)>-1},Nn.prototype.set=function(e,t){var n=this.__data__,r=zn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},jn.prototype.clear=function(){this.size=0,this.__data__={hash:new Dn,map:new(pn||Nn),string:new Dn}},jn.prototype.delete=function(e){var t=Ji(this,e).delete(e);return this.size-=t?1:0,t},jn.prototype.get=function(e){return Ji(this,e).get(e)},jn.prototype.has=function(e){return Ji(this,e).has(e)},jn.prototype.set=function(e,t){var n=Ji(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Ln.prototype.add=Ln.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ln.prototype.has=function(e){return this.__data__.has(e)},Un.prototype.clear=function(){this.__data__=new Nn,this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Un.prototype.get=function(e){return this.__data__.get(e)},Un.prototype.has=function(e){return this.__data__.has(e)},Un.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Nn){var r=n.__data__;if(!pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new jn(r)}return n.set(e,t),this.size=n.size,this};var tr=Si(ur),nr=Si(hr,!0);function rr(e,t){var n=!0;return tr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function ir(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(null!=s&&(void 0===a?s==s&&!Js(s):n(s,a)))var a=s,c=o}return c}function or(e,t){var n=[];return tr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function sr(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=so),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?sr(a,t-1,n,r,i):pt(i,a):r||(i[i.length]=a)}return i}var ar=Ti(),cr=Ti(!0);function ur(e,t){return e&&ar(e,t,wa)}function hr(e,t){return e&&cr(e,t,wa)}function lr(e,t){return ht(t,(function(t){return Vs(e[t])}))}function fr(e,t){for(var n=0,r=(t=ci(t,e)).length;null!=e&&n<r;)e=e[Ro(t[n++])];return n&&n==r?e:void 0}function dr(e,t,n){var r=t(e);return Ds(e)?r:pt(r,n(e))}function pr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Je&&Je in pe(e)?function(e){var t=Te.call(e,Je),n=e[Je];try{e[Je]=void 0;var r=!0}catch(e){}var i=Ee.call(e);r&&(t?e[Je]=n:delete e[Je]);return i}(e):function(e){return Ee.call(e)}(e)}function vr(e,t){return e>t}function gr(e,t){return null!=e&&Te.call(e,t)}function mr(e,t){return null!=e&&t in pe(e)}function yr(e,t,n){for(var i=n?ft:lt,o=e[0].length,s=e.length,a=s,c=r(s),u=1/0,h=[];a--;){var l=e[a];a&&t&&(l=dt(l,Pt(t))),u=cn(l.length,u),c[a]=!n&&(t||o>=120&&l.length>=120)?new Ln(a&&l):void 0}l=e[0];var f=-1,d=c[0];e:for(;++f<o&&h.length<u;){var p=l[f],v=t?t(p):p;if(p=n||0!==p?p:0,!(d?It(d,v):i(h,v,n))){for(a=s;--a;){var g=c[a];if(!(g?It(g,v):i(e[a],v,n)))continue e}d&&d.push(v),h.push(p)}}return h}function br(e,t,n){var r=null==(e=mo(e,t=ci(t,e)))?e:e[Ro(Bo(t))];return null==r?void 0:ot(r,e,n)}function _r(e){return zs(e)&&pr(e)==c}function wr(e,t,n,r,i){return e===t||(null==e||null==t||!zs(e)&&!zs(t)?e!=e&&t!=t:function(e,t,n,r,i,o){var s=Ds(e),a=Ds(t),d=s?u:ro(e),p=a?u:ro(t),S=(d=d==c?m:d)==m,C=(p=p==c?m:p)==m,E=d==p;if(E&&Us(e)){if(!Us(t))return!1;s=!0,S=!1}if(E&&!S)return o||(o=new Un),s||Qs(e)?qi(e,t,n,r,i,o):function(e,t,n,r,i,o,s){switch(n){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!o(new De(e),new De(t)));case h:case l:case g:return As(+e,+t);case f:return e.name==t.name&&e.message==t.message;case y:case _:return e==t+"";case v:var a=Vt;case b:var c=1&r;if(a||(a=qt),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var d=qi(a(e),a(t),r,i,o,s);return s.delete(e),d;case w:if(Rn)return Rn.call(e)==Rn.call(t)}return!1}(e,t,d,n,r,i,o);if(!(1&n)){var R=S&&Te.call(e,"__wrapped__"),M=C&&Te.call(t,"__wrapped__");if(R||M){var O=R?e.value():e,A=M?t.value():t;return o||(o=new Un),i(O,A,n,r,o)}}if(!E)return!1;return o||(o=new Un),function(e,t,n,r,i,o){var s=1&n,a=Gi(e),c=a.length,u=Gi(t).length;if(c!=u&&!s)return!1;var h=c;for(;h--;){var l=a[h];if(!(s?l in t:Te.call(t,l)))return!1}var f=o.get(e),d=o.get(t);if(f&&d)return f==t&&d==e;var p=!0;o.set(e,t),o.set(t,e);var v=s;for(;++h<c;){l=a[h];var g=e[l],m=t[l];if(r)var y=s?r(m,g,l,t,e,o):r(g,m,l,e,t,o);if(!(void 0===y?g===m||i(g,m,n,r,o):y)){p=!1;break}v||(v="constructor"==l)}if(p&&!v){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,r,i,o)}(e,t,n,r,wr,i))}function Sr(e,t,n,r){var i=n.length,o=i,s=!r;if(null==e)return!o;for(e=pe(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var c=(a=n[i])[0],u=e[c],h=a[1];if(s&&a[2]){if(void 0===u&&!(c in e))return!1}else{var l=new Un;if(r)var f=r(u,h,c,e,t,l);if(!(void 0===f?wr(h,u,3,r,l):f))return!1}}return!0}function Tr(e){return!(!qs(e)||(t=e,Ce&&Ce in t))&&(Vs(e)?Oe:se).test(Mo(e));var t}function xr(e){return"function"==typeof e?e:null==e?Ya:"object"==typeof e?Ds(e)?Ar(e[0],e[1]):Or(e):nc(e)}function Cr(e){if(!fo(e))return sn(e);var t=[];for(var n in pe(e))Te.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Er(e){if(!qs(e))return function(e){var t=[];if(null!=e)for(var n in pe(e))t.push(n);return t}(e);var t=fo(e),n=[];for(var r in e)("constructor"!=r||!t&&Te.call(e,r))&&n.push(r);return n}function Rr(e,t){return e<t}function Mr(e,t){var n=-1,i=js(e)?r(e.length):[];return tr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Or(e){var t=Qi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||Sr(n,e,t)}}function Ar(e,t){return uo(e)&&po(t)?vo(Ro(e),t):function(n){var r=ga(n,e);return void 0===r&&r===t?ma(n,e):wr(t,r,3)}}function Pr(e,t,n,r,i){e!==t&&ar(t,(function(o,s){if(i||(i=new Un),qs(o))!function(e,t,n,r,i,o,s){var a=bo(e,n),c=bo(t,n),u=s.get(c);if(u)return void Hn(e,n,u);var h=o?o(a,c,n+"",e,t,s):void 0,l=void 0===h;if(l){var f=Ds(c),d=!f&&Us(c),p=!f&&!d&&Qs(c);h=c,f||d||p?Ds(a)?h=a:Ls(a)?h=yi(a):d?(l=!1,h=fi(c,!0)):p?(l=!1,h=pi(c,!0)):h=[]:$s(c)||Is(c)?(h=a,Is(a)?h=aa(a):qs(a)&&!Vs(a)||(h=oo(c))):l=!1}l&&(s.set(c,h),i(h,c,r,o,s),s.delete(c));Hn(e,n,h)}(e,t,s,n,Pr,r,i);else{var a=r?r(bo(e,s),o,s+"",e,t,i):void 0;void 0===a&&(a=o),Hn(e,s,a)}}),Sa)}function kr(e,t){var n=e.length;if(n)return ao(t+=t<0?n:0,n)?e[t]:void 0}function Ir(e,t,n){t=t.length?dt(t,(function(e){return Ds(e)?function(t){return fr(t,1===e.length?e[0]:e)}:e})):[Ya];var r=-1;return t=dt(t,Pt(Zi())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Mr(e,(function(e,n,i){return{criteria:dt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;for(;++r<s;){var c=vi(i[r],o[r]);if(c){if(r>=a)return c;var u=n[r];return c*("desc"==u?-1:1)}}return e.index-t.index}(e,t,n)}))}function Dr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=fr(e,s);n(a,s)&&Wr(o,ci(s,e),a)}return o}function Nr(e,t,n,r){var i=r?St:wt,o=-1,s=t.length,a=e;for(e===t&&(t=yi(t)),n&&(a=dt(e,Pt(n)));++o<s;)for(var c=0,u=t[o],h=n?n(u):u;(c=i(a,h,c,r))>-1;)a!==e&&$e.call(a,c,1),$e.call(e,c,1);return e}function jr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;ao(i)?$e.call(e,i,1):ei(e,i)}}return e}function Lr(e,t){return e+en(ln()*(t-e+1))}function Ur(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=en(t/2))&&(e+=e)}while(t);return n}function Fr(e,t){return So(go(e,t,Ya),e+"")}function Br(e){return Bn(Aa(e))}function Vr(e,t){var n=Aa(e);return Co(n,Xn(t,0,n.length))}function Wr(e,t,n,r){if(!qs(e))return e;for(var i=-1,o=(t=ci(t,e)).length,s=o-1,a=e;null!=a&&++i<o;){var c=Ro(t[i]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=s){var h=a[c];void 0===(u=r?r(h,c,a):void 0)&&(u=qs(h)?h:ao(t[i+1])?[]:{})}qn(a,c,u),a=a[c]}return e}var Hr=bn?function(e,t){return bn.set(e,t),e}:Ya,qr=yt?function(e,t){return yt(e,"toString",{configurable:!0,enumerable:!1,value:qa(t),writable:!0})}:Ya;function zr(e){return Co(Aa(e))}function Gr(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i<o;)s[i]=e[i+t];return s}function Yr(e,t){var n;return tr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function $r(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!Js(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return Kr(e,t,Ya,n)}function Kr(e,t,n,r){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var s=(t=n(t))!=t,a=null===t,c=Js(t),u=void 0===t;i<o;){var h=en((i+o)/2),l=n(e[h]),f=void 0!==l,d=null===l,p=l==l,v=Js(l);if(s)var g=r||p;else g=u?p&&(r||f):a?p&&f&&(r||!d):c?p&&f&&!d&&(r||!v):!d&&!v&&(r?l<=t:l<t);g?i=h+1:o=h}return cn(o,4294967294)}function Xr(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!As(a,c)){var c=a;o[i++]=0===s?0:s}}return o}function Zr(e){return"number"==typeof e?e:Js(e)?NaN:+e}function Jr(e){if("string"==typeof e)return e;if(Ds(e))return dt(e,Jr)+"";if(Js(e))return Mn?Mn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Qr(e,t,n){var r=-1,i=lt,o=e.length,s=!0,a=[],c=a;if(n)s=!1,i=ft;else if(o>=200){var u=t?null:Ui(e);if(u)return qt(u);s=!1,i=It,c=new Ln}else c=t?[]:a;e:for(;++r<o;){var h=e[r],l=t?t(h):h;if(h=n||0!==h?h:0,s&&l==l){for(var f=c.length;f--;)if(c[f]===l)continue e;t&&c.push(l),a.push(h)}else i(c,l,n)||(c!==a&&c.push(l),a.push(h))}return a}function ei(e,t){return null==(e=mo(e,t=ci(t,e)))||delete e[Ro(Bo(t))]}function ti(e,t,n,r){return Wr(e,t,n(fr(e,t)),r)}function ni(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Gr(e,r?0:o,r?o+1:i):Gr(e,r?o+1:0,r?i:o)}function ri(e,t){var n=e;return n instanceof In&&(n=n.value()),vt(t,(function(e,t){return t.func.apply(t.thisArg,pt([e],t.args))}),n)}function ii(e,t,n){var i=e.length;if(i<2)return i?Qr(e[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=e[o],c=-1;++c<i;)c!=o&&(s[o]=er(s[o]||a,e[c],t,n));return Qr(sr(s,1),t,n)}function oi(e,t,n){for(var r=-1,i=e.length,o=t.length,s={};++r<i;){var a=r<o?t[r]:void 0;n(s,e[r],a)}return s}function si(e){return Ls(e)?e:[]}function ai(e){return"function"==typeof e?e:Ya}function ci(e,t){return Ds(e)?e:uo(e,t)?[e]:Eo(ca(e))}var ui=Fr;function hi(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Gr(e,t,n)}var li=Et||function(e){return Ye.clearTimeout(e)};function fi(e,t){if(t)return e.slice();var n=e.length,r=je?je(n):new e.constructor(n);return e.copy(r),r}function di(e){var t=new e.constructor(e.byteLength);return new De(t).set(new De(e)),t}function pi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Js(e),s=void 0!==t,a=null===t,c=t==t,u=Js(t);if(!a&&!u&&!o&&e>t||o&&s&&c&&!a&&!u||r&&s&&c||!n&&c||!i)return 1;if(!r&&!o&&!u&&e<t||u&&n&&i&&!r&&!o||a&&n&&i||!s&&i||!c)return-1}return 0}function gi(e,t,n,i){for(var o=-1,s=e.length,a=n.length,c=-1,u=t.length,h=an(s-a,0),l=r(u+h),f=!i;++c<u;)l[c]=t[c];for(;++o<a;)(f||o<s)&&(l[n[o]]=e[o]);for(;h--;)l[c++]=e[o++];return l}function mi(e,t,n,i){for(var o=-1,s=e.length,a=-1,c=n.length,u=-1,h=t.length,l=an(s-c,0),f=r(l+h),d=!i;++o<l;)f[o]=e[o];for(var p=o;++u<h;)f[p+u]=t[u];for(;++a<c;)(d||o<s)&&(f[p+n[a]]=e[o++]);return f}function yi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function bi(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),i?$n(n,a,c):qn(n,a,c)}return n}function _i(e,t){return function(n,r){var i=Ds(n)?st:Gn,o=t?t():{};return i(n,e,Zi(r,2),o)}}function wi(e){return Fr((function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,s&&co(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=pe(t);++r<i;){var a=n[r];a&&e(t,a,r,o)}return t}))}function Si(e,t){return function(n,r){if(null==n)return n;if(!js(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=pe(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Ti(e){return function(t,n,r){for(var i=-1,o=pe(t),s=r(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===n(o[c],c,o))break}return t}}function xi(e){return function(t){var n=Bt(t=ca(t))?Yt(t):void 0,r=n?n[0]:t.charAt(0),i=n?hi(n,1).join(""):t.slice(1);return r[e]()+i}}function Ci(e){return function(t){return vt(Va(Ia(t).replace(ke,"")),e,"")}}function Ei(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=An(e.prototype),r=e.apply(n,t);return qs(r)?r:n}}function Ri(e){return function(t,n,r){var i=pe(t);if(!js(t)){var o=Zi(n,3);t=wa(t),n=function(e){return o(i[e],e,i)}}var s=e(t,n,r);return s>-1?i[o?t[s]:s]:void 0}}function Mi(e){return zi((function(t){var n=t.length,r=n,i=kn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new me(o);if(i&&!a&&"wrapper"==Ki(s))var a=new kn([],!0)}for(r=a?r:n;++r<n;){var c=Ki(s=t[r]),u="wrapper"==c?$i(s):void 0;a=u&&ho(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?a[Ki(u[0])].apply(a,u[3]):1==s.length&&ho(s)?a[c]():a.thru(s)}return function(){var e=arguments,r=e[0];if(a&&1==e.length&&Ds(r))return a.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Oi(e,t,n,i,o,s,a,c,u,h){var l=128&t,f=1&t,d=2&t,p=24&t,v=512&t,g=d?void 0:Ei(e);return function m(){for(var y=arguments.length,b=r(y),_=y;_--;)b[_]=arguments[_];if(p)var w=Xi(m),S=jt(b,w);if(i&&(b=gi(b,i,o,p)),s&&(b=mi(b,s,a,p)),y-=S,p&&y<h){var T=Ht(b,w);return ji(e,t,Oi,m.placeholder,n,b,T,c,u,h-y)}var x=f?n:this,C=d?x[e]:e;return y=b.length,c?b=yo(b,c):v&&y>1&&b.reverse(),l&&u<y&&(b.length=u),this&&this!==Ye&&this instanceof m&&(C=g||Ei(C)),C.apply(x,b)}}function Ai(e,t){return function(n,r){return function(e,t,n,r){return ur(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Pi(e,t){return function(n,r){var i;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Jr(n),r=Jr(r)):(n=Zr(n),r=Zr(r)),i=e(n,r)}return i}}function ki(e){return zi((function(t){return t=dt(t,Pt(Zi())),Fr((function(n){var r=this;return e(t,(function(e){return ot(e,r,n)}))}))}))}function Ii(e,t){var n=(t=void 0===t?" ":Jr(t)).length;if(n<2)return n?Ur(t,e):t;var r=Ur(t,Qt(e/Gt(t)));return Bt(t)?hi(Yt(r),0,e).join(""):r.slice(0,e)}function Di(e){return function(t,n,i){return i&&"number"!=typeof i&&co(t,n,i)&&(n=i=void 0),t=ra(t),void 0===n?(n=t,t=0):n=ra(n),function(e,t,n,i){for(var o=-1,s=an(Qt((t-e)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=e,e+=n;return a}(t,n,i=void 0===i?t<n?1:-1:ra(i),e)}}function Ni(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=sa(t),n=sa(n)),e(t,n)}}function ji(e,t,n,r,i,o,s,a,c,u){var h=8&t;t|=h?32:64,4&(t&=~(h?64:32))||(t&=-4);var l=[e,t,i,h?o:void 0,h?s:void 0,h?void 0:o,h?void 0:s,a,c,u],f=n.apply(void 0,l);return ho(e)&&_o(f,l),f.placeholder=r,To(f,e,t)}function Li(e){var t=de[e];return function(e,n){if(e=sa(e),(n=null==n?0:cn(ia(n),292))&&rn(e)){var r=(ca(e)+"e").split("e");return+((r=(ca(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Ui=gn&&1/qt(new gn([,-0]))[1]==1/0?function(e){return new gn(e)}:Ja;function Fi(e){return function(t){var n=ro(t);return n==v?Vt(t):n==b?zt(t):function(e,t){return dt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Bi(e,t,n,i,a,c,u,h){var l=2&t;if(!l&&"function"!=typeof e)throw new me(o);var f=i?i.length:0;if(f||(t&=-97,i=a=void 0),u=void 0===u?u:an(ia(u),0),h=void 0===h?h:ia(h),f-=a?a.length:0,64&t){var d=i,p=a;i=a=void 0}var v=l?void 0:$i(e),g=[e,t,n,i,a,d,p,c,u,h];if(v&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var c=t[3];if(c){var u=e[3];e[3]=u?gi(u,c,t[4]):c,e[4]=u?Ht(e[3],s):t[4]}(c=t[5])&&(u=e[5],e[5]=u?mi(u,c,t[6]):c,e[6]=u?Ht(e[5],s):t[6]);(c=t[7])&&(e[7]=c);128&r&&(e[8]=null==e[8]?t[8]:cn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(g,v),e=g[0],t=g[1],n=g[2],i=g[3],a=g[4],!(h=g[9]=void 0===g[9]?l?0:e.length:an(g[9]-f,0))&&24&t&&(t&=-25),t&&1!=t)m=8==t||16==t?function(e,t,n){var i=Ei(e);return function o(){for(var s=arguments.length,a=r(s),c=s,u=Xi(o);c--;)a[c]=arguments[c];var h=s<3&&a[0]!==u&&a[s-1]!==u?[]:Ht(a,u);if((s-=h.length)<n)return ji(e,t,Oi,o.placeholder,void 0,a,h,void 0,void 0,n-s);var l=this&&this!==Ye&&this instanceof o?i:e;return ot(l,this,a)}}(e,t,h):32!=t&&33!=t||a.length?Oi.apply(void 0,g):function(e,t,n,i){var o=1&t,s=Ei(e);return function t(){for(var a=-1,c=arguments.length,u=-1,h=i.length,l=r(h+c),f=this&&this!==Ye&&this instanceof t?s:e;++u<h;)l[u]=i[u];for(;c--;)l[u++]=arguments[++a];return ot(f,o?n:this,l)}}(e,t,n,i);else var m=function(e,t,n){var r=1&t,i=Ei(e);return function t(){var o=this&&this!==Ye&&this instanceof t?i:e;return o.apply(r?n:this,arguments)}}(e,t,n);return To((v?Hr:_o)(m,g),e,t)}function Vi(e,t,n,r){return void 0===e||As(e,_e[n])&&!Te.call(r,n)?t:e}function Wi(e,t,n,r,i,o){return qs(e)&&qs(t)&&(o.set(t,e),Pr(e,t,void 0,Wi,o),o.delete(t)),e}function Hi(e){return $s(e)?void 0:e}function qi(e,t,n,r,i,o){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(e),h=o.get(t);if(u&&h)return u==t&&h==e;var l=-1,f=!0,d=2&n?new Ln:void 0;for(o.set(e,t),o.set(t,e);++l<a;){var p=e[l],v=t[l];if(r)var g=s?r(v,p,l,t,e,o):r(p,v,l,e,t,o);if(void 0!==g){if(g)continue;f=!1;break}if(d){if(!mt(t,(function(e,t){if(!It(d,t)&&(p===e||i(p,e,n,r,o)))return d.push(t)}))){f=!1;break}}else if(p!==v&&!i(p,v,n,r,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function zi(e){return So(go(e,void 0,No),e+"")}function Gi(e){return dr(e,wa,to)}function Yi(e){return dr(e,Sa,no)}var $i=bn?function(e){return bn.get(e)}:Ja;function Ki(e){for(var t=e.name+"",n=_n[t],r=Te.call(_n,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function Xi(e){return(Te.call(On,"placeholder")?On:e).placeholder}function Zi(){var e=On.iteratee||$a;return e=e===$a?xr:e,arguments.length?e(arguments[0],arguments[1]):e}function Ji(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Qi(e){for(var t=wa(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,po(i)]}return t}function eo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Tr(n)?n:void 0}var to=tn?function(e){return null==e?[]:(e=pe(e),ht(tn(e),(function(t){return Ge.call(e,t)})))}:oc,no=tn?function(e){for(var t=[];e;)pt(t,to(e)),e=We(e);return t}:oc,ro=pr;function io(e,t,n){for(var r=-1,i=(t=ci(t,e)).length,o=!1;++r<i;){var s=Ro(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Hs(i)&&ao(s,i)&&(Ds(e)||Is(e))}function oo(e){return"function"!=typeof e.constructor||fo(e)?{}:An(We(e))}function so(e){return Ds(e)||Is(e)||!!(Ke&&e&&e[Ke])}function ao(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ce.test(e))&&e>-1&&e%1==0&&e<t}function co(e,t,n){if(!qs(n))return!1;var r=typeof t;return!!("number"==r?js(n)&&ao(t,n.length):"string"==r&&t in n)&&As(n[t],e)}function uo(e,t){if(Ds(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Js(e))||(q.test(e)||!H.test(e)||null!=t&&e in pe(t))}function ho(e){var t=Ki(e),n=On[t];if("function"!=typeof n||!(t in In.prototype))return!1;if(e===n)return!0;var r=$i(n);return!!r&&e===r[0]}(dn&&ro(new dn(new ArrayBuffer(1)))!=x||pn&&ro(new pn)!=v||vn&&"[object Promise]"!=ro(vn.resolve())||gn&&ro(new gn)!=b||mn&&ro(new mn)!=S)&&(ro=function(e){var t=pr(e),n=t==m?e.constructor:void 0,r=n?Mo(n):"";if(r)switch(r){case wn:return x;case Sn:return v;case Tn:return"[object Promise]";case xn:return b;case Cn:return S}return t});var lo=we?Vs:sc;function fo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function po(e){return e==e&&!qs(e)}function vo(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in pe(n)))}}function go(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=an(i.length-t,0),a=r(s);++o<s;)a[o]=i[t+o];o=-1;for(var c=r(t+1);++o<t;)c[o]=i[o];return c[t]=n(a),ot(e,this,c)}}function mo(e,t){return t.length<2?e:fr(e,Gr(t,0,-1))}function yo(e,t){for(var n=e.length,r=cn(t.length,n),i=yi(e);r--;){var o=t[r];e[r]=ao(o,n)?i[o]:void 0}return e}function bo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=xo(Hr),wo=Jt||function(e,t){return Ye.setTimeout(e,t)},So=xo(qr);function To(e,t,n){var r=t+"";return So(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(X,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return at(a,(function(n){var r="_."+n[0];t&n[1]&&!lt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(Z);return t?t[1].split(J):[]}(r),n)))}function xo(e){var t=0,n=0;return function(){var r=un(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Co(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n<t;){var o=Lr(n,i),s=e[o];e[o]=e[n],e[n]=s}return e.length=t,e}var Eo=function(e){var t=xs(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,(function(e,n,r,i){t.push(r?i.replace(te,"$1"):n||e)})),t}));function Ro(e){if("string"==typeof e||Js(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mo(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oo(e){if(e instanceof In)return e.clone();var t=new kn(e.__wrapped__,e.__chain__);return t.__actions__=yi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ao=Fr((function(e,t){return Ls(e)?er(e,sr(t,1,Ls,!0)):[]})),Po=Fr((function(e,t){var n=Bo(t);return Ls(n)&&(n=void 0),Ls(e)?er(e,sr(t,1,Ls,!0),Zi(n,2)):[]})),ko=Fr((function(e,t){var n=Bo(t);return Ls(n)&&(n=void 0),Ls(e)?er(e,sr(t,1,Ls,!0),void 0,n):[]}));function Io(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ia(n);return i<0&&(i=an(r+i,0)),_t(e,Zi(t,3),i)}function Do(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=ia(n),i=n<0?an(r+i,0):cn(i,r-1)),_t(e,Zi(t,3),i,!0)}function No(e){return(null==e?0:e.length)?sr(e,1):[]}function jo(e){return e&&e.length?e[0]:void 0}var Lo=Fr((function(e){var t=dt(e,si);return t.length&&t[0]===e[0]?yr(t):[]})),Uo=Fr((function(e){var t=Bo(e),n=dt(e,si);return t===Bo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?yr(n,Zi(t,2)):[]})),Fo=Fr((function(e){var t=Bo(e),n=dt(e,si);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?yr(n,void 0,t):[]}));function Bo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Vo=Fr(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Nr(e,t):e}var Ho=zi((function(e,t){var n=null==e?0:e.length,r=Kn(e,t);return jr(e,dt(t,(function(e){return ao(e,n)?+e:e})).sort(vi)),r}));function qo(e){return null==e?e:fn.call(e)}var zo=Fr((function(e){return Qr(sr(e,1,Ls,!0))})),Go=Fr((function(e){var t=Bo(e);return Ls(t)&&(t=void 0),Qr(sr(e,1,Ls,!0),Zi(t,2))})),Yo=Fr((function(e){var t=Bo(e);return t="function"==typeof t?t:void 0,Qr(sr(e,1,Ls,!0),void 0,t)}));function $o(e){if(!e||!e.length)return[];var t=0;return e=ht(e,(function(e){if(Ls(e))return t=an(e.length,t),!0})),Ot(t,(function(t){return dt(e,Ct(t))}))}function Ko(e,t){if(!e||!e.length)return[];var n=$o(e);return null==t?n:dt(n,(function(e){return ot(t,void 0,e)}))}var Xo=Fr((function(e,t){return Ls(e)?er(e,t):[]})),Zo=Fr((function(e){return ii(ht(e,Ls))})),Jo=Fr((function(e){var t=Bo(e);return Ls(t)&&(t=void 0),ii(ht(e,Ls),Zi(t,2))})),Qo=Fr((function(e){var t=Bo(e);return t="function"==typeof t?t:void 0,ii(ht(e,Ls),void 0,t)})),es=Fr($o);var ts=Fr((function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Ko(e,n)}));function ns(e){var t=On(e);return t.__chain__=!0,t}function rs(e,t){return t(e)}var is=zi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Kn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof In&&ao(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:rs,args:[i],thisArg:void 0}),new kn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var os=_i((function(e,t,n){Te.call(e,n)?++e[n]:$n(e,n,1)}));var ss=Ri(Io),as=Ri(Do);function cs(e,t){return(Ds(e)?at:tr)(e,Zi(t,3))}function us(e,t){return(Ds(e)?ct:nr)(e,Zi(t,3))}var hs=_i((function(e,t,n){Te.call(e,n)?e[n].push(t):$n(e,n,[t])}));var ls=Fr((function(e,t,n){var i=-1,o="function"==typeof t,s=js(e)?r(e.length):[];return tr(e,(function(e){s[++i]=o?ot(t,e,n):br(e,t,n)})),s})),fs=_i((function(e,t,n){$n(e,n,t)}));function ds(e,t){return(Ds(e)?dt:Mr)(e,Zi(t,3))}var ps=_i((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var vs=Fr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&co(e,t[0],t[1])?t=[]:n>2&&co(t[0],t[1],t[2])&&(t=[t[0]]),Ir(e,sr(t,1),[])})),gs=Zt||function(){return Ye.Date.now()};function ms(e,t,n){return t=n?void 0:t,Bi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ys(e,t){var n;if("function"!=typeof t)throw new me(o);return e=ia(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var bs=Fr((function(e,t,n){var r=1;if(n.length){var i=Ht(n,Xi(bs));r|=32}return Bi(e,r,t,n,i)})),_s=Fr((function(e,t,n){var r=3;if(n.length){var i=Ht(n,Xi(_s));r|=32}return Bi(t,r,e,n,i)}));function ws(e,t,n){var r,i,s,a,c,u,h=0,l=!1,f=!1,d=!0;if("function"!=typeof e)throw new me(o);function p(t){var n=r,o=i;return r=i=void 0,h=t,a=e.apply(o,n)}function v(e){return h=e,c=wo(m,t),l?p(e):a}function g(e){var n=e-u;return void 0===u||n>=t||n<0||f&&e-h>=s}function m(){var e=gs();if(g(e))return y(e);c=wo(m,function(e){var n=t-(e-u);return f?cn(n,s-(e-h)):n}(e))}function y(e){return c=void 0,d&&r?p(e):(r=i=void 0,a)}function b(){var e=gs(),n=g(e);if(r=arguments,i=this,u=e,n){if(void 0===c)return v(u);if(f)return li(c),c=wo(m,t),p(u)}return void 0===c&&(c=wo(m,t)),a}return t=sa(t)||0,qs(n)&&(l=!!n.leading,s=(f="maxWait"in n)?an(sa(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==c&&li(c),h=0,r=u=i=c=void 0},b.flush=function(){return void 0===c?a:y(gs())},b}var Ss=Fr((function(e,t){return Qn(e,1,t)})),Ts=Fr((function(e,t,n){return Qn(e,sa(t)||0,n)}));function xs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new me(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(xs.Cache||jn),n}function Cs(e){if("function"!=typeof e)throw new me(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}xs.Cache=jn;var Es=ui((function(e,t){var n=(t=1==t.length&&Ds(t[0])?dt(t[0],Pt(Zi())):dt(sr(t,1),Pt(Zi()))).length;return Fr((function(r){for(var i=-1,o=cn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return ot(e,this,r)}))})),Rs=Fr((function(e,t){return Bi(e,32,void 0,t,Ht(t,Xi(Rs)))})),Ms=Fr((function(e,t){return Bi(e,64,void 0,t,Ht(t,Xi(Ms)))})),Os=zi((function(e,t){return Bi(e,256,void 0,void 0,void 0,t)}));function As(e,t){return e===t||e!=e&&t!=t}var Ps=Ni(vr),ks=Ni((function(e,t){return e>=t})),Is=_r(function(){return arguments}())?_r:function(e){return zs(e)&&Te.call(e,"callee")&&!Ge.call(e,"callee")},Ds=r.isArray,Ns=Qe?Pt(Qe):function(e){return zs(e)&&pr(e)==T};function js(e){return null!=e&&Hs(e.length)&&!Vs(e)}function Ls(e){return zs(e)&&js(e)}var Us=nn||sc,Fs=et?Pt(et):function(e){return zs(e)&&pr(e)==l};function Bs(e){if(!zs(e))return!1;var t=pr(e);return t==f||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!$s(e)}function Vs(e){if(!qs(e))return!1;var t=pr(e);return t==d||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ws(e){return"number"==typeof e&&e==ia(e)}function Hs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function qs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function zs(e){return null!=e&&"object"==typeof e}var Gs=tt?Pt(tt):function(e){return zs(e)&&ro(e)==v};function Ys(e){return"number"==typeof e||zs(e)&&pr(e)==g}function $s(e){if(!zs(e)||pr(e)!=m)return!1;var t=We(e);if(null===t)return!0;var n=Te.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Re}var Ks=nt?Pt(nt):function(e){return zs(e)&&pr(e)==y};var Xs=rt?Pt(rt):function(e){return zs(e)&&ro(e)==b};function Zs(e){return"string"==typeof e||!Ds(e)&&zs(e)&&pr(e)==_}function Js(e){return"symbol"==typeof e||zs(e)&&pr(e)==w}var Qs=it?Pt(it):function(e){return zs(e)&&Hs(e.length)&&!!Be[pr(e)]};var ea=Ni(Rr),ta=Ni((function(e,t){return e<=t}));function na(e){if(!e)return[];if(js(e))return Zs(e)?Yt(e):yi(e);if(Ze&&e[Ze])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ze]());var t=ro(e);return(t==v?Vt:t==b?qt:Aa)(e)}function ra(e){return e?(e=sa(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ia(e){var t=ra(e),n=t%1;return t==t?n?t-n:t:0}function oa(e){return e?Xn(ia(e),0,4294967295):0}function sa(e){if("number"==typeof e)return e;if(Js(e))return NaN;if(qs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=qs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=At(e);var n=oe.test(e);return n||ae.test(e)?qe(e.slice(2),n?2:8):ie.test(e)?NaN:+e}function aa(e){return bi(e,Sa(e))}function ca(e){return null==e?"":Jr(e)}var ua=wi((function(e,t){if(fo(t)||js(t))bi(t,wa(t),e);else for(var n in t)Te.call(t,n)&&qn(e,n,t[n])})),ha=wi((function(e,t){bi(t,Sa(t),e)})),la=wi((function(e,t,n,r){bi(t,Sa(t),e,r)})),fa=wi((function(e,t,n,r){bi(t,wa(t),e,r)})),da=zi(Kn);var pa=Fr((function(e,t){e=pe(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&co(t[0],t[1],i)&&(r=1);++n<r;)for(var o=t[n],s=Sa(o),a=-1,c=s.length;++a<c;){var u=s[a],h=e[u];(void 0===h||As(h,_e[u])&&!Te.call(e,u))&&(e[u]=o[u])}return e})),va=Fr((function(e){return e.push(void 0,Wi),ot(xa,void 0,e)}));function ga(e,t,n){var r=null==e?void 0:fr(e,t);return void 0===r?n:r}function ma(e,t){return null!=e&&io(e,t,mr)}var ya=Ai((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ee.call(t)),e[t]=n}),qa(Ya)),ba=Ai((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ee.call(t)),Te.call(e,t)?e[t].push(n):e[t]=[n]}),Zi),_a=Fr(br);function wa(e){return js(e)?Fn(e):Cr(e)}function Sa(e){return js(e)?Fn(e,!0):Er(e)}var Ta=wi((function(e,t,n){Pr(e,t,n)})),xa=wi((function(e,t,n,r){Pr(e,t,n,r)})),Ca=zi((function(e,t){var n={};if(null==e)return n;var r=!1;t=dt(t,(function(t){return t=ci(t,e),r||(r=t.length>1),t})),bi(e,Yi(e),n),r&&(n=Zn(n,7,Hi));for(var i=t.length;i--;)ei(n,t[i]);return n}));var Ea=zi((function(e,t){return null==e?{}:function(e,t){return Dr(e,t,(function(t,n){return ma(e,n)}))}(e,t)}));function Ra(e,t){if(null==e)return{};var n=dt(Yi(e),(function(e){return[e]}));return t=Zi(t),Dr(e,n,(function(e,n){return t(e,n[0])}))}var Ma=Fi(wa),Oa=Fi(Sa);function Aa(e){return null==e?[]:kt(e,wa(e))}var Pa=Ci((function(e,t,n){return t=t.toLowerCase(),e+(n?ka(t):t)}));function ka(e){return Ba(ca(e).toLowerCase())}function Ia(e){return(e=ca(e))&&e.replace(ue,Lt).replace(Ie,"")}var Da=Ci((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Na=Ci((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),ja=xi("toLowerCase");var La=Ci((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ua=Ci((function(e,t,n){return e+(n?" ":"")+Ba(t)}));var Fa=Ci((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ba=xi("toUpperCase");function Va(e,t,n){return e=ca(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(Ne)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Wa=Fr((function(e,t){try{return ot(e,void 0,t)}catch(e){return Bs(e)?e:new K(e)}})),Ha=zi((function(e,t){return at(t,(function(t){t=Ro(t),$n(e,t,bs(e[t],e))})),e}));function qa(e){return function(){return e}}var za=Mi(),Ga=Mi(!0);function Ya(e){return e}function $a(e){return xr("function"==typeof e?e:Zn(e,1))}var Ka=Fr((function(e,t){return function(n){return br(n,e,t)}})),Xa=Fr((function(e,t){return function(n){return br(e,n,t)}}));function Za(e,t,n){var r=wa(t),i=lr(t,r);null!=n||qs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=lr(t,wa(t)));var o=!(qs(n)&&"chain"in n&&!n.chain),s=Vs(e);return at(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=yi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,pt([this.value()],arguments))})})),e}function Ja(){}var Qa=ki(dt),ec=ki(ut),tc=ki(mt);function nc(e){return uo(e)?Ct(Ro(e)):function(e){return function(t){return fr(t,e)}}(e)}var rc=Di(),ic=Di(!0);function oc(){return[]}function sc(){return!1}var ac=Pi((function(e,t){return e+t}),0),cc=Li("ceil"),uc=Pi((function(e,t){return e/t}),1),hc=Li("floor");var lc,fc=Pi((function(e,t){return e*t}),1),dc=Li("round"),pc=Pi((function(e,t){return e-t}),0);return On.after=function(e,t){if("function"!=typeof t)throw new me(o);return e=ia(e),function(){if(--e<1)return t.apply(this,arguments)}},On.ary=ms,On.assign=ua,On.assignIn=ha,On.assignInWith=la,On.assignWith=fa,On.at=da,On.before=ys,On.bind=bs,On.bindAll=Ha,On.bindKey=_s,On.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ds(e)?e:[e]},On.chain=ns,On.chunk=function(e,t,n){t=(n?co(e,t,n):void 0===t)?1:an(ia(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,s=0,a=r(Qt(i/t));o<i;)a[s++]=Gr(e,o,o+=t);return a},On.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},On.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return pt(Ds(n)?yi(n):[n],sr(t,1))},On.cond=function(e){var t=null==e?0:e.length,n=Zi();return e=t?dt(e,(function(e){if("function"!=typeof e[1])throw new me(o);return[n(e[0]),e[1]]})):[],Fr((function(n){for(var r=-1;++r<t;){var i=e[r];if(ot(i[0],this,n))return ot(i[1],this,n)}}))},On.conforms=function(e){return function(e){var t=wa(e);return function(n){return Jn(n,e,t)}}(Zn(e,1))},On.constant=qa,On.countBy=os,On.create=function(e,t){var n=An(e);return null==t?n:Yn(n,t)},On.curry=function e(t,n,r){var i=Bi(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=e.placeholder,i},On.curryRight=function e(t,n,r){var i=Bi(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=e.placeholder,i},On.debounce=ws,On.defaults=pa,On.defaultsDeep=va,On.defer=Ss,On.delay=Ts,On.difference=Ao,On.differenceBy=Po,On.differenceWith=ko,On.drop=function(e,t,n){var r=null==e?0:e.length;return r?Gr(e,(t=n||void 0===t?1:ia(t))<0?0:t,r):[]},On.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Gr(e,0,(t=r-(t=n||void 0===t?1:ia(t)))<0?0:t):[]},On.dropRightWhile=function(e,t){return e&&e.length?ni(e,Zi(t,3),!0,!0):[]},On.dropWhile=function(e,t){return e&&e.length?ni(e,Zi(t,3),!0):[]},On.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&co(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=ia(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:ia(r))<0&&(r+=i),r=n>r?0:oa(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},On.filter=function(e,t){return(Ds(e)?ht:or)(e,Zi(t,3))},On.flatMap=function(e,t){return sr(ds(e,t),1)},On.flatMapDeep=function(e,t){return sr(ds(e,t),1/0)},On.flatMapDepth=function(e,t,n){return n=void 0===n?1:ia(n),sr(ds(e,t),n)},On.flatten=No,On.flattenDeep=function(e){return(null==e?0:e.length)?sr(e,1/0):[]},On.flattenDepth=function(e,t){return(null==e?0:e.length)?sr(e,t=void 0===t?1:ia(t)):[]},On.flip=function(e){return Bi(e,512)},On.flow=za,On.flowRight=Ga,On.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},On.functions=function(e){return null==e?[]:lr(e,wa(e))},On.functionsIn=function(e){return null==e?[]:lr(e,Sa(e))},On.groupBy=hs,On.initial=function(e){return(null==e?0:e.length)?Gr(e,0,-1):[]},On.intersection=Lo,On.intersectionBy=Uo,On.intersectionWith=Fo,On.invert=ya,On.invertBy=ba,On.invokeMap=ls,On.iteratee=$a,On.keyBy=fs,On.keys=wa,On.keysIn=Sa,On.map=ds,On.mapKeys=function(e,t){var n={};return t=Zi(t,3),ur(e,(function(e,r,i){$n(n,t(e,r,i),e)})),n},On.mapValues=function(e,t){var n={};return t=Zi(t,3),ur(e,(function(e,r,i){$n(n,r,t(e,r,i))})),n},On.matches=function(e){return Or(Zn(e,1))},On.matchesProperty=function(e,t){return Ar(e,Zn(t,1))},On.memoize=xs,On.merge=Ta,On.mergeWith=xa,On.method=Ka,On.methodOf=Xa,On.mixin=Za,On.negate=Cs,On.nthArg=function(e){return e=ia(e),Fr((function(t){return kr(t,e)}))},On.omit=Ca,On.omitBy=function(e,t){return Ra(e,Cs(Zi(t)))},On.once=function(e){return ys(2,e)},On.orderBy=function(e,t,n,r){return null==e?[]:(Ds(t)||(t=null==t?[]:[t]),Ds(n=r?void 0:n)||(n=null==n?[]:[n]),Ir(e,t,n))},On.over=Qa,On.overArgs=Es,On.overEvery=ec,On.overSome=tc,On.partial=Rs,On.partialRight=Ms,On.partition=ps,On.pick=Ea,On.pickBy=Ra,On.property=nc,On.propertyOf=function(e){return function(t){return null==e?void 0:fr(e,t)}},On.pull=Vo,On.pullAll=Wo,On.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Nr(e,t,Zi(n,2)):e},On.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Nr(e,t,void 0,n):e},On.pullAt=Ho,On.range=rc,On.rangeRight=ic,On.rearg=Os,On.reject=function(e,t){return(Ds(e)?ht:or)(e,Cs(Zi(t,3)))},On.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=Zi(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return jr(e,i),n},On.rest=function(e,t){if("function"!=typeof e)throw new me(o);return Fr(e,t=void 0===t?t:ia(t))},On.reverse=qo,On.sampleSize=function(e,t,n){return t=(n?co(e,t,n):void 0===t)?1:ia(t),(Ds(e)?Vn:Vr)(e,t)},On.set=function(e,t,n){return null==e?e:Wr(e,t,n)},On.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Wr(e,t,n,r)},On.shuffle=function(e){return(Ds(e)?Wn:zr)(e)},On.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&co(e,t,n)?(t=0,n=r):(t=null==t?0:ia(t),n=void 0===n?r:ia(n)),Gr(e,t,n)):[]},On.sortBy=vs,On.sortedUniq=function(e){return e&&e.length?Xr(e):[]},On.sortedUniqBy=function(e,t){return e&&e.length?Xr(e,Zi(t,2)):[]},On.split=function(e,t,n){return n&&"number"!=typeof n&&co(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ca(e))&&("string"==typeof t||null!=t&&!Ks(t))&&!(t=Jr(t))&&Bt(e)?hi(Yt(e),0,n):e.split(t,n):[]},On.spread=function(e,t){if("function"!=typeof e)throw new me(o);return t=null==t?0:an(ia(t),0),Fr((function(n){var r=n[t],i=hi(n,0,t);return r&&pt(i,r),ot(e,this,i)}))},On.tail=function(e){var t=null==e?0:e.length;return t?Gr(e,1,t):[]},On.take=function(e,t,n){return e&&e.length?Gr(e,0,(t=n||void 0===t?1:ia(t))<0?0:t):[]},On.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Gr(e,(t=r-(t=n||void 0===t?1:ia(t)))<0?0:t,r):[]},On.takeRightWhile=function(e,t){return e&&e.length?ni(e,Zi(t,3),!1,!0):[]},On.takeWhile=function(e,t){return e&&e.length?ni(e,Zi(t,3)):[]},On.tap=function(e,t){return t(e),e},On.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new me(o);return qs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ws(e,t,{leading:r,maxWait:t,trailing:i})},On.thru=rs,On.toArray=na,On.toPairs=Ma,On.toPairsIn=Oa,On.toPath=function(e){return Ds(e)?dt(e,Ro):Js(e)?[e]:yi(Eo(ca(e)))},On.toPlainObject=aa,On.transform=function(e,t,n){var r=Ds(e),i=r||Us(e)||Qs(e);if(t=Zi(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:qs(e)&&Vs(o)?An(We(e)):{}}return(i?at:ur)(e,(function(e,r,i){return t(n,e,r,i)})),n},On.unary=function(e){return ms(e,1)},On.union=zo,On.unionBy=Go,On.unionWith=Yo,On.uniq=function(e){return e&&e.length?Qr(e):[]},On.uniqBy=function(e,t){return e&&e.length?Qr(e,Zi(t,2)):[]},On.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qr(e,void 0,t):[]},On.unset=function(e,t){return null==e||ei(e,t)},On.unzip=$o,On.unzipWith=Ko,On.update=function(e,t,n){return null==e?e:ti(e,t,ai(n))},On.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:ti(e,t,ai(n),r)},On.values=Aa,On.valuesIn=function(e){return null==e?[]:kt(e,Sa(e))},On.without=Xo,On.words=Va,On.wrap=function(e,t){return Rs(ai(t),e)},On.xor=Zo,On.xorBy=Jo,On.xorWith=Qo,On.zip=es,On.zipObject=function(e,t){return oi(e||[],t||[],qn)},On.zipObjectDeep=function(e,t){return oi(e||[],t||[],Wr)},On.zipWith=ts,On.entries=Ma,On.entriesIn=Oa,On.extend=ha,On.extendWith=la,Za(On,On),On.add=ac,On.attempt=Wa,On.camelCase=Pa,On.capitalize=ka,On.ceil=cc,On.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=sa(n))==n?n:0),void 0!==t&&(t=(t=sa(t))==t?t:0),Xn(sa(e),t,n)},On.clone=function(e){return Zn(e,4)},On.cloneDeep=function(e){return Zn(e,5)},On.cloneDeepWith=function(e,t){return Zn(e,5,t="function"==typeof t?t:void 0)},On.cloneWith=function(e,t){return Zn(e,4,t="function"==typeof t?t:void 0)},On.conformsTo=function(e,t){return null==t||Jn(e,t,wa(t))},On.deburr=Ia,On.defaultTo=function(e,t){return null==e||e!=e?t:e},On.divide=uc,On.endsWith=function(e,t,n){e=ca(e),t=Jr(t);var r=e.length,i=n=void 0===n?r:Xn(ia(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},On.eq=As,On.escape=function(e){return(e=ca(e))&&F.test(e)?e.replace(L,Ut):e},On.escapeRegExp=function(e){return(e=ca(e))&&Y.test(e)?e.replace(G,"\\$&"):e},On.every=function(e,t,n){var r=Ds(e)?ut:rr;return n&&co(e,t,n)&&(t=void 0),r(e,Zi(t,3))},On.find=ss,On.findIndex=Io,On.findKey=function(e,t){return bt(e,Zi(t,3),ur)},On.findLast=as,On.findLastIndex=Do,On.findLastKey=function(e,t){return bt(e,Zi(t,3),hr)},On.floor=hc,On.forEach=cs,On.forEachRight=us,On.forIn=function(e,t){return null==e?e:ar(e,Zi(t,3),Sa)},On.forInRight=function(e,t){return null==e?e:cr(e,Zi(t,3),Sa)},On.forOwn=function(e,t){return e&&ur(e,Zi(t,3))},On.forOwnRight=function(e,t){return e&&hr(e,Zi(t,3))},On.get=ga,On.gt=Ps,On.gte=ks,On.has=function(e,t){return null!=e&&io(e,t,gr)},On.hasIn=ma,On.head=jo,On.identity=Ya,On.includes=function(e,t,n,r){e=js(e)?e:Aa(e),n=n&&!r?ia(n):0;var i=e.length;return n<0&&(n=an(i+n,0)),Zs(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&wt(e,t,n)>-1},On.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ia(n);return i<0&&(i=an(r+i,0)),wt(e,t,i)},On.inRange=function(e,t,n){return t=ra(t),void 0===n?(n=t,t=0):n=ra(n),function(e,t,n){return e>=cn(t,n)&&e<an(t,n)}(e=sa(e),t,n)},On.invoke=_a,On.isArguments=Is,On.isArray=Ds,On.isArrayBuffer=Ns,On.isArrayLike=js,On.isArrayLikeObject=Ls,On.isBoolean=function(e){return!0===e||!1===e||zs(e)&&pr(e)==h},On.isBuffer=Us,On.isDate=Fs,On.isElement=function(e){return zs(e)&&1===e.nodeType&&!$s(e)},On.isEmpty=function(e){if(null==e)return!0;if(js(e)&&(Ds(e)||"string"==typeof e||"function"==typeof e.splice||Us(e)||Qs(e)||Is(e)))return!e.length;var t=ro(e);if(t==v||t==b)return!e.size;if(fo(e))return!Cr(e).length;for(var n in e)if(Te.call(e,n))return!1;return!0},On.isEqual=function(e,t){return wr(e,t)},On.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?wr(e,t,void 0,n):!!r},On.isError=Bs,On.isFinite=function(e){return"number"==typeof e&&rn(e)},On.isFunction=Vs,On.isInteger=Ws,On.isLength=Hs,On.isMap=Gs,On.isMatch=function(e,t){return e===t||Sr(e,t,Qi(t))},On.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sr(e,t,Qi(t),n)},On.isNaN=function(e){return Ys(e)&&e!=+e},On.isNative=function(e){if(lo(e))throw new K("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Tr(e)},On.isNil=function(e){return null==e},On.isNull=function(e){return null===e},On.isNumber=Ys,On.isObject=qs,On.isObjectLike=zs,On.isPlainObject=$s,On.isRegExp=Ks,On.isSafeInteger=function(e){return Ws(e)&&e>=-9007199254740991&&e<=9007199254740991},On.isSet=Xs,On.isString=Zs,On.isSymbol=Js,On.isTypedArray=Qs,On.isUndefined=function(e){return void 0===e},On.isWeakMap=function(e){return zs(e)&&ro(e)==S},On.isWeakSet=function(e){return zs(e)&&"[object WeakSet]"==pr(e)},On.join=function(e,t){return null==e?"":on.call(e,t)},On.kebabCase=Da,On.last=Bo,On.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=ia(n))<0?an(r+i,0):cn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):_t(e,Tt,i,!0)},On.lowerCase=Na,On.lowerFirst=ja,On.lt=ea,On.lte=ta,On.max=function(e){return e&&e.length?ir(e,Ya,vr):void 0},On.maxBy=function(e,t){return e&&e.length?ir(e,Zi(t,2),vr):void 0},On.mean=function(e){return xt(e,Ya)},On.meanBy=function(e,t){return xt(e,Zi(t,2))},On.min=function(e){return e&&e.length?ir(e,Ya,Rr):void 0},On.minBy=function(e,t){return e&&e.length?ir(e,Zi(t,2),Rr):void 0},On.stubArray=oc,On.stubFalse=sc,On.stubObject=function(){return{}},On.stubString=function(){return""},On.stubTrue=function(){return!0},On.multiply=fc,On.nth=function(e,t){return e&&e.length?kr(e,ia(t)):void 0},On.noConflict=function(){return Ye._===this&&(Ye._=Me),this},On.noop=Ja,On.now=gs,On.pad=function(e,t,n){e=ca(e);var r=(t=ia(t))?Gt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ii(en(i),n)+e+Ii(Qt(i),n)},On.padEnd=function(e,t,n){e=ca(e);var r=(t=ia(t))?Gt(e):0;return t&&r<t?e+Ii(t-r,n):e},On.padStart=function(e,t,n){e=ca(e);var r=(t=ia(t))?Gt(e):0;return t&&r<t?Ii(t-r,n)+e:e},On.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),hn(ca(e).replace($,""),t||0)},On.random=function(e,t,n){if(n&&"boolean"!=typeof n&&co(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=ra(e),void 0===t?(t=e,e=0):t=ra(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=ln();return cn(e+i*(t-e+He("1e-"+((i+"").length-1))),t)}return Lr(e,t)},On.reduce=function(e,t,n){var r=Ds(e)?vt:Rt,i=arguments.length<3;return r(e,Zi(t,4),n,i,tr)},On.reduceRight=function(e,t,n){var r=Ds(e)?gt:Rt,i=arguments.length<3;return r(e,Zi(t,4),n,i,nr)},On.repeat=function(e,t,n){return t=(n?co(e,t,n):void 0===t)?1:ia(t),Ur(ca(e),t)},On.replace=function(){var e=arguments,t=ca(e[0]);return e.length<3?t:t.replace(e[1],e[2])},On.result=function(e,t,n){var r=-1,i=(t=ci(t,e)).length;for(i||(i=1,e=void 0);++r<i;){var o=null==e?void 0:e[Ro(t[r])];void 0===o&&(r=i,o=n),e=Vs(o)?o.call(e):o}return e},On.round=dc,On.runInContext=e,On.sample=function(e){return(Ds(e)?Bn:Br)(e)},On.size=function(e){if(null==e)return 0;if(js(e))return Zs(e)?Gt(e):e.length;var t=ro(e);return t==v||t==b?e.size:Cr(e).length},On.snakeCase=La,On.some=function(e,t,n){var r=Ds(e)?mt:Yr;return n&&co(e,t,n)&&(t=void 0),r(e,Zi(t,3))},On.sortedIndex=function(e,t){return $r(e,t)},On.sortedIndexBy=function(e,t,n){return Kr(e,t,Zi(n,2))},On.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=$r(e,t);if(r<n&&As(e[r],t))return r}return-1},On.sortedLastIndex=function(e,t){return $r(e,t,!0)},On.sortedLastIndexBy=function(e,t,n){return Kr(e,t,Zi(n,2),!0)},On.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=$r(e,t,!0)-1;if(As(e[n],t))return n}return-1},On.startCase=Ua,On.startsWith=function(e,t,n){return e=ca(e),n=null==n?0:Xn(ia(n),0,e.length),t=Jr(t),e.slice(n,n+t.length)==t},On.subtract=pc,On.sum=function(e){return e&&e.length?Mt(e,Ya):0},On.sumBy=function(e,t){return e&&e.length?Mt(e,Zi(t,2)):0},On.template=function(e,t,n){var r=On.templateSettings;n&&co(e,t,n)&&(t=void 0),e=ca(e),t=la({},t,r,Vi);var i,o,s=la({},t.imports,r.imports,Vi),a=wa(s),c=kt(s,a),u=0,h=t.interpolate||he,l="__p += '",f=ve((t.escape||he).source+"|"+h.source+"|"+(h===W?ne:he).source+"|"+(t.evaluate||he).source+"|$","g"),d="//# sourceURL="+(Te.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fe+"]")+"\n";e.replace(f,(function(t,n,r,s,a,c){return r||(r=s),l+=e.slice(u,c).replace(le,Ft),n&&(i=!0,l+="' +\n__e("+n+") +\n'"),a&&(o=!0,l+="';\n"+a+";\n__p += '"),r&&(l+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),l+="';\n";var p=Te.call(t,"variable")&&t.variable;if(p){if(ee.test(p))throw new K("Invalid `variable` option passed into `_.template`")}else l="with (obj) {\n"+l+"\n}\n";l=(o?l.replace(I,""):l).replace(D,"$1").replace(N,"$1;"),l="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var v=Wa((function(){return fe(a,d+"return "+l).apply(void 0,c)}));if(v.source=l,Bs(v))throw v;return v},On.times=function(e,t){if((e=ia(e))<1||e>9007199254740991)return[];var n=4294967295,r=cn(e,4294967295);e-=4294967295;for(var i=Ot(r,t=Zi(t));++n<e;)t(n);return i},On.toFinite=ra,On.toInteger=ia,On.toLength=oa,On.toLower=function(e){return ca(e).toLowerCase()},On.toNumber=sa,On.toSafeInteger=function(e){return e?Xn(ia(e),-9007199254740991,9007199254740991):0===e?e:0},On.toString=ca,On.toUpper=function(e){return ca(e).toUpperCase()},On.trim=function(e,t,n){if((e=ca(e))&&(n||void 0===t))return At(e);if(!e||!(t=Jr(t)))return e;var r=Yt(e),i=Yt(t);return hi(r,Dt(r,i),Nt(r,i)+1).join("")},On.trimEnd=function(e,t,n){if((e=ca(e))&&(n||void 0===t))return e.slice(0,$t(e)+1);if(!e||!(t=Jr(t)))return e;var r=Yt(e);return hi(r,0,Nt(r,Yt(t))+1).join("")},On.trimStart=function(e,t,n){if((e=ca(e))&&(n||void 0===t))return e.replace($,"");if(!e||!(t=Jr(t)))return e;var r=Yt(e);return hi(r,Dt(r,Yt(t))).join("")},On.truncate=function(e,t){var n=30,r="...";if(qs(t)){var i="separator"in t?t.separator:i;n="length"in t?ia(t.length):n,r="omission"in t?Jr(t.omission):r}var o=(e=ca(e)).length;if(Bt(e)){var s=Yt(e);o=s.length}if(n>=o)return e;var a=n-Gt(r);if(a<1)return r;var c=s?hi(s,0,a).join(""):e.slice(0,a);if(void 0===i)return c+r;if(s&&(a+=c.length-a),Ks(i)){if(e.slice(a).search(i)){var u,h=c;for(i.global||(i=ve(i.source,ca(re.exec(i))+"g")),i.lastIndex=0;u=i.exec(h);)var l=u.index;c=c.slice(0,void 0===l?a:l)}}else if(e.indexOf(Jr(i),a)!=a){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+r},On.unescape=function(e){return(e=ca(e))&&U.test(e)?e.replace(j,Kt):e},On.uniqueId=function(e){var t=++xe;return ca(e)+t},On.upperCase=Fa,On.upperFirst=Ba,On.each=cs,On.eachRight=us,On.first=jo,Za(On,(lc={},ur(On,(function(e,t){Te.call(On.prototype,t)||(lc[t]=e)})),lc),{chain:!1}),On.VERSION="4.17.21",at(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){On[e].placeholder=On})),at(["drop","take"],(function(e,t){In.prototype[e]=function(n){n=void 0===n?1:an(ia(n),0);var r=this.__filtered__&&!t?new In(this):this.clone();return r.__filtered__?r.__takeCount__=cn(n,r.__takeCount__):r.__views__.push({size:cn(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},In.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),at(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;In.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Zi(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),at(["head","last"],(function(e,t){var n="take"+(t?"Right":"");In.prototype[e]=function(){return this[n](1).value()[0]}})),at(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");In.prototype[e]=function(){return this.__filtered__?new In(this):this[n](1)}})),In.prototype.compact=function(){return this.filter(Ya)},In.prototype.find=function(e){return this.filter(e).head()},In.prototype.findLast=function(e){return this.reverse().find(e)},In.prototype.invokeMap=Fr((function(e,t){return"function"==typeof e?new In(this):this.map((function(n){return br(n,e,t)}))})),In.prototype.reject=function(e){return this.filter(Cs(Zi(e)))},In.prototype.slice=function(e,t){e=ia(e);var n=this;return n.__filtered__&&(e>0||t<0)?new In(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ia(t))<0?n.dropRight(-t):n.take(t-e)),n)},In.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},In.prototype.toArray=function(){return this.take(4294967295)},ur(In.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=On[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(On.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,a=t instanceof In,c=s[0],u=a||Ds(t),h=function(e){var t=i.apply(On,pt([e],s));return r&&l?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(a=u=!1);var l=this.__chain__,f=!!this.__actions__.length,d=o&&!l,p=a&&!f;if(!o&&u){t=p?t:new In(this);var v=e.apply(t,s);return v.__actions__.push({func:rs,args:[h],thisArg:void 0}),new kn(v,l)}return d&&p?e.apply(this,s):(v=this.thru(h),d?r?v.value()[0]:v.value():v)})})),at(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);On.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ds(i)?i:[],e)}return this[n]((function(n){return t.apply(Ds(n)?n:[],e)}))}})),ur(In.prototype,(function(e,t){var n=On[t];if(n){var r=n.name+"";Te.call(_n,r)||(_n[r]=[]),_n[r].push({name:t,func:n})}})),_n[Oi(void 0,2).name]=[{name:"wrapper",func:void 0}],In.prototype.clone=function(){var e=new In(this.__wrapped__);return e.__actions__=yi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=yi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=yi(this.__views__),e},In.prototype.reverse=function(){if(this.__filtered__){var e=new In(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},In.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ds(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=cn(t,e+s);break;case"takeRight":e=an(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,c=a-s,u=r?a:s-1,h=this.__iteratees__,l=h.length,f=0,d=cn(c,this.__takeCount__);if(!n||!r&&i==c&&d==c)return ri(e,this.__actions__);var p=[];e:for(;c--&&f<d;){for(var v=-1,g=e[u+=t];++v<l;){var m=h[v],y=m.iteratee,b=m.type,_=y(g);if(2==b)g=_;else if(!_){if(1==b)continue e;break e}}p[f++]=g}return p},On.prototype.at=is,On.prototype.chain=function(){return ns(this)},On.prototype.commit=function(){return new kn(this.value(),this.__chain__)},On.prototype.next=function(){void 0===this.__values__&&(this.__values__=na(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},On.prototype.plant=function(e){for(var t,n=this;n instanceof Pn;){var r=Oo(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},On.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof In){var t=e;return this.__actions__.length&&(t=new In(this)),(t=t.reverse()).__actions__.push({func:rs,args:[qo],thisArg:void 0}),new kn(t,this.__chain__)}return this.thru(qo)},On.prototype.toJSON=On.prototype.valueOf=On.prototype.value=function(){return ri(this.__wrapped__,this.__actions__)},On.prototype.first=On.prototype.head,Ze&&(On.prototype[Ze]=function(){return this}),On}();Ye._=Xt,void 0===(i=function(){return Xt}.call(t,n,t,r))||(r.exports=i)}).call(this)}).call(this,n(35),n(138)(e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return h}));var r=n(0),i=n(5),o=n(3),s=n(1),a=n(4),c=n(48),u=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.a(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new a.a).add(this.source.subscribe(new l(this.getSubject(),this))),e.closed&&(this._connection=null,e=a.a.EMPTY)),e},t.prototype.refCount=function(){return Object(c.a)()(this)},t}(o.a),h=function(){var e=u.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return r.a(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(i.b);s.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(0),i=n(5),o=n(21),s=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return r.a(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new o.a;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.a)},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return c}));var r=n(0),i=n(1),o=n(17);function s(e,t){return void 0===t&&(t=0),function(n){return n.lift(new a(e,t))}}var a=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.scheduler,this.delay))},e}(),c=function(e){function t(t,n,r){void 0===r&&(r=0);var i=e.call(this,t)||this;return i.scheduler=n,i.delay=r,i}return r.a(t,e),t.dispatch=function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new u(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(o.a.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(o.a.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(o.a.createComplete()),this.unsubscribe()},t}(i.a),u=function(){return function(e,t){this.notification=e,this.destination=t}}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(52);function i(){return Object(r.a)(1)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),i=n(9),o=n(52),s=n(26);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Number.POSITIVE_INFINITY,a=null,c=e[e.length-1];return Object(i.a)(c)?(a=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof c&&(n=e.pop()),null===a&&1===e.length&&e[0]instanceof r.a?e[0]:Object(o.a)(n)(Object(s.a)(e,a))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),i=n(7),o=n(26),s=n(15),a=n(12);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){if(!Object(i.a)(e[0]))return e[0];e=e[0]}return Object(o.a)(e,void 0).lift(new u)}var u=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new h(e))},e}(),h=function(e){function t(t){var n=e.call(this,t)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return r.a(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var n=0;n<t&&!this.hasFirst;n++){var r=e[n],i=Object(a.a)(this,r,void 0,n);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},t.prototype.notifyNext=function(e,t,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(t)},t}(s.a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),i=n(6),o=n(30),s=n(9);function a(e,t,n){void 0===e&&(e=0);var a=-1;return Object(o.a)(t)?a=Number(t)<1?1:Number(t):Object(s.a)(t)&&(n=t),Object(s.a)(n)||(n=i.a),new r.a((function(t){var r=Object(o.a)(e)?e:+e-n.now();return n.schedule(c,r,{index:0,period:a,subscriber:t})}))}function c(e){var t=e.index,n=e.period,r=e.subscriber;if(r.next(t),!r.closed){if(-1===n)return r.complete();e.index=t+1,this.schedule(e,n)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(3),i=n(4),o=n(20);var s=n(57),a=n(18);var c=n(77),u=n(76);function h(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[o.a]}(e))return function(e,t){return new r.a((function(n){var r=new i.a;return r.add(t.schedule((function(){var i=e[o.a]();r.add(i.subscribe({next:function(e){r.add(t.schedule((function(){return n.next(e)})))},error:function(e){r.add(t.schedule((function(){return n.error(e)})))},complete:function(){r.add(t.schedule((function(){return n.complete()})))}}))}))),r}))}(e,t);if(Object(c.a)(e))return function(e,t){return new r.a((function(n){var r=new i.a;return r.add(t.schedule((function(){return e.then((function(e){r.add(t.schedule((function(){n.next(e),r.add(t.schedule((function(){return n.complete()})))})))}),(function(e){r.add(t.schedule((function(){return n.error(e)})))}))}))),r}))}(e,t);if(Object(u.a)(e))return Object(s.a)(e,t);if(function(e){return e&&"function"==typeof e[a.a]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new r.a((function(n){var r,o=new i.a;return o.add((function(){r&&"function"==typeof r.return&&r.return()})),o.add(t.schedule((function(){r=e[a.a](),o.add(t.schedule((function(){if(!n.closed){var e,t;try{var i=r.next();e=i.value,t=i.done}catch(e){return void n.error(e)}t?n.complete():(n.next(e),this.schedule())}})))}))),o}))}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),i=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return r.a(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(n(4).a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){return function(t){for(var n=0,r=e.length;n<r&&!t.closed;n++)t.next(e[n]);t.complete()}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},function(e,t,n){"use strict";function r(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=e,n.thisArg=t,n}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(45).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,o){if("function"==typeof n)return e(t,null,n);n||(n={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(o||i);var s=n.readable||!1!==n.readable&&t.readable,a=n.writable||!1!==n.writable&&t.writable,c=function(){t.writable||h()},u=t._writableState&&t._writableState.finished,h=function(){a=!1,u=!0,s||o.call(t)},l=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,l=!0,a||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return s&&!l?(t._readableState&&t._readableState.ended||(e=new r),o.call(t,e)):a&&!u?(t._writableState&&t._writableState.ended||(e=new r),o.call(t,e)):void 0},v=function(){t.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",c),t.on("close",c)):(t.on("complete",h),t.on("abort",p),t.req?v():t.on("request",v)),t.on("end",f),t.on("finish",h),!1!==n.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",h),t.removeListener("abort",p),t.removeListener("request",v),t.req&&t.req.removeListener("finish",h),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",h),t.removeListener("end",f),t.removeListener("error",d),t.removeListener("close",p)}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Prom=t.PromMessageType=void 0;const i=r(n(136));var o;!function(e){e[e.SessionStart=0]="SessionStart",e[e.WebRtcPerformance=1]="WebRtcPerformance",e[e.AvailabilityCheck=2]="AvailabilityCheck",e[e.QuestionMessageReceived=3]="QuestionMessageReceived",e[e.AnswerMessageReceived=4]="AnswerMessageReceived",e[e.SessionEnded=5]="SessionEnded"}(o=t.PromMessageType||(t.PromMessageType={}));t.Prom=class{constructor(e){this.apiUrl=e,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(e){var t,n,r,i,s,a,c;const u=Object.assign(e.labels||{},{platform:"js"});switch(e.type){case o.SessionStart:this.sessionStartTime.observe(e.value,u);break;case o.QuestionMessageReceived:this.messageTimings.push(e.value);break;case o.AnswerMessageReceived:const h=this.calculateConversationRtt(e);h>0&&this.conversationRoundTripTime.observe(h,u);break;case o.WebRtcPerformance:const l=e.value;l.outboundQualityLimitationReason?u.qualityLimitationReason=null===(t=l.outboundQualityLimitationReason)||void 0===t?void 0:t.value:u.qualityLimitationReason="unknown",l.newFramesDropped&&this.webRtcFramesDropped.observe(null===(n=l.newFramesDropped)||void 0===n?void 0:n.value,u),l.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(r=l.framesPerSec)||void 0===r?void 0:r.value,u),l.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=l.inboundNewPacketsLost)||void 0===i?void 0:i.value,u),l.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(s=l.inboundRoundTripTime)||void 0===s?void 0:s.value,u),l.frameHeight&&this.webRtcFrameHeight.observe(null===(a=l.frameHeight)||void 0===a?void 0:a.value,u),l.frameWidth&&this.webRtcFrameWidth.observe(null===(c=l.frameWidth)||void 0===c?void 0:c.value,u);break;case o.AvailabilityCheck:this.availabilityCheckTime.observe(e.value,u);break;case o.SessionEnded:this.stopSendingMetrics()}}calculateConversationRtt(e){if(e.value&&this.messageTimings){const t=this.messageTimings.find(t=>t.id===e.value.id);if(t){const n=t.receivedOn;if(n){const r=(e.value.receivedOn-n)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(t),1),r}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const e=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(e),this.registry.reset()}stopSendingMetrics(){this.metricsIntervalId&&clearInterval(this.metricsIntervalId)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"audit",(function(){return o})),n.d(t,"auditTime",(function(){return h})),n.d(t,"buffer",(function(){return l})),n.d(t,"bufferCount",(function(){return v})),n.d(t,"bufferTime",(function(){return _})),n.d(t,"bufferToggle",(function(){return A})),n.d(t,"bufferWhen",(function(){return I})),n.d(t,"catchError",(function(){return j})),n.d(t,"combineAll",(function(){return B})),n.d(t,"combineLatest",(function(){return H})),n.d(t,"concat",(function(){return z})),n.d(t,"concatAll",(function(){return G.a})),n.d(t,"concatMap",(function(){return $})),n.d(t,"concatMapTo",(function(){return K})),n.d(t,"count",(function(){return X})),n.d(t,"debounce",(function(){return Q})),n.d(t,"debounceTime",(function(){return ne})),n.d(t,"defaultIfEmpty",(function(){return se})),n.d(t,"delay",(function(){return le})),n.d(t,"delayWhen",(function(){return ge})),n.d(t,"dematerialize",(function(){return we})),n.d(t,"distinct",(function(){return xe})),n.d(t,"distinctUntilChanged",(function(){return Re})),n.d(t,"distinctUntilKeyChanged",(function(){return Ae})),n.d(t,"elementAt",(function(){return We})),n.d(t,"endWith",(function(){return qe})),n.d(t,"every",(function(){return ze})),n.d(t,"exhaust",(function(){return $e})),n.d(t,"exhaustMap",(function(){return Je})),n.d(t,"expand",(function(){return tt})),n.d(t,"filter",(function(){return ke.a})),n.d(t,"finalize",(function(){return it})),n.d(t,"find",(function(){return at})),n.d(t,"findIndex",(function(){return ht})),n.d(t,"first",(function(){return ft})),n.d(t,"groupBy",(function(){return dt.b})),n.d(t,"ignoreElements",(function(){return pt})),n.d(t,"isEmpty",(function(){return mt})),n.d(t,"last",(function(){return Tt})),n.d(t,"map",(function(){return Ze.a})),n.d(t,"mapTo",(function(){return xt})),n.d(t,"materialize",(function(){return Rt})),n.d(t,"max",(function(){return Nt})),n.d(t,"merge",(function(){return Lt})),n.d(t,"mergeAll",(function(){return Ut.a})),n.d(t,"mergeMap",(function(){return Y.b})),n.d(t,"flatMap",(function(){return Y.a})),n.d(t,"mergeMapTo",(function(){return Ft})),n.d(t,"mergeScan",(function(){return Bt})),n.d(t,"min",(function(){return Ht})),n.d(t,"multicast",(function(){return zt})),n.d(t,"observeOn",(function(){return Yt.b})),n.d(t,"onErrorResumeNext",(function(){return $t})),n.d(t,"pairwise",(function(){return Zt})),n.d(t,"partition",(function(){return tn})),n.d(t,"pluck",(function(){return nn})),n.d(t,"publish",(function(){return sn})),n.d(t,"publishBehavior",(function(){return cn})),n.d(t,"publishLast",(function(){return hn})),n.d(t,"publishReplay",(function(){return fn})),n.d(t,"race",(function(){return pn})),n.d(t,"reduce",(function(){return Dt})),n.d(t,"repeat",(function(){return vn})),n.d(t,"repeatWhen",(function(){return yn})),n.d(t,"retry",(function(){return wn})),n.d(t,"retryWhen",(function(){return xn})),n.d(t,"refCount",(function(){return Rn.a})),n.d(t,"sample",(function(){return Mn})),n.d(t,"sampleTime",(function(){return Pn})),n.d(t,"scan",(function(){return At})),n.d(t,"sequenceEqual",(function(){return Nn})),n.d(t,"share",(function(){return Bn})),n.d(t,"shareReplay",(function(){return Vn})),n.d(t,"single",(function(){return Wn})),n.d(t,"skip",(function(){return zn})),n.d(t,"skipLast",(function(){return $n})),n.d(t,"skipUntil",(function(){return Zn})),n.d(t,"skipWhile",(function(){return er})),n.d(t,"startWith",(function(){return rr})),n.d(t,"subscribeOn",(function(){return ar})),n.d(t,"switchAll",(function(){return fr})),n.d(t,"switchMap",(function(){return ur})),n.d(t,"switchMapTo",(function(){return dr})),n.d(t,"take",(function(){return Fe})),n.d(t,"takeLast",(function(){return _t})),n.d(t,"takeUntil",(function(){return pr})),n.d(t,"takeWhile",(function(){return mr})),n.d(t,"tap",(function(){return Sr})),n.d(t,"throttle",(function(){return Er})),n.d(t,"throttleTime",(function(){return Or})),n.d(t,"throwIfEmpty",(function(){return De})),n.d(t,"timeInterval",(function(){return Dr})),n.d(t,"timeout",(function(){return Vr})),n.d(t,"timeoutWith",(function(){return Lr})),n.d(t,"timestamp",(function(){return Wr})),n.d(t,"toArray",(function(){return zr})),n.d(t,"window",(function(){return Gr})),n.d(t,"windowCount",(function(){return Kr})),n.d(t,"windowTime",(function(){return Jr})),n.d(t,"windowToggle",(function(){return oi})),n.d(t,"windowWhen",(function(){return ci})),n.d(t,"withLatestFrom",(function(){return li})),n.d(t,"zip",(function(){return vi})),n.d(t,"zipAll",(function(){return gi}));var r=n(0),i=n(2);function o(e){return function(t){return t.lift(new s(e))}}var s=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.durationSelector))},e}(),a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.a(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var n=Object(i.c)(t,new i.a(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},t.prototype.clearThrottle=function(){var e=this.value,t=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(i.b),c=n(6),u=n(72);function h(e,t){return void 0===t&&(t=c.a),o((function(){return Object(u.a)(e,t)}))}function l(e){return function(t){return t.lift(new f(e))}}var f=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.closingNotifier))},e}(),d=function(e){function t(t,n){var r=e.call(this,t)||this;return r.buffer=[],r.add(Object(i.c)(n,new i.a(r))),r}return r.a(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(i.b),p=n(1);function v(e,t){return void 0===t&&(t=null),function(n){return n.lift(new g(e,t))}}var g=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,this.subscriberClass=t&&e!==t?y:m}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),m=function(e){function t(t,n){var r=e.call(this,t)||this;return r.bufferSize=n,r.buffer=[],r}return r.a(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(p.a),y=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return r.a(t,e),t.prototype._next=function(e){var t=this.bufferSize,n=this.startBufferEvery,r=this.buffers,i=this.count;this.count++,i%n==0&&r.push([]);for(var o=r.length;o--;){var s=r[o];s.push(e),s.length===t&&(r.splice(o,1),this.destination.next(s))}},t.prototype._complete=function(){for(var t=this.buffers,n=this.destination;t.length>0;){var r=t.shift();r.length>0&&n.next(r)}e.prototype._complete.call(this)},t}(p.a),b=n(9);function _(e){var t=arguments.length,n=c.a;Object(b.a)(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],t--);var r=null;t>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return t>=3&&(i=arguments[2]),function(t){return t.lift(new w(e,r,i,n))}}var w=function(){function e(e,t,n,r){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new T(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),S=function(){return function(){this.buffer=[]}}(),T=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;s.bufferTimeSpan=n,s.bufferCreationInterval=r,s.maxBufferSize=i,s.scheduler=o,s.contexts=[];var a=s.openContext();if(s.timespanOnly=null==r||r<0,s.timespanOnly){var c={subscriber:s,context:a,bufferTimeSpan:n};s.add(a.closeAction=o.schedule(x,n,c))}else{var u={subscriber:s,context:a},h={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:s,scheduler:o};s.add(a.closeAction=o.schedule(E,n,u)),s.add(o.schedule(C,r,h))}return s}return r.a(t,e),t.prototype._next=function(e){for(var t,n=this.contexts,r=n.length,i=0;i<r;i++){var o=n[i],s=o.buffer;s.push(e),s.length==this.maxBufferSize&&(t=o)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,n=this.destination;t.length>0;){var r=t.shift();n.next(r.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:e,bufferTimeSpan:n};this.add(e.closeAction=this.scheduler.schedule(x,n,r))}},t.prototype.openContext=function(){var e=new S;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(p.a);function x(e){var t=e.subscriber,n=e.context;n&&t.closeContext(n),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function C(e){var t=e.bufferCreationInterval,n=e.bufferTimeSpan,r=e.subscriber,i=e.scheduler,o=r.openContext();r.closed||(r.add(o.closeAction=i.schedule(E,n,{subscriber:r,context:o})),this.schedule(e,t))}function E(e){var t=e.subscriber,n=e.context;t.closeContext(n)}var R=n(4),M=n(12),O=n(15);function A(e,t){return function(n){return n.lift(new P(e,t))}}var P=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new k(e,this.openings,this.closingSelector))},e}(),k=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.closingSelector=r,i.contexts=[],i.add(Object(M.a)(i,n)),i}return r.a(t,e),t.prototype._next=function(e){for(var t=this.contexts,n=t.length,r=0;r<n;r++)t[r].buffer.push(e)},t.prototype._error=function(t){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var n=t.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var n=e.buffer,r=e.subscription;this.destination.next(n),t.splice(t.indexOf(e),1),this.remove(r),r.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,n=new R.a,r={buffer:[],subscription:n};t.push(r);var i=Object(M.a)(this,e,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},t}(O.a);function I(e){return function(t){return t.lift(new D(e))}}var D=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new N(e,this.closingSelector))},e}(),N=function(e){function t(t,n){var r=e.call(this,t)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return r.a(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e=this.closingSubscription;e&&(this.remove(e),e.unsubscribe());var t,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{t=(0,this.closingSelector)()}catch(e){return this.error(e)}e=new R.a,this.closingSubscription=e,this.add(e),this.subscribing=!0,e.add(Object(i.c)(t,new i.a(this))),this.subscribing=!1},t}(i.b);function j(e){return function(t){var n=new L(e),r=t.lift(n);return n.caught=r}}var L=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new U(e,this.selector,this.caught))},e}(),U=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.selector=n,i.caught=r,i}return r.a(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle();var r=new i.a(this);this.add(r);var o=Object(i.c)(n,r);o!==r&&this.add(o)}},t}(i.b),F=n(51);function B(e){return function(t){return t.lift(new F.a(e))}}var V=n(7),W=n(11);function H(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=null;return"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&Object(V.a)(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(Object(W.a)([t].concat(e)),new F.a(n))}}var q=n(32);function z(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(q.a.apply(void 0,[t].concat(e)))}}var G=n(69),Y=n(25);function $(e,t){return Object(Y.b)(e,t,1)}function K(e,t){return $((function(){return e}),t)}function X(e){return function(t){return t.lift(new Z(e,t))}}var Z=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new J(e,this.predicate,this.source))},e}(),J=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return r.a(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){return void this.destination.error(e)}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(p.a);function Q(e){return function(t){return t.lift(new ee(e))}}var ee=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new te(e,this.durationSelector))},e}(),te=function(e){function t(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.a(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var n=this.durationSubscription;this.value=e,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=Object(i.c)(t,new i.a(this)))&&!n.closed&&this.add(this.durationSubscription=n)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(i.b);function ne(e,t){return void 0===t&&(t=c.a),function(n){return n.lift(new re(e,t))}}var re=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new ie(e,this.dueTime,this.scheduler))},e}(),ie=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return r.a(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(oe,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(p.a);function oe(e){e.debouncedNext()}function se(e){return void 0===e&&(e=null),function(t){return t.lift(new ae(e))}}var ae=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new ce(e,this.defaultValue))},e}(),ce=function(e){function t(t,n){var r=e.call(this,t)||this;return r.defaultValue=n,r.isEmpty=!0,r}return r.a(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(p.a);function ue(e){return e instanceof Date&&!isNaN(+e)}var he=n(17);function le(e,t){void 0===t&&(t=c.a);var n=ue(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new fe(n,t))}}var fe=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new de(e,this.delay,this.scheduler))},e}(),de=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return r.a(t,e),t.dispatch=function(e){for(var t=e.source,n=t.queue,r=e.scheduler,i=e.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var o=Math.max(0,n[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,n=new pe(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(he.a.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(he.a.createComplete()),this.unsubscribe()},t}(p.a),pe=function(){return function(e,t){this.time=e,this.notification=t}}(),ve=n(3);function ge(e,t){return t?function(n){return new be(n,t).lift(new me(e))}:function(t){return t.lift(new me(e))}}var me=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new ye(e,this.delayDurationSelector))},e}(),ye=function(e){function t(t,n){var r=e.call(this,t)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return r.a(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(e),this.removeSubscription(i),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){var t=this.index++;try{var n=this.delayDurationSelector(e,t);n&&this.tryDelay(n,e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return-1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var n=Object(M.a)(this,e,t);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(O.a),be=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subscriptionDelay=n,r}return r.a(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new _e(e,this.source))},t}(ve.a),_e=function(e){function t(t,n){var r=e.call(this)||this;return r.parent=t,r.source=n,r.sourceSubscribed=!1,r}return r.a(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(p.a);function we(){return function(e){return e.lift(new Se)}}var Se=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Te(e))},e}(),Te=function(e){function t(t){return e.call(this,t)||this}return r.a(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(p.a);function xe(e,t){return function(n){return n.lift(new Ce(e,t))}}var Ce=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new Ee(e,this.keySelector,this.flushes))},e}(),Ee=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.keySelector=n,o.values=new Set,r&&o.add(Object(i.c)(r,new i.a(o))),o}return r.a(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,n=this.destination;try{t=this.keySelector(e)}catch(e){return void n.error(e)}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))},t}(i.b);function Re(e,t){return function(n){return n.lift(new Me(e,t))}}var Me=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new Oe(e,this.compare,this.keySelector))},e}(),Oe=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return r.a(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t;try{var n=this.keySelector;t=n?n(e):e}catch(e){return this.destination.error(e)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;r||(this.key=t,this.destination.next(e))},t}(p.a);function Ae(e,t){return Re((function(n,r){return t?t(n[e],r[e]):n[e]===r[e]}))}var Pe=n(22),ke=n(16),Ie=n(24);function De(e){return void 0===e&&(e=Le),function(t){return t.lift(new Ne(e))}}var Ne=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new je(e,this.errorFactory))},e}(),je=function(e){function t(t,n){var r=e.call(this,t)||this;return r.errorFactory=n,r.hasValue=!1,r}return r.a(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(p.a);function Le(){return new Ie.a}var Ue=n(10);function Fe(e){return function(t){return 0===e?Object(Ue.b)():t.lift(new Be(e))}}var Be=function(){function e(e){if(this.total=e,this.total<0)throw new Pe.a}return e.prototype.call=function(e,t){return t.subscribe(new Ve(e,this.total))},e}(),Ve=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return r.a(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(p.a);function We(e,t){if(e<0)throw new Pe.a;var n=arguments.length>=2;return function(r){return r.pipe(Object(ke.a)((function(t,n){return n===e})),Fe(1),n?se(t):De((function(){return new Pe.a})))}}var He=n(36);function qe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return Object(q.a)(t,He.a.apply(void 0,e))}}function ze(e,t){return function(n){return n.lift(new Ge(e,t,n))}}var Ge=function(){function e(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new Ye(e,this.predicate,this.thisArg,this.source))},e}(),Ye=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.predicate=n,o.thisArg=r,o.source=i,o.index=0,o.thisArg=r||o,o}return r.a(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){return void this.destination.error(e)}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(p.a);function $e(){return function(e){return e.lift(new Ke)}}var Ke=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Xe(e))},e}(),Xe=function(e){function t(t){var n=e.call(this,t)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return r.a(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(Object(i.c)(e,new i.a(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(i.b),Ze=n(8);function Je(e,t){return t?function(n){return n.pipe(Je((function(n,r){return Object(W.a)(e(n,r)).pipe(Object(Ze.a)((function(e,i){return t(n,e,r,i)})))})))}:function(t){return t.lift(new Qe(e))}}var Qe=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new et(e,this.project))},e}(),et=function(e){function t(t,n){var r=e.call(this,t)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return r.a(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this.hasSubscription=!0,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new i.a(this),n=this.destination;n.add(t);var r=Object(i.c)(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(i.b);function tt(e,t,n){return void 0===t&&(t=Number.POSITIVE_INFINITY),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(r){return r.lift(new nt(e,t,n))}}var nt=function(){function e(e,t,n){this.project=e,this.concurrent=t,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new rt(e,this.project,this.concurrent,this.scheduler))},e}(),rt=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.project=n,o.concurrent=r,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return r.a(t,e),t.dispatch=function(e){var t=e.subscriber,n=e.result,r=e.value,i=e.index;t.subscribeToProjection(n,r,i)},t.prototype._next=function(e){var n=this.destination;if(n.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){n.next(e);try{var i=(0,this.project)(e,r);if(this.scheduler){var o={subscriber:this,result:i,value:e,index:r};this.destination.add(this.scheduler.schedule(t.dispatch,0,o))}else this.subscribeToProjection(i,e,r)}catch(e){n.error(e)}}else this.buffer.push(e)}},t.prototype.subscribeToProjection=function(e,t,n){this.active++,this.destination.add(Object(i.c)(e,new i.a(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this._next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(i.b);function it(e){return function(t){return t.lift(new ot(e))}}var ot=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new st(e,this.callback))},e}(),st=function(e){function t(t,n){var r=e.call(this,t)||this;return r.add(new R.a(n)),r}return r.a(t,e),t}(p.a);function at(e,t){if("function"!=typeof e)throw new TypeError("predicate is not a function");return function(n){return n.lift(new ct(e,n,!1,t))}}var ct=function(){function e(e,t,n,r){this.predicate=e,this.source=t,this.yieldIndex=n,this.thisArg=r}return e.prototype.call=function(e,t){return t.subscribe(new ut(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}(),ut=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;return s.predicate=n,s.source=r,s.yieldIndex=i,s.thisArg=o,s.index=0,s}return r.a(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,n=this.thisArg,r=this.index++;try{t.call(n||this,e,r,this.source)&&this.notifyComplete(this.yieldIndex?r:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(p.a);function ht(e,t){return function(n){return n.lift(new ct(e,n,!0,t))}}var lt=n(14);function ft(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?Object(ke.a)((function(t,n){return e(t,n,r)})):lt.a,Fe(1),n?se(t):De((function(){return new Ie.a})))}}var dt=n(62);function pt(){return function(e){return e.lift(new vt)}}var vt=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new gt(e))},e}(),gt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.a(t,e),t.prototype._next=function(e){},t}(p.a);function mt(){return function(e){return e.lift(new yt)}}var yt=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new bt(e))},e}(),bt=function(e){function t(t){return e.call(this,t)||this}return r.a(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(p.a);function _t(e){return function(t){return 0===e?Object(Ue.b)():t.lift(new wt(e))}}var wt=function(){function e(e){if(this.total=e,this.total<0)throw new Pe.a}return e.prototype.call=function(e,t){return t.subscribe(new St(e,this.total))},e}(),St=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.ring=new Array,r.count=0,r}return r.a(t,e),t.prototype._next=function(e){var t=this.ring,n=this.total,r=this.count++;t.length<n?t.push(e):t[r%n]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var o=t++%n;e.next(r[o])}e.complete()},t}(p.a);function Tt(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?Object(ke.a)((function(t,n){return e(t,n,r)})):lt.a,_t(1),n?se(t):De((function(){return new Ie.a})))}}function xt(e){return function(t){return t.lift(new Ct(e))}}var Ct=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new Et(e,this.value))},e}(),Et=function(e){function t(t,n){var r=e.call(this,t)||this;return r.value=n,r}return r.a(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(p.a);function Rt(){return function(e){return e.lift(new Mt)}}var Mt=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Ot(e))},e}(),Ot=function(e){function t(t){return e.call(this,t)||this}return r.a(t,e),t.prototype._next=function(e){this.destination.next(he.a.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(he.a.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(he.a.createComplete()),e.complete()},t}(p.a);function At(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new Pt(e,t,n))}}var Pt=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new kt(e,this.accumulator,this.seed,this.hasSeed))},e}(),kt=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o}return r.a(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(p.a),It=n(39);function Dt(e,t){return arguments.length>=2?function(n){return Object(It.a)(At(e,t),_t(1),se(t))(n)}:function(t){return Object(It.a)(At((function(t,n,r){return e(t,n,r+1)})),_t(1))(t)}}function Nt(e){return Dt("function"==typeof e?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t})}var jt=n(70);function Lt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(jt.a.apply(void 0,[t].concat(e)))}}var Ut=n(52);function Ft(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?Object(Y.b)((function(){return e}),t,n):("number"==typeof t&&(n=t),Object(Y.b)((function(){return e}),n))}function Bt(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Vt(e,t,n))}}var Vt=function(){function e(e,t,n){this.accumulator=e,this.seed=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new Wt(e,this.accumulator,this.seed,this.concurrent))},e}(),Wt=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.accumulator=n,o.acc=r,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return r.a(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,e,t)}catch(e){return n.error(e)}this.active++,this._innerSub(r)}else this.buffer.push(e)},t.prototype._innerSub=function(e){var t=new i.a(this),n=this.destination;n.add(t);var r=Object(i.c)(e,t);r!==t&&n.add(r)},t.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()},t.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(i.b);function Ht(e){return Dt("function"==typeof e?function(t,n){return e(t,n)<0?t:n}:function(e,t){return e<t?e:t})}var qt=n(65);function zt(e,t){return function(n){var r;if(r="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new Gt(r,t));var i=Object.create(n,qt.b);return i.source=n,i.subjectFactory=r,i}}var Gt=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(e);return i.add(t.subscribe(r)),i},e}(),Yt=n(67);function $t(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&Object(V.a)(e[0])&&(e=e[0]),function(t){return t.lift(new Kt(e))}}var Kt=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new Xt(e,this.nextSources))},e}(),Xt=function(e){function t(t,n){var r=e.call(this,t)||this;return r.destination=t,r.nextSources=n,r}return r.a(t,e),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new i.a(this),n=this.destination;n.add(t);var r=Object(i.c)(e,t);r!==t&&n.add(r)}else this.destination.complete()},t}(i.b);function Zt(){return function(e){return e.lift(new Jt)}}var Jt=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Qt(e))},e}(),Qt=function(e){function t(t){var n=e.call(this,t)||this;return n.hasPrev=!1,n}return r.a(t,e),t.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},t}(p.a),en=n(78);function tn(e,t){return function(n){return[Object(ke.a)(e,t)(n),Object(ke.a)(Object(en.a)(e,t))(n)]}}function nn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(t){return Object(Ze.a)(rn(e,n))(t)}}function rn(e,t){return function(n){for(var r=n,i=0;i<t;i++){var o=null!=r?r[e[i]]:void 0;if(void 0===o)return;r=o}return r}}var on=n(5);function sn(e){return e?zt((function(){return new on.a}),e):zt(new on.a)}var an=n(66);function cn(e){return function(t){return zt(new an.a(e))(t)}}var un=n(28);function hn(){return function(e){return zt(new un.a)(e)}}var ln=n(49);function fn(e,t,n,r){n&&"function"!=typeof n&&(r=n);var i="function"==typeof n?n:void 0,o=new ln.a(e,t,r);return function(e){return zt((function(){return o}),i)(e)}}var dn=n(71);function pn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&Object(V.a)(e[0])&&(e=e[0]),t.lift.call(dn.a.apply(void 0,[t].concat(e)))}}function vn(e){return void 0===e&&(e=-1),function(t){return 0===e?Object(Ue.b)():e<0?t.lift(new gn(-1,t)):t.lift(new gn(e-1,t))}}var gn=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new mn(e,this.count,this.source))},e}(),mn=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.count=n,i.source=r,i}return r.a(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,n=this.count;if(0===n)return e.prototype.complete.call(this);n>-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(p.a);function yn(e){return function(t){return t.lift(new bn(e))}}var bn=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new _n(e,this.notifier,t))},e}(),_n=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return r.a(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){var t;this.notifications=new on.a;try{t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=Object(i.c)(t,new i.a(this))},t}(i.b);function wn(e){return void 0===e&&(e=-1),function(t){return t.lift(new Sn(e,t))}}var Sn=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new Tn(e,this.count,this.source))},e}(),Tn=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.count=n,i.source=r,i}return r.a(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return e.prototype.error.call(this,t);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},t}(p.a);function xn(e){return function(t){return t.lift(new Cn(e,t))}}var Cn=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new En(e,this.notifier,this.source))},e}(),En=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.notifier=n,i.source=r,i}return r.a(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.errors,r=this.retries,o=this.retriesSubscription;if(r)this.errors=void 0,this.retriesSubscription=void 0;else{n=new on.a;try{r=(0,this.notifier)(n)}catch(t){return e.prototype.error.call(this,t)}o=Object(i.c)(r,new i.a(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=o,n.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(i.b),Rn=n(48);function Mn(e){return function(t){return t.lift(new On(e))}}var On=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new An(e),r=t.subscribe(n);return r.add(Object(i.c)(this.notifier,new i.a(n))),r},e}(),An=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return r.a(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(i.b);function Pn(e,t){return void 0===t&&(t=c.a),function(n){return n.lift(new kn(e,t))}}var kn=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new In(e,this.period,this.scheduler))},e}(),In=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(Dn,n,{subscriber:i,period:n})),i}return r.a(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(p.a);function Dn(e){var t=e.subscriber,n=e.period;t.notifyNext(),this.schedule(e,n)}function Nn(e,t){return function(n){return n.lift(new jn(e,t))}}var jn=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new Ln(e,this.compareTo,this.comparator))},e}(),Ln=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new Un(t,i))),i}return r.a(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this._a,t=this._b,n=this.comparator;e.length>0&&t.length>0;){var r=e.shift(),i=t.shift(),o=!1;try{o=n?n(r,i):r===i}catch(e){this.destination.error(e)}o||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t}(p.a),Un=function(e){function t(t,n){var r=e.call(this,t)||this;return r.parent=n,r}return r.a(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(p.a);function Fn(){return new on.a}function Bn(){return function(e){return Object(Rn.a)()(zt(Fn)(e))}}function Vn(e,t,n){var r;return r=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n},function(e){return e.lift(function(e){var t,n,r=e.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY:r,o=e.windowTime,s=void 0===o?Number.POSITIVE_INFINITY:o,a=e.refCount,c=e.scheduler,u=0,h=!1,l=!1;return function(e){var r;u++,!t||h?(h=!1,t=new ln.a(i,s,c),r=t.subscribe(this),n=e.subscribe({next:function(e){t.next(e)},error:function(e){h=!0,t.error(e)},complete:function(){l=!0,n=void 0,t.complete()}}),l&&(n=void 0)):r=t.subscribe(this),this.add((function(){u--,r.unsubscribe(),r=void 0,n&&!l&&a&&0===u&&(n.unsubscribe(),n=void 0,t=void 0)}))}}(r))}}function Wn(e){return function(t){return t.lift(new Hn(e,t))}}var Hn=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new qn(e,this.predicate,this.source))},e}(),qn=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return r.a(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new Ie.a)},t}(p.a);function zn(e){return function(t){return t.lift(new Gn(e))}}var Gn=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new Yn(e,this.total))},e}(),Yn=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return r.a(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(p.a);function $n(e){return function(t){return t.lift(new Kn(e))}}var Kn=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new Pe.a}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new p.a(e)):t.subscribe(new Xn(e,this._skipCount))},e}(),Xn=function(e){function t(t,n){var r=e.call(this,t)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return r.a(t,e),t.prototype._next=function(e){var t=this._skipCount,n=this._count++;if(n<t)this._ring[n]=e;else{var r=n%t,i=this._ring,o=i[r];i[r]=e,this.destination.next(o)}},t}(p.a);function Zn(e){return function(t){return t.lift(new Jn(e))}}var Jn=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new Qn(e,this.notifier))},e}(),Qn=function(e){function t(t,n){var r=e.call(this,t)||this;r.hasValue=!1;var o=new i.a(r);r.add(o),r.innerSubscription=o;var s=Object(i.c)(n,o);return s!==o&&(r.add(s),r.innerSubscription=s),r}return r.a(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(i.b);function er(e){return function(t){return t.lift(new tr(e))}}var tr=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new nr(e,this.predicate))},e}(),nr=function(e){function t(t,n){var r=e.call(this,t)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return r.a(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(e){this.destination.error(e)}},t}(p.a);function rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return Object(b.a)(n)?(e.pop(),function(t){return Object(q.a)(e,t,n)}):function(t){return Object(q.a)(e,t)}}var ir=n(40),or=n(30),sr=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=ir.a);var i=e.call(this)||this;return i.source=t,i.delayTime=n,i.scheduler=r,(!Object(or.a)(n)||n<0)&&(i.delayTime=0),r&&"function"==typeof r.schedule||(i.scheduler=ir.a),i}return r.a(t,e),t.create=function(e,n,r){return void 0===n&&(n=0),void 0===r&&(r=ir.a),new t(e,n,r)},t.dispatch=function(e){var t=e.source,n=e.subscriber;return this.add(t.subscribe(n))},t.prototype._subscribe=function(e){var n=this.delayTime,r=this.source;return this.scheduler.schedule(t.dispatch,n,{source:r,subscriber:e})},t}(ve.a);function ar(e,t){return void 0===t&&(t=0),function(n){return n.lift(new cr(e,t))}}var cr=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new sr(t,this.delay,this.scheduler).subscribe(e)},e}();function ur(e,t){return"function"==typeof t?function(n){return n.pipe(ur((function(n,r){return Object(W.a)(e(n,r)).pipe(Object(Ze.a)((function(e,i){return t(n,e,r,i)})))})))}:function(t){return t.lift(new hr(e))}}var hr=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new lr(e,this.project))},e}(),lr=function(e){function t(t,n){var r=e.call(this,t)||this;return r.project=n,r.index=0,r}return r.a(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var n=new i.a(this),r=this.destination;r.add(n),this.innerSubscription=Object(i.c)(e,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(i.b);function fr(){return ur(lt.a)}function dr(e,t){return t?ur((function(){return e}),t):ur((function(){return e}))}function pr(e){return function(t){return t.lift(new vr(e))}}var vr=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new gr(e),r=Object(i.c)(this.notifier,new i.a(n));return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n},e}(),gr=function(e){function t(t){var n=e.call(this,t)||this;return n.seenValue=!1,n}return r.a(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(i.b);function mr(e,t){return void 0===t&&(t=!1),function(n){return n.lift(new yr(e,t))}}var yr=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new br(e,this.predicate,this.inclusive))},e}(),br=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return r.a(t,e),t.prototype._next=function(e){var t,n=this.destination;try{t=this.predicate(e,this.index++)}catch(e){return void n.error(e)}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var n=this.destination;Boolean(t)?n.next(e):(this.inclusive&&n.next(e),n.complete())},t}(p.a),_r=n(19),wr=n(23);function Sr(e,t,n){return function(r){return r.lift(new Tr(e,t,n))}}var Tr=function(){function e(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}return e.prototype.call=function(e,t){return t.subscribe(new xr(e,this.nextOrObserver,this.error,this.complete))},e}(),xr=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o._tapNext=_r.a,o._tapError=_r.a,o._tapComplete=_r.a,o._tapError=r||_r.a,o._tapComplete=i||_r.a,Object(wr.a)(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||_r.a,o._tapError=n.error||_r.a,o._tapComplete=n.complete||_r.a),o}return r.a(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},t}(p.a),Cr={leading:!0,trailing:!1};function Er(e,t){return void 0===t&&(t=Cr),function(n){return n.lift(new Rr(e,!!t.leading,!!t.trailing))}}var Rr=function(){function e(e,t,n){this.durationSelector=e,this.leading=t,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new Mr(e,this.durationSelector,this.leading,this.trailing))},e}(),Mr=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.destination=t,o.durationSelector=n,o._leading=r,o._trailing=i,o._hasValue=!1,o}return r.a(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=Object(i.c)(t,new i.a(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(i.b);function Or(e,t,n){return void 0===t&&(t=c.a),void 0===n&&(n=Cr),function(r){return r.lift(new Ar(e,t,n.leading,n.trailing))}}var Ar=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new Pr(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),Pr=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;return s.duration=n,s.scheduler=r,s.leading=i,s.trailing=o,s._hasTrailingValue=!1,s._trailingValue=null,s}return r.a(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(kr,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(p.a);function kr(e){e.subscriber.clearThrottle()}var Ir=n(53);function Dr(e){return void 0===e&&(e=c.a),function(t){return Object(Ir.a)((function(){return t.pipe(At((function(t,n){var r=t.current;return{value:n,current:e.now(),last:r}}),{current:e.now(),value:void 0,last:void 0}),Object(Ze.a)((function(e){var t=e.current,n=e.last,r=e.value;return new Nr(r,t-n)})))}))}}var Nr=function(){return function(e,t){this.value=e,this.interval=t}}(),jr=n(68);function Lr(e,t,n){return void 0===n&&(n=c.a),function(r){var i=ue(e),o=i?+e-n.now():Math.abs(e);return r.lift(new Ur(o,i,t,n))}}var Ur=function(){function e(e,t,n,r){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new Fr(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),Fr=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;return s.absoluteTimeout=n,s.waitFor=r,s.withObservable=i,s.scheduler=o,s.scheduleTimeout(),s}return r.a(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(Object(i.c)(t,new i.a(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(i.b),Br=n(50);function Vr(e,t){return void 0===t&&(t=c.a),Lr(e,Object(Br.a)(new jr.a),t)}function Wr(e){return void 0===e&&(e=c.a),Object(Ze.a)((function(t){return new Hr(t,e.now())}))}var Hr=function(){return function(e,t){this.value=e,this.timestamp=t}}();function qr(e,t,n){return 0===n?[t]:(e.push(t),e)}function zr(){return Dt(qr,[])}function Gr(e){return function(t){return t.lift(new Yr(e))}}var Yr=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var n=new $r(e),r=t.subscribe(n);return r.closed||n.add(Object(i.c)(this.windowBoundaries,new i.a(n))),r},e}(),$r=function(e){function t(t){var n=e.call(this,t)||this;return n.window=new on.a,t.next(n.window),n}return r.a(t,e),t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,n=this.window=new on.a;t.next(n)},t}(i.b);function Kr(e,t){return void 0===t&&(t=0),function(n){return n.lift(new Xr(e,t))}}var Xr=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new Zr(e,this.windowSize,this.startWindowEvery))},e}(),Zr=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=n,i.startWindowEvery=r,i.windows=[new on.a],i.count=0,t.next(i.windows[0]),i}return r.a(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,o=i.length,s=0;s<o&&!this.closed;s++)i[s].next(e);var a=this.count-r+1;if(a>=0&&a%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var c=new on.a;i.push(c),n.next(c)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(p.a);function Jr(e){var t=c.a,n=null,r=Number.POSITIVE_INFINITY;return Object(b.a)(arguments[3])&&(t=arguments[3]),Object(b.a)(arguments[2])?t=arguments[2]:Object(or.a)(arguments[2])&&(r=Number(arguments[2])),Object(b.a)(arguments[1])?t=arguments[1]:Object(or.a)(arguments[1])&&(n=Number(arguments[1])),function(i){return i.lift(new Qr(e,n,r,t))}}var Qr=function(){function e(e,t,n,r){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new ti(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),ei=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return r.a(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(on.a),ti=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;s.destination=t,s.windowTimeSpan=n,s.windowCreationInterval=r,s.maxWindowSize=i,s.scheduler=o,s.windows=[];var a=s.openWindow();if(null!==r&&r>=0){var c={subscriber:s,window:a,context:null},u={windowTimeSpan:n,windowCreationInterval:r,subscriber:s,scheduler:o};s.add(o.schedule(ii,n,c)),s.add(o.schedule(ri,r,u))}else{var h={subscriber:s,window:a,windowTimeSpan:n};s.add(o.schedule(ni,n,h))}return s}return r.a(t,e),t.prototype._next=function(e){for(var t=this.windows,n=t.length,r=0;r<n;r++){var i=t[r];i.closed||(i.next(e),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new ei;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(p.a);function ni(e){var t=e.subscriber,n=e.windowTimeSpan,r=e.window;r&&t.closeWindow(r),e.window=t.openWindow(),this.schedule(e,n)}function ri(e){var t=e.windowTimeSpan,n=e.subscriber,r=e.scheduler,i=e.windowCreationInterval,o=n.openWindow(),s={action:this,subscription:null},a={subscriber:n,window:o,context:s};s.subscription=r.schedule(ii,t,a),this.add(s.subscription),this.schedule(e,i)}function ii(e){var t=e.subscriber,n=e.window,r=e.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),t.closeWindow(n)}function oi(e,t){return function(n){return n.lift(new si(e,t))}}var si=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new ai(e,this.openings,this.closingSelector))},e}(),ai=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=Object(M.a)(i,n,n)),i}return r.a(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var n=t.length,r=0;r<n;r++)t[r].window.next(e)},t.prototype._error=function(t){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var o=n[i];o.window.error(t),o.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var n=t.length,r=-1;++r<n;){var i=t[r];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,n=-1;++n<t;){var r=e[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,n,r,i){if(e===this.openings){var o=void 0;try{o=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var s=new on.a,a=new R.a,c={window:s,subscription:a};this.contexts.push(c);var u=Object(M.a)(this,o,c);u.closed?this.closeWindow(this.contexts.length-1):(u.context=c,a.add(u)),this.destination.next(s)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,n=t[e],r=n.window,i=n.subscription;t.splice(e,1),r.complete(),i.unsubscribe()}},t}(O.a);function ci(e){return function(t){return t.lift(new ui(e))}}var ui=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new hi(e,this.closingSelector))},e}(),hi=function(e){function t(t,n){var r=e.call(this,t)||this;return r.destination=t,r.closingSelector=n,r.openWindow(),r}return r.a(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.openWindow(i)},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t=this.window;t&&t.complete();var n,r=this.window=new on.a;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(e){return this.destination.error(e),void this.window.error(e)}this.add(this.closingNotification=Object(M.a)(this,n))},t}(O.a);function li(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n;"function"==typeof e[e.length-1]&&(n=e.pop());var r=e;return t.lift(new fi(r,n))}}var fi=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new di(e,this.observables,this.project))},e}(),di=function(e){function t(t,n,r){var i=e.call(this,t)||this;i.observables=n,i.project=r,i.toRespond=[];var o=n.length;i.values=new Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(s=0;s<o;s++){var a=n[s];i.add(Object(M.a)(i,a,void 0,s))}return i}return r.a(t,e),t.prototype.notifyNext=function(e,t,n){this.values[n]=t;var r=this.toRespond;if(r.length>0){var i=r.indexOf(n);-1!==i&&r.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(O.a),pi=n(54);function vi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(pi.b.apply(void 0,[t].concat(e)))}}function gi(e){return function(t){return t.lift(new pi.a(e))}}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"shimGetUserMedia",(function(){return b})),n.d(r,"shimGetDisplayMedia",(function(){return _})),n.d(r,"shimMediaStream",(function(){return w})),n.d(r,"shimOnTrack",(function(){return S})),n.d(r,"shimGetSendersWithDtmf",(function(){return T})),n.d(r,"shimGetStats",(function(){return x})),n.d(r,"shimSenderReceiverGetStats",(function(){return C})),n.d(r,"shimAddTrackRemoveTrackWithNative",(function(){return E})),n.d(r,"shimAddTrackRemoveTrack",(function(){return R})),n.d(r,"shimPeerConnection",(function(){return M})),n.d(r,"fixNegotiationNeeded",(function(){return O}));var i={};n.r(i),n.d(i,"shimGetUserMedia",(function(){return A})),n.d(i,"shimGetDisplayMedia",(function(){return P})),n.d(i,"shimOnTrack",(function(){return k})),n.d(i,"shimPeerConnection",(function(){return I})),n.d(i,"shimSenderGetStats",(function(){return D})),n.d(i,"shimReceiverGetStats",(function(){return N})),n.d(i,"shimRemoveStream",(function(){return j})),n.d(i,"shimRTCDataChannel",(function(){return L})),n.d(i,"shimAddTransceiver",(function(){return U})),n.d(i,"shimGetParameters",(function(){return F})),n.d(i,"shimCreateOffer",(function(){return B})),n.d(i,"shimCreateAnswer",(function(){return V}));var o={};n.r(o),n.d(o,"shimLocalStreamsAPI",(function(){return W})),n.d(o,"shimRemoteStreamsAPI",(function(){return H})),n.d(o,"shimCallbacksAPI",(function(){return q})),n.d(o,"shimGetUserMedia",(function(){return z})),n.d(o,"shimConstraints",(function(){return G})),n.d(o,"shimRTCIceServerUrls",(function(){return Y})),n.d(o,"shimTrackEventTransceiver",(function(){return $})),n.d(o,"shimCreateOfferLegacy",(function(){return K})),n.d(o,"shimAudioContext",(function(){return X}));var s={};n.r(s),n.d(s,"shimRTCIceCandidate",(function(){return Q})),n.d(s,"shimMaxMessageSize",(function(){return ee})),n.d(s,"shimSendThrowTypeError",(function(){return te})),n.d(s,"shimConnectionState",(function(){return ne})),n.d(s,"removeExtmapAllowMixed",(function(){return re})),n.d(s,"shimAddIceCandidateNullOrEmpty",(function(){return ie})),n.d(s,"shimParameterlessSetLocalDescription",(function(){return oe}));let a=!0,c=!0;function u(e,t,n){const r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function h(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,o),i.apply(this,[e,o])};const o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(n))return o.apply(this,arguments);const r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function l(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function f(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(c=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function d(){if("object"==typeof window){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function p(e,t){c&&console.warn(e+" is deprecated, please use "+t+" instead.")}function v(e){return"[object Object]"===Object.prototype.toString.call(e)}function g(e){return v(e)?Object.keys(e).reduce((function(t,n){const r=v(e[n]),i=r?g(e[n]):e[n],o=r&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[n]:i})}),{}):e}function m(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach(e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)}),o.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&function e(t,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(i=>{i.endsWith("Id")?e(t,t.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach(n=>{e(t,t.get(n),r)})}))}(e,n,i)})}),i}const y=d;function b(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const r=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[i("min",n)]=r.ideal,t.optional.push(e),e={},e[i("max",n)]=r.ideal,t.optional.push(e)):(e[i("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=r(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then(n=>{let s=(n=n.filter(e=>"videoinput"===e.kind)).find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!s&&n.length&&t.includes("back")&&(s=n[n.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=r(e.video),y("chrome: "+JSON.stringify(e)),i(e)})}e.video=r(e.video)}return y("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,r){i(e,e=>{n.webkitGetUserMedia(e,t,e=>{r&&r(o(e))})})}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return i(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException("","NotFoundError");return e},e=>Promise.reject(o(e))))}}}function _(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then(t=>{const r=n.video&&n.video.width,i=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function w(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function S(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.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=[t.stream],this.dispatchEvent(i)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else h(e,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function T(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach(e=>{const t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.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 x(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach(e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(t=>{n[t]=e.stat(t)}),t[n.id]=n}),t},o=function(e){return new Map(Object.keys(e).map(t=>[t,e[t]]))};if(arguments.length>=2){const r=function(e){n(o(i(e)))};return t.apply(this,[r,e])}return new Promise((e,n)=>{t.apply(this,[function(t){e(o(i(t)))},n])}).then(n,r)}}function C(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>m(t,e.track,!0))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),h(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>m(t,e.track,!1))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function E(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=t.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=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")});const t=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter(e=>-1===t.indexOf(e));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]}),i.apply(this,arguments)}}function R(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return E(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function s(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,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(e=>e===t))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(e=>e.track===t);if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=o(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>o(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]}));const a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=s(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function M(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function O(e,t){h(e,"negotiationneeded",e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e})}function A(e,t){const n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){p("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=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)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function P(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}function k(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function I(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return r.apply(this,[e||null]).then(e=>{if(t.version<53&&!i)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if("TypeError"!==t.name)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(i,o)}}function D(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function N(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),h(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function j(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){p("removeStream","removeTrack"),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function L(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function U(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach(e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=t.apply(this,arguments);if(n){const{sender:t}=r,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(n).then(()=>{delete t.sendEncodings}).catch(()=>{delete t.sendEncodings})))}return r})}function F(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function B(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function V(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function W(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function H(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)})})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function q(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let a=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=a,a=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=a,a=function(e,t,n){const r=s.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=a}function z(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(G(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function G(e){return e&&void 0!==e.video?Object.assign({},e,{video:g(e.video)}):e}function Y(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let r=e.iceServers[n];!r.hasOwnProperty("urls")&&r.hasOwnProperty("url")?(p("RTCIceServer.url","RTCIceServer.urls"),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function $(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function K(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find(e=>"audio"===e.receiver.track.kind);!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find(e=>"video"===e.receiver.track.kind);!1===e.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!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}}function X(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Z=n(43),J=n.n(Z);function Q(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),r=J.a.parseCandidate(e.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 t(e)},e.RTCIceCandidate.prototype=t.prototype,h(e,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t))}function ee(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=J.a.splitSections(e.sdp);return t.shift(),t.some(e=>{const t=J.a.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})},r=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},i=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},o=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const i=J.a.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},s=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=r(arguments[0]),t=i(e),n=o(arguments[0],e);let s;s=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const a={};Object.defineProperty(a,"maxMessageSize",{get:()=>s}),this._sctp=a}return s.apply(this,arguments)}}function te(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},h(e,"datachannel",e=>(t(e.channel,e.target),e))}function ne(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function re(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter(e=>"a=extmap-allow-mixed"!==e.trim()).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function ie(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function oe(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return n.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then(e=>n.apply(this,[e]))})}const se=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=d,a=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=u(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=u(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=u(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),c={browserDetails:a,commonShim:s,extractVersion:u,disableLog:l,disableWarnings:f,sdp:Z};switch(a.browser){case"chrome":if(!r||!M||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),c;if(null===a.version)return n("Chrome shim can not determine version, not shimming."),c;n("adapter.js shimming chrome."),c.browserShim=r,ie(e,a),oe(e),b(e,a),w(e),M(e,a),S(e),R(e,a),T(e),x(e),C(e),O(e,a),Q(e),ne(e),ee(e,a),te(e),re(e,a);break;case"firefox":if(!i||!I||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),c;n("adapter.js shimming firefox."),c.browserShim=i,ie(e,a),oe(e),A(e,a),I(e,a),k(e),j(e),D(e),N(e),L(e),U(e),F(e),B(e),V(e),Q(e),ne(e),ee(e,a),te(e);break;case"safari":if(!o||!t.shimSafari)return n("Safari shim is not included in this adapter release."),c;n("adapter.js shimming safari."),c.browserShim=o,ie(e,a),oe(e),Y(e),K(e),q(e),W(e),H(e),$(e),z(e),X(e),Q(e),ee(e,a),te(e),re(e,a);break;default:n("Unsupported browser!")}return c}({window:"undefined"==typeof window?void 0:window});t.default=se},function(e,t,n){"use strict";n.r(t),console.log("BUILD/SERIOUSLY.MODULE");let r,i,o,s,a,c,u,h={},l={},f={},d={},p=[],v={},g={},m={canvas:[],image:[],video:[]},y={},b=window.WeakMap&&new WeakMap,_=0,w=function(){},S={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]},T=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,x=/^#(([0-9a-fA-F]{3,8}))/,C=["x","y","z","w"],E=["r","g","b","a"],R={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},M=["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"],O=/^[\t ]*#define[\t ]+SHADER_NAME\s+([^$\n\r]+)/i,A={frustum:function(e,t,n,r,i,o,s){s||(s=A.create());var a=t-e,c=r-n,u=o-i;return s[0]=2*i/a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/c,s[6]=0,s[7]=0,s[8]=(t+e)/a,s[9]=(r+n)/c,s[10]=-(o+i)/u,s[11]=-1,s[12]=0,s[13]=0,s[14]=-o*i*2/u,s[15]=0,s},perspective:function(e,t,n,r,i){var o=n*Math.tan(e*Math.PI/360),s=o*t;return A.frustum(-s,s,-o,o,n,r,i)},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],u=t[6],h=t[7],l=t[8],f=t[9],d=t[10],p=t[11],v=t[12],g=t[13],m=t[14],y=t[15],b=n[0],_=n[1],w=n[2],S=n[3];return e[0]=b*r+_*a+w*l+S*v,e[1]=b*i+_*c+w*f+S*g,e[2]=b*o+_*u+w*d+S*m,e[3]=b*s+_*h+w*p+S*y,b=n[4],_=n[5],w=n[6],S=n[7],e[4]=b*r+_*a+w*l+S*v,e[5]=b*i+_*c+w*f+S*g,e[6]=b*o+_*u+w*d+S*m,e[7]=b*s+_*h+w*p+S*y,b=n[8],_=n[9],w=n[10],S=n[11],e[8]=b*r+_*a+w*l+S*v,e[9]=b*i+_*c+w*f+S*g,e[10]=b*o+_*u+w*d+S*m,e[11]=b*s+_*h+w*p+S*y,b=n[12],_=n[13],w=n[14],S=n[15],e[12]=b*r+_*a+w*l+S*v,e[13]=b*i+_*c+w*f+S*g,e[14]=b*o+_*u+w*d+S*m,e[15]=b*s+_*h+w*p+S*y,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},P=(j=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){var t,n,r;return t=(new Date).getTime(),n=Math.max(0,16-(t-j)),r=window.setTimeout((function(){e(t+n)}),n),j=t+n,r}),k=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(e){window.cancelTimeout(e)},I=["alias","destroy","effect","id","initialize","inputs","isDestroyed","isReady","matte","off","on","readPixels","render","title","update"],D=["alias","destroy","id","inputs","isDestroyed","isReady","off","on","source","title","update"],N=["aliases","defaults","destroy","effect","go","id","incompatible","isDestroyed","isEffect","isNode","isSource","isTarget","isTransform","removeAlias","render","source","stop","target","transform"];var j;function L(e,t){var n,r;if("string"==typeof e)n=document.querySelector(e);else if(!e)return!1;return e.tagName&&(n=e),n?(r=n.tagName.toLowerCase(),t&&t.indexOf(r)<0?e:n):e}function U(e,t){var n,r;for(n in e.prototype&&t.prototype&&e.prototype!==t.prototype&&U(e.prototype,t.prototype),t)t.hasOwnProperty(n)&&((r=Object.getOwnPropertyDescriptor(t,n)).get||r.set?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:r.get,set:r.set}):e[n]=t[n]);return e}function F(e){var t;if(!console)return w;if("function"==typeof console[e])t=console[e];else{if("function"!=typeof console.log)return w;t=console.log}return t.bind?t.bind(console):function(){t.apply(console,arguments)}}function B(e,t){if(t||(t="HTMLElement"),e instanceof window[t])return!0;if(!e||"object"!=typeof e)return!1;for(;e;)if((e=Object.getPrototypeOf(e))&&e.constructor.name===t)return!0;return!1}function V(e,t,n,r,i){function o(e,t,n){return(n%=1)<0&&(n+=1),n<1/6?e+(t-e)*n*6:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var s,a;return s=2*n-(a=n<.5?n*(t+1):n+t-n*t),i||(i=[]),i[0]=o(s,a,e+1/3),i[1]=o(s,a,e),i[2]=o(s,a,e-1/3),i[3]=r,i}function W(e){var t,n,r,i="#",o=e[3]<1?4:3;for(t=0;t<o;t++)r=(n=Math.min(255,Math.round(255*e[t]||0))).toString(16),n<16&&(r="0"+r),i+=r;return i}function H(e){return Array.isArray(e)||e&&e.BYTES_PER_ELEMENT&&"length"in e}function q(e){if("function"!=typeof e)throw new Error("setTimeoutZero argument is not a function");p.push(e),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout((function(){p.length&&p.shift()()}),0)}function z(e,t){var n;try{n=window.WebGLDebugUtils&&t&&t.debugContext?window.WebGLDebugUtils.makeDebugContext(e.getContext("webgl",t)):e.getContext("webgl",t)}catch(e){}if(!n)try{n=e.getContext("experimental-webgl",t)}catch(e){}return n}function G(){var e;return r&&r.getError()===r.CONTEXT_LOST_WEBGL&&(r=void 0),r||!window.WebGLRenderingContext||o||(e=document.createElement("canvas"),r=z(e),r?e.addEventListener("webglcontextlost",(function t(n){n.preventDefault(),r&&r.canvas===this&&(r=void 0,e.removeEventListener("webglcontextlost",t,!1))}),!1):X.logger.warn("Unable to access WebGL.")),r}function Y(e){var t,n,r;function i(e,r){var i,o;H(e)?(i=e[0],o=e[1]||i):i=e,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),n[i]=o,r||(t.firstValue=i)}function o(e){return e}for(r in e.inputs)if(e.inputs.hasOwnProperty(r)){if(e.reserved.indexOf(r)>=0||Object.prototype[r])throw new Error("Reserved input name: "+r);(t=e.inputs[r]).name=r,isNaN(t.min)&&(t.min=-1/0),isNaN(t.max)&&(t.max=1/0),isNaN(t.minCount)&&(t.minCount=-1/0),isNaN(t.maxCount)&&(t.maxCount=1/0),isNaN(t.step)&&(t.step=0),isNaN(t.mod)&&(t.mod=0),"enum"===t.type&&t.options&&H(t.options)&&t.options.length&&(n={},t.options.forEach(i),t.options=n),"vector"===t.type?t.dimensions<2?t.dimensions=2:t.dimensions>4||!t.dimensions||isNaN(t.dimensions)?t.dimensions=4:t.dimensions=Math.round(t.dimensions):t.dimensions=1,t.shaderDirty=!!t.shaderDirty,"function"!=typeof t.validate&&(t.validate=X.inputValidators[t.type]||o),e.defaultImageInput||"image"!==t.type||(e.defaultImageInput=r)}}function $(e,t,n,r){var i,o,s,a;!0===r||r&&r.useFloat;this.type=e.UNSIGNED_BYTE,i=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,i),r&&r.texture?(this.texture=r.texture,e.bindTexture(e.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===e.FLOAT?(s=new Float32Array(t*n*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.FLOAT,s)):(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),this.type=e.UNSIGNED_BYTE)}catch(r){this.type=e.UNSIGNED_BYTE,s=new Uint8Array(t*n*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,s)}if(o=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t,n),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0),(a=e.checkFramebufferStatus(e.FRAMEBUFFER))===e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(a===e.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(a!==e.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+a);e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),this.gl=e,this.frameBuffer=i,this.renderBuffer=o,this.width=t,this.height=n}function K(e,t,n){var r,i,o,s,a,c,u,h,l="";function f(t,n){var r,i;if(r=n?e.createShader(e.FRAGMENT_SHADER):e.createShader(e.VERTEX_SHADER),e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){for(t=t.split(/[\n\r]/),i=0;i<t.length;i++)t[i]=i+1+":\t"+t[i];throw t.unshift("Error compiling "+(n?"fragment":"vertex")+" shader:"),X.logger.error(t.join("\n")),new Error("Shader error: "+e.getShaderInfoLog(r))}return r}function d(t,n){if(t.type===e.SAMPLER_2D)return function(r){t.glTexture=e["TEXTURE"+r],e.uniform1i(n,r)};if(t.type===e.BOOL||t.type===e.INT)return t.size>1?function(t){e.uniform1iv(n,t)}:function(t){e.uniform1i(n,t)};if(t.type===e.FLOAT)return t.size>1?function(t){e.uniform1fv(n,t)}:function(t){e.uniform1f(n,t)};if(t.type===e.FLOAT_VEC2)return function(t){e.uniform2f(n,t[0],t[1])};if(t.type===e.FLOAT_VEC3)return function(t){e.uniform3f(n,t[0],t[1],t[2])};if(t.type===e.FLOAT_VEC4)return function(t){e.uniform4f(n,t[0],t[1],t[2],t[3])};if(t.type===e.FLOAT_MAT3)return function(t){e.uniformMatrix3fv(n,!1,t)};if(t.type===e.FLOAT_MAT4)return function(t){e.uniformMatrix4fv(n,!1,t)};throw new Error("Unknown shader uniform type: "+t.type)}function p(t){return function(){return e.getUniform(r,t)}}if(i=f(t),o=f(n,!0),r=e.createProgram(),e.attachShader(r,i),(s=e.getShaderInfoLog(i))&&(l+="Vertex shader error: "+s+"\n"),e.attachShader(r,o),(s=e.getShaderInfoLog(o))&&(l+="Fragment shader error: "+s+"\n"),e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS))throw l+=e.getProgramInfoLog(r),e.deleteProgram(r),e.deleteShader(i),e.deleteShader(o),(u=O.exec(t)||O.exec(n))&&(l="Shader = "+u[1]+"\n"+l),M.forEach((function(t){l+="\n"+t+": "+e.getParameter(e[t])})),new Error("Could not initialize shader:\n"+l);for(e.useProgram(r),this.uniforms={},c=e.getProgramParameter(r,e.ACTIVE_UNIFORMS),a=0;a<c;++a)(h={info:e.getActiveUniform(r,a)}).name=h.info.name.replace(/\[0\]$/,""),h.loc=e.getUniformLocation(r,h.name),h.set=d(h.info,h.loc),h.get=p(h.loc),this.uniforms[h.name]=h,this[h.name]||(this[h.name]=h);for(this.attributes={},this.location={},c=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES),a=0;a<c;++a)(h={info:e.getActiveAttrib(r,a)}).name=h.info.name,h.location=e.getAttribLocation(r,h.name),this.attributes[h.name]=h,this.location[h.name]=h.location;this.gl=e,this.program=r,this.destroy=function(){var t;for(t in e&&(e.deleteProgram(r),e.deleteShader(i),e.deleteShader(o)),this)this.hasOwnProperty(t)&&delete this[t];r=null,i=null,o=null}}function X(e){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(e);var t,n,r,i,o,a,p,y,S,T,x,C,E,M,I,D=++_,j=this,F=[],V={},H=0,G=[],Z=[],J=[],Q=[],ee={},te=[],ne=[],re={},ie={},oe=!1,se=!1;function ae(e,t){var n,r,i;return!!t&&(n=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e.vertices,t.STATIC_DRAW),n.size=3,r=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,r),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.indices,t.STATIC_DRAW),i=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,i),t.bufferData(t.ARRAY_BUFFER,e.coords,t.STATIC_DRAW),i.size=2,{vertex:n,index:r,texCoord:i,length:e.indices.length,mode:e.mode||t.TRIANGLES})}function ce(e){var t={};return t.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),t.indices=new Uint16Array([0,1,2,0,2,3]),t.coords=new Float32Array([0,0,1,0,1,1,0,1]),ae(t,e)}function ue(e){var r,s;if(!n)if(e.canvas.addEventListener("webglcontextlost",le,!1),e.canvas.addEventListener("webglcontextrestored",he,!1),e.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(n=e,t=e.canvas,i=ce(n),o=new K(n,"#define SHADER_NAME seriously.base\n"+c,"#define SHADER_NAME seriously.base\n"+u),r=0;r<Q.length;r++)(s=Q[r]).gl=n,s.initialize(),s.buildShader();for(r=0;r<G.length;r++)(s=G[r]).initialize();for(r=0;r<Z.length;r++)(s=Z[r]).model||(s.model=i,s.shader=o)}}function he(){var e,t,i,o;if(r&&!n){if(B(t=r.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(e=z(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:r.debugContext})){if(e.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ue(e),r.renderToTexture?r.frameBuffer=new $(n,r.width,r.height,!1):r.frameBuffer={frameBuffer:null},i=0;i<F.length;i++)(o=F[i]).setDirty(),o.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function le(e){var r,s;for(e&&(X.logger.warn("WebGL context lost"),e.preventDefault()),I&&(k(I),I=0),t&&t.removeEventListener("webglcontextlost",le,!1),r=0;r<Q.length;r++)(s=Q[r]).gl=null,s.initialized=!1,s.baseShader=null,s.model=null,s.frameBuffer=null,s.texture=null,s.shader&&s.shader.destroy&&(s.shader.destroy(),s.effect.commonShader&&delete ie[s.hook]),s.shaderDirty=!0,s.shader=null,s.effect.lostContext&&s.effect.lostContext.call(s),e&&s.emit("webglcontextlost");for(r=0;r<G.length;r++)(s=G[r]).texture=null,s.initialized=!1,s.allowRefresh=!1,e&&s.emit("webglcontextlost");for(r=0;r<J.length;r++)(s=J[r]).frameBuffer=null,s.texture=null,e&&s.emit("webglcontextlost");for(r=0;r<Z.length;r++)(s=Z[r]).model=!1,s.frameBuffer=null,e&&s.emit("webglcontextlost");o&&o.destroy&&o.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,o=null,n=null,t=null}function fe(e){var t,n,r=!1;if(I=0,te.length)for(r=!0,t=0;t<te.length;t++)te[t].call(j,e);if(G&&G.length)for(r=!0,t=0;t<G.length;t++)((n=G[t]).dirty||n.checkDirty&&n.checkDirty())&&(n.dirty=!1,n.setDirty());for(t=0;t<Z.length;t++)(n=Z[t]).auto&&n.dirty&&n.render();if(ne.length)for(r=!0,t=0;t<ne.length;t++)ne[t].call(j);r&&!I&&(I=P(fe))}function de(e,t,r,i,o,s){var a,c,u,h,l,f,d,v,g,m=0,b=o&&o.gl||n;if(b){for(a in o?(h=s&&s.width||o.width||b.canvas.width,l=s&&s.height||o.height||b.canvas.height):(h=s&&s.width||b.canvas.width,l=s&&s.height||b.canvas.height),e.use(),b.viewport(0,0,h,l),b.bindFramebuffer(b.FRAMEBUFFER,i),b.enableVertexAttribArray(e.location.position),b.enableVertexAttribArray(e.location.texCoord),t.texCoord&&(b.bindBuffer(b.ARRAY_BUFFER,t.texCoord),b.vertexAttribPointer(e.location.texCoord,t.texCoord.size,b.FLOAT,!1,0,0)),b.bindBuffer(b.ARRAY_BUFFER,t.vertex),b.vertexAttribPointer(e.location.position,t.vertex.size,b.FLOAT,!1,0,0),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,t.index),s&&s.depth?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),s?void 0===s.blend||s.blend?(n.enable(n.BLEND),f=void 0===s.srcRGB?n.ONE:s.srcRGB,v=s.dstRGB||n.ZERO,d=void 0===s.srcAlpha?f:s.srcAlpha,g=void 0===s.dstAlpha?v:s.dstAlpha,n.blendFuncSeparate(f,v,d,g),n.blendEquation(s.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(a)&&(c=r[a],(u=e.uniforms[a])&&(B(c,"WebGLTexture")?(b.activeTexture(b.TEXTURE0+m),b.bindTexture(b.TEXTURE_2D,c),u.set(m),m++):c instanceof p||c instanceof y||c instanceof S?c.texture&&(b.activeTexture(b.TEXTURE0+m),b.bindTexture(b.TEXTURE_2D,c.texture),u.set(m),m++):null!=c&&u.set(c)));s&&void 0!==s.clear&&!s.clear||(b.clearColor(0,0,0,0),b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)),b.drawElements(t.mode,t.length,b.UNSIGNED_SHORT,0),n.enable(n.DEPTH_TEST)}}function pe(e,t,n){var r,i;if(("string"!=typeof e||!t&&0!==t)&&(n&&"object"==typeof n||(n=t),t=e),"string"==typeof e&&f[e]||(e=null),t instanceof p||t instanceof y||t instanceof S)r=t;else if(t instanceof x||t instanceof C||t instanceof E){if(!(r=V[t.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),i=0;i<G.length;i++)if(r=G[i],(!e||e===r.hook)&&r.compare&&r.compare(t,n))return r;r=new p(e,t,n)}return r}function ve(e,t){var n,r,i;if(!(e instanceof y||e instanceof S))return!1;if(e===t)return!0;for(n in i=e.sources)if(i.hasOwnProperty(n)&&((r=i[n])===t||ve(r,t)))return!0;return!1}(a=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=j,this.listeners={},this.id=H,H++}).prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},a.prototype.setUnready=function(){var e;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setUnready()},a.prototype.setDirty=function(){var e;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setDirty()},a.prototype.initFrameBuffer=function(e){n&&(this.frameBuffer=new $(n,this.width,this.height,e))},a.prototype.readPixels=function(e,t,r,i,o){var s=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===o)o=new Uint8Array(r*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,r,i,n.RGBA,n.UNSIGNED_BYTE,o),o},a.prototype.resize=function(){var e,t;this.source?(e=this.source.width,t=this.source.height):this.sources&&this.sources.source?(e=this.sources.source.width,t=this.sources.source.height):this.inputs&&this.inputs.width?(e=this.inputs.width,t=this.inputs.height||e):this.inputs&&this.inputs.height?e=t=this.inputs.height:(e=1,t=1),e=Math.floor(e),t=Math.floor(t),this.width===e&&this.height===t||(this.width=e,this.height=t,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=t),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,t)},a.prototype.on=function(e,t){var n,r=-1;e&&"function"==typeof t&&((n=this.listeners[e])?r=n.indexOf(t):n=this.listeners[e]=[],r<0&&n.push(t))},a.prototype.off=function(e,t){var n,r=-1;e&&"function"==typeof t&&(n=this.listeners[e])&&(r=n.indexOf(t))>=0&&n.splice(r,1)},a.prototype.emit=function(e){var t,n=this.listeners[e];if(n&&n.length)for(t=0;t<n.length;t++)q(n[t])},a.prototype.destroy=function(){var e,t;for(t in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];for(e in this.uniforms)this.uniforms.hasOwnProperty(e)&&delete this.uniforms[e];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(e=F.indexOf(this))>=0&&F.splice(e,1),delete V[this.id],this.isDestroyed=!0},x=function(e){var t,n=e;function r(e,t){var r,i,o;return o=n.effect.inputs[e],r=n.inputElements[e],"string"==typeof t&&isNaN(t)&&("enum"===o.type?o.options.hasOwnProperty(t)||(t=L(t,["select"])):"number"===o.type||"boolean"===o.type?t=L(t,["input","select"]):"image"===o.type&&(t=L(t,["canvas","img","video"]))),B(t,"HTMLInputElement")||B(t,"HTMLSelectElement")?(i=t.value,r&&r.element!==t&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[e],r=null),r||(r={element:t,listener:function(e,r){return function(){var i,s;i="checkbox"===t.type?t.checked:r.value,s=n.setInput(e,i),"color"===o.type&&(s=W(s).substr(0,7)),s!==i&&(r.value=s)}}(e,t)},n.inputElements[e]=r,"range"===t.type?(t.addEventListener("input",r.listener,!0),t.addEventListener("change",r.listener,!0)):t.addEventListener("change",r.listener,!0)),r&&"checkbox"===t.type&&(i=t.checked)):(r&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[e]),i=t),n.setInput(e,i),n.inputs[e]}function i(e){return function(t){var n=r(e,t);return n&&n.pub}}function o(e){return function(){var t=n.inputs[e];return t&&t.pub}}function s(e){return function(t){return r(e,t)}}function a(e){return function(){return n.inputs[e]}}for(t in n.effect.inputs)if(n.effect.inputs.hasOwnProperty(t)){if(void 0!==this[t])throw new Error("Cannot overwrite Seriously."+t);"image"===n.effect.inputs[t].type?Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:o(t),set:i(t)}):Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:a(t),set:s(t)})}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(e,t,r,i,o){return n.readPixels(e,t,r,i,o)},this.on=function(e,t){n.on(e,t)},this.off=function(e,t){n.off(e,t)},this.inputs=function(e){var t,r,i,o;if(i=n.effect.inputs,e)return(r=i[e])?(t={type:r.type,defaultValue:r.defaultValue,title:r.title||e},"number"===r.type?(t.min=r.min,t.max=r.max,t.step=r.step,t.mod=r.mod):"enum"===r.type?t.options=U({},r.options):"vector"===r.type&&(t.dimensions=r.dimensions),r.description&&(t.description=r.description),t):null;for(o in t={},i)i.hasOwnProperty(o)&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return n.alias(e,t),this},this.matte=function(e){n.matte(e)},this.destroy=function(){var e,t;for(e in n.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(y=function(e,t){var r,i,o,c,u={};for(r in a.call(this,t),this.gl=n,this.effectRef=h[e],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=e,this.options=t,this.transform=null,this.effect=U({},this.effectRef),this.effectRef.definition&&U(this.effect,this.effectRef.definition.call(this,t)),Y(this.effect),this.uniforms.transform=s,this.inputs={},c=re[e],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)),o=i.validate.call(this,i.defaultValue,i),c&&void 0!==c[r]&&(o=i.validate.call(this,c[r],i,i.defaultValue,o),c[r]=o,"image"===i.type&&(u[r]=o)),this.inputs[r]=o,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 x(this),F.push(this),V[this.id]=this,Q.push(this),v[e].push(this),u)u.hasOwnProperty(r)&&this.setInput(r,u[r])}).prototype=Object.create(a.prototype),y.prototype.constructor=y,y.prototype.initialize=function(){if(!this.initialized){var e=this;this.baseShader=o,this.shape?this.model=ae(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,(function(){e.initFrameBuffer(!0)}),n):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},y.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize()},y.prototype.updateReady=function(){var e,t,n,r,i=!0;for(t in(n=this.effect).inputs)if(n.inputs.hasOwnProperty(t)&&"image"===this.effect.inputs[t].type&&(!this.sources[t]||!this.sources[t].ready)&&(!n.requires||n.requires.call(this,t,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),r=i?"setReady":"setUnready",this.targets))for(e=0;e<this.targets.length;e++)this.targets[e][r]()},y.prototype.setReady=y.prototype.updateReady,y.prototype.setUnready=y.prototype.updateReady,y.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},y.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},y.prototype.removeSource=function(e){var t,n=e&&e.pub;for(t in this.inputs)!this.inputs.hasOwnProperty(t)||this.inputs[t]!==e&&this.inputs[t]!==n||(this.inputs[t]=null);for(t in this.sources)!this.sources.hasOwnProperty(t)||this.sources[t]!==e&&this.sources[t]!==n||(this.sources[t]=null)},y.prototype.buildShader=function(){var e,t=this.effect,r=this;function i(e){return O.test(e)?e:"#define SHADER_NAME seriously."+r.hook+"\n"+e}this.shaderDirty&&(t.commonShader&&ie[this.hook]?(this.shader||ie[this.hook].count++,this.shader=ie[this.hook].shader):t.shader?(this.shader&&!t.commonShader&&this.shader.destroy(),(e=t.shader.call(this,this.inputs,{vertex:c,fragment:u},X.util))instanceof K?this.shader=e:e&&e.vertex&&e.fragment?this.shader=new K(n,i(e.vertex),i(e.fragment)):this.shader=o,t.commonShader&&(ie[this.hook]={count:1,shader:this.shader})):this.shader=o,this.shaderDirty=!1)},y.prototype.render=function(){var e,t,r,i=this.effect,o=this;if(n){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(e in this.sources)!this.sources.hasOwnProperty(e)||i.requires&&!i.requires.call(this,e,this.inputs)||(r="function"==typeof this.inPlace?this.inPlace(e):this.inPlace,this.sources[e].render(!r));this.frameBuffer&&(t=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,t,(function(e,t,n,r,i,s){de(e,t,n,r,i||o,s)})),this.emit("render")):t&&(de(this.shader,this.model,this.uniforms,t,this),this.emit("render")),this.dirty=!1}return this.texture}},y.prototype.setInput=function(e,t){var n,r,i,o,a,c=this;if(this.effect.inputs.hasOwnProperty(e)){if("image"===(n=this.effect.inputs[e]).type){if(t){if((t=pe(t))!==this.sources[e]){if(function(){var t,n=c.sources[e];if(n){for(t in c.sources)if(t!==e&&c.sources.hasOwnProperty(t)&&c.sources[t]===n)return;n.removeTarget(c)}}(),ve(t,this))throw new Error("Attempt to make cyclical connection.");this.sources[e]=t,t.addTarget(this)}}else delete this.sources[e],t=!1;r=this.sources[e],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(o=this.sources[i[0]],this.uniforms.transform=o&&o.cumulativeMatrix||s):this.uniforms.transform=s}else a=re[this.hook]&&void 0!==re[this.hook][e]?re[this.hook][e]:n.defaultValue,r=t=n.validate.call(this,t,n,a,this.inputs[e]);return this.inputs[e]===t&&"color"!==n.type&&"vector"!==n.type||(this.inputs[e]=t,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,t)),t}},y.prototype.alias=function(e,t){var n=this;if(N.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(e)&&(t||(t=e),j.removeAlias(t),ee[t]={node:this,input:e},Object.defineProperty(j,t,{configurable:!0,enumerable:!0,get:function(){return n.inputs[e]},set:function(t){return n.setInput(e,t)}})),this},y.prototype.matte=function(e){var t,n,r,i,o,s,a,c=[],u=[],h={};function l(e){var t,n,r,i,o,s,a,h,l,f,d,p=[];if(!e.simple){for(t=0;t<e.edges.length;t++)for(r=e.edges[t],n=t+1;n<e.edges.length;n++)i=e.edges[n],v=r[0],g=r[1],m=i[0],y=i[1],b=void 0,_=void 0,w=void 0,S=void 0,T=void 0,b=(y.x-m.x)*(v.y-m.y)-(y.y-m.y)*(v.x-m.x),_=(g.x-v.x)*(v.y-m.y)-(g.y-v.y)*(v.x-m.x),(o=!!((w=(y.y-m.y)*(g.x-v.x)-(y.x-m.x)*(g.y-v.y))&&(T=_/w,(S=b/w)>0&&S<=1&&T>0&&T<=1))&&{x:v.x+S*(g.x-v.x),y:v.y+S*(g.y-v.y)})&&(o.edge1=r,o.edge2=i,p.push(o));var v,g,m,y,b,_,w,S,T;if(p.length){for(l=[],t=0;t<p.length;t++)r=(o=p[t]).edge1,i=o.edge2,f={x:o.x,y:o.y,prev:r[0],next:i[1],id:u.length},e.vertices.push(f),u.push(f),d={x:o.x,y:o.y,prev:i[0],next:r[1],id:u.length},e.vertices.push(d),u.push(f),f.prev.next=f,f.next.prev=f,d.prev.next=d,d.next.prev=d;do{s={edges:[],vertices:[],simple:!0},l.push(s),a=h=e.vertices[0];do{t=e.vertices.indexOf(h),e.vertices.splice(t,1),s.edges.push([h,h.next]),s.vertices.push(h),h=h.next}while(h!==a)}while(e.vertices.length);for(t=c.indexOf(e),c.splice(t,1),t=0;t<l.length;t++)c.push(l[t])}else e.simple=!0}}function f(e){var t,n,r,i,o=e.vertices.length,s=0;for(t=o-1,n=0;n<o;t=n,n++)r=e.vertices[t],i=e.vertices[n],s+=r.x*i.y-i.x*r.y;return s>0}function d(e){var t,r,i,o,s,a,c,u,h,l,f,d=e.vertices,p=[],v=[];function g(e,t,n,r){var i,o,s,a,c,u,h,l,f,d,p,v;return i=n.x-t.x,o=n.y-t.y,s=e.x-n.x,a=e.y-n.y,c=t.x-e.x,u=t.y-e.y,h=r.x-e.x,l=r.y-e.y,f=r.x-t.x,d=r.y-t.y,p=r.x-n.x,v=r.y-n.y,i*d-o*f>=0&&s*v-a*p>=0&&c*l-u*h>=0}function m(e,t,n,r,i){var o,s,a,c;if(s=d[i[e]],a=d[i[t]],c=d[i[n]],0>(a.x-s.x)*(c.y-s.y)-(a.y-s.y)*(c.x-s.x))return!1;for(o=0;o<r;o++)if(o!==e&&o!==t&&o!==n&&g(s,a,c,d[i[o]]))return!1;return!0}if(r=d.length,e.clockWise)for(t=0;t<r;t++)p[t]=t;else for(t=0;t<r;t++)p[t]=r-1-t;for(o=2*(i=r),t=i-1;i>2;){if(o--<=0)return v;if(i<=(s=t)&&(s=0),i<=(t=s+1)&&(t=0),i<(a=t+1)&&(a=0),m(s,t,a,i,p)){for(c=p[s],u=p[t],h=p[a],e.clockWise?(v.push(d[c]),v.push(d[u]),v.push(d[h])):(v.push(d[h]),v.push(d[u]),v.push(d[c])),l=t,f=t+1;f<i;l++,f++)p[l]=p[f];o=2*--i}}n.indices=v}for(t=function(e){return e&&e.length&&Array.isArray(e)?Array.isArray(e[0])?Array.isArray(e[0])&&!isNaN(e[0][0])?[e]:e:[e]:[]}(e),r=0;r<t.length;r++){for(e=t[r],a=null,n={vertices:[],edges:[]},i=0;i<e.length;i++)"object"!=typeof(o=e[i])||isNaN(o.x)||isNaN(o.y)?o.length>=2&&!isNaN(o[0])&&!isNaN(o[1])&&(s={x:o[0],y:o[1],id:u.length}):s={x:o.x,y:o.y,id:u.length},s&&(a?(a.next=s,s.prev=a,s.next=n.vertices[0],n.vertices[0].prev=s):(n.head=s,s.next=s,s.prev=s),u.push(s),n.vertices.push(s),a=s);if(n.vertices.length>2)for(3===n.vertices.length&&(n.simple=!0),c.push(n),i=0;i<n.vertices.length;i++)s=n.vertices[i],n.edges.push([s,s.next])}for(r=c.length-1;r>=0;r--)l(n=c[r]);for(r=0;r<c.length;r++)(n=c[r]).clockWise=f(n),d(n);for(h.vertices=[],h.coords=[],r=0;r<u.length;r++)o=u[r],h.vertices.push(2*o.x-1),h.vertices.push(-2*o.y+1),h.vertices.push(-1),h.coords.push(o.x),h.coords.push(-1*o.y+1);for(h.vertices=new Float32Array(h.vertices),h.coords=new Float32Array(h.coords),h.indices=[],r=0;r<c.length;r++)for(n=c[r],i=0;i<n.indices.length;i++)o=n.indices[i],h.indices.push(o.id);h.indices=new Uint16Array(h.indices),this.shape=h,this.gl&&ae(h,this.gl)},y.prototype.destroy=function(){var e,t,n,r=this.hook;for(t in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,ie[r]&&(ie[r].count--,ie[r].count||delete ie[r]),this.shader&&this.shader.destroy&&this.shader!==o&&!ie[r]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(t)&&((n=this.inputElements[t]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(t in this.sources)this.sources.hasOwnProperty(t)&&((n=this.sources[t])&&n.removeTarget&&n.removeTarget(this),delete this.sources[t]);for(;this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(n=ee[t]).node===this&&j.removeAlias(t);(e=Q.indexOf(this))>=0&&Q.splice(e,1),(e=v[r].indexOf(this))>=0&&v[r].splice(e,1),a.prototype.destroy.call(this)},C=function(e){var t=e;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return t.source}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}},width:{enumerable:!0,configurable:!0,get:function(){return t.width}},height:{enumerable:!0,configurable:!0,get:function(){return t.height}}}),this.render=function(){t.render()},this.update=function(){t.setDirty()},this.readPixels=function(e,n,r,i,o){return t.readPixels(e,n,r,i,o)},this.on=function(e,n){t.on(e,n)},this.off=function(e,n){t.off(e,n)},this.destroy=function(){var e,n;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((n=Object.getOwnPropertyDescriptor(this,e)).get||n.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},(p=function(e,t,r){var i,o,s=r||{},c=void 0===s.flip||s.flip,u=s.width,h=s.height,l=!1,d=this,p=!1;function v(e,t,n,r){var i=f[e];if(i.definition){if(!(i=i.definition.call(d,t,n,r)))return null;i=U(U({},f[e]),i)}return i}function g(e){return d.source===e}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(r&&"object"==typeof r||(r=t),t=e),"string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),"string"==typeof e&&f[e]&&(o=v(e,t,r,!0))&&(this.hook=e,p=!0,l=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source)),!o&&B(t))"CANVAS"===t.tagName?(this.width=t.width,this.height=t.height,this.render=this.renderImageCanvas,p=!0,this.hook="canvas",this.compare=g):"IMG"===t.tagName&&(this.width=t.naturalWidth||1,this.height=t.naturalHeight||1,t.complete&&t.naturalWidth||(l=!0),t.addEventListener("load",(function(){d.isDestroyed||(d.width===t.naturalWidth&&d.height===t.naturalHeight||(d.width=t.naturalWidth,d.height=t.naturalHeight,d.resize()),d.setDirty(),d.setReady())}),!0),this.render=this.renderImageCanvas,p=!0,this.hook="image",this.compare=g);else if(!o&&B(t,"WebGLTexture")){if(n&&!n.isTexture(t))throw new Error("Not a valid WebGL texture.");isNaN(u)?isNaN(h)||(u=h):isNaN(h)&&(h=u),this.width=u,this.height=h,void 0===s.flip&&(c=!1),p=!0,this.texture=t,this.initialized=!0,this.hook="texture",this.compare=g,this.render=function(){}}if(!p&&!o)for(i in f)if(f.hasOwnProperty(i)&&f[i]&&(o=v(i,t,r,!1))){this.hook=i,p=!0,l=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source);break}if(!p)throw new Error("Unknown source type");this.source=t,void 0===this.flip&&(this.flip=c),this.targets=[],l||d.setReady(),this.pub=new C(this),F.push(this),V[this.id]=this,G.push(this),m[this.hook].push(this),G.length&&!I&&fe()}).prototype=Object.create(a.prototype),p.prototype.constructor=p,p.prototype.initialize=function(){var e;n&&!this.texture&&this.ready&&(e=n.createTexture(),n.bindTexture(n.TEXTURE_2D,e),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=e,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},p.prototype.initFrameBuffer=function(e){n&&(this.frameBuffer=new $(n,this.width,this.height,{texture:this.texture,useFloat:e}))},p.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},p.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},p.prototype.resize=function(){var e,t;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(e=0;e<this.targets.length;e++)(t=this.targets[e]).resize(),t.setTransformDirty&&t.setTransformDirty()},p.prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},p.prototype.render=function(){var e=this.source;n&&(e||0===e)&&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,de,i,o)&&(this.dirty=!1,this.emit("render")))},p.prototype.renderImageCanvas=function(){var e=this.source;if(n&&e&&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,e),this.dirty=!1,this.emit("render"),!0}catch(e){e.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},p.prototype.destroy=function(){var e,t,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(t in(e=G.indexOf(this))>=0&&G.splice(e,1),(e=m[this.hook].indexOf(this))>=0&&m[this.hook].splice(e,1),this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];a.prototype.destroy.call(this)},M=function(e){var t=e;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(t.source)return t.source.pub},set:function(e){t.setSource(e)}},original:{enumerable:!0,configurable:!0,get:function(){return t.target}},width:{enumerable:!0,configurable:!0,get:function(){return t.width},set:function(e){!isNaN(e)&&e>0&&t.width!==e&&(t.width=e,t.resize(),t.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return t.height},set:function(e){!isNaN(e)&&e>0&&t.height!==e&&(t.height=e,t.resize(),t.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}}}),this.render=function(){t.render()},this.readPixels=function(e,n,r,i,o){return t.readPixels(e,n,r,i,o)},this.on=function(e,n){t.on(e,n)},this.off=function(e,n){t.off(e,n)},this.go=function(e){t.go(e)},this.stop=function(){t.stop()},this.getTexture=function(){return t.frameBuffer.texture},this.destroy=function(){var e,n;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((n=Object.getOwnPropertyDescriptor(this,e)).get||n.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.inputs=function(e){return{source:{type:"image"}}},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},((T=function(e,t,s){var h,l,f,p,v,g,m,y,_,S=this,T=!1;function x(e,t,r,s){var a=d[e];if(a.definition){if(!(a=a.definition.call(S,t,r,s)))return null;a=U(U({},d[e]),a),S.hook=_,T=!0,S.plugin=a,S.compare=a.compare,a.target&&(t=a.target),a.gl&&!S.gl&&(S.gl=a.gl,n||ue(a.gl)),S.gl===n&&(S.model=i,S.shader=o)}return a}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(s&&"object"==typeof s||(s=t),t=e),l=void 0===(h=s||{}).flip||h.flip,f=parseInt(h.width,10),p=parseInt(h.height,10),g=h.debugContext,"string"==typeof e&&d[e]&&x(e,t,h,!0),this.renderToTexture=h.renderToTexture,B(t,"WebGLFramebuffer"))if(m=t,B(h,"HTMLCanvasElement"))t=h;else if(B(h,"WebGLRenderingContext"))t=h.canvas;else if(B(h.canvas,"HTMLCanvasElement"))t=h.canvas;else{if(!B(h.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");t=h.context.canvas}if(B(t,"HTMLCanvasElement")){if(f=t.width,p=t.height,(!n||n.canvas!==t&&h.allowSecondaryWebGL)&&(v=z(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:g})),v)n&&n!==v?(this.gl=v,this.frameBuffer={frameBuffer:m||null},this.shader=new K(this.gl,c,u),this.model=ce.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||ue(v),this.render=this.renderWebGL,h.renderToTexture?n&&(this.frameBuffer=new $(n,f,p,!1)):this.frameBuffer={frameBuffer:m||null});else{if(!h.allowSecondaryWebGL&&n&&n.canvas!==t)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=w,X.logger.log("Unable to create WebGL context.")}T=!0}if(!T)for(_ in d)if(d.hasOwnProperty(_)&&d[_]&&x(_,t,h,!1))break;if(!T)throw new Error("Unknown target type");b&&((y=b.get(t))?X.logger.warn("Target already in use by another instance",t,Object.keys(y).map((function(e){return y[e]}))):(y={},b.set(t,y)),y[j.id]=j),this.target=t,this.transform=null,this.transformDirty=!0,this.flip=l,f&&(this.width=f),p&&(this.height=p),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==h.auto?this.auto=h.auto:this.auto=oe,this.frames=0,this.pub=new M(this),F.push(this),V[this.id]=this,Z.push(this)}).prototype=Object.create(a.prototype)).constructor=T,T.prototype.setSource=function(e){var t;(t=pe(e))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&(this.resize(),t.ready?this.setReady():this.setUnready()),this.setDirty())},T.prototype.setDirty=function(){this.dirty=!0,this.auto&&!I&&(I=P(fe))},T.prototype.resize=function(){B(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))},T.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},T.prototype.go=function(){this.auto=!0,this.setDirty()},T.prototype.stop=function(){this.auto=!1},T.prototype.render=function(){n&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,de,o,i)},T.prototype.renderWebGL=function(){var e,t,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||s:this.transformDirty&&(e=this.transform,A.copy(e,this.source.cumulativeMatrix||s),t=this.source.width/this.width,r=this.source.height/this.height,e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=r,e[5]*=r,e[6]*=r,e[7]*=r,this.uniforms.transform=e,this.transformDirty=!1),de(o,i,this.uniforms,this.frameBuffer.frameBuffer,this,R),this.emit("render"),this.dirty=!1}},T.prototype.renderSecondaryWebGL=function(){var e,t,n,r,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),e=this.source.width,t=this.source.height,this.pixels&&this.pixels.length===e*t*4||(this.pixels=new Uint8Array(e*t*4)),this.source.readPixels(0,0,e,t,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),e===this.width&&t===this.height?this.uniforms.transform=s:this.transformDirty&&(n=this.transform,A.copy(n,s),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,de(this.shader,this.model,this.uniforms,null,this,R),this.dirty=!1)},T.prototype.removeSource=function(e){this.source!==e&&this.source!==e.pub||(this.source=null)},T.prototype.destroy=function(){var e,n;this.source&&this.source.removeTarget&&this.source.removeTarget(this),b&&(delete(n=b.get(this.target))[j.id],Object.keys(n).length||b.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,(e=Z.indexOf(this))>=0&&Z.splice(e,1),a.prototype.destroy.call(this),this===r&&(t.removeEventListener("webglcontextrestored",he,!1),le(),r=null)},E=function(e){var t,n=e,r=this;function i(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){return t.get.call(n)},set:function(r){!function(e,t,r){var i,o,s;i=n.inputElements[e],"string"==typeof r&&isNaN(r)&&("enum"===t.type?t.options.hasOwnProperty(r)||(r=L(r,["select"])):"number"===t.type||"boolean"===t.type?r=L(r,["input","select"]):"image"===t.type&&(r=L(r,["canvas","img","video"]))),B(r,"HTMLInputElement")||B(r,"HTMLSelectElement")?(o=r.value,i&&i.element!==r&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[e],i=null),i||(i={element:r,listener:(s=r,function(){var t,i;t="checkbox"===r.type?r.checked:s.value,i=n.setInput(e,t),"color"===r.type&&(i=W(i)),i!==t&&(s.value=i)})},n.inputElements[e]=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&&(o=r.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[e]),o=r),n.setInput(e,o)}(e,t,r)}})}function o(e){return function(){e.apply(n,arguments)&&n.setTransformDirty()}}for(t 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(e){n.setSource(e)}}}),n.methods)n.methods.hasOwnProperty(t)&&(this[t]=o(n.methods[t]));for(t in n.inputs)n.inputs.hasOwnProperty(t)&&i(t,n.inputs[t]);this.update=function(){n.setDirty()},this.inputs=function(e){var t,r,i,o;if(i=n.plugin.inputs,e)return!(r=i[e])||r.method?null:(t={type:r.type,defaultValue:r.defaultValue,title:r.title||e},"number"===r.type?(t.min=r.min,t.max=r.max,t.step=r.step,t.mod=r.mod):"enum"===r.type?t.options=U({},r.options):"vector"===r.type&&(t.dimensions=r.dimensions),r.description&&(t.description=r.description),t);for(o in t={},i)i.hasOwnProperty(o)&&!i[o].method&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return n.alias(e,t),this},this.on=function(e,t){n.on(e,t)},this.off=function(e,t){n.off(e,t)},this.destroy=function(){var e,t;for(e in n.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(S=function(e,t){var n,r,i,o,s;for(n in this.matrix=new Float32Array(16),this.cumulativeMatrix=new Float32Array(16),this.ready=!1,this.width=1,this.height=1,this.seriously=j,this.transformRef=l[e],this.hook=e,this.id=H,H++,this.options=t,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=U({},this.transformRef),this.transformRef.definition&&U(this.plugin,this.transformRef.definition.call(this,t)),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),s=re[e],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),o=void 0===r.defaultValue?i:r.defaultValue,o=r.validate.call(this,o,r,i),s&&void 0!==s[n]&&(o=r.validate.call(this,s[n],r,r.defaultValue,o),s[n]=o),o!==i&&r.set.call(this,o));F.push(this),V[this.id]=this,this.pub=new E(this),J.push(this),g[e].push(this)}).prototype=Object.create(a.prototype),S.prototype.constructor=S,S.prototype.setDirty=function(){this.renderDirty=!0,a.prototype.setDirty.call(this)},S.prototype.setTransformDirty=function(){var e,t;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,e=0;e<this.targets.length;e++)(t=this.targets[e]).setTransformDirty?t.setTransformDirty():t.setDirty()},S.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty()},S.prototype.setSource=function(e){var t;if((t=pe(e))!==this.source){if(ve(t,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&t.ready?this.setReady():this.setUnready(),this.resize()}},S.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},S.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1),this.targets&&this.targets.length&&this.resize()},S.prototype.setInput=function(e,t){var n,r,i;if(this.plugin.inputs.hasOwnProperty(e))return n=this.plugin.inputs[e],r=re[this.hook]&&void 0!==re[this.hook][e]?re[this.hook][e]:n.defaultValue,i=n.get.call(this),void 0===r&&(r=i),t=n.validate.call(this,t,n,r,i),n.set.call(this,t)&&this.setTransformDirty(),n.get.call(this)},S.prototype.alias=function(e,t){var n,r,i=this;if(N.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(e)&&(t||(t=e),j.removeAlias(t),(n=this.inputs[e])?(r=i.inputs[e],Object.defineProperty(j,t,{configurable:!0,enumerable:!0,get:function(){return r.get.call(i)},set:function(e){r.set.call(i,e)&&i.setTransformDirty()}})):(n=this.methods[e])&&(r=n,j[t]=function(){r.apply(i,arguments)&&i.setTransformDirty()}),n&&(ee[t]={node:this,input:e})),this},S.prototype.render=function(e){return this.source?(this.source.render(),this.transformDirty&&(this.transformed?this.source.cumulativeMatrix?A.multiply(this.cumulativeMatrix,this.matrix,this.source.cumulativeMatrix):A.copy(this.cumulativeMatrix,this.matrix):A.copy(this.cumulativeMatrix,this.source.cumulativeMatrix||s),this.transformDirty=!1),e&&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||s,de(o,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&&(A.copy(this.cumulativeMatrix,this.matrix),this.transformDirty=!1),this.texture=null,void(this.dirty=!1))},S.prototype.readPixels=function(e,t,r,i,o){var s=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===o)o=new Uint8Array(r*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,r,i,n.RGBA,n.UNSIGNED_BYTE,o),o},S.prototype.destroy=function(){var e,t,n,r=this.hook;for(e 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(e)&&((n=this.inputElements[e]).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(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(n=ee[t]).node===this&&j.removeAlias(t);(e=J.indexOf(this))>=0&&J.splice(e,1),(e=g[r].indexOf(this))>=0&&g[r].splice(e,1),a.prototype.destroy.call(this)},S.prototype.setReady=a.prototype.setReady,S.prototype.setUnready=a.prototype.setUnready,S.prototype.on=a.prototype.on,S.prototype.off=a.prototype.off,S.prototype.emit=a.prototype.emit,(e=B(e,"HTMLCanvasElement")?{canvas:e}:e||{}).canvas,this.effect=function(e,t){if(!h[e])throw new Error("Unknown effect: "+e);return new y(e,t).pub},this.source=function(e,t,n){return pe(e,t,n).pub},this.transform=function(t,n){if("string"!=typeof t&&(n=t,t=!1),t){if(!l[t])throw new Error("Unknown transform: "+t)}else if(t=e&&e.defaultTransform||"2d",!l[t])throw new Error("No transform specified");return new S(t,n).pub},this.target=function(e,t,n){var r,i,o;for(e&&"string"==typeof e&&!d[e]&&(i=document.querySelector(e)),("string"!=typeof e||!t&&0!==t||i)&&(n&&"object"==typeof n||(n=t),t=i||e,e=null),"string"==typeof t&&isNaN(t)&&(t=document.querySelector(t)),o=0;o<Z.length;o++)if(r=Z[o],(!e||e===r.hook)&&(r.target===t||r.compare&&r.compare(t,n)))return r.pub;return(r=new T(e,t,n)).pub},this.aliases=function(){return Object.keys(ee)},this.removeAlias=function(e){ee[e]&&(delete this[e],delete ee[e])},this.defaults=function(e,t){var n;if(e)if("object"!=typeof e)null===t?delete re[e]:"object"==typeof t&&(re[e]=U({},t));else for(n in e)e.hasOwnProperty(n)&&this.defaults(n,e[n]);else if(null===e)for(n in re)re.hasOwnProperty(n)&&delete re[n]},this.go=function(e,t){var n;for("function"==typeof e&&te.indexOf(e)<0&&te.push(e),"function"==typeof t&&ne.indexOf(t)<0&&ne.push(t),oe=!0,n=0;n<Z.length;n++)Z[n].go();I||!te.length&&!ne.length||fe()},this.stop=function(){te.length=0,ne.length=0,k(I),I=0},this.render=function(){var t;for(t=0;t<Z.length;t++)Z[t].render(e)},this.destroy=function(){for(var e,t;F.length;)F[0].pub.destroy();for(e in this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w);j=null,G=[],Z=[],Q=[],F=[],te.length=0,ne.length=0,k(I),I=0,se=!0},this.isDestroyed=function(){return se},this.incompatible=function(e){var t,n,r;if(r=X.incompatible(e))return r;if(!e){for(t in v)if(v.hasOwnProperty(t)&&v[t].length&&(n=h[t])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"plugin-"+t;for(t in m)if(m.hasOwnProperty(t)&&m[t].length&&(n=f[t])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"source-"+t}return!1},this.isNode=function(e){var t;return!(!e||!(t=V[e.id])||t.isDestroyed)},this.isSource=function(e){return this.isNode(e)&&e instanceof C},this.isEffect=function(e){return this.isNode(e)&&e instanceof x},this.isTransform=function(e){return this.isNode(e)&&e instanceof E},this.isTarget=function(e){return this.isNode(e)&&e instanceof M},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return D}}}),this.defaults(e.defaults)}window.addEventListener("message",(function(e){e.source===window&&"seriously-timeout-message"===e.data&&(e.stopPropagation(),p.length>0&&p.shift()())}),!0),$.prototype.resize=function(e,t){var n=this.gl;this.width===e&&this.height===t||(this.width=e,this.height=t,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,e,t,0,n.RGBA,n.UNSIGNED_BYTE,null),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,e,t),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 e=this.gl;e&&(e.deleteFramebuffer(this.frameBuffer),e.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&e.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},K.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(e){var t,n,r;if(void 0===o&&((t=document.createElement("canvas"))&&t.getContext?window.WebGLRenderingContext?(n=G())||(o="context"):o="webgl":o="canvas"),o)return o;if(e){if((r=h[e])&&"function"==typeof r.compatible&&!r.compatible(n))return"plugin-"+e;if((r=f[e])&&"function"==typeof r.compatible&&!r.compatible(n))return"source-"+e}return!1},X.plugin=function(e,t,n){var r;if(h[e])X.logger.warn("Effect ["+e+"] already loaded");else if(void 0===n&&"object"==typeof t&&(n=t),n)return r=U({},n),"function"==typeof t&&(r.definition=t),r.reserved=I,r.inputs&&Y(r),r.title||(r.title=e),h[e]=r,v[e]=[],r},X.removePlugin=function(e){var t;if(!e)return this;if(!h[e])return this;if(t=v[e]){for(;t.length;)t.shift().destroy();delete v[e]}return delete h[e],this},X.source=function(e,t,n){var r;if(f[e])X.logger.warn("Source ["+e+"] already loaded");else if(void 0===n&&"object"==typeof t&&(n=t),n||t)return r=U({},n),"function"==typeof t&&(r.definition=t),r.title||(r.title=e),f[e]=r,m[e]=[],r},X.removeSource=function(e){var t;if(!e)return this;if(!f[e])return this;if(t=m[e]){for(;t.length;)t.shift().destroy();delete m[e]}return delete f[e],this},X.transform=function(e,t,n){var r;if(l[e])X.logger.warn("Transform ["+e+"] already loaded");else if(void 0===n&&"object"==typeof t&&(n=t),n||t)return r=U({},n),"function"==typeof t&&(r.definition=t),r.reserved=D,r.inputs&&Y(r),r.title||(r.title=e),l[e]=r,g[e]=[],r},X.removeTransform=function(e){var t;if(!e)return this;if(!l[e])return this;if(t=g[e]){for(;t.length;)t.shift().destroy();delete g[e]}return delete l[e],this},X.target=function(e,t,n){var r;if(d[e])X.logger.warn("Target ["+e+"] already loaded");else if(void 0===n&&"object"==typeof t&&(n=t),n||t)return r=U({},n),"function"==typeof t&&(r.definition=t),r.title||(r.title=e),d[e]=r,y[e]=[],r},X.removeTarget=function(e){var t;if(!e)return this;if(!d[e])return this;if(t=y[e]){for(;t.length;)t.shift().destroy();delete y[e]}return delete d[e],this},X.inputValidators={color:function(e,t,n,r){var o,s,a,c;if(s=r||[],"string"==typeof e){if((a=T.exec(e))&&a.length){if(a.length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(s[3]=1,c=0;c<3;c++)s[c]=parseFloat(a[c+2])/255;return isNaN(a[6])||(s[3]=parseFloat(a[6])),"hsl"===a[1].toLowerCase()?V(s[0],s[1],s[2],s[3],s):s}if((a=x.exec(e))&&a.length)return 3===(o=a[1]).length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=1):4===o.length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=parseInt(o[3],16)/15):6===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=1):8===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=parseInt(o.substr(6,2),16)/255):s[0]=s[1]=s[2]=s[3]=0,s;if(a=S[e.toLowerCase()]){for(c=0;c<4;c++)s[c]=a[c];return s}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=e,(o=i.fillStyle)&&"#000000"!==o?X.inputValidators.color(o,t,n,r):(s[0]=s[1]=s[2]=s[3]=0,s)}if(H(e)){if((s=e).length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(c=0;c<3;c++)if(isNaN(s[c]))return s[0]=s[1]=s[2]=s[3]=0,s;return s.length<4&&s.push(1),s}if("number"==typeof e)return s[0]=s[1]=s[2]=e,s[3]=1,s;if("object"==typeof e){for(c=0;c<4;c++)null===e[o=E[c]]||isNaN(e[o])?s[c]=3===c?1:0:s[c]=e[o];return s}return s[0]=s[1]=s[2]=s[3]=0,s},number:function(e,t,n){return e=parseFloat(e),isNaN(e)?n||0:(t.mod&&(e-=t.mod*Math.floor(e/t.mod)),e<t.min?t.min:e>t.max?t.max:t.step?Math.round(e/t.step)*t.step:e)},enum:function(e,t,n){var r=t.options||[];return"string"==typeof e?e=e.toLowerCase():"number"==typeof e?e=e.toString():e||(e=""),r.hasOwnProperty(e)?e:n||""},vector:function(e,t,n,r){var i,o,s,a=t.dimensions||4;if(i=r||[],H(e)){for(o=0;o<a;o++)i[o]=e[o]||0;return i}if("object"==typeof e){for(o=0;o<a;o++)void 0===e[s=C[o]]&&(s=E[o]),i[o]=e[s]||0;return i}for(e=parseFloat(e)||0,o=0;o<a;o++)i[o]=e;return i},boolean:function(e){return!!e&&(!e||!e.toLowerCase||"false"!==e.toLowerCase())},string:function(e){return"string"==typeof e?e:0===e||e?e.toString?e.toString():String(e):""}},X.prototype.effects=X.effects=function(){var e,t,n,r,i,o={};for(e in h)if(h.hasOwnProperty(e)){for(i in n={title:(t=h[e]).title||e,description:t.description||"",inputs:{}},t.inputs)t.inputs.hasOwnProperty(i)&&(r=t.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||[]});o[e]=n}return o},window.Float32Array&&(s=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 e;for(e in window.Seriously)window.Seriously.hasOwnProperty(e)&&"plugin"!==e&&"object"==typeof window.Seriously[e]&&X.plugin(e,window.Seriously[e])}(),X.logger={log:F("log"),info:F("info"),warn:F("warn"),error:F("error")},X.util={mat4:A,checkSource:function(e){var t,n,r,i;if(!(t=L(e,["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===t.naturalWidth&&"IMG"===t.tagName)return X.logger.warn("Image not loaded"),!1;if(0===t.readyState&&0===t.videoWidth&&"VIDEO"===t.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,t)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+e.message),r.deleteTexture(i),!1}r.deleteTexture(i)}else{r=n.getContext("2d");try{r.drawImage(t,0,0),r.getImageData(0,0,1,1)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+e.message),!1}}return!0},hslToRgb:V,colors:S,setTimeoutZero:q,ShaderProgram:K,FrameBuffer:$,requestAnimationFrame:P,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(e,t,n){var r,i,o=this,s=!1,c=!1,u=!1,h=0;function l(){e.removeEventListener("loadedmetadata",l,!0),s||(e.videoWidth?(o.width===e.videoWidth&&o.height===e.videoHeight||(o.width=e.videoWidth,o.height=e.videoHeight,o.resize()),c&&o.setReady()):(c=!0,setTimeout(l,50)))}function f(){u=!0}function d(){u=!1,o.setDirty()}if(B(e,"HTMLVideoElement"))return e.readyState?l():(c=!0,e.addEventListener("loadedmetadata",l,!0)),e.addEventListener("seeking",f,!1),e.addEventListener("seeked",d,!1),{deferTexture:c,source:e,render:function t(n){var s;if(h=e.currentTime,!e.videoHeight||!e.videoWidth)return!1;a?(i||(i=document.createElement("canvas").getContext("2d"),(r=i.canvas).width=o.width,r.height=o.height),s=r,i.drawImage(e,0,0,o.width,o.height)):s=e,n.bindTexture(n.TEXTURE_2D,o.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,o.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,s),void 0===a){if(n.getError()===n.INVALID_VALUE)return a=!0,t(n);a=!1}return!0}catch(e){e.code===window.DOMException.SECURITY_ERR?(o.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",e)}return!1},checkDirty:function(){return!u&&e.currentTime!==h},compare:function(e){return o.source===e},destroy:function(){s=!0,e.removeEventListener("seeking",f,!1),e.removeEventListener("seeked",d,!1),e.removeEventListener("loadedmetadata",l,!0)}}}),{title:"Video"}),X.transform("2d",(function(e){var t=this,n=!(e&&e.radians),r=0,i=0,o=1,s=1,a=0,c=0,u=0,h=0,l=0;function f(){var e,f,d,p,v,g,m,y,b,_,w,S=t.matrix;function T(e,t){S[12]=S[0]*e+S[4]*t+S[12],S[13]=S[1]*e+S[5]*t+S[13],S[14]=S[2]*e+S[6]*t+S[14],S[15]=S[3]*e+S[7]*t+S[15]}a||c||u||h||l||1!==o||1!==s?(A.identity(S),T(a+r,c+i),h&&(S[4]=h/t.width),l&&(S[1]=l/t.height),u&&(p=S[0],v=S[1],g=S[2],m=S[3],y=S[4],b=S[5],_=S[6],w=S[7],e=-(n?u*Math.PI/180:u),f=Math.sin(e),d=Math.cos(e),S[0]=p*d+y*f,S[1]=v*d+b*f,S[2]=g*d+_*f,S[3]=m*d+w*f,S[4]=y*d-p*f,S[5]=b*d-v*f,S[6]=_*d-g*f,S[7]=w*d-m*f),1!==o&&(S[0]*=o,S[1]*=o,S[2]*=o,S[3]*=o),1!==s&&(S[4]*=s,S[5]*=s,S[6]*=s,S[7]*=s),T(-r,-i),t.transformed=!0):t.transformed=!1}return{inputs:{reset:{method:function(){return r=0,i=0,o=1,s=1,a=0,c=0,u=0,h=0,l=0,!!t.transformed&&(t.transformed=!1,!0)}},translate:{method:function(e,t){return isNaN(e)&&(e=a),isNaN(t)&&(t=c),(e!==a||t!==c)&&(a=e,c=t,f(),!0)},type:["number","number"]},translateX:{get:function(){return a},set:function(e){return e!==a&&(a=e,f(),!0)},type:"number"},translateY:{get:function(){return c},set:function(e){return e!==c&&(c=e,f(),!0)},type:"number"},rotation:{get:function(){return u},set:function(e){return e!==u&&(u=parseFloat(e),f(),!0)},type:"number"},center:{method:function(e,t){return isNaN(e)&&(e=r),isNaN(t)&&(t=i),(e!==r||t!==i)&&(r=e,i=t,f(),!0)},type:["number","number"]},centerX:{get:function(){return r},set:function(e){return e!==r&&(r=e,f(),!0)},type:"number"},centerY:{get:function(){return i},set:function(e){return e!==i&&(i=e,f(),!0)},type:"number"},skew:{method:function(e,t){return isNaN(e)&&(e=h),isNaN(t)&&(t=l),(e!==h||t!==l)&&(h=e,l=t,f(),!0)},type:["number","number"]},skewX:{get:function(){return h},set:function(e){return e!==h&&(h=e,f(),!0)},type:"number"},skewY:{get:function(){return l},set:function(e){return e!==l&&(l=e,f(),!0)},type:"number"},scale:{method:function(e,t){var n,r;if(n=isNaN(e)?o:e,isNaN(t)){if(isNaN(e))return!1;r=n}else r=t;return(n!==o||r!==s)&&(o=n,s=r,f(),!0)},type:["number","number"]},scaleX:{get:function(){return o},set:function(e){return e!==o&&(o=e,f(),!0)},type:"number"},scaleY:{get:function(){return s},set:function(e){return e!==s&&(s=e,f(),!0)},type:"number"}}}}),{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",(function(){var e=this,t=!0;function n(){var n=e.matrix;t?(n[0]=-1,n[5]=1):(n[0]=1,n[5]=-1)}return A.identity(e.matrix),n(),e.transformDirty=!0,e.transformed=!0,{inputs:{direction:{get:function(){return t?"horizontal":"vertical"},set:function(e){var r;return(r="vertical"!==e)!==t&&(t=r,n(),!0)},type:"string"}}}}),{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",(function(){var e,t,n=this,r="contain";function i(){var i,o,s,a,c=n.matrix,u=e||n.width,h=t||n.height,l=n.source,f=l&&l.width||1,d=l&&l.height||1;"distort"===r||u===f&&h===d?n.transformed=!1:(s=f/d,a=u/h,"none"===r?(i=f/u,o=d/h):"width"===r||"contain"===r&&a<=s?(i=1,o=a/s):"height"===r||"contain"===r&&a>s?(i=s/a,o=1):a>s?(i=1,o=a/s):(i=s/a,o=1),1!==i||1!==o?(A.identity(c),1!==i&&(c[0]*=i,c[1]*=i,c[2]*=i,c[3]*=i),1!==o&&(c[4]*=o,c[5]*=o,c[6]*=o,c[7]*=o),n.transformed=!0):n.transformed=!1)}function o(){return e||n.source&&n.source.width||1}function s(){return t||n.source&&n.source.height||1}return this.resize=function(){var e,t=o(),n=s();if(this.width!==t||this.height!==n)for(this.width=t,this.height=n,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=n),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,n),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty(),i()},{inputs:{width:{get:o,set:function(t){return(t=Math.floor(t))===e||(e=t,this.resize()),!1},type:"number"},height:{get:s,set:function(e){return(e=Math.floor(e))===t||(t=e,this.resize()),!1},type:"number"},mode:{get:function(){return r},set:function(e){return e!==r&&(r=e,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}}),{title:"Reformat",description:"Change output dimensions"}),c=["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"),u=["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",t.default=X},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Uneeq=void 0;const o=n(47);n(105);const s=n(81),a=i(n(108)),c=n(109),u=n(110),h=n(133),l=n(134),f=n(31),d=n(135),p=n(142),v=n(148),g=n(150),m=n(80),y=n(151),b=n(152),_=n(99),w=n(153),S=n(63),T=n(155),x=n(85),C=n(156),E=n(100);t.Uneeq=class{constructor(e){this.ready=new o.BehaviorSubject(!1),this.version=a.default.version,this.messages=new o.Subject,this.internalMessages$=new o.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,this.sessionWasResumed=!1,this.uneeqLocalStorage=new _.UneeqLocalStorage,f.logger.enabled=e.logging||!1,this.options=e,this.options.diagnostics=e.diagnostics||!1,this.options.micActivityMessages=e.micActivityMessages||!1,this.options.sendLocalVideo=void 0===e.sendLocalVideo||e.sendLocalVideo,this.options.sendLocalAudio=void 0===e.sendLocalAudio||e.sendLocalAudio,this.options.enableClientPerformanceMessage=e.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=e.enableTransparentBackground||!1,this.options.backgroundImageUrl=e.backgroundImageUrl||"",this.options.nameTagImageUrl=e.nameTagImageUrl||"",this.options.speechToTextLocales=l.LocaleDetector.validateOrDetectSpeechLocales(e),this.checkIfResumeSessionIsAvailable(),this.options.voiceInputMode=e.voiceInputMode||E.VoiceInputMode.PUSH_TO_TALK,this.api=new c.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:T.SessionType.WEB,sdkVersion:this.version,clientWidth:window.screen.availWidth,clientHeight:window.screen.availHeight},this.options.customData&&(this.startSessionData.customData=this.options.customData),f.logger.log(`Uneeq Created (version ${this.version})`),this.streamManager=new b.StreamManager,this.initDigitalHumanVideoElement(),this.metricsService=new v.MetricsService(this.options,this.internalMessages$,this.messages),this.dhVideoPlayManager=new h.DigitalHumanVideoPlayManager(this.messages,()=>{this.unmuteDigitalHuman()})}get sessionId(){return this.session?this.session.id:null}setLoggerEnabled(e){f.logger.enabled=e}init(){this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then(e=>{this.session=e,this.initialize()}).catch(e=>{this.sendServiceUnavailableMessage(e)})}initWithToken(e){return r(this,void 0,void 0,(function*(){this.startSessionTime=Date.now();try{const t=y.ResumeSessionCheck.validate(this.options);!0===t.resumeSession&&(this.startSessionData.resumeSessionId=t.resumeSessionId),this.startSessionData.tokenId=e,this.session=yield this.api.startSessionWithToken(this.startSessionData),console.log("UneeQ Session ID: "+this.session.id),this.session.id===this.startSessionData.resumeSessionId?(f.logger.log("UneeQ: Session was resumed."),this.sessionWasResumed=!0):f.logger.log("UneeQ: Session was not resumed."),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionId",this.session.id),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionPersonaId",this.options.conversationId),this.session.sourceApp=C.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:C.SourceApp.UNKNOWN,this.initialize()}catch(e){this.sendServiceUnavailableMessage(e)}}))}setCamera(e){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(e)}setMic(e){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(e)}setSpeaker(e){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(e)}setVoiceInputMode(e){this.serviceReadyCheck("setVoiceInputMode")&&this.voiceInputManager.setVoiceInputMode(e)}enableMicrophone(e=!0){this.deviceManager&&this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,e)}enableCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,this.options.sendLocalAudio)}enableMicrophoneAndCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,e)}sendTranscript(e){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(e))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new S.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 S.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.voiceInputManager.stopRecording())}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new S.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new S.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new S.SessionResumedMessage),!0):(this.messages.next(new S.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(e){return this.api.setAvatarDebug(e)}playWelcomeMessage(){return this.api.avatarWelcome()}unmuteDigitalHuman(){this.voiceInputManager.resumeAudioContext(),this.dhVideoPlayManager.unmuteVideo()}initDigitalHumanVideoElement(){const e=document.createElement("video");this.digitalHumanVideoElement=e,e.volume=1,e.controls=!1,e.autoplay=!1,e.setAttribute("playsinline","true"),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.play().catch(e=>{f.logger.log("UneeQ: Failed to play digital human video. Play() will be re-attempted when stream is ready.",e)})}gatherWebRtcMetrics(){var e;null===(e=this.deviceManager)||void 0===e||e.mediaHandler.gatherWebRTCStats((e,t)=>{this.metricsService.parseAndLogWebRtcStats(t)}),setTimeout(()=>{this.gatherWebRtcMetrics()},5e3)}initMessaging(){this.messages.subscribe(e=>this.messageCallback(e)),this.messaging.state$.filter(e=>e===p.MessagingState.CONNECTED).subscribe(()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new S.ReadyMessage),this.gatherWebRtcMetrics()}),this.messaging.messages$.subscribe(e=>this.internalMessages$.next(JSON.parse(e.body))),this.messageHandler=new d.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe(e=>{f.logger.log("-- Msg -- ",e)})}initDeviceManager(){this.voiceInputManager=new w.VoiceInputManager(this.options,this.api,this.messages,e=>{this.enableMicrophone(e)}),this.deviceManager=new u.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,digitalHumanVideoElement:this.digitalHumanVideoElement},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new S.SessionLiveMessage(this.session.showUneeqLogo||!1,this.sessionWasResumed)),this.options.playWelcome&&this.api.avatarWelcome();const e={type:m.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.sessionStarted=!0}}initAvatar(){this.ready.filter(Boolean).pipe(s.take(1)).subscribe(()=>{this.internalMessages$.filter(e=>"DevicePermissionAllowedInternal"===e.faceMeMessageType).pipe(s.take(1)).subscribe(e=>{this.messages.next(new S.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()}),this.initDeviceManager()}),this.internalMessages$.filter(e=>"sessionLive"===e.faceMeMessageType).pipe(s.take(1)).subscribe(e=>this.sessionLiveHandler()),this.internalMessages$.filter(e=>"sessionEnd"===e.faceMeMessageType).subscribe(()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new S.SessionEndedMessage),this.messaging.disconnect()}),this.internalMessages$.filter(e=>"remoteVideoReadyToPlay"===e.faceMeMessageType).subscribe(e=>{this.dhVideoPlayManager.play(this.deviceManager.mediaHandler.avatarVideoElement)})}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then(e=>{if(e.available>0){const e={type:m.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new S.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground,resumeSession:this.sessionWasResumed,backgroundImageUrl:this.options.backgroundImageUrl,nameTagImageUrl:this.options.nameTagImageUrl,speechToTextLocales:this.options.speechToTextLocales}).catch(e=>{console.error("UneeQ: Digital human could not be started. Clearing resumeSession token and ending process.",e),this.uneeqLocalStorage.removeItemSafely("uneeqResumeSessionId")})}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new S.AvatarUnavailableMessage)),setTimeout(()=>{this.startAvatarWhenAvailable()},1e3)})}initialize(){if(this.session){this.initPromMetricsListener(),this.api.callId=this.session.id,this.initAvatar();const e={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new S.ConnectionLostMessage(x.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new p.MessagingService(this.options.url+"/api/messaging",e),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(e){const t=new S.ServiceUnavailableMessage(e);this.messages.next(t),this.messageCallback(t)}serviceReadyCheck(e){return!!this.ready.value||(this.messages.next(new S.WarningMessage("Call to "+e+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new g.OnlineStatusService(this.messages,()=>{this.messages.next(new S.ConnectionLostMessage(x.PublishSubscribeState.DISCONNECTED)),this.endSession()})}initPromMetricsListener(){const e=new m.Prom(this.options.url);this.internalMessages$.filter(e=>"prom"===e.faceMeMessageType).subscribe(t=>{e.handleMessage(t.promMsg)})}checkIfResumeSessionIsAvailable(){!0!==this.options.resumeSession||this.uneeqLocalStorage.available||(console.warn("UneeQ: Resuming session is unavailable in this browser because localStorage is not allowed."),this.messages.next(new S.ResumeSessionUnavailable),this.options.resumeSession=!1)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PublishSubscribeState=void 0,function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.FAILED="FAILED"}(t.PublishSubscribeState||(t.PublishSubscribeState={}))},function(e,t,n){
|
|
32
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
33
|
-
var r=n(44),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";(function(t,r){var i;e.exports=C,C.ReadableState=x;n(88).EventEmitter;var o=function(e,t){return e.listeners(t).length},s=n(89),a=n(44).Buffer,c=t.Uint8Array||function(){};var u,h=n(123);u=h&&h.debuglog?h.debuglog("stream"):function(){};var l,f,d,p=n(124),v=n(90),g=n(91).getHighWaterMark,m=n(45).codes,y=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,w=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(59)(C,s);var S=v.errorOrDestroy,T=["error","close","destroy","pause","resume"];function x(e,t,r){i=i||n(46),e=e||{},"boolean"!=typeof r&&(r=t instanceof i),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",r),this.buffer=new p,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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=n(93).StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function C(e){if(i=i||n(46),!(this instanceof C))return new C(e);var t=this instanceof i;this._readableState=new x(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function E(e,t,n,r,i){u("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,A(e)))}(e,s);else if(i||(o=function(e,t){var n;r=t,a.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],t));var r;return n}(s,t)),o)S(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),r)s.endEmitted?S(e,new w):R(e,s,t,!0);else if(s.ended)S(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?R(e,s,t,!1):P(e,s)):R(e,s,t,!1)}else r||(s.reading=!1,P(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function R(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&O(e)),P(e,t)}Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),C.prototype.destroy=v.destroy,C.prototype._undestroy=v.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=a.from(e,t),t=""),n=!0),E(this,e,t,!1,n)},C.prototype.unshift=function(e){return E(this,e,null,!0,!1)},C.prototype.isPaused=function(){return!1===this._readableState.flowing},C.prototype.setEncoding=function(e){l||(l=n(93).StringDecoder);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function M(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(A,e))}function A(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function P(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(u("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){u("readable nexttick read 0"),e.read(0)}function N(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function U(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(F,t,e))}function F(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function B(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}C.prototype.read=function(e){u("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):O(this),null;if(0===(e=M(e,t))&&t.ended)return 0===t.length&&U(this),null;var r,i=t.needReadable;return u("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&u("length less than watermark",i=!0),t.ended||t.reading?u("reading or ended",i=!1):i&&(u("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=M(n,t))),null===(r=e>0?L(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&U(this)),null!==r&&this.emit("data",r),r},C.prototype._read=function(e){S(this,new _("_read()"))},C.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,u("pipe count=%d opts=%j",i.pipesCount,t);var s=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function a(t,r){u("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",v),e.removeListener("drain",h),e.removeListener("error",d),e.removeListener("unpipe",a),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",f),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function c(){u("onend"),e.end()}i.endEmitted?r.nextTick(s):n.once("end",s),e.on("unpipe",a);var h=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,j(e))}}(n);e.on("drain",h);var l=!1;function f(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==B(i.pipes,e))&&!l&&(u("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function d(t){u("onerror",t),g(),e.removeListener("error",d),0===o(e,"error")&&S(e,t)}function p(){e.removeListener("finish",v),g()}function v(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",p),e.once("finish",v),e.emit("pipe",n),i.flowing||(u("pipe resume"),n.resume()),e},C.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=B(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},C.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,u("on readable",i.length,i.reading),i.length?O(this):i.reading||r.nextTick(D,this))),n},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(I,this),n},C.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(I,this),t},C.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(N,e,t))}(this,e)),e.paused=!1,this},C.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(u("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(u("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<T.length;o++)e.on(T[o],this.emit.bind(this,T[o]));return this._read=function(t){u("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(C.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=n(127)),f(this)}),Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(C.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(C.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),C._fromList=L,Object.defineProperty(C.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(C.from=function(e,t){return void 0===d&&(d=n(128)),d(C,e,t)})}).call(this,n(35),n(38))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function h(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,o,s,a;if(u(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=h(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function f(){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 d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):g(i,i.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function m(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.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},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return h(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var u=c.length,h=g(c,u);for(n=0;n<u;++n)o(h[n],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return u(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,o,s;if(u(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,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[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},a.prototype.listenerCount=v,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){e.exports=n(88).EventEmitter},function(e,t,n){"use strict";(function(t){function n(e,t){i(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var s=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?s._writableState?s._writableState.errorEmitted?t.nextTick(r,s):(s._writableState.errorEmitted=!0,t.nextTick(n,s,e)):t.nextTick(n,s,e):o?(t.nextTick(r,s),o(e)):t.nextTick(r,s)})),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(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this,n(38))},function(e,t,n){"use strict";var r=n(45).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},function(e,t,n){"use strict";(function(t,r){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=C,C.WritableState=x;var s={deprecate:n(126)},a=n(89),c=n(44).Buffer,u=t.Uint8Array||function(){};var h,l=n(90),f=n(91).getHighWaterMark,d=n(45).codes,p=d.ERR_INVALID_ARG_TYPE,v=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,_=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,S=l.errorOrDestroy;function T(){}function x(e,t,s){o=o||n(46),e=e||{},"boolean"!=typeof s&&(s=t instanceof o),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,o=n.writecb;if("function"!=typeof o)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,o){--t.pendingcb,n?(r.nextTick(o,i),r.nextTick(P,e,t),e._writableState.errorEmitted=!0,S(e,i)):(o(i),e._writableState.errorEmitted=!0,S(e,i),P(e,t))}(e,n,i,t,o);else{var s=O(n)||e.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||M(e,n),i?r.nextTick(R,e,n,s,o):R(e,n,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function C(e){var t=this instanceof(o=o||n(46));if(!t&&!h.call(C,this))return new C(e);this._writableState=new x(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function E(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function R(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),P(e,t)}function M(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),s=t.corkedRequestsFree;s.entry=n;for(var a=0,c=!0;n;)o[a]=n,n.isBuf||(c=!1),n=n.next,a+=1;o.allBuffers=c,E(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,h=n.encoding,l=n.callback;if(E(e,t,!1,t.objectMode?1:u.length,u,h,l),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function O(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(n){t.pendingcb--,n&&S(e,n),t.prefinished=!0,e.emit("prefinish"),P(e,t)}))}function P(e,t){var n=O(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(A,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return n}n(59)(C,a),x.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(x.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===C&&(e&&e._writableState instanceof x)}})):h=function(e){return e instanceof this},C.prototype.pipe=function(){S(this,new m)},C.prototype.write=function(e,t,n){var i,o=this._writableState,s=!1,a=!o.objectMode&&(i=e,c.isBuffer(i)||i instanceof u);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=T),o.ending?function(e,t){var n=new _;S(e,n),r.nextTick(t,n)}(this,n):(a||function(e,t,n,i){var o;return null===n?o=new b:"string"==typeof n||t.objectMode||(o=new p("chunk",["string","Buffer"],n)),!o||(S(e,o),r.nextTick(i,o),!1)}(this,o,e,n))&&(o.pendingcb++,s=function(e,t,n,r,i,o){if(!n){var s=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n));return t}(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=t.objectMode?1:r.length;t.length+=a;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var h=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},h?h.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,a,r,i,o);return u}(this,o,a,e,t,n)),s},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||M(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(e,t,n){n(new v("_write()"))},C.prototype._writev=null,C.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,P(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),this},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._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),C.prototype.destroy=l.destroy,C.prototype._undestroy=l.undestroy,C.prototype._destroy=function(e,t){t(e)}}).call(this,n(35),n(38))},function(e,t,n){"use strict";var r=n(86).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.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 o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=h,this.end=l,t=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function h(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=s(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=s(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=s(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=h;var r=n(45).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,s=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(46);function u(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function h(e){if(!(this instanceof h))return new h(e);c.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,n){f(e,t,n)}))}function f(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}n(59)(h,c),h.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},h.prototype._transform=function(e,t,n){n(new i("_transform()"))},h.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},h.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},h.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,(function(e){t(e)}))}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Counter=void 0;var u=function(e){function t(){return i(this,t),s(this,a(t).apply(this,arguments))}var n,r,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,e),n=t,(r=[{key:"inc",value:function(e){return this.add(1,e),this}},{key:"add",value:function(e,t){if(e<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(e));var n=this.get(t);return this.set(n?n.value+e:e,t),this}},{key:"reset",value:function(e){this.set(0,e)}}])&&o(n.prototype,r),u&&o(n,u),t}(n(96).Collector);t.Counter=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collector=void 0;var r=n(64),i=n(97);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(n="data")in(t=this)?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.data=[]}var t,n,s;return t=e,(n=[{key:"get",value:function(e){return(0,i.findExistingMetric)(e,this.data)}},{key:"set",value:function(e,t){var n=(0,i.findExistingMetric)(t,this.data);return n?n.value=e:this.data.push({labels:t,value:e}),this}},{key:"collect",value:function(e){return(0,r.filter)(this.data,(function(t){return(0,r.matches)(e)(t.labels)}))}},{key:"resetAll",value:function(){var e=this;return(0,r.each)(this.data,(function(t){e.reset(t.labels)})),this}}])&&o(t.prototype,n),s&&o(t,s),e}();t.Collector=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatHistogramOrSummary=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",o="",s=i(t);s.length>0?(o+="".concat(e,"_count{").concat(s,"} ").concat(t.value.count,"\n"),o+="".concat(e,"_sum{").concat(s,"} ").concat(t.value.sum,"\n")):(o+="".concat(e,"_count ").concat(t.value.count,"\n"),o+="".concat(e,"_sum ").concat(t.value.sum,"\n"));return(0,r.reduce)(t.value.entries,(function(t,r,i){return s.length>0?o+="".concat(e,"_bucket{").concat(n,'="').concat(i,'",').concat(s,"} ").concat(r,"\n"):o+="".concat(e,"_bucket{").concat(n,'="').concat(i,'"} ').concat(r,"\n"),o}),o)},t.findExistingMetric=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return t[0];return(0,r.find)(t,(function(t){return(0,r.isEqual)(t.labels,e)}))},t.formatCounterOrGauge=function(e,t){var n=" ".concat(t.value.toString());if(null==t.labels||0===Object.keys(t.labels).length)return"".concat(e).concat(n,"\n");var i=(0,r.map)(t.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return"".concat(e,"{").concat(i.join(","),"}").concat(n,"\n")};var r=n(64);function i(e){var t=(0,r.map)(e.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return 0===t.length?"":"".concat(t.join(","))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=void 0,function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(t.MessagingState||(t.MessagingState={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqLocalStorage=void 0;const r=n(31);t.UneeqLocalStorage=class{constructor(){}get available(){return void 0===this.localStorageAvailable&&(this.localStorageAvailable=this.checkIfLocalStorageAvailable()),this.localStorageAvailable}setItemSafely(e,t){this.available?localStorage.setItem(e,t):r.logger.log("UneeQ: unable to access localStorage because it is not available.")}getItemSafely(e){return this.available?localStorage.getItem(e):void r.logger.log("UneeQ: unable to access localStorage because it is not available.")}removeItemSafely(e){this.available?localStorage.removeItem(e):r.logger.log("UneeQ: unable to access localStorage because it is not available.")}checkIfLocalStorageAvailable(){try{return localStorage.setItem("UneeqLocalStoreCheck","UneeqLocalStoreCheck"),localStorage.removeItem("UneeqLocalStoreCheck"),!0}catch(e){return!1}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputMode=void 0,function(e){e.PUSH_TO_TALK="PUSH_TO_TALK",e.VOICE_ACTIVITY="VOICE_ACTIVITY"}(t.VoiceInputMode||(t.VoiceInputMode={}))},function(e,t,n){(function(e,t){!function(e){function n(){}function r(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,-1===o.indexOf(e.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}function i(e){for(var t=0,n=Math.min(65536,e.length+1),r=new Uint16Array(n),i=[],o=0;;){var s=t<e.length;if(!s||o>=n-1){if(i.push(String.fromCharCode.apply(null,r.subarray(0,o))),!s)return i.join("");e=e.subarray(t),o=t=0}if(0==(128&(s=e[t++])))r[o++]=s;else if(192==(224&s)){var a=63&e[t++];r[o++]=(31&s)<<6|a}else if(224==(240&s)){a=63&e[t++];var c=63&e[t++];r[o++]=(31&s)<<12|a<<6|c}else if(240==(248&s)){65535<(s=(7&s)<<18|(a=63&e[t++])<<12|(c=63&e[t++])<<6|63&e[t++])&&(s-=65536,r[o++]=s>>>10&1023|55296,s=56320|1023&s),r[o++]=s}}}if(e.TextEncoder&&e.TextDecoder)return!1;var o=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),n.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var n=e.length,r=0,i=Math.max(32,n+(n>>>1)+7),o=new Uint8Array(i>>>3<<3);t<n;){var s=e.charCodeAt(t++);if(55296<=s&&56319>=s){if(t<n){var a=e.charCodeAt(t);56320==(64512&a)&&(++t,s=((1023&s)<<10)+(1023&a)+65536)}if(55296<=s&&56319>=s)continue}if(r+4>o.length&&(i+=8,i=(i*=1+t/e.length*2)>>>3<<3,(a=new Uint8Array(i)).set(o),o=a),0==(4294967168&s))o[r++]=s;else{if(0==(4294965248&s))o[r++]=s>>>6&31|192;else if(0==(4294901760&s))o[r++]=s>>>12&15|224,o[r++]=s>>>6&63|128;else{if(0!=(4292870144&s))continue;o[r++]=s>>>18&7|240,o[r++]=s>>>12&63|128,o[r++]=s>>>6&63|128}o[r++]=63&s|128}}return o.slice?o.slice(0,r):o.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 s=i;"function"==typeof t&&t.from?s=function(e){return t.from(e.buffer,e.byteOffset,e.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(s=function(e){try{var t=URL.createObjectURL(new Blob([e],{type:"text/plain;charset=UTF-8"})),n=new XMLHttpRequest;return n.open("GET",t,!1),n.send(),n.responseText}catch(t){return i(e)}finally{t&&URL.revokeObjectURL(t)}}),r.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");return e=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),s(e)},e.TextEncoder=n,e.TextDecoder=r}("undefined"!=typeof window?window:void 0!==e?e:this)}).call(this,n(35),n(44).Buffer)},function(e,t,n){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=u(e),s=r[0],a=r[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,s,a)),h=0,l=a>0?s-4:s;for(n=0;n<l;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;2===a&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,c[h++]=255&t);1===a&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(h(e,s,s+16383>a?a:s+16383));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function h(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){
|
|
34
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
35
|
-
t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,h=-7,l=n?i-1:0,f=n?-1:1,d=e[t+l];for(l+=f,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+e[t+l],l+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+e[t+l],l+=f,h-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=u}return(d?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,c,u=8*o-i-1,h=(1<<u)-1,l=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(t*c-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[n+d]=255&s,d+=p,s/=256,u-=8);e[n+d-p]|=128*v}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(106)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(47),i=n(107);r.Observable.prototype.filter=i.filter},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(81);t.filter=function(e,t){return r.filter(e,t)(this)}},function(e){e.exports=JSON.parse('{"name":"uneeq-js","version":"2.46.4","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"npx karma start karma.conf.js -logLevel=DEBUG","test":"npx 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":"npx tslint -p tsconfig.json --fix","docs":"npx 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(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.API=void 0;t.API=class{constructor(e,t="",n=(()=>{})){this.xAuthToken="",this.apiUrl=e,this.apiKey=t,this.loggedOutHandler=n}set callId(e){this._callId=e}get authToken(){return this.xAuthToken}startSession(e){return this.postRequest("/api/v1/customers/",e,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",e)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:e})}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(e){return this.postRequest("/api/v2/clients/start-session",e,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(e){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:e})}sendMediaUnavailable(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",e)}getEdgeNodeId(e){let t=e.replace("turn:","http://");t=t.replace("turns:","https://");const n=new Request(t,{method:"GET"});return this.makeRequest(n)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(e){return r(this,void 0,void 0,(function*(){const t=yield fetch(e);if(!t.ok){401===t.status&&this.loggedOutHandler();const e=yield t.json();throw{status:t.status,body:e}}return 204===t.status?new Promise((e,t)=>{e()}):(this.xAuthToken=t.headers.get("x-auth-token")||this.xAuthToken,yield t.json())}))}getRequest(e){const t=new Request(this.apiUrl+e,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(t)}postRequest(e,t={},n={},r={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},r),body:JSON.stringify(t)},o=new Request(this.apiUrl+e,Object.assign(i,n));return this.makeRequest(o)}putRequest(e,t={},n={}){const r={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(t)},i=new Request(this.apiUrl+e,Object.assign(r,n));return this.makeRequest(i)}}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceManager=void 0;const i=n(37),o=n(111);t.DeviceManager=class{constructor(e,t){this.options=e,this.api=t,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new o.MediaHandler(this.options,()=>this.remoteVideoReady()),this.initMediaConstraints(),this.getDevices(!1)}set edgeNodeId(e){this.mediaHandler.setEdgeNodeId(e),this.getDevices(!0)}enableLocalDevices(e,t){const n=this.options.uneeqOptions.sendLocalVideo!==e,r=this.options.uneeqOptions.sendLocalAudio!==t;(n||r)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=e,this.options.uneeqOptions.sendLocalAudio=t,n&&!1===e&&this.publishStream.getVideoTracks().forEach(e=>e.stop()),r&&!1===t&&this.publishStream.getAudioTracks().forEach(e=>e.stop()),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(e=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const t=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then(t=>r(this,void 0,void 0,(function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),e){if(this.options.uneeqOptions.sendLocalVideo){const e=t.getVideoTracks();e.length>0&&(this.publishStream.getVideoTracks().forEach(e=>this.publishStream.removeTrack(e)),this.publishStream.addTrack(e[0]))}if(this.options.uneeqOptions.sendLocalAudio){const e=t.getAudioTracks();e.length>0&&(this.publishStream.getAudioTracks().forEach(e=>this.publishStream.removeTrack(e)),this.publishStream.addTrack(e[0]))}this.mediaHandler.localStream$.next(this.publishStream)}}))).catch(e=>{t.options.userMessages.next(new i.DeviceErrorMessage(e)),console.error("device error: ",e),this.sendMediaUnavailableInfo("NotAllowedError"===e.name),this.revertMediaOptions()})}setMicDevice(e,t=!0){const n=this.devices.audioInput.filter(t=>t.deviceId===e);if(n&&n.length>0)this.options.uneeqOptions.preferredMicrophoneId=e,this.audioConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(e));else{const t="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setCamDevice(e,t=!0){const n=this.devices.videoInput.filter(t=>t.deviceId===e);if(n&&n.length>0)this.options.uneeqOptions.preferredCameraId=e,this.videoConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(e));else{const t="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setAvatarSpeakerDevice(e){if(this.mediaHandler.avatarVideoElement){const t=this.devices.audioOutput.filter(t=>t.deviceId===e);if(t&&t.length>0)this.options.uneeqOptions.preferredSpeakerId=e,this.mediaHandler.avatarVideoElement.setSinkId(e).then(()=>{this.speakerConstraints.deviceId=e,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(e))}).catch(t=>{const n="Uneeq setSpeaker: Error setting device. "+t.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(n,e))});else{const t="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}}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(e=>this.publishStream.removeTrack(e)),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(e){return r(this,void 0,void 0,(function*(){const t=yield this.getMediaDevices(),n={audioInputs:t.audioInput.length,videoInputs:t.videoInput.length,hasUserDeniedPermission:e};return this.api.sendMediaUnavailable(n)}))}getMediaDevices(){return r(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t={audioInput:[],audioOutput:[],videoInput:[]};return t.audioInput=e.filter(e=>"audioinput"===e.kind),t.audioOutput=e.filter(e=>"audiooutput"===e.kind),t.videoInput=e.filter(e=>"videoinput"===e.kind),t}))}initDeviceList(){return r(this,void 0,void 0,(function*(){navigator.mediaDevices.ondevicechange=e=>{this.initDeviceList()};const e=yield this.getMediaDevices();JSON.stringify(e)!==JSON.stringify(this.devices)&&(this.devices=e,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(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaHandler=void 0;const r=n(47),i=n(37),o=n(112),s=n(85),a=n(114),c=n(31),u=n(115);t.MediaHandler=class{constructor(e,t){this.options=e,this.remoteVideoReady=t,this.remoteStream$=new r.BehaviorSubject(null),this.localStream$=new r.BehaviorSubject(null),this.publishState$=new r.BehaviorSubject(s.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.remoteStream$.filter(e=>null!==e).subscribe(n=>{this.avatarVideoElement=this.options.digitalHumanVideoElement,this.avatarVideoElement.srcObject=n,e.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",e.uneeqOptions.avatarVideoContainerElement.innerHTML="",e.uneeqOptions.avatarVideoContainerElement.appendChild(this.avatarVideoElement),this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(this.avatarVideoElement),t()}),this.localStream$.filter(e=>null!==e).subscribe(t=>{const n=document.createElement("video");this.localVideoElement=n,n.srcObject=t,n.autoplay=!0,n.muted=!0,n.setAttribute("playsinline","true"),n.setAttribute("style","width: 100%; height: 100%;"),e.uneeqOptions.localVideoContainerElement.innerHTML="",e.uneeqOptions.localVideoContainerElement.appendChild(n),this.options.voiceInputManager.initMicActivity(t),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()}),this.options.internalMessages$.filter(e=>"AnswerMessage"===e.faceMeMessageType).subscribe(e=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(e)}),this.options.internalMessages$.filter(e=>"IceCandidateMessage"===e.faceMeMessageType).subscribe(e=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(e)})}setEdgeNodeId(e){this.options.session.edgeNodeId=e,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){c.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(s.PublishSubscribeState.DISCONNECTED)}pause(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),t&&t.getTracks().forEach(e=>e.enabled=!1),e&&e.getTracks().forEach(e=>e.enabled=!1)}resume(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();t&&t.getTracks().forEach(e=>e.enabled=!0),e&&e.getTracks().forEach(e=>e.enabled=!0),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const e=this.localStream$.getValue();e&&e.getTracks().forEach(e=>e.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 e=this.remoteStream$.getValue();e&&e.getTracks().forEach(e=>e.stop()),this.options.voiceInputManager.handleSessionEnd()}sendDataMessage(e){this.webRTC&&this.webRTC.sendDataMessage(e)}gatherWebRTCStats(e){var t;null===(t=this.webRTC)||void 0===t||t.getStats(e)}publishVideo(){const e=this.options.session.streamId,t=this.options.session.avatarStreamId,n=this.options.session.turnServerAddresses,r=this.options.session.turnUsername,o=this.options.session.turnPassword,a=this.options.session.forceTurnServerUse,h=this.publishState$,l=this.remoteStream$,f=this.localStream$.getValue();if(!f||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let d=0;c.logger.log("UserSession | publishVideo - stream:",f,"publishStreamName:",e),c.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new u.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:e,subscribeStreamName:t,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:e=>{c.logger.log("WEBRTC: onAddStream "+e.stream),l.next(e.stream)},forceTurnServerUse:a,iceServers:[{urls:n,username:r,credential:o}],onConnect:()=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected");h.getValue()===s.PublishSubscribeState.CONNECTING&&h.next(s.PublishSubscribeState.CONNECTED)},onError:e=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",d),d<3?(d++,this.performWebRTCConnection(f),this.options.userMessages.next(new i.ConnectionLostMessage(s.PublishSubscribeState.DISCONNECTED))):(c.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),h.next(s.PublishSubscribeState.FAILED),this.options.userMessages.next(new i.ConnectionLostMessage(s.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(f)):this.webRTC.updateStreamTracks(f)}performWebRTCConnection(e){this.webRTC&&(this.publishState$.next(s.PublishSubscribeState.CONNECTING),this.webRTC.connect(e))}initTransparentBackground(e){const t=new a.CanvasService(this.options.uneeqOptions).createCanvas();(new o.VideoEditor).applyChromaKeyEffect(t,e),this.avatarVideoElement.style.display="none"}}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoEditor=void 0;const s=o(n(83));t.VideoEditor=class{constructor(){}applyChromaKeyEffect(e,t){try{n(113);const r=s.default();let i,o,a;i=r.transform("reformat"),i.source=t,i.width=e.width,i.height=e.height,a=r.target(e),o=r.effect("chroma"),o.source=i,a.source=o,r.go()}catch(e){console.error(e)}}}},function(e,t,n){"use strict";n.r(t),n(83).default.plugin("chroma",{shader:function(e,t){return t.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"),t.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"),t},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(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasService=void 0;t.CanvasService=class{constructor(e){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=e}createCanvas(){const e=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(e),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.height=this.canvasHeight,e.width=this.canvasWidth,e}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqWebRTC=void 0;const i=r(n(116)),o=r(n(82)),s=n(37),a=n(31);t.UneeqWebRTC=class{constructor(e){this.fakeDataChannel={},this.MESSAGING_ENDPOINT="/app/v2/webRTC",this.onStats=(e,t)=>{this.options.userMessages.next(new s.WebRtcStatsMessage(t)),this.statTimer=window.setTimeout(()=>{this.client.getStats(this.onStats)},2e3)},this.options=Object.assign({forceTurnServerUse:!1,iceServers:[]},e),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(e){this.close(),this.client=new i.default({initiator:!0,config:{iceServers:this.options.iceServers},stream:e,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",e=>{this.log("error",e),void 0!==this.options.onError&&this.options.onError(e)}),this.client.on("signal",e=>{const t={payload:"",publishStreamName:this.options.publishStreamName,subscribeStreamName:this.options.subscribeStreamName,uniqueId:this.uniqueId,userAgent:navigator.userAgent,edgeNodeId:this.options.edgeNodeId};if("type"in e&&"offer"===e.type)t.payload=JSON.stringify({type:"offer",sdp:e.sdp}),t.type="OfferMessage",this.log("Offer payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t);else if("candidate"in e){const n=JSON.stringify(e.candidate);this.options.forceTurnServerUse&&!n.match(/typ relay/)||n.match(/::/)||(t.payload=n,t.type="IceCandidate",this.log("IC payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t))}else this.warn("WARNING Unhandled signal: ",JSON.stringify(e))}),this.client.on("connect",()=>{this.log("CONNECT"),void 0!==this.options.onConnect&&this.options.onConnect()}),this.client.on("data",e=>{this.log("data: "+e),void 0!==this.options.onData&&this.options.onData(e),this.options.userMessages.next(new s.WebRtcDataMessage(e))}),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",e=>{void 0!==this.options.onAddStream&&this.options.onAddStream({stream:e})})}close(){this.client&&(this.client.destroy(),this.client=null),this.statTimer&&clearTimeout(this.statTimer)}handleAnswerMessage(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);return this.log("got answer: ",t),this.client.signal(t),!0}return this.log("ignoring answer: ",e),!1}handleIceCandidate(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);if("candidate"in t&&""===t.candidate){if("edge"===o.default.browserDetails.browser){const e=this.client._pc;e.remoteDescription&&e.remoteDescription.type&&e.addIceCandidate(null)}}else this.client.signal({candidate:t});return!0}return!1}sendDataMessage(e){this.client.send(e)}getStats(e){return this.client&&this.client.getStats(e)}updateStreamTracks(e){e.getTracks().forEach(e=>{this.client._pc.getSenders().find(t=>e.kind===t.track.kind).replaceTrack(e).then(()=>{a.logger.log("Updated publish media stream track for "+e.kind)}).catch(t=>{a.logger.error("Error: updating publish media stream track failed for "+e.kind,t)})})}enableDiagnostics(){this.client._pc&&0!==this.client._pc.getStats.length&&(this.client._pc.getStats=""),this.client.getStats(this.onStats)}isMessageForUs(e){return e.requestUniqueId===this.uniqueId}log(e,...t){a.logger.log("UneeqWebRTC: "+e,t)}warn(e,...t){a.logger.warn("UneeqWebRTC: "+e,t)}}},function(e,t,n){
|
|
36
|
-
/*! simple-peer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
37
|
-
const r=n(117)("simple-peer"),i=n(120),o=n(121),s=n(122),a=n(131),c=n(132),{Buffer:u}=n(44);function h(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class l extends s.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=o(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||o(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||l.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},l.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.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=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:i(),!this._wrtc)throw"undefined"==typeof window?c(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):c(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(e){return void this.destroy(c(e,"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=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch(e=>{this.destroy(c(e,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach(e=>{this.addStream(e)}),this._pc.ontrack=e=>{this._onTrack(e)},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(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(e=>{this._addIceCandidate(e)}),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())}).catch(e=>{this.destroy(c(e,"ERR_SET_REMOTE_DESCRIPTION"))}),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(c(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch(e=>{var n;!t.address||t.address.endsWith(".local")?(n="Ignoring unsupported ICE candidate.",console.warn(n)):this.destroy(c(e,"ERR_ADD_ICE_CANDIDATE"))})}send(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(c(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach(t=>{this.addTrack(t,e)})}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw c(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const n=this._senderMap.get(e)||new Map;let r=n.get(t);if(r)throw r.removed?c(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):c(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");r=this._pc.addTrack(e,t),n.set(t,r),this._senderMap.set(e,n),this._needsNegotiation()}replaceTrack(e,t,n){if(this.destroying)return;if(this.destroyed)throw c(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const r=this._senderMap.get(e),i=r?r.get(n):null;if(!i)throw c(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,r),null!=i.replaceTrack?i.replaceTrack(t):this.destroy(c(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw c(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const n=this._senderMap.get(e),r=n?n.get(t):null;if(!r)throw c(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{r.removed=!0,this._pc.removeTrack(r)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(r):this.destroy(c(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach(t=>{this.removeTrack(t,e)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,a(()=>{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 c(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(e){this._destroy(e,()=>{})}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),a(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),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(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}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,e&&this.emit("error",e),this.emit("close"),t()}))}_setupData(e){if(!e.channel)return this.destroy(c(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=65536),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(c(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval(()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1},5e3)}_read(){}_write(e,t,n){if(this.destroyed)return n(c(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(c(e,"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=e,this._cb=n}_onFinish(){if(this.destroyed)return;const e=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?e():this.once("connect",e)}_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(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=h(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})};this._pc.setLocalDescription(e).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))}).catch(e=>{this.destroy(c(e,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(e=>{this.destroy(c(e,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=h(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(e).then(()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))}).catch(e=>{this.destroy(c(e,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(e=>{this.destroy(c(e,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(c(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),"connected"!==e&&"completed"!==e||(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(c(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(c(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach(t=>{Object.assign(e,t)}),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then(n=>{const r=[];n.forEach(e=>{r.push(t(e))}),e(null,r)},t=>e(t)):this._pc.getStats.length>0?this._pc.getStats(n=>{if(this.destroyed)return;const r=[];n.result().forEach(e=>{const n={};e.names().forEach(t=>{n[t]=e.stat(t)}),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,r.push(t(n))}),e(null,r)},t=>e(t)):e(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 e=()=>{this.destroyed||this.getStats((t,n)=>{if(this.destroyed)return;t&&(n=[]);const r={},i={},o={};let s=!1;n.forEach(e=>{"remotecandidate"!==e.type&&"remote-candidate"!==e.type||(r[e.id]=e),"localcandidate"!==e.type&&"local-candidate"!==e.type||(i[e.id]=e),"candidatepair"!==e.type&&"candidate-pair"!==e.type||(o[e.id]=e)});const a=e=>{s=!0;let t=i[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=Number(t.port)):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=Number(t.portNumber)):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=Number(t[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let n=r[e.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 e.googRemoteAddress&&(n=e.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(e=>{"transport"===e.type&&e.selectedCandidatePairId&&a(o[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&a(e)}),s||Object.keys(o).length&&!Object.keys(i).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(t){return this.destroy(c(t,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(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(e,100)})};e()}_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(e=>{this._pc.removeTrack(e),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(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=u.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(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(e){this.destroyed||e.streams.forEach(t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some(e=>e.id===t.id)||(this._remoteStreams.push(t),a(()=>{this._debug("on stream"),this.emit("stream",t)}))})}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],r.apply(null,e)}}l.WEBRTC_SUPPORT=!!i(),l.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},l.channelConfig={},e.exports=l},function(e,t,n){(function(r){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},t.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+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=n(118)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(38))},function(e,t,n){e.exports=function(e){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,i)=>{if("%%"===n)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(119),t.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(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},function(e,t){var n=1e3,r=6e4,i=60*r,o=24*i;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,t){t=t||{};var a=typeof e;if("string"===a&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===a&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return s(e,t,o,"day");if(t>=i)return s(e,t,i,"hour");if(t>=r)return s(e,t,r,"minute");if(t>=n)return s(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=r)return Math.round(e/r)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t){e.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},function(e,t,n){"use strict";(function(t,r){var i=n(86).Buffer,o=t.crypto||t.msCrypto;o&&o.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var n=i.allocUnsafe(e);if(e>0)if(e>65536)for(var s=0;s<e;s+=65536)o.getRandomValues(n.slice(s,s+65536));else o.getRandomValues(n);if("function"==typeof t)return r.nextTick((function(){t(null,n)}));return n}:e.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(35),n(38))},function(e,t,n){(t=e.exports=n(87)).Stream=t,t.Readable=t,t.Writable=n(92),t.Duplex=n(46),t.Transform=n(94),t.PassThrough=n(129),t.finished=n(79),t.pipeline=n(130)},function(e,t){},function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=n(44).Buffer,a=n(125).inspect,c=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,n,u;return t=e,(n=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,n,r,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,n=i,r=a,s.prototype.copy.call(t,n,r),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:c,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&o(t.prototype,n),u&&o(t,u),e}()},function(e,t){},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(35))},function(e,t,n){"use strict";(function(t){var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(79),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),l=Symbol("handlePromise"),f=Symbol("stream");function d(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var n=e[f].read();null!==n&&(e[h]=null,e[s]=null,e[a]=null,t(d(n,!1)))}}function v(e){t.nextTick(p,e)}var g=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((i(r={get stream(){return this[f]},next:function(){var e=this,n=this[c];if(null!==n)return Promise.reject(n);if(this[u])return Promise.resolve(d(void 0,!0));if(this[f].destroyed)return new Promise((function(n,r){t.nextTick((function(){e[c]?r(e[c]):n(d(void 0,!0))}))}));var r,i=this[h];if(i)r=new Promise(function(e,t){return function(n,r){e.then((function(){t[u]?n(d(void 0,!0)):t[l](n,r)}),r)}}(i,this));else{var o=this[f].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[l])}return this[h]=r,r}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){e?n(e):t(d(void 0,!0))}))}))})),r),g);e.exports=function(e){var t,n=Object.create(m,(i(t={},f,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,l,{value:function(e,t){var r=n[f].read();r?(n[h]=null,n[s]=null,n[a]=null,e(d(r,!1))):(n[s]=e,n[a]=t)},writable:!0}),t));return n[h]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[a];return null!==t&&(n[h]=null,n[s]=null,n[a]=null,t(e)),void(n[c]=e)}var r=n[s];null!==r&&(n[h]=null,n[s]=null,n[a]=null,r(d(void 0,!0))),n[u]=!0})),e.on("readable",v.bind(null,n)),n}}).call(this,n(38))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,n){"use strict";e.exports=i;var r=n(94);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(59)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){"use strict";var r;var i=n(45).codes,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===r&&(r=n(79)),r(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var c=!1;return function(t){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}function u(e){e()}function h(e,t){return e.pipe(t)}function l(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=l(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var s=t.map((function(e,n){var o=n<t.length-1;return c(e,o,n>0,(function(e){r||(r=e),e&&s.forEach(u),o||(s.forEach(u),i(r))}))}));return t.reduce(h)}},function(e,t,n){(function(t){/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
38
|
-
let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:t):e=>(n||(n=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0))}).call(this,n(35))},function(e,t,n){"use strict";function r(e,t){for(const n in t)Object.defineProperty(e,n,{value:t[n],enumerable:!0,configurable:!0});return e}e.exports=function(e,t,n){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof t&&(n=t,t=""),t&&(n.code=t);try{return r(e,n)}catch(t){n.message=e.message,n.stack=e.stack;const i=function(){};i.prototype=Object.create(Object.getPrototypeOf(e));return r(new i,n)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanVideoPlayManager=void 0;const r=n(63),i=n(31);t.DigitalHumanVideoPlayManager=class{constructor(e,t){this.messages=e,this.publicUnmuteDigitalHumanMethod=t,this.remoteVideoPlayCount=0}play(e){this.video=e,this.playRemoteVideo()}unmuteVideo(){this.video&&this.video.muted&&(this.video.muted=!1,this.messages.next(new r.DigitalHumanUnmuted))}playRemoteVideo(){this.video&&(this.video.onerror=e=>{this.messages.next(new r.DigitalHumanVideoError(e))},this.video.play().then(()=>{this.messages.next(new r.DigitalHumanUnmuted)}).catch(()=>{this.digitalHumanFailedToPlayUnmuted()}))}digitalHumanFailedToPlayUnmuted(){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(e=>{i.logger.log("Could not play digital human video even as muted, starting exponential backoff.",e),this.playRemoteVideoWithExponentialBackoff()})}playRemoteVideoWithExponentialBackoff(){this.video&&(this.video.autoplay=!0,this.video.play().then(()=>{this.messages.next(new r.DigitalHumanUnmuted)}),this.remoteVideoPlayCount++,setTimeout(()=>{this.remoteVideoPlayCount<10&&this.playRemoteVideoWithExponentialBackoff()},100*(this.remoteVideoPlayCount-1)))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocaleDetector=void 0;class r{static validateOrDetectSpeechLocales(e){let t=e.speechToTextLocales;if(t&&t.length>0){t.split(":").forEach(e=>{this.sttSupportedLocales[e]||(console.error(`UneeQ: Speech to text not supported for: ${e}. Defaulting to en-US`),t=this.defaultLocale)}),"undefined"!==t&&"null"!==t||(t=this.defaultLocale)}let n=(window.navigator.languages||[window.navigator.language]).map(e=>((e.length<5||"zh-CN"===e)&&(e=this.localeMappings[e]||null),e&&!this.sttSupportedLocales[e]&&(console.warn(`UneeQ: Speech to text not supported for one of the detected languages: ${e}. Replacing with en-US.`),e=this.defaultLocale),e)).slice(0,4).filter(i).filter((e,t,n)=>n.indexOf(e)===t).join(":").replace(/:\s*$/,"");return n&&0!==n.length||(n=this.defaultLocale),t&&t.length>0?console.debug("UneeQ: Configured speech to text languages: "+t):console.warn("UneeQ: Detected speechToText languages from browser: "+n),t||n}}function i(e){return null!=e}t.LocaleDetector=r,r.defaultLocale="en-US",r.localeMappings={en:"en-US",es:"es-ES",fr:"fr-FR",ja:"ja-JP",de:"de-DE",ko:"ko-KR",zh:"cmn-Hans-CN",it:"it-IT",pt:"pt-PT",nl:"nl-NL",sv:"sv-SE",da:"da-DK",no:"no-NO",fi:"fi-FI",ru:"ru-RU",pl:"pl-PL",tr:"tr-TR",ar:"ar-SA",th:"th-TH",id:"id-ID",cs:"cs-CZ",hu:"hu-HU",ro:"ro-RO",he:"he-IL",vi:"vi-VN",uk:"uk-UA",hi:"hi-IN","zh-CN":"cmn-Hans-CN"},r.sttSupportedLocales={"af-ZA":!0,"sq-AL":!0,"am-ET":!0,"ar-DZ":!0,"ar-BH":!0,"ar-EG":!0,"ar-IQ":!0,"ar-IL":!0,"ar-JO":!0,"ar-KW":!0,"ar-LB":!0,"ar-MR":!0,"ar-MA":!0,"ar-OM":!0,"ar-QA":!0,"ar-SA":!0,"ar-PS":!0,"ar-TN":!0,"ar-AE":!0,"ar-YE":!0,"hy-AM":!0,"az-AZ":!0,"eu-ES":!0,"bn-BD":!0,"bn-IN":!0,"bs-BA":!0,"bg-BG":!0,"my-MM":!0,"ca-ES":!0,"yue-Hant-HK":!0,"cmn-Hans-CN":!0,"cmn-Hant-TW":!0,"hr-HR":!0,"cs-CZ":!0,"da-DK":!0,"nl-BE":!0,"nl-NL":!0,"en-AU":!0,"en-CA":!0,"en-GH":!0,"en-HK":!0,"en-IN":!0,"en-IE":!0,"en-KE":!0,"en-NZ":!0,"en-NG":!0,"en-PK":!0,"en-PH":!0,"en-SG":!0,"en-ZA":!0,"en-TZ":!0,"en-GB":!0,"en-US":!0,"et-EE":!0,"fil-PH":!0,"fi-FI":!0,"fr-BE":!0,"fr-CA":!0,"fr-FR":!0,"fr-CH":!0,"gl-ES":!0,"ka-GE":!0,"de-AT":!0,"de-DE":!0,"de-CH":!0,"el-GR":!0,"gu-IN":!0,"iw-IL":!0,"hi-IN":!0,"hu-HU":!0,"is-IS":!0,"id-ID":!0,"it-IT":!0,"it-CH":!0,"ja-JP":!0,"jv-ID":!0,"kn-IN":!0,"kk-KZ":!0,"km-KH":!0,"ko-KR":!0,"lo-LA":!0,"lv-LV":!0,"lt-LT":!0,"mk-MK":!0,"ms-MY":!0,"ml-IN":!0,"mr-IN":!0,"mn-MN":!0,"ne-NP":!0,"no-NO":!0,"fa-IR":!0,"pl-PL":!0,"pt-BR":!0,"pt-PT":!0,"pa-Guru-IN":!0,"ro-RO":!0,"ru-RU":!0,"rw-RW":!0,"sr-RS":!0,"si-LK":!0,"sk-SK":!0,"sl-SI":!0,"ss-latn-za":!0,"st-ZA":!0,"es-AR":!0,"es-BO":!0,"es-CL":!0,"es-CO":!0,"es-CR":!0,"es-DO":!0,"es-EC":!0,"es-SV":!0,"es-GT":!0,"es-HN":!0,"es-MX":!0,"es-NI":!0,"es-PA":!0,"es-PY":!0,"es-PE":!0,"es-PR":!0,"es-ES":!0,"es-US":!0,"es-UY":!0,"es-VE":!0,"su-ID":!0,"sw-KE":!0,"sw-TZ":!0,"sv-SE":!0,"ta-IN":!0,"ta-MY":!0,"ta-SG":!0,"ta-LK":!0,"te-IN":!0,"th-TH":!0,"tn-latn-za":!0,"tr-TR":!0,"ts-ZA":!0,"uk-UA":!0,"ur-IN":!0,"ur-PK":!0,"uz-UZ":!0,"ve-ZA":!0,"vi-VN":!0,"xh-ZA":!0,"zu-ZA":!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;const r=n(37),i=n(80);t.MessageHandler=class{constructor(e,t){this.internalMessages$=e,this.messages=t,this.deviceManager={getDevices:(e,t)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe(e=>{const t={type:i.PromMessageType.QuestionMessageReceived,value:{id:e.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new r.AvatarQuestionMessage(e.question,e.id))}),this.getMessagesOfType("AvatarAnswerText").subscribe(e=>{const t={type:i.PromMessageType.AnswerMessageReceived,value:{id:e.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new r.AvatarAnswerMessage(e.answer,e.answerAvatar,e.answerSpeech,e.questionId))}),this.getMessagesOfType("AvatarAnswerHTML").subscribe(e=>{this.messages.next(new r.AvatarAnswerContentMessage(e.html,e.messageId,e.hasDisplayHtml)),this.messages.next(new r.InstructionsMessage(e.instructions))}),this.getMessagesOfType("AvatarTextInputStarted").subscribe(e=>this.messages.next(new r.StartedSpeakingMessage)),this.getMessagesOfType("AvatarTextInputFinished").subscribe(e=>{this.messages.next(new r.FinishedSpeakingMessage),this.messages.next(new r.AvatarTextInputFinishedMessage)}),this.getMessagesOfType("AvatarStarting").subscribe(e=>{this.deviceManager.edgeNodeId=e.edgeNodeId}),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe(e=>{this.messages.next(new r.ClientMediaStreamUpdateMessage(e.clientStreamingAudio,e.clientStreamingVideo,e.serverStreamingAudio,e.serverStreamingVideo)),e.clientStreamingAudio&&e.clientStreamingVideo&&e.serverStreamingAudio&&e.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))}),this.getMessagesOfType("SessionErrorMessage").subscribe(e=>{console.error(e.error),this.messages.next(new r.SessionErrorMessage(e.error))}),this.getMessagesOfType("SessionInfoMessage").subscribe(e=>{this.messages.next(new r.SessionInfoMessage(e.info))}),this.getMessagesOfType("SessionEndedMessage").subscribe(()=>{const e={type:i.PromMessageType.SessionEnded,value:{receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.internalMessages$.next({faceMeMessageType:"sessionEnd"})}),this.getMessagesOfType("AvatarRequestCompleted").subscribe(e=>{this.messages.next(new r.AvatarRequestCompleted(e.reason))}),this.getMessagesOfType("AvatarRequestIgnored").subscribe(e=>{this.messages.next(new r.AvatarRequestIgnored(e.reason))})}setDeviceManager(e){this.deviceManager=e}getMessagesOfType(e){return this.internalMessages$.filter(t=>t.faceMeMessageType===e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={};t.default=void 0;var i=n(137),o=n(141);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));t.default=function(){return new i.Registry}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Registry=void 0;var r=n(64),i=n(95),o=n(139),s=n(140),a=n(97);function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var u=function(){function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(n="data")in(t=this)?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.data={counter:{},gauge:{},histogram:{}}}var t,n,u;return t=e,(n=[{key:"validateInput",value:function(e,t,n,i){if(""===String(t))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(e))throw new Error("Unknown metric type ".concat(e));if("string"!=typeof n&&null!=n)throw new Error("help must be string or undefined/null");if((0,r.has)(this.data,"".concat(e,".").concat(t)))throw new Error("A metric with the name '".concat(t,"' already exists for type '").concat(e,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(e,t,r,a),"counter"===e?(n=new i.Counter,this.data.counter[t]={help:r,instance:n,type:e}):"gauge"===e?(n=new o.Gauge,this.data.gauge[t]={help:r,instance:n,type:e}):(n=new s.Histogram(a),this.data.histogram[t]={help:r,instance:n,type:e}),n}},{key:"metrics",value:function(){return(0,r.reduce)(this.data,(function(e,t,n){return e+(0,r.reduce)(t,(function(e,t,i){var o=t.instance.collect(),s=e;return t.help.length>0&&(s+="# HELP ".concat(i," ").concat(t.help,"\n")),s+="# TYPE ".concat(i," ").concat(n,"\n"),s+=(0,r.reduce)(o,(function(e,t){return e+("histogram"===n?(0,a.formatHistogramOrSummary)(i,t):(0,a.formatCounterOrGauge)(i,t))}),"")}),"")}),"")}},{key:"reset",value:function(){return(0,r.each)(this.data,(function(e){(0,r.each)(e,(function(e){e.instance.resetAll()}))})),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(e,t){var n=(null!=e?[this.data[e]]:(0,r.valuesIn)(this.data)).find((function(e){return(0,r.has)(e,t)}));return null!=n?n[t].instance:void 0}}])&&c(t.prototype,n),u&&c(t,u),e}();t.Registry=u},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Gauge=void 0;var u=function(e){function t(){return i(this,t),s(this,a(t).apply(this,arguments))}var n,r,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,e),n=t,(r=[{key:"dec",value:function(e){var t=this.get(e);return this.set(t?t.value-1:0,e),this}},{key:"sub",value:function(e,t){var n=this.get(t);return this.set(n?n.value-e:0,t),this}}])&&o(n.prototype,r),u&&o(n,u),t}(n(95).Counter);t.Gauge=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Histogram=void 0;var r=n(64);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?u(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return{entries:(0,r.reduce)(e,(function(e,t){return e[t.toString()]=0,e}),{"+Inf":0}),sum:0,count:0,raw:[]}}var d=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return o(this,t),l(u(e=a(this,c(t).call(this))),"buckets",void 0),e.buckets=n.sort((function(e,t){return e>t?1:-1})),e.set(f(e.buckets)),e.observe=e.observe.bind(u(e)),e}var n,i,d;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),n=t,(i=[{key:"observe",value:function(e,t){var n=this.get(t);null==n&&(n=this.set(f(this.buckets),t).get(t)),n.value.raw.push(e),n.value.entries["+Inf"]+=1;var i=function(e,t){if(t<e[e.length-1])for(var n=0;n<e.length;n+=1)if(t<=e[n])return n}(this.buckets,e);if(null!=i)for(var o=i;o<this.buckets.length;o+=1){var s=n.value.entries[this.buckets[o].toString()];n.value.entries[this.buckets[o].toString()]=s+1}return n.value.sum=(0,r.sum)(n.value.raw),n.value.count+=1,this}},{key:"reset",value:function(e){this.set(f(this.buckets),e)}}])&&s(n.prototype,i),d&&s(n,d),t}(n(96).Collector);t.Histogram=d},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=t.MessagingService=void 0;const r=n(143);Object.defineProperty(t,"MessagingService",{enumerable:!0,get:function(){return r.MessagingService}});const i=n(98);Object.defineProperty(t,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingService=void 0;const r=n(157),i=n(144),o=n(146),s=n(31),a=n(98);t.MessagingService=class{constructor(e,t){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=e,this.options=Object.assign(this.options,t),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(a.MessagingState.DISCONNECTED),this.messages$=new o.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=e=>this.onStompConnected(e),this.stompClient.onDisconnect=e=>{s.logger.log("Stomp client disconnected",e)},this.stompClient.onStompError=e=>{s.logger.log("Stomp client error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketError=e=>{s.logger.log("Stomp client web socket error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketClose=e=>{s.logger.log("Stomp client web socket closed",e),this.onStompClientConnectionClosed(e)}}connect(){this.disconnect(),s.logger.log("MessagingService | connecting..."),this.state$.next(a.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const e=this.state$.getValue();if(e===a.MessagingState.CONNECTED||e===a.MessagingState.CONNECTING){s.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.options.autoReconnect=!1,this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(a.MessagingState.DISCONNECTED)}catch(e){console.error("MessagingService | disconnect: error",e),this.state$.next(a.MessagingState.DISCONNECTED)}}}send(e,t){s.logger.log("MessagingService | send:",e,t);const n={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},r=JSON.stringify(t);this.stompClient.publish({destination:e,body:r,headers:n})}getTopic(e){s.logger.log("MessagingService | subscribeToTopic: "+e);const t=this.subscriptions[e];if(t)return s.logger.log("existing subscription... not re-subscribing to topic"),t;const n=new o.Subject;return this.stompClient.subscribe(e,e=>{n.next(e),this.messages$.next(e)}),this.subscriptions[e]=n,n}onStompConnected(e){s.logger.log("MessagingService | connected"),this.state$.next(a.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(e){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(){s.logger.log("MessagingService | initMessagingSubscription");this.stompClient.subscribe("/",e=>{this.messages$.next(e)})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(145))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(47);t.BehaviorSubject=r.BehaviorSubject},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(147))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(47);t.Subject=r.Subject},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsService=void 0;const r=n(37),i=n(149),o=n(80);t.MetricsService=class{constructor(e,t,n){this.uneeqOptions=e,this.internalMessages=t,this.messages=n,this.clientPerformanceStats={},this.options=e,this.internalMessages$=t,this.messages$=n}parseAndLogWebRtcStats(e){try{e.forEach(e=>{var t,n;if("inbound-rtp"===e.type&&"video"===e.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",e.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",e.frameWidth);const r=e.framesDropped,o=r?r-(null===(t=this.clientPerformanceStats.totalFramesDropped)||void 0===t?void 0:t.value):0;this.clientPerformanceStats.newFramesDropped=o?new i.ClientPerformanceStat("New Frames Dropped",o):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=r?new i.ClientPerformanceStat("Total Frames Dropped",r):new i.ClientPerformanceStat;const s=e.packetsLost,a=s?s-(null===(n=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===n?void 0:n.value):0;this.clientPerformanceStats.inboundNewPacketsLost=a?new i.ClientPerformanceStat("New packets lost",a):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=s?new i.ClientPerformanceStat("Total packets lost",s):new i.ClientPerformanceStat;const c=e.framesPerSecond;this.clientPerformanceStats.framesPerSec=c?new i.ClientPerformanceStat("Frames per second",c):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===e.type&&"video"===e.kind){const t=e.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=t?new i.ClientPerformanceStat("Round Trip Time",t):new i.ClientPerformanceStat}else if("outbound-rtp"===e.type&&"video"===e.kind){const t=e.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",t)}}),this.options.enableClientPerformanceMessage&&this.messages$.next(new r.ClientPerformanceMessage(this.clientPerformanceStats));const t={type:o.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t})}catch(e){console.warn("Unable to parseAndLogWebRTCStats",e)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientPerformanceStat=void 0;t.ClientPerformanceStat=class{constructor(e="",t=0){this.label=e,this.value=t}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnlineStatusService=void 0;const r=n(37);t.OnlineStatusService=class{constructor(e,t){this.messages=e,this.offlineTimeoutLimitHandler=t,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(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResumeSessionCheck=void 0;const r=n(31),i=n(99);class o{static validate(e){const t=new i.UneeqLocalStorage;let n=void 0!==e.resumeSession&&e.resumeSession;t.getItemSafely("uneeqResumeSessionPersonaId")===e.conversationId||(r.logger.log("UneeQ: Persona Id's do not match, unable to resume session."),n=!1);const s=o.browserTabIsActive();if(n&&!s&&(r.logger.log("UneeQ: Browser tab is not active so unable to resume"),n=!1),n){const e=t.getItemSafely("uneeqResumeSessionId");if(null!==e)return{resumeSession:!0,resumeSessionId:e}}return{resumeSession:!1}}static browserTabIsActive(){return!document.hidden}}t.ResumeSessionCheck=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamManager=void 0;t.StreamManager=class{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(e){return e.getVideoTracks().forEach(t=>e.removeTrack(t)),e.addTrack(this.canvasVideoTrack),e}addSilentAudioTrackToStream(e){return e.getAudioTracks().forEach(t=>e.removeTrack(t)),e.addTrack(this.silentAudioTrack),e}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){const e=document.createElement("canvas");e.width=40,e.height=30,e.getContext("2d");return e.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){const e=new window.AudioContext;this.audioContextInstance=e,this.audioSourceDestination=e.createMediaStreamDestination()}return this.audioSourceDestination.stream.getAudioTracks()[0]}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputManager=void 0;const r=n(81),i=n(154),o=n(63),s=n(100),a=n(31);t.VoiceInputManager=class{constructor(e,t,n,r){this.options=e,this.api=t,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(e.voiceInputMode);try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(e){this.audioContextNotSupported()}this.handleAppMessages()}setVoiceInputMode(e){e===s.VoiceInputMode.PUSH_TO_TALK?this.options.voiceInputMode=s.VoiceInputMode.PUSH_TO_TALK:e===s.VoiceInputMode.VOICE_ACTIVITY?this.options.voiceInputMode=s.VoiceInputMode.VOICE_ACTIVITY:this.messages.next(new o.WarningMessage("Invalid voice input mode selected: "+e))}startRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStartRecording():this.requestNotSupportedInVoiceActivityMode("startRecording")}stopRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStopRecording():this.requestNotSupportedInVoiceActivityMode("stopRecording")}handleSessionEnd(){this.soundMeter&&this.soundMeter.stop()}resumeAudioContext(){a.logger.log("UneeQ: resuming publish stream audio context and initializing mic activity."),this.audioContext&&(this.audioContext.resume(),this.stream&&this.initMicActivity(this.stream))}initMicActivity(e){this.stream=e,this.soundMeter=new i.SoundMeter(this.audioContext),this.soundMeter.connectToSource(e,e=>this.micActivityConnected(e))}audioContextNotSupported(){this.options.micActivityMessages&&this.messages.next(new o.MicActivityNotSupportedMessage),this.messages.next(new o.VoiceActivityInputModeNotSupportedMessage),this.setVoiceInputMode(s.VoiceInputMode.PUSH_TO_TALK)}handleAppMessages(){this.messages.subscribe(e=>{switch(e.uneeqMessageType){case o.UneeqMessageType.StartedSpeaking:console.log("StartSpeaking message"),this.digitalHumanSpeaking=!0;break;case o.UneeqMessageType.FinishedSpeaking:this.digitalHumanSpeaking=!1}})}requestNotSupportedInVoiceActivityMode(e){this.messages.next(new o.WarningMessage("Request not supported in voice activity mode: "+e))}apiStartRecording(){this.recording=!0,this.messages.next(new o.RecordingStartedMessage),this.api.avatarStartRecording().catch(()=>{this.recording=!1,this.messages.next(new o.RecordingStoppedMessage)})}apiStopRecording(){this.recording=!1,this.api.avatarStopRecording().finally(()=>this.messages.next(new o.RecordingStoppedMessage))}micActivityConnected(e){e?this.messages.next(new o.MicActivityErrorMessage(e)):this.soundMeter&&this.soundMeter.instant$.pipe(r.distinctUntilChanged()).subscribe(e=>{this.handleVoiceActivity(e)})}handleVoiceActivity(e){this.options.micActivityMessages&&this.messages.next(new o.MicActivityMessage(e)),this.options.voiceInputMode!==s.VoiceInputMode.VOICE_ACTIVITY||this.digitalHumanSpeaking&&!this.voiceActivityAllowInterruptions||(e>this.microphoneEngageVolume?(this.recording||this.apiStartRecording(),this.clearSilenceTimeout()):e<this.microphoneDisengageVolume&&this.recording&&(this.clearSilenceTimeout(),this.silenceTimeout=setTimeout(()=>{this.recording&&this.apiStopRecording()},this.voiceActivityNotSpeakingTimeoutMS)))}clearSilenceTimeout(){this.silenceTimeout&&clearTimeout(this.silenceTimeout)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SoundMeter=void 0;const r=n(47),i=n(31);t.SoundMeter=class{constructor(e){this.instant$=new r.BehaviorSubject(0),this.context=e,this.instant=0,this.slow=0,this.clip=0,this.script=e.createScriptProcessor(2048,1,1);const t=this;this.script.onaudioprocess=e=>{const n=e.inputBuffer.getChannelData(0);let r,i=0,o=0;for(r=0;r<n.length;++r)i+=n[r]*n[r],Math.abs(n[r])>.99&&(o+=1);t.instant=Math.sqrt(i/n.length),t.slow=.95*t.slow+.05*t.instant,t.clip=o/n.length,t.instant$.next(parseFloat(t.instant.toFixed(2)))}}connectToSource(e,t){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==t&&t(null)}catch(e){console.error(e),void 0!==t&&t(e)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionType=void 0,function(e){e[e.WEB=0]="WEB"}(t.SessionType||(t.SessionType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceApp=void 0,function(e){e.HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",e.SHOWCASE="SHOWCASE",e.SPLIT_SCREEN="SPLIT_SCREEN",e.INTERACTIONS="INTERACTIONS",e.UNKNOWN="UNKNOWN"}(t.SourceApp||(t.SourceApp={}))},function(e,t,n){"use strict";n.r(t),n.d(t,"Client",(function(){return f})),n.d(t,"FrameImpl",(function(){return o})),n.d(t,"Parser",(function(){return s})),n.d(t,"StompConfig",(function(){return d})),n.d(t,"StompHeaders",(function(){return p})),n.d(t,"StompSubscription",(function(){return v})),n.d(t,"StompSocketState",(function(){return a})),n.d(t,"ActivationState",(function(){return c})),n.d(t,"Versions",(function(){return u})),n.d(t,"CompatClient",(function(){return m})),n.d(t,"Stomp",(function(){return y}));const r="\n",i="\0";class o{constructor(e){const{command:t,headers:n,body:r,binaryBody:i,escapeHeaderValues:o,skipContentLengthHeader:s}=e;this.command=t,this.headers=Object.assign({},n||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=r||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=s||!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(e,t){const n={},r=e=>e.replace(/^\s+|\s+$/g,"");for(const i of e.headers.reverse()){i.indexOf(":");const s=r(i[0]);let a=r(i[1]);t&&"CONNECT"!==e.command&&"CONNECTED"!==e.command&&(a=o.hdrValueUnEscape(a)),n[s]=a}return new o({command:e.command,headers:n,binaryBody:e.binaryBody,escapeHeaderValues:t})}toString(){return this.serializeCmdAndHeaders()}serialize(){const e=this.serializeCmdAndHeaders();return this.isBinaryBody?o.toUnit8Array(e,this._binaryBody).buffer:e+this._body+i}serializeCmdAndHeaders(){const e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const t of Object.keys(this.headers||{})){const n=this.headers[t];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?e.push(`${t}:${o.hdrValueEscape(""+n)}`):e.push(`${t}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push("content-length:"+this.bodyLength()),e.join(r)+r+r}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const e=this.binaryBody;return e?e.length:0}static sizeOfUTF8(e){return e?(new TextEncoder).encode(e).length:0}static toUnit8Array(e,t){const n=(new TextEncoder).encode(e),r=new Uint8Array([0]),i=new Uint8Array(n.length+t.length+r.length);return i.set(n),i.set(t,n.length),i.set(r,n.length+t.length),i}static marshall(e){return new o(e).serialize()}static hdrValueEscape(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(e){return e.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}class s{constructor(e,t){this.onFrame=e,this.onIncomingPing=t,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(e,t=!1){let n;if(n=e instanceof ArrayBuffer?new Uint8Array(e):this._encoder.encode(e),t&&0!==n[n.length-1]){const e=new Uint8Array(n.length+1);e.set(n,0),e[n.length]=0,n=e}for(let e=0;e<n.length;e++){const t=n[e];this._onByte(t)}}_collectFrame(e){0!==e&&13!==e&&(10!==e?(this._onByte=this._collectCommand,this._reinjectByte(e)):this.onIncomingPing())}_collectCommand(e){if(13!==e)return 10===e?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_collectHeaders(e){13!==e&&(10!==e?(this._onByte=this._collectHeaderKey,this._reinjectByte(e)):this._setupCollectBody())}_reinjectByte(e){this._onByte(e)}_collectHeaderKey(e){if(58===e)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(e)}_collectHeaderValue(e){if(13!==e)return 10===e?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_setupCollectBody(){const e=this._results.headers.filter(e=>"content-length"===e[0])[0];e?(this._bodyBytesRemaining=parseInt(e[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(e){0!==e?this._consumeByte(e):this._retrievedBody()}_collectBodyFixedSize(e){0!=this._bodyBytesRemaining--?this._consumeByte(e):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(e){this._token.push(e)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const e=new Uint8Array(this._token);return this._token=[],e}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var a,c;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(a||(a={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.DEACTIVATING=1]="DEACTIVATING",e[e.INACTIVE=2]="INACTIVE"}(c||(c={}));class u{constructor(e){this.versions=e}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(e=>`v${e.replace(".","")}.stomp`)}}u.V1_0="1.0",u.V1_1="1.1",u.V1_2="1.2",u.default=new u([u.V1_0,u.V1_1,u.V1_2]);class h{constructor(e,t,n={}){this._client=e,this._webSocket=t,this._serverFrameHandlers={CONNECTED:e=>{this.debug("connected to server "+e.headers.server),this._connected=!0,this._connectedVersion=e.headers.version,this._connectedVersion===u.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(e.headers),this.onConnect(e)},MESSAGE:e=>{const t=e.headers.subscription,n=this._subscriptions[t]||this.onUnhandledMessage,r=e,i=this,o=this._connectedVersion===u.V1_2?r.headers.ack:r.headers["message-id"];r.ack=(e={})=>i.ack(o,t,e),r.nack=(e={})=>i.nack(o,t,e),n(r)},RECEIPT:e=>{const t=this._receiptWatchers[e.headers["receipt-id"]];t?(t(e),delete this._receiptWatchers[e.headers["receipt-id"]]):this.onUnhandledReceipt(e)},ERROR:e=>{this.onStompError(e)}},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(e){Object.assign(this,e)}start(){const e=new s(e=>{const t=o.fromRawFrame(e,this._escapeHeaderValues);this.logRawCommunication||this.debug("<<< "+t);(this._serverFrameHandlers[t.command]||this.onUnhandledFrame)(t)},()=>{this.debug("<<< PONG")});this._webSocket.onmessage=t=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const e=t.data instanceof ArrayBuffer?(new TextDecoder).decode(t.data):t.data;this.debug("<<< "+e)}e.parseChunk(t.data,this.appendMissingNULLonIncoming)},this._onclose=e=>{this.debug("Connection closed to "+this._client.brokerURL),this._cleanUp(),this.onWebSocketClose(e)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=e=>{this.onWebSocketError(e)},this._webSocket.onopen=()=>{const e=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),e["accept-version"]=this.stompVersions.supportedVersions(),e["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:e})}}_setupHeartbeat(e){if(e.version!==u.V1_1&&e.version!==u.V1_2)return;if(!e["heart-beat"])return;const[t,n]=e["heart-beat"].split(",").map(e=>parseInt(e,10));if(0!==this.heartbeatOutgoing&&0!==n){const e=Math.max(this.heartbeatOutgoing,n);this.debug(`send PING every ${e}ms`),this._pinger=setInterval(()=>{this._webSocket.readyState===a.OPEN&&(this._webSocket.send(r),this.debug(">>> PING"))},e)}if(0!==this.heartbeatIncoming&&0!==t){const e=Math.max(this.heartbeatIncoming,t);this.debug(`check PONG every ${e}ms`),this._ponger=setInterval(()=>{const t=Date.now()-this._lastServerActivityTS;t>2*e&&(this.debug(`did not receive server activity for the last ${t}ms`),this._closeOrDiscardWebsocket())},e)}}_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!==a.CONNECTING&&this._webSocket.readyState!==a.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}_discardWebsocket(){var e,t;this._webSocket.terminate||(e=this._webSocket,t=e=>this.debug(e),e.terminate=function(){const e=()=>{};this.onerror=e,this.onmessage=e,this.onopen=e;const n=new Date,r=this.onclose;this.onclose=e=>{const r=(new Date).getTime()-n.getTime();t(`Discarded socket closed after ${r}ms, with code/reason: ${e.code}/${e.reason}`)},this.close(),r.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(e){const{command:t,headers:n,body:r,binaryBody:i,skipContentLengthHeader:s}=e,a=new o({command:t,headers:n,body:r,binaryBody:i,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:s});let c=a.serialize();if(this.logRawCommunication?this.debug(">>> "+c):this.debug(">>> "+a),this.forceBinaryWSFrames&&"string"==typeof c&&(c=(new TextEncoder).encode(c)),"string"==typeof c&&this.splitLargeFrames){let e=c;for(;e.length>0;){const t=e.substring(0,this.maxWebSocketChunkSize);e=e.substring(this.maxWebSocketChunkSize),this._webSocket.send(t),this.debug(`chunk sent = ${t.length}, remaining = ${e.length}`)}}else this._webSocket.send(c)}dispose(){if(this.connected)try{const e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt="close-"+this._counter++),this.watchForReceipt(e.receipt,e=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(e)}),this._transmit({command:"DISCONNECT",headers:e})}catch(e){this.debug("Ignoring error during disconnect "+e)}else this._webSocket.readyState!==a.CONNECTING&&this._webSocket.readyState!==a.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)}publish(e){const{destination:t,headers:n,body:r,binaryBody:i,skipContentLengthHeader:o}=e,s=Object.assign({destination:t},n);this._transmit({command:"SEND",headers:s,body:r,binaryBody:i,skipContentLengthHeader:o})}watchForReceipt(e,t){this._receiptWatchers[e]=t}subscribe(e,t,n={}){(n=Object.assign({},n)).id||(n.id="sub-"+this._counter++),n.destination=e,this._subscriptions[n.id]=t,this._transmit({command:"SUBSCRIBE",headers:n});const r=this;return{id:n.id,unsubscribe:e=>r.unsubscribe(n.id,e)}}unsubscribe(e,t={}){t=Object.assign({},t),delete this._subscriptions[e],t.id=e,this._transmit({command:"UNSUBSCRIBE",headers:t})}begin(e){const t=e||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:t}});const n=this;return{id:t,commit(){n.commit(t)},abort(){n.abort(t)}}}commit(e){this._transmit({command:"COMMIT",headers:{transaction:e}})}abort(e){this._transmit({command:"ABORT",headers:{transaction:e}})}ack(e,t,n={}){n=Object.assign({},n),this._connectedVersion===u.V1_2?n.id=e:n["message-id"]=e,n.subscription=t,this._transmit({command:"ACK",headers:n})}nack(e,t,n={}){return n=Object.assign({},n),this._connectedVersion===u.V1_2?n.id=e:n["message-id"]=e,n.subscription=t,this._transmit({command:"NACK",headers:n})}}var l=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class f{constructor(e={}){this.stompVersions=u.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=c.INACTIVE;const t=()=>{};this.debug=t,this.beforeConnect=t,this.onConnect=t,this.onDisconnect=t,this.onUnhandledMessage=t,this.onUnhandledReceipt=t,this.onUnhandledFrame=t,this.onStompError=t,this.onWebSocketClose=t,this.onWebSocketError=t,this.logRawCommunication=!1,this.onChangeState=t,this.connectHeaders={},this._disconnectHeaders={},this.configure(e)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(e){this._disconnectHeaders=e,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===c.ACTIVE}_changeState(e){this.state=e,this.onChangeState(e)}configure(e){Object.assign(this,e)}activate(){if(this.state===c.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(c.ACTIVE),this._connect())}_connect(){return l(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 e=this._createWebSocket();this._stompHandler=new h(this,e,{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:e=>{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(e)},onDisconnect:e=>{this.onDisconnect(e)},onStompError:e=>{this.onStompError(e)},onWebSocketClose:e=>{this._stompHandler=void 0,this.state===c.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(c.INACTIVE)),this.onWebSocketClose(e),this.active&&this._schedule_reconnect()},onWebSocketError:e=>{this.onWebSocketError(e)},onUnhandledMessage:e=>{this.onUnhandledMessage(e)},onUnhandledReceipt:e=>{this.onUnhandledReceipt(e)},onUnhandledFrame:e=>{this.onUnhandledFrame(e)}}),this._stompHandler.start()}))}_createWebSocket(){let e;return e=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions()),e.binaryType="arraybuffer",e}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout(()=>{this._connect()},this.reconnectDelay))}deactivate(){return l(this,void 0,void 0,(function*(){let e;return this.state!==c.ACTIVE?(this.debug(`Already ${c[this.state]}, ignoring call to deactivate`),Promise.resolve()):(this._changeState(c.DEACTIVATING),this._reconnector&&clearTimeout(this._reconnector),this._stompHandler&&this.webSocket.readyState!==a.CLOSED?(e=new Promise((e,t)=>{this._resolveSocketClose=e}),this._disposeStompHandler(),e):(this._changeState(c.INACTIVE),Promise.resolve()))}))}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(e){this._stompHandler.publish(e)}watchForReceipt(e,t){this._stompHandler.watchForReceipt(e,t)}subscribe(e,t,n={}){return this._stompHandler.subscribe(e,t,n)}unsubscribe(e,t={}){this._stompHandler.unsubscribe(e,t)}begin(e){return this._stompHandler.begin(e)}commit(e){this._stompHandler.commit(e)}abort(e){this._stompHandler.abort(e)}ack(e,t,n={}){this._stompHandler.ack(e,t,n)}nack(e,t,n={}){this._stompHandler.nack(e,t,n)}}class d{}class p{}class v{}class g{constructor(e){this.client=e}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(e){this.client.heartbeatOutgoing=e}get incoming(){return this.client.heartbeatIncoming}set incoming(e){this.client.heartbeatIncoming=e}}class m extends f{constructor(e){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new g(this),this.reconnect_delay=0,this.webSocketFactory=e,this.debug=(...e)=>{console.log(...e)}}_parseConnect(...e){let t,n,r,i={};if(e.length<2)throw new Error("Connect requires at least 2 arguments");if("function"==typeof e[1])[i,n,r,t]=e;else switch(e.length){case 6:[i.login,i.passcode,n,r,t,i.host]=e;break;default:[i.login,i.passcode,n,r,t]=e}return[i,n,r,t]}connect(...e){const t=this._parseConnect(...e);t[0]&&(this.connectHeaders=t[0]),t[1]&&(this.onConnect=t[1]),t[2]&&(this.onStompError=t[2]),t[3]&&(this.onWebSocketClose=t[3]),super.activate()}disconnect(e,t={}){e&&(this.onDisconnect=e),this.disconnectHeaders=t,super.deactivate()}send(e,t={},n=""){const r=!1===(t=Object.assign({},t))["content-length"];r&&delete t["content-length"],this.publish({destination:e,headers:t,body:n,skipContentLengthHeader:r})}set reconnect_delay(e){this.reconnectDelay=e}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(e){this.onUnhandledMessage=e}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(e){this.onUnhandledReceipt=e}get heartbeat(){return this._heartbeatInfo}set heartbeat(e){this.heartbeatIncoming=e.incoming,this.heartbeatOutgoing=e.outgoing}}class y{static client(e,t){null==t&&(t=u.default.protocolVersions());return new m(()=>new(y.WebSocketClass||WebSocket)(e,t))}static over(e){let t;return"function"==typeof e?t=e:(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"),t=()=>e),new m(t)}}y.WebSocketClass=null}]));
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
(()=>{var e={2541:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ActivationState:()=>a,Client:()=>f,CompatClient:()=>m,FrameImpl:()=>i,Parser:()=>o,Stomp:()=>g,StompConfig:()=>h,StompHeaders:()=>d,StompSocketState:()=>s,StompSubscription:()=>p,Versions:()=>u});const n="\n";class i{constructor(e){const{command:t,headers:r,body:n,binaryBody:i,escapeHeaderValues:o,skipContentLengthHeader:s}=e;this.command=t,this.headers=Object.assign({},r||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=n||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=s||!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(e,t){const r={},n=e=>e.replace(/^\s+|\s+$/g,"");for(const o of e.headers.reverse()){o.indexOf(":");const s=n(o[0]);let a=n(o[1]);t&&"CONNECT"!==e.command&&"CONNECTED"!==e.command&&(a=i.hdrValueUnEscape(a)),r[s]=a}return new i({command:e.command,headers:r,binaryBody:e.binaryBody,escapeHeaderValues:t})}toString(){return this.serializeCmdAndHeaders()}serialize(){const e=this.serializeCmdAndHeaders();return this.isBinaryBody?i.toUnit8Array(e,this._binaryBody).buffer:e+this._body+"\0"}serializeCmdAndHeaders(){const e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const t of Object.keys(this.headers||{})){const r=this.headers[t];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?e.push(`${t}:${i.hdrValueEscape(`${r}`)}`):e.push(`${t}:${r}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push(`content-length:${this.bodyLength()}`),e.join(n)+n+n}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const e=this.binaryBody;return e?e.length:0}static sizeOfUTF8(e){return e?(new TextEncoder).encode(e).length:0}static toUnit8Array(e,t){const r=(new TextEncoder).encode(e),n=new Uint8Array([0]),i=new Uint8Array(r.length+t.length+n.length);return i.set(r),i.set(t,r.length),i.set(n,r.length+t.length),i}static marshall(e){return new i(e).serialize()}static hdrValueEscape(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(e){return e.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}class o{constructor(e,t){this.onFrame=e,this.onIncomingPing=t,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(e,t=!1){let r;if(r=e instanceof ArrayBuffer?new Uint8Array(e):this._encoder.encode(e),t&&0!==r[r.length-1]){const e=new Uint8Array(r.length+1);e.set(r,0),e[r.length]=0,r=e}for(let e=0;e<r.length;e++){const t=r[e];this._onByte(t)}}_collectFrame(e){0!==e&&13!==e&&(10!==e?(this._onByte=this._collectCommand,this._reinjectByte(e)):this.onIncomingPing())}_collectCommand(e){if(13!==e)return 10===e?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_collectHeaders(e){13!==e&&(10!==e?(this._onByte=this._collectHeaderKey,this._reinjectByte(e)):this._setupCollectBody())}_reinjectByte(e){this._onByte(e)}_collectHeaderKey(e){if(58===e)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(e)}_collectHeaderValue(e){if(13!==e)return 10===e?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_setupCollectBody(){const e=this._results.headers.filter((e=>"content-length"===e[0]))[0];e?(this._bodyBytesRemaining=parseInt(e[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(e){0!==e?this._consumeByte(e):this._retrievedBody()}_collectBodyFixedSize(e){0!=this._bodyBytesRemaining--?this._consumeByte(e):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(e){this._token.push(e)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const e=new Uint8Array(this._token);return this._token=[],e}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var s,a;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(s||(s={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.DEACTIVATING=1]="DEACTIVATING",e[e.INACTIVE=2]="INACTIVE"}(a||(a={}));class u{constructor(e){this.versions=e}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map((e=>`v${e.replace(".","")}.stomp`))}}u.V1_0="1.0",u.V1_1="1.1",u.V1_2="1.2",u.default=new u([u.V1_0,u.V1_1,u.V1_2]);class c{constructor(e,t,r={}){this._client=e,this._webSocket=t,this._serverFrameHandlers={CONNECTED:e=>{this.debug(`connected to server ${e.headers.server}`),this._connected=!0,this._connectedVersion=e.headers.version,this._connectedVersion===u.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(e.headers),this.onConnect(e)},MESSAGE:e=>{const t=e.headers.subscription,r=this._subscriptions[t]||this.onUnhandledMessage,n=e,i=this,o=this._connectedVersion===u.V1_2?n.headers.ack:n.headers["message-id"];n.ack=(e={})=>i.ack(o,t,e),n.nack=(e={})=>i.nack(o,t,e),r(n)},RECEIPT:e=>{const t=this._receiptWatchers[e.headers["receipt-id"]];t?(t(e),delete this._receiptWatchers[e.headers["receipt-id"]]):this.onUnhandledReceipt(e)},ERROR:e=>{this.onStompError(e)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(r)}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}configure(e){Object.assign(this,e)}start(){const e=new o((e=>{const t=i.fromRawFrame(e,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${t}`),(this._serverFrameHandlers[t.command]||this.onUnhandledFrame)(t)}),(()=>{this.debug("<<< PONG")}));this._webSocket.onmessage=t=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const e=t.data instanceof ArrayBuffer?(new TextDecoder).decode(t.data):t.data;this.debug(`<<< ${e}`)}e.parseChunk(t.data,this.appendMissingNULLonIncoming)},this._onclose=e=>{this.debug(`Connection closed to ${this._client.brokerURL}`),this._cleanUp(),this.onWebSocketClose(e)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=e=>{this.onWebSocketError(e)},this._webSocket.onopen=()=>{const e=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),e["accept-version"]=this.stompVersions.supportedVersions(),e["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:e})}}_setupHeartbeat(e){if(e.version!==u.V1_1&&e.version!==u.V1_2)return;if(!e["heart-beat"])return;const[t,r]=e["heart-beat"].split(",").map((e=>parseInt(e,10)));if(0!==this.heartbeatOutgoing&&0!==r){const e=Math.max(this.heartbeatOutgoing,r);this.debug(`send PING every ${e}ms`),this._pinger=setInterval((()=>{this._webSocket.readyState===s.OPEN&&(this._webSocket.send(n),this.debug(">>> PING"))}),e)}if(0!==this.heartbeatIncoming&&0!==t){const e=Math.max(this.heartbeatIncoming,t);this.debug(`check PONG every ${e}ms`),this._ponger=setInterval((()=>{const t=Date.now()-this._lastServerActivityTS;t>2*e&&(this.debug(`did not receive server activity for the last ${t}ms`),this._closeOrDiscardWebsocket())}),e)}}_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 e,t;this._webSocket.terminate||(e=this._webSocket,t=e=>this.debug(e),e.terminate=function(){const e=()=>{};this.onerror=e,this.onmessage=e,this.onopen=e;const r=new Date,n=this.onclose;this.onclose=e=>{const n=(new Date).getTime()-r.getTime();t(`Discarded socket closed after ${n}ms, with code/reason: ${e.code}/${e.reason}`)},this.close(),n.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(e){const{command:t,headers:r,body:n,binaryBody:o,skipContentLengthHeader:s}=e,a=new i({command:t,headers:r,body:n,binaryBody:o,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:s});let u=a.serialize();if(this.logRawCommunication?this.debug(`>>> ${u}`):this.debug(`>>> ${a}`),this.forceBinaryWSFrames&&"string"==typeof u&&(u=(new TextEncoder).encode(u)),"string"==typeof u&&this.splitLargeFrames){let e=u;for(;e.length>0;){const t=e.substring(0,this.maxWebSocketChunkSize);e=e.substring(this.maxWebSocketChunkSize),this._webSocket.send(t),this.debug(`chunk sent = ${t.length}, remaining = ${e.length}`)}}else this._webSocket.send(u)}dispose(){if(this.connected)try{const e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt="close-"+this._counter++),this.watchForReceipt(e.receipt,(e=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(e)})),this._transmit({command:"DISCONNECT",headers:e})}catch(e){this.debug(`Ignoring error during disconnect ${e}`)}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(e){const{destination:t,headers:r,body:n,binaryBody:i,skipContentLengthHeader:o}=e,s=Object.assign({destination:t},r);this._transmit({command:"SEND",headers:s,body:n,binaryBody:i,skipContentLengthHeader:o})}watchForReceipt(e,t){this._receiptWatchers[e]=t}subscribe(e,t,r={}){(r=Object.assign({},r)).id||(r.id="sub-"+this._counter++),r.destination=e,this._subscriptions[r.id]=t,this._transmit({command:"SUBSCRIBE",headers:r});const n=this;return{id:r.id,unsubscribe:e=>n.unsubscribe(r.id,e)}}unsubscribe(e,t={}){t=Object.assign({},t),delete this._subscriptions[e],t.id=e,this._transmit({command:"UNSUBSCRIBE",headers:t})}begin(e){const t=e||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:t}});const r=this;return{id:t,commit(){r.commit(t)},abort(){r.abort(t)}}}commit(e){this._transmit({command:"COMMIT",headers:{transaction:e}})}abort(e){this._transmit({command:"ABORT",headers:{transaction:e}})}ack(e,t,r={}){r=Object.assign({},r),this._connectedVersion===u.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"ACK",headers:r})}nack(e,t,r={}){return r=Object.assign({},r),this._connectedVersion===u.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"NACK",headers:r})}}var l=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class f{constructor(e={}){this.stompVersions=u.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 t=()=>{};this.debug=t,this.beforeConnect=t,this.onConnect=t,this.onDisconnect=t,this.onUnhandledMessage=t,this.onUnhandledReceipt=t,this.onUnhandledFrame=t,this.onStompError=t,this.onWebSocketClose=t,this.onWebSocketError=t,this.logRawCommunication=!1,this.onChangeState=t,this.connectHeaders={},this._disconnectHeaders={},this.configure(e)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(e){this._disconnectHeaders=e,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(e){this.state=e,this.onChangeState(e)}configure(e){Object.assign(this,e)}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 l(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 e=this._createWebSocket();this._stompHandler=new c(this,e,{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:e=>{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(e)},onDisconnect:e=>{this.onDisconnect(e)},onStompError:e=>{this.onStompError(e)},onWebSocketClose:e=>{this._stompHandler=void 0,this.state===a.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(a.INACTIVE)),this.onWebSocketClose(e),this.active&&this._schedule_reconnect()},onWebSocketError:e=>{this.onWebSocketError(e)},onUnhandledMessage:e=>{this.onUnhandledMessage(e)},onUnhandledReceipt:e=>{this.onUnhandledReceipt(e)},onUnhandledFrame:e=>{this.onUnhandledFrame(e)}}),this._stompHandler.start()}))}_createWebSocket(){let e;return e=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions()),e.binaryType="arraybuffer",e}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout((()=>{this._connect()}),this.reconnectDelay))}deactivate(){return l(this,void 0,void 0,(function*(){let e;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?(e=new Promise(((e,t)=>{this._resolveSocketClose=e})),this._disposeStompHandler(),e):(this._changeState(a.INACTIVE),Promise.resolve()))}))}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(e){this._stompHandler.publish(e)}watchForReceipt(e,t){this._stompHandler.watchForReceipt(e,t)}subscribe(e,t,r={}){return this._stompHandler.subscribe(e,t,r)}unsubscribe(e,t={}){this._stompHandler.unsubscribe(e,t)}begin(e){return this._stompHandler.begin(e)}commit(e){this._stompHandler.commit(e)}abort(e){this._stompHandler.abort(e)}ack(e,t,r={}){this._stompHandler.ack(e,t,r)}nack(e,t,r={}){this._stompHandler.nack(e,t,r)}}class h{}class d{}class p{}class v{constructor(e){this.client=e}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(e){this.client.heartbeatOutgoing=e}get incoming(){return this.client.heartbeatIncoming}set incoming(e){this.client.heartbeatIncoming=e}}class m extends f{constructor(e){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new v(this),this.reconnect_delay=0,this.webSocketFactory=e,this.debug=(...e)=>{console.log(...e)}}_parseConnect(...e){let t,r,n,i={};if(e.length<2)throw new Error("Connect requires at least 2 arguments");return"function"==typeof e[1]?[i,r,n,t]=e:6===e.length?[i.login,i.passcode,r,n,t,i.host]=e:[i.login,i.passcode,r,n,t]=e,[i,r,n,t]}connect(...e){const t=this._parseConnect(...e);t[0]&&(this.connectHeaders=t[0]),t[1]&&(this.onConnect=t[1]),t[2]&&(this.onStompError=t[2]),t[3]&&(this.onWebSocketClose=t[3]),super.activate()}disconnect(e,t={}){e&&(this.onDisconnect=e),this.disconnectHeaders=t,super.deactivate()}send(e,t={},r=""){const n=!1===(t=Object.assign({},t))["content-length"];n&&delete t["content-length"],this.publish({destination:e,headers:t,body:r,skipContentLengthHeader:n})}set reconnect_delay(e){this.reconnectDelay=e}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(e){this.onUnhandledMessage=e}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(e){this.onUnhandledReceipt=e}get heartbeat(){return this._heartbeatInfo}set heartbeat(e){this.heartbeatIncoming=e.incoming,this.heartbeatOutgoing=e.outgoing}}class g{static client(e,t){return null==t&&(t=u.default.protocolVersions()),new m((()=>new(g.WebSocketClass||WebSocket)(e,t)))}static over(e){let t;return"function"==typeof e?t=e:(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"),t=()=>e),new m(t)}}g.WebSocketClass=null},6551:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>J}),console.log("BUILD/SERIOUSLY.MODULE");let n,i,o,s,a,u,c,l={},f={},h={},d={},p=[],v={},m={},g={canvas:[],image:[],video:[]},y={},b=window.WeakMap&&new WeakMap,_=0,w=function(){},S={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]},E=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,T=/^#(([0-9a-fA-F]{3,8}))/,O=["x","y","z","w"],C=["r","g","b","a"],x={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},P=["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(e,t,r,n,i,o,s){s||(s=M.create());var a=t-e,u=n-r,c=o-i;return s[0]=2*i/a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/u,s[6]=0,s[7]=0,s[8]=(t+e)/a,s[9]=(n+r)/u,s[10]=-(o+i)/c,s[11]=-1,s[12]=0,s[13]=0,s[14]=-o*i*2/c,s[15]=0,s},perspective:function(e,t,r,n,i){var o=r*Math.tan(e*Math.PI/360),s=o*t;return M.frustum(-s,s,-o,o,r,n,i)},multiply:function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],v=t[12],m=t[13],g=t[14],y=t[15],b=r[0],_=r[1],w=r[2],S=r[3];return e[0]=b*n+_*a+w*f+S*v,e[1]=b*i+_*u+w*h+S*m,e[2]=b*o+_*c+w*d+S*g,e[3]=b*s+_*l+w*p+S*y,b=r[4],_=r[5],w=r[6],S=r[7],e[4]=b*n+_*a+w*f+S*v,e[5]=b*i+_*u+w*h+S*m,e[6]=b*o+_*c+w*d+S*g,e[7]=b*s+_*l+w*p+S*y,b=r[8],_=r[9],w=r[10],S=r[11],e[8]=b*n+_*a+w*f+S*v,e[9]=b*i+_*u+w*h+S*m,e[10]=b*o+_*c+w*d+S*g,e[11]=b*s+_*l+w*p+S*y,b=r[12],_=r[13],w=r[14],S=r[15],e[12]=b*n+_*a+w*f+S*v,e[13]=b*i+_*u+w*h+S*m,e[14]=b*o+_*c+w*d+S*g,e[15]=b*s+_*l+w*p+S*y,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},A=(N=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){var t,r,n;return t=(new Date).getTime(),r=Math.max(0,16-(t-N)),n=window.setTimeout((function(){e(t+r)}),r),N=t+r,n}),j=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(e){window.cancelTimeout(e)},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 L(e,t){var r,n;if("string"==typeof e)r=document.querySelector(e);else if(!e)return!1;return e.tagName&&(r=e),r?(n=r.tagName.toLowerCase(),t&&t.indexOf(n)<0?e:r):e}function F(e,t){var r,n;for(r in e.prototype&&t.prototype&&e.prototype!==t.prototype&&F(e.prototype,t.prototype),t)t.hasOwnProperty(r)&&((n=Object.getOwnPropertyDescriptor(t,r)).get||n.set?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:n.get,set:n.set}):e[r]=t[r]);return e}function U(e){var t;if(!console)return w;if("function"==typeof console[e])t=console[e];else{if("function"!=typeof console.log)return w;t=console.log}return t.bind?t.bind(console):function(){t.apply(console,arguments)}}function B(e,t){if(t||(t="HTMLElement"),e instanceof window[t])return!0;if(!e||"object"!=typeof e)return!1;for(;e;)if((e=Object.getPrototypeOf(e))&&e.constructor.name===t)return!0;return!1}function W(e,t,r,n,i){function o(e,t,r){return(r%=1)<0&&(r+=1),r<1/6?e+(t-e)*r*6:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var s,a;return s=2*r-(a=r<.5?r*(t+1):r+t-r*t),i||(i=[]),i[0]=o(s,a,e+1/3),i[1]=o(s,a,e),i[2]=o(s,a,e-1/3),i[3]=n,i}function V(e){var t,r,n,i="#",o=e[3]<1?4:3;for(t=0;t<o;t++)n=(r=Math.min(255,Math.round(255*e[t]||0))).toString(16),r<16&&(n="0"+n),i+=n;return i}function q(e){return Array.isArray(e)||e&&e.BYTES_PER_ELEMENT&&"length"in e}function z(e){if("function"!=typeof e)throw new Error("setTimeoutZero argument is not a function");p.push(e),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout((function(){p.length&&p.shift()()}),0)}function H(e,t){var r;try{r=window.WebGLDebugUtils&&t&&t.debugContext?window.WebGLDebugUtils.makeDebugContext(e.getContext("webgl",t)):e.getContext("webgl",t)}catch(e){}if(!r)try{r=e.getContext("experimental-webgl",t)}catch(e){}return r}function G(){var e;return n&&n.getError()===n.CONTEXT_LOST_WEBGL&&(n=void 0),n||!window.WebGLRenderingContext||o||(e=document.createElement("canvas"),n=H(e),n?e.addEventListener("webglcontextlost",(function t(r){r.preventDefault(),n&&n.canvas===this&&(n=void 0,e.removeEventListener("webglcontextlost",t,!1))}),!1):X.logger.warn("Unable to access WebGL.")),n}function $(e){var t,r,n;function i(e,n){var i,o;q(e)?(i=e[0],o=e[1]||i):i=e,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),r[i]=o,n||(t.firstValue=i)}function o(e){return e}for(n in e.inputs)if(e.inputs.hasOwnProperty(n)){if(e.reserved.indexOf(n)>=0||Object.prototype[n])throw new Error("Reserved input name: "+n);(t=e.inputs[n]).name=n,isNaN(t.min)&&(t.min=-1/0),isNaN(t.max)&&(t.max=1/0),isNaN(t.minCount)&&(t.minCount=-1/0),isNaN(t.maxCount)&&(t.maxCount=1/0),isNaN(t.step)&&(t.step=0),isNaN(t.mod)&&(t.mod=0),"enum"===t.type&&t.options&&q(t.options)&&t.options.length&&(r={},t.options.forEach(i),t.options=r),"vector"===t.type?t.dimensions<2?t.dimensions=2:t.dimensions>4||!t.dimensions||isNaN(t.dimensions)?t.dimensions=4:t.dimensions=Math.round(t.dimensions):t.dimensions=1,t.shaderDirty=!!t.shaderDirty,"function"!=typeof t.validate&&(t.validate=X.inputValidators[t.type]||o),e.defaultImageInput||"image"!==t.type||(e.defaultImageInput=n)}}function Y(e,t,r,n){var i,o,s,a;!0===n||n&&n.useFloat,this.type=e.UNSIGNED_BYTE,i=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,i),n&&n.texture?(this.texture=n.texture,e.bindTexture(e.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===e.FLOAT?(s=new Float32Array(t*r*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.FLOAT,s)):(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),this.type=e.UNSIGNED_BYTE)}catch(n){this.type=e.UNSIGNED_BYTE,s=new Uint8Array(t*r*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,s)}if(o=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0),(a=e.checkFramebufferStatus(e.FRAMEBUFFER))===e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(a===e.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(a!==e.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+a);e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),this.gl=e,this.frameBuffer=i,this.renderBuffer=o,this.width=t,this.height=r}function K(e,t,r){var n,i,o,s,a,u,c,l,f="";function h(t,r){var n,i;if(n=r?e.createShader(e.FRAGMENT_SHADER):e.createShader(e.VERTEX_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){for(t=t.split(/[\n\r]/),i=0;i<t.length;i++)t[i]=i+1+":\t"+t[i];throw t.unshift("Error compiling "+(r?"fragment":"vertex")+" shader:"),X.logger.error(t.join("\n")),new Error("Shader error: "+e.getShaderInfoLog(n))}return n}function d(t,r){if(t.type===e.SAMPLER_2D)return function(n){t.glTexture=e["TEXTURE"+n],e.uniform1i(r,n)};if(t.type===e.BOOL||t.type===e.INT)return t.size>1?function(t){e.uniform1iv(r,t)}:function(t){e.uniform1i(r,t)};if(t.type===e.FLOAT)return t.size>1?function(t){e.uniform1fv(r,t)}:function(t){e.uniform1f(r,t)};if(t.type===e.FLOAT_VEC2)return function(t){e.uniform2f(r,t[0],t[1])};if(t.type===e.FLOAT_VEC3)return function(t){e.uniform3f(r,t[0],t[1],t[2])};if(t.type===e.FLOAT_VEC4)return function(t){e.uniform4f(r,t[0],t[1],t[2],t[3])};if(t.type===e.FLOAT_MAT3)return function(t){e.uniformMatrix3fv(r,!1,t)};if(t.type===e.FLOAT_MAT4)return function(t){e.uniformMatrix4fv(r,!1,t)};throw new Error("Unknown shader uniform type: "+t.type)}function p(t){return function(){return e.getUniform(n,t)}}if(i=h(t),o=h(r,!0),n=e.createProgram(),e.attachShader(n,i),(s=e.getShaderInfoLog(i))&&(f+="Vertex shader error: "+s+"\n"),e.attachShader(n,o),(s=e.getShaderInfoLog(o))&&(f+="Fragment shader error: "+s+"\n"),e.linkProgram(n),!e.getProgramParameter(n,e.LINK_STATUS))throw f+=e.getProgramInfoLog(n),e.deleteProgram(n),e.deleteShader(i),e.deleteShader(o),(c=R.exec(t)||R.exec(r))&&(f="Shader = "+c[1]+"\n"+f),P.forEach((function(t){f+="\n"+t+": "+e.getParameter(e[t])})),new Error("Could not initialize shader:\n"+f);for(e.useProgram(n),this.uniforms={},u=e.getProgramParameter(n,e.ACTIVE_UNIFORMS),a=0;a<u;++a)(l={info:e.getActiveUniform(n,a)}).name=l.info.name.replace(/\[0\]$/,""),l.loc=e.getUniformLocation(n,l.name),l.set=d(l.info,l.loc),l.get=p(l.loc),this.uniforms[l.name]=l,this[l.name]||(this[l.name]=l);for(this.attributes={},this.location={},u=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),a=0;a<u;++a)(l={info:e.getActiveAttrib(n,a)}).name=l.info.name,l.location=e.getAttribLocation(n,l.name),this.attributes[l.name]=l,this.location[l.name]=l.location;this.gl=e,this.program=n,this.destroy=function(){var t;for(t in e&&(e.deleteProgram(n),e.deleteShader(i),e.deleteShader(o)),this)this.hasOwnProperty(t)&&delete this[t];n=null,i=null,o=null}}function X(e){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(e);var t,r,n,i,o,a,p,y,S,E,T,O,C,P,k,I=++_,N=this,U=[],W={},q=0,G=[],J=[],Z=[],Q=[],ee={},te=[],re=[],ne={},ie={},oe=!1,se=!1;function ae(e,t){var r,n,i;return!!t&&(r=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,e.vertices,t.STATIC_DRAW),r.size=3,n=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.indices,t.STATIC_DRAW),i=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,i),t.bufferData(t.ARRAY_BUFFER,e.coords,t.STATIC_DRAW),i.size=2,{vertex:r,index:n,texCoord:i,length:e.indices.length,mode:e.mode||t.TRIANGLES})}function ue(e){var t={};return t.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),t.indices=new Uint16Array([0,1,2,0,2,3]),t.coords=new Float32Array([0,0,1,0,1,1,0,1]),ae(t,e)}function ce(e){var n,s;if(!r)if(e.canvas.addEventListener("webglcontextlost",fe,!1),e.canvas.addEventListener("webglcontextrestored",le,!1),e.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(r=e,t=e.canvas,i=ue(r),o=new K(r,"#define SHADER_NAME seriously.base\n"+u,"#define SHADER_NAME seriously.base\n"+c),n=0;n<Q.length;n++)(s=Q[n]).gl=r,s.initialize(),s.buildShader();for(n=0;n<G.length;n++)(s=G[n]).initialize();for(n=0;n<J.length;n++)(s=J[n]).model||(s.model=i,s.shader=o)}}function le(){var e,t,i,o;if(n&&!r){if(B(t=n.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(e=H(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:n.debugContext})){if(e.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ce(e),n.renderToTexture?n.frameBuffer=new Y(r,n.width,n.height,!1):n.frameBuffer={frameBuffer:null},i=0;i<U.length;i++)(o=U[i]).setDirty(),o.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function fe(e){var n,s;for(e&&(X.logger.warn("WebGL context lost"),e.preventDefault()),k&&(j(k),k=0),t&&t.removeEventListener("webglcontextlost",fe,!1),n=0;n<Q.length;n++)(s=Q[n]).gl=null,s.initialized=!1,s.baseShader=null,s.model=null,s.frameBuffer=null,s.texture=null,s.shader&&s.shader.destroy&&(s.shader.destroy(),s.effect.commonShader&&delete ie[s.hook]),s.shaderDirty=!0,s.shader=null,s.effect.lostContext&&s.effect.lostContext.call(s),e&&s.emit("webglcontextlost");for(n=0;n<G.length;n++)(s=G[n]).texture=null,s.initialized=!1,s.allowRefresh=!1,e&&s.emit("webglcontextlost");for(n=0;n<Z.length;n++)(s=Z[n]).frameBuffer=null,s.texture=null,e&&s.emit("webglcontextlost");for(n=0;n<J.length;n++)(s=J[n]).model=!1,s.frameBuffer=null,e&&s.emit("webglcontextlost");o&&o.destroy&&o.destroy(),r&&(r.deleteBuffer(i.vertex),r.deleteBuffer(i.texCoord),r.deleteBuffer(i.index)),i&&(delete i.vertex,delete i.texCoord,delete i.index),i=null,o=null,r=null,t=null}function he(e){var t,r,n=!1;if(k=0,te.length)for(n=!0,t=0;t<te.length;t++)te[t].call(N,e);if(G&&G.length)for(n=!0,t=0;t<G.length;t++)((r=G[t]).dirty||r.checkDirty&&r.checkDirty())&&(r.dirty=!1,r.setDirty());for(t=0;t<J.length;t++)(r=J[t]).auto&&r.dirty&&r.render();if(re.length)for(n=!0,t=0;t<re.length;t++)re[t].call(N);n&&!k&&(k=A(he))}function de(e,t,n,i,o,s){var a,u,c,l,f,h,d,v,m,g=0,b=o&&o.gl||r;if(b){for(a in o?(l=s&&s.width||o.width||b.canvas.width,f=s&&s.height||o.height||b.canvas.height):(l=s&&s.width||b.canvas.width,f=s&&s.height||b.canvas.height),e.use(),b.viewport(0,0,l,f),b.bindFramebuffer(b.FRAMEBUFFER,i),b.enableVertexAttribArray(e.location.position),b.enableVertexAttribArray(e.location.texCoord),t.texCoord&&(b.bindBuffer(b.ARRAY_BUFFER,t.texCoord),b.vertexAttribPointer(e.location.texCoord,t.texCoord.size,b.FLOAT,!1,0,0)),b.bindBuffer(b.ARRAY_BUFFER,t.vertex),b.vertexAttribPointer(e.location.position,t.vertex.size,b.FLOAT,!1,0,0),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,t.index),s&&s.depth?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),s?void 0===s.blend||s.blend?(r.enable(r.BLEND),h=void 0===s.srcRGB?r.ONE:s.srcRGB,v=s.dstRGB||r.ZERO,d=void 0===s.srcAlpha?h:s.srcAlpha,m=void 0===s.dstAlpha?v:s.dstAlpha,r.blendFuncSeparate(h,v,d,m),r.blendEquation(s.blendEquation||r.FUNC_ADD)):r.disable(r.BLEND):(r.enable(r.BLEND),r.blendFunc(r.ONE,r.ZERO),r.blendEquation(r.FUNC_ADD)),n)n.hasOwnProperty(a)&&(u=n[a],(c=e.uniforms[a])&&(B(u,"WebGLTexture")?(b.activeTexture(b.TEXTURE0+g),b.bindTexture(b.TEXTURE_2D,u),c.set(g),g++):u instanceof p||u instanceof y||u instanceof S?u.texture&&(b.activeTexture(b.TEXTURE0+g),b.bindTexture(b.TEXTURE_2D,u.texture),c.set(g),g++):null!=u&&c.set(u)));s&&void 0!==s.clear&&!s.clear||(b.clearColor(0,0,0,0),b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)),b.drawElements(t.mode,t.length,b.UNSIGNED_SHORT,0),r.enable(r.DEPTH_TEST)}}function pe(e,t,r){var n,i;if(("string"!=typeof e||!t&&0!==t)&&(r&&"object"==typeof r||(r=t),t=e),"string"==typeof e&&h[e]||(e=null),t instanceof p||t instanceof y||t instanceof S)n=t;else if(t instanceof T||t instanceof O||t instanceof C){if(!(n=W[t.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),i=0;i<G.length;i++)if(n=G[i],(!e||e===n.hook)&&n.compare&&n.compare(t,r))return n;n=new p(e,t,r)}return n}function ve(e,t){var r,n,i;if(!(e instanceof y||e instanceof S))return!1;if(e===t)return!0;for(r in i=e.sources)if(i.hasOwnProperty(r)&&((n=i[r])===t||ve(n,t)))return!0;return!1}(a=function(){this.ready=!1,this.width=1,this.height=1,this.gl=r,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 e;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},a.prototype.setUnready=function(){var e;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setUnready()},a.prototype.setDirty=function(){var e;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setDirty()},a.prototype.initFrameBuffer=function(e){r&&(this.frameBuffer=new Y(r,this.width,this.height,e))},a.prototype.readPixels=function(e,t,n,i,o){var s=this.gl||r;if(!r)throw new Error("Cannot read pixels until a canvas is connected");if(this.frameBuffer||(this.initFrameBuffer(),this.setDirty()),this.render(),void 0===o)o=new Uint8Array(n*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,n,i,r.RGBA,r.UNSIGNED_BYTE,o),o},a.prototype.resize=function(){var e,t;this.source?(e=this.source.width,t=this.source.height):this.sources&&this.sources.source?(e=this.sources.source.width,t=this.sources.source.height):this.inputs&&this.inputs.width?(e=this.inputs.width,t=this.inputs.height||e):this.inputs&&this.inputs.height?e=t=this.inputs.height:(e=1,t=1),e=Math.floor(e),t=Math.floor(t),this.width===e&&this.height===t||(this.width=e,this.height=t,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=t),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,t)},a.prototype.on=function(e,t){var r,n=-1;e&&"function"==typeof t&&((r=this.listeners[e])?n=r.indexOf(t):r=this.listeners[e]=[],n<0&&r.push(t))},a.prototype.off=function(e,t){var r,n=-1;e&&"function"==typeof t&&(r=this.listeners[e])&&(n=r.indexOf(t))>=0&&r.splice(n,1)},a.prototype.emit=function(e){var t,r=this.listeners[e];if(r&&r.length)for(t=0;t<r.length;t++)z(r[t])},a.prototype.destroy=function(){var e,t;for(t in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];for(e in this.uniforms)this.uniforms.hasOwnProperty(e)&&delete this.uniforms[e];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(e=U.indexOf(this))>=0&&U.splice(e,1),delete W[this.id],this.isDestroyed=!0},T=function(e){var t,r=e;function n(e,t){var n,i,o;return o=r.effect.inputs[e],n=r.inputElements[e],"string"==typeof t&&isNaN(t)&&("enum"===o.type?o.options.hasOwnProperty(t)||(t=L(t,["select"])):"number"===o.type||"boolean"===o.type?t=L(t,["input","select"]):"image"===o.type&&(t=L(t,["canvas","img","video"]))),B(t,"HTMLInputElement")||B(t,"HTMLSelectElement")?(i=t.value,n&&n.element!==t&&(n.element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0),delete r.inputElements[e],n=null),n||(n={element:t,listener:function(e,n){return function(){var i,s;i="checkbox"===t.type?t.checked:n.value,s=r.setInput(e,i),"color"===o.type&&(s=V(s).substr(0,7)),s!==i&&(n.value=s)}}(e,t)},r.inputElements[e]=n,"range"===t.type?(t.addEventListener("input",n.listener,!0),t.addEventListener("change",n.listener,!0)):t.addEventListener("change",n.listener,!0)),n&&"checkbox"===t.type&&(i=t.checked)):(n&&(n.element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0),delete r.inputElements[e]),i=t),r.setInput(e,i),r.inputs[e]}function i(e){return function(t){var r=n(e,t);return r&&r.pub}}function o(e){return function(){var t=r.inputs[e];return t&&t.pub}}function s(e){return function(t){return n(e,t)}}function a(e){return function(){return r.inputs[e]}}for(t in r.effect.inputs)if(r.effect.inputs.hasOwnProperty(t)){if(void 0!==this[t])throw new Error("Cannot overwrite Seriously."+t);"image"===r.effect.inputs[t].type?Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:o(t),set:i(t)}):Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:a(t),set:s(t)})}Object.defineProperties(this,{effect:{enumerable:!0,configurable:!0,get:function(){return r.hook}},title:{enumerable:!0,configurable:!0,get:function(){return r.effect.title||r.hook}},width:{enumerable:!0,configurable:!0,get:function(){return r.width}},height:{enumerable:!0,configurable:!0,get:function(){return r.height}},id:{enumerable:!0,configurable:!0,get:function(){return r.id}}}),this.render=function(){return r.render(),this},this.readPixels=function(e,t,n,i,o){return r.readPixels(e,t,n,i,o)},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)},this.inputs=function(e){var t,n,i,o;if(i=r.effect.inputs,e)return(n=i[e])?(t={type:n.type,defaultValue:n.defaultValue,title:n.title||e},"number"===n.type?(t.min=n.min,t.max=n.max,t.step=n.step,t.mod=n.mod):"enum"===n.type?t.options=F({},n.options):"vector"===n.type&&(t.dimensions=n.dimensions),n.description&&(t.description=n.description),t):null;for(o in t={},i)i.hasOwnProperty(o)&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return r.alias(e,t),this},this.matte=function(e){r.matte(e)},this.destroy=function(){var e,t;for(e in r.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return r.isDestroyed},this.isReady=function(){return r.ready}},y=function(e,t){var n,i,o,u,c={};for(n in a.call(this,t),this.gl=r,this.effectRef=l[e],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=e,this.options=t,this.transform=null,this.effect=F({},this.effectRef),this.effectRef.definition&&F(this.effect,this.effectRef.definition.call(this,t)),$(this.effect),this.uniforms.transform=s,this.inputs={},u=ne[e],this.effect.inputs)this.effect.inputs.hasOwnProperty(n)&&(void 0!==(i=this.effect.inputs[n]).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)),o=i.validate.call(this,i.defaultValue,i),u&&void 0!==u[n]&&(o=i.validate.call(this,u[n],i,i.defaultValue,o),u[n]=o,"image"===i.type&&(c[n]=o)),this.inputs[n]=o,i.uniform&&(this.uniforms[i.uniform]=i.defaultValue));for(n in r&&(this.initialize(),this.effect.commonShader&&this.buildShader()),this.updateReady(),this.inPlace=this.effect.inPlace,this.pub=new T(this),U.push(this),W[this.id]=this,Q.push(this),v[e].push(this),c)c.hasOwnProperty(n)&&this.setInput(n,c[n])},y.prototype=Object.create(a.prototype),y.prototype.constructor=y,y.prototype.initialize=function(){if(!this.initialized){var e=this;this.baseShader=o,this.shape?this.model=ae(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,(function(){e.initFrameBuffer(!0)}),r):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},y.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize()},y.prototype.updateReady=function(){var e,t,r,n,i=!0;for(t in(r=this.effect).inputs)if(r.inputs.hasOwnProperty(t)&&"image"===this.effect.inputs[t].type&&(!this.sources[t]||!this.sources[t].ready)&&(!r.requires||r.requires.call(this,t,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),n=i?"setReady":"setUnready",this.targets))for(e=0;e<this.targets.length;e++)this.targets[e][n]()},y.prototype.setReady=y.prototype.updateReady,y.prototype.setUnready=y.prototype.updateReady,y.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},y.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},y.prototype.removeSource=function(e){var t,r=e&&e.pub;for(t in this.inputs)!this.inputs.hasOwnProperty(t)||this.inputs[t]!==e&&this.inputs[t]!==r||(this.inputs[t]=null);for(t in this.sources)!this.sources.hasOwnProperty(t)||this.sources[t]!==e&&this.sources[t]!==r||(this.sources[t]=null)},y.prototype.buildShader=function(){var e,t=this.effect,n=this;function i(e){return R.test(e)?e:"#define SHADER_NAME seriously."+n.hook+"\n"+e}this.shaderDirty&&(t.commonShader&&ie[this.hook]?(this.shader||ie[this.hook].count++,this.shader=ie[this.hook].shader):t.shader?(this.shader&&!t.commonShader&&this.shader.destroy(),(e=t.shader.call(this,this.inputs,{vertex:u,fragment:c},X.util))instanceof K?this.shader=e:e&&e.vertex&&e.fragment?this.shader=new K(r,i(e.vertex),i(e.fragment)):this.shader=o,t.commonShader&&(ie[this.hook]={count:1,shader:this.shader})):this.shader=o,this.shaderDirty=!1)},y.prototype.render=function(){var e,t,n,i=this.effect,o=this;if(r){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(e in this.sources)!this.sources.hasOwnProperty(e)||i.requires&&!i.requires.call(this,e,this.inputs)||(n="function"==typeof this.inPlace?this.inPlace(e):this.inPlace,this.sources[e].render(!n));this.frameBuffer&&(t=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,t,(function(e,t,r,n,i,s){de(e,t,r,n,i||o,s)})),this.emit("render")):t&&(de(this.shader,this.model,this.uniforms,t,this),this.emit("render")),this.dirty=!1}return this.texture}},y.prototype.setInput=function(e,t){var r,n,i,o,a,u=this;if(this.effect.inputs.hasOwnProperty(e)){if("image"===(r=this.effect.inputs[e]).type){if(t){if((t=pe(t))!==this.sources[e]){if(function(){var t,r=u.sources[e];if(r){for(t in u.sources)if(t!==e&&u.sources.hasOwnProperty(t)&&u.sources[t]===r)return;r.removeTarget(u)}}(),ve(t,this))throw new Error("Attempt to make cyclical connection.");this.sources[e]=t,t.addTarget(this)}}else delete this.sources[e],t=!1;n=this.sources[e],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(o=this.sources[i[0]],this.uniforms.transform=o&&o.cumulativeMatrix||s):this.uniforms.transform=s}else a=ne[this.hook]&&void 0!==ne[this.hook][e]?ne[this.hook][e]:r.defaultValue,n=t=r.validate.call(this,t,r,a,this.inputs[e]);return this.inputs[e]===t&&"color"!==r.type&&"vector"!==r.type||(this.inputs[e]=t,r.uniform&&(this.uniforms[r.uniform]=n),"image"===r.type?(this.resize(),this.updateReady()):r.updateSources&&this.updateReady(),r.shaderDirty&&(this.shaderDirty=!0),this.setDirty(),r.update&&r.update.call(this,t)),t}},y.prototype.alias=function(e,t){var r=this;if(D.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(e)&&(t||(t=e),N.removeAlias(t),ee[t]={node:this,input:e},Object.defineProperty(N,t,{configurable:!0,enumerable:!0,get:function(){return r.inputs[e]},set:function(t){return r.setInput(e,t)}})),this},y.prototype.matte=function(e){var t,r,n,i,o,s,a,u=[],c=[],l={};function f(e){var t,r,n,i,o,s,a,l,f,h,d,p=[];if(!e.simple){for(t=0;t<e.edges.length;t++)for(n=e.edges[t],r=t+1;r<e.edges.length;r++)i=e.edges[r],v=n[0],m=n[1],g=i[0],void 0,void 0,void 0,S=void 0,E=void 0,b=((y=i[1]).x-g.x)*(v.y-g.y)-(y.y-g.y)*(v.x-g.x),_=(m.x-v.x)*(v.y-g.y)-(m.y-v.y)*(v.x-g.x),(o=!!((w=(y.y-g.y)*(m.x-v.x)-(y.x-g.x)*(m.y-v.y))&&(E=_/w,(S=b/w)>0&&S<=1&&E>0&&E<=1))&&{x:v.x+S*(m.x-v.x),y:v.y+S*(m.y-v.y)})&&(o.edge1=n,o.edge2=i,p.push(o));var v,m,g,y,b,_,w,S,E;if(p.length){for(f=[],t=0;t<p.length;t++)n=(o=p[t]).edge1,i=o.edge2,h={x:o.x,y:o.y,prev:n[0],next:i[1],id:c.length},e.vertices.push(h),c.push(h),d={x:o.x,y:o.y,prev:i[0],next:n[1],id:c.length},e.vertices.push(d),c.push(h),h.prev.next=h,h.next.prev=h,d.prev.next=d,d.next.prev=d;do{s={edges:[],vertices:[],simple:!0},f.push(s),a=l=e.vertices[0];do{t=e.vertices.indexOf(l),e.vertices.splice(t,1),s.edges.push([l,l.next]),s.vertices.push(l),l=l.next}while(l!==a)}while(e.vertices.length);for(t=u.indexOf(e),u.splice(t,1),t=0;t<f.length;t++)u.push(f[t])}else e.simple=!0}}function h(e){var t,r,n,i,o=e.vertices.length,s=0;for(t=o-1,r=0;r<o;t=r,r++)n=e.vertices[t],i=e.vertices[r],s+=n.x*i.y-i.x*n.y;return s>0}function d(e){var t,n,i,o,s,a,u,c,l,f,h,d=e.vertices,p=[],v=[];function m(e,t,r,n){var i,o,s,a,u,c,l,f,h,d,p,v;return i=r.x-t.x,o=r.y-t.y,s=e.x-r.x,a=e.y-r.y,u=t.x-e.x,c=t.y-e.y,l=n.x-e.x,f=n.y-e.y,h=n.x-t.x,d=n.y-t.y,p=n.x-r.x,v=n.y-r.y,i*d-o*h>=0&&s*v-a*p>=0&&u*f-c*l>=0}function g(e,t,r,n,i){var o,s,a,u;if(s=d[i[e]],a=d[i[t]],u=d[i[r]],0>(a.x-s.x)*(u.y-s.y)-(a.y-s.y)*(u.x-s.x))return!1;for(o=0;o<n;o++)if(o!==e&&o!==t&&o!==r&&m(s,a,u,d[i[o]]))return!1;return!0}if(n=d.length,e.clockWise)for(t=0;t<n;t++)p[t]=t;else for(t=0;t<n;t++)p[t]=n-1-t;for(o=2*(i=n),t=i-1;i>2;){if(o--<=0)return v;if(i<=(s=t)&&(s=0),i<=(t=s+1)&&(t=0),i<(a=t+1)&&(a=0),g(s,t,a,i,p)){for(u=p[s],c=p[t],l=p[a],e.clockWise?(v.push(d[u]),v.push(d[c]),v.push(d[l])):(v.push(d[l]),v.push(d[c]),v.push(d[u])),f=t,h=t+1;h<i;f++,h++)p[f]=p[h];o=2*--i}}r.indices=v}for(t=function(e){return e&&e.length&&Array.isArray(e)?Array.isArray(e[0])?Array.isArray(e[0])&&!isNaN(e[0][0])?[e]:e:[e]:[]}(e),n=0;n<t.length;n++){for(e=t[n],a=null,r={vertices:[],edges:[]},i=0;i<e.length;i++)"object"!=typeof(o=e[i])||isNaN(o.x)||isNaN(o.y)?o.length>=2&&!isNaN(o[0])&&!isNaN(o[1])&&(s={x:o[0],y:o[1],id:c.length}):s={x:o.x,y:o.y,id:c.length},s&&(a?(a.next=s,s.prev=a,s.next=r.vertices[0],r.vertices[0].prev=s):(r.head=s,s.next=s,s.prev=s),c.push(s),r.vertices.push(s),a=s);if(r.vertices.length>2)for(3===r.vertices.length&&(r.simple=!0),u.push(r),i=0;i<r.vertices.length;i++)s=r.vertices[i],r.edges.push([s,s.next])}for(n=u.length-1;n>=0;n--)f(r=u[n]);for(n=0;n<u.length;n++)(r=u[n]).clockWise=h(r),d(r);for(l.vertices=[],l.coords=[],n=0;n<c.length;n++)o=c[n],l.vertices.push(2*o.x-1),l.vertices.push(-2*o.y+1),l.vertices.push(-1),l.coords.push(o.x),l.coords.push(-1*o.y+1);for(l.vertices=new Float32Array(l.vertices),l.coords=new Float32Array(l.coords),l.indices=[],n=0;n<u.length;n++)for(r=u[n],i=0;i<r.indices.length;i++)o=r.indices[i],l.indices.push(o.id);l.indices=new Uint16Array(l.indices),this.shape=l,this.gl&&ae(l,this.gl)},y.prototype.destroy=function(){var e,t,r,n=this.hook;for(t in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,ie[n]&&(ie[n].count--,ie[n].count||delete ie[n]),this.shader&&this.shader.destroy&&this.shader!==o&&!ie[n]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(t)&&((r=this.inputElements[t]).element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0));for(t in this.sources)this.sources.hasOwnProperty(t)&&((r=this.sources[t])&&r.removeTarget&&r.removeTarget(this),delete this.sources[t]);for(;this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(r=ee[t]).node===this&&N.removeAlias(t);(e=Q.indexOf(this))>=0&&Q.splice(e,1),(e=v[n].indexOf(this))>=0&&v[n].splice(e,1),a.prototype.destroy.call(this)},O=function(e){var t=e;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return t.source}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}},width:{enumerable:!0,configurable:!0,get:function(){return t.width}},height:{enumerable:!0,configurable:!0,get:function(){return t.height}}}),this.render=function(){t.render()},this.update=function(){t.setDirty()},this.readPixels=function(e,r,n,i,o){return t.readPixels(e,r,n,i,o)},this.on=function(e,r){t.on(e,r)},this.off=function(e,r){t.off(e,r)},this.destroy=function(){var e,r;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((r=Object.getOwnPropertyDescriptor(this,e)).get||r.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},p=function(e,t,n){var i,o,s=n||{},u=void 0===s.flip||s.flip,c=s.width,l=s.height,f=!1,d=this,p=!1;function v(e,t,r,n){var i=h[e];if(i.definition){if(!(i=i.definition.call(d,t,r,n)))return null;i=F(F({},h[e]),i)}return i}function m(e){return d.source===e}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(n&&"object"==typeof n||(n=t),t=e),"string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),"string"==typeof e&&h[e]&&(o=v(e,t,n,!0))&&(this.hook=e,p=!0,f=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source)),!o&&B(t))"CANVAS"===t.tagName?(this.width=t.width,this.height=t.height,this.render=this.renderImageCanvas,p=!0,this.hook="canvas",this.compare=m):"IMG"===t.tagName&&(this.width=t.naturalWidth||1,this.height=t.naturalHeight||1,t.complete&&t.naturalWidth||(f=!0),t.addEventListener("load",(function(){d.isDestroyed||(d.width===t.naturalWidth&&d.height===t.naturalHeight||(d.width=t.naturalWidth,d.height=t.naturalHeight,d.resize()),d.setDirty(),d.setReady())}),!0),this.render=this.renderImageCanvas,p=!0,this.hook="image",this.compare=m);else if(!o&&B(t,"WebGLTexture")){if(r&&!r.isTexture(t))throw new Error("Not a valid WebGL texture.");isNaN(c)?isNaN(l)||(c=l):isNaN(l)&&(l=c),this.width=c,this.height=l,void 0===s.flip&&(u=!1),p=!0,this.texture=t,this.initialized=!0,this.hook="texture",this.compare=m,this.render=function(){}}if(!p&&!o)for(i in h)if(h.hasOwnProperty(i)&&h[i]&&(o=v(i,t,n,!1))){this.hook=i,p=!0,f=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source);break}if(!p)throw new Error("Unknown source type");this.source=t,void 0===this.flip&&(this.flip=u),this.targets=[],f||d.setReady(),this.pub=new O(this),U.push(this),W[this.id]=this,G.push(this),g[this.hook].push(this),G.length&&!k&&he()},p.prototype=Object.create(a.prototype),p.prototype.constructor=p,p.prototype.initialize=function(){var e;r&&!this.texture&&this.ready&&(e=r.createTexture(),r.bindTexture(r.TEXTURE_2D,e),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.bindTexture(r.TEXTURE_2D,null),this.texture=e,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},p.prototype.initFrameBuffer=function(e){r&&(this.frameBuffer=new Y(r,this.width,this.height,{texture:this.texture,useFloat:e}))},p.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},p.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},p.prototype.resize=function(){var e,t;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(e=0;e<this.targets.length;e++)(t=this.targets[e]).resize(),t.setTransformDirty&&t.setTransformDirty()},p.prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},p.prototype.render=function(){var e=this.source;r&&(e||0===e)&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.plugin&&this.plugin.render&&(this.dirty||this.checkDirty&&this.checkDirty())&&this.plugin.render.call(this,r,de,i,o)&&(this.dirty=!1,this.emit("render")))},p.prototype.renderImageCanvas=function(){var e=this.source;if(r&&e&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.dirty)){r.bindTexture(r.TEXTURE_2D,this.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,this.flip),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{return r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),this.dirty=!1,this.emit("render"),!0}catch(e){e.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},p.prototype.destroy=function(){var e,t,n;for(this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),r&&this.texture&&r.deleteTexture(this.texture);this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(t in(e=G.indexOf(this))>=0&&G.splice(e,1),(e=g[this.hook].indexOf(this))>=0&&g[this.hook].splice(e,1),this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];a.prototype.destroy.call(this)},P=function(e){var t=e;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(t.source)return t.source.pub},set:function(e){t.setSource(e)}},original:{enumerable:!0,configurable:!0,get:function(){return t.target}},width:{enumerable:!0,configurable:!0,get:function(){return t.width},set:function(e){!isNaN(e)&&e>0&&t.width!==e&&(t.width=e,t.resize(),t.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return t.height},set:function(e){!isNaN(e)&&e>0&&t.height!==e&&(t.height=e,t.resize(),t.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}}}),this.render=function(){t.render()},this.readPixels=function(e,r,n,i,o){return t.readPixels(e,r,n,i,o)},this.on=function(e,r){t.on(e,r)},this.off=function(e,r){t.off(e,r)},this.go=function(e){t.go(e)},this.stop=function(){t.stop()},this.getTexture=function(){return t.frameBuffer.texture},this.destroy=function(){var e,r;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((r=Object.getOwnPropertyDescriptor(this,e)).get||r.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.inputs=function(e){return{source:{type:"image"}}},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},E=function(e,t,s){var l,f,h,p,v,m,g,y,_,S=this,E=!1;function T(e,t,n,s){var a=d[e];if(a.definition){if(!(a=a.definition.call(S,t,n,s)))return null;a=F(F({},d[e]),a),S.hook=_,E=!0,S.plugin=a,S.compare=a.compare,a.target&&(t=a.target),a.gl&&!S.gl&&(S.gl=a.gl,r||ce(a.gl)),S.gl===r&&(S.model=i,S.shader=o)}return a}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(s&&"object"==typeof s||(s=t),t=e),f=void 0===(l=s||{}).flip||l.flip,h=parseInt(l.width,10),p=parseInt(l.height,10),m=l.debugContext,"string"==typeof e&&d[e]&&T(e,t,l,!0),this.renderToTexture=l.renderToTexture,B(t,"WebGLFramebuffer"))if(g=t,B(l,"HTMLCanvasElement"))t=l;else if(B(l,"WebGLRenderingContext"))t=l.canvas;else if(B(l.canvas,"HTMLCanvasElement"))t=l.canvas;else{if(!B(l.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");t=l.context.canvas}if(B(t,"HTMLCanvasElement")){if(h=t.width,p=t.height,(!r||r.canvas!==t&&l.allowSecondaryWebGL)&&(v=H(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:m})),v)r&&r!==v?(this.gl=v,this.frameBuffer={frameBuffer:g||null},this.shader=new K(this.gl,u,c),this.model=ue.call(this,this.gl),this.pixels=null,this.texture=this.gl.createTexture(),this.gl.bindTexture(r.TEXTURE_2D,this.texture),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.render=this.renderSecondaryWebGL):(n||(n=this),r||ce(v),this.render=this.renderWebGL,l.renderToTexture?r&&(this.frameBuffer=new Y(r,h,p,!1)):this.frameBuffer={frameBuffer:g||null});else{if(!l.allowSecondaryWebGL&&r&&r.canvas!==t)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=w,X.logger.log("Unable to create WebGL context.")}E=!0}if(!E)for(_ in d)if(d.hasOwnProperty(_)&&d[_]&&T(_,t,l,!1))break;if(!E)throw new Error("Unknown target type");b&&((y=b.get(t))?X.logger.warn("Target already in use by another instance",t,Object.keys(y).map((function(e){return y[e]}))):(y={},b.set(t,y)),y[N.id]=N),this.target=t,this.transform=null,this.transformDirty=!0,this.flip=f,h&&(this.width=h),p&&(this.height=p),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==l.auto?this.auto=l.auto:this.auto=oe,this.frames=0,this.pub=new P(this),U.push(this),W[this.id]=this,J.push(this)},(E.prototype=Object.create(a.prototype)).constructor=E,E.prototype.setSource=function(e){var t;(t=pe(e))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&(this.resize(),t.ready?this.setReady():this.setUnready()),this.setDirty())},E.prototype.setDirty=function(){this.dirty=!0,this.auto&&!k&&(k=A(he))},E.prototype.resize=function(){B(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))},E.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},E.prototype.go=function(){this.auto=!0,this.setDirty()},E.prototype.stop=function(){this.auto=!1},E.prototype.render=function(){r&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,de,o,i)},E.prototype.renderWebGL=function(){var e,t,n;if(this.resize(),r&&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||s:this.transformDirty&&(e=this.transform,M.copy(e,this.source.cumulativeMatrix||s),t=this.source.width/this.width,n=this.source.height/this.height,e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=n,e[5]*=n,e[6]*=n,e[7]*=n,this.uniforms.transform=e,this.transformDirty=!1),de(o,i,this.uniforms,this.frameBuffer.frameBuffer,this,x),this.emit("render"),this.dirty=!1}},E.prototype.renderSecondaryWebGL=function(){var e,t,r,n,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),e=this.source.width,t=this.source.height,this.pixels&&this.pixels.length===e*t*4||(this.pixels=new Uint8Array(e*t*4)),this.source.readPixels(0,0,e,t,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),e===this.width&&t===this.height?this.uniforms.transform=s:this.transformDirty&&(r=this.transform,M.copy(r,s),n=this.source.width/this.width,i=this.source.height/this.height,r[0]*=n,r[1]*=n,r[2]*=n,r[3]*=n,r[4]*=i,r[5]*=i,r[6]*=i,r[7]*=i,this.uniforms.transform=r,this.transformDirty=!1),this.uniforms.source=this.texture,de(this.shader,this.model,this.uniforms,null,this,x),this.dirty=!1)},E.prototype.removeSource=function(e){this.source!==e&&this.source!==e.pub||(this.source=null)},E.prototype.destroy=function(){var e,r;this.source&&this.source.removeTarget&&this.source.removeTarget(this),b&&(delete(r=b.get(this.target))[N.id],Object.keys(r).length||b.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,(e=J.indexOf(this))>=0&&J.splice(e,1),a.prototype.destroy.call(this),this===n&&(t.removeEventListener("webglcontextrestored",le,!1),fe(),n=null)},C=function(e){var t,r=e,n=this;function i(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){return t.get.call(r)},set:function(n){!function(e,t,n){var i,o,s;i=r.inputElements[e],"string"==typeof n&&isNaN(n)&&("enum"===t.type?t.options.hasOwnProperty(n)||(n=L(n,["select"])):"number"===t.type||"boolean"===t.type?n=L(n,["input","select"]):"image"===t.type&&(n=L(n,["canvas","img","video"]))),B(n,"HTMLInputElement")||B(n,"HTMLSelectElement")?(o=n.value,i&&i.element!==n&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete r.inputElements[e],i=null),i||(i={element:n,listener:(s=n,function(){var t,i;t="checkbox"===n.type?n.checked:s.value,i=r.setInput(e,t),"color"===n.type&&(i=V(i)),i!==t&&(s.value=i)})},r.inputElements[e]=i,"range"===n.type?(n.addEventListener("input",i.listener,!0),n.addEventListener("change",i.listener,!0)):n.addEventListener("change",i.listener,!0)),i&&"checkbox"===n.type&&(o=n.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete r.inputElements[e]),o=n),r.setInput(e,o)}(e,t,n)}})}function o(e){return function(){e.apply(r,arguments)&&r.setTransformDirty()}}for(t in Object.defineProperties(this,{transform:{enumerable:!0,configurable:!0,get:function(){return r.hook}},title:{enumerable:!0,configurable:!0,get:function(){return r.plugin.title||r.hook}},width:{enumerable:!0,configurable:!0,get:function(){return r.width}},height:{enumerable:!0,configurable:!0,get:function(){return r.height}},id:{enumerable:!0,configurable:!0,get:function(){return r.id}},source:{enumerable:!0,configurable:!0,get:function(){return r.source&&r.source.pub},set:function(e){r.setSource(e)}}}),r.methods)r.methods.hasOwnProperty(t)&&(this[t]=o(r.methods[t]));for(t in r.inputs)r.inputs.hasOwnProperty(t)&&i(t,r.inputs[t]);this.update=function(){r.setDirty()},this.inputs=function(e){var t,n,i,o;if(i=r.plugin.inputs,e)return!(n=i[e])||n.method?null:(t={type:n.type,defaultValue:n.defaultValue,title:n.title||e},"number"===n.type?(t.min=n.min,t.max=n.max,t.step=n.step,t.mod=n.mod):"enum"===n.type?t.options=F({},n.options):"vector"===n.type&&(t.dimensions=n.dimensions),n.description&&(t.description=n.description),t);for(o in t={},i)i.hasOwnProperty(o)&&!i[o].method&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return r.alias(e,t),this},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)},this.destroy=function(){var e,t;for(e in r.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return r.isDestroyed},this.isReady=function(){return r.ready}},S=function(e,t){var r,n,i,o,s;for(r 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=f[e],this.hook=e,this.id=q,q++,this.options=t,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=F({},this.transformRef),this.transformRef.definition&&F(this.plugin,this.transformRef.definition.call(this,t)),this.plugin.inputs)this.plugin.inputs.hasOwnProperty(r)&&((n=this.plugin.inputs[r]).method&&"function"==typeof n.method?this.methods[r]=n.method:"function"==typeof n.set&&"function"==typeof n.get&&(this.inputs[r]=n));for(r in $(this.plugin),s=ne[e],this.plugin.inputs)this.plugin.inputs.hasOwnProperty(r)&&"function"==typeof(n=this.plugin.inputs[r]).set&&"function"==typeof n.get&&"function"!=typeof n.method&&(i=n.get.call(this),o=void 0===n.defaultValue?i:n.defaultValue,o=n.validate.call(this,o,n,i),s&&void 0!==s[r]&&(o=n.validate.call(this,s[r],n,n.defaultValue,o),s[r]=o),o!==i&&n.set.call(this,o));U.push(this),W[this.id]=this,this.pub=new C(this),Z.push(this),m[e].push(this)},S.prototype=Object.create(a.prototype),S.prototype.constructor=S,S.prototype.setDirty=function(){this.renderDirty=!0,a.prototype.setDirty.call(this)},S.prototype.setTransformDirty=function(){var e,t;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,e=0;e<this.targets.length;e++)(t=this.targets[e]).setTransformDirty?t.setTransformDirty():t.setDirty()},S.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty()},S.prototype.setSource=function(e){var t;if((t=pe(e))!==this.source){if(ve(t,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&t.ready?this.setReady():this.setUnready(),this.resize()}},S.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},S.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1),this.targets&&this.targets.length&&this.resize()},S.prototype.setInput=function(e,t){var r,n,i;if(this.plugin.inputs.hasOwnProperty(e))return r=this.plugin.inputs[e],n=ne[this.hook]&&void 0!==ne[this.hook][e]?ne[this.hook][e]:r.defaultValue,i=r.get.call(this),void 0===n&&(n=i),t=r.validate.call(this,t,r,n,i),r.set.call(this,t)&&this.setTransformDirty(),r.get.call(this)},S.prototype.alias=function(e,t){var r,n,i=this;if(D.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(e)&&(t||(t=e),N.removeAlias(t),(r=this.inputs[e])?(n=i.inputs[e],Object.defineProperty(N,t,{configurable:!0,enumerable:!0,get:function(){return n.get.call(i)},set:function(e){n.set.call(i,e)&&i.setTransformDirty()}})):(r=this.methods[e])&&(n=r,N[t]=function(){n.apply(i,arguments)&&i.setTransformDirty()}),r&&(ee[t]={node:this,input:e})),this},S.prototype.render=function(e){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||s),this.transformDirty=!1),e&&r?(this.renderDirty&&(this.frameBuffer||(this.uniforms={resolution:[this.width,this.height]},this.frameBuffer=new Y(r,this.width,this.height)),this.uniforms.source=this.source.texture,this.uniforms.transform=this.cumulativeMatrix||s,de(o,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))},S.prototype.readPixels=function(e,t,n,i,o){var s=this.gl||r;if(!r)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===o)o=new Uint8Array(n*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,n,i,r.RGBA,r.UNSIGNED_BYTE,o),o},S.prototype.destroy=function(){var e,t,r,n=this.hook;for(e 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(e)&&((r=this.inputElements[e]).element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0));for(this.source&&this.source.removeTarget(this);this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(r=ee[t]).node===this&&N.removeAlias(t);(e=Z.indexOf(this))>=0&&Z.splice(e,1),(e=m[n].indexOf(this))>=0&&m[n].splice(e,1),a.prototype.destroy.call(this)},S.prototype.setReady=a.prototype.setReady,S.prototype.setUnready=a.prototype.setUnready,S.prototype.on=a.prototype.on,S.prototype.off=a.prototype.off,S.prototype.emit=a.prototype.emit,(e=B(e,"HTMLCanvasElement")?{canvas:e}:e||{}).canvas,this.effect=function(e,t){if(!l[e])throw new Error("Unknown effect: "+e);return new y(e,t).pub},this.source=function(e,t,r){return pe(e,t,r).pub},this.transform=function(t,r){if("string"!=typeof t&&(r=t,t=!1),t){if(!f[t])throw new Error("Unknown transform: "+t)}else if(t=e&&e.defaultTransform||"2d",!f[t])throw new Error("No transform specified");return new S(t,r).pub},this.target=function(e,t,r){var n,i,o;for(e&&"string"==typeof e&&!d[e]&&(i=document.querySelector(e)),("string"!=typeof e||!t&&0!==t||i)&&(r&&"object"==typeof r||(r=t),t=i||e,e=null),"string"==typeof t&&isNaN(t)&&(t=document.querySelector(t)),o=0;o<J.length;o++)if(n=J[o],(!e||e===n.hook)&&(n.target===t||n.compare&&n.compare(t,r)))return n.pub;return(n=new E(e,t,r)).pub},this.aliases=function(){return Object.keys(ee)},this.removeAlias=function(e){ee[e]&&(delete this[e],delete ee[e])},this.defaults=function(e,t){var r;if(e)if("object"!=typeof e)null===t?delete ne[e]:"object"==typeof t&&(ne[e]=F({},t));else for(r in e)e.hasOwnProperty(r)&&this.defaults(r,e[r]);else if(null===e)for(r in ne)ne.hasOwnProperty(r)&&delete ne[r]},this.go=function(e,t){var r;for("function"==typeof e&&te.indexOf(e)<0&&te.push(e),"function"==typeof t&&re.indexOf(t)<0&&re.push(t),oe=!0,r=0;r<J.length;r++)J[r].go();k||!te.length&&!re.length||he()},this.stop=function(){te.length=0,re.length=0,j(k),k=0},this.render=function(){var t;for(t=0;t<J.length;t++)J[t].render(e)},this.destroy=function(){for(var e,t;U.length;)U[0].pub.destroy();for(e in this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w);N=null,G=[],J=[],Q=[],U=[],te.length=0,re.length=0,j(k),k=0,se=!0},this.isDestroyed=function(){return se},this.incompatible=function(e){var t,r,n;if(n=X.incompatible(e))return n;if(!e){for(t in v)if(v.hasOwnProperty(t)&&v[t].length&&(r=l[t])&&"function"==typeof r.compatible&&!r.compatible.call(this))return"plugin-"+t;for(t in g)if(g.hasOwnProperty(t)&&g[t].length&&(r=h[t])&&"function"==typeof r.compatible&&!r.compatible.call(this))return"source-"+t}return!1},this.isNode=function(e){var t;return!(!e||!(t=W[e.id])||t.isDestroyed)},this.isSource=function(e){return this.isNode(e)&&e instanceof O},this.isEffect=function(e){return this.isNode(e)&&e instanceof T},this.isTransform=function(e){return this.isNode(e)&&e instanceof C},this.isTarget=function(e){return this.isNode(e)&&e instanceof P},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return I}}}),this.defaults(e.defaults)}window.addEventListener("message",(function(e){e.source===window&&"seriously-timeout-message"===e.data&&(e.stopPropagation(),p.length>0&&p.shift()())}),!0),Y.prototype.resize=function(e,t){var r=this.gl;this.width===e&&this.height===t||(this.width=e,this.height=t,r&&(r.bindTexture(r.TEXTURE_2D,this.texture),r.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,this.renderBuffer),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e,t,0,r.RGBA,r.UNSIGNED_BYTE,null),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,e,t),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,this.texture,0),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindFramebuffer(r.FRAMEBUFFER,null)))},Y.prototype.destroy=function(){var e=this.gl;e&&(e.deleteFramebuffer(this.frameBuffer),e.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&e.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},K.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(e){var t,r,n;if(void 0===o&&((t=document.createElement("canvas"))&&t.getContext?window.WebGLRenderingContext?(r=G())||(o="context"):o="webgl":o="canvas"),o)return o;if(e){if((n=l[e])&&"function"==typeof n.compatible&&!n.compatible(r))return"plugin-"+e;if((n=h[e])&&"function"==typeof n.compatible&&!n.compatible(r))return"source-"+e}return!1},X.plugin=function(e,t,r){var n;if(l[e])X.logger.warn("Effect ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r)return n=F({},r),"function"==typeof t&&(n.definition=t),n.reserved=k,n.inputs&&$(n),n.title||(n.title=e),l[e]=n,v[e]=[],n},X.removePlugin=function(e){var t;if(!e)return this;if(!l[e])return this;if(t=v[e]){for(;t.length;)t.shift().destroy();delete v[e]}return delete l[e],this},X.source=function(e,t,r){var n;if(h[e])X.logger.warn("Source ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.title||(n.title=e),h[e]=n,g[e]=[],n},X.removeSource=function(e){var t;if(!e)return this;if(!h[e])return this;if(t=g[e]){for(;t.length;)t.shift().destroy();delete g[e]}return delete h[e],this},X.transform=function(e,t,r){var n;if(f[e])X.logger.warn("Transform ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.reserved=I,n.inputs&&$(n),n.title||(n.title=e),f[e]=n,m[e]=[],n},X.removeTransform=function(e){var t;if(!e)return this;if(!f[e])return this;if(t=m[e]){for(;t.length;)t.shift().destroy();delete m[e]}return delete f[e],this},X.target=function(e,t,r){var n;if(d[e])X.logger.warn("Target ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.title||(n.title=e),d[e]=n,y[e]=[],n},X.removeTarget=function(e){var t;if(!e)return this;if(!d[e])return this;if(t=y[e]){for(;t.length;)t.shift().destroy();delete y[e]}return delete d[e],this},X.inputValidators={color:function(e,t,r,n){var o,s,a,u;if(s=n||[],"string"==typeof e){if((a=E.exec(e))&&a.length){if(a.length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(s[3]=1,u=0;u<3;u++)s[u]=parseFloat(a[u+2])/255;return isNaN(a[6])||(s[3]=parseFloat(a[6])),"hsl"===a[1].toLowerCase()?W(s[0],s[1],s[2],s[3],s):s}if((a=T.exec(e))&&a.length)return 3===(o=a[1]).length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=1):4===o.length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=parseInt(o[3],16)/15):6===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=1):8===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=parseInt(o.substr(6,2),16)/255):s[0]=s[1]=s[2]=s[3]=0,s;if(a=S[e.toLowerCase()]){for(u=0;u<4;u++)s[u]=a[u];return s}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=e,(o=i.fillStyle)&&"#000000"!==o?X.inputValidators.color(o,t,r,n):(s[0]=s[1]=s[2]=s[3]=0,s)}if(q(e)){if((s=e).length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(u=0;u<3;u++)if(isNaN(s[u]))return s[0]=s[1]=s[2]=s[3]=0,s;return s.length<4&&s.push(1),s}if("number"==typeof e)return s[0]=s[1]=s[2]=e,s[3]=1,s;if("object"==typeof e){for(u=0;u<4;u++)null===e[o=C[u]]||isNaN(e[o])?s[u]=3===u?1:0:s[u]=e[o];return s}return s[0]=s[1]=s[2]=s[3]=0,s},number:function(e,t,r){return e=parseFloat(e),isNaN(e)?r||0:(t.mod&&(e-=t.mod*Math.floor(e/t.mod)),e<t.min?t.min:e>t.max?t.max:t.step?Math.round(e/t.step)*t.step:e)},enum:function(e,t,r){var n=t.options||[];return"string"==typeof e?e=e.toLowerCase():"number"==typeof e?e=e.toString():e||(e=""),n.hasOwnProperty(e)?e:r||""},vector:function(e,t,r,n){var i,o,s,a=t.dimensions||4;if(i=n||[],q(e)){for(o=0;o<a;o++)i[o]=e[o]||0;return i}if("object"==typeof e){for(o=0;o<a;o++)void 0===e[s=O[o]]&&(s=C[o]),i[o]=e[s]||0;return i}for(e=parseFloat(e)||0,o=0;o<a;o++)i[o]=e;return i},boolean:function(e){return!(!e||e&&e.toLowerCase&&"false"===e.toLowerCase())},string:function(e){return"string"==typeof e?e:0===e||e?e.toString?e.toString():String(e):""}},X.prototype.effects=X.effects=function(){var e,t,r,n,i,o={};for(e in l)if(l.hasOwnProperty(e)){for(i in r={title:(t=l[e]).title||e,description:t.description||"",inputs:{}},t.inputs)t.inputs.hasOwnProperty(i)&&(n=t.inputs[i],r.inputs[i]={type:n.type,defaultValue:n.defaultValue,step:n.step,min:n.min,max:n.max,mod:n.mod,minCount:n.minCount,maxCount:n.maxCount,dimensions:n.dimensions,title:n.title||i,description:n.description||"",options:n.options||[]});o[e]=r}return o},window.Float32Array&&(s=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 e;for(e in window.Seriously)window.Seriously.hasOwnProperty(e)&&"plugin"!==e&&"object"==typeof window.Seriously[e]&&X.plugin(e,window.Seriously[e])}(),X.logger={log:U("log"),info:U("info"),warn:U("warn"),error:U("error")},X.util={mat4:M,checkSource:function(e){var t,r,n,i;if(!(t=L(e,["img","canvas","video"])))return!1;if(!(r=document.createElement("canvas")))return X.logger.warn("Browser does not support canvas or Seriously.js"),!1;if(0===t.naturalWidth&&"IMG"===t.tagName)return X.logger.warn("Image not loaded"),!1;if(0===t.readyState&&0===t.videoWidth&&"VIDEO"===t.tagName)return X.logger.warn("Video not loaded"),!1;if(n=G()){(i=n.createTexture())||X.logger.error("Test WebGL context has been lost"),n.bindTexture(n.TEXTURE_2D,i);try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+e.message),n.deleteTexture(i),!1}n.deleteTexture(i)}else{n=r.getContext("2d");try{n.drawImage(t,0,0),n.getImageData(0,0,1,1)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+e.message),!1}}return!0},hslToRgb:W,colors:S,setTimeoutZero:z,ShaderProgram:K,FrameBuffer:Y,requestAnimationFrame:A,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(e,t,r){var n,i,o=this,s=!1,u=!1,c=!1,l=0;function f(){e.removeEventListener("loadedmetadata",f,!0),s||(e.videoWidth?(o.width===e.videoWidth&&o.height===e.videoHeight||(o.width=e.videoWidth,o.height=e.videoHeight,o.resize()),u&&o.setReady()):(u=!0,setTimeout(f,50)))}function h(){c=!0}function d(){c=!1,o.setDirty()}if(B(e,"HTMLVideoElement"))return e.readyState?f():(u=!0,e.addEventListener("loadedmetadata",f,!0)),e.addEventListener("seeking",h,!1),e.addEventListener("seeked",d,!1),{deferTexture:u,source:e,render:function t(r){var s;if(l=e.currentTime,!e.videoHeight||!e.videoWidth)return!1;a?(i||(i=document.createElement("canvas").getContext("2d"),(n=i.canvas).width=o.width,n.height=o.height),s=n,i.drawImage(e,0,0,o.width,o.height)):s=e,r.bindTexture(r.TEXTURE_2D,o.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,o.flip),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,s),void 0===a){if(r.getError()===r.INVALID_VALUE)return a=!0,t(r);a=!1}return!0}catch(e){e.code===window.DOMException.SECURITY_ERR?(o.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",e)}return!1},checkDirty:function(){return!c&&e.currentTime!==l},compare:function(e){return o.source===e},destroy:function(){s=!0,e.removeEventListener("seeking",h,!1),e.removeEventListener("seeked",d,!1),e.removeEventListener("loadedmetadata",f,!0)}}}),{title:"Video"}),X.transform("2d",(function(e){var t=this,r=!(e&&e.radians),n=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,f=0;function h(){var e,h,d,p,v,m,g,y,b,_,w,S=t.matrix;function E(e,t){S[12]=S[0]*e+S[4]*t+S[12],S[13]=S[1]*e+S[5]*t+S[13],S[14]=S[2]*e+S[6]*t+S[14],S[15]=S[3]*e+S[7]*t+S[15]}a||u||c||l||f||1!==o||1!==s?(M.identity(S),E(a+n,u+i),l&&(S[4]=l/t.width),f&&(S[1]=f/t.height),c&&(p=S[0],v=S[1],m=S[2],g=S[3],y=S[4],b=S[5],_=S[6],w=S[7],e=-(r?c*Math.PI/180:c),h=Math.sin(e),d=Math.cos(e),S[0]=p*d+y*h,S[1]=v*d+b*h,S[2]=m*d+_*h,S[3]=g*d+w*h,S[4]=y*d-p*h,S[5]=b*d-v*h,S[6]=_*d-m*h,S[7]=w*d-g*h),1!==o&&(S[0]*=o,S[1]*=o,S[2]*=o,S[3]*=o),1!==s&&(S[4]*=s,S[5]*=s,S[6]*=s,S[7]*=s),E(-n,-i),t.transformed=!0):t.transformed=!1}return{inputs:{reset:{method:function(){return n=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,f=0,!!t.transformed&&(t.transformed=!1,!0)}},translate:{method:function(e,t){return isNaN(e)&&(e=a),isNaN(t)&&(t=u),(e!==a||t!==u)&&(a=e,u=t,h(),!0)},type:["number","number"]},translateX:{get:function(){return a},set:function(e){return e!==a&&(a=e,h(),!0)},type:"number"},translateY:{get:function(){return u},set:function(e){return e!==u&&(u=e,h(),!0)},type:"number"},rotation:{get:function(){return c},set:function(e){return e!==c&&(c=parseFloat(e),h(),!0)},type:"number"},center:{method:function(e,t){return isNaN(e)&&(e=n),isNaN(t)&&(t=i),(e!==n||t!==i)&&(n=e,i=t,h(),!0)},type:["number","number"]},centerX:{get:function(){return n},set:function(e){return e!==n&&(n=e,h(),!0)},type:"number"},centerY:{get:function(){return i},set:function(e){return e!==i&&(i=e,h(),!0)},type:"number"},skew:{method:function(e,t){return isNaN(e)&&(e=l),isNaN(t)&&(t=f),(e!==l||t!==f)&&(l=e,f=t,h(),!0)},type:["number","number"]},skewX:{get:function(){return l},set:function(e){return e!==l&&(l=e,h(),!0)},type:"number"},skewY:{get:function(){return f},set:function(e){return e!==f&&(f=e,h(),!0)},type:"number"},scale:{method:function(e,t){var r,n;if(r=isNaN(e)?o:e,isNaN(t)){if(isNaN(e))return!1;n=r}else n=t;return(r!==o||n!==s)&&(o=r,s=n,h(),!0)},type:["number","number"]},scaleX:{get:function(){return o},set:function(e){return e!==o&&(o=e,h(),!0)},type:"number"},scaleY:{get:function(){return s},set:function(e){return e!==s&&(s=e,h(),!0)},type:"number"}}}}),{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",(function(){var e=this,t=!0;function r(){var r=e.matrix;t?(r[0]=-1,r[5]=1):(r[0]=1,r[5]=-1)}return M.identity(e.matrix),r(),e.transformDirty=!0,e.transformed=!0,{inputs:{direction:{get:function(){return t?"horizontal":"vertical"},set:function(e){var n;return(n="vertical"!==e)!==t&&(t=n,r(),!0)},type:"string"}}}}),{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",(function(){var e,t,r=this,n="contain";function i(){var i,o,s,a,u=r.matrix,c=e||r.width,l=t||r.height,f=r.source,h=f&&f.width||1,d=f&&f.height||1;"distort"===n||c===h&&l===d?r.transformed=!1:(s=h/d,a=c/l,"none"===n?(i=h/c,o=d/l):"width"===n||"contain"===n&&a<=s?(i=1,o=a/s):"height"===n||"contain"===n&&a>s?(i=s/a,o=1):a>s?(i=1,o=a/s):(i=s/a,o=1),1!==i||1!==o?(M.identity(u),1!==i&&(u[0]*=i,u[1]*=i,u[2]*=i,u[3]*=i),1!==o&&(u[4]*=o,u[5]*=o,u[6]*=o,u[7]*=o),r.transformed=!0):r.transformed=!1)}function o(){return e||r.source&&r.source.width||1}function s(){return t||r.source&&r.source.height||1}return this.resize=function(){var e,t=o(),r=s();if(this.width!==t||this.height!==r)for(this.width=t,this.height=r,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=r),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,r),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty(),i()},{inputs:{width:{get:o,set:function(t){return(t=Math.floor(t))===e||(e=t,this.resize()),!1},type:"number"},height:{get:s,set:function(e){return(e=Math.floor(e))===t||(t=e,this.resize()),!1},type:"number"},mode:{get:function(){return n},set:function(e){return e!==n&&(n=e,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}}),{title:"Reformat",description:"Change output dimensions"}),u=["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";const J=X},6303:(e,t,r)=>{"use strict";r.r(t),r(6551).default.plugin("chroma",{shader:function(e,t){return t.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"),t.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"),t},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:""})},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),l=0,f=u>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(u(e,a,a+s>c?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|v(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function v(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(X(n))return s;e[r+s]=n}return s}function w(e,t,r,n){return Y(G(t,e.length-r),e,r,n)}function S(e,t,r,n){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return Y($(t),e,r,n)}function T(e,t,r,n){return Y(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).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}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==l[e]){o=c[e],s=l[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function M(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=J[e[n]];return i}function A(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function j(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function D(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Z((function(e,t=0){return I(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Z((function(e,t=0){return I(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const U={};function B(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,i,o)}function q(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=W(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function $(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},1227:(e,t,r)=>{var n=r(4155);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=r(2447)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(7824),t.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(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},2114:e=>{"use strict";function t(e,t){for(const r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,r,n){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof r&&(n=r,r=""),r&&(n.code=r);try{return t(e,n)}catch(r){n.message=e.message,n.stack=e.stack;const i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(e)),t(new i,n)}}},7187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return e}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(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function v(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.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},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=p(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8806:function(e,t,r){!function(e){function t(){}function r(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,-1===i.indexOf(e.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}function n(e){for(var t=0,r=Math.min(65536,e.length+1),n=new Uint16Array(r),i=[],o=0;;){var s=t<e.length;if(!s||o>=r-1){if(i.push(String.fromCharCode.apply(null,n.subarray(0,o))),!s)return i.join("");e=e.subarray(t),o=t=0}if(0==(128&(s=e[t++])))n[o++]=s;else if(192==(224&s)){var a=63&e[t++];n[o++]=(31&s)<<6|a}else if(224==(240&s)){a=63&e[t++];var u=63&e[t++];n[o++]=(31&s)<<12|a<<6|u}else 240==(248&s)&&(65535<(s=(7&s)<<18|(a=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++])&&(s-=65536,n[o++]=s>>>10&1023|55296,s=56320|1023&s),n[o++]=s)}}if(e.TextEncoder&&e.TextDecoder)return!1;var i=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var r=e.length,n=0,i=Math.max(32,r+(r>>>1)+7),o=new Uint8Array(i>>>3<<3);t<r;){var s=e.charCodeAt(t++);if(55296<=s&&56319>=s){if(t<r){var a=e.charCodeAt(t);56320==(64512&a)&&(++t,s=((1023&s)<<10)+(1023&a)+65536)}if(55296<=s&&56319>=s)continue}if(n+4>o.length&&(i+=8,i=(i*=1+t/e.length*2)>>>3<<3,(a=new Uint8Array(i)).set(o),o=a),0==(4294967168&s))o[n++]=s;else{if(0==(4294965248&s))o[n++]=s>>>6&31|192;else if(0==(4294901760&s))o[n++]=s>>>12&15|224,o[n++]=s>>>6&63|128;else{if(0!=(4292870144&s))continue;o[n++]=s>>>18&7|240,o[n++]=s>>>12&63|128,o[n++]=s>>>6&63|128}o[n++]=63&s|128}}return o.slice?o.slice(0,n):o.subarray(0,n)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1});var o=n;"function"==typeof Buffer&&Buffer.from?o=function(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(o=function(e){try{var t=URL.createObjectURL(new Blob([e],{type:"text/plain;charset=UTF-8"})),r=new XMLHttpRequest;return r.open("GET",t,!1),r.send(),r.responseText}catch(t){return n(e)}finally{t&&URL.revokeObjectURL(t)}}),r.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");return e=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),o(e)},e.TextEncoder=t,e.TextDecoder=r}("undefined"!=typeof window?window:void 0!==r.g?r.g:this)},5177:e=>{e.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*v}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6486:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=32,c=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",S="[object Map]",E="[object Number]",T="[object Object]",O="[object Promise]",C="[object RegExp]",x="[object Set]",P="[object String]",R="[object Symbol]",M="[object WeakMap]",A="[object ArrayBuffer]",j="[object DataView]",k="[object Float32Array]",I="[object Float64Array]",D="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",B="[object Uint16Array]",W="[object Uint32Array]",V=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,$=RegExp(H.source),Y=RegExp(G.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Oe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",xe="\\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",Pe="["+we+"]",Re="["+xe+"]",Me="["+Se+"]",Ae="\\d+",je="["+Ee+"]",ke="["+Te+"]",Ie="[^"+we+xe+Ae+Ee+Te+Oe+"]",De="\\ud83c[\\udffb-\\udfff]",Ne="[^"+we+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Oe+"]",Be="\\u200d",We="(?:"+ke+"|"+Ie+")",Ve="(?:"+Ue+"|"+Ie+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Me+"|"+De+")?",Ge="["+Ce+"]?",$e=Ge+He+"(?:"+Be+"(?:"+[Ne,Le,Fe].join("|")+")"+Ge+He+")*",Ye="(?:"+[je,Le,Fe].join("|")+")"+$e,Ke="(?:"+[Ne+Me+"?",Me,Le,Fe,Pe].join("|")+")",Xe=RegExp("['’]","g"),Je=RegExp(Me,"g"),Ze=RegExp(De+"(?="+De+")|"+Ke+$e,"g"),Qe=RegExp([Ue+"?"+ke+"+"+qe+"(?="+[Re,Ue,"$"].join("|")+")",Ve+"+"+ze+"(?="+[Re,Ue+We,"$"].join("|")+")",Ue+"?"+We+"+"+qe,Ue+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ye].join("|"),"g"),et=RegExp("["+Be+we+Se+Ce+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["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"],nt=-1,it={};it[k]=it[I]=it[D]=it[N]=it[L]=it[F]=it[U]=it[B]=it[W]=!0,it[v]=it[m]=it[A]=it[g]=it[j]=it[y]=it[b]=it[_]=it[S]=it[E]=it[T]=it[C]=it[x]=it[P]=it[M]=!1;var ot={};ot[v]=ot[m]=ot[A]=ot[j]=ot[g]=ot[y]=ot[k]=ot[I]=ot[D]=ot[N]=ot[L]=ot[S]=ot[E]=ot[T]=ot[C]=ot[x]=ot[P]=ot[R]=ot[F]=ot[U]=ot[B]=ot[W]=!0,ot[b]=ot[_]=ot[M]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,ut=parseInt,ct="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=ct||lt||Function("return this")(),ht=t&&!t.nodeType&&t,dt=ht&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ht,vt=pt&&ct.process,mt=function(){try{return dt&&dt.require&&dt.require("util").types||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),gt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,bt=mt&&mt.isMap,_t=mt&&mt.isRegExp,wt=mt&&mt.isSet,St=mt&&mt.isTypedArray;function Et(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Tt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function Ot(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function xt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Pt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Rt(e,t){return!(null==e||!e.length)&&Ut(e,t,0)>-1}function Mt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function At(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function jt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function kt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function It(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Dt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Nt=qt("length");function Lt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Ft(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Ft(e,Wt,r)}function Bt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Wt(e){return e!=e}function Vt(e,t){var r=null==e?0:e.length;return r?Gt(e,t)/r:h}function qt(e){return function(t){return null==t?i:t[e]}}function zt(e){return function(t){return null==e?i:e[t]}}function Ht(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Gt(e,t){for(var r,n=-1,o=e.length;++n<o;){var s=t(e[n]);s!==i&&(r=r===i?s:r+s)}return r}function $t(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Yt(e){return e?e.slice(0,fr(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return At(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Zt(e,t){for(var r=-1,n=e.length;++r<n&&Ut(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var er=zt({À:"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"}),tr=zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+st[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==a||(e[r]=a,o[i++]=r)}return o}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function cr(e){return nr(e)?function(e){for(var t=Ze.lastIndex=0;Ze.test(e);)++t;return t}(e):Nt(e)}function lr(e){return nr(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var hr=zt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),dr=function e(t){var r,n=(t=null==t?ft:dr.defaults(ft.Object(),t,dr.pick(ft,rt))).Array,ie=t.Date,we=t.Error,Se=t.Function,Ee=t.Math,Te=t.Object,Oe=t.RegExp,Ce=t.String,xe=t.TypeError,Pe=n.prototype,Re=Se.prototype,Me=Te.prototype,Ae=t["__core-js_shared__"],je=Re.toString,ke=Me.hasOwnProperty,Ie=0,De=(r=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Ne=Me.toString,Le=je.call(Te),Fe=ft._,Ue=Oe("^"+je.call(ke).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=pt?t.Buffer:i,We=t.Symbol,Ve=t.Uint8Array,qe=Be?Be.allocUnsafe:i,ze=or(Te.getPrototypeOf,Te),He=Te.create,Ge=Me.propertyIsEnumerable,$e=Pe.splice,Ye=We?We.isConcatSpreadable:i,Ke=We?We.iterator:i,Ze=We?We.toStringTag:i,et=function(){try{var e=uo(Te,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==ft.Date.now&&ie.now,lt=t.setTimeout!==ft.setTimeout&&t.setTimeout,ht=Ee.ceil,dt=Ee.floor,vt=Te.getOwnPropertySymbols,mt=Be?Be.isBuffer:i,Nt=t.isFinite,zt=Pe.join,pr=or(Te.keys,Te),vr=Ee.max,mr=Ee.min,gr=ie.now,yr=t.parseInt,br=Ee.random,_r=Pe.reverse,wr=uo(t,"DataView"),Sr=uo(t,"Map"),Er=uo(t,"Promise"),Tr=uo(t,"Set"),Or=uo(t,"WeakMap"),Cr=uo(Te,"create"),xr=Or&&new Or,Pr={},Rr=Lo(wr),Mr=Lo(Sr),Ar=Lo(Er),jr=Lo(Tr),kr=Lo(Or),Ir=We?We.prototype:i,Dr=Ir?Ir.valueOf:i,Nr=Ir?Ir.toString:i;function Lr(e){if(ea(e)&&!qs(e)&&!(e instanceof Wr)){if(e instanceof Br)return e;if(ke.call(e,"__wrapped__"))return Fo(e)}return new Br(e)}var Fr=function(){function e(){}return function(t){if(!Qs(t))return{};if(He)return He(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function Ur(){}function Br(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Wr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new zr;++t<r;)this.add(e[t])}function Gr(e){var t=this.__data__=new qr(e);this.size=t.size}function $r(e,t){var r=qs(e),n=!r&&Vs(e),i=!r&&!n&&$s(e),o=!r&&!n&&!i&&ua(e),s=r||n||i||o,a=s?$t(e.length,Ce):[],u=a.length;for(var c in e)!t&&!ke.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mo(c,u))||a.push(c);return a}function Yr(e){var t=e.length;return t?e[Hn(0,t-1)]:i}function Kr(e,t){return jo(Ci(e),on(t,0,e.length))}function Xr(e){return jo(Ci(e))}function Jr(e,t,r){(r!==i&&!Us(e[t],r)||r===i&&!(t in e))&&rn(e,t,r)}function Zr(e,t,r){var n=e[t];ke.call(e,t)&&Us(n,r)&&(r!==i||t in e)||rn(e,t,r)}function Qr(e,t){for(var r=e.length;r--;)if(Us(e[r][0],t))return r;return-1}function en(e,t,r,n){return ln(e,(function(e,i,o){t(n,e,r(e),o)})),n}function tn(e,t){return e&&xi(t,Ma(t),e)}function rn(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function nn(e,t){for(var r=-1,o=t.length,s=n(o),a=null==e;++r<o;)s[r]=a?i:Oa(e,t[r]);return s}function on(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function sn(e,t,r,n,o,s){var a,u=1&t,c=2&t,l=4&t;if(r&&(a=o?r(e,n,o,s):r(e)),a!==i)return a;if(!Qs(e))return e;var f=qs(e);if(f){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ke.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return Ci(e,a)}else{var h=fo(e),d=h==_||h==w;if($s(e))return _i(e,u);if(h==T||h==v||d&&!o){if(a=c||d?{}:po(e),!u)return c?function(e,t){return xi(e,lo(e),t)}(e,function(e,t){return e&&xi(t,Aa(t),e)}(a,e)):function(e,t){return xi(e,co(e),t)}(e,tn(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,r){var n,i=e.constructor;switch(t){case A:return wi(e);case g:case y:return new i(+e);case j:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case k:case I:case D:case N:case L:case F:case U:case B:case W:return Si(e,r);case S:return new i;case E:case P:return new i(e);case C:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case x:return new i;case R:return n=e,Dr?Te(Dr.call(n)):{}}}(e,h,u)}}s||(s=new Gr);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(n){a.add(sn(n,t,r,n,e,s))})):ta(e)&&e.forEach((function(n,i){a.set(i,sn(n,t,r,i,e,s))}));var m=f?i:(l?c?to:eo:c?Aa:Ma)(e);return Ot(m||e,(function(n,i){m&&(n=e[i=n]),Zr(a,i,sn(n,t,r,i,e,s))})),a}function an(e,t,r){var n=r.length;if(null==e)return!n;for(e=Te(e);n--;){var o=r[n],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function un(e,t,r){if("function"!=typeof e)throw new xe(o);return Po((function(){e.apply(i,r)}),t)}function cn(e,t,r,n){var i=-1,o=Rt,s=!0,a=e.length,u=[],c=t.length;if(!a)return u;r&&(t=At(t,Kt(r))),n?(o=Mt,s=!1):t.length>=200&&(o=Jt,s=!1,t=new Hr(t));e:for(;++i<a;){var l=e[i],f=null==r?l:r(l);if(l=n||0!==l?l:0,s&&f==f){for(var h=c;h--;)if(t[h]===f)continue e;u.push(l)}else o(t,f,n)||u.push(l)}return u}Lr.templateSettings={escape:K,evaluate:X,interpolate:J,variable:"",imports:{_:Lr}},Lr.prototype=Ur.prototype,Lr.prototype.constructor=Lr,Br.prototype=Fr(Ur.prototype),Br.prototype.constructor=Br,Wr.prototype=Fr(Ur.prototype),Wr.prototype.constructor=Wr,Vr.prototype.clear=function(){this.__data__=Cr?Cr(null):{},this.size=0},Vr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vr.prototype.get=function(e){var t=this.__data__;if(Cr){var r=t[e];return r===s?i:r}return ke.call(t,e)?t[e]:i},Vr.prototype.has=function(e){var t=this.__data__;return Cr?t[e]!==i:ke.call(t,e)},Vr.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Cr&&t===i?s:t,this},qr.prototype.clear=function(){this.__data__=[],this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=Qr(t,e);return!(r<0||(r==t.length-1?t.pop():$e.call(t,r,1),--this.size,0))},qr.prototype.get=function(e){var t=this.__data__,r=Qr(t,e);return r<0?i:t[r][1]},qr.prototype.has=function(e){return Qr(this.__data__,e)>-1},qr.prototype.set=function(e,t){var r=this.__data__,n=Qr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},zr.prototype.clear=function(){this.size=0,this.__data__={hash:new Vr,map:new(Sr||qr),string:new Vr}},zr.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},zr.prototype.get=function(e){return so(this,e).get(e)},zr.prototype.has=function(e){return so(this,e).has(e)},zr.prototype.set=function(e,t){var r=so(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Hr.prototype.add=Hr.prototype.push=function(e){return this.__data__.set(e,s),this},Hr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.clear=function(){this.__data__=new qr,this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Gr.prototype.get=function(e){return this.__data__.get(e)},Gr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!Sr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(e,t),this.size=r.size,this};var ln=Mi(yn),fn=Mi(bn,!0);function hn(e,t){var r=!0;return ln(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function dn(e,t,r){for(var n=-1,o=e.length;++n<o;){var s=e[n],a=t(s);if(null!=a&&(u===i?a==a&&!aa(a):r(a,u)))var u=a,c=s}return c}function pn(e,t){var r=[];return ln(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function vn(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=vo),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?vn(a,t-1,r,n,i):jt(i,a):n||(i[i.length]=a)}return i}var mn=Ai(),gn=Ai(!0);function yn(e,t){return e&&mn(e,t,Ma)}function bn(e,t){return e&&gn(e,t,Ma)}function _n(e,t){return Pt(t,(function(t){return Xs(e[t])}))}function wn(e,t){for(var r=0,n=(t=mi(t,e)).length;null!=e&&r<n;)e=e[No(t[r++])];return r&&r==n?e:i}function Sn(e,t,r){var n=t(e);return qs(e)?n:jt(n,r(e))}function En(e){return null==e?e===i?"[object Undefined]":"[object Null]":Ze&&Ze in Te(e)?function(e){var t=ke.call(e,Ze),r=e[Ze];try{e[Ze]=i;var n=!0}catch(e){}var o=Ne.call(e);return n&&(t?e[Ze]=r:delete e[Ze]),o}(e):function(e){return Ne.call(e)}(e)}function Tn(e,t){return e>t}function On(e,t){return null!=e&&ke.call(e,t)}function Cn(e,t){return null!=e&&t in Te(e)}function xn(e,t,r){for(var o=r?Mt:Rt,s=e[0].length,a=e.length,u=a,c=n(a),l=1/0,f=[];u--;){var h=e[u];u&&t&&(h=At(h,Kt(t))),l=mr(h.length,l),c[u]=!r&&(t||s>=120&&h.length>=120)?new Hr(u&&h):i}h=e[0];var d=-1,p=c[0];e:for(;++d<s&&f.length<l;){var v=h[d],m=t?t(v):v;if(v=r||0!==v?v:0,!(p?Jt(p,m):o(f,m,r))){for(u=a;--u;){var g=c[u];if(!(g?Jt(g,m):o(e[u],m,r)))continue e}p&&p.push(m),f.push(v)}}return f}function Pn(e,t,r){var n=null==(e=Oo(e,t=mi(t,e)))?e:e[No(Ko(t))];return null==n?i:Et(n,e,r)}function Rn(e){return ea(e)&&En(e)==v}function Mn(e,t,r,n,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,r,n,o,s){var a=qs(e),u=qs(t),c=a?m:fo(e),l=u?m:fo(t),f=(c=c==v?T:c)==T,h=(l=l==v?T:l)==T,d=c==l;if(d&&$s(e)){if(!$s(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new Gr),a||ua(e)?Zi(e,t,r,n,o,s):function(e,t,r,n,i,o,s){switch(r){case j:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case g:case y:case E:return Us(+e,+t);case b:return e.name==t.name&&e.message==t.message;case C:case P:return e==t+"";case S:var a=ir;case x:var u=1&n;if(a||(a=ar),e.size!=t.size&&!u)return!1;var c=s.get(e);if(c)return c==t;n|=2,s.set(e,t);var l=Zi(a(e),a(t),n,i,o,s);return s.delete(e),l;case R:if(Dr)return Dr.call(e)==Dr.call(t)}return!1}(e,t,c,r,n,o,s);if(!(1&r)){var p=f&&ke.call(e,"__wrapped__"),_=h&&ke.call(t,"__wrapped__");if(p||_){var w=p?e.value():e,O=_?t.value():t;return s||(s=new Gr),o(w,O,r,n,s)}}return!!d&&(s||(s=new Gr),function(e,t,r,n,o,s){var a=1&r,u=eo(e),c=u.length;if(c!=eo(t).length&&!a)return!1;for(var l=c;l--;){var f=u[l];if(!(a?f in t:ke.call(t,f)))return!1}var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var p=!0;s.set(e,t),s.set(t,e);for(var v=a;++l<c;){var m=e[f=u[l]],g=t[f];if(n)var y=a?n(g,m,f,t,e,s):n(m,g,f,e,t,s);if(!(y===i?m===g||o(m,g,r,n,s):y)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,r,n,o,s))}(e,t,r,n,Mn,o))}function An(e,t,r,n){var o=r.length,s=o,a=!n;if(null==e)return!s;for(e=Te(e);o--;){var u=r[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var c=(u=r[o])[0],l=e[c],f=u[1];if(a&&u[2]){if(l===i&&!(c in e))return!1}else{var h=new Gr;if(n)var d=n(l,f,c,e,t,h);if(!(d===i?Mn(f,l,3,n,h):d))return!1}}return!0}function jn(e){return!(!Qs(e)||(t=e,De&&De in t))&&(Xs(e)?Ue:ve).test(Lo(e));var t}function kn(e){return"function"==typeof e?e:null==e?ru:"object"==typeof e?qs(e)?Fn(e[0],e[1]):Ln(e):fu(e)}function In(e){if(!wo(e))return pr(e);var t=[];for(var r in Te(e))ke.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Dn(e,t){return e<t}function Nn(e,t){var r=-1,i=Hs(e)?n(e.length):[];return ln(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Ln(e){var t=ao(e);return 1==t.length&&t[0][2]?Eo(t[0][0],t[0][1]):function(r){return r===e||An(r,e,t)}}function Fn(e,t){return yo(e)&&So(t)?Eo(No(e),t):function(r){var n=Oa(r,e);return n===i&&n===t?Ca(r,e):Mn(t,n,3)}}function Un(e,t,r,n,o){e!==t&&mn(t,(function(s,a){if(o||(o=new Gr),Qs(s))!function(e,t,r,n,o,s,a){var u=Co(e,r),c=Co(t,r),l=a.get(c);if(l)Jr(e,r,l);else{var f=s?s(u,c,r+"",e,t,a):i,h=f===i;if(h){var d=qs(c),p=!d&&$s(c),v=!d&&!p&&ua(c);f=c,d||p||v?qs(u)?f=u:Gs(u)?f=Ci(u):p?(h=!1,f=_i(c,!0)):v?(h=!1,f=Si(c,!0)):f=[]:na(c)||Vs(c)?(f=u,Vs(u)?f=ma(u):Qs(u)&&!Xs(u)||(f=po(c))):h=!1}h&&(a.set(c,f),o(f,c,n,s,a),a.delete(c)),Jr(e,r,f)}}(e,t,a,r,Un,n,o);else{var u=n?n(Co(e,a),s,a+"",e,t,o):i;u===i&&(u=s),Jr(e,a,u)}}),Aa)}function Bn(e,t){var r=e.length;if(r)return mo(t+=t<0?r:0,r)?e[t]:i}function Wn(e,t,r){t=t.length?At(t,(function(e){return qs(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e})):[ru];var n=-1;t=At(t,Kt(oo()));var i=Nn(e,(function(e,r,i){var o=At(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var n=e.length;for(e.sort((function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var u=Ei(i[n],o[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Vn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=wn(e,s);r(a,s)&&Xn(o,mi(s,e),a)}return o}function qn(e,t,r,n){var i=n?Bt:Ut,o=-1,s=t.length,a=e;for(e===t&&(t=Ci(t)),r&&(a=At(e,Kt(r)));++o<s;)for(var u=0,c=t[o],l=r?r(c):c;(u=i(a,l,u,n))>-1;)a!==e&&$e.call(a,u,1),$e.call(e,u,1);return e}function zn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;mo(i)?$e.call(e,i,1):ui(e,i)}}return e}function Hn(e,t){return e+dt(br()*(t-e+1))}function Gn(e,t){var r="";if(!e||t<1||t>f)return r;do{t%2&&(r+=e),(t=dt(t/2))&&(e+=e)}while(t);return r}function $n(e,t){return Ro(To(e,t,ru),e+"")}function Yn(e){return Yr(Ua(e))}function Kn(e,t){var r=Ua(e);return jo(r,on(t,0,r.length))}function Xn(e,t,r,n){if(!Qs(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,u=e;null!=u&&++o<s;){var c=No(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var f=u[c];(l=n?n(f,c,u):i)===i&&(l=Qs(f)?f:mo(t[o+1])?[]:{})}Zr(u,c,l),u=u[c]}return e}var Jn=xr?function(e,t){return xr.set(e,t),e}:ru,Zn=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Qa(t),writable:!0})}:ru;function Qn(e){return jo(Ua(e))}function ei(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var r;return ln(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ri(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!aa(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return ni(e,t,ru,r)}function ni(e,t,r,n){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,u=null===t,c=aa(t),l=t===i;o<s;){var f=dt((o+s)/2),h=r(e[f]),d=h!==i,p=null===h,v=h==h,m=aa(h);if(a)var g=n||v;else g=l?v&&(n||d):u?v&&d&&(n||!p):c?v&&d&&!p&&(n||!m):!p&&!m&&(n?h<=t:h<t);g?o=f+1:s=f}return mr(s,4294967294)}function ii(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!Us(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(qs(e))return At(e,si)+"";if(aa(e))return Nr?Nr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,r){var n=-1,i=Rt,o=e.length,s=!0,a=[],u=a;if(r)s=!1,i=Mt;else if(o>=200){var c=t?null:Gi(e);if(c)return ar(c);s=!1,i=Jt,u=new Hr}else u=t?[]:a;e:for(;++n<o;){var l=e[n],f=t?t(l):l;if(l=r||0!==l?l:0,s&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue e;t&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function ui(e,t){return null==(e=Oo(e,t=mi(t,e)))||delete e[No(Ko(t))]}function ci(e,t,r,n){return Xn(e,t,r(wn(e,t)),n)}function li(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ei(e,n?0:o,n?o+1:i):ei(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Wr&&(r=r.value()),kt(t,(function(e,t){return t.func.apply(t.thisArg,jt([e],t.args))}),r)}function hi(e,t,r){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=n(i);++o<i;)for(var a=e[o],u=-1;++u<i;)u!=o&&(s[o]=cn(s[o]||a,e[u],t,r));return ai(vn(s,1),t,r)}function di(e,t,r){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var u=n<s?t[n]:i;r(a,e[n],u)}return a}function pi(e){return Gs(e)?e:[]}function vi(e){return"function"==typeof e?e:ru}function mi(e,t){return qs(e)?e:yo(e,t)?[e]:Do(ga(e))}var gi=$n;function yi(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ei(e,t,r)}var bi=st||function(e){return ft.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var r=e.length,n=qe?qe(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Si(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ei(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,s=aa(e),a=t!==i,u=null===t,c=t==t,l=aa(t);if(!u&&!l&&!s&&e>t||s&&a&&c&&!u&&!l||n&&a&&c||!r&&c||!o)return 1;if(!n&&!s&&!l&&e<t||l&&r&&o&&!n&&!s||u&&r&&o||!a&&o||!c)return-1}return 0}function Ti(e,t,r,i){for(var o=-1,s=e.length,a=r.length,u=-1,c=t.length,l=vr(s-a,0),f=n(c+l),h=!i;++u<c;)f[u]=t[u];for(;++o<a;)(h||o<s)&&(f[r[o]]=e[o]);for(;l--;)f[u++]=e[o++];return f}function Oi(e,t,r,i){for(var o=-1,s=e.length,a=-1,u=r.length,c=-1,l=t.length,f=vr(s-u,0),h=n(f+l),d=!i;++o<f;)h[o]=e[o];for(var p=o;++c<l;)h[p+c]=t[c];for(;++a<u;)(d||o<s)&&(h[p+r[a]]=e[o++]);return h}function Ci(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function xi(e,t,r,n){var o=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var u=t[s],c=n?n(r[u],e[u],u,r,e):i;c===i&&(c=e[u]),o?rn(r,u,c):Zr(r,u,c)}return r}function Pi(e,t){return function(r,n){var i=qs(r)?Tt:en,o=t?t():{};return i(r,e,oo(n,2),o)}}function Ri(e){return $n((function(t,r){var n=-1,o=r.length,s=o>1?r[o-1]:i,a=o>2?r[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&go(r[0],r[1],a)&&(s=o<3?i:s,o=1),t=Te(t);++n<o;){var u=r[n];u&&e(t,u,n,s)}return t}))}function Mi(e,t){return function(r,n){if(null==r)return r;if(!Hs(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Te(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function Ai(e){return function(t,r,n){for(var i=-1,o=Te(t),s=n(t),a=s.length;a--;){var u=s[e?a:++i];if(!1===r(o[u],u,o))break}return t}}function ji(e){return function(t){var r=nr(t=ga(t))?lr(t):i,n=r?r[0]:t.charAt(0),o=r?yi(r,1).join(""):t.slice(1);return n[e]()+o}}function ki(e){return function(t){return kt(Xa(Va(t).replace(Xe,"")),e,"")}}function Ii(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return Qs(n)?n:r}}function Di(e){return function(t,r,n){var o=Te(t);if(!Hs(t)){var s=oo(r,3);t=Ma(t),r=function(e){return s(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[s?t[a]:a]:i}}function Ni(e){return Qi((function(t){var r=t.length,n=r,s=Br.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new xe(o);if(s&&!u&&"wrapper"==no(a))var u=new Br([],!0)}for(n=u?n:r;++n<r;){var c=no(a=t[n]),l="wrapper"==c?ro(a):i;u=l&&bo(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[no(l[0])].apply(u,l[3]):1==a.length&&bo(a)?u[c]():u.thru(a)}return function(){var e=arguments,n=e[0];if(u&&1==e.length&&qs(n))return u.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Li(e,t,r,o,s,a,u,l,f,h){var d=t&c,p=1&t,v=2&t,m=24&t,g=512&t,y=v?i:Ii(e);return function c(){for(var b=arguments.length,_=n(b),w=b;w--;)_[w]=arguments[w];if(m)var S=io(c),E=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(_,S);if(o&&(_=Ti(_,o,s,m)),a&&(_=Oi(_,a,u,m)),b-=E,m&&b<h){var T=sr(_,S);return zi(e,t,Li,c.placeholder,r,_,T,l,f,h-b)}var O=p?r:this,C=v?O[e]:e;return b=_.length,l?_=function(e,t){for(var r=e.length,n=mr(t.length,r),o=Ci(e);n--;){var s=t[n];e[n]=mo(s,r)?o[s]:i}return e}(_,l):g&&b>1&&_.reverse(),d&&f<b&&(_.length=f),this&&this!==ft&&this instanceof c&&(C=y||Ii(C)),C.apply(O,_)}}function Fi(e,t){return function(r,n){return function(e,t,r,n){return yn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function Ui(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=si(r),n=si(n)):(r=oi(r),n=oi(n)),o=e(r,n)}return o}}function Bi(e){return Qi((function(t){return t=At(t,Kt(oo())),$n((function(r){var n=this;return e(t,(function(e){return Et(e,n,r)}))}))}))}function Wi(e,t){var r=(t=t===i?" ":si(t)).length;if(r<2)return r?Gn(t,e):t;var n=Gn(t,ht(e/cr(t)));return nr(t)?yi(lr(n),0,e).join(""):n.slice(0,e)}function Vi(e){return function(t,r,o){return o&&"number"!=typeof o&&go(t,r,o)&&(r=o=i),t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r,i){for(var o=-1,s=vr(ht((t-e)/(r||1)),0),a=n(s);s--;)a[i?s:++o]=e,e+=r;return a}(t,r,o=o===i?t<r?1:-1:ha(o),e)}}function qi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=va(t),r=va(r)),e(t,r)}}function zi(e,t,r,n,o,s,a,c,l,f){var h=8&t;t|=h?u:64,4&(t&=~(h?64:u))||(t&=-4);var d=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,c,l,f],p=r.apply(i,d);return bo(e)&&xo(p,d),p.placeholder=n,Mo(p,e,t)}function Hi(e){var t=Ee[e];return function(e,r){if(e=va(e),(r=null==r?0:mr(da(r),292))&&Nt(e)){var n=(ga(e)+"e").split("e");return+((n=(ga(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Gi=Tr&&1/ar(new Tr([,-0]))[1]==l?function(e){return new Tr(e)}:au;function $i(e){return function(t){var r=fo(t);return r==S?ir(t):r==x?ur(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Yi(e,t,r,s,l,f,h,d){var p=2&t;if(!p&&"function"!=typeof e)throw new xe(o);var v=s?s.length:0;if(v||(t&=-97,s=l=i),h=h===i?h:vr(da(h),0),d=d===i?d:da(d),v-=l?l.length:0,64&t){var m=s,g=l;s=l=i}var y=p?i:ro(e),b=[e,t,r,s,l,m,g,f,h,d];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=n==c&&8==r||n==c&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?Ti(l,u,t[4]):u,e[4]=l?sr(e[3],a):t[4]}(u=t[5])&&(l=e[5],e[5]=l?Oi(l,u,t[6]):u,e[6]=l?sr(e[5],a):t[6]),(u=t[7])&&(e[7]=u),n&c&&(e[8]=null==e[8]?t[8]:mr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,y),e=b[0],t=b[1],r=b[2],s=b[3],l=b[4],!(d=b[9]=b[9]===i?p?0:e.length:vr(b[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,r){var o=Ii(e);return function s(){for(var a=arguments.length,u=n(a),c=a,l=io(s);c--;)u[c]=arguments[c];var f=a<3&&u[0]!==l&&u[a-1]!==l?[]:sr(u,l);return(a-=f.length)<r?zi(e,t,Li,s.placeholder,i,u,f,i,i,r-a):Et(this&&this!==ft&&this instanceof s?o:e,this,u)}}(e,t,d):t!=u&&33!=t||l.length?Li.apply(i,b):function(e,t,r,i){var o=1&t,s=Ii(e);return function t(){for(var a=-1,u=arguments.length,c=-1,l=i.length,f=n(l+u),h=this&&this!==ft&&this instanceof t?s:e;++c<l;)f[c]=i[c];for(;u--;)f[c++]=arguments[++a];return Et(h,o?r:this,f)}}(e,t,r,s);else var _=function(e,t,r){var n=1&t,i=Ii(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Mo((y?Jn:xo)(_,b),e,t)}function Ki(e,t,r,n){return e===i||Us(e,Me[r])&&!ke.call(n,r)?t:e}function Xi(e,t,r,n,o,s){return Qs(e)&&Qs(t)&&(s.set(t,e),Un(e,t,i,Xi,s),s.delete(t)),e}function Ji(e){return na(e)?i:e}function Zi(e,t,r,n,o,s){var a=1&r,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var l=s.get(e),f=s.get(t);if(l&&f)return l==t&&f==e;var h=-1,d=!0,p=2&r?new Hr:i;for(s.set(e,t),s.set(t,e);++h<u;){var v=e[h],m=t[h];if(n)var g=a?n(m,v,h,t,e,s):n(v,m,h,e,t,s);if(g!==i){if(g)continue;d=!1;break}if(p){if(!Dt(t,(function(e,t){if(!Jt(p,t)&&(v===e||o(v,e,r,n,s)))return p.push(t)}))){d=!1;break}}else if(v!==m&&!o(v,m,r,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function Qi(e){return Ro(To(e,i,zo),e+"")}function eo(e){return Sn(e,Ma,co)}function to(e){return Sn(e,Aa,lo)}var ro=xr?function(e){return xr.get(e)}:au;function no(e){for(var t=e.name+"",r=Pr[t],n=ke.call(Pr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(ke.call(Lr,"placeholder")?Lr:e).placeholder}function oo(){var e=Lr.iteratee||nu;return e=e===nu?kn:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ma(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,So(i)]}return t}function uo(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return jn(r)?r:i}var co=vt?function(e){return null==e?[]:(e=Te(e),Pt(vt(e),(function(t){return Ge.call(e,t)})))}:pu,lo=vt?function(e){for(var t=[];e;)jt(t,co(e)),e=ze(e);return t}:pu,fo=En;function ho(e,t,r){for(var n=-1,i=(t=mi(t,e)).length,o=!1;++n<i;){var s=No(t[n]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Zs(i)&&mo(s,i)&&(qs(e)||Vs(e))}function po(e){return"function"!=typeof e.constructor||wo(e)?{}:Fr(ze(e))}function vo(e){return qs(e)||Vs(e)||!!(Ye&&e&&e[Ye])}function mo(e,t){var r=typeof e;return!!(t=null==t?f:t)&&("number"==r||"symbol"!=r&&ge.test(e))&&e>-1&&e%1==0&&e<t}function go(e,t,r){if(!Qs(r))return!1;var n=typeof t;return!!("number"==n?Hs(r)&&mo(t,r.length):"string"==n&&t in r)&&Us(r[t],e)}function yo(e,t){if(qs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!aa(e))||Q.test(e)||!Z.test(e)||null!=t&&e in Te(t)}function bo(e){var t=no(e),r=Lr[t];if("function"!=typeof r||!(t in Wr.prototype))return!1;if(e===r)return!0;var n=ro(r);return!!n&&e===n[0]}(wr&&fo(new wr(new ArrayBuffer(1)))!=j||Sr&&fo(new Sr)!=S||Er&&fo(Er.resolve())!=O||Tr&&fo(new Tr)!=x||Or&&fo(new Or)!=M)&&(fo=function(e){var t=En(e),r=t==T?e.constructor:i,n=r?Lo(r):"";if(n)switch(n){case Rr:return j;case Mr:return S;case Ar:return O;case jr:return x;case kr:return M}return t});var _o=Ae?Xs:vu;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function So(e){return e==e&&!Qs(e)}function Eo(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in Te(r))}}function To(e,t,r){return t=vr(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=vr(i.length-t,0),a=n(s);++o<s;)a[o]=i[t+o];o=-1;for(var u=n(t+1);++o<t;)u[o]=i[o];return u[t]=r(a),Et(e,this,u)}}function Oo(e,t){return t.length<2?e:wn(e,ei(t,0,-1))}function Co(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var xo=Ao(Jn),Po=lt||function(e,t){return ft.setTimeout(e,t)},Ro=Ao(Zn);function Mo(e,t,r){var n=t+"";return Ro(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ot(p,(function(r){var n="_."+r[0];t&r[1]&&!Rt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(n),r)))}function Ao(e){var t=0,r=0;return function(){var n=gr(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function jo(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var s=Hn(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=t,e}var ko,Io,Do=(ko=ks((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(le,"$1"):r||e)})),t}),(function(e){return 500===Io.size&&Io.clear(),e})),Io=ko.cache,ko);function No(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return je.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fo(e){if(e instanceof Wr)return e.clone();var t=new Br(e.__wrapped__,e.__chain__);return t.__actions__=Ci(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Uo=$n((function(e,t){return Gs(e)?cn(e,vn(t,1,Gs,!0)):[]})),Bo=$n((function(e,t){var r=Ko(t);return Gs(r)&&(r=i),Gs(e)?cn(e,vn(t,1,Gs,!0),oo(r,2)):[]})),Wo=$n((function(e,t){var r=Ko(t);return Gs(r)&&(r=i),Gs(e)?cn(e,vn(t,1,Gs,!0),i,r):[]}));function Vo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=vr(n+i,0)),Ft(e,oo(t,3),i)}function qo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=da(r),o=r<0?vr(n+o,0):mr(o,n-1)),Ft(e,oo(t,3),o,!0)}function zo(e){return null!=e&&e.length?vn(e,1):[]}function Ho(e){return e&&e.length?e[0]:i}var Go=$n((function(e){var t=At(e,pi);return t.length&&t[0]===e[0]?xn(t):[]})),$o=$n((function(e){var t=Ko(e),r=At(e,pi);return t===Ko(r)?t=i:r.pop(),r.length&&r[0]===e[0]?xn(r,oo(t,2)):[]})),Yo=$n((function(e){var t=Ko(e),r=At(e,pi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?xn(r,i,t):[]}));function Ko(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Xo=$n(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?qn(e,t):e}var Zo=Qi((function(e,t){var r=null==e?0:e.length,n=nn(e,t);return zn(e,At(t,(function(e){return mo(e,r)?+e:e})).sort(Ei)),n}));function Qo(e){return null==e?e:_r.call(e)}var es=$n((function(e){return ai(vn(e,1,Gs,!0))})),ts=$n((function(e){var t=Ko(e);return Gs(t)&&(t=i),ai(vn(e,1,Gs,!0),oo(t,2))})),rs=$n((function(e){var t=Ko(e);return t="function"==typeof t?t:i,ai(vn(e,1,Gs,!0),i,t)}));function ns(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,(function(e){if(Gs(e))return t=vr(e.length,t),!0})),$t(t,(function(t){return At(e,qt(t))}))}function is(e,t){if(!e||!e.length)return[];var r=ns(e);return null==t?r:At(r,(function(e){return Et(t,i,e)}))}var os=$n((function(e,t){return Gs(e)?cn(e,t):[]})),ss=$n((function(e){return hi(Pt(e,Gs))})),as=$n((function(e){var t=Ko(e);return Gs(t)&&(t=i),hi(Pt(e,Gs),oo(t,2))})),us=$n((function(e){var t=Ko(e);return t="function"==typeof t?t:i,hi(Pt(e,Gs),i,t)})),cs=$n(ns),ls=$n((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,is(e,r)}));function fs(e){var t=Lr(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ds=Qi((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Wr&&mo(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Br(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Pi((function(e,t,r){ke.call(e,r)?++e[r]:rn(e,r,1)})),vs=Di(Vo),ms=Di(qo);function gs(e,t){return(qs(e)?Ot:ln)(e,oo(t,3))}function ys(e,t){return(qs(e)?Ct:fn)(e,oo(t,3))}var bs=Pi((function(e,t,r){ke.call(e,r)?e[r].push(t):rn(e,r,[t])})),_s=$n((function(e,t,r){var i=-1,o="function"==typeof t,s=Hs(e)?n(e.length):[];return ln(e,(function(e){s[++i]=o?Et(t,e,r):Pn(e,t,r)})),s})),ws=Pi((function(e,t,r){rn(e,r,t)}));function Ss(e,t){return(qs(e)?At:Nn)(e,oo(t,3))}var Es=Pi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ts=$n((function(e,t){if(null==e)return[];var r=t.length;return r>1&&go(e,t[0],t[1])?t=[]:r>2&&go(t[0],t[1],t[2])&&(t=[t[0]]),Wn(e,vn(t,1),[])})),Os=ct||function(){return ft.Date.now()};function Cs(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Yi(e,c,i,i,i,i,t)}function xs(e,t){var r;if("function"!=typeof t)throw new xe(o);return e=da(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var Ps=$n((function(e,t,r){var n=1;if(r.length){var i=sr(r,io(Ps));n|=u}return Yi(e,n,t,r,i)})),Rs=$n((function(e,t,r){var n=3;if(r.length){var i=sr(r,io(Rs));n|=u}return Yi(t,n,e,r,i)}));function Ms(e,t,r){var n,s,a,u,c,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new xe(o);function v(t){var r=n,o=s;return n=s=i,f=t,u=e.apply(o,r)}function m(e){var r=e-l;return l===i||r>=t||r<0||d&&e-f>=a}function g(){var e=Os();if(m(e))return y(e);c=Po(g,function(e){var r=t-(e-l);return d?mr(r,a-(e-f)):r}(e))}function y(e){return c=i,p&&n?v(e):(n=s=i,u)}function b(){var e=Os(),r=m(e);if(n=arguments,s=this,l=e,r){if(c===i)return function(e){return f=e,c=Po(g,t),h?v(e):u}(l);if(d)return bi(c),c=Po(g,t),v(l)}return c===i&&(c=Po(g,t)),u}return t=va(t)||0,Qs(r)&&(h=!!r.leading,a=(d="maxWait"in r)?vr(va(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),b.cancel=function(){c!==i&&bi(c),f=0,n=l=s=c=i},b.flush=function(){return c===i?u:y(Os())},b}var As=$n((function(e,t){return un(e,1,t)})),js=$n((function(e,t,r){return un(e,va(t)||0,r)}));function ks(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(ks.Cache||zr),r}function Is(e){if("function"!=typeof e)throw new xe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ks.Cache=zr;var Ds=gi((function(e,t){var r=(t=1==t.length&&qs(t[0])?At(t[0],Kt(oo())):At(vn(t,1),Kt(oo()))).length;return $n((function(n){for(var i=-1,o=mr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return Et(e,this,n)}))})),Ns=$n((function(e,t){var r=sr(t,io(Ns));return Yi(e,u,i,t,r)})),Ls=$n((function(e,t){var r=sr(t,io(Ls));return Yi(e,64,i,t,r)})),Fs=Qi((function(e,t){return Yi(e,256,i,i,i,t)}));function Us(e,t){return e===t||e!=e&&t!=t}var Bs=qi(Tn),Ws=qi((function(e,t){return e>=t})),Vs=Rn(function(){return arguments}())?Rn:function(e){return ea(e)&&ke.call(e,"callee")&&!Ge.call(e,"callee")},qs=n.isArray,zs=gt?Kt(gt):function(e){return ea(e)&&En(e)==A};function Hs(e){return null!=e&&Zs(e.length)&&!Xs(e)}function Gs(e){return ea(e)&&Hs(e)}var $s=mt||vu,Ys=yt?Kt(yt):function(e){return ea(e)&&En(e)==y};function Ks(e){if(!ea(e))return!1;var t=En(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!na(e)}function Xs(e){if(!Qs(e))return!1;var t=En(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==da(e)}function Zs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function Qs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=bt?Kt(bt):function(e){return ea(e)&&fo(e)==S};function ra(e){return"number"==typeof e||ea(e)&&En(e)==E}function na(e){if(!ea(e)||En(e)!=T)return!1;var t=ze(e);if(null===t)return!0;var r=ke.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==Le}var ia=_t?Kt(_t):function(e){return ea(e)&&En(e)==C},oa=wt?Kt(wt):function(e){return ea(e)&&fo(e)==x};function sa(e){return"string"==typeof e||!qs(e)&&ea(e)&&En(e)==P}function aa(e){return"symbol"==typeof e||ea(e)&&En(e)==R}var ua=St?Kt(St):function(e){return ea(e)&&Zs(e.length)&&!!it[En(e)]},ca=qi(Dn),la=qi((function(e,t){return e<=t}));function fa(e){if(!e)return[];if(Hs(e))return sa(e)?lr(e):Ci(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=fo(e);return(t==S?ir:t==x?ar:Ua)(e)}function ha(e){return e?(e=va(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=ha(e),r=t%1;return t==t?r?t-r:t:0}function pa(e){return e?on(da(e),0,d):0}function va(e){if("number"==typeof e)return e;if(aa(e))return h;if(Qs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=pe.test(e);return r||me.test(e)?ut(e.slice(2),r?2:8):de.test(e)?h:+e}function ma(e){return xi(e,Aa(e))}function ga(e){return null==e?"":si(e)}var ya=Ri((function(e,t){if(wo(t)||Hs(t))xi(t,Ma(t),e);else for(var r in t)ke.call(t,r)&&Zr(e,r,t[r])})),ba=Ri((function(e,t){xi(t,Aa(t),e)})),_a=Ri((function(e,t,r,n){xi(t,Aa(t),e,n)})),wa=Ri((function(e,t,r,n){xi(t,Ma(t),e,n)})),Sa=Qi(nn),Ea=$n((function(e,t){e=Te(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&go(t[0],t[1],o)&&(n=1);++r<n;)for(var s=t[r],a=Aa(s),u=-1,c=a.length;++u<c;){var l=a[u],f=e[l];(f===i||Us(f,Me[l])&&!ke.call(e,l))&&(e[l]=s[l])}return e})),Ta=$n((function(e){return e.push(i,Xi),Et(ka,i,e)}));function Oa(e,t,r){var n=null==e?i:wn(e,t);return n===i?r:n}function Ca(e,t){return null!=e&&ho(e,t,Cn)}var xa=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=r}),Qa(ru)),Pa=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),ke.call(e,t)?e[t].push(r):e[t]=[r]}),oo),Ra=$n(Pn);function Ma(e){return Hs(e)?$r(e):In(e)}function Aa(e){return Hs(e)?$r(e,!0):function(e){if(!Qs(e))return function(e){var t=[];if(null!=e)for(var r in Te(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&ke.call(e,n))&&r.push(n);return r}(e)}var ja=Ri((function(e,t,r){Un(e,t,r)})),ka=Ri((function(e,t,r,n){Un(e,t,r,n)})),Ia=Qi((function(e,t){var r={};if(null==e)return r;var n=!1;t=At(t,(function(t){return t=mi(t,e),n||(n=t.length>1),t})),xi(e,to(e),r),n&&(r=sn(r,7,Ji));for(var i=t.length;i--;)ui(r,t[i]);return r})),Da=Qi((function(e,t){return null==e?{}:function(e,t){return Vn(e,t,(function(t,r){return Ca(e,r)}))}(e,t)}));function Na(e,t){if(null==e)return{};var r=At(to(e),(function(e){return[e]}));return t=oo(t),Vn(e,r,(function(e,r){return t(e,r[0])}))}var La=$i(Ma),Fa=$i(Aa);function Ua(e){return null==e?[]:Xt(e,Ma(e))}var Ba=ki((function(e,t,r){return t=t.toLowerCase(),e+(r?Wa(t):t)}));function Wa(e){return Ka(ga(e).toLowerCase())}function Va(e){return(e=ga(e))&&e.replace(ye,er).replace(Je,"")}var qa=ki((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),za=ki((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ha=ji("toLowerCase"),Ga=ki((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),$a=ki((function(e,t,r){return e+(r?" ":"")+Ka(t)})),Ya=ki((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ka=ji("toUpperCase");function Xa(e,t,r){return e=ga(e),(t=r?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Ja=$n((function(e,t){try{return Et(e,i,t)}catch(e){return Ks(e)?e:new we(e)}})),Za=Qi((function(e,t){return Ot(t,(function(t){t=No(t),rn(e,t,Ps(e[t],e))})),e}));function Qa(e){return function(){return e}}var eu=Ni(),tu=Ni(!0);function ru(e){return e}function nu(e){return kn("function"==typeof e?e:sn(e,1))}var iu=$n((function(e,t){return function(r){return Pn(r,e,t)}})),ou=$n((function(e,t){return function(r){return Pn(e,r,t)}}));function su(e,t,r){var n=Ma(t),i=_n(t,n);null!=r||Qs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=_n(t,Ma(t)));var o=!(Qs(r)&&"chain"in r&&!r.chain),s=Xs(e);return Ot(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ci(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function au(){}var uu=Bi(At),cu=Bi(xt),lu=Bi(Dt);function fu(e){return yo(e)?qt(No(e)):function(e){return function(t){return wn(t,e)}}(e)}var hu=Vi(),du=Vi(!0);function pu(){return[]}function vu(){return!1}var mu,gu=Ui((function(e,t){return e+t}),0),yu=Hi("ceil"),bu=Ui((function(e,t){return e/t}),1),_u=Hi("floor"),wu=Ui((function(e,t){return e*t}),1),Su=Hi("round"),Eu=Ui((function(e,t){return e-t}),0);return Lr.after=function(e,t){if("function"!=typeof t)throw new xe(o);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Lr.ary=Cs,Lr.assign=ya,Lr.assignIn=ba,Lr.assignInWith=_a,Lr.assignWith=wa,Lr.at=Sa,Lr.before=xs,Lr.bind=Ps,Lr.bindAll=Za,Lr.bindKey=Rs,Lr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qs(e)?e:[e]},Lr.chain=fs,Lr.chunk=function(e,t,r){t=(r?go(e,t,r):t===i)?1:vr(da(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,u=n(ht(o/t));s<o;)u[a++]=ei(e,s,s+=t);return u},Lr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Lr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return jt(qs(r)?Ci(r):[r],vn(t,1))},Lr.cond=function(e){var t=null==e?0:e.length,r=oo();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new xe(o);return[r(e[0]),e[1]]})):[],$n((function(r){for(var n=-1;++n<t;){var i=e[n];if(Et(i[0],this,r))return Et(i[1],this,r)}}))},Lr.conforms=function(e){return function(e){var t=Ma(e);return function(r){return an(r,e,t)}}(sn(e,1))},Lr.constant=Qa,Lr.countBy=ps,Lr.create=function(e,t){var r=Fr(e);return null==t?r:tn(r,t)},Lr.curry=function e(t,r,n){var o=Yi(t,8,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Lr.curryRight=function e(t,r,n){var o=Yi(t,16,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Lr.debounce=Ms,Lr.defaults=Ea,Lr.defaultsDeep=Ta,Lr.defer=As,Lr.delay=js,Lr.difference=Uo,Lr.differenceBy=Bo,Lr.differenceWith=Wo,Lr.drop=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=r||t===i?1:da(t))<0?0:t,n):[]},Lr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,0,(t=n-(t=r||t===i?1:da(t)))<0?0:t):[]},Lr.dropRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0,!0):[]},Lr.dropWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0):[]},Lr.fill=function(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&go(e,t,r)&&(r=0,n=o),function(e,t,r,n){var o=e.length;for((r=da(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:da(n))<0&&(n+=o),n=r>n?0:pa(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Lr.filter=function(e,t){return(qs(e)?Pt:pn)(e,oo(t,3))},Lr.flatMap=function(e,t){return vn(Ss(e,t),1)},Lr.flatMapDeep=function(e,t){return vn(Ss(e,t),l)},Lr.flatMapDepth=function(e,t,r){return r=r===i?1:da(r),vn(Ss(e,t),r)},Lr.flatten=zo,Lr.flattenDeep=function(e){return null!=e&&e.length?vn(e,l):[]},Lr.flattenDepth=function(e,t){return null!=e&&e.length?vn(e,t=t===i?1:da(t)):[]},Lr.flip=function(e){return Yi(e,512)},Lr.flow=eu,Lr.flowRight=tu,Lr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Lr.functions=function(e){return null==e?[]:_n(e,Ma(e))},Lr.functionsIn=function(e){return null==e?[]:_n(e,Aa(e))},Lr.groupBy=bs,Lr.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Lr.intersection=Go,Lr.intersectionBy=$o,Lr.intersectionWith=Yo,Lr.invert=xa,Lr.invertBy=Pa,Lr.invokeMap=_s,Lr.iteratee=nu,Lr.keyBy=ws,Lr.keys=Ma,Lr.keysIn=Aa,Lr.map=Ss,Lr.mapKeys=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,t(e,n,i),e)})),r},Lr.mapValues=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,n,t(e,n,i))})),r},Lr.matches=function(e){return Ln(sn(e,1))},Lr.matchesProperty=function(e,t){return Fn(e,sn(t,1))},Lr.memoize=ks,Lr.merge=ja,Lr.mergeWith=ka,Lr.method=iu,Lr.methodOf=ou,Lr.mixin=su,Lr.negate=Is,Lr.nthArg=function(e){return e=da(e),$n((function(t){return Bn(t,e)}))},Lr.omit=Ia,Lr.omitBy=function(e,t){return Na(e,Is(oo(t)))},Lr.once=function(e){return xs(2,e)},Lr.orderBy=function(e,t,r,n){return null==e?[]:(qs(t)||(t=null==t?[]:[t]),qs(r=n?i:r)||(r=null==r?[]:[r]),Wn(e,t,r))},Lr.over=uu,Lr.overArgs=Ds,Lr.overEvery=cu,Lr.overSome=lu,Lr.partial=Ns,Lr.partialRight=Ls,Lr.partition=Es,Lr.pick=Da,Lr.pickBy=Na,Lr.property=fu,Lr.propertyOf=function(e){return function(t){return null==e?i:wn(e,t)}},Lr.pull=Xo,Lr.pullAll=Jo,Lr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,oo(r,2)):e},Lr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,i,r):e},Lr.pullAt=Zo,Lr.range=hu,Lr.rangeRight=du,Lr.rearg=Fs,Lr.reject=function(e,t){return(qs(e)?Pt:pn)(e,Is(oo(t,3)))},Lr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=oo(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return zn(e,i),r},Lr.rest=function(e,t){if("function"!=typeof e)throw new xe(o);return $n(e,t=t===i?t:da(t))},Lr.reverse=Qo,Lr.sampleSize=function(e,t,r){return t=(r?go(e,t,r):t===i)?1:da(t),(qs(e)?Kr:Kn)(e,t)},Lr.set=function(e,t,r){return null==e?e:Xn(e,t,r)},Lr.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:Xn(e,t,r,n)},Lr.shuffle=function(e){return(qs(e)?Xr:Qn)(e)},Lr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&go(e,t,r)?(t=0,r=n):(t=null==t?0:da(t),r=r===i?n:da(r)),ei(e,t,r)):[]},Lr.sortBy=Ts,Lr.sortedUniq=function(e){return e&&e.length?ii(e):[]},Lr.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Lr.split=function(e,t,r){return r&&"number"!=typeof r&&go(e,t,r)&&(t=r=i),(r=r===i?d:r>>>0)?(e=ga(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&nr(e)?yi(lr(e),0,r):e.split(t,r):[]},Lr.spread=function(e,t){if("function"!=typeof e)throw new xe(o);return t=null==t?0:vr(da(t),0),$n((function(r){var n=r[t],i=yi(r,0,t);return n&&jt(i,n),Et(e,this,i)}))},Lr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Lr.take=function(e,t,r){return e&&e.length?ei(e,0,(t=r||t===i?1:da(t))<0?0:t):[]},Lr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=n-(t=r||t===i?1:da(t)))<0?0:t,n):[]},Lr.takeRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!1,!0):[]},Lr.takeWhile=function(e,t){return e&&e.length?li(e,oo(t,3)):[]},Lr.tap=function(e,t){return t(e),e},Lr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new xe(o);return Qs(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ms(e,t,{leading:n,maxWait:t,trailing:i})},Lr.thru=hs,Lr.toArray=fa,Lr.toPairs=La,Lr.toPairsIn=Fa,Lr.toPath=function(e){return qs(e)?At(e,No):aa(e)?[e]:Ci(Do(ga(e)))},Lr.toPlainObject=ma,Lr.transform=function(e,t,r){var n=qs(e),i=n||$s(e)||ua(e);if(t=oo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Qs(e)&&Xs(o)?Fr(ze(e)):{}}return(i?Ot:yn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Lr.unary=function(e){return Cs(e,1)},Lr.union=es,Lr.unionBy=ts,Lr.unionWith=rs,Lr.uniq=function(e){return e&&e.length?ai(e):[]},Lr.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Lr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Lr.unset=function(e,t){return null==e||ui(e,t)},Lr.unzip=ns,Lr.unzipWith=is,Lr.update=function(e,t,r){return null==e?e:ci(e,t,vi(r))},Lr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ci(e,t,vi(r),n)},Lr.values=Ua,Lr.valuesIn=function(e){return null==e?[]:Xt(e,Aa(e))},Lr.without=os,Lr.words=Xa,Lr.wrap=function(e,t){return Ns(vi(t),e)},Lr.xor=ss,Lr.xorBy=as,Lr.xorWith=us,Lr.zip=cs,Lr.zipObject=function(e,t){return di(e||[],t||[],Zr)},Lr.zipObjectDeep=function(e,t){return di(e||[],t||[],Xn)},Lr.zipWith=ls,Lr.entries=La,Lr.entriesIn=Fa,Lr.extend=ba,Lr.extendWith=_a,su(Lr,Lr),Lr.add=gu,Lr.attempt=Ja,Lr.camelCase=Ba,Lr.capitalize=Wa,Lr.ceil=yu,Lr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=va(r))==r?r:0),t!==i&&(t=(t=va(t))==t?t:0),on(va(e),t,r)},Lr.clone=function(e){return sn(e,4)},Lr.cloneDeep=function(e){return sn(e,5)},Lr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:i)},Lr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:i)},Lr.conformsTo=function(e,t){return null==t||an(e,t,Ma(t))},Lr.deburr=Va,Lr.defaultTo=function(e,t){return null==e||e!=e?t:e},Lr.divide=bu,Lr.endsWith=function(e,t,r){e=ga(e),t=si(t);var n=e.length,o=r=r===i?n:on(da(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Lr.eq=Us,Lr.escape=function(e){return(e=ga(e))&&Y.test(e)?e.replace(G,tr):e},Lr.escapeRegExp=function(e){return(e=ga(e))&&re.test(e)?e.replace(te,"\\$&"):e},Lr.every=function(e,t,r){var n=qs(e)?xt:hn;return r&&go(e,t,r)&&(t=i),n(e,oo(t,3))},Lr.find=vs,Lr.findIndex=Vo,Lr.findKey=function(e,t){return Lt(e,oo(t,3),yn)},Lr.findLast=ms,Lr.findLastIndex=qo,Lr.findLastKey=function(e,t){return Lt(e,oo(t,3),bn)},Lr.floor=_u,Lr.forEach=gs,Lr.forEachRight=ys,Lr.forIn=function(e,t){return null==e?e:mn(e,oo(t,3),Aa)},Lr.forInRight=function(e,t){return null==e?e:gn(e,oo(t,3),Aa)},Lr.forOwn=function(e,t){return e&&yn(e,oo(t,3))},Lr.forOwnRight=function(e,t){return e&&bn(e,oo(t,3))},Lr.get=Oa,Lr.gt=Bs,Lr.gte=Ws,Lr.has=function(e,t){return null!=e&&ho(e,t,On)},Lr.hasIn=Ca,Lr.head=Ho,Lr.identity=ru,Lr.includes=function(e,t,r,n){e=Hs(e)?e:Ua(e),r=r&&!n?da(r):0;var i=e.length;return r<0&&(r=vr(i+r,0)),sa(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ut(e,t,r)>-1},Lr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=vr(n+i,0)),Ut(e,t,i)},Lr.inRange=function(e,t,r){return t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r){return e>=mr(t,r)&&e<vr(t,r)}(e=va(e),t,r)},Lr.invoke=Ra,Lr.isArguments=Vs,Lr.isArray=qs,Lr.isArrayBuffer=zs,Lr.isArrayLike=Hs,Lr.isArrayLikeObject=Gs,Lr.isBoolean=function(e){return!0===e||!1===e||ea(e)&&En(e)==g},Lr.isBuffer=$s,Lr.isDate=Ys,Lr.isElement=function(e){return ea(e)&&1===e.nodeType&&!na(e)},Lr.isEmpty=function(e){if(null==e)return!0;if(Hs(e)&&(qs(e)||"string"==typeof e||"function"==typeof e.splice||$s(e)||ua(e)||Vs(e)))return!e.length;var t=fo(e);if(t==S||t==x)return!e.size;if(wo(e))return!In(e).length;for(var r in e)if(ke.call(e,r))return!1;return!0},Lr.isEqual=function(e,t){return Mn(e,t)},Lr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Mn(e,t,i,r):!!n},Lr.isError=Ks,Lr.isFinite=function(e){return"number"==typeof e&&Nt(e)},Lr.isFunction=Xs,Lr.isInteger=Js,Lr.isLength=Zs,Lr.isMap=ta,Lr.isMatch=function(e,t){return e===t||An(e,t,ao(t))},Lr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,An(e,t,ao(t),r)},Lr.isNaN=function(e){return ra(e)&&e!=+e},Lr.isNative=function(e){if(_o(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return jn(e)},Lr.isNil=function(e){return null==e},Lr.isNull=function(e){return null===e},Lr.isNumber=ra,Lr.isObject=Qs,Lr.isObjectLike=ea,Lr.isPlainObject=na,Lr.isRegExp=ia,Lr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=f},Lr.isSet=oa,Lr.isString=sa,Lr.isSymbol=aa,Lr.isTypedArray=ua,Lr.isUndefined=function(e){return e===i},Lr.isWeakMap=function(e){return ea(e)&&fo(e)==M},Lr.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==En(e)},Lr.join=function(e,t){return null==e?"":zt.call(e,t)},Lr.kebabCase=qa,Lr.last=Ko,Lr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=da(r))<0?vr(n+o,0):mr(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ft(e,Wt,o,!0)},Lr.lowerCase=za,Lr.lowerFirst=Ha,Lr.lt=ca,Lr.lte=la,Lr.max=function(e){return e&&e.length?dn(e,ru,Tn):i},Lr.maxBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Tn):i},Lr.mean=function(e){return Vt(e,ru)},Lr.meanBy=function(e,t){return Vt(e,oo(t,2))},Lr.min=function(e){return e&&e.length?dn(e,ru,Dn):i},Lr.minBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Dn):i},Lr.stubArray=pu,Lr.stubFalse=vu,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=wu,Lr.nth=function(e,t){return e&&e.length?Bn(e,da(t)):i},Lr.noConflict=function(){return ft._===this&&(ft._=Fe),this},Lr.noop=au,Lr.now=Os,Lr.pad=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Wi(dt(i),r)+e+Wi(ht(i),r)},Lr.padEnd=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;return t&&n<t?e+Wi(t-n,r):e},Lr.padStart=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;return t&&n<t?Wi(t-n,r)+e:e},Lr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),yr(ga(e).replace(ne,""),t||0)},Lr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&go(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=br();return mr(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Hn(e,t)},Lr.reduce=function(e,t,r){var n=qs(e)?kt:Ht,i=arguments.length<3;return n(e,oo(t,4),r,i,ln)},Lr.reduceRight=function(e,t,r){var n=qs(e)?It:Ht,i=arguments.length<3;return n(e,oo(t,4),r,i,fn)},Lr.repeat=function(e,t,r){return t=(r?go(e,t,r):t===i)?1:da(t),Gn(ga(e),t)},Lr.replace=function(){var e=arguments,t=ga(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Lr.result=function(e,t,r){var n=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++n<o;){var s=null==e?i:e[No(t[n])];s===i&&(n=o,s=r),e=Xs(s)?s.call(e):s}return e},Lr.round=Su,Lr.runInContext=e,Lr.sample=function(e){return(qs(e)?Yr:Yn)(e)},Lr.size=function(e){if(null==e)return 0;if(Hs(e))return sa(e)?cr(e):e.length;var t=fo(e);return t==S||t==x?e.size:In(e).length},Lr.snakeCase=Ga,Lr.some=function(e,t,r){var n=qs(e)?Dt:ti;return r&&go(e,t,r)&&(t=i),n(e,oo(t,3))},Lr.sortedIndex=function(e,t){return ri(e,t)},Lr.sortedIndexBy=function(e,t,r){return ni(e,t,oo(r,2))},Lr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ri(e,t);if(n<r&&Us(e[n],t))return n}return-1},Lr.sortedLastIndex=function(e,t){return ri(e,t,!0)},Lr.sortedLastIndexBy=function(e,t,r){return ni(e,t,oo(r,2),!0)},Lr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ri(e,t,!0)-1;if(Us(e[r],t))return r}return-1},Lr.startCase=$a,Lr.startsWith=function(e,t,r){return e=ga(e),r=null==r?0:on(da(r),0,e.length),t=si(t),e.slice(r,r+t.length)==t},Lr.subtract=Eu,Lr.sum=function(e){return e&&e.length?Gt(e,ru):0},Lr.sumBy=function(e,t){return e&&e.length?Gt(e,oo(t,2)):0},Lr.template=function(e,t,r){var n=Lr.templateSettings;r&&go(e,t,r)&&(t=i),e=ga(e),t=_a({},t,n,Ki);var o,s,a=_a({},t.imports,n.imports,Ki),u=Ma(a),c=Xt(a,u),l=0,f=t.interpolate||be,h="__p += '",d=Oe((t.escape||be).source+"|"+f.source+"|"+(f===J?fe:be).source+"|"+(t.evaluate||be).source+"|$","g"),p="//# sourceURL="+(ke.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(d,(function(t,r,n,i,a,u){return n||(n=i),h+=e.slice(l,u).replace(_e,rr),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=u+t.length,t})),h+="';\n";var v=ke.call(t,"variable")&&t.variable;if(v){if(ce.test(v))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(V,""):h).replace(q,"$1").replace(z,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ja((function(){return Se(u,p+"return "+h).apply(i,c)}));if(m.source=h,Ks(m))throw m;return m},Lr.times=function(e,t){if((e=da(e))<1||e>f)return[];var r=d,n=mr(e,d);t=oo(t),e-=d;for(var i=$t(n,t);++r<e;)t(r);return i},Lr.toFinite=ha,Lr.toInteger=da,Lr.toLength=pa,Lr.toLower=function(e){return ga(e).toLowerCase()},Lr.toNumber=va,Lr.toSafeInteger=function(e){return e?on(da(e),-9007199254740991,f):0===e?e:0},Lr.toString=ga,Lr.toUpper=function(e){return ga(e).toUpperCase()},Lr.trim=function(e,t,r){if((e=ga(e))&&(r||t===i))return Yt(e);if(!e||!(t=si(t)))return e;var n=lr(e),o=lr(t);return yi(n,Zt(n,o),Qt(n,o)+1).join("")},Lr.trimEnd=function(e,t,r){if((e=ga(e))&&(r||t===i))return e.slice(0,fr(e)+1);if(!e||!(t=si(t)))return e;var n=lr(e);return yi(n,0,Qt(n,lr(t))+1).join("")},Lr.trimStart=function(e,t,r){if((e=ga(e))&&(r||t===i))return e.replace(ne,"");if(!e||!(t=si(t)))return e;var n=lr(e);return yi(n,Zt(n,lr(t))).join("")},Lr.truncate=function(e,t){var r=30,n="...";if(Qs(t)){var o="separator"in t?t.separator:o;r="length"in t?da(t.length):r,n="omission"in t?si(t.omission):n}var s=(e=ga(e)).length;if(nr(e)){var a=lr(e);s=a.length}if(r>=s)return e;var u=r-cr(n);if(u<1)return n;var c=a?yi(a,0,u).join(""):e.slice(0,u);if(o===i)return c+n;if(a&&(u+=c.length-u),ia(o)){if(e.slice(u).search(o)){var l,f=c;for(o.global||(o=Oe(o.source,ga(he.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;c=c.slice(0,h===i?u:h)}}else if(e.indexOf(si(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+n},Lr.unescape=function(e){return(e=ga(e))&&$.test(e)?e.replace(H,hr):e},Lr.uniqueId=function(e){var t=++Ie;return ga(e)+t},Lr.upperCase=Ya,Lr.upperFirst=Ka,Lr.each=gs,Lr.eachRight=ys,Lr.first=Ho,su(Lr,(mu={},yn(Lr,(function(e,t){ke.call(Lr.prototype,t)||(mu[t]=e)})),mu),{chain:!1}),Lr.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Lr[e].placeholder=Lr})),Ot(["drop","take"],(function(e,t){Wr.prototype[e]=function(r){r=r===i?1:vr(da(r),0);var n=this.__filtered__&&!t?new Wr(this):this.clone();return n.__filtered__?n.__takeCount__=mr(r,n.__takeCount__):n.__views__.push({size:mr(r,d),type:e+(n.__dir__<0?"Right":"")}),n},Wr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Wr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Ot(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Wr.prototype[e]=function(){return this[r](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Wr.prototype[e]=function(){return this.__filtered__?new Wr(this):this[r](1)}})),Wr.prototype.compact=function(){return this.filter(ru)},Wr.prototype.find=function(e){return this.filter(e).head()},Wr.prototype.findLast=function(e){return this.reverse().find(e)},Wr.prototype.invokeMap=$n((function(e,t){return"function"==typeof e?new Wr(this):this.map((function(r){return Pn(r,e,t)}))})),Wr.prototype.reject=function(e){return this.filter(Is(oo(e)))},Wr.prototype.slice=function(e,t){e=da(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Wr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=da(t))<0?r.dropRight(-t):r.take(t-e)),r)},Wr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wr.prototype.toArray=function(){return this.take(d)},yn(Wr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Lr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Lr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,u=t instanceof Wr,c=a[0],l=u||qs(t),f=function(e){var t=o.apply(Lr,jt([e],a));return n&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,v=u&&!d;if(!s&&l){t=v?t:new Wr(this);var m=e.apply(t,a);return m.__actions__.push({func:hs,args:[f],thisArg:i}),new Br(m,h)}return p&&v?e.apply(this,a):(m=this.thru(f),p?n?m.value()[0]:m.value():m)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Lr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(qs(i)?i:[],e)}return this[r]((function(r){return t.apply(qs(r)?r:[],e)}))}})),yn(Wr.prototype,(function(e,t){var r=Lr[t];if(r){var n=r.name+"";ke.call(Pr,n)||(Pr[n]=[]),Pr[n].push({name:t,func:r})}})),Pr[Li(i,2).name]=[{name:"wrapper",func:i}],Wr.prototype.clone=function(){var e=new Wr(this.__wrapped__);return e.__actions__=Ci(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ci(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ci(this.__views__),e},Wr.prototype.reverse=function(){if(this.__filtered__){var e=new Wr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=qs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=mr(t,e+s);break;case"takeRight":e=vr(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,u=a-s,c=n?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=mr(u,this.__takeCount__);if(!r||!n&&i==u&&d==u)return fi(e,this.__actions__);var p=[];e:for(;u--&&h<d;){for(var v=-1,m=e[c+=t];++v<f;){var g=l[v],y=g.iteratee,b=g.type,_=y(m);if(2==b)m=_;else if(!_){if(1==b)continue e;break e}}p[h++]=m}return p},Lr.prototype.at=ds,Lr.prototype.chain=function(){return fs(this)},Lr.prototype.commit=function(){return new Br(this.value(),this.__chain__)},Lr.prototype.next=function(){this.__values__===i&&(this.__values__=fa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Lr.prototype.plant=function(e){for(var t,r=this;r instanceof Ur;){var n=Fo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Lr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wr){var t=e;return this.__actions__.length&&(t=new Wr(this)),(t=t.reverse()).__actions__.push({func:hs,args:[Qo],thisArg:i}),new Br(t,this.__chain__)}return this.thru(Qo)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Ke&&(Lr.prototype[Ke]=function(){return this}),Lr}();ft._=dr,(n=function(){return dr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},7824:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,u,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=n?o(a,u,n,"hour"):u>=r?o(a,u,r,"minute"):u>=t?o(a,u,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},3399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collector=void 0;var n=r(6486),i=r(3701);function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){var t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(t="data")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.data=[]}var t,r;return t=e,(r=[{key:"get",value:function(e){return(0,i.findExistingMetric)(e,this.data)}},{key:"set",value:function(e,t){var r=(0,i.findExistingMetric)(t,this.data);return r?r.value=e:this.data.push({labels:t,value:e}),this}},{key:"collect",value:function(e){return(0,n.filter)(this.data,(function(t){return(0,n.matches)(e)(t.labels)}))}},{key:"resetAll",value:function(){var e=this;return(0,n.each)(this.data,(function(t){e.reset(t.labels)})),this}}])&&o(t.prototype,r),e}();t.Collector=s},4486:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Counter=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),r=t,(a=[{key:"inc",value:function(e){return this.add(1,e),this}},{key:"add",value:function(e,t){if(e<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(e));var r=this.get(t);return this.set(r?r.value+e:e,t),this}},{key:"reset",value:function(e){this.set(0,e)}}])&&i(r.prototype,a),t}(r(3399).Collector);t.Counter=a},1993:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Gauge=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),r=t,(a=[{key:"dec",value:function(e){var t=this.get(e);return this.set(t?t.value-1:0,e),this}},{key:"sub",value:function(e,t){var r=this.get(t);return this.set(r?r.value-e:0,t),this}}])&&i(r.prototype,a),t}(r(4486).Counter);t.Gauge=a},8215:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Histogram=void 0;var n=r(6486);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function c(e){return{entries:(0,n.reduce)(e,(function(e,t){return e[t.toString()]=0,e}),{"+Inf":0}),sum:0,count:0,raw:[]}}var l=function(e){function t(){var e,r,n,o,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?a(e):t}(this,s(t).call(this)),o=void 0,(n="buckets")in(r=a(e))?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,e.buckets=u.sort((function(e,t){return e>t?1:-1})),e.set(c(e.buckets)),e.observe=e.observe.bind(a(e)),e}var r,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),r=t,l=[{key:"observe",value:function(e,t){var r=this.get(t);null==r&&(r=this.set(c(this.buckets),t).get(t)),r.value.raw.push(e),r.value.entries["+Inf"]+=1;var i=function(e,t){if(t<e[e.length-1])for(var r=0;r<e.length;r+=1)if(t<=e[r])return r}(this.buckets,e);if(null!=i)for(var o=i;o<this.buckets.length;o+=1){var s=r.value.entries[this.buckets[o].toString()];r.value.entries[this.buckets[o].toString()]=s+1}return r.value.sum=(0,n.sum)(r.value.raw),r.value.count+=1,this}},{key:"reset",value:function(e){this.set(c(this.buckets),e)}}],l&&o(r.prototype,l),t}(r(3399).Collector);t.Histogram=l},4427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={};t.default=void 0;var i=r(4961),o=r(5262);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=function(){return new i.Registry}},4961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Registry=void 0;var n=r(6486),i=r(4486),o=r(1993),s=r(8215),a=r(3701);function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var c=function(){function e(){var t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(t="data")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.data={counter:{},gauge:{},histogram:{}}}var t,r;return t=e,r=[{key:"validateInput",value:function(e,t,r,i){if(""===String(t))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(e))throw new Error("Unknown metric type ".concat(e));if("string"!=typeof r&&null!=r)throw new Error("help must be string or undefined/null");if((0,n.has)(this.data,"".concat(e,".").concat(t)))throw new Error("A metric with the name '".concat(t,"' already exists for type '").concat(e,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(e,t,n,a),"counter"===e?(r=new i.Counter,this.data.counter[t]={help:n,instance:r,type:e}):"gauge"===e?(r=new o.Gauge,this.data.gauge[t]={help:n,instance:r,type:e}):(r=new s.Histogram(a),this.data.histogram[t]={help:n,instance:r,type:e}),r}},{key:"metrics",value:function(){return(0,n.reduce)(this.data,(function(e,t,r){return e+(0,n.reduce)(t,(function(e,t,i){var o=t.instance.collect(),s=e;return t.help.length>0&&(s+="# HELP ".concat(i," ").concat(t.help,"\n")),(s+="# TYPE ".concat(i," ").concat(r,"\n"))+(0,n.reduce)(o,(function(e,t){return e+("histogram"===r?(0,a.formatHistogramOrSummary)(i,t):(0,a.formatCounterOrGauge)(i,t))}),"")}),"")}),"")}},{key:"reset",value:function(){return(0,n.each)(this.data,(function(e){(0,n.each)(e,(function(e){e.instance.resetAll()}))})),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(e,t){var r=(null!=e?[this.data[e]]:(0,n.valuesIn)(this.data)).find((function(e){return(0,n.has)(e,t)}));return null!=r?r[t].instance:void 0}}],r&&u(t.prototype,r),e}();t.Registry=c},5262:()=>{},3701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatHistogramOrSummary=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",i="",o=function(e){var t=(0,n.map)(e.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return 0===t.length?"":"".concat(t.join(","))}(t);return o.length>0?(i+="".concat(e,"_count{").concat(o,"} ").concat(t.value.count,"\n"),i+="".concat(e,"_sum{").concat(o,"} ").concat(t.value.sum,"\n")):(i+="".concat(e,"_count ").concat(t.value.count,"\n"),i+="".concat(e,"_sum ").concat(t.value.sum,"\n")),(0,n.reduce)(t.value.entries,(function(t,n,s){return o.length>0?i+="".concat(e,"_bucket{").concat(r,'="').concat(s,'",').concat(o,"} ").concat(n,"\n"):i+="".concat(e,"_bucket{").concat(r,'="').concat(s,'"} ').concat(n,"\n"),i}),i)},t.findExistingMetric=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e?(0,n.find)(t,(function(t){return(0,n.isEqual)(t.labels,e)})):t[0]},t.formatCounterOrGauge=function(e,t){var r=" ".concat(t.value.toString());if(null==t.labels||0===Object.keys(t.labels).length)return"".concat(e).concat(r,"\n");var i=(0,n.map)(t.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return"".concat(e,"{").concat(i.join(","),"}").concat(r,"\n")};var n=r(6486)},4375:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},1798:(e,t,r)=>{"use strict";var n=r(4155),i=65536,o=r(9509).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(e>0)if(e>i)for(var a=0;a<e;a+=i)s.getRandomValues(r.slice(a,a+i));else s.getRandomValues(r);return"function"==typeof t?n.nextTick((function(){t(null,r)})):r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},4281:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s,a,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(a=e).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:(e,t,r)=>{"use strict";var n=r(4155),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(9481),s=r(4229);r(5717)(l,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var c=a[u];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:(e,t,r)=>{"use strict";e.exports=i;var n=r(4605);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(5717)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},9481:(e,t,r)=>{"use strict";var n,i=r(4155);e.exports=O,O.ReadableState=T,r(7187).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},l=r(4616);o=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,d,p=r(7327),v=r(1195),m=r(2457).getHighWaterMark,g=r(4281).q,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,_=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(O,a);var S=v.errorOrDestroy,E=["error","close","destroy","pause","resume"];function T(e,t,i){n=n||r(6753),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",i),this.buffer=new p,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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(2553).s),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function O(e){if(n=n||r(6753),!(this instanceof O))return new O(e);var t=this instanceof n;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function C(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?M(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,A(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?S(e,new w):x(e,a,t,!0);else if(a.ended)S(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):j(e,a)):x(e,a,t,!1)}else n||(a.reading=!1,j(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function x(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&M(e)),j(e,t)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=v.destroy,O.prototype._undestroy=v.undestroy,O.prototype._destroy=function(e,t){t(e)},O.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),C(this,e,t,!1,r)},O.prototype.unshift=function(e){return C(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.prototype.setEncoding=function(e){f||(f=r(2553).s);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var P=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function M(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(A,e))}function A(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function j(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){o("readable nexttick read 0"),e.read(0)}function N(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(B,t,e))}function B(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function W(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}O.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):M(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},O.prototype._read=function(e){S(this,new _("_read()"))},O.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?v:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",(function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",v),r.removeListener("data",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",c);var l=!1;function f(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==W(n.pipes,e))&&!l&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),v(),e.removeListener("error",h),0===s(e,"error")&&S(e,t)}function d(){e.removeListener("finish",p),v()}function p(){o("onfinish"),e.removeListener("close",d),v()}function v(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=W(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},O.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?M(this):n.reading||i.nextTick(D,this))),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(I,this),r},O.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(I,this),t},O.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(N,e,t))}(this,e)),e.paused=!1,this},O.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(5850)),h(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=F,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(e,t){return void 0===d&&(d=r(5167)),d(O,e,t)})},4605:(e,t,r)=>{"use strict";e.exports=l;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(5717)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=O,O.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,l=r.g.Uint8Array||function(){},f=r(1195),h=r(2457).getHighWaterMark,d=r(4281).q,p=d.ERR_INVALID_ARG_TYPE,v=d.ERR_METHOD_NOT_IMPLEMENTED,m=d.ERR_MULTIPLE_CALLBACK,g=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,_=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,S=f.errorOrDestroy;function E(){}function T(e,t,s){n=n||r(6753),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(A,e,t),e._writableState.errorEmitted=!0,S(e,n)):(o(n),e._writableState.errorEmitted=!0,S(e,n),A(e,t))}(e,r,n,t,o);else{var s=R(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),n?i.nextTick(x,e,r,s,o):x(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function O(e){var t=this instanceof(n=n||r(6753));if(!t&&!s.call(O,this))return new O(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function C(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function x(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function P(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,C(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(C(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function M(e,t){e._final((function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(M,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(O,u),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===O&&e&&e._writableState instanceof T}})):s=function(e){return e instanceof this},O.prototype.pipe=function(){S(this,new g)},O.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,c.isBuffer(n)||n instanceof l);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new _;S(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new b:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(S(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,a,n,i,o);return u}(this,o,a,e,t,r)),s},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},O.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new v("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=f.destroy,O.prototype._undestroy=f.undestroy,O.prototype._destroy=function(e,t){t(e)}},5850:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function v(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[f]=null,e[a]=null,e[u]=null,t(p(r,!1)))}}function m(e){i.nextTick(v,e)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[c]?r(e[c]):t(p(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[l]?r(p(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),g);e.exports=function(e){var t,r=Object.create(y,(o(t={},d,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[d].read();n?(r[f]=null,r[a]=null,r[u]=null,e(p(n,!1))):(r[a]=e,r[u]=t)},writable:!0}),t));return r[f]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[f]=null,r[a]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0})),e.on("readable",m.bind(null,r)),r}},7327:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=r(8764).Buffer,a=r(2361).inspect,u=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&o(t.prototype,r),e}()},1195:(e,t,r)=>{"use strict";var n=r(4155);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),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(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){a=!1,c=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,f=!0,a||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},v=function(){t.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",l),t.on("abort",p),t.req?v():t.on("request",v)):a&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",h),t.on("finish",l),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",v),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",h),t.removeListener("error",d),t.removeListener("close",p)}}},5167:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,(function(e){l||(l=e),e&&h.forEach(u),o||(h.forEach(u),f(l))}))}));return t.reduce(c)}},2457:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},2503:(e,t,r)=>{e.exports=r(7187).EventEmitter},8473:(e,t,r)=>{(t=e.exports=r(9481)).Stream=t,t.Readable=t,t.Writable=r(4229),t.Duplex=r(6753),t.Transform=r(4605),t.PassThrough=r(2725),t.finished=r(8610),t.pipeline=r(9946)},2872:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.interval=t.iif=t.generate=t.fromEventPattern=t.fromEvent=t.from=t.forkJoin=t.empty=t.defer=t.connectable=t.concat=t.combineLatest=t.bindNodeCallback=t.bindCallback=t.UnsubscriptionError=t.TimeoutError=t.SequenceError=t.ObjectUnsubscribedError=t.NotFoundError=t.EmptyError=t.ArgumentOutOfRangeError=t.firstValueFrom=t.lastValueFrom=t.isObservable=t.identity=t.noop=t.pipe=t.NotificationKind=t.Notification=t.Subscriber=t.Subscription=t.Scheduler=t.VirtualAction=t.VirtualTimeScheduler=t.animationFrameScheduler=t.animationFrame=t.queueScheduler=t.queue=t.asyncScheduler=t.async=t.asapScheduler=t.asap=t.AsyncSubject=t.ReplaySubject=t.BehaviorSubject=t.Subject=t.animationFrames=t.observable=t.ConnectableObservable=t.Observable=void 0,t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.combineLatestWith=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=t.config=t.NEVER=t.EMPTY=t.scheduled=t.zip=t.using=t.timer=t.throwError=t.range=t.race=t.partition=t.pairs=t.onErrorResumeNext=t.of=t.never=t.merge=void 0,t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.pairwise=t.onErrorResumeNextWith=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=t.mergeAll=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=void 0,t.zipWith=t.zipAll=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=void 0;var o=r(2419);Object.defineProperty(t,"Observable",{enumerable:!0,get:function(){return o.Observable}});var s=r(9518);Object.defineProperty(t,"ConnectableObservable",{enumerable:!0,get:function(){return s.ConnectableObservable}});var a=r(2801);Object.defineProperty(t,"observable",{enumerable:!0,get:function(){return a.observable}});var u=r(9106);Object.defineProperty(t,"animationFrames",{enumerable:!0,get:function(){return u.animationFrames}});var c=r(3032);Object.defineProperty(t,"Subject",{enumerable:!0,get:function(){return c.Subject}});var l=r(5240);Object.defineProperty(t,"BehaviorSubject",{enumerable:!0,get:function(){return l.BehaviorSubject}});var f=r(3274);Object.defineProperty(t,"ReplaySubject",{enumerable:!0,get:function(){return f.ReplaySubject}});var h=r(280);Object.defineProperty(t,"AsyncSubject",{enumerable:!0,get:function(){return h.AsyncSubject}});var d=r(580);Object.defineProperty(t,"asap",{enumerable:!0,get:function(){return d.asap}}),Object.defineProperty(t,"asapScheduler",{enumerable:!0,get:function(){return d.asapScheduler}});var p=r(2445);Object.defineProperty(t,"async",{enumerable:!0,get:function(){return p.async}}),Object.defineProperty(t,"asyncScheduler",{enumerable:!0,get:function(){return p.asyncScheduler}});var v=r(8615);Object.defineProperty(t,"queue",{enumerable:!0,get:function(){return v.queue}}),Object.defineProperty(t,"queueScheduler",{enumerable:!0,get:function(){return v.queueScheduler}});var m=r(3660);Object.defineProperty(t,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(t,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var g=r(4123);Object.defineProperty(t,"VirtualTimeScheduler",{enumerable:!0,get:function(){return g.VirtualTimeScheduler}}),Object.defineProperty(t,"VirtualAction",{enumerable:!0,get:function(){return g.VirtualAction}});var y=r(218);Object.defineProperty(t,"Scheduler",{enumerable:!0,get:function(){return y.Scheduler}});var b=r(3865);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return b.Subscription}});var _=r(5125);Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return _.Subscriber}});var w=r(3104);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return w.Notification}}),Object.defineProperty(t,"NotificationKind",{enumerable:!0,get:function(){return w.NotificationKind}});var S=r(9985);Object.defineProperty(t,"pipe",{enumerable:!0,get:function(){return S.pipe}});var E=r(2576);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return E.noop}});var T=r(4781);Object.defineProperty(t,"identity",{enumerable:!0,get:function(){return T.identity}});var O=r(8386);Object.defineProperty(t,"isObservable",{enumerable:!0,get:function(){return O.isObservable}});var C=r(9309);Object.defineProperty(t,"lastValueFrom",{enumerable:!0,get:function(){return C.lastValueFrom}});var x=r(8182);Object.defineProperty(t,"firstValueFrom",{enumerable:!0,get:function(){return x.firstValueFrom}});var P=r(2351);Object.defineProperty(t,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return P.ArgumentOutOfRangeError}});var R=r(9474);Object.defineProperty(t,"EmptyError",{enumerable:!0,get:function(){return R.EmptyError}});var M=r(8598);Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return M.NotFoundError}});var A=r(2642);Object.defineProperty(t,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return A.ObjectUnsubscribedError}});var j=r(6156);Object.defineProperty(t,"SequenceError",{enumerable:!0,get:function(){return j.SequenceError}});var k=r(4173);Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return k.TimeoutError}});var I=r(4805);Object.defineProperty(t,"UnsubscriptionError",{enumerable:!0,get:function(){return I.UnsubscriptionError}});var D=r(3050);Object.defineProperty(t,"bindCallback",{enumerable:!0,get:function(){return D.bindCallback}});var N=r(8130);Object.defineProperty(t,"bindNodeCallback",{enumerable:!0,get:function(){return N.bindNodeCallback}});var L=r(9258);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return L.combineLatest}});var F=r(2239);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return F.concat}});var U=r(2873);Object.defineProperty(t,"connectable",{enumerable:!0,get:function(){return U.connectable}});var B=r(7885);Object.defineProperty(t,"defer",{enumerable:!0,get:function(){return B.defer}});var W=r(6332);Object.defineProperty(t,"empty",{enumerable:!0,get:function(){return W.empty}});var V=r(7245);Object.defineProperty(t,"forkJoin",{enumerable:!0,get:function(){return V.forkJoin}});var q=r(5432);Object.defineProperty(t,"from",{enumerable:!0,get:function(){return q.from}});var z=r(3267);Object.defineProperty(t,"fromEvent",{enumerable:!0,get:function(){return z.fromEvent}});var H=r(470);Object.defineProperty(t,"fromEventPattern",{enumerable:!0,get:function(){return H.fromEventPattern}});var G=r(4303);Object.defineProperty(t,"generate",{enumerable:!0,get:function(){return G.generate}});var $=r(1757);Object.defineProperty(t,"iif",{enumerable:!0,get:function(){return $.iif}});var Y=r(8990);Object.defineProperty(t,"interval",{enumerable:!0,get:function(){return Y.interval}});var K=r(1846);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return K.merge}});var X=r(1339);Object.defineProperty(t,"never",{enumerable:!0,get:function(){return X.never}});var J=r(5726);Object.defineProperty(t,"of",{enumerable:!0,get:function(){return J.of}});var Z=r(724);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return Z.onErrorResumeNext}});var Q=r(4380);Object.defineProperty(t,"pairs",{enumerable:!0,get:function(){return Q.pairs}});var ee=r(7273);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ee.partition}});var te=r(5182);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return te.race}});var re=r(322);Object.defineProperty(t,"range",{enumerable:!0,get:function(){return re.range}});var ne=r(2098);Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return ne.throwError}});var ie=r(7513);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return ie.timer}});var oe=r(2962);Object.defineProperty(t,"using",{enumerable:!0,get:function(){return oe.using}});var se=r(7654);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return se.zip}});var ae=r(5207);Object.defineProperty(t,"scheduled",{enumerable:!0,get:function(){return ae.scheduled}});var ue=r(6332);Object.defineProperty(t,"EMPTY",{enumerable:!0,get:function(){return ue.EMPTY}});var ce=r(1339);Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return ce.NEVER}}),i(r(8433),t);var le=r(3280);Object.defineProperty(t,"config",{enumerable:!0,get:function(){return le.config}});var fe=r(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return fe.audit}});var he=r(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return he.auditTime}});var de=r(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return de.buffer}});var pe=r(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}});var ve=r(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return ve.bufferTime}});var me=r(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return me.bufferToggle}});var ge=r(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return ge.bufferWhen}});var ye=r(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return ye.catchError}});var be=r(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return be.combineAll}});var _e=r(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return _e.combineLatestAll}});var we=r(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return we.combineLatestWith}});var Se=r(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return Se.concatAll}});var Ee=r(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return Ee.concatMap}});var Te=r(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return Te.concatMapTo}});var Oe=r(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return Oe.concatWith}});var Ce=r(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return Ce.connect}});var xe=r(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return xe.count}});var Pe=r(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return Pe.debounce}});var Re=r(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return Re.debounceTime}});var Me=r(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return Me.defaultIfEmpty}});var Ae=r(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return Ae.delay}});var je=r(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return je.delayWhen}});var ke=r(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return ke.dematerialize}});var Ie=r(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return Ie.distinct}});var De=r(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return De.distinctUntilChanged}});var Ne=r(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Ne.distinctUntilKeyChanged}});var Le=r(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return Le.elementAt}});var Fe=r(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return Fe.endWith}});var Ue=r(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return Ue.every}});var Be=r(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return Be.exhaust}});var We=r(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return We.exhaustAll}});var Ve=r(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return Ve.exhaustMap}});var qe=r(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return qe.expand}});var ze=r(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return ze.filter}});var He=r(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return He.finalize}});var Ge=r(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return Ge.find}});var $e=r(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return $e.findIndex}});var Ye=r(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return Ye.first}});var Ke=r(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return Ke.groupBy}});var Xe=r(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return Xe.ignoreElements}});var Je=r(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return Je.isEmpty}});var Ze=r(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return Ze.last}});var Qe=r(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return Qe.map}});var et=r(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return et.mapTo}});var tt=r(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return tt.materialize}});var rt=r(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return rt.max}});var nt=r(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return nt.mergeAll}});var it=r(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return it.flatMap}});var ot=r(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ot.mergeMap}});var st=r(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return st.mergeMapTo}});var at=r(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return at.mergeScan}});var ut=r(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ut.mergeWith}});var ct=r(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ct.min}});var lt=r(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return lt.multicast}});var ft=r(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return ft.observeOn}});var ht=r(7582);Object.defineProperty(t,"onErrorResumeNextWith",{enumerable:!0,get:function(){return ht.onErrorResumeNextWith}});var dt=r(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return dt.pairwise}});var pt=r(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return pt.pluck}});var vt=r(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return vt.publish}});var mt=r(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return mt.publishBehavior}});var gt=r(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return gt.publishLast}});var yt=r(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return yt.publishReplay}});var bt=r(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return bt.raceWith}});var _t=r(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return _t.reduce}});var wt=r(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return wt.repeat}});var St=r(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return St.repeatWhen}});var Et=r(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return Et.retry}});var Tt=r(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return Tt.retryWhen}});var Ot=r(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Ot.refCount}});var Ct=r(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Ct.sample}});var xt=r(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return xt.sampleTime}});var Pt=r(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Pt.scan}});var Rt=r(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Rt.sequenceEqual}});var Mt=r(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return Mt.share}});var At=r(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return At.shareReplay}});var jt=r(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return jt.single}});var kt=r(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return kt.skip}});var It=r(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return It.skipLast}});var Dt=r(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Dt.skipUntil}});var Nt=r(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return Nt.skipWhile}});var Lt=r(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Lt.startWith}});var Ft=r(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ft.subscribeOn}});var Ut=r(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Ut.switchAll}});var Bt=r(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Bt.switchMap}});var Wt=r(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Wt.switchMapTo}});var Vt=r(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Vt.switchScan}});var qt=r(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return qt.take}});var zt=r(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return zt.takeLast}});var Ht=r(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Ht.takeUntil}});var Gt=r(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return Gt.takeWhile}});var $t=r(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return $t.tap}});var Yt=r(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Yt.throttle}});var Kt=r(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Kt.throttleTime}});var Xt=r(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return Xt.throwIfEmpty}});var Jt=r(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Jt.timeInterval}});var Zt=r(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Zt.timeout}});var Qt=r(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Qt.timeoutWith}});var er=r(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return er.timestamp}});var tr=r(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return tr.toArray}});var rr=r(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return rr.window}});var nr=r(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return nr.windowCount}});var ir=r(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return ir.windowTime}});var or=r(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return or.windowToggle}});var sr=r(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return sr.windowWhen}});var ar=r(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return ar.withLatestFrom}});var ur=r(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return ur.zipAll}});var cr=r(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return cr.zipWith}})},280:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncSubject=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return i(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))},t}(r(3032).Subject);t.AsyncSubject=o},5240:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;var o=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r(3032).Subject);t.BehaviorSubject=o},3104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNotification=t.Notification=t.NotificationKind=void 0;var n,i=r(6332),o=r(5726),s=r(2098),a=r(3005);(n=t.NotificationKind||(t.NotificationKind={})).NEXT="N",n.ERROR="E",n.COMPLETE="C";var u=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){return c(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return a.isFunction(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,n=e.error,a="N"===t?o.of(r):"E"===t?s.throwError((function(){return n})):"C"===t?i.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();function c(e,t){var r,n,i,o=e,s=o.kind,a=o.value,u=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,u):null===(i=t.complete)||void 0===i||i.call(t)}t.Notification=u,t.observeNotification=c},7286:(e,t)=>{"use strict";function r(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=r("C",void 0,void 0),t.errorNotification=function(e){return r("E",void 0,e)},t.nextNotification=function(e){return r("N",e,void 0)},t.createNotification=r},2419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var n=r(5125),i=r(3865),o=r(2801),s=r(9985),a=r(3280),u=r(3005),c=r(6110),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var o,s=this,a=(o=e)&&o instanceof n.Subscriber||function(e){return e&&u.isFunction(e.next)&&u.isFunction(e.error)&&u.isFunction(e.complete)}(o)&&i.isSubscription(o)?e:new n.SafeSubscriber(e,t,r);return c.errorContext((function(){var e=s,t=e.operator,r=e.source;a.add(t?t.call(a,r):r?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=f(t))((function(t,i){var o=new n.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:a.config.Promise)&&void 0!==t?t:Promise}t.Observable=l},3274:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySubject=void 0;var o=r(3032),s=r(7950),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return i(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,u=1;u<n.length&&n[u]<=s;u+=2)a=u;a&&n.splice(0,a+1)}},t}(o.Subject);t.ReplaySubject=a},218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=void 0;var n=r(7950),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=n.dateTimestampProvider.now,e}();t.Scheduler=i},3032:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0;var s=r(2419),a=r(3865),u=r(2642),c=r(6967),l=r(6110),f=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype.lift=function(e){var t=new h(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new u.ObjectUnsubscribedError},t.prototype.next=function(e){var t=this;l.errorContext((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=o(t.currentObservers),s=i.next();!s.done;s=i.next())s.value.next(e)}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;l.errorContext((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;l.errorContext((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?a.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new a.Subscription((function(){t.currentObservers=null,c.arrRemove(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new s.Observable;return e.source=this,e},t.create=function(e,t){return new h(e,t)},t}(s.Observable);t.Subject=f;var h=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:a.EMPTY_SUBSCRIPTION},t}(f);t.AnonymousSubject=h},5125:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_OBSERVER=t.SafeSubscriber=t.Subscriber=void 0;var o=r(3005),s=r(3865),a=r(3280),u=r(7968),c=r(2576),l=r(7286),f=r(4590),h=r(6110),d=function(e){function r(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,s.isSubscription(r)&&r.add(n)):n.destination=t.EMPTY_OBSERVER,n}return i(r,e),r.create=function(e,t,r){return new g(e,t,r)},r.prototype.next=function(e){this.isStopped?b(l.nextNotification(e),this):this._next(e)},r.prototype.error=function(e){this.isStopped?b(l.errorNotification(e),this):(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped?b(l.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(s.Subscription);t.Subscriber=d;var p=Function.prototype.bind;function v(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){y(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){y(e)}else y(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){y(e)}},e}(),g=function(e){function t(t,r,n){var i,s,u=e.call(this)||this;return o.isFunction(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:u&&a.config.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},i={next:t.next&&v(t.next,s),error:t.error&&v(t.error,s),complete:t.complete&&v(t.complete,s)}):i=t,u.destination=new m(i),u}return i(t,e),t}(d);function y(e){a.config.useDeprecatedSynchronousErrorHandling?h.captureError(e):u.reportUnhandledError(e)}function b(e,t){var r=a.config.onStoppedNotification;r&&f.timeoutProvider.setTimeout((function(){return r(e,t)}))}t.SafeSubscriber=g,t.EMPTY_OBSERVER={closed:!0,next:c.noop,error:function(e){throw e},complete:c.noop}},3865:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscription=t.EMPTY_SUBSCRIPTION=t.Subscription=void 0;var s=r(3005),a=r(4805),u=r(6967),c=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,u,c;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var h=n(f),d=h.next();!d.done;d=h.next())d.value.remove(this)}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}else f.remove(this);var p=this.initialTeardown;if(s.isFunction(p))try{p()}catch(e){c=e instanceof a.UnsubscriptionError?e.errors:[e]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var m=n(v),g=m.next();!g.done;g=m.next()){var y=g.value;try{l(y)}catch(e){c=null!=c?c:[],e instanceof a.UnsubscriptionError?c=o(o([],i(c)),i(e.errors)):c.push(e)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(u=m.return)&&u.call(m)}finally{if(r)throw r.error}}}if(c)throw new a.UnsubscriptionError(c)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&u.arrRemove(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&u.arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function l(e){s.isFunction(e)?e():e.unsubscribe()}t.Subscription=c,t.EMPTY_SUBSCRIPTION=c.EMPTY,t.isSubscription=function(e){return e instanceof c||e&&"closed"in e&&s.isFunction(e.remove)&&s.isFunction(e.add)&&s.isFunction(e.unsubscribe)}},3280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},8182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstValueFrom=void 0;var n=r(9474),i=r(5125);t.firstValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(o,s){var a=new i.SafeSubscriber({next:function(e){o(e),a.unsubscribe()},error:s,complete:function(){r?o(t.defaultValue):s(new n.EmptyError)}});e.subscribe(a)}))}},9309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastValueFrom=void 0;var n=r(9474);t.lastValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(i,o){var s,a=!1;e.subscribe({next:function(e){s=e,a=!0},error:o,complete:function(){a?i(s):r?i(t.defaultValue):o(new n.EmptyError)}})}))}},9518:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var o=r(2419),s=r(3865),a=r(8739),u=r(4990),c=r(4935),l=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,c.hasLift(t)&&(n.lift=t.lift),n}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new s.Subscription;var r=this.getSubject();t.add(this.source.subscribe(u.createOperatorSubscriber(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=s.Subscription.EMPTY)}return t},t.prototype.refCount=function(){return a.refCount()(this)},t}(o.Observable);t.ConnectableObservable=l},3050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallback=void 0;var n=r(9592);t.bindCallback=function(e,t,r){return n.bindCallbackInternals(!1,e,t,r)}},9592:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallbackInternals=void 0;var o=r(9016),s=r(2419),a=r(276),u=r(1914),c=r(1184),l=r(280);t.bindCallbackInternals=function e(t,r,f,h){if(f){if(!o.isScheduler(f))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r,h).apply(this,n).pipe(u.mapOneOrManyArgs(f))};h=f}return h?function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r).apply(this,n).pipe(a.subscribeOn(h),c.observeOn(h))}:function(){for(var e=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var u=new l.AsyncSubject,c=!0;return new s.Observable((function(s){var a=u.subscribe(s);if(c){c=!1;var l=!1,f=!1;r.apply(e,i(i([],n(o)),[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t){var n=e.shift();if(null!=n)return void u.error(n)}u.next(1<e.length?e:e[0]),f=!0,l&&u.complete()}])),f&&u.complete(),l=!0}return a}))}}},8130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindNodeCallback=void 0;var n=r(9592);t.bindNodeCallback=function(e,t,r){return n.bindCallbackInternals(!0,e,t,r)}},9258:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestInit=t.combineLatest=void 0;var n=r(2419),i=r(1203),o=r(5432),s=r(4781),a=r(1914),u=r(2433),c=r(641),l=r(4990),f=r(7738);function h(e,t,r){return void 0===r&&(r=s.identity),function(n){d(t,(function(){for(var i=e.length,s=new Array(i),a=i,u=i,c=function(i){d(t,(function(){var c=o.from(e[i],t),f=!1;c.subscribe(l.createOperatorSubscriber(n,(function(e){s[i]=e,f||(f=!0,u--),u||n.next(r(s.slice()))}),(function(){--a||n.complete()})))}),n)},f=0;f<i;f++)c(f)}),n)}}function d(e,t,r){e?f.executeSchedule(r,e,t):t()}t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=u.popScheduler(e),l=u.popResultSelector(e),f=i.argsArgArrayOrObject(e),d=f.args,p=f.keys;if(0===d.length)return o.from([],r);var v=new n.Observable(h(d,r,p?function(e){return c.createObject(p,e)}:s.identity));return l?v.pipe(a.mapOneOrManyArgs(l)):v},t.combineLatestInit=h},2239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var n=r(4413),i=r(2433),o=r(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.concatAll()(o.from(e,i.popScheduler(e)))}},2873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectable=void 0;var n=r(3032),i=r(2419),o=r(7885),s={connector:function(){return new n.Subject},resetOnDisconnect:!0};t.connectable=function(e,t){void 0===t&&(t=s);var r=null,n=t.connector,a=t.resetOnDisconnect,u=void 0===a||a,c=n(),l=new i.Observable((function(e){return c.subscribe(e)}));return l.connect=function(){return r&&!r.closed||(r=o.defer((function(){return e})).subscribe(c),u&&r.add((function(){return c=n()}))),r},l}},7885:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defer=void 0;var n=r(2419),i=r(7103);t.defer=function(e){return new n.Observable((function(t){i.innerFrom(e()).subscribe(t)}))}},9106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0;var n=r(2419),i=r(6813),o=r(505);function s(e){return new n.Observable((function(t){var r=e||i.performanceTimestampProvider,n=r.now(),s=0,a=function(){t.closed||(s=o.animationFrameProvider.requestAnimationFrame((function(i){s=0;var o=r.now();t.next({timestamp:e?o:i,elapsed:o-n}),a()})))};return a(),function(){s&&o.animationFrameProvider.cancelAnimationFrame(s)}}))}t.animationFrames=function(e){return e?s(e):a};var a=s()},6332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var n=r(2419);t.EMPTY=new n.Observable((function(e){return e.complete()})),t.empty=function(e){return e?function(e){return new n.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}(e):t.EMPTY}},7245:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forkJoin=void 0;var n=r(2419),i=r(1203),o=r(7103),s=r(2433),a=r(4990),u=r(1914),c=r(641);t.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popResultSelector(e),l=i.argsArgArrayOrObject(e),f=l.args,h=l.keys,d=new n.Observable((function(e){var t=f.length;if(t)for(var r=new Array(t),n=t,i=t,s=function(t){var s=!1;o.innerFrom(f[t]).subscribe(a.createOperatorSubscriber(e,(function(e){s||(s=!0,i--),r[t]=e}),(function(){return n--}),void 0,(function(){n&&s||(i||e.next(h?c.createObject(h,r):r),e.complete())})))},u=0;u<t;u++)s(u);else e.complete()}));return r?d.pipe(u.mapOneOrManyArgs(r)):d}},5432:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.from=void 0;var n=r(5207),i=r(7103);t.from=function(e,t){return t?n.scheduled(e,t):i.innerFrom(e)}},3267:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.fromEvent=void 0;var i=r(7103),o=r(2419),s=r(9475),a=r(3909),u=r(3005),c=r(1914),l=["addListener","removeListener"],f=["addEventListener","removeEventListener"],h=["on","off"];function d(e,t){return function(r){return function(n){return e[r](t,n)}}}t.fromEvent=function e(t,r,p,v){if(u.isFunction(p)&&(v=p,p=void 0),v)return e(t,r,p).pipe(c.mapOneOrManyArgs(v));var m=n(function(e){return u.isFunction(e.addEventListener)&&u.isFunction(e.removeEventListener)}(t)?f.map((function(e){return function(n){return t[e](r,n,p)}})):function(e){return u.isFunction(e.addListener)&&u.isFunction(e.removeListener)}(t)?l.map(d(t,r)):function(e){return u.isFunction(e.on)&&u.isFunction(e.off)}(t)?h.map(d(t,r)):[],2),g=m[0],y=m[1];if(!g&&a.isArrayLike(t))return s.mergeMap((function(t){return e(t,r,p)}))(i.innerFrom(t));if(!g)throw new TypeError("Invalid event target");return new o.Observable((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}},470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromEventPattern=void 0;var n=r(2419),i=r(3005),o=r(1914);t.fromEventPattern=function e(t,r,s){return s?e(t,r).pipe(o.mapOneOrManyArgs(s)):new n.Observable((function(e){var n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1===t.length?t[0]:t)},o=t(n);return i.isFunction(r)?function(){return r(n,o)}:void 0}))}},851:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSubscribable=void 0;var n=r(2419);t.fromSubscribable=function(e){return new n.Observable((function(t){return e.subscribe(t)}))}},4303:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generate=void 0;var i=r(4781),o=r(9016),s=r(7885),a=r(1297);t.generate=function(e,t,r,u,c){var l,f,h,d;function p(){var e;return n(this,(function(n){switch(n.label){case 0:e=d,n.label=1;case 1:return t&&!t(e)?[3,4]:[4,h(e)];case 2:n.sent(),n.label=3;case 3:return e=r(e),[3,1];case 4:return[2]}}))}return 1===arguments.length?(d=(l=e).initialState,t=l.condition,r=l.iterate,f=l.resultSelector,h=void 0===f?i.identity:f,c=l.scheduler):(d=e,!u||o.isScheduler(u)?(h=i.identity,c=u):h=u),s.defer(c?function(){return a.scheduleIterable(p(),c)}:p)}},1757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;var n=r(7885);t.iif=function(e,t,r){return n.defer((function(){return e()?t:r}))}},7103:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof s?s(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.fromReadableStreamLike=t.fromAsyncIterable=t.fromIterable=t.fromPromise=t.fromArrayLike=t.fromInteropObservable=t.innerFrom=void 0;var a=r(3909),u=r(6018),c=r(2419),l=r(9500),f=r(9595),h=r(9906),d=r(2743),p=r(7823),v=r(3005),m=r(7968),g=r(2801);function y(e){return new c.Observable((function(t){var r=e[g.observable]();if(v.isFunction(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function b(e){return new c.Observable((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}function _(e){return new c.Observable((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,m.reportUnhandledError)}))}function w(e){return new c.Observable((function(t){var r,n;try{for(var i=s(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()}))}function S(e){return new c.Observable((function(t){(function(e,t){var r,s,a,u;return n(this,void 0,void 0,(function(){var n,c;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,11]),r=o(e),i.label=1;case 1:return[4,r.next()];case 2:if((s=i.sent()).done)return[3,4];if(n=s.value,t.next(n),t.closed)return[2];i.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=i.sent(),a={error:c},[3,11];case 6:return i.trys.push([6,,9,10]),s&&!s.done&&(u=r.return)?[4,u.call(r)]:[3,8];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function E(e){return S(p.readableStreamLikeToAsyncGenerator(e))}t.innerFrom=function(e){if(e instanceof c.Observable)return e;if(null!=e){if(l.isInteropObservable(e))return y(e);if(a.isArrayLike(e))return b(e);if(u.isPromise(e))return _(e);if(f.isAsyncIterable(e))return S(e);if(d.isIterable(e))return w(e);if(p.isReadableStreamLike(e))return E(e)}throw h.createInvalidObservableTypeError(e)},t.fromInteropObservable=y,t.fromArrayLike=b,t.fromPromise=_,t.fromIterable=w,t.fromAsyncIterable=S,t.fromReadableStreamLike=E},8990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interval=void 0;var n=r(2445),i=r(7513);t.interval=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=n.asyncScheduler),e<0&&(e=0),i.timer(e,e,t)}},1846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var n=r(3783),i=r(7103),o=r(6332),s=r(2433),a=r(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popScheduler(e),u=s.popNumber(e,1/0),c=e;return c.length?1===c.length?i.innerFrom(c[0]):n.mergeAll(u)(a.from(c,r)):o.EMPTY}},1339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.never=t.NEVER=void 0;var n=r(2419),i=r(2576);t.NEVER=new n.Observable(i.noop),t.never=function(){return t.NEVER}},5726:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.of=void 0;var n=r(2433),i=r(5432);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.popScheduler(e);return i.from(e,r)}},724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=void 0;var n=r(2419),i=r(5498),o=r(4990),s=r(2576),a=r(7103);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.argsOrArgArray(e);return new n.Observable((function(e){var t=0,n=function(){if(t<r.length){var i=void 0;try{i=a.innerFrom(r[t++])}catch(e){return void n()}var u=new o.OperatorSubscriber(e,void 0,s.noop,s.noop);i.subscribe(u),u.add(n)}else e.complete()};n()}))}},4380:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairs=void 0;var n=r(5432);t.pairs=function(e,t){return n.from(Object.entries(e),t)}},7273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8634),i=r(9154),o=r(7103);t.partition=function(e,t,r){return[i.filter(t,r)(o.innerFrom(e)),i.filter(n.not(t,r))(o.innerFrom(e))]}},5182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.raceInit=t.race=void 0;var n=r(2419),i=r(7103),o=r(5498),s=r(4990);function a(e){return function(t){for(var r=[],n=function(n){r.push(i.innerFrom(e[n]).subscribe(s.createOperatorSubscriber(t,(function(e){if(r){for(var i=0;i<r.length;i++)i!==n&&r[i].unsubscribe();r=null}t.next(e)}))))},o=0;r&&!t.closed&&o<e.length;o++)n(o)}}t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o.argsOrArgArray(e)).length?i.innerFrom(e[0]):new n.Observable(a(e))},t.raceInit=a},322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0;var n=r(2419),i=r(6332);t.range=function(e,t,r){if(null==t&&(t=e,e=0),t<=0)return i.EMPTY;var o=t+e;return new n.Observable(r?function(t){var n=e;return r.schedule((function(){n<o?(t.next(n++),this.schedule()):t.complete()}))}:function(t){for(var r=e;r<o&&!t.closed;)t.next(r++);t.complete()})}},2098:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;var n=r(2419),i=r(3005);t.throwError=function(e,t){var r=i.isFunction(e)?e:function(){return e},o=function(e){return e.error(r())};return new n.Observable(t?function(e){return t.schedule(o,0,e)}:o)}},7513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0;var n=r(2419),i=r(2445),o=r(9016),s=r(1677);t.timer=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=i.async);var a=-1;return null!=t&&(o.isScheduler(t)?r=t:a=t),new n.Observable((function(t){var n=s.isValidDate(e)?+e-r.now():e;n<0&&(n=0);var i=0;return r.schedule((function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())}),n)}))}},2962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0;var n=r(2419),i=r(7103),o=r(6332);t.using=function(e,t){return new n.Observable((function(r){var n=e(),s=t(n);return(s?i.innerFrom(s):o.EMPTY).subscribe(r),function(){n&&n.unsubscribe()}}))}},7654:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(2419),s=r(7103),a=r(5498),u=r(6332),c=r(4990),l=r(2433);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e),f=a.argsOrArgArray(e);return f.length?new o.Observable((function(e){var t=f.map((function(){return[]})),o=f.map((function(){return!1}));e.add((function(){t=o=null}));for(var a=function(a){s.innerFrom(f[a]).subscribe(c.createOperatorSubscriber(e,(function(s){if(t[a].push(s),t.every((function(e){return e.length}))){var u=t.map((function(e){return e.shift()}));e.next(r?r.apply(void 0,i([],n(u))):u),t.some((function(e,t){return!e.length&&o[t]}))&&e.complete()}}),(function(){o[a]=!0,!t[a].length&&e.complete()})))},u=0;!e.closed&&u<f.length;u++)a(u);return function(){t=o=null}})):u.EMPTY}},4990:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorSubscriber=t.createOperatorSubscriber=void 0;var o=r(5125);t.createOperatorSubscriber=function(e,t,r,n,i){return new s(e,t,r,n,i)};var s=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return i(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(o.Subscriber);t.OperatorSubscriber=s},6474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.audit=void 0;var n=r(4935),i=r(7103),o=r(4990);t.audit=function(e){return n.operate((function(t,r){var n=!1,s=null,a=null,u=!1,c=function(){if(null==a||a.unsubscribe(),a=null,n){n=!1;var e=s;s=null,r.next(e)}u&&r.complete()},l=function(){a=null,u&&r.complete()};t.subscribe(o.createOperatorSubscriber(r,(function(t){n=!0,s=t,a||i.innerFrom(e(t)).subscribe(a=o.createOperatorSubscriber(r,c,l))}),(function(){u=!0,(!n||!a||a.closed)&&r.complete()})))}))}},5382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auditTime=void 0;var n=r(2445),i=r(6474),o=r(7513);t.auditTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.audit((function(){return o.timer(e,t)}))}},9715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.buffer=function(e){return n.operate((function(t,r){var n=[];return t.subscribe(o.createOperatorSubscriber(r,(function(e){return n.push(e)}),(function(){r.next(n),r.complete()}))),s.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){var e=n;n=[],r.next(e)}),i.noop)),function(){n=null}}))}},3814:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferCount=void 0;var i=r(4935),o=r(4990),s=r(6967);t.bufferCount=function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,i.operate((function(r,i){var a=[],u=0;r.subscribe(o.createOperatorSubscriber(i,(function(r){var o,c,l,f,h=null;u++%t==0&&a.push([]);try{for(var d=n(a),p=d.next();!p.done;p=d.next())(g=p.value).push(r),e<=g.length&&(h=null!=h?h:[]).push(g)}catch(e){o={error:e}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(o)throw o.error}}if(h)try{for(var v=n(h),m=v.next();!m.done;m=v.next()){var g=m.value;s.arrRemove(a,g),i.next(g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(f=v.return)&&f.call(v)}finally{if(l)throw l.error}}}),(function(){var e,t;try{for(var r=n(a),o=r.next();!o.done;o=r.next()){var s=o.value;i.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.complete()}),void 0,(function(){a=null})))}))}},7211:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferTime=void 0;var i=r(3865),o=r(4935),s=r(4990),a=r(6967),u=r(2445),c=r(2433),l=r(7738);t.bufferTime=function(e){for(var t,r,f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];var d=null!==(t=c.popScheduler(f))&&void 0!==t?t:u.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,v=f[1]||1/0;return o.operate((function(t,r){var o=[],u=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(o,e),r.next(t),u&&f()},f=function(){if(o){var t=new i.Subscription;r.add(t);var n={buffer:[],subs:t};o.push(n),l.executeSchedule(t,d,(function(){return c(n)}),e)}};null!==p&&p>=0?l.executeSchedule(r,d,f,p,!0):u=!0,f();var h=s.createOperatorSubscriber(r,(function(e){var t,r,i=o.slice();try{for(var s=n(i),a=s.next();!a.done;a=s.next()){var u=a.value,l=u.buffer;l.push(e),v<=l.length&&c(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)r.next(o.shift().buffer);null==h||h.unsubscribe(),r.complete(),r.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(h)}))}},4943:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToggle=void 0;var i=r(3865),o=r(4935),s=r(7103),a=r(4990),u=r(2576),c=r(6967);t.bufferToggle=function(e,t){return o.operate((function(r,o){var l=[];s.innerFrom(e).subscribe(a.createOperatorSubscriber(o,(function(e){var r=[];l.push(r);var n=new i.Subscription;n.add(s.innerFrom(t(e)).subscribe(a.createOperatorSubscriber(o,(function(){c.arrRemove(l,r),o.next(r),n.unsubscribe()}),u.noop)))}),u.noop)),r.subscribe(a.createOperatorSubscriber(o,(function(e){var t,r;try{for(var i=n(l),o=i.next();!o.done;o=i.next())o.value.push(e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}),(function(){for(;l.length>0;)o.next(l.shift());o.complete()})))}))}},1240:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferWhen=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.bufferWhen=function(e){return n.operate((function(t,r){var n=null,a=null,u=function(){null==a||a.unsubscribe();var t=n;n=[],t&&r.next(t),s.innerFrom(e()).subscribe(a=o.createOperatorSubscriber(r,u,i.noop))};u(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==n?void 0:n.push(e)}),(function(){n&&r.next(n),r.complete()}),void 0,(function(){return n=a=null})))}))}},9548:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchError=void 0;var n=r(7103),i=r(4990),o=r(4935);t.catchError=function e(t){return o.operate((function(r,o){var s,a=null,u=!1;a=r.subscribe(i.createOperatorSubscriber(o,void 0,void 0,(function(i){s=n.innerFrom(t(i,e(t)(r))),a?(a.unsubscribe(),a=null,s.subscribe(o)):u=!0}))),u&&(a.unsubscribe(),a=null,s.subscribe(o))}))}},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineAll=void 0;var n=r(3240);t.combineAll=n.combineLatestAll},6318:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatest=void 0;var o=r(9258),s=r(4935),a=r(5498),u=r(1914),c=r(9985),l=r(2433);t.combineLatest=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var f=l.popResultSelector(t);return f?c.pipe(e.apply(void 0,i([],n(t))),u.mapOneOrManyArgs(f)):s.operate((function(e,r){o.combineLatestInit(i([e],n(a.argsOrArgArray(t))))(r)}))}},3240:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestAll=void 0;var n=r(9258),i=r(2069);t.combineLatestAll=function(e){return i.joinAllInternals(n.combineLatest,e)}},5024:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestWith=void 0;var o=r(6318);t.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.combineLatest.apply(void 0,i([],n(e)))}},4919:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var o=r(4935),s=r(4413),a=r(2433),u=r(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.popScheduler(e);return o.operate((function(t,o){s.concatAll()(u.from(i([t],n(e)),r)).subscribe(o)}))}},4413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAll=void 0;var n=r(3783);t.concatAll=function(){return n.mergeAll(1)}},7498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMap=void 0;var n=r(9475),i=r(3005);t.concatMap=function(e,t){return i.isFunction(t)?n.mergeMap(e,t,1):n.mergeMap(e,1)}},6109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMapTo=void 0;var n=r(7498),i=r(3005);t.concatMapTo=function(e,t){return i.isFunction(t)?n.concatMap((function(){return e}),t):n.concatMap((function(){return e}))}},9664:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concatWith=void 0;var o=r(4919);t.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concat.apply(void 0,i([],n(e)))}},1995:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var n=r(3032),i=r(7103),o=r(4935),s=r(851),a={connector:function(){return new n.Subject}};t.connect=function(e,t){void 0===t&&(t=a);var r=t.connector;return o.operate((function(t,n){var o=r();i.innerFrom(e(s.fromSubscribable(o))).subscribe(n),n.add(t.subscribe(o))}))}},993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.count=void 0;var n=r(122);t.count=function(e){return n.reduce((function(t,r,n){return!e||e(r,n)?t+1:t}),0)}},496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.debounce=function(e){return n.operate((function(t,r){var n=!1,a=null,u=null,c=function(){if(null==u||u.unsubscribe(),u=null,n){n=!1;var e=a;a=null,r.next(e)}};t.subscribe(o.createOperatorSubscriber(r,(function(t){null==u||u.unsubscribe(),n=!0,a=t,u=o.createOperatorSubscriber(r,c,i.noop),s.innerFrom(e(t)).subscribe(u)}),(function(){c(),r.complete()}),void 0,(function(){a=u=null})))}))}},1385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounceTime=void 0;var n=r(2445),i=r(4935),o=r(4990);t.debounceTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.operate((function(r,n){var i=null,s=null,a=null,u=function(){if(i){i.unsubscribe(),i=null;var e=s;s=null,n.next(e)}};function c(){var r=a+e,o=t.now();if(o<r)return i=this.schedule(void 0,r-o),void n.add(i);u()}r.subscribe(o.createOperatorSubscriber(n,(function(r){s=r,a=t.now(),i||(i=t.schedule(c,e),n.add(i))}),(function(){u(),n.complete()}),void 0,(function(){s=i=null})))}))}},1658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultIfEmpty=void 0;var n=r(4935),i=r(4990);t.defaultIfEmpty=function(e){return n.operate((function(t,r){var n=!1;t.subscribe(i.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}},5841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0;var n=r(2445),i=r(8798),o=r(7513);t.delay=function(e,t){void 0===t&&(t=n.asyncScheduler);var r=o.timer(e,t);return i.delayWhen((function(){return r}))}},8798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayWhen=void 0;var n=r(2239),i=r(4783),o=r(9438),s=r(8313),a=r(9475),u=r(7103);t.delayWhen=function e(t,r){return r?function(s){return n.concat(r.pipe(i.take(1),o.ignoreElements()),s.pipe(e(t)))}:a.mergeMap((function(e,r){return u.innerFrom(t(e,r)).pipe(i.take(1),s.mapTo(e))}))}},1080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dematerialize=void 0;var n=r(3104),i=r(4935),o=r(4990);t.dematerialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){return n.observeNotification(e,t)})))}))}},3054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinct=void 0;var n=r(4935),i=r(4990),o=r(2576),s=r(7103);t.distinct=function(e,t){return n.operate((function(r,n){var a=new Set;r.subscribe(i.createOperatorSubscriber(n,(function(t){var r=e?e(t):t;a.has(r)||(a.add(r),n.next(t))}))),t&&s.innerFrom(t).subscribe(i.createOperatorSubscriber(n,(function(){return a.clear()}),o.noop))}))}},8737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilChanged=void 0;var n=r(4781),i=r(4935),o=r(4990);function s(e,t){return e===t}t.distinctUntilChanged=function(e,t){return void 0===t&&(t=n.identity),e=null!=e?e:s,i.operate((function(r,n){var i,s=!0;r.subscribe(o.createOperatorSubscriber(n,(function(r){var o=t(r);!s&&e(i,o)||(s=!1,i=o,n.next(r))})))}))}},7957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilKeyChanged=void 0;var n=r(8737);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))}},8633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementAt=void 0;var n=r(2351),i=r(9154),o=r(1779),s=r(1658),a=r(4783);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(u){return u.pipe(i.filter((function(t,r){return r===e})),a.take(1),r?s.defaultIfEmpty(t):o.throwIfEmpty((function(){return new n.ArgumentOutOfRangeError})))}}},911:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.endWith=void 0;var o=r(2239),s=r(5726);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return o.concat(t,s.of.apply(void 0,i([],n(e))))}}},2096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.every=void 0;var n=r(4935),i=r(4990);t.every=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(i){e.call(t,i,o++,r)||(n.next(!1),n.complete())}),(function(){n.next(!0),n.complete()})))}))}},67:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaust=void 0;var n=r(5337);t.exhaust=n.exhaustAll},5337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustAll=void 0;var n=r(5635),i=r(4781);t.exhaustAll=function(){return n.exhaustMap(i.identity)}},5635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustMap=void 0;var n=r(7291),i=r(7103),o=r(4935),s=r(4990);t.exhaustMap=function e(t,r){return r?function(o){return o.pipe(e((function(e,o){return i.innerFrom(t(e,o)).pipe(n.map((function(t,n){return r(e,t,o,n)})))})))}:o.operate((function(e,r){var n=0,o=null,a=!1;e.subscribe(s.createOperatorSubscriber(r,(function(e){o||(o=s.createOperatorSubscriber(r,void 0,(function(){o=null,a&&r.complete()})),i.innerFrom(t(e,n++)).subscribe(o))}),(function(){a=!0,!o&&r.complete()})))}))}},9745:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expand=void 0;var n=r(4935),i=r(7788);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=(t||0)<1?1/0:t,n.operate((function(n,o){return i.mergeInternals(n,o,e,t,void 0,!0,r)}))}},9154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=void 0;var n=r(4935),i=r(4990);t.filter=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){return e.call(t,r,o++)&&n.next(r)})))}))}},9283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=void 0;var n=r(4935);t.finalize=function(e){return n.operate((function(t,r){try{t.subscribe(r)}finally{r.add(e)}}))}},7119:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFind=t.find=void 0;var n=r(4935),i=r(4990);function o(e,t,r){var n="index"===r;return function(r,o){var s=0;r.subscribe(i.createOperatorSubscriber(o,(function(i){var a=s++;e.call(t,i,a,r)&&(o.next(n?a:i),o.complete())}),(function(){o.next(n?-1:void 0),o.complete()})))}}t.find=function(e,t){return n.operate(o(e,t,"value"))},t.createFind=o},4706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findIndex=void 0;var n=r(4935),i=r(7119);t.findIndex=function(e,t){return n.operate(i.createFind(e,t,"index"))}},9219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.first=void 0;var n=r(9474),i=r(9154),o=r(4783),s=r(1658),a=r(1779),u=r(4781);t.first=function(e,t){var r=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,r){return e(t,r,c)})):u.identity,o.take(1),r?s.defaultIfEmpty(t):a.throwIfEmpty((function(){return new n.EmptyError})))}}},1788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var n=r(9475);t.flatMap=n.mergeMap},9749:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=void 0;var n=r(2419),i=r(7103),o=r(3032),s=r(4935),a=r(4990);t.groupBy=function(e,t,r,u){return s.operate((function(s,c){var l;t&&"function"!=typeof t?(r=t.duration,l=t.element,u=t.connector):l=t;var f=new Map,h=function(e){f.forEach(e),e(c)},d=function(e){return h((function(t){return t.error(e)}))},p=0,v=!1,m=new a.OperatorSubscriber(c,(function(t){try{var s=e(t),h=f.get(s);if(!h){f.set(s,h=u?u():new o.Subject);var g=(b=s,_=h,(w=new n.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&v&&m.unsubscribe()}}))).key=b,w);if(c.next(g),r){var y=a.createOperatorSubscriber(h,(function(){h.complete(),null==y||y.unsubscribe()}),void 0,void 0,(function(){return f.delete(s)}));m.add(i.innerFrom(r(g)).subscribe(y))}}h.next(l?l(t):t)}catch(e){d(e)}var b,_,w}),(function(){return h((function(e){return e.complete()}))}),d,(function(){return f.clear()}),(function(){return v=!0,0===p}));s.subscribe(m)}))}},9438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreElements=void 0;var n=r(4935),i=r(4990),o=r(2576);t.ignoreElements=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,o.noop))}))}},8515:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var n=r(4935),i=r(4990);t.isEmpty=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}},2069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinAllInternals=void 0;var n=r(4781),i=r(1914),o=r(9985),s=r(9475),a=r(2);t.joinAllInternals=function(e,t){return o.pipe(a.toArray(),s.mergeMap((function(t){return e(t)})),t?i.mapOneOrManyArgs(t):n.identity)}},2435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;var n=r(9474),i=r(9154),o=r(1980),s=r(1779),a=r(1658),u=r(4781);t.last=function(e,t){var r=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,r){return e(t,r,c)})):u.identity,o.takeLast(1),r?a.defaultIfEmpty(t):s.throwIfEmpty((function(){return new n.EmptyError})))}}},7291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=void 0;var n=r(4935),i=r(4990);t.map=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){n.next(e.call(t,r,o++))})))}))}},8313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTo=void 0;var n=r(7291);t.mapTo=function(e){return n.map((function(){return e}))}},3209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materialize=void 0;var n=r(3104),i=r(4935),o=r(4990);t.materialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){t.next(n.Notification.createNext(e))}),(function(){t.next(n.Notification.createComplete()),t.complete()}),(function(e){t.next(n.Notification.createError(e)),t.complete()})))}))}},2620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.max=void 0;var n=r(122),i=r(3005);t.max=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},9821:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var o=r(4935),s=r(5498),a=r(3783),u=r(2433),c=r(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=u.popScheduler(e),l=u.popNumber(e,1/0);return e=s.argsOrArgArray(e),o.operate((function(t,o){a.mergeAll(l)(c.from(i([t],n(e)),r)).subscribe(o)}))}},3783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=void 0;var n=r(9475),i=r(4781);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},7788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeInternals=void 0;var n=r(7103),i=r(7738),o=r(4990);t.mergeInternals=function(e,t,r,s,a,u,c,l){var f=[],h=0,d=0,p=!1,v=function(){!p||f.length||h||t.complete()},m=function(e){return h<s?g(e):f.push(e)},g=function(e){u&&t.next(e),h++;var l=!1;n.innerFrom(r(e,d++)).subscribe(o.createOperatorSubscriber(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{h--;for(var e=function(){var e=f.shift();c?i.executeSchedule(t,c,(function(){return g(e)})):g(e)};f.length&&h<s;)e();v()}catch(e){t.error(e)}})))};return e.subscribe(o.createOperatorSubscriber(t,m,(function(){p=!0,v()}))),function(){null==l||l()}}},9475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMap=void 0;var n=r(7291),i=r(7103),o=r(4935),s=r(7788),a=r(3005);t.mergeMap=function e(t,r,u){return void 0===u&&(u=1/0),a.isFunction(r)?e((function(e,o){return n.map((function(t,n){return r(e,t,o,n)}))(i.innerFrom(t(e,o)))}),u):("number"==typeof r&&(u=r),o.operate((function(e,r){return s.mergeInternals(e,r,t,u)})))}},1211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMapTo=void 0;var n=r(9475),i=r(3005);t.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),i.isFunction(t)?n.mergeMap((function(){return e}),t,r):("number"==typeof t&&(r=t),n.mergeMap((function(){return e}),r))}},7267:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeScan=void 0;var n=r(4935),i=r(7788);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),n.operate((function(n,o){var s=t;return i.mergeInternals(n,o,(function(t,r){return e(s,t,r)}),r,(function(e){s=e}),!1,void 0,(function(){return s=null}))}))}},9303:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeWith=void 0;var o=r(9821);t.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.merge.apply(void 0,i([],n(e)))}},9714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.min=void 0;var n=r(122),i=r(3005);t.min=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t})}},3848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multicast=void 0;var n=r(9518),i=r(3005),o=r(1995);t.multicast=function(e,t){var r=i.isFunction(e)?e:function(){return e};return i.isFunction(t)?o.connect(t,{connector:r}):function(e){return new n.ConnectableObservable(e,r)}}},1184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeOn=void 0;var n=r(7738),i=r(4935),o=r(4990);t.observeOn=function(e,t){return void 0===t&&(t=0),i.operate((function(r,i){r.subscribe(o.createOperatorSubscriber(i,(function(r){return n.executeSchedule(i,e,(function(){return i.next(r)}),t)}),(function(){return n.executeSchedule(i,e,(function(){return i.complete()}),t)}),(function(r){return n.executeSchedule(i,e,(function(){return i.error(r)}),t)})))}))}},7582:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=t.onErrorResumeNextWith=void 0;var o=r(5498),s=r(724);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.argsOrArgArray(e);return function(e){return s.onErrorResumeNext.apply(void 0,i([e],n(r)))}}t.onErrorResumeNextWith=a,t.onErrorResumeNext=a},2731:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairwise=void 0;var n=r(4935),i=r(4990);t.pairwise=function(){return n.operate((function(e,t){var r,n=!1;e.subscribe(i.createOperatorSubscriber(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))}))}},5649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8634),i=r(9154);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},4691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pluck=void 0;var n=r(7291);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return n.map((function(t){for(var n=t,i=0;i<r;i++){var o=null==n?void 0:n[e[i]];if(void 0===o)return;n=o}return n}))}},4474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publish=void 0;var n=r(3032),i=r(3848),o=r(1995);t.publish=function(e){return e?function(t){return o.connect(e)(t)}:function(e){return i.multicast(new n.Subject)(e)}}},52:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishBehavior=void 0;var n=r(5240),i=r(9518);t.publishBehavior=function(e){return function(t){var r=new n.BehaviorSubject(e);return new i.ConnectableObservable(t,(function(){return r}))}}},2110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishLast=void 0;var n=r(280),i=r(9518);t.publishLast=function(){return function(e){var t=new n.AsyncSubject;return new i.ConnectableObservable(e,(function(){return t}))}}},9864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishReplay=void 0;var n=r(3274),i=r(3848),o=r(3005);t.publishReplay=function(e,t,r,s){r&&!o.isFunction(r)&&(s=r);var a=o.isFunction(r)?r:void 0;return function(r){return i.multicast(new n.ReplaySubject(e,t,s),a)(r)}}},9764:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0;var o=r(5498),s=r(179);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.raceWith.apply(void 0,i([],n(o.argsOrArgArray(e))))}},179:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.raceWith=void 0;var o=r(5182),s=r(4935),a=r(4781);t.raceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?s.operate((function(t,r){o.raceInit(i([t],n(e)))(r)})):a.identity}},122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduce=void 0;var n=r(8345),i=r(4935);t.reduce=function(e,t){return i.operate(n.scanInternals(e,t,arguments.length>=2,!1,!0))}},8739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refCount=void 0;var n=r(4935),i=r(4990);t.refCount=function(){return n.operate((function(e,t){var r=null;e._refCount++;var n=i.createOperatorSubscriber(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))}},5313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=void 0;var n=r(6332),i=r(4935),o=r(4990),s=r(7103),a=r(7513);t.repeat=function(e){var t,r,u=1/0;return null!=e&&("object"==typeof e?(t=e.count,u=void 0===t?1/0:t,r=e.delay):u=e),u<=0?function(){return n.EMPTY}:i.operate((function(e,t){var n,i=0,c=function(){if(null==n||n.unsubscribe(),n=null,null!=r){var e="number"==typeof r?a.timer(r):s.innerFrom(r(i)),u=o.createOperatorSubscriber(t,(function(){u.unsubscribe(),l()}));e.subscribe(u)}else l()},l=function(){var r=!1;n=e.subscribe(o.createOperatorSubscriber(t,void 0,(function(){++i<u?n?c():r=!0:t.complete()}))),r&&c()};l()}))}},4068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatWhen=void 0;var n=r(7103),i=r(3032),o=r(4935),s=r(4990);t.repeatWhen=function(e){return o.operate((function(t,r){var o,a,u=!1,c=!1,l=!1,f=function(){return l&&c&&(r.complete(),!0)},h=function(){l=!1,o=t.subscribe(s.createOperatorSubscriber(r,void 0,(function(){l=!0,!f()&&(a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){o?h():u=!0}),(function(){c=!0,f()})))),a).next()}))),u&&(o.unsubscribe(),o=null,u=!1,h())};h()}))}},64:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;var n=r(4935),i=r(4990),o=r(4781),s=r(7513),a=r(7103);t.retry=function(e){var t;void 0===e&&(e=1/0);var r=(t=e&&"object"==typeof e?e:{count:e}).count,u=void 0===r?1/0:r,c=t.delay,l=t.resetOnSuccess,f=void 0!==l&&l;return u<=0?o.identity:n.operate((function(e,t){var r,n=0,o=function(){var l=!1;r=e.subscribe(i.createOperatorSubscriber(t,(function(e){f&&(n=0),t.next(e)}),void 0,(function(e){if(n++<u){var f=function(){r?(r.unsubscribe(),r=null,o()):l=!0};if(null!=c){var h="number"==typeof c?s.timer(c):a.innerFrom(c(e,n)),d=i.createOperatorSubscriber(t,(function(){d.unsubscribe(),f()}),(function(){t.complete()}));h.subscribe(d)}else f()}else t.error(e)}))),l&&(r.unsubscribe(),r=null,o())};o()}))}},1188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryWhen=void 0;var n=r(7103),i=r(3032),o=r(4935),s=r(4990);t.retryWhen=function(e){return o.operate((function(t,r){var o,a,u=!1,c=function(){o=t.subscribe(s.createOperatorSubscriber(r,void 0,void 0,(function(t){a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){return o?c():u=!0})))),a&&a.next(t)}))),u&&(o.unsubscribe(),o=null,u=!1,c())};c()}))}},4193:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=void 0;var n=r(7103),i=r(4935),o=r(2576),s=r(4990);t.sample=function(e){return i.operate((function(t,r){var i=!1,a=null;t.subscribe(s.createOperatorSubscriber(r,(function(e){i=!0,a=e}))),n.innerFrom(e).subscribe(s.createOperatorSubscriber(r,(function(){if(i){i=!1;var e=a;a=null,r.next(e)}}),o.noop))}))}},6170:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleTime=void 0;var n=r(2445),i=r(4193),o=r(8990);t.sampleTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.sample(o.interval(e,t))}},5876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scan=void 0;var n=r(4935),i=r(8345);t.scan=function(e,t){return n.operate(i.scanInternals(e,t,arguments.length>=2,!0))}},8345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanInternals=void 0;var n=r(4990);t.scanInternals=function(e,t,r,i,o){return function(s,a){var u=r,c=t,l=0;s.subscribe(n.createOperatorSubscriber(a,(function(t){var r=l++;c=u?e(c,t,r):(u=!0,t),i&&a.next(c)}),o&&function(){u&&a.next(c),a.complete()}))}}},1791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceEqual=void 0;var n=r(4935),i=r(4990),o=r(7103);t.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),n.operate((function(r,n){var s={buffer:[],complete:!1},a={buffer:[],complete:!1},u=function(e){n.next(e),n.complete()},c=function(e,r){var o=i.createOperatorSubscriber(n,(function(n){var i=r.buffer,o=r.complete;0===i.length?o?u(!1):e.buffer.push(n):!t(n,i.shift())&&u(!1)}),(function(){e.complete=!0;var t=r.complete,n=r.buffer;t&&u(0===n.length),null==o||o.unsubscribe()}));return o};r.subscribe(c(s,a)),o.innerFrom(e).subscribe(c(a,s))}))}},5137:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.share=void 0;var o=r(7103),s=r(3032),a=r(5125),u=r(4935);function c(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0!==t){if(!1!==t){var u=new a.SafeSubscriber({next:function(){u.unsubscribe(),e()}});return o.innerFrom(t.apply(void 0,i([],n(r)))).subscribe(u)}}else e()}t.share=function(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.Subject}:t,n=e.resetOnError,i=void 0===n||n,l=e.resetOnComplete,f=void 0===l||l,h=e.resetOnRefCountZero,d=void 0===h||h;return function(e){var t,n,s,l=0,h=!1,p=!1,v=function(){null==n||n.unsubscribe(),n=void 0},m=function(){v(),t=s=void 0,h=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return u.operate((function(e,u){l++,p||h||v();var y=s=null!=s?s:r();u.add((function(){0!=--l||p||h||(n=c(g,d))})),y.subscribe(u),!t&&l>0&&(t=new a.SafeSubscriber({next:function(e){return y.next(e)},error:function(e){p=!0,v(),n=c(m,i,e),y.error(e)},complete:function(){h=!0,v(),n=c(m,f),y.complete()}}),o.innerFrom(e).subscribe(t))}))(e)}}},1348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shareReplay=void 0;var n=r(3274),i=r(5137);t.shareReplay=function(e,t,r){var o,s,a,u,c=!1;return e&&"object"==typeof e?(o=e.bufferSize,u=void 0===o?1/0:o,s=e.windowTime,t=void 0===s?1/0:s,c=void 0!==(a=e.refCount)&&a,r=e.scheduler):u=null!=e?e:1/0,i.share({connector:function(){return new n.ReplaySubject(u,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},8242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.single=void 0;var n=r(9474),i=r(6156),o=r(8598),s=r(4935),a=r(4990);t.single=function(e){return s.operate((function(t,r){var s,u=!1,c=!1,l=0;t.subscribe(a.createOperatorSubscriber(r,(function(n){c=!0,e&&!e(n,l++,t)||(u&&r.error(new i.SequenceError("Too many matching values")),u=!0,s=n)}),(function(){u?(r.next(s),r.complete()):r.error(c?new o.NotFoundError("No matching values"):new n.EmptyError)})))}))}},3169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skip=void 0;var n=r(9154);t.skip=function(e){return n.filter((function(t,r){return e<=r}))}},2454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipLast=void 0;var n=r(4781),i=r(4935),o=r(4990);t.skipLast=function(e){return e<=0?n.identity:i.operate((function(t,r){var n=new Array(e),i=0;return t.subscribe(o.createOperatorSubscriber(r,(function(t){var o=i++;if(o<e)n[o]=t;else{var s=o%e,a=n[s];n[s]=t,r.next(a)}}))),function(){n=null}}))}},6931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipUntil=void 0;var n=r(4935),i=r(4990),o=r(7103),s=r(2576);t.skipUntil=function(e){return n.operate((function(t,r){var n=!1,a=i.createOperatorSubscriber(r,(function(){null==a||a.unsubscribe(),n=!0}),s.noop);o.innerFrom(e).subscribe(a),t.subscribe(i.createOperatorSubscriber(r,(function(e){return n&&r.next(e)})))}))}},7913:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipWhile=void 0;var n=r(4935),i=r(4990);t.skipWhile=function(e){return n.operate((function(t,r){var n=!1,o=0;t.subscribe(i.createOperatorSubscriber(r,(function(t){return(n||(n=!e(t,o++)))&&r.next(t)})))}))}},9234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startWith=void 0;var n=r(2239),i=r(2433),o=r(4935);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.popScheduler(e);return o.operate((function(t,i){(r?n.concat(e,t,r):n.concat(e,t)).subscribe(i)}))}},276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOn=void 0;var n=r(4935);t.subscribeOn=function(e,t){return void 0===t&&(t=0),n.operate((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}},9253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchAll=void 0;var n=r(8518),i=r(4781);t.switchAll=function(){return n.switchMap(i.identity)}},8518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMap=void 0;var n=r(7103),i=r(4935),o=r(4990);t.switchMap=function(e,t){return i.operate((function(r,i){var s=null,a=0,u=!1,c=function(){return u&&!s&&i.complete()};r.subscribe(o.createOperatorSubscriber(i,(function(r){null==s||s.unsubscribe();var u=0,l=a++;n.innerFrom(e(r,l)).subscribe(s=o.createOperatorSubscriber(i,(function(e){return i.next(t?t(r,e,l,u++):e)}),(function(){s=null,c()})))}),(function(){u=!0,c()})))}))}},1173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var n=r(8518),i=r(3005);t.switchMapTo=function(e,t){return i.isFunction(t)?n.switchMap((function(){return e}),t):n.switchMap((function(){return e}))}},3855:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchScan=void 0;var n=r(8518),i=r(4935);t.switchScan=function(e,t){return i.operate((function(r,i){var o=t;return n.switchMap((function(t,r){return e(o,t,r)}),(function(e,t){return o=t,t}))(r).subscribe(i),function(){o=null}}))}},4783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.take=void 0;var n=r(6332),i=r(4935),o=r(4990);t.take=function(e){return e<=0?function(){return n.EMPTY}:i.operate((function(t,r){var n=0;t.subscribe(o.createOperatorSubscriber(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}},1980:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.takeLast=void 0;var i=r(6332),o=r(4935),s=r(4990);t.takeLast=function(e){return e<=0?function(){return i.EMPTY}:o.operate((function(t,r){var i=[];t.subscribe(s.createOperatorSubscriber(r,(function(t){i.push(t),e<i.length&&i.shift()}),(function(){var e,t;try{for(var o=n(i),s=o.next();!s.done;s=o.next()){var a=s.value;r.next(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}r.complete()}),void 0,(function(){i=null})))}))}},9845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeUntil=void 0;var n=r(4935),i=r(4990),o=r(7103),s=r(2576);t.takeUntil=function(e){return n.operate((function(t,r){o.innerFrom(e).subscribe(i.createOperatorSubscriber(r,(function(){return r.complete()}),s.noop)),!r.closed&&t.subscribe(r)}))}},6060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0;var n=r(4935),i=r(4990);t.takeWhile=function(e,t){return void 0===t&&(t=!1),n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){var i=e(r,o++);(i||t)&&n.next(r),!i&&n.complete()})))}))}},1138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tap=void 0;var n=r(3005),i=r(4935),o=r(4990),s=r(4781);t.tap=function(e,t,r){var a=n.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return a?i.operate((function(e,t){var r;null===(r=a.subscribe)||void 0===r||r.call(a);var n=!0;e.subscribe(o.createOperatorSubscriber(t,(function(e){var r;null===(r=a.next)||void 0===r||r.call(a,e),t.next(e)}),(function(){var e;n=!1,null===(e=a.complete)||void 0===e||e.call(a),t.complete()}),(function(e){var r;n=!1,null===(r=a.error)||void 0===r||r.call(a,e),t.error(e)}),(function(){var e,t;n&&(null===(e=a.unsubscribe)||void 0===e||e.call(a)),null===(t=a.finalize)||void 0===t||t.call(a)})))})):s.identity}},7306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=void 0;var n=r(4935),i=r(4990),o=r(7103);t.throttle=function(e,t){return n.operate((function(r,n){var s=null!=t?t:{},a=s.leading,u=void 0===a||a,c=s.trailing,l=void 0!==c&&c,f=!1,h=null,d=null,p=!1,v=function(){null==d||d.unsubscribe(),d=null,l&&(y(),p&&n.complete())},m=function(){d=null,p&&n.complete()},g=function(t){return d=o.innerFrom(e(t)).subscribe(i.createOperatorSubscriber(n,v,m))},y=function(){if(f){f=!1;var e=h;h=null,n.next(e),!p&&g(e)}};r.subscribe(i.createOperatorSubscriber(n,(function(e){f=!0,h=e,(!d||d.closed)&&(u?y():g(e))}),(function(){p=!0,(!(l&&f&&d)||d.closed)&&n.complete()})))}))}},8968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttleTime=void 0;var n=r(2445),i=r(7306),o=r(7513);t.throttleTime=function(e,t,r){void 0===t&&(t=n.asyncScheduler);var s=o.timer(e,t);return i.throttle((function(){return s}),r)}},1779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfEmpty=void 0;var n=r(9474),i=r(4935),o=r(4990);function s(){return new n.EmptyError}t.throwIfEmpty=function(e){return void 0===e&&(e=s),i.operate((function(t,r){var n=!1;t.subscribe(o.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}},8005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeInterval=t.timeInterval=void 0;var n=r(2445),i=r(4935),o=r(4990);t.timeInterval=function(e){return void 0===e&&(e=n.asyncScheduler),i.operate((function(t,r){var n=e.now();t.subscribe(o.createOperatorSubscriber(r,(function(t){var i=e.now(),o=i-n;n=i,r.next(new s(t,o))})))}))};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},4173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=t.TimeoutError=void 0;var n=r(2445),i=r(1677),o=r(4935),s=r(7103),a=r(7029),u=r(4990),c=r(7738);function l(e){throw new t.TimeoutError(e)}t.TimeoutError=a.createErrorClass((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})),t.timeout=function(e,t){var r=i.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,a=r.first,f=r.each,h=r.with,d=void 0===h?l:h,p=r.scheduler,v=void 0===p?null!=t?t:n.asyncScheduler:p,m=r.meta,g=void 0===m?null:m;if(null==a&&null==f)throw new TypeError("No timeout provided.");return o.operate((function(e,t){var r,n,i=null,o=0,l=function(e){n=c.executeSchedule(t,v,(function(){try{r.unsubscribe(),s.innerFrom(d({meta:g,lastValue:i,seen:o})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(u.createOperatorSubscriber(t,(function(e){null==n||n.unsubscribe(),o++,t.next(i=e),f>0&&l(f)}),void 0,void 0,(function(){(null==n?void 0:n.closed)||null==n||n.unsubscribe(),i=null}))),!o&&l(null!=a?"number"==typeof a?a:+a-v.now():f)}))}},7223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutWith=void 0;var n=r(2445),i=r(1677),o=r(4173);t.timeoutWith=function(e,t,r){var s,a,u;if(r=null!=r?r:n.async,i.isValidDate(e)?s=e:"number"==typeof e&&(a=e),!t)throw new TypeError("No observable provided to switch to");if(u=function(){return t},null==s&&null==a)throw new TypeError("No timeout provided.");return o.timeout({first:s,each:a,scheduler:r,with:u})}},8975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestamp=void 0;var n=r(7950),i=r(7291);t.timestamp=function(e){return void 0===e&&(e=n.dateTimestampProvider),i.map((function(t){return{value:t,timestamp:e.now()}}))}},2:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var n=r(122),i=r(4935),o=function(e,t){return e.push(t),e};t.toArray=function(){return i.operate((function(e,t){n.reduce(o,[])(e).subscribe(t)}))}},2826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.window=void 0;var n=r(3032),i=r(4935),o=r(4990),s=r(2576),a=r(7103);t.window=function(e){return i.operate((function(t,r){var i=new n.Subject;r.next(i.asObservable());var u=function(e){i.error(e),r.error(e)};return t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==i?void 0:i.next(e)}),(function(){i.complete(),r.complete()}),u)),a.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){i.complete(),r.next(i=new n.Subject)}),s.noop,u)),function(){null==i||i.unsubscribe(),i=null}}))}},7526:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowCount=void 0;var i=r(3032),o=r(4935),s=r(4990);t.windowCount=function(e,t){void 0===t&&(t=0);var r=t>0?t:e;return o.operate((function(t,o){var a=[new i.Subject],u=0;o.next(a[0].asObservable()),t.subscribe(s.createOperatorSubscriber(o,(function(t){var s,c;try{for(var l=n(a),f=l.next();!f.done;f=l.next())f.value.next(t)}catch(e){s={error:e}}finally{try{f&&!f.done&&(c=l.return)&&c.call(l)}finally{if(s)throw s.error}}var h=u-e+1;if(h>=0&&h%r==0&&a.shift().complete(),++u%r==0){var d=new i.Subject;a.push(d),o.next(d.asObservable())}}),(function(){for(;a.length>0;)a.shift().complete();o.complete()}),(function(e){for(;a.length>0;)a.shift().error(e);o.error(e)}),(function(){a=null})))}))}},8294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowTime=void 0;var n=r(3032),i=r(2445),o=r(3865),s=r(4935),a=r(4990),u=r(6967),c=r(2433),l=r(7738);t.windowTime=function(e){for(var t,r,f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];var d=null!==(t=c.popScheduler(f))&&void 0!==t?t:i.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,v=f[1]||1/0;return s.operate((function(t,r){var i=[],s=!1,c=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),u.arrRemove(i,e),s&&f()},f=function(){if(i){var t=new o.Subscription;r.add(t);var s=new n.Subject,a={window:s,subs:t,seen:0};i.push(a),r.next(s.asObservable()),l.executeSchedule(t,d,(function(){return c(a)}),e)}};null!==p&&p>=0?l.executeSchedule(r,d,f,p,!0):s=!0,f();var h=function(e){return i.slice().forEach(e)},m=function(e){h((function(t){var r=t.window;return e(r)})),e(r),r.unsubscribe()};return t.subscribe(a.createOperatorSubscriber(r,(function(e){h((function(t){t.window.next(e),v<=++t.seen&&c(t)}))}),(function(){return m((function(e){return e.complete()}))}),(function(e){return m((function(t){return t.error(e)}))}))),function(){i=null}}))}},1883:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowToggle=void 0;var i=r(3032),o=r(3865),s=r(4935),a=r(7103),u=r(4990),c=r(2576),l=r(6967);t.windowToggle=function(e,t){return s.operate((function(r,s){var f=[],h=function(e){for(;0<f.length;)f.shift().error(e);s.error(e)};a.innerFrom(e).subscribe(u.createOperatorSubscriber(s,(function(e){var r=new i.Subject;f.push(r);var n,d=new o.Subscription;try{n=a.innerFrom(t(e))}catch(e){return void h(e)}s.next(r.asObservable()),d.add(n.subscribe(u.createOperatorSubscriber(s,(function(){l.arrRemove(f,r),r.complete(),d.unsubscribe()}),c.noop,h)))}),c.noop)),r.subscribe(u.createOperatorSubscriber(s,(function(e){var t,r,i=f.slice();try{for(var o=n(i),s=o.next();!s.done;s=o.next())s.value.next(e)}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}),(function(){for(;0<f.length;)f.shift().complete();s.complete()}),h,(function(){for(;0<f.length;)f.shift().unsubscribe()})))}))}},4309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowWhen=void 0;var n=r(3032),i=r(4935),o=r(4990),s=r(7103);t.windowWhen=function(e){return i.operate((function(t,r){var i,a,u=function(e){i.error(e),r.error(e)},c=function(){var t;null==a||a.unsubscribe(),null==i||i.complete(),i=new n.Subject,r.next(i.asObservable());try{t=s.innerFrom(e())}catch(e){return void u(e)}t.subscribe(a=o.createOperatorSubscriber(r,c,c,u))};c(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return i.next(e)}),(function(){i.complete(),r.complete()}),u,(function(){null==a||a.unsubscribe(),i=null})))}))}},3041:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.withLatestFrom=void 0;var o=r(4935),s=r(4990),a=r(7103),u=r(4781),c=r(2576),l=r(2433);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e);return o.operate((function(t,o){for(var l=e.length,f=new Array(l),h=e.map((function(){return!1})),d=!1,p=function(t){a.innerFrom(e[t]).subscribe(s.createOperatorSubscriber(o,(function(e){f[t]=e,d||h[t]||(h[t]=!0,(d=h.every(u.identity))&&(h=null))}),c.noop))},v=0;v<l;v++)p(v);t.subscribe(s.createOperatorSubscriber(o,(function(e){if(d){var t=i([e],n(f));o.next(r?r.apply(void 0,i([],n(t))):t)}})))}))}},4400:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(7654),s=r(4935);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.operate((function(t,r){o.zip.apply(void 0,i([t],n(e))).subscribe(r)}))}},8593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zipAll=void 0;var n=r(7654),i=r(2069);t.zipAll=function(e){return i.joinAllInternals(n.zip,e)}},8096:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zipWith=void 0;var o=r(4400);t.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.zip.apply(void 0,i([],n(e)))}},7631:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleArray=void 0;var n=r(2419);t.scheduleArray=function(e,t){return new n.Observable((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}},8489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAsyncIterable=void 0;var n=r(2419),i=r(7738);t.scheduleAsyncIterable=function(e,t){if(!e)throw new Error("Iterable cannot be null");return new n.Observable((function(r){i.executeSchedule(r,t,(function(){var n=e[Symbol.asyncIterator]();i.executeSchedule(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}},1297:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleIterable=void 0;var n=r(2419),i=r(3725),o=r(3005),s=r(7738);t.scheduleIterable=function(e,t){return new n.Observable((function(r){var n;return s.executeSchedule(r,t,(function(){n=e[i.iterator](),s.executeSchedule(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return o.isFunction(null==n?void 0:n.return)&&n.return()}}))}},4001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleObservable=void 0;var n=r(7103),i=r(1184),o=r(276);t.scheduleObservable=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},5143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schedulePromise=void 0;var n=r(7103),i=r(1184),o=r(276);t.schedulePromise=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},3676:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleReadableStreamLike=void 0;var n=r(8489),i=r(7823);t.scheduleReadableStreamLike=function(e,t){return n.scheduleAsyncIterable(i.readableStreamLikeToAsyncGenerator(e),t)}},5207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduled=void 0;var n=r(4001),i=r(5143),o=r(7631),s=r(1297),a=r(8489),u=r(9500),c=r(6018),l=r(3909),f=r(2743),h=r(9595),d=r(9906),p=r(7823),v=r(3676);t.scheduled=function(e,t){if(null!=e){if(u.isInteropObservable(e))return n.scheduleObservable(e,t);if(l.isArrayLike(e))return o.scheduleArray(e,t);if(c.isPromise(e))return i.schedulePromise(e,t);if(h.isAsyncIterable(e))return a.scheduleAsyncIterable(e,t);if(f.isIterable(e))return s.scheduleIterable(e,t);if(p.isReadableStreamLike(e))return v.scheduleReadableStreamLike(e,t)}throw d.createInvalidObservableTypeError(e)}},1986:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0;var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(3865).Subscription);t.Action=o},7574:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameAction=void 0;var o=r(9702),s=r(505),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},t}(o.AsyncAction);t.AnimationFrameAction=a},2934:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(3643).AsyncScheduler);t.AnimationFrameScheduler=o},2189:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapAction=void 0;var o=r(9702),s=r(8908),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.immediateProvider.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(o.AsyncAction);t.AsapAction=a},5523:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(3643).AsyncScheduler);t.AsapScheduler=o},9702:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=void 0;var o=r(1986),s=r(8203),a=r(6967),u=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.intervalProvider.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.intervalProvider.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,a.arrRemove(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(o.Action);t.AsyncAction=u},3643:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncScheduler=void 0;var o=r(218),s=function(e){function t(t,r){void 0===r&&(r=o.Scheduler.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return i(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(o.Scheduler);t.AsyncScheduler=s},6201:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=void 0;var o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(r(9702).AsyncAction);t.QueueAction=o},5860:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(3643).AsyncScheduler);t.QueueScheduler=o},4123:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualAction=t.VirtualTimeScheduler=void 0;var o=r(9702),s=r(3865),a=function(e){function t(t,r){void 0===t&&(t=u),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return i(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(r(3643).AsyncScheduler);t.VirtualTimeScheduler=a;var u=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return i(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return s.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(o.AsyncAction);t.VirtualAction=u},3660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var n=r(7574),i=r(2934);t.animationFrameScheduler=new i.AnimationFrameScheduler(n.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler},505:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrameProvider=void 0;var o=r(3865);t.animationFrameProvider={schedule:function(e){var r=requestAnimationFrame,n=cancelAnimationFrame,i=t.animationFrameProvider.delegate;i&&(r=i.requestAnimationFrame,n=i.cancelAnimationFrame);var s=r((function(t){n=void 0,e(t)}));return new o.Subscription((function(){return null==n?void 0:n(s)}))},requestAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.requestAnimationFrame)||requestAnimationFrame).apply(void 0,i([],n(e)))},cancelAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,i([],n(e)))},delegate:void 0}},580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var n=r(2189),i=r(5523);t.asapScheduler=new i.AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},2445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var n=r(9702),i=r(3643);t.asyncScheduler=new i.AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},7950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}},8908:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.immediateProvider=void 0;var o=r(7629),s=o.Immediate.setImmediate,a=o.Immediate.clearImmediate;t.immediateProvider={setImmediate:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.immediateProvider.delegate;return((null==o?void 0:o.setImmediate)||s).apply(void 0,i([],n(e)))},clearImmediate:function(e){var r=t.immediateProvider.delegate;return((null==r?void 0:r.clearImmediate)||a)(e)},delegate:void 0}},8203:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.intervalProvider=void 0,t.intervalProvider={setInterval:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.intervalProvider.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,n([e,i],r(o))):setInterval.apply(void 0,n([e,i],r(o)))},clearInterval:function(e){var r=t.intervalProvider.delegate;return((null==r?void 0:r.clearInterval)||clearInterval)(e)},delegate:void 0}},6813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performanceTimestampProvider=void 0,t.performanceTimestampProvider={now:function(){return(t.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}},8615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var n=r(6201),i=r(5860);t.queueScheduler=new i.QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},4590:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutProvider=void 0,t.timeoutProvider={setTimeout:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.timeoutProvider.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,n([e,i],r(o))):setTimeout.apply(void 0,n([e,i],r(o)))},clearTimeout:function(e){var r=t.timeoutProvider.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0}},3725:(e,t)=>{"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.iterator=t.getSymbolIterator=void 0,t.getSymbolIterator=r,t.iterator=r()},2801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},8433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2351:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=void 0;var n=r(7029);t.ArgumentOutOfRangeError=n.createErrorClass((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}))},9474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=void 0;var n=r(7029);t.EmptyError=n.createErrorClass((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},7629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTools=t.Immediate=void 0;var r,n=1,i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return i[t]=!0,r||(r=Promise.resolve()),r.then((function(){return o(t)&&e()})),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},8598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundError=void 0;var n=r(7029);t.NotFoundError=n.createErrorClass((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}}))},2642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=void 0;var n=r(7029);t.ObjectUnsubscribedError=n.createErrorClass((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}))},6156:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceError=void 0;var n=r(7029);t.SequenceError=n.createErrorClass((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}))},4805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=void 0;var n=r(7029);t.UnsubscriptionError=n.createErrorClass((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}))},2433:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.popNumber=t.popScheduler=t.popResultSelector=void 0;var n=r(3005),i=r(9016);function o(e){return e[e.length-1]}t.popResultSelector=function(e){return n.isFunction(o(e))?e.pop():void 0},t.popScheduler=function(e){return i.isScheduler(o(e))?e.pop():void 0},t.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t}},1203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsArgArrayOrObject=void 0;var r=Array.isArray,n=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;t.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((a=t)&&"object"==typeof a&&n(a)===i){var s=o(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var a;return{args:e,keys:null}}},5498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsOrArgArray=void 0;var r=Array.isArray;t.argsOrArgArray=function(e){return 1===e.length&&r(e[0])?e[0]:e}},6967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrRemove=void 0,t.arrRemove=function(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},7029:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorClass=void 0,t.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},641:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObject=void 0,t.createObject=function(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}},6110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.captureError=t.errorContext=void 0;var n=r(3280),i=null;t.errorContext=function(e){if(n.config.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()},t.captureError=function(e){n.config.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeSchedule=void 0,t.executeSchedule=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}},4781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=void 0,t.identity=function(e){return e}},3909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=void 0,t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},9595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=void 0;var n=r(3005);t.isAsyncIterable=function(e){return Symbol.asyncIterator&&n.isFunction(null==e?void 0:e[Symbol.asyncIterator])}},1677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidDate=void 0,t.isValidDate=function(e){return e instanceof Date&&!isNaN(e)}},3005:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},9500:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteropObservable=void 0;var n=r(2801),i=r(3005);t.isInteropObservable=function(e){return i.isFunction(e[n.observable])}},2743:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterable=void 0;var n=r(3725),i=r(3005);t.isIterable=function(e){return i.isFunction(null==e?void 0:e[n.iterator])}},8386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObservable=void 0;var n=r(2419),i=r(3005);t.isObservable=function(e){return!!e&&(e instanceof n.Observable||i.isFunction(e.lift)&&i.isFunction(e.subscribe))}},6018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0;var n=r(3005);t.isPromise=function(e){return n.isFunction(null==e?void 0:e.then)}},7823:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i=this&&this.__await||function(e){return this instanceof i?(this.v=e,this):new i(e)},o=this&&this.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||u(e,t)}))})}function u(e,t){try{(r=o[e](t)).value instanceof i?Promise.resolve(r.value.v).then(c,l):f(s[0][2],r)}catch(e){f(s[0][3],e)}var r}function c(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),s.shift(),s.length&&u(s[0][0],s[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.isReadableStreamLike=t.readableStreamLikeToAsyncGenerator=void 0;var s=r(3005);t.readableStreamLikeToAsyncGenerator=function(e){return o(this,arguments,(function(){var t,r,o;return n(this,(function(n){switch(n.label){case 0:t=e.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,i(t.read())];case 3:return r=n.sent(),o=r.value,r.done?[4,i(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,i(o)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))},t.isReadableStreamLike=function(e){return s.isFunction(null==e?void 0:e.getReader)}},9016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=void 0;var n=r(3005);t.isScheduler=function(e){return e&&n.isFunction(e.schedule)}},4935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operate=t.hasLift=void 0;var n=r(3005);function i(e){return n.isFunction(null==e?void 0:e.lift)}t.hasLift=i,t.operate=function(e){return function(t){if(i(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},1914:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mapOneOrManyArgs=void 0;var o=r(7291),s=Array.isArray;t.mapOneOrManyArgs=function(e){return o.map((function(t){return function(e,t){return s(t)?e.apply(void 0,i([],n(t))):e(t)}(e,t)}))}},2576:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){}},8634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=void 0,t.not=function(e,t){return function(r,n){return!e.call(t,r,n)}}},9985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeFromArray=t.pipe=void 0;var n=r(4781);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},7968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnhandledError=void 0;var n=r(3280),i=r(4590);t.reportUnhandledError=function(e){i.timeoutProvider.setTimeout((function(){var t=n.config.onUnhandledError;if(!t)throw e;t(e)}))}},9906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvalidObservableTypeError=void 0,t.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},4857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0;var n=r(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return n.audit}});var i=r(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return i.auditTime}});var o=r(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return o.buffer}});var s=r(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return s.bufferCount}});var a=r(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var u=r(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return u.bufferToggle}});var c=r(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return c.bufferWhen}});var l=r(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return l.catchError}});var f=r(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return f.combineAll}});var h=r(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return h.combineLatestAll}});var d=r(6318);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return d.combineLatest}});var p=r(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return p.combineLatestWith}});var v=r(4919);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return v.concat}});var m=r(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var g=r(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return g.concatMap}});var y=r(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return y.concatMapTo}});var b=r(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return b.concatWith}});var _=r(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return _.connect}});var w=r(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return w.count}});var S=r(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return S.debounce}});var E=r(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return E.debounceTime}});var T=r(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return T.defaultIfEmpty}});var O=r(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return O.delay}});var C=r(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return C.delayWhen}});var x=r(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return x.dematerialize}});var P=r(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return P.distinct}});var R=r(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return R.distinctUntilChanged}});var M=r(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return M.distinctUntilKeyChanged}});var A=r(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return A.elementAt}});var j=r(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return j.endWith}});var k=r(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return k.every}});var I=r(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return I.exhaust}});var D=r(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return D.exhaustAll}});var N=r(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return N.exhaustMap}});var L=r(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return L.expand}});var F=r(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return F.filter}});var U=r(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return U.finalize}});var B=r(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return B.find}});var W=r(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return W.findIndex}});var V=r(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return V.first}});var q=r(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return q.groupBy}});var z=r(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return z.ignoreElements}});var H=r(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return H.isEmpty}});var G=r(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return G.last}});var $=r(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return $.map}});var Y=r(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return Y.mapTo}});var K=r(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return K.materialize}});var X=r(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return X.max}});var J=r(9821);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return J.merge}});var Z=r(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return Z.mergeAll}});var Q=r(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return Q.flatMap}});var ee=r(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ee.mergeMap}});var te=r(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return te.mergeMapTo}});var re=r(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return re.mergeScan}});var ne=r(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ne.mergeWith}});var ie=r(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ie.min}});var oe=r(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return oe.multicast}});var se=r(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return se.observeOn}});var ae=r(7582);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return ae.onErrorResumeNext}});var ue=r(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ue.pairwise}});var ce=r(5649);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ce.partition}});var le=r(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return le.pluck}});var fe=r(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return fe.publish}});var he=r(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return he.publishBehavior}});var de=r(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return de.publishLast}});var pe=r(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return pe.publishReplay}});var ve=r(9764);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return ve.race}});var me=r(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return me.raceWith}});var ge=r(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return ge.reduce}});var ye=r(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return ye.repeat}});var be=r(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return be.repeatWhen}});var _e=r(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return _e.retry}});var we=r(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return we.retryWhen}});var Se=r(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Se.refCount}});var Ee=r(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Ee.sample}});var Te=r(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Te.sampleTime}});var Oe=r(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Oe.scan}});var Ce=r(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Ce.sequenceEqual}});var xe=r(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return xe.share}});var Pe=r(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Pe.shareReplay}});var Re=r(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Re.single}});var Me=r(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return Me.skip}});var Ae=r(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Ae.skipLast}});var je=r(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return je.skipUntil}});var ke=r(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return ke.skipWhile}});var Ie=r(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Ie.startWith}});var De=r(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return De.subscribeOn}});var Ne=r(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Ne.switchAll}});var Le=r(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Le.switchMap}});var Fe=r(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Fe.switchMapTo}});var Ue=r(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Ue.switchScan}});var Be=r(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Be.take}});var We=r(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return We.takeLast}});var Ve=r(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Ve.takeUntil}});var qe=r(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return qe.takeWhile}});var ze=r(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return ze.tap}});var He=r(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return He.throttle}});var Ge=r(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Ge.throttleTime}});var $e=r(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return $e.throwIfEmpty}});var Ye=r(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Ye.timeInterval}});var Ke=r(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Ke.timeout}});var Xe=r(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Xe.timeoutWith}});var Je=r(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return Je.timestamp}});var Ze=r(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return Ze.toArray}});var Qe=r(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return Qe.window}});var et=r(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return et.windowCount}});var tt=r(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return tt.windowTime}});var rt=r(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return rt.windowToggle}});var nt=r(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return nt.windowWhen}});var it=r(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return it.withLatestFrom}});var ot=r(4400);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return ot.zip}});var st=r(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return st.zipAll}});var at=r(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return at.zipWith}})},9509:(e,t,r)=>{var n=r(8764),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},7539:e=>{"use strict";const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substring(7,t),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substring(t+1,n),r.value=e.substring(n+1)):r.attribute=e.substring(t+1),r},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");r.profile=n[2];for(let i=3;i<n.length;i++){const o=n[i],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){const n=t.parseRtpMap(s),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))}));const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return r.codecs.forEach((e=>{i.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.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",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),a=s.length>0&&s[0].ssrc;let u;const c=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));c.length>0&&c[0].length>1&&c[0][0]===a&&(u=c[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&u&&(t.rtx={ssrc:u}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&a&&r.push({ssrc:a});let l=t.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=l}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substring(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:r.fmt,maxMessageSize:i};const s=t.matchPrefix(e,"a=sctpmap:");if(s.length>0){const e=s[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,r,n){let i;const o=void 0!==r?r:2;return i=e||t.generateSessionId(),"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t},8853:(e,t,r)=>{const n=r(1227)("simple-peer"),i=r(5177),o=r(1798),s=r(8473),a=r(4375),u=r(2114),{Buffer:c}=r(8764),l=65536;function f(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class h extends s.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=o(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||o(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||h.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},h.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.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=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:i(),!this._wrtc)throw"undefined"==typeof window?u(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):u(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(e){return void this.destroy(u(e,"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=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(u(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},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(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(u(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(u(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{!t.address||t.address.endsWith(".local")?("Ignoring unsupported ICE candidate.",console.warn("Ignoring unsupported ICE candidate.")):this.destroy(u(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(u(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const r=this._senderMap.get(e)||new Map;let n=r.get(t);if(n)throw n.removed?u(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):u(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");n=this._pc.addTrack(e,t),r.set(t,n),this._senderMap.set(e,r),this._needsNegotiation()}replaceTrack(e,t,r){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const n=this._senderMap.get(e),i=n?n.get(r):null;if(!i)throw u(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,n),null!=i.replaceTrack?i.replaceTrack(t):this.destroy(u(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const r=this._senderMap.get(e),n=r?r.get(t):null;if(!n)throw u(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{n.removed=!0,this._pc.removeTrack(n)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(n):this.destroy(u(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach((t=>{this.removeTrack(t,e)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,a((()=>{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 u(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(e){this._destroy(e,(()=>{}))}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),a((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),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(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}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,e&&this.emit("error",e),this.emit("close"),t()})))}_setupData(e){if(!e.channel)return this.destroy(u(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=l),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(u(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1}),5e3)}_read(){}_write(e,t,r){if(this.destroyed)return r(u(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(u(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>l?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=r):r(null)}else this._debug("write before connect"),this._chunk=e,this._cb=r}_onFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?e():this.once("connect",e)}_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((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=f(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})};this._pc.setLocalDescription(e).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=f(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(e).then((()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(u(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),"connected"!==e&&"completed"!==e||(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(u(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(u(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach((t=>{Object.assign(e,t)})),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((r=>{const n=[];r.forEach((e=>{n.push(t(e))})),e(null,n)}),(t=>e(t))):this._pc.getStats.length>0?this._pc.getStats((r=>{if(this.destroyed)return;const n=[];r.result().forEach((e=>{const r={};e.names().forEach((t=>{r[t]=e.stat(t)})),r.id=e.id,r.type=e.type,r.timestamp=e.timestamp,n.push(t(r))})),e(null,n)}),(t=>e(t))):e(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 e=()=>{this.destroyed||this.getStats(((t,r)=>{if(this.destroyed)return;t&&(r=[]);const n={},i={},o={};let s=!1;r.forEach((e=>{"remotecandidate"!==e.type&&"remote-candidate"!==e.type||(n[e.id]=e),"localcandidate"!==e.type&&"local-candidate"!==e.type||(i[e.id]=e),"candidatepair"!==e.type&&"candidate-pair"!==e.type||(o[e.id]=e)}));const a=e=>{s=!0;let t=i[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=Number(t.port)):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=Number(t.portNumber)):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=Number(t[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let r=n[e.remoteCandidateId];r&&(r.ip||r.address)?(this.remoteAddress=r.ip||r.address,this.remotePort=Number(r.port)):r&&r.ipAddress?(this.remoteAddress=r.ipAddress,this.remotePort=Number(r.portNumber)):"string"==typeof e.googRemoteAddress&&(r=e.googRemoteAddress.split(":"),this.remoteAddress=r[0],this.remotePort=Number(r[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(r.forEach((e=>{"transport"===e.type&&e.selectedCandidatePairId&&a(o[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&a(e)})),s||Object.keys(o).length&&!Object.keys(i).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(t){return this.destroy(u(t,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(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(e,100)}))};e()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>l||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((e=>{this._pc.removeTrack(e),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(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(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(e){this.destroyed||e.streams.forEach((t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some((e=>e.id===t.id))||(this._remoteStreams.push(t),a((()=>{this._debug("on stream"),this.emit("stream",t)})))}))}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],n.apply(null,e)}}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={},e.exports=h},2553:(e,t,r)=>{"use strict";var n=r(9509).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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 o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3607:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(8806);const a=o(r(835)),u=r(6123);s(r(8512),t);var c=r(6123);Object.defineProperty(t,"Uneeq",{enumerable:!0,get:function(){return c.Uneeq}}),s(r(835),t),window.AdapterJS=a,window.Uneeq=u.Uneeq},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SoundMeter=void 0;const n=r(2872),i=r(7501);t.SoundMeter=class{constructor(e){this.instant$=new n.BehaviorSubject(0),this.context=e,this.instant=0,this.slow=0,this.clip=0,this.script=e.createScriptProcessor(2048,1,1);const t=this;this.script.onaudioprocess=e=>{const r=e.inputBuffer.getChannelData(0);let n,i=0,o=0;for(n=0;n<r.length;++n)i+=r[n]*r[n],Math.abs(r[n])>.99&&(o+=1);t.instant=Math.sqrt(i/r.length),t.slow=.95*t.slow+.05*t.instant,t.clip=o/r.length,t.instant$.next(parseFloat(t.instant.toFixed(2)))}}connectToSource(e,t){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==t&&t(null)}catch(e){console.error(e),void 0!==t&&t(e)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},4518:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoEditor=void 0;const s=o(r(6551));t.VideoEditor=class{constructor(){}applyChromaKeyEffect(e,t){try{r(6303);const n=s.default();let i,o,a;i=n.transform("reformat"),i.source=t,i.width=e.width,i.height=e.height,a=n.target(e),o=n.effect("chroma"),o.source=i,a.source=o,n.go()}catch(e){console.error(e)}}}},1181:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.API=void 0,t.API=class{constructor(e,t="",r=(()=>{})){this.xAuthToken="",this.apiUrl=e,this.apiKey=t,this.loggedOutHandler=r}set callId(e){this._callId=e}get authToken(){return this.xAuthToken}startSession(e){return this.postRequest("/api/v1/customers/",e,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",e)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:e})}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(e){return this.postRequest("/api/v2/clients/start-session",e,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(e){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:e})}sendMediaUnavailable(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",e)}getEdgeNodeId(e){let t=e.replace("turn:","http://");t=t.replace("turns:","https://");const r=new Request(t,{method:"GET"});return this.makeRequest(r)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(e){return r(this,void 0,void 0,(function*(){const t=yield fetch(e);if(!t.ok){401===t.status&&this.loggedOutHandler();const e=yield t.json();throw{status:t.status,body:e}}return 204===t.status?new Promise(((e,t)=>{e()})):(this.xAuthToken=t.headers.get("x-auth-token")||this.xAuthToken,yield t.json())}))}getRequest(e){const t=new Request(this.apiUrl+e,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(t)}postRequest(e,t={},r={},n={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},n),body:JSON.stringify(t)},o=new Request(this.apiUrl+e,Object.assign(i,r));return this.makeRequest(o)}putRequest(e,t={},r={}){const n={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(t)},i=new Request(this.apiUrl+e,Object.assign(n,r));return this.makeRequest(i)}}},2958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasService=void 0,t.CanvasService=class{constructor(e){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=e}createCanvas(){const e=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(e),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.height=this.canvasHeight,e.width=this.canvasWidth,e}}},1546:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceManager=void 0;const i=r(3607),o=r(1929);t.DeviceManager=class{constructor(e,t){this.options=e,this.api=t,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new o.MediaHandler(this.options,(()=>this.remoteVideoReady())),this.initMediaConstraints(),this.getDevices(!1)}set edgeNodeId(e){this.mediaHandler.setEdgeNodeId(e),this.getDevices(!0)}enableLocalDevices(e,t){const r=this.options.uneeqOptions.sendLocalVideo!==e,n=this.options.uneeqOptions.sendLocalAudio!==t;(r||n)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=e,this.options.uneeqOptions.sendLocalAudio=t,r&&!1===e&&this.publishStream.getVideoTracks().forEach((e=>e.stop())),n&&!1===t&&this.publishStream.getAudioTracks().forEach((e=>e.stop())),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(e=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const t=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then((t=>n(this,void 0,void 0,(function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),e){if(this.options.uneeqOptions.sendLocalVideo){const e=t.getVideoTracks();e.length>0&&(this.publishStream.getVideoTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}if(this.options.uneeqOptions.sendLocalAudio){const e=t.getAudioTracks();e.length>0&&(this.publishStream.getAudioTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}this.mediaHandler.localStream$.next(this.publishStream)}})))).catch((e=>{t.options.userMessages.next(new i.DeviceErrorMessage(e)),console.error("device error: ",e),this.sendMediaUnavailableInfo("NotAllowedError"===e.name),this.revertMediaOptions()}))}setMicDevice(e,t=!0){const r=this.devices.audioInput.filter((t=>t.deviceId===e));if(r&&r.length>0)this.options.uneeqOptions.preferredMicrophoneId=e,this.audioConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(e));else{const t="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setCamDevice(e,t=!0){const r=this.devices.videoInput.filter((t=>t.deviceId===e));if(r&&r.length>0)this.options.uneeqOptions.preferredCameraId=e,this.videoConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(e));else{const t="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setAvatarSpeakerDevice(e){if(this.mediaHandler.avatarVideoElement){const t=this.devices.audioOutput.filter((t=>t.deviceId===e));if(t&&t.length>0)this.options.uneeqOptions.preferredSpeakerId=e,this.mediaHandler.avatarVideoElement.setSinkId(e).then((()=>{this.speakerConstraints.deviceId=e,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(e))})).catch((t=>{const r="Uneeq setSpeaker: Error setting device. "+t.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(r,e))}));else{const t="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}}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((e=>this.publishStream.removeTrack(e))),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(e){return n(this,void 0,void 0,(function*(){const t=yield this.getMediaDevices(),r={audioInputs:t.audioInput.length,videoInputs:t.videoInput.length,hasUserDeniedPermission:e};return this.api.sendMediaUnavailable(r)}))}getMediaDevices(){return n(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t={audioInput:[],audioOutput:[],videoInput:[]};return t.audioInput=e.filter((e=>"audioinput"===e.kind)),t.audioOutput=e.filter((e=>"audiooutput"===e.kind)),t.videoInput=e.filter((e=>"videoinput"===e.kind)),t}))}initDeviceList(){return n(this,void 0,void 0,(function*(){navigator.mediaDevices.ondevicechange=e=>{this.initDeviceList()};const e=yield this.getMediaDevices();JSON.stringify(e)!==JSON.stringify(this.devices)&&(this.devices=e,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)))}))}}},6886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanVideoPlayManager=void 0;const n=r(8512),i=r(7501);t.DigitalHumanVideoPlayManager=class{constructor(e,t){this.messages=e,this.publicUnmuteDigitalHumanMethod=t,this.remoteVideoPlayCount=0}play(e){this.video=e,this.playRemoteVideo()}unmuteVideo(){this.video&&this.video.muted&&(this.video.muted=!1,this.messages.next(new n.DigitalHumanUnmuted))}playRemoteVideo(){this.video&&(this.video.onerror=e=>{this.messages.next(new n.DigitalHumanVideoError(e))},this.video.play().then((()=>{this.messages.next(new n.DigitalHumanUnmuted)})).catch((()=>{this.digitalHumanFailedToPlayUnmuted()})))}digitalHumanFailedToPlayUnmuted(){this.messages.next(new n.DigitalHumanFailedToPlay),this.video.muted=!0,this.video.play().then((()=>{i.logger.log("Muting the digital human and playing it succeeded."),this.messages.next(new n.DigitalHumanPlayedInMutedModeSuccess),this.video.addEventListener("click",(()=>{this.publicUnmuteDigitalHumanMethod()}),{once:!0})})).catch((e=>{i.logger.log("Could not play digital human video even as muted, starting exponential backoff.",e),this.playRemoteVideoWithExponentialBackoff()}))}playRemoteVideoWithExponentialBackoff(){this.video&&(this.video.autoplay=!0,this.video.play().then((()=>{this.messages.next(new n.DigitalHumanUnmuted)})),this.remoteVideoPlayCount++,setTimeout((()=>{this.remoteVideoPlayCount<10&&this.playRemoteVideoWithExponentialBackoff()}),100*(this.remoteVideoPlayCount-1)))}}},7789:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocaleDetector=void 0;class r{static validateOrDetectSpeechLocales(e){let t=e.speechToTextLocales;t&&t.length>0&&(t.split(":").forEach((e=>{this.sttSupportedLocales[e]||(console.error(`UneeQ: Speech to text not supported for: ${e}. Defaulting to en-US`),t=this.defaultLocale)})),"undefined"!==t&&"null"!==t||(t=this.defaultLocale));const r=(window.navigator.languages||[window.navigator.language]).map((e=>((e.length<5||"zh-CN"===e)&&(e=this.localeMappings[e]||null),e&&!this.sttSupportedLocales[e]&&(console.warn(`UneeQ: Speech to text not supported for one of the detected languages: ${e}. Replacing with en-US.`),e=this.defaultLocale),e))).slice(0,4).filter(n).filter(((e,t,r)=>r.indexOf(e)===t));let i=r.join(":").replace(/:\s*$/,"");return i&&0!==i.length||(i=this.defaultLocale),t&&t.length>0?console.debug(`UneeQ: Configured speech to text languages: ${t}`):console.warn(`UneeQ: Detected speechToText languages from browser: ${i}`),t||i}}function n(e){return null!=e}t.LocaleDetector=r,r.defaultLocale="en-US",r.localeMappings={en:"en-US",es:"es-ES",fr:"fr-FR",ja:"ja-JP",de:"de-DE",ko:"ko-KR",zh:"cmn-Hans-CN",it:"it-IT",pt:"pt-PT",nl:"nl-NL",sv:"sv-SE",da:"da-DK",no:"no-NO",fi:"fi-FI",ru:"ru-RU",pl:"pl-PL",tr:"tr-TR",ar:"ar-SA",th:"th-TH",id:"id-ID",cs:"cs-CZ",hu:"hu-HU",ro:"ro-RO",he:"he-IL",vi:"vi-VN",uk:"uk-UA",hi:"hi-IN","zh-CN":"cmn-Hans-CN"},r.sttSupportedLocales={"af-ZA":!0,"sq-AL":!0,"am-ET":!0,"ar-DZ":!0,"ar-BH":!0,"ar-EG":!0,"ar-IQ":!0,"ar-IL":!0,"ar-JO":!0,"ar-KW":!0,"ar-LB":!0,"ar-MR":!0,"ar-MA":!0,"ar-OM":!0,"ar-QA":!0,"ar-SA":!0,"ar-PS":!0,"ar-TN":!0,"ar-AE":!0,"ar-YE":!0,"hy-AM":!0,"az-AZ":!0,"eu-ES":!0,"bn-BD":!0,"bn-IN":!0,"bs-BA":!0,"bg-BG":!0,"my-MM":!0,"ca-ES":!0,"yue-Hant-HK":!0,"cmn-Hans-CN":!0,"cmn-Hant-TW":!0,"hr-HR":!0,"cs-CZ":!0,"da-DK":!0,"nl-BE":!0,"nl-NL":!0,"en-AU":!0,"en-CA":!0,"en-GH":!0,"en-HK":!0,"en-IN":!0,"en-IE":!0,"en-KE":!0,"en-NZ":!0,"en-NG":!0,"en-PK":!0,"en-PH":!0,"en-SG":!0,"en-ZA":!0,"en-TZ":!0,"en-GB":!0,"en-US":!0,"et-EE":!0,"fil-PH":!0,"fi-FI":!0,"fr-BE":!0,"fr-CA":!0,"fr-FR":!0,"fr-CH":!0,"gl-ES":!0,"ka-GE":!0,"de-AT":!0,"de-DE":!0,"de-CH":!0,"el-GR":!0,"gu-IN":!0,"iw-IL":!0,"hi-IN":!0,"hu-HU":!0,"is-IS":!0,"id-ID":!0,"it-IT":!0,"it-CH":!0,"ja-JP":!0,"jv-ID":!0,"kn-IN":!0,"kk-KZ":!0,"km-KH":!0,"ko-KR":!0,"lo-LA":!0,"lv-LV":!0,"lt-LT":!0,"mk-MK":!0,"ms-MY":!0,"ml-IN":!0,"mr-IN":!0,"mn-MN":!0,"ne-NP":!0,"no-NO":!0,"fa-IR":!0,"pl-PL":!0,"pt-BR":!0,"pt-PT":!0,"pa-Guru-IN":!0,"ro-RO":!0,"ru-RU":!0,"rw-RW":!0,"sr-RS":!0,"si-LK":!0,"sk-SK":!0,"sl-SI":!0,"ss-latn-za":!0,"st-ZA":!0,"es-AR":!0,"es-BO":!0,"es-CL":!0,"es-CO":!0,"es-CR":!0,"es-DO":!0,"es-EC":!0,"es-SV":!0,"es-GT":!0,"es-HN":!0,"es-MX":!0,"es-NI":!0,"es-PA":!0,"es-PY":!0,"es-PE":!0,"es-PR":!0,"es-ES":!0,"es-US":!0,"es-UY":!0,"es-VE":!0,"su-ID":!0,"sw-KE":!0,"sw-TZ":!0,"sv-SE":!0,"ta-IN":!0,"ta-MY":!0,"ta-SG":!0,"ta-LK":!0,"te-IN":!0,"th-TH":!0,"tn-latn-za":!0,"tr-TR":!0,"ts-ZA":!0,"uk-UA":!0,"ur-IN":!0,"ur-PK":!0,"uz-UZ":!0,"ve-ZA":!0,"vi-VN":!0,"xh-ZA":!0,"zu-ZA":!0}},7501:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.Logger=t.LogType=void 0,function(e){e.debug="debug",e.log="log",e.warn="warn",e.error="error"}(r=t.LogType||(t.LogType={}));class n{constructor(){this.enabled=!1}log(e,...t){this.emitLogMessage(r.log,e,t)}warn(e,...t){this.emitLogMessage(r.warn,e,t)}error(e,...t){this.emitLogMessage(r.error,e,t)}debug(e,...t){this.emitLogMessage(r.debug,e,t)}emitLogMessage(e,t,n){(this.enabled||e===r.error)&&(n.length>0?console[e](t,n):console[e](t))}}t.Logger=n,t.logger=new n},1929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaHandler=void 0;const n=r(2872),i=r(4857),o=r(3607),s=r(4518),a=r(7563),u=r(2958),c=r(7501),l=r(8477);t.MediaHandler=class{constructor(e,t){this.options=e,this.remoteVideoReady=t,this.remoteStream$=new n.BehaviorSubject(null),this.localStream$=new n.BehaviorSubject(null),this.publishState$=new n.BehaviorSubject(a.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.remoteStream$.pipe(i.filter((e=>null!==e))).subscribe((r=>{this.avatarVideoElement=this.options.digitalHumanVideoElement,this.avatarVideoElement.srcObject=r,e.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",e.uneeqOptions.avatarVideoContainerElement.innerHTML="",e.uneeqOptions.avatarVideoContainerElement.appendChild(this.avatarVideoElement),this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(this.avatarVideoElement),t()})),this.localStream$.pipe(i.filter((e=>null!==e))).subscribe((t=>{const r=document.createElement("video");this.localVideoElement=r,r.srcObject=t,r.autoplay=!0,r.muted=!0,r.setAttribute("playsinline","true"),r.setAttribute("style","width: 100%; height: 100%;"),e.uneeqOptions.localVideoContainerElement.innerHTML="",e.uneeqOptions.localVideoContainerElement.appendChild(r),this.options.voiceInputManager&&this.options.voiceInputManager.initMicActivity(t),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()})),this.options.internalMessages$.pipe(i.filter((e=>"AnswerMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(e)})),this.options.internalMessages$.pipe(i.filter((e=>"IceCandidateMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(e)}))}setEdgeNodeId(e){this.options.session.edgeNodeId=e,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){c.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(a.PublishSubscribeState.DISCONNECTED)}pause(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),t&&t.getTracks().forEach((e=>e.enabled=!1)),e&&e.getTracks().forEach((e=>e.enabled=!1))}resume(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();t&&t.getTracks().forEach((e=>e.enabled=!0)),e&&e.getTracks().forEach((e=>e.enabled=!0)),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const e=this.localStream$.getValue();e&&e.getTracks().forEach((e=>e.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 e=this.remoteStream$.getValue();e&&e.getTracks().forEach((e=>e.stop())),this.options.voiceInputManager&&this.options.voiceInputManager.handleSessionEnd()}sendDataMessage(e){this.webRTC&&this.webRTC.sendDataMessage(e)}gatherWebRTCStats(e){var t;null===(t=this.webRTC)||void 0===t||t.getStats(e)}publishVideo(){const e=this.options.session.streamId,t=this.options.session.avatarStreamId,r=this.options.session.turnServerAddresses,n=this.options.session.turnUsername,i=this.options.session.turnPassword,s=this.options.session.forceTurnServerUse,u=this.publishState$,f=this.remoteStream$,h=this.localStream$.getValue();if(!h||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let d=0;c.logger.log("UserSession | publishVideo - stream:",h,"publishStreamName:",e),c.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new l.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:e,subscribeStreamName:t,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:e=>{c.logger.log("WEBRTC: onAddStream "+e.stream),f.next(e.stream)},forceTurnServerUse:s,iceServers:[{urls:r,username:n,credential:i}],onConnect:()=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected"),u.getValue()===a.PublishSubscribeState.CONNECTING&&u.next(a.PublishSubscribeState.CONNECTED)},onError:e=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",d),d<3?(d++,this.performWebRTCConnection(h),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.DISCONNECTED))):(c.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),u.next(a.PublishSubscribeState.FAILED),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(h)):this.webRTC.updateStreamTracks(h)}performWebRTCConnection(e){this.webRTC&&(this.publishState$.next(a.PublishSubscribeState.CONNECTING),this.webRTC.connect(e))}initTransparentBackground(e){const t=new u.CanvasService(this.options.uneeqOptions).createCanvas();(new s.VideoEditor).applyChromaKeyEffect(t,e),this.avatarVideoElement.style.display="none"}}},4887:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;const n=r(4857),i=r(3607),o=r(4050);t.MessageHandler=class{constructor(e,t){this.internalMessages$=e,this.messages=t,this.deviceManager={getDevices:(e,t)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe((e=>{const t={type:o.PromMessageType.QuestionMessageReceived,value:{id:e.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarQuestionMessage(e.question,e.id))})),this.getMessagesOfType("AvatarAnswerText").subscribe((e=>{const t={type:o.PromMessageType.AnswerMessageReceived,value:{id:e.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarAnswerMessage(e.answer,e.answerAvatar,e.answerSpeech,e.questionId))})),this.getMessagesOfType("AvatarAnswerHTML").subscribe((e=>{this.messages.next(new i.AvatarAnswerContentMessage(e.html,e.messageId,e.hasDisplayHtml)),this.messages.next(new i.InstructionsMessage(e.instructions))})),this.getMessagesOfType("AvatarTextInputStarted").subscribe((e=>this.messages.next(new i.StartedSpeakingMessage))),this.getMessagesOfType("AvatarTextInputFinished").subscribe((e=>{this.messages.next(new i.FinishedSpeakingMessage),this.messages.next(new i.AvatarTextInputFinishedMessage)})),this.getMessagesOfType("AvatarStarting").subscribe((e=>{this.deviceManager.edgeNodeId=e.edgeNodeId})),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe((e=>{this.messages.next(new i.ClientMediaStreamUpdateMessage(e.clientStreamingAudio,e.clientStreamingVideo,e.serverStreamingAudio,e.serverStreamingVideo)),e.clientStreamingAudio&&e.clientStreamingVideo&&e.serverStreamingAudio&&e.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))})),this.getMessagesOfType("SessionErrorMessage").subscribe((e=>{console.error(e.error),this.messages.next(new i.SessionErrorMessage(e.error))})),this.getMessagesOfType("SessionInfoMessage").subscribe((e=>{this.messages.next(new i.SessionInfoMessage(e.info))})),this.getMessagesOfType("SessionEndedMessage").subscribe((()=>{const e={type:o.PromMessageType.SessionEnded,value:{receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.internalMessages$.next({faceMeMessageType:"sessionEnd"})})),this.getMessagesOfType("AvatarRequestCompleted").subscribe((e=>{this.messages.next(new i.AvatarRequestCompleted(e.reason))})),this.getMessagesOfType("AvatarRequestIgnored").subscribe((e=>{this.messages.next(new i.AvatarRequestIgnored(e.reason))}))}setDeviceManager(e){this.deviceManager=e}getMessagesOfType(e){return this.internalMessages$.pipe(n.filter((t=>t.faceMeMessageType===e)))}}},8957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=t.MessagingService=void 0;const n=r(8637);Object.defineProperty(t,"MessagingService",{enumerable:!0,get:function(){return n.MessagingService}});const i=r(7229);Object.defineProperty(t,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},8637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingService=void 0;const n=r(2541),i=r(2872),o=r(7501),s=r(7229);t.MessagingService=class{constructor(e,t){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=e,this.options=Object.assign(this.options,t),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(s.MessagingState.DISCONNECTED),this.messages$=new i.Subject,console.log("connect headers messaging: ",this.options.connectionHeaders);const r={connectHeaders:this.options.connectionHeaders,reconnectDelay:0,connectionTimeout:5e3,discardWebsocketOnCommFailure:!0,brokerURL:this.url.replace("https://","wss://").replace("http://","ws://")};this.stompClient=new n.Client(r),this.stompClient.onConnect=e=>this.onStompConnected(e),this.stompClient.onDisconnect=e=>{o.logger.log("Stomp client disconnected",e)},this.stompClient.onStompError=e=>{o.logger.log("Stomp client error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketError=e=>{o.logger.log("Stomp client web socket error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketClose=e=>{o.logger.log("Stomp client web socket closed",e),this.onStompClientConnectionClosed(e)}}connect(){this.disconnect(),o.logger.log("MessagingService | connecting..."),this.state$.next(s.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const e=this.state$.getValue();if(e===s.MessagingState.CONNECTED||e===s.MessagingState.CONNECTING){o.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.options.autoReconnect=!1,this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(s.MessagingState.DISCONNECTED)}catch(e){console.error("MessagingService | disconnect: error",e),this.state$.next(s.MessagingState.DISCONNECTED)}}}send(e,t){o.logger.log("MessagingService | send:",e,t);const r={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},n=JSON.stringify(t);this.stompClient.publish({destination:e,body:n,headers:r})}getTopic(e){o.logger.log("MessagingService | subscribeToTopic: "+e);const t=this.subscriptions[e];if(t)return o.logger.log("existing subscription... not re-subscribing to topic"),t;const r=new i.Subject;return this.stompClient.subscribe(e,(e=>{r.next(e),this.messages$.next(e)})),this.subscriptions[e]=r,r}onStompConnected(e){o.logger.log("MessagingService | connected"),this.state$.next(s.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(e){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("/",(e=>{this.messages$.next(e)}))}}},7229:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=void 0,(r=t.MessagingState||(t.MessagingState={}))[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"},2694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsService=void 0;const n=r(3607),i=r(9824),o=r(4050);t.MetricsService=class{constructor(e,t,r){this.uneeqOptions=e,this.internalMessages=t,this.messages=r,this.clientPerformanceStats={},this.options=e,this.internalMessages$=t,this.messages$=r}parseAndLogWebRtcStats(e){try{e.forEach((e=>{var t,r;if("inbound-rtp"===e.type&&"video"===e.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",e.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",e.frameWidth);const n=e.framesDropped,o=n?n-(null===(t=this.clientPerformanceStats.totalFramesDropped)||void 0===t?void 0:t.value):0;this.clientPerformanceStats.newFramesDropped=o?new i.ClientPerformanceStat("New Frames Dropped",o):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=n?new i.ClientPerformanceStat("Total Frames Dropped",n):new i.ClientPerformanceStat;const s=e.packetsLost,a=s?s-(null===(r=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===r?void 0:r.value):0;this.clientPerformanceStats.inboundNewPacketsLost=a?new i.ClientPerformanceStat("New packets lost",a):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=s?new i.ClientPerformanceStat("Total packets lost",s):new i.ClientPerformanceStat;const u=e.framesPerSecond;this.clientPerformanceStats.framesPerSec=u?new i.ClientPerformanceStat("Frames per second",u):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===e.type&&"video"===e.kind){const t=e.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=t?new i.ClientPerformanceStat("Round Trip Time",t):new i.ClientPerformanceStat}else if("outbound-rtp"===e.type&&"video"===e.kind){const t=e.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",t)}})),this.options.enableClientPerformanceMessage&&this.messages$.next(new n.ClientPerformanceMessage(this.clientPerformanceStats));const t={type:o.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t})}catch(e){console.warn("Unable to parseAndLogWebRTCStats",e)}}}},6400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnlineStatusService=void 0;const n=r(3607);t.OnlineStatusService=class{constructor(e,t){this.messages=e,this.offlineTimeoutLimitHandler=t,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 n.OnlineStatusUpdateMessage(this.online))}}},4050:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Prom=t.PromMessageType=void 0;const i=n(r(4427));var o;!function(e){e[e.SessionStart=0]="SessionStart",e[e.WebRtcPerformance=1]="WebRtcPerformance",e[e.AvailabilityCheck=2]="AvailabilityCheck",e[e.QuestionMessageReceived=3]="QuestionMessageReceived",e[e.AnswerMessageReceived=4]="AnswerMessageReceived",e[e.SessionEnded=5]="SessionEnded"}(o=t.PromMessageType||(t.PromMessageType={})),t.Prom=class{constructor(e){this.apiUrl=e,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(e){var t,r,n,i,s,a,u;const c=Object.assign(e.labels||{},{platform:"js"});switch(e.type){case o.SessionStart:this.sessionStartTime.observe(e.value,c);break;case o.QuestionMessageReceived:this.messageTimings.push(e.value);break;case o.AnswerMessageReceived:const l=this.calculateConversationRtt(e);l>0&&this.conversationRoundTripTime.observe(l,c);break;case o.WebRtcPerformance:const f=e.value;f.outboundQualityLimitationReason?c.qualityLimitationReason=null===(t=f.outboundQualityLimitationReason)||void 0===t?void 0:t.value:c.qualityLimitationReason="unknown",f.newFramesDropped&&this.webRtcFramesDropped.observe(null===(r=f.newFramesDropped)||void 0===r?void 0:r.value,c),f.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(n=f.framesPerSec)||void 0===n?void 0:n.value,c),f.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=f.inboundNewPacketsLost)||void 0===i?void 0:i.value,c),f.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(s=f.inboundRoundTripTime)||void 0===s?void 0:s.value,c),f.frameHeight&&this.webRtcFrameHeight.observe(null===(a=f.frameHeight)||void 0===a?void 0:a.value,c),f.frameWidth&&this.webRtcFrameWidth.observe(null===(u=f.frameWidth)||void 0===u?void 0:u.value,c);break;case o.AvailabilityCheck:this.availabilityCheckTime.observe(e.value,c);break;case o.SessionEnded:this.stopSendingMetrics()}}calculateConversationRtt(e){if(e.value&&this.messageTimings){const t=this.messageTimings.find((t=>t.id===e.value.id));if(t){const r=t.receivedOn;if(r){const n=(e.value.receivedOn-r)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(t),1),n}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const e=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(e),this.registry.reset()}stopSendingMetrics(){this.metricsIntervalId&&clearInterval(this.metricsIntervalId)}}},8591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResumeSessionCheck=void 0;const n=r(7501),i=r(39);class o{static validate(e){const t=new i.UneeqLocalStorage;let r=void 0!==e.resumeSession&&e.resumeSession;t.getItemSafely("uneeqResumeSessionPersonaId")===e.conversationId||(n.logger.log("UneeQ: Persona Id's do not match, unable to resume session."),r=!1);const s=o.browserTabIsActive();if(r&&!s&&(n.logger.log("UneeQ: Browser tab is not active so unable to resume"),r=!1),r){const e=t.getItemSafely("uneeqResumeSessionId");if(null!==e)return{resumeSession:!0,resumeSessionId:e}}return{resumeSession:!1}}static browserTabIsActive(){return!document.hidden}}t.ResumeSessionCheck=o},1116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamManager=void 0,t.StreamManager=class{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(e){return e.getVideoTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.canvasVideoTrack),e}addSilentAudioTrackToStream(e){return e.getAudioTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.silentAudioTrack),e}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){const e=document.createElement("canvas");return e.width=40,e.height=30,e.getContext("2d"),e.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){const e=new window.AudioContext;this.audioContextInstance=e,this.audioSourceDestination=e.createMediaStreamDestination()}return this.audioSourceDestination.stream.getAudioTracks()[0]}}},39:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqLocalStorage=void 0;const n=r(7501);t.UneeqLocalStorage=class{constructor(){}get available(){return void 0===this.localStorageAvailable&&(this.localStorageAvailable=this.checkIfLocalStorageAvailable()),this.localStorageAvailable}setItemSafely(e,t){this.available?localStorage.setItem(e,t):n.logger.log("UneeQ: unable to access localStorage because it is not available.")}getItemSafely(e){return this.available?localStorage.getItem(e):void n.logger.log("UneeQ: unable to access localStorage because it is not available.")}removeItemSafely(e){this.available?localStorage.removeItem(e):n.logger.log("UneeQ: unable to access localStorage because it is not available.")}checkIfLocalStorageAvailable(){const e="UneeqLocalStoreCheck";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}}},8477:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqWebRTC=void 0;const i=n(r(8853)),o=n(r(835)),s=r(3607),a=r(7501);t.UneeqWebRTC=class{constructor(e){this.fakeDataChannel={},this.MESSAGING_ENDPOINT="/app/v2/webRTC",this.onStats=(e,t)=>{this.options.userMessages.next(new s.WebRtcStatsMessage(t)),this.statTimer=window.setTimeout((()=>{this.client.getStats(this.onStats)}),2e3)},this.options=Object.assign({forceTurnServerUse:!1,iceServers:[]},e),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(e){this.close(),this.client=new i.default({initiator:!0,config:{iceServers:this.options.iceServers},stream:e,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",(e=>{this.log("error",e),void 0!==this.options.onError&&this.options.onError(e)})),this.client.on("signal",(e=>{const t={payload:"",publishStreamName:this.options.publishStreamName,subscribeStreamName:this.options.subscribeStreamName,uniqueId:this.uniqueId,userAgent:navigator.userAgent,edgeNodeId:this.options.edgeNodeId};if("type"in e&&"offer"===e.type)t.payload=JSON.stringify({type:"offer",sdp:e.sdp}),t.type="OfferMessage",this.log("Offer payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t);else if("candidate"in e){const r=JSON.stringify(e.candidate);this.options.forceTurnServerUse&&!r.match(/typ relay/)||r.match(/::/)||(t.payload=r,t.type="IceCandidate",this.log("IC payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t))}else this.warn("WARNING Unhandled signal: ",JSON.stringify(e))})),this.client.on("connect",(()=>{this.log("CONNECT"),void 0!==this.options.onConnect&&this.options.onConnect()})),this.client.on("data",(e=>{this.log("data: "+e),void 0!==this.options.onData&&this.options.onData(e),this.options.userMessages.next(new s.WebRtcDataMessage(e))})),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",(e=>{void 0!==this.options.onAddStream&&this.options.onAddStream({stream:e})}))}close(){this.client&&(this.client.destroy(),this.client=null),this.statTimer&&clearTimeout(this.statTimer)}handleAnswerMessage(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);return this.log("got answer: ",t),this.client.signal(t),!0}return this.log("ignoring answer: ",e),!1}handleIceCandidate(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);if("candidate"in t&&""===t.candidate){if("edge"===o.default.browserDetails.browser){const e=this.client._pc;e.remoteDescription&&e.remoteDescription.type&&e.addIceCandidate(null)}}else this.client.signal({candidate:t});return!0}return!1}sendDataMessage(e){this.client.send(e)}getStats(e){return this.client&&this.client.getStats(e)}updateStreamTracks(e){e.getTracks().forEach((e=>{this.client._pc.getSenders().find((t=>e.kind===t.track.kind)).replaceTrack(e).then((()=>{a.logger.log("Updated publish media stream track for "+e.kind)})).catch((t=>{a.logger.error("Error: updating publish media stream track failed for "+e.kind,t)}))}))}enableDiagnostics(){this.client._pc&&0!==this.client._pc.getStats.length&&(this.client._pc.getStats=""),this.client.getStats(this.onStats)}isMessageForUs(e){return e.requestUniqueId===this.uniqueId}log(e,...t){a.logger.log("UneeqWebRTC: "+e,t)}warn(e,...t){a.logger.warn("UneeqWebRTC: "+e,t)}}},4333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputManager=void 0;const n=r(4857),i=r(881),o=r(8512),s=r(608),a=r(7501);t.VoiceInputManager=class{constructor(e,t,r,n){this.options=e,this.api=t,this.messages=r,this.enableMicrophone=n,this.microphoneEngageVolume=.02,this.microphoneDisengageVolume=.02,this.voiceActivityNotSpeakingTimeoutMS=1e3,this.voiceActivityAllowInterruptions=!1,this.digitalHumanSpeaking=!1,this.recording=!1,this.setVoiceInputMode(e.voiceInputMode);try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(e){this.audioContextNotSupported()}this.handleAppMessages()}setVoiceInputMode(e){e===s.VoiceInputMode.PUSH_TO_TALK?this.options.voiceInputMode=s.VoiceInputMode.PUSH_TO_TALK:e===s.VoiceInputMode.VOICE_ACTIVITY?this.options.voiceInputMode=s.VoiceInputMode.VOICE_ACTIVITY:this.messages.next(new o.WarningMessage("Invalid voice input mode selected: "+e))}startRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStartRecording():this.requestNotSupportedInVoiceActivityMode("startRecording")}stopRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStopRecording():this.requestNotSupportedInVoiceActivityMode("stopRecording")}handleSessionEnd(){this.soundMeter&&this.soundMeter.stop()}resumeAudioContext(){a.logger.log("UneeQ: resuming publish stream audio context and initializing mic activity."),this.audioContext&&(this.audioContext.resume(),this.stream&&this.initMicActivity(this.stream))}initMicActivity(e){this.stream=e,this.soundMeter=new i.SoundMeter(this.audioContext),this.soundMeter.connectToSource(e,(e=>this.micActivityConnected(e)))}audioContextNotSupported(){this.options.micActivityMessages&&this.messages.next(new o.MicActivityNotSupportedMessage),this.messages.next(new o.VoiceActivityInputModeNotSupportedMessage),this.setVoiceInputMode(s.VoiceInputMode.PUSH_TO_TALK)}handleAppMessages(){this.messages.subscribe((e=>{switch(e.uneeqMessageType){case o.UneeqMessageType.StartedSpeaking:console.log("StartSpeaking message"),this.digitalHumanSpeaking=!0;break;case o.UneeqMessageType.FinishedSpeaking:this.digitalHumanSpeaking=!1}}))}requestNotSupportedInVoiceActivityMode(e){this.messages.next(new o.WarningMessage("Request not supported in voice activity mode: "+e))}apiStartRecording(){this.recording=!0,this.messages.next(new o.RecordingStartedMessage),this.api.avatarStartRecording().catch((()=>{this.recording=!1,this.messages.next(new o.RecordingStoppedMessage)}))}apiStopRecording(){this.recording=!1,this.api.avatarStopRecording().finally((()=>this.messages.next(new o.RecordingStoppedMessage)))}micActivityConnected(e){e?this.messages.next(new o.MicActivityErrorMessage(e)):this.soundMeter&&this.soundMeter.instant$.pipe(n.distinctUntilChanged()).subscribe((e=>{this.handleVoiceActivity(e)}))}handleVoiceActivity(e){this.options.micActivityMessages&&this.messages.next(new o.MicActivityMessage(e)),this.options.voiceInputMode!==s.VoiceInputMode.VOICE_ACTIVITY||this.digitalHumanSpeaking&&!this.voiceActivityAllowInterruptions||(e>this.microphoneEngageVolume?(this.recording||this.apiStartRecording(),this.clearSilenceTimeout()):e<this.microphoneDisengageVolume&&this.recording&&(this.clearSilenceTimeout(),this.silenceTimeout=setTimeout((()=>{this.recording&&this.apiStopRecording()}),this.voiceActivityNotSpeakingTimeoutMS)))}clearSilenceTimeout(){this.silenceTimeout&&clearTimeout(this.silenceTimeout)}}},9824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientPerformanceStat=void 0,t.ClientPerformanceStat=class{constructor(e="",t=0){this.label=e,this.value=t}}},8512:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanUnmuted=t.DigitalHumanPlayedInMutedModeSuccess=t.DigitalHumanFailedToPlay=t.DigitalHumanVideoError=t.ClientPerformanceMessage=t.ClientMediaStreamUpdateMessage=t.OnlineStatusUpdateMessage=t.SessionInfoMessage=t.AvatarRequestIgnored=t.AvatarRequestCompleted=t.SessionErrorMessage=t.WebRtcStatsMessage=t.WebRtcDataMessage=t.SessionLiveMessage=t.WarningMessage=t.RecordingStoppedMessage=t.RecordingStartedMessage=t.DevicePermissionAllowedMessage=t.AvatarTextInputFinishedMessage=t.FinishedSpeakingMessage=t.StartedSpeakingMessage=t.AvatarQuestionMessage=t.InstructionsMessage=t.AvatarAnswerContentMessage=t.AvatarAnswerMessage=t.ResumeSessionUnavailable=t.ConnectionLostMessage=t.VoiceActivityInputModeNotSupportedMessage=t.MicActivityNotSupportedMessage=t.MicActivityMessage=t.MicActivityErrorMessage=t.ServiceUnavailableMessage=t.AvatarUnavailableMessage=t.AvatarAvailableMessage=t.SessionEndedMessage=t.SessionResumedMessage=t.SessionPausedMessage=t.DeviceListUpdatedMessage=t.DeviceErrorMessage=t.SetSpeakerSuccessMessage=t.SetMicSuccessMessage=t.SetCameraSuccessMessage=t.DeviceNotFoundErrorMessage=t.ReadyMessage=t.UneeqMessageType=void 0,function(e){e.Ready="Ready",e.DeviceNotFoundError="DeviceNotFoundError",e.SetCameraSuccess="SetCameraSuccess",e.SetMicSuccess="SetMicSuccess",e.SetSpeakerSuccess="SetSpeakerSuccess",e.SessionPaused="SessionPaused",e.SessionResumed="SessionResumed",e.SessionEnded="SessionEnded",e.AvatarAvailable="AvatarAvailable",e.AvatarUnavailable="AvatarUnavailable",e.ConnectionLost="ConnectionLost",e.ResumeSessionUnavailable="ResumeSessionUnavailable",e.ServiceUnavailable="ServiceUnavailable",e.OnlineStatusUpdate="OnlineStatusUpdate",e.MicActivityNotSupported="MicActivityNotSupported",e.VoiceActivityInputModeNotSupported="VoiceActivityInputModeNotSupported",e.MicActivityError="MicActivityError",e.MicActivity="MicActivity",e.DeviceError="DeviceError",e.DeviceListUpdated="DeviceListUpdated",e.AvatarAnswer="AvatarAnswer",e.AvatarAnswerContent="AvatarAnswerContent",e.Instructions="Instructions",e.StartedSpeaking="StartedSpeaking",e.FinishedSpeaking="FinishedSpeaking",e.AvatarTextInputFinished="AvatarTextInputFinished",e.AvatarQuestionText="AvatarQuestionText",e.DevicePermissionAllowed="DevicePermissionAllowed",e.RecordingStarted="RecordingStarted",e.RecordingStopped="RecordingStopped",e.Warning="Warning",e.SessionLive="SessionLive",e.WebRtcData="WebRtcData",e.WebRtcStats="WebRtcStats",e.SessionError="SessionError",e.SessionInfo="SessionInfo",e.AvatarRequestCompleted="AvatarRequestCompleted",e.AvatarRequestIgnored="AvatarRequestIgnored",e.ClientMediaStreamUpdate="ClientMediaStreamUpdate",e.ClientPerformanceMessage="ClientPerformanceMessage",e.DigitalHumanVideoError="DigitalHumanVideoError",e.DigitalHumanFailedToPlay="DigitalHumanFailedToPlay",e.DigitalHumanPlayedInMutedModeSuccess="DigitalHumanPlayedInMutedModeSuccess",e.DigitalHumanUnmuted="DigitalHumanUnmuted"}(r=t.UneeqMessageType||(t.UneeqMessageType={})),t.ReadyMessage=class{constructor(){this.uneeqMessageType=r.Ready}},t.DeviceNotFoundErrorMessage=class{constructor(e,t){this.msg=e,this.deviceId=t,this.uneeqMessageType=r.DeviceNotFoundError}},t.SetCameraSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetCameraSuccess}},t.SetMicSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetMicSuccess}},t.SetSpeakerSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetSpeakerSuccess}},t.DeviceErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.DeviceError}},t.DeviceListUpdatedMessage=class{constructor(e){this.devices=e,this.uneeqMessageType=r.DeviceListUpdated}},t.SessionPausedMessage=class{constructor(){this.uneeqMessageType=r.SessionPaused}},t.SessionResumedMessage=class{constructor(){this.uneeqMessageType=r.SessionResumed}},t.SessionEndedMessage=class{constructor(){this.uneeqMessageType=r.SessionEnded}},t.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarAvailable}},t.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarUnavailable}},t.ServiceUnavailableMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.ServiceUnavailable}},t.MicActivityErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.MicActivityError}},t.MicActivityMessage=class{constructor(e){this.level=e,this.uneeqMessageType=r.MicActivity}},t.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.MicActivityNotSupported}},t.VoiceActivityInputModeNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.VoiceActivityInputModeNotSupported}},t.ConnectionLostMessage=class{constructor(e){this.connectionState=e,this.uneeqMessageType=r.ConnectionLost}},t.ResumeSessionUnavailable=class{constructor(){this.uneeqMessageType=r.ResumeSessionUnavailable}},t.AvatarAnswerMessage=class{constructor(e,t,n,i){this.answer=e,this.answerAvatar=t,this.answerSpeech=n,this.transcriptId=i,this.uneeqMessageType=r.AvatarAnswer}},t.AvatarAnswerContentMessage=class{constructor(e,t,n=!1){this.content=e,this.transcriptId=t,this.hasDisplayHtml=n,this.uneeqMessageType=r.AvatarAnswerContent}},t.InstructionsMessage=class{constructor(e){this.instructions=e,this.uneeqMessageType=r.Instructions}},t.AvatarQuestionMessage=class{constructor(e,t){this.question=e,this.transcriptId=t,this.uneeqMessageType=r.AvatarQuestionText}},t.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.StartedSpeaking}},t.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.FinishedSpeaking}},t.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=r.AvatarTextInputFinished}},t.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=r.DevicePermissionAllowed}},t.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStarted}},t.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStopped}},t.WarningMessage=class{constructor(e){this.msg=e,this.uneeqMessageType=r.Warning}},t.SessionLiveMessage=class{constructor(e,t){this.showLogo=e,this.sessionResumed=t,this.uneeqMessageType=r.SessionLive}},t.WebRtcDataMessage=class{constructor(e){this.data=e,this.uneeqMessageType=r.WebRtcData}},t.WebRtcStatsMessage=class{constructor(e){this.stats=e,this.uneeqMessageType=r.WebRtcStats}},t.SessionErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.SessionError}},t.AvatarRequestCompleted=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestCompleted}},t.AvatarRequestIgnored=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestIgnored}},t.SessionInfoMessage=class{constructor(e){this.info=e,this.uneeqMessageType=r.SessionInfo}},t.OnlineStatusUpdateMessage=class{constructor(e){this.online=e,this.uneeqMessageType=r.OnlineStatusUpdate}},t.ClientMediaStreamUpdateMessage=class{constructor(e,t,n,i){this.clientStreamingAudio=e,this.clientStreamingVideo=t,this.serverStreamingAudio=n,this.serverStreamingVideo=i,this.uneeqMessageType=r.ClientMediaStreamUpdate}},t.ClientPerformanceMessage=class{constructor(e){this.clientPerformance=e,this.uneeqMessageType=r.ClientPerformanceMessage}},t.DigitalHumanVideoError=class{constructor(e){this.error=e,this.uneeqMessageType=r.DigitalHumanVideoError}},t.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."}},t.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."}},t.DigitalHumanUnmuted=class{constructor(){this.uneeqMessageType=r.DigitalHumanUnmuted}}},7636:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SessionType=void 0,(r=t.SessionType||(t.SessionType={}))[r.WEB=0]="WEB"},7563:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PublishSubscribeState=void 0,(r=t.PublishSubscribeState||(t.PublishSubscribeState={})).DISCONNECTED="DISCONNECTED",r.CONNECTING="CONNECTING",r.CONNECTED="CONNECTED",r.FAILED="FAILED"},9794:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SourceApp=void 0,(r=t.SourceApp||(t.SourceApp={})).HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",r.SHOWCASE="SHOWCASE",r.SPLIT_SCREEN="SPLIT_SCREEN",r.INTERACTIONS="INTERACTIONS",r.UNKNOWN="UNKNOWN"},608:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputMode=void 0,(r=t.VoiceInputMode||(t.VoiceInputMode={})).PUSH_TO_TALK="PUSH_TO_TALK",r.VOICE_ACTIVITY="VOICE_ACTIVITY",r.SPEECH_RECOGNITION="SPEECH_RECOGNITION"},6123:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Uneeq=void 0;const o=r(2872),s=r(4857),a=i(r(4147)),u=r(1181),c=r(1546),l=r(6886),f=r(7789),h=r(7501),d=r(4887),p=r(8957),v=r(2694),m=r(6400),g=r(4050),y=r(8591),b=r(1116),_=r(39),w=r(4333),S=r(8512),E=r(7636),T=r(7563),O=r(9794),C=r(608);t.Uneeq=class{constructor(e){this.ready=new o.BehaviorSubject(!1),this.version=a.default.version,this.messages=new o.Subject,this.internalMessages$=new o.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,this.sessionWasResumed=!1,this.uneeqLocalStorage=new _.UneeqLocalStorage,h.logger.enabled=e.logging||!1,this.options=e,this.options.diagnostics=e.diagnostics||!1,this.options.micActivityMessages=e.micActivityMessages||!1,this.options.sendLocalVideo=void 0===e.sendLocalVideo||e.sendLocalVideo,this.options.sendLocalAudio=void 0===e.sendLocalAudio||e.sendLocalAudio,this.options.enableClientPerformanceMessage=e.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=e.enableTransparentBackground||!1,this.options.backgroundImageUrl=e.backgroundImageUrl||"",this.options.nameTagImageUrl=e.nameTagImageUrl||"",this.options.speechToTextLocales=f.LocaleDetector.validateOrDetectSpeechLocales(e),this.checkIfResumeSessionIsAvailable(),this.options.voiceInputMode=e.voiceInputMode||C.VoiceInputMode.PUSH_TO_TALK,this.api=new u.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:E.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 b.StreamManager,this.initDigitalHumanVideoElement(),this.metricsService=new v.MetricsService(this.options,this.internalMessages$,this.messages),this.dhVideoPlayManager=new l.DigitalHumanVideoPlayManager(this.messages,(()=>{this.unmuteDigitalHuman()}))}get sessionId(){return this.session?this.session.id:null}setLoggerEnabled(e){h.logger.enabled=e}init(){this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then((e=>{this.session=e,this.initialize()})).catch((e=>{this.sendServiceUnavailableMessage(e)}))}initWithToken(e){return n(this,void 0,void 0,(function*(){this.startSessionTime=Date.now();try{const t=y.ResumeSessionCheck.validate(this.options);!0===t.resumeSession&&(this.startSessionData.resumeSessionId=t.resumeSessionId),this.startSessionData.tokenId=e,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."),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionId",this.session.id),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionPersonaId",this.options.conversationId),this.session.sourceApp=O.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:O.SourceApp.UNKNOWN,this.initialize()}catch(e){this.sendServiceUnavailableMessage(e)}}))}setCamera(e){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(e)}setMic(e){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(e)}setSpeaker(e){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(e)}setVoiceInputMode(e){this.serviceReadyCheck("setVoiceInputMode")&&this.voiceInputManager.setVoiceInputMode(e)}enableMicrophone(e=!0){this.deviceManager&&this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,e)}enableCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,this.options.sendLocalAudio)}enableMicrophoneAndCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,e)}sendTranscript(e){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(e))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to startRecording() will be ignored. Session is paused.")):this.voiceInputManager.startRecording())}stopRecording(){this.serviceReadyCheck("stopRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.voiceInputManager.stopRecording())}stopSpeaking(){return this.api.avatarStopSpeaking()}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new S.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new S.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new S.SessionResumedMessage),!0):(this.messages.next(new S.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(e){return this.api.setAvatarDebug(e)}playWelcomeMessage(){return this.api.avatarWelcome()}unmuteDigitalHuman(){this.voiceInputManager.resumeAudioContext(),this.dhVideoPlayManager.unmuteVideo()}initDigitalHumanVideoElement(){const e=document.createElement("video");this.digitalHumanVideoElement=e,e.volume=1,e.controls=!1,e.autoplay=!1,e.setAttribute("playsinline","true"),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.play().catch((e=>{h.logger.log("UneeQ: Failed to play digital human video. Play() will be re-attempted when stream is ready.",e)}))}gatherWebRtcMetrics(){var e;null===(e=this.deviceManager)||void 0===e||e.mediaHandler.gatherWebRTCStats(((e,t)=>{this.metricsService.parseAndLogWebRtcStats(t)})),setTimeout((()=>{this.gatherWebRtcMetrics()}),5e3)}initMessaging(){this.messages.subscribe((e=>this.messageCallback(e))),this.messaging.state$.pipe(s.filter((e=>e===p.MessagingState.CONNECTED))).subscribe((()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new S.ReadyMessage),this.gatherWebRtcMetrics()})),this.messaging.messages$.subscribe((e=>this.internalMessages$.next(JSON.parse(e.body)))),this.messageHandler=new d.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe((e=>{h.logger.log("-- Msg -- ",e)}))}initDeviceManager(){this.voiceInputManager=new w.VoiceInputManager(this.options,this.api,this.messages,(e=>{this.enableMicrophone(e)})),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,digitalHumanVideoElement:this.digitalHumanVideoElement},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new S.SessionLiveMessage(this.session.showUneeqLogo||!1,this.sessionWasResumed)),this.options.playWelcome&&this.api.avatarWelcome();const e={type:g.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.sessionStarted=!0}}initAvatar(){this.ready.pipe(s.filter(Boolean),s.take(1)).subscribe((()=>{this.internalMessages$.pipe(s.filter((e=>"DevicePermissionAllowedInternal"===e.faceMeMessageType)),s.take(1)).subscribe((e=>{this.messages.next(new S.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()})),this.initDeviceManager()})),this.internalMessages$.pipe(s.filter((e=>"sessionLive"===e.faceMeMessageType)),s.take(1)).subscribe((e=>this.sessionLiveHandler())),this.internalMessages$.pipe(s.filter((e=>"sessionEnd"===e.faceMeMessageType))).subscribe((()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new S.SessionEndedMessage),this.messaging.disconnect()})),this.internalMessages$.pipe(s.filter((e=>"remoteVideoReadyToPlay"===e.faceMeMessageType))).subscribe((e=>{this.dhVideoPlayManager.play(this.deviceManager.mediaHandler.avatarVideoElement)}))}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then((e=>{if(e.available>0){const e={type:g.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new S.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground,resumeSession:this.sessionWasResumed,backgroundImageUrl:this.options.backgroundImageUrl,nameTagImageUrl:this.options.nameTagImageUrl,speechToTextLocales:this.options.speechToTextLocales}).catch((e=>{console.error("UneeQ: Digital human could not be started. Clearing resumeSession token and ending process.",e),this.uneeqLocalStorage.removeItemSafely("uneeqResumeSessionId")}))}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new S.AvatarUnavailableMessage)),setTimeout((()=>{this.startAvatarWhenAvailable()}),1e3)}))}initialize(){if(this.session){this.initPromMetricsListener(),this.api.callId=this.session.id,this.initAvatar();const e={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new S.ConnectionLostMessage(T.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new p.MessagingService(this.options.url+"/api/messaging",e),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(e){const t=new S.ServiceUnavailableMessage(e);this.messages.next(t),this.messageCallback(t)}serviceReadyCheck(e){return!!this.ready.value||(this.messages.next(new S.WarningMessage("Call to "+e+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.mediaDevices.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new m.OnlineStatusService(this.messages,(()=>{this.messages.next(new S.ConnectionLostMessage(T.PublishSubscribeState.DISCONNECTED)),this.endSession()}))}initPromMetricsListener(){const e=new g.Prom(this.options.url);this.internalMessages$.pipe(s.filter((e=>"prom"===e.faceMeMessageType))).subscribe((t=>{e.handleMessage(t.promMsg)}))}checkIfResumeSessionIsAvailable(){!0!==this.options.resumeSession||this.uneeqLocalStorage.available||(console.warn("UneeQ: Resuming session is unavailable in this browser because localStorage is not allowed."),this.messages.next(new S.ResumeSessionUnavailable),this.options.resumeSession=!1)}}},4927:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},835:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ce});var n={};r.r(n),r.d(n,{fixNegotiationNeeded:()=>M,shimAddTrackRemoveTrack:()=>P,shimAddTrackRemoveTrackWithNative:()=>x,shimGetDisplayMedia:()=>w,shimGetSendersWithDtmf:()=>T,shimGetStats:()=>O,shimGetUserMedia:()=>_,shimMediaStream:()=>S,shimOnTrack:()=>E,shimPeerConnection:()=>R,shimSenderReceiverGetStats:()=>C});var i={};r.r(i),r.d(i,{shimAddTransceiver:()=>U,shimCreateAnswer:()=>V,shimCreateOffer:()=>W,shimGetDisplayMedia:()=>j,shimGetParameters:()=>B,shimGetUserMedia:()=>A,shimOnTrack:()=>k,shimPeerConnection:()=>I,shimRTCDataChannel:()=>F,shimReceiverGetStats:()=>N,shimRemoveStream:()=>L,shimSenderGetStats:()=>D});var o={};r.r(o),r.d(o,{shimAudioContext:()=>J,shimCallbacksAPI:()=>H,shimConstraints:()=>$,shimCreateOfferLegacy:()=>X,shimGetUserMedia:()=>G,shimLocalStreamsAPI:()=>q,shimRTCIceServerUrls:()=>Y,shimRemoteStreamsAPI:()=>z,shimTrackEventTransceiver:()=>K});var s={};r.r(s),r.d(s,{removeExtmapAllowMixed:()=>oe,shimAddIceCandidateNullOrEmpty:()=>se,shimConnectionState:()=>ie,shimMaxMessageSize:()=>re,shimParameterlessSetLocalDescription:()=>ae,shimRTCIceCandidate:()=>ee,shimRTCIceCandidateRelayProtocol:()=>te,shimSendThrowTypeError:()=>ne});let a=!0,u=!0;function c(e,t,r){const n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function l(e,t,r){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),i.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(r))return o.apply(this,arguments);const n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function f(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function h(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(u=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function d(){if("object"==typeof window){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function p(e,t){u&&console.warn(e+" is deprecated, please use "+t+" instead.")}function v(e){return"[object Object]"===Object.prototype.toString.call(e)}function m(e){return v(e)?Object.keys(e).reduce((function(t,r){const n=v(e[r]),i=n?m(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function g(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?g(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{g(e,e.get(t),r)}))})))}function y(e,t,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((r=>{r.type===n&&r.trackId===t.id&&g(e,r,i)}))})),i}const b=d;function _(e,t){const r=e&&e.navigator;if(!r.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[i("min",r)]=n.ideal,t.optional.push(e),e={},e[i("max",r)]=n.ideal,t.optional.push(e)):(e[i("",r)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return r.mediaDevices.enumerateDevices().then((r=>{let s=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!s&&r.length&&t.includes("back")&&(s=r[r.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=n(e.video),b("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return b("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(e,t,n){i(e,(e=>{r.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){const e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(t){return i(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(o(e))))))}}}function w(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((t=>{const n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function S(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function E(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else l(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function T(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.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 O(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,n]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach((e=>{const r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{r[t]=e.stat(t)})),t[r.id]=r})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){r(o(i(e)))};return t.apply(this,[n,e])}return new Promise(((e,r)=>{t.apply(this,[function(t){e(o(i(t)))},r])})).then(r,n)}}function C(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,r,n;return this.getSenders().forEach((r=>{r.track===e&&(t?n=!0:t=r)})),this.getReceivers().forEach((t=>(t.track===e&&(r?n=!0:r=t),t.track===e))),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function x(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();r.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const r=this._shimmedLocalStreams[t].indexOf(e);-1!==r&&this._shimmedLocalStreams[t].splice(r,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function P(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return x(e);const r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=r.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}n.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((e=>e.track===t)))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[r.id];if(i)i.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[t=>{const r=o(this,t);e[0].apply(null,[r])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):r.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})}(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=a.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((r=>{this._streams[r].getTracks().find((t=>e.track===t))&&(t=this._streams[r])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function R(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function M(e,t){l(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}function A(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){p("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const e=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),e(r.audio,"autoGainControl","mozAutoGainControl"),e(r.audio,"noiseSuppression","mozNoiseSuppression")),t(r)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const r=t.apply(this,arguments);return e(r,"mozAutoGainControl","autoGainControl"),e(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),e(r,"autoGainControl","mozAutoGainControl"),e(r,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[r])}}}}function j(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}function k(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function I(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,o)}}function D(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function N(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function L(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){p("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function F(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function U(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const r=e.length>0;r&&e.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=t.apply(this,arguments);if(r){const{sender:t}=n,r=t.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(r).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function B(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function W(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function V(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function q(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((r=>t.call(this,r,e))),e.getVideoTracks().forEach((r=>t.call(this,r,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...r){return r&&r.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const r=e.getTracks();this.getSenders().forEach((e=>{r.includes(e.track)&&this.removeTrack(e)}))})}}function z(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}))}),t.apply(e,arguments)}}}function H(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i};let a=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=a,a=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=a,a=function(e,t,r){const n=s.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=a}function G(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,r=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>r($(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function $(e){return e&&void 0!==e.video?Object.assign({},e,{video:m(e.video)}):e}function Y(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;r<e.iceServers.length;r++){let n=e.iceServers[r];void 0===n.urls&&n.url?(p("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[r])}e.iceServers=t}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function K(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function X(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const r=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function J(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Z=r(7539),Q=r.n(Z);function ee(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){const r=new t(e),n=Q().parseCandidate(e.candidate);for(const e in n)e in r||Object.defineProperty(r,e,{value:n[e]});return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,l(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function te(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||l(e,"icecandidate",(e=>{if(e.candidate){const t=Q().parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function re(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;const t=Q().splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Q().parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){const e=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const r=parseInt(t[1],10);return r!=r?-1:r}(arguments[0]),r=function(e){let r=65536;return"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r}(e),n=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=Q().matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substring(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n}(arguments[0],e);let i;i=0===r&&0===n?Number.POSITIVE_INFINITY:0===r||0===n?Math.max(r,n):Math.min(r,n);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>i}),this._sctp=o}return r.apply(this,arguments)}}function ne(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const r=e.send;e.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return t(e,this),e},l(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function ie(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function oe(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const r=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:r}):t.sdp=r}return r.apply(this,arguments)}}function se(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ae(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return r.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}return e.sdp||"offer"!==e.type&&"answer"!==e.type?r.apply(this,[e]):("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then((e=>r.apply(this,[e])))})}const ue=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=d,a=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator||!e.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=c(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=c(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=c(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),u={browserDetails:a,commonShim:s,extractVersion:c,disableLog:f,disableWarnings:h,sdp:Z};switch(a.browser){case"chrome":if(!n||!R||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),u;if(null===a.version)return r("Chrome shim can not determine version, not shimming."),u;r("adapter.js shimming chrome."),u.browserShim=n,se(e,a),ae(e),_(e,a),S(e),R(e,a),E(e),P(e,a),T(e),O(e),C(e),M(e,a),ee(e),te(e),ie(e),re(e,a),ne(e),oe(e,a);break;case"firefox":if(!i||!I||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),u;r("adapter.js shimming firefox."),u.browserShim=i,se(e,a),ae(e),A(e,a),I(e,a),k(e),L(e),D(e),N(e),F(e),U(e),B(e),W(e),V(e),ee(e),ie(e),re(e,a),ne(e);break;case"safari":if(!o||!t.shimSafari)return r("Safari shim is not included in this adapter release."),u;r("adapter.js shimming safari."),u.browserShim=o,se(e,a),ae(e),Y(e),X(e),H(e),q(e),z(e),K(e),G(e),J(e),ee(e),te(e),re(e,a),ne(e),oe(e,a);break;default:r("Unsupported browser!")}return u}({window:"undefined"==typeof window?void 0:window}),ce=ue},2361:()=>{},4616:()=>{},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"uneeq-js","version":"2.46.6","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"npx karma start karma.conf.js -logLevel=DEBUG","test":"npx 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":"npx tslint -p tsconfig.json --fix","docs":"npx 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":"^7.8.1","rxjs-compat":"^6.6.7","simple-peer":"^9.11.1","webrtc-adapter":"^8.2.3"},"devDependencies":{"@types/dom-mediacapture-record":"^1.0.16","@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.5.4","karma-typescript-es6-transform":"^5.0.0","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^9.4.4","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":"^5.88.2","webpack-cli":"^5.1.4"}}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n=r(3607),i=exports;for(var o in n)i[o]=n[o];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
|